UNPKG

@nu-art/file-upload

Version:

File Uploader - Express & Typescript based backend framework

50 lines (49 loc) 2.04 kB
"use strict"; /* * Permissions management system, define access level for each of * your server apis, and restrict users by giving them access levels * * Copyright (C) 2020 Adam van der Kruk aka TacB0sS * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ Object.defineProperty(exports, "__esModule", { value: true }); exports.ModuleBE_AssetUploader = exports.ModuleBE_AssetUploader_Class = void 0; const ModuleBase_AssetUploader_1 = require("../../shared/modules/ModuleBase_AssetUploader"); const backend_1 = require("@nu-art/thunderstorm/backend"); const shared_1 = require("../shared"); class ModuleBE_AssetUploader_Class extends ModuleBase_AssetUploader_1.ModuleBase_AssetUploader { constructor() { super(); this.vv1 = { getUploadUrl: (0, backend_1.apiWithBodyAxios)(shared_1.ApiDef_AssetUploader.vv1.getUploadUrl), processAssetManually: (0, backend_1.apiWithQueryAxios)(shared_1.ApiDef_AssetUploader.vv1.processAssetManually), }; } init() { super.init(); backend_1.AxiosHttpModule.setRequestOption(this.config.requestConfig); } createRequest(uploadFile) { return backend_1.AxiosHttpModule.createRequest(uploadFile); } upload(files) { return this.uploadImpl(files); } async subscribeToPush(toSubscribe) { // Not sure now // We said timeout } } exports.ModuleBE_AssetUploader_Class = ModuleBE_AssetUploader_Class; exports.ModuleBE_AssetUploader = new ModuleBE_AssetUploader_Class();