@nu-art/file-upload
Version:
File Uploader - Express & Typescript based backend framework
46 lines • 1.84 kB
JavaScript
/*
* 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.
*/
import { ModuleBase_AssetUploader, } from '../../shared/modules/ModuleBase_AssetUploader.js';
import { apiWithBodyAxios, apiWithQueryAxios, AxiosHttpModule } from '@nu-art/thunderstorm/backend/index';
import { ApiDef_AssetUploader } from '../shared.js';
export class ModuleBE_AssetUploader_Class extends ModuleBase_AssetUploader {
constructor() {
super();
this.vv1 = {
getUploadUrl: apiWithBodyAxios(ApiDef_AssetUploader.vv1.getUploadUrl),
processAssetManually: apiWithQueryAxios(ApiDef_AssetUploader.vv1.processAssetManually),
};
}
init() {
super.init();
AxiosHttpModule.setRequestOption(this.config.requestConfig);
}
createRequest(uploadFile) {
return AxiosHttpModule.createRequest(uploadFile);
}
upload(files) {
return this.uploadImpl(files);
}
async subscribeToPush(toSubscribe) {
// Not sure now
// We said timeout
}
}
export const ModuleBE_AssetUploader = new ModuleBE_AssetUploader_Class();
//# sourceMappingURL=ModuleBE_AssetUploader.js.map