@flusys/nestjs-storage 7.1.0 → 8.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/config/index.d.ts +3 -3
- package/controllers/file-manager.controller.d.ts +4 -4
- package/controllers/folder.controller.d.ts +2 -2
- package/controllers/index.d.ts +4 -4
- package/controllers/storage-config.controller.d.ts +2 -2
- package/controllers/upload.controller.d.ts +3 -3
- package/docs/index.d.ts +1 -1
- package/docs/storage-swagger.config.d.ts +2 -2
- package/dtos/index.d.ts +4 -4
- package/entities/file-manager-with-company.entity.d.ts +2 -2
- package/entities/file-manager.entity.d.ts +1 -1
- package/entities/folder-with-company.entity.d.ts +1 -1
- package/entities/index.d.ts +15 -15
- package/entities/storage-config-with-company.entity.d.ts +1 -1
- package/enums/index.d.ts +1 -1
- package/fesm/493.js +2768 -0
- package/fesm/537.js +1157 -0
- package/fesm/562.js +786 -0
- package/fesm/{providers/azure-provider.optional.js → chunks/190.js} +33 -30
- package/fesm/chunks/252.js +12 -0
- package/fesm/chunks/327.js +12 -0
- package/fesm/chunks/385.js +12 -0
- package/fesm/{providers/s3-provider.optional.js → chunks/591.js} +37 -34
- package/fesm/chunks/746.js +12 -0
- package/fesm/chunks/798.js +12 -0
- package/fesm/{providers/sftp-provider.optional.js → chunks/918.js} +35 -31
- package/fesm/config/index.js +119 -3
- package/fesm/controllers/index.js +16 -4
- package/fesm/docs/index.js +206 -1
- package/fesm/dtos/index.js +879 -4
- package/fesm/entities/index.js +463 -18
- package/fesm/enums/index.js +36 -1
- package/fesm/index.js +398 -12
- package/fesm/interfaces/index.js +19 -5
- package/fesm/modules/index.js +16 -1
- package/fesm/providers/index.js +364 -3
- package/fesm/runtime.js +252 -0
- package/fesm/services/index.js +16 -6
- package/fesm/utils/index.js +149 -1
- package/index.d.ts +11 -11
- package/interfaces/file-manager.interface.d.ts +1 -1
- package/interfaces/folder.interface.d.ts +1 -1
- package/interfaces/index.d.ts +5 -5
- package/interfaces/storage-config.interface.d.ts +1 -1
- package/interfaces/storage-module-options.interface.d.ts +3 -3
- package/interfaces/storage-provider.interface.d.ts +1 -1
- package/middlewares/file-serve.middleware.d.ts +4 -3
- package/middlewares/index.d.ts +1 -1
- package/modules/index.d.ts +1 -1
- package/modules/storage.module.d.ts +2 -2
- package/package.json +30 -41
- package/providers/azure-provider.optional.d.ts +2 -2
- package/providers/index.d.ts +3 -3
- package/providers/local-provider.d.ts +2 -2
- package/providers/s3-provider.optional.d.ts +2 -2
- package/providers/sftp-provider.optional.d.ts +2 -2
- package/providers/storage-factory.service.d.ts +3 -3
- package/providers/storage-provider.registry.d.ts +2 -2
- package/services/file-manager.service.d.ts +9 -8
- package/services/folder.service.d.ts +6 -6
- package/services/index.d.ts +6 -6
- package/services/storage-config.service.d.ts +3 -3
- package/services/storage-datasource.provider.d.ts +3 -3
- package/services/storage-provider-config.service.d.ts +7 -7
- package/services/upload.service.d.ts +6 -6
- package/utils/image-compressor.util.d.ts +1 -1
- package/utils/index.d.ts +1 -1
- package/cjs/config/event-actions.js +0 -34
- package/cjs/config/index.js +0 -20
- package/cjs/config/message-keys.js +0 -46
- package/cjs/config/storage.constants.js +0 -28
- package/cjs/controllers/file-manager.controller.js +0 -152
- package/cjs/controllers/file-manager.controller.spec.js +0 -135
- package/cjs/controllers/folder.controller.js +0 -102
- package/cjs/controllers/folder.controller.spec.js +0 -86
- package/cjs/controllers/index.js +0 -21
- package/cjs/controllers/storage-config.controller.js +0 -102
- package/cjs/controllers/storage-config.controller.spec.js +0 -85
- package/cjs/controllers/upload.controller.js +0 -234
- package/cjs/controllers/upload.controller.spec.js +0 -132
- package/cjs/docs/index.js +0 -11
- package/cjs/docs/storage-swagger.config.js +0 -188
- package/cjs/docs/storage-swagger.config.spec.js +0 -72
- package/cjs/dtos/file-manager.dto.js +0 -327
- package/cjs/dtos/folder.dto.js +0 -105
- package/cjs/dtos/index.js +0 -21
- package/cjs/dtos/storage-config.dto.js +0 -170
- package/cjs/dtos/upload.dto.js +0 -272
- package/cjs/entities/file-manager-with-company.entity.js +0 -61
- package/cjs/entities/file-manager.entity.js +0 -122
- package/cjs/entities/folder-with-company.entity.js +0 -55
- package/cjs/entities/folder.entity.js +0 -64
- package/cjs/entities/index.js +0 -63
- package/cjs/entities/index.spec.js +0 -18
- package/cjs/entities/storage-config-with-company.entity.js +0 -51
- package/cjs/entities/storage-config.entity.js +0 -96
- package/cjs/enums/file-location.enum.js +0 -17
- package/cjs/enums/index.js +0 -18
- package/cjs/index.js +0 -29
- package/cjs/interfaces/file-manager.interface.js +0 -4
- package/cjs/interfaces/folder.interface.js +0 -4
- package/cjs/interfaces/index.js +0 -22
- package/cjs/interfaces/storage-config.interface.js +0 -4
- package/cjs/interfaces/storage-module-options.interface.js +0 -4
- package/cjs/interfaces/storage-provider.interface.js +0 -4
- package/cjs/middlewares/file-serve.middleware.js +0 -241
- package/cjs/middlewares/file-serve.middleware.spec.js +0 -211
- package/cjs/middlewares/index.js +0 -18
- package/cjs/modules/index.js +0 -18
- package/cjs/modules/storage.module.js +0 -165
- package/cjs/modules/storage.module.spec.js +0 -184
- package/cjs/providers/azure-provider.optional.js +0 -155
- package/cjs/providers/azure-provider.optional.spec.js +0 -228
- package/cjs/providers/index.js +0 -26
- package/cjs/providers/local-provider.js +0 -230
- package/cjs/providers/local-provider.spec.js +0 -239
- package/cjs/providers/s3-provider.optional.js +0 -175
- package/cjs/providers/s3-provider.optional.spec.js +0 -243
- package/cjs/providers/sftp-provider.optional.js +0 -203
- package/cjs/providers/sftp-provider.optional.spec.js +0 -217
- package/cjs/providers/storage-factory.service.js +0 -175
- package/cjs/providers/storage-factory.service.spec.js +0 -253
- package/cjs/providers/storage-provider.registry.js +0 -41
- package/cjs/providers/storage-provider.registry.spec.js +0 -67
- package/cjs/services/file-manager.service.js +0 -387
- package/cjs/services/file-manager.service.spec.js +0 -580
- package/cjs/services/folder.service.js +0 -101
- package/cjs/services/folder.service.spec.js +0 -167
- package/cjs/services/index.js +0 -23
- package/cjs/services/storage-config.service.js +0 -129
- package/cjs/services/storage-config.service.spec.js +0 -257
- package/cjs/services/storage-datasource.provider.js +0 -137
- package/cjs/services/storage-datasource.provider.spec.js +0 -217
- package/cjs/services/storage-provider-config.service.js +0 -171
- package/cjs/services/storage-provider-config.service.spec.js +0 -265
- package/cjs/services/upload.service.js +0 -376
- package/cjs/services/upload.service.spec.js +0 -426
- package/cjs/utils/file-validator.util.js +0 -440
- package/cjs/utils/file-validator.util.spec.js +0 -259
- package/cjs/utils/image-compressor.util.js +0 -162
- package/cjs/utils/image-compressor.util.spec.js +0 -166
- package/cjs/utils/index.js +0 -18
- package/fesm/config/event-actions.js +0 -13
- package/fesm/config/message-keys.js +0 -22
- package/fesm/config/storage.constants.js +0 -7
- package/fesm/controllers/file-manager.controller.js +0 -142
- package/fesm/controllers/file-manager.controller.spec.js +0 -131
- package/fesm/controllers/folder.controller.js +0 -92
- package/fesm/controllers/folder.controller.spec.js +0 -82
- package/fesm/controllers/storage-config.controller.js +0 -92
- package/fesm/controllers/storage-config.controller.spec.js +0 -81
- package/fesm/controllers/upload.controller.js +0 -224
- package/fesm/controllers/upload.controller.spec.js +0 -128
- package/fesm/docs/storage-swagger.config.js +0 -181
- package/fesm/docs/storage-swagger.config.spec.js +0 -68
- package/fesm/dtos/file-manager.dto.js +0 -300
- package/fesm/dtos/folder.dto.js +0 -84
- package/fesm/dtos/storage-config.dto.js +0 -149
- package/fesm/dtos/upload.dto.js +0 -245
- package/fesm/entities/file-manager-with-company.entity.js +0 -51
- package/fesm/entities/file-manager.entity.js +0 -112
- package/fesm/entities/folder-with-company.entity.js +0 -45
- package/fesm/entities/folder.entity.js +0 -54
- package/fesm/entities/index.spec.js +0 -14
- package/fesm/entities/storage-config-with-company.entity.js +0 -41
- package/fesm/entities/storage-config.entity.js +0 -86
- package/fesm/enums/file-location.enum.js +0 -7
- package/fesm/interfaces/file-manager.interface.js +0 -1
- package/fesm/interfaces/folder.interface.js +0 -1
- package/fesm/interfaces/storage-config.interface.js +0 -1
- package/fesm/interfaces/storage-module-options.interface.js +0 -3
- package/fesm/interfaces/storage-provider.interface.js +0 -4
- package/fesm/middlewares/file-serve.middleware.js +0 -190
- package/fesm/middlewares/file-serve.middleware.spec.js +0 -207
- package/fesm/middlewares/index.js +0 -1
- package/fesm/modules/storage.module.js +0 -156
- package/fesm/modules/storage.module.spec.js +0 -180
- package/fesm/providers/azure-provider.optional.spec.js +0 -224
- package/fesm/providers/local-provider.js +0 -182
- package/fesm/providers/local-provider.spec.js +0 -194
- package/fesm/providers/s3-provider.optional.spec.js +0 -239
- package/fesm/providers/sftp-provider.optional.spec.js +0 -213
- package/fesm/providers/storage-factory.service.js +0 -124
- package/fesm/providers/storage-factory.service.spec.js +0 -249
- package/fesm/providers/storage-provider.registry.js +0 -34
- package/fesm/providers/storage-provider.registry.spec.js +0 -63
- package/fesm/services/file-manager.service.js +0 -336
- package/fesm/services/file-manager.service.spec.js +0 -576
- package/fesm/services/folder.service.js +0 -91
- package/fesm/services/folder.service.spec.js +0 -163
- package/fesm/services/storage-config.service.js +0 -119
- package/fesm/services/storage-config.service.spec.js +0 -253
- package/fesm/services/storage-datasource.provider.js +0 -86
- package/fesm/services/storage-datasource.provider.spec.js +0 -172
- package/fesm/services/storage-provider-config.service.js +0 -161
- package/fesm/services/storage-provider-config.service.spec.js +0 -261
- package/fesm/services/upload.service.js +0 -366
- package/fesm/services/upload.service.spec.js +0 -422
- package/fesm/utils/file-validator.util.js +0 -433
- package/fesm/utils/file-validator.util.spec.js +0 -255
- package/fesm/utils/image-compressor.util.js +0 -114
- package/fesm/utils/image-compressor.util.spec.js +0 -162
|
@@ -1,265 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
const _testing = require("@nestjs/testing");
|
|
6
|
-
const _modules = require("@flusys/nestjs-shared/modules");
|
|
7
|
-
const _repositorymock = require("@test-utils/mocks/repository.mock");
|
|
8
|
-
const _loggedusermock = require("@test-utils/mocks/logged-user.mock");
|
|
9
|
-
const _storageproviderconfigservice = require("./storage-provider-config.service");
|
|
10
|
-
const _storageconfigservice = require("./storage-config.service");
|
|
11
|
-
const _storagedatasourceprovider = require("./storage-datasource.provider");
|
|
12
|
-
const _entities = require("../entities");
|
|
13
|
-
function buildStorageConfig(overrides = {}) {
|
|
14
|
-
return {
|
|
15
|
-
id: 'config-uuid-1',
|
|
16
|
-
name: 'Default Local',
|
|
17
|
-
storage: 'local',
|
|
18
|
-
config: {
|
|
19
|
-
basePath: './uploads'
|
|
20
|
-
},
|
|
21
|
-
isActive: true,
|
|
22
|
-
isDefault: false,
|
|
23
|
-
createdAt: new Date(),
|
|
24
|
-
updatedAt: new Date(),
|
|
25
|
-
deletedAt: null,
|
|
26
|
-
createdById: null,
|
|
27
|
-
updatedById: null,
|
|
28
|
-
deletedById: null,
|
|
29
|
-
...overrides
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
describe('StorageProviderConfigService', ()=>{
|
|
33
|
-
let service;
|
|
34
|
-
let module;
|
|
35
|
-
let mockRepo;
|
|
36
|
-
let mockStorageConfig;
|
|
37
|
-
beforeEach(async ()=>{
|
|
38
|
-
mockRepo = (0, _repositorymock.createMockRepository)();
|
|
39
|
-
const mockDataSourceProvider = (0, _repositorymock.createMockDataSourceProvider)(mockRepo);
|
|
40
|
-
mockStorageConfig = {
|
|
41
|
-
isCompanyFeatureEnabled: jest.fn().mockReturnValue(false),
|
|
42
|
-
getAppUrl: jest.fn().mockReturnValue('http://localhost:2002')
|
|
43
|
-
};
|
|
44
|
-
module = await _testing.Test.createTestingModule({
|
|
45
|
-
providers: [
|
|
46
|
-
_storageproviderconfigservice.StorageProviderConfigService,
|
|
47
|
-
{
|
|
48
|
-
provide: 'CACHE_INSTANCE',
|
|
49
|
-
useValue: {}
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
provide: _modules.UtilsService,
|
|
53
|
-
useValue: {}
|
|
54
|
-
},
|
|
55
|
-
{
|
|
56
|
-
provide: _storageconfigservice.StorageConfigService,
|
|
57
|
-
useValue: mockStorageConfig
|
|
58
|
-
},
|
|
59
|
-
{
|
|
60
|
-
provide: _storagedatasourceprovider.StorageDataSourceProvider,
|
|
61
|
-
useValue: mockDataSourceProvider
|
|
62
|
-
}
|
|
63
|
-
]
|
|
64
|
-
}).compile();
|
|
65
|
-
service = await module.resolve(_storageproviderconfigservice.StorageProviderConfigService);
|
|
66
|
-
});
|
|
67
|
-
describe('entity selection', ()=>{
|
|
68
|
-
it('uses StorageConfig when the company feature is disabled', async ()=>{
|
|
69
|
-
mockStorageConfig.isCompanyFeatureEnabled.mockReturnValue(false);
|
|
70
|
-
const built = await module.resolve(_storageproviderconfigservice.StorageProviderConfigService);
|
|
71
|
-
expect(built['_entity']).toBe(_entities.StorageConfig);
|
|
72
|
-
});
|
|
73
|
-
it('uses StorageConfigWithCompany when the company feature is enabled', async ()=>{
|
|
74
|
-
mockStorageConfig.isCompanyFeatureEnabled.mockReturnValue(true);
|
|
75
|
-
const built = await module.resolve(_storageproviderconfigservice.StorageProviderConfigService);
|
|
76
|
-
expect(built['_entity']).toBe(_entities.StorageConfigWithCompany);
|
|
77
|
-
});
|
|
78
|
-
});
|
|
79
|
-
describe('convertSingleDtoToEntity', ()=>{
|
|
80
|
-
beforeEach(async ()=>{
|
|
81
|
-
mockRepo.create.mockReturnValue({});
|
|
82
|
-
await service.ensureDataSourceRepository();
|
|
83
|
-
});
|
|
84
|
-
it('does not attach companyId when the company feature is disabled', async ()=>{
|
|
85
|
-
const entity = await service.convertSingleDtoToEntity({
|
|
86
|
-
name: 'AWS S3',
|
|
87
|
-
storage: 'aws',
|
|
88
|
-
config: {}
|
|
89
|
-
}, (0, _loggedusermock.buildMockUser)());
|
|
90
|
-
expect(entity.companyId).toBeUndefined();
|
|
91
|
-
});
|
|
92
|
-
it('attaches the current user companyId when the company feature is enabled', async ()=>{
|
|
93
|
-
mockStorageConfig.isCompanyFeatureEnabled.mockReturnValue(true);
|
|
94
|
-
const entity = await service.convertSingleDtoToEntity({
|
|
95
|
-
name: 'AWS S3',
|
|
96
|
-
storage: 'aws',
|
|
97
|
-
config: {}
|
|
98
|
-
}, (0, _loggedusermock.buildMockUser)({
|
|
99
|
-
companyId: 'company-42'
|
|
100
|
-
}));
|
|
101
|
-
expect(entity.companyId).toBe('company-42');
|
|
102
|
-
});
|
|
103
|
-
it('defaults companyId to null when company feature is enabled but user has none', async ()=>{
|
|
104
|
-
mockStorageConfig.isCompanyFeatureEnabled.mockReturnValue(true);
|
|
105
|
-
const entity = await service.convertSingleDtoToEntity({
|
|
106
|
-
name: 'AWS S3',
|
|
107
|
-
storage: 'aws',
|
|
108
|
-
config: {}
|
|
109
|
-
}, null);
|
|
110
|
-
expect(entity.companyId).toBeNull();
|
|
111
|
-
});
|
|
112
|
-
});
|
|
113
|
-
describe('getSelectQuery', ()=>{
|
|
114
|
-
it('selects the default field set when none is provided', async ()=>{
|
|
115
|
-
const query = {
|
|
116
|
-
select: jest.fn().mockReturnThis()
|
|
117
|
-
};
|
|
118
|
-
await service.getSelectQuery(query, (0, _loggedusermock.buildMockUser)());
|
|
119
|
-
expect(query.select).toHaveBeenCalledWith([
|
|
120
|
-
'storageConfig.id',
|
|
121
|
-
'storageConfig.name',
|
|
122
|
-
'storageConfig.storage',
|
|
123
|
-
'storageConfig.config',
|
|
124
|
-
'storageConfig.isActive',
|
|
125
|
-
'storageConfig.isDefault',
|
|
126
|
-
'storageConfig.createdAt',
|
|
127
|
-
'storageConfig.updatedAt'
|
|
128
|
-
]);
|
|
129
|
-
});
|
|
130
|
-
it('adds companyId to the default select list when company feature is enabled', async ()=>{
|
|
131
|
-
mockStorageConfig.isCompanyFeatureEnabled.mockReturnValue(true);
|
|
132
|
-
const query = {
|
|
133
|
-
select: jest.fn().mockReturnThis()
|
|
134
|
-
};
|
|
135
|
-
await service.getSelectQuery(query, (0, _loggedusermock.buildMockUser)());
|
|
136
|
-
const selected = query.select.mock.calls[0][0];
|
|
137
|
-
expect(selected).toContain('storageConfig.companyId');
|
|
138
|
-
});
|
|
139
|
-
it('respects an explicitly provided select list', async ()=>{
|
|
140
|
-
const query = {
|
|
141
|
-
select: jest.fn().mockReturnThis()
|
|
142
|
-
};
|
|
143
|
-
await service.getSelectQuery(query, (0, _loggedusermock.buildMockUser)(), [
|
|
144
|
-
'id',
|
|
145
|
-
'name'
|
|
146
|
-
]);
|
|
147
|
-
expect(query.select).toHaveBeenCalledWith([
|
|
148
|
-
'storageConfig.id',
|
|
149
|
-
'storageConfig.name'
|
|
150
|
-
]);
|
|
151
|
-
});
|
|
152
|
-
});
|
|
153
|
-
describe('findByIdDirect', ()=>{
|
|
154
|
-
it('bypasses company filtering and returns the raw entity by id', async ()=>{
|
|
155
|
-
const config = buildStorageConfig();
|
|
156
|
-
mockRepo.findOne.mockResolvedValue(config);
|
|
157
|
-
const result = await service.findByIdDirect('config-uuid-1');
|
|
158
|
-
expect(mockRepo.findOne).toHaveBeenCalledWith({
|
|
159
|
-
where: {
|
|
160
|
-
id: 'config-uuid-1'
|
|
161
|
-
}
|
|
162
|
-
});
|
|
163
|
-
expect(result).toEqual(config);
|
|
164
|
-
});
|
|
165
|
-
it('returns null when no config exists for the given id', async ()=>{
|
|
166
|
-
mockRepo.findOne.mockResolvedValue(null);
|
|
167
|
-
const result = await service.findByIdDirect('missing-id');
|
|
168
|
-
expect(result).toBeNull();
|
|
169
|
-
});
|
|
170
|
-
});
|
|
171
|
-
describe('getDefaultConfig', ()=>{
|
|
172
|
-
it('returns the config explicitly flagged isDefault when one exists', async ()=>{
|
|
173
|
-
const defaultConfig = buildStorageConfig({
|
|
174
|
-
id: 'default-1',
|
|
175
|
-
isDefault: true
|
|
176
|
-
});
|
|
177
|
-
mockRepo.findOne.mockResolvedValueOnce(defaultConfig);
|
|
178
|
-
const result = await service.getDefaultConfig((0, _loggedusermock.buildMockUser)());
|
|
179
|
-
expect(result).toEqual(defaultConfig);
|
|
180
|
-
expect(mockRepo.findOne).toHaveBeenCalledTimes(1);
|
|
181
|
-
});
|
|
182
|
-
it('falls back to the oldest active config when no default is flagged', async ()=>{
|
|
183
|
-
const fallbackConfig = buildStorageConfig({
|
|
184
|
-
id: 'fallback-1'
|
|
185
|
-
});
|
|
186
|
-
mockRepo.findOne.mockResolvedValueOnce(null).mockResolvedValueOnce(fallbackConfig);
|
|
187
|
-
const result = await service.getDefaultConfig((0, _loggedusermock.buildMockUser)());
|
|
188
|
-
expect(result).toEqual(fallbackConfig);
|
|
189
|
-
expect(mockRepo.findOne).toHaveBeenCalledTimes(2);
|
|
190
|
-
});
|
|
191
|
-
it('returns null when there is no default and no active config at all', async ()=>{
|
|
192
|
-
mockRepo.findOne.mockResolvedValue(null);
|
|
193
|
-
const result = await service.getDefaultConfig((0, _loggedusermock.buildMockUser)());
|
|
194
|
-
expect(result).toBeNull();
|
|
195
|
-
});
|
|
196
|
-
it('scopes the query to the user company when company feature is enabled', async ()=>{
|
|
197
|
-
mockStorageConfig.isCompanyFeatureEnabled.mockReturnValue(true);
|
|
198
|
-
mockRepo.findOne.mockResolvedValue(null);
|
|
199
|
-
await service.getDefaultConfig((0, _loggedusermock.buildMockUser)({
|
|
200
|
-
companyId: 'company-9'
|
|
201
|
-
}));
|
|
202
|
-
expect(mockRepo.findOne).toHaveBeenCalledWith(expect.objectContaining({
|
|
203
|
-
where: expect.objectContaining({
|
|
204
|
-
companyId: 'company-9',
|
|
205
|
-
isActive: true
|
|
206
|
-
})
|
|
207
|
-
}));
|
|
208
|
-
});
|
|
209
|
-
});
|
|
210
|
-
describe('getConfigByType', ()=>{
|
|
211
|
-
it('returns active configs matching the requested storage type', async ()=>{
|
|
212
|
-
const localConfigs = [
|
|
213
|
-
buildStorageConfig({
|
|
214
|
-
storage: 'local'
|
|
215
|
-
})
|
|
216
|
-
];
|
|
217
|
-
mockRepo.find.mockResolvedValue(localConfigs);
|
|
218
|
-
const result = await service.getConfigByType('local', (0, _loggedusermock.buildMockUser)());
|
|
219
|
-
expect(mockRepo.find).toHaveBeenCalledWith({
|
|
220
|
-
where: {
|
|
221
|
-
storage: 'local',
|
|
222
|
-
isActive: true
|
|
223
|
-
}
|
|
224
|
-
});
|
|
225
|
-
expect(result).toEqual(localConfigs);
|
|
226
|
-
});
|
|
227
|
-
it('scopes the lookup to the current company when company feature is enabled', async ()=>{
|
|
228
|
-
mockStorageConfig.isCompanyFeatureEnabled.mockReturnValue(true);
|
|
229
|
-
mockRepo.find.mockResolvedValue([]);
|
|
230
|
-
await service.getConfigByType('aws', (0, _loggedusermock.buildMockUser)({
|
|
231
|
-
companyId: 'company-5'
|
|
232
|
-
}));
|
|
233
|
-
expect(mockRepo.find).toHaveBeenCalledWith({
|
|
234
|
-
where: {
|
|
235
|
-
storage: 'aws',
|
|
236
|
-
isActive: true,
|
|
237
|
-
companyId: 'company-5'
|
|
238
|
-
}
|
|
239
|
-
});
|
|
240
|
-
});
|
|
241
|
-
it('returns an empty array when no configs match', async ()=>{
|
|
242
|
-
mockRepo.find.mockResolvedValue([]);
|
|
243
|
-
const result = await service.getConfigByType('azure');
|
|
244
|
-
expect(result).toEqual([]);
|
|
245
|
-
});
|
|
246
|
-
});
|
|
247
|
-
describe('beforeDeleteOperation', ()=>{
|
|
248
|
-
it('rejects deleting the default storage config', async ()=>{
|
|
249
|
-
mockRepo.find.mockResolvedValue([
|
|
250
|
-
buildStorageConfig({
|
|
251
|
-
isDefault: true
|
|
252
|
-
})
|
|
253
|
-
]);
|
|
254
|
-
await expect(service.beforeDeleteOperation({
|
|
255
|
-
id: 'config-uuid-1'
|
|
256
|
-
}, null, {})).rejects.toThrow('Cannot delete the default storage config');
|
|
257
|
-
});
|
|
258
|
-
it('allows deleting a non-default storage config', async ()=>{
|
|
259
|
-
mockRepo.find.mockResolvedValue([]);
|
|
260
|
-
await expect(service.beforeDeleteOperation({
|
|
261
|
-
id: 'config-uuid-1'
|
|
262
|
-
}, null, {})).resolves.toBeUndefined();
|
|
263
|
-
});
|
|
264
|
-
});
|
|
265
|
-
});
|
|
@@ -1,376 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
Object.defineProperty(exports, "UploadService", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: function() {
|
|
8
|
-
return UploadService;
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
const _nestjsshared = require("@flusys/nestjs-shared");
|
|
12
|
-
const _classes = require("@flusys/nestjs-shared/classes");
|
|
13
|
-
const _interfaces = require("@flusys/nestjs-shared/interfaces");
|
|
14
|
-
const _utils = require("@flusys/nestjs-shared/utils");
|
|
15
|
-
const _common = require("@nestjs/common");
|
|
16
|
-
const _config = require("../config");
|
|
17
|
-
const _uploaddto = require("../dtos/upload.dto");
|
|
18
|
-
const _filelocationenum = require("../enums/file-location.enum");
|
|
19
|
-
const _storagefactoryservice = require("../providers/storage-factory.service");
|
|
20
|
-
const _filevalidatorutil = require("../utils/file-validator.util");
|
|
21
|
-
const _storageconfigservice = require("./storage-config.service");
|
|
22
|
-
const _storageproviderconfigservice = require("./storage-provider-config.service");
|
|
23
|
-
function _define_property(obj, key, value) {
|
|
24
|
-
if (key in obj) {
|
|
25
|
-
Object.defineProperty(obj, key, {
|
|
26
|
-
value: value,
|
|
27
|
-
enumerable: true,
|
|
28
|
-
configurable: true,
|
|
29
|
-
writable: true
|
|
30
|
-
});
|
|
31
|
-
} else {
|
|
32
|
-
obj[key] = value;
|
|
33
|
-
}
|
|
34
|
-
return obj;
|
|
35
|
-
}
|
|
36
|
-
function _ts_decorate(decorators, target, key, desc) {
|
|
37
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
38
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
39
|
-
else for(var i = decorators.length - 1; i >= 0; i--)if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
40
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
41
|
-
}
|
|
42
|
-
function _ts_metadata(k, v) {
|
|
43
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
44
|
-
}
|
|
45
|
-
function _ts_param(paramIndex, decorator) {
|
|
46
|
-
return function(target, key) {
|
|
47
|
-
decorator(target, key, paramIndex);
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
let UploadService = class UploadService {
|
|
51
|
-
/**
|
|
52
|
-
* Validate file before upload - includes size, type, and content validation.
|
|
53
|
-
* Uses magic bytes to verify file content matches declared MIME type.
|
|
54
|
-
*/ validateFile(file) {
|
|
55
|
-
// Validate file size
|
|
56
|
-
const sizeValidation = this.storageConfigService.validateFileSize(file.size);
|
|
57
|
-
if (!sizeValidation.valid) {
|
|
58
|
-
throw new _common.BadRequestException({
|
|
59
|
-
message: sizeValidation.message,
|
|
60
|
-
messageKey: sizeValidation.messageKey,
|
|
61
|
-
messageVariables: sizeValidation.messageVariables
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
// Validate declared file type (MIME)
|
|
65
|
-
const typeValidation = this.storageConfigService.validateFileType(file.mimetype);
|
|
66
|
-
if (!typeValidation.valid) {
|
|
67
|
-
throw new _common.BadRequestException({
|
|
68
|
-
message: typeValidation.message,
|
|
69
|
-
messageKey: typeValidation.messageKey,
|
|
70
|
-
messageVariables: typeValidation.messageVariables
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
// Validate file content matches declared type (magic bytes check)
|
|
74
|
-
// This prevents MIME type spoofing attacks
|
|
75
|
-
const allowedTypes = this.storageConfigService.getAllowedFileTypes();
|
|
76
|
-
const contentValidation = _filevalidatorutil.FileValidator.validateFileContent(file.buffer, file.mimetype, allowedTypes);
|
|
77
|
-
if (!contentValidation.valid) {
|
|
78
|
-
throw new _common.BadRequestException({
|
|
79
|
-
message: contentValidation.message || 'File content validation failed',
|
|
80
|
-
messageKey: _config.UPLOAD_MESSAGES.INVALID_TYPE,
|
|
81
|
-
messageVariables: {
|
|
82
|
-
mimeType: file.mimetype,
|
|
83
|
-
allowedTypes: allowedTypes.join(', ')
|
|
84
|
-
}
|
|
85
|
-
});
|
|
86
|
-
}
|
|
87
|
-
// Sanitize filename to prevent path traversal attacks
|
|
88
|
-
file.originalname = _filevalidatorutil.FileValidator.sanitizeFilename(file.originalname);
|
|
89
|
-
}
|
|
90
|
-
/**
|
|
91
|
-
* Create provider from storage config entity
|
|
92
|
-
*/ async createProviderFromConfig(config) {
|
|
93
|
-
return this.storageFactory.createProvider({
|
|
94
|
-
provider: config.storage,
|
|
95
|
-
config: config.config
|
|
96
|
-
});
|
|
97
|
-
}
|
|
98
|
-
/**
|
|
99
|
-
* Create fallback local provider
|
|
100
|
-
*/ async createFallbackLocalProvider() {
|
|
101
|
-
return this.storageFactory.createProvider({
|
|
102
|
-
provider: _filelocationenum.FileLocationEnum.LOCAL,
|
|
103
|
-
config: {
|
|
104
|
-
basePath: this.storageConfigService.getDefaultLocalStoragePath()
|
|
105
|
-
}
|
|
106
|
-
});
|
|
107
|
-
}
|
|
108
|
-
/**
|
|
109
|
-
* Get storage provider and config info based on storage config ID
|
|
110
|
-
* Validates company ownership when company feature is enabled
|
|
111
|
-
*/ async getStorageProviderWithConfig(storageConfigId, user) {
|
|
112
|
-
let storageConfig;
|
|
113
|
-
// Get storage config from database
|
|
114
|
-
if (storageConfigId) {
|
|
115
|
-
// Use direct lookup (bypasses company filtering, returns null instead of throwing)
|
|
116
|
-
const config = await this.storageProviderConfigService.findByIdDirect(storageConfigId);
|
|
117
|
-
if (!config) {
|
|
118
|
-
throw new _common.NotFoundException({
|
|
119
|
-
message: 'Storage configuration not found',
|
|
120
|
-
messageKey: _config.UPLOAD_MESSAGES.CONFIG_NOT_FOUND
|
|
121
|
-
});
|
|
122
|
-
}
|
|
123
|
-
// Validate company ownership using shared utility
|
|
124
|
-
(0, _utils.validateCompanyOwnership)(config, user, this.storageConfigService.isCompanyFeatureEnabled(), 'Storage configuration');
|
|
125
|
-
storageConfig = config;
|
|
126
|
-
} else {
|
|
127
|
-
// Use default config (scoped to user's company/branch)
|
|
128
|
-
const defaultConfig = await this.storageProviderConfigService.getDefaultConfig(user);
|
|
129
|
-
if (!defaultConfig) {
|
|
130
|
-
throw new _common.NotFoundException({
|
|
131
|
-
message: 'No default storage configuration found for your company/branch. Please create one.',
|
|
132
|
-
messageKey: _config.UPLOAD_MESSAGES.CONFIG_NOT_FOUND
|
|
133
|
-
});
|
|
134
|
-
}
|
|
135
|
-
storageConfig = defaultConfig;
|
|
136
|
-
}
|
|
137
|
-
const provider = await this.createProviderFromConfig(storageConfig);
|
|
138
|
-
return {
|
|
139
|
-
provider,
|
|
140
|
-
location: storageConfig.storage,
|
|
141
|
-
configId: storageConfig.id
|
|
142
|
-
};
|
|
143
|
-
}
|
|
144
|
-
/**
|
|
145
|
-
* Get storage provider for delete operations with fallback
|
|
146
|
-
* If the original storage config doesn't exist, falls back based on locationHint
|
|
147
|
-
*/ async getStorageProviderForDelete(storageConfigId, user, locationHint) {
|
|
148
|
-
// Try to find by storageConfigId
|
|
149
|
-
if (storageConfigId) {
|
|
150
|
-
const config = await this.storageProviderConfigService.findByIdDirect(storageConfigId);
|
|
151
|
-
if (config) {
|
|
152
|
-
return this.createProviderFromConfig(config);
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
// Fallback: Use locationHint to find a matching config
|
|
156
|
-
if (locationHint) {
|
|
157
|
-
const matchingConfigs = await this.storageProviderConfigService.getConfigByType(locationHint, user);
|
|
158
|
-
if (matchingConfigs.length > 0) {
|
|
159
|
-
return this.createProviderFromConfig(matchingConfigs[0]);
|
|
160
|
-
}
|
|
161
|
-
if (locationHint === _filelocationenum.FileLocationEnum.LOCAL) {
|
|
162
|
-
return this.createFallbackLocalProvider();
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
// Last resort: Try default config
|
|
166
|
-
const defaultConfig = await this.storageProviderConfigService.getDefaultConfig(user);
|
|
167
|
-
if (defaultConfig) {
|
|
168
|
-
return this.createProviderFromConfig(defaultConfig);
|
|
169
|
-
}
|
|
170
|
-
return this.createFallbackLocalProvider();
|
|
171
|
-
}
|
|
172
|
-
async uploadSingleFile(file, options, user) {
|
|
173
|
-
this.validateFile(file);
|
|
174
|
-
const { provider, location, configId } = await this.getStorageProviderWithConfig(options.storageConfigId, user);
|
|
175
|
-
const result = await provider.uploadFile(file, options);
|
|
176
|
-
await this.publishFileEvent(_config.STORAGE_EVENT_ACTIONS.UPLOADED, [
|
|
177
|
-
result.key
|
|
178
|
-
], user, {
|
|
179
|
-
location,
|
|
180
|
-
storageConfigId: configId,
|
|
181
|
-
totalSize: result.size,
|
|
182
|
-
count: 1
|
|
183
|
-
});
|
|
184
|
-
return {
|
|
185
|
-
...result,
|
|
186
|
-
location,
|
|
187
|
-
storageConfigId: configId
|
|
188
|
-
};
|
|
189
|
-
}
|
|
190
|
-
async uploadMultipleFiles(files, options, user) {
|
|
191
|
-
for (const file of files){
|
|
192
|
-
this.validateFile(file);
|
|
193
|
-
}
|
|
194
|
-
const { provider, location, configId } = await this.getStorageProviderWithConfig(options.storageConfigId, user);
|
|
195
|
-
const results = await provider.uploadMultipleFiles(files, options);
|
|
196
|
-
await this.publishFileEvent(_config.STORAGE_EVENT_ACTIONS.UPLOADED, results.map((result)=>result.key), user, {
|
|
197
|
-
location,
|
|
198
|
-
storageConfigId: configId,
|
|
199
|
-
totalSize: results.reduce((sum, result)=>sum + (result.size ?? 0), 0),
|
|
200
|
-
count: results.length
|
|
201
|
-
});
|
|
202
|
-
return results.map((result)=>({
|
|
203
|
-
...result,
|
|
204
|
-
location,
|
|
205
|
-
storageConfigId: configId
|
|
206
|
-
}));
|
|
207
|
-
}
|
|
208
|
-
async deleteSingleFile(key, storageConfigId, user, locationHint) {
|
|
209
|
-
if (!key) throw new _common.BadRequestException({
|
|
210
|
-
message: 'No file path provided',
|
|
211
|
-
messageKey: _config.UPLOAD_MESSAGES.NO_FILE_PATH
|
|
212
|
-
});
|
|
213
|
-
const provider = await this.getStorageProviderForDelete(storageConfigId, user, locationHint);
|
|
214
|
-
await provider.deleteFile(key);
|
|
215
|
-
await this.publishFileEvent(_config.STORAGE_EVENT_ACTIONS.REMOVED, [
|
|
216
|
-
key
|
|
217
|
-
], user, {
|
|
218
|
-
storageConfigId,
|
|
219
|
-
count: 1
|
|
220
|
-
});
|
|
221
|
-
return true;
|
|
222
|
-
}
|
|
223
|
-
async deleteMultipleFile(keys, storageConfigId, user, locationHint) {
|
|
224
|
-
if (!keys || !keys.length) throw new _common.BadRequestException({
|
|
225
|
-
message: 'No file paths provided',
|
|
226
|
-
messageKey: _config.UPLOAD_MESSAGES.NO_FILE_PATH
|
|
227
|
-
});
|
|
228
|
-
const provider = await this.getStorageProviderForDelete(storageConfigId, user, locationHint);
|
|
229
|
-
await provider.deleteMultipleFiles(keys);
|
|
230
|
-
await this.publishFileEvent(_config.STORAGE_EVENT_ACTIONS.REMOVED, keys, user, {
|
|
231
|
-
storageConfigId,
|
|
232
|
-
count: keys.length
|
|
233
|
-
});
|
|
234
|
-
return true;
|
|
235
|
-
}
|
|
236
|
-
async publishFileEvent(action, keys, user, metadata) {
|
|
237
|
-
await (0, _classes.publishDomainEvent)({
|
|
238
|
-
module: _config.STORAGE_EVENT_MODULE,
|
|
239
|
-
entity: _config.STORAGE_EVENT_ENTITIES.FILE,
|
|
240
|
-
action,
|
|
241
|
-
ids: keys,
|
|
242
|
-
metadata,
|
|
243
|
-
user: user ?? null
|
|
244
|
-
});
|
|
245
|
-
}
|
|
246
|
-
bytesToKb(bytes) {
|
|
247
|
-
return Number((bytes * 0.001).toFixed(2));
|
|
248
|
-
}
|
|
249
|
-
/**
|
|
250
|
-
* Get local storage basePath from DB config
|
|
251
|
-
* Initializes local provider if not cached, ensuring basePath is from DB
|
|
252
|
-
*/ async getLocalStorageBasePath() {
|
|
253
|
-
try {
|
|
254
|
-
// First check if already cached
|
|
255
|
-
const cachedPath = this.storageFactory.getLocalProviderBasePath();
|
|
256
|
-
if (cachedPath) {
|
|
257
|
-
return cachedPath;
|
|
258
|
-
}
|
|
259
|
-
// Get local config from DB (without user context for public access)
|
|
260
|
-
const localConfigs = await this.storageProviderConfigService.getConfigByType(_filelocationenum.FileLocationEnum.LOCAL);
|
|
261
|
-
if (localConfigs.length > 0) {
|
|
262
|
-
const localConfig = localConfigs[0];
|
|
263
|
-
// Initialize provider to cache it
|
|
264
|
-
await this.storageFactory.createProvider({
|
|
265
|
-
provider: _filelocationenum.FileLocationEnum.LOCAL,
|
|
266
|
-
config: localConfig.config
|
|
267
|
-
});
|
|
268
|
-
// Now get the cached basePath
|
|
269
|
-
return this.storageFactory.getLocalProviderBasePath();
|
|
270
|
-
}
|
|
271
|
-
return null;
|
|
272
|
-
} catch {
|
|
273
|
-
return null;
|
|
274
|
-
}
|
|
275
|
-
}
|
|
276
|
-
async makeFileUrl(key, storageConfigId, expiresIn = 3600, user) {
|
|
277
|
-
const { provider } = await this.getStorageProviderWithConfig(storageConfigId, user);
|
|
278
|
-
// Check if provider supports presigned URLs
|
|
279
|
-
if (provider.generatePresignedUrl) {
|
|
280
|
-
return await provider.generatePresignedUrl(key, expiresIn);
|
|
281
|
-
}
|
|
282
|
-
// For SFTP or other providers without presigned URLs
|
|
283
|
-
return key;
|
|
284
|
-
}
|
|
285
|
-
// NOTE: @Inject() required for bundled code - type metadata may be lost during esbuild
|
|
286
|
-
constructor(storageFactory, storageConfigService, storageProviderConfigService){
|
|
287
|
-
_define_property(this, "storageFactory", void 0);
|
|
288
|
-
_define_property(this, "storageConfigService", void 0);
|
|
289
|
-
_define_property(this, "storageProviderConfigService", void 0);
|
|
290
|
-
this.storageFactory = storageFactory;
|
|
291
|
-
this.storageConfigService = storageConfigService;
|
|
292
|
-
this.storageProviderConfigService = storageProviderConfigService;
|
|
293
|
-
}
|
|
294
|
-
};
|
|
295
|
-
_ts_decorate([
|
|
296
|
-
(0, _nestjsshared.LogAction)({
|
|
297
|
-
action: 'storage.uploadSingle',
|
|
298
|
-
module: 'storage'
|
|
299
|
-
}),
|
|
300
|
-
_ts_metadata("design:type", Function),
|
|
301
|
-
_ts_metadata("design:paramtypes", [
|
|
302
|
-
typeof Express === "undefined" || typeof Express.Multer === "undefined" || typeof Express.Multer.File === "undefined" ? Object : Express.Multer.File,
|
|
303
|
-
typeof _uploaddto.UploadOptionsDto === "undefined" ? Object : _uploaddto.UploadOptionsDto,
|
|
304
|
-
typeof _interfaces.ILoggedUserInfo === "undefined" ? Object : _interfaces.ILoggedUserInfo
|
|
305
|
-
]),
|
|
306
|
-
_ts_metadata("design:returntype", Promise)
|
|
307
|
-
], UploadService.prototype, "uploadSingleFile", null);
|
|
308
|
-
_ts_decorate([
|
|
309
|
-
(0, _nestjsshared.LogAction)({
|
|
310
|
-
action: 'storage.uploadMultiple',
|
|
311
|
-
module: 'storage'
|
|
312
|
-
}),
|
|
313
|
-
_ts_metadata("design:type", Function),
|
|
314
|
-
_ts_metadata("design:paramtypes", [
|
|
315
|
-
Array,
|
|
316
|
-
typeof _uploaddto.UploadOptionsDto === "undefined" ? Object : _uploaddto.UploadOptionsDto,
|
|
317
|
-
typeof _interfaces.ILoggedUserInfo === "undefined" ? Object : _interfaces.ILoggedUserInfo
|
|
318
|
-
]),
|
|
319
|
-
_ts_metadata("design:returntype", Promise)
|
|
320
|
-
], UploadService.prototype, "uploadMultipleFiles", null);
|
|
321
|
-
_ts_decorate([
|
|
322
|
-
(0, _nestjsshared.LogAction)({
|
|
323
|
-
action: 'storage.deleteSingle',
|
|
324
|
-
module: 'storage'
|
|
325
|
-
}),
|
|
326
|
-
_ts_metadata("design:type", Function),
|
|
327
|
-
_ts_metadata("design:paramtypes", [
|
|
328
|
-
String,
|
|
329
|
-
String,
|
|
330
|
-
typeof _interfaces.ILoggedUserInfo === "undefined" ? Object : _interfaces.ILoggedUserInfo,
|
|
331
|
-
String
|
|
332
|
-
]),
|
|
333
|
-
_ts_metadata("design:returntype", Promise)
|
|
334
|
-
], UploadService.prototype, "deleteSingleFile", null);
|
|
335
|
-
_ts_decorate([
|
|
336
|
-
(0, _nestjsshared.LogAction)({
|
|
337
|
-
action: 'storage.deleteMultiple',
|
|
338
|
-
module: 'storage'
|
|
339
|
-
}),
|
|
340
|
-
_ts_metadata("design:type", Function),
|
|
341
|
-
_ts_metadata("design:paramtypes", [
|
|
342
|
-
Array,
|
|
343
|
-
String,
|
|
344
|
-
typeof _interfaces.ILoggedUserInfo === "undefined" ? Object : _interfaces.ILoggedUserInfo,
|
|
345
|
-
String
|
|
346
|
-
]),
|
|
347
|
-
_ts_metadata("design:returntype", Promise)
|
|
348
|
-
], UploadService.prototype, "deleteMultipleFile", null);
|
|
349
|
-
_ts_decorate([
|
|
350
|
-
(0, _nestjsshared.LogAction)({
|
|
351
|
-
action: 'storage.makeFileUrl',
|
|
352
|
-
module: 'storage'
|
|
353
|
-
}),
|
|
354
|
-
_ts_metadata("design:type", Function),
|
|
355
|
-
_ts_metadata("design:paramtypes", [
|
|
356
|
-
String,
|
|
357
|
-
String,
|
|
358
|
-
Number,
|
|
359
|
-
typeof _interfaces.ILoggedUserInfo === "undefined" ? Object : _interfaces.ILoggedUserInfo
|
|
360
|
-
]),
|
|
361
|
-
_ts_metadata("design:returntype", Promise)
|
|
362
|
-
], UploadService.prototype, "makeFileUrl", null);
|
|
363
|
-
UploadService = _ts_decorate([
|
|
364
|
-
(0, _common.Injectable)({
|
|
365
|
-
scope: _common.Scope.REQUEST
|
|
366
|
-
}),
|
|
367
|
-
_ts_param(0, (0, _common.Inject)(_storagefactoryservice.StorageFactoryService)),
|
|
368
|
-
_ts_param(1, (0, _common.Inject)(_storageconfigservice.StorageConfigService)),
|
|
369
|
-
_ts_param(2, (0, _common.Inject)(_storageproviderconfigservice.StorageProviderConfigService)),
|
|
370
|
-
_ts_metadata("design:type", Function),
|
|
371
|
-
_ts_metadata("design:paramtypes", [
|
|
372
|
-
typeof _storagefactoryservice.StorageFactoryService === "undefined" ? Object : _storagefactoryservice.StorageFactoryService,
|
|
373
|
-
typeof _storageconfigservice.StorageConfigService === "undefined" ? Object : _storageconfigservice.StorageConfigService,
|
|
374
|
-
typeof _storageproviderconfigservice.StorageProviderConfigService === "undefined" ? Object : _storageproviderconfigservice.StorageProviderConfigService
|
|
375
|
-
])
|
|
376
|
-
], UploadService);
|