@tc-libs/file 0.34.0 → 0.36.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/package.json CHANGED
@@ -1,18 +1,18 @@
1
1
  {
2
2
  "name": "@tc-libs/file",
3
- "version": "0.34.0",
3
+ "version": "0.36.0",
4
4
  "dependencies": {
5
5
  "tslib": "^2.3.0",
6
6
  "@nestjs/common": "^10.0.2",
7
7
  "@nestjs/platform-express": "^10.0.2",
8
- "@tc-libs/request": "0.34.0",
8
+ "@tc-libs/request": "0.36.0",
9
9
  "@nestjs/swagger": "^7.1.10",
10
10
  "rxjs": "^7.8.0",
11
11
  "@nestjs/core": "^10.0.2",
12
12
  "express": "4.21.0",
13
- "@tc-libs/errors": "0.34.0",
14
- "@tc-libs/file-handler": "0.34.0",
15
- "@tc-libs/constant": "0.34.0"
13
+ "@tc-libs/errors": "0.36.0",
14
+ "@tc-libs/file-handler": "0.36.0",
15
+ "@tc-libs/constant": "0.36.0"
16
16
  },
17
17
  "type": "commonjs",
18
18
  "main": "./src/index.js",
@@ -0,0 +1,6 @@
1
+ import { DynamicModule } from '@nestjs/common';
2
+ import FileModuleAsyncOptions, { FileModuleOptions } from './file.module.options';
3
+ export declare class FileModule {
4
+ static register(options: FileModuleOptions, isGlobal?: boolean): DynamicModule;
5
+ static registerAsync(options: FileModuleAsyncOptions, isGlobal?: boolean): DynamicModule;
6
+ }
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ var FileModule_1;
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.FileModule = void 0;
5
+ const tslib_1 = require("tslib");
6
+ const common_1 = require("@nestjs/common");
7
+ const file_module_options_1 = require("./file.module.options");
8
+ const interceptors_1 = require("./interceptors");
9
+ const providers = [interceptors_1.FileCustomMaxFilesInterceptor, interceptors_1.FileCustomMaxSizeInterceptor];
10
+ let FileModule = FileModule_1 = class FileModule {
11
+ static register(options, isGlobal) {
12
+ return {
13
+ module: FileModule_1,
14
+ providers: [
15
+ { provide: file_module_options_1.FILE_MODULE_CONFIG_OPTIONS, useValue: options },
16
+ ...providers,
17
+ ],
18
+ exports: [file_module_options_1.FILE_MODULE_CONFIG_OPTIONS, ...providers],
19
+ global: isGlobal,
20
+ };
21
+ }
22
+ static registerAsync(options, isGlobal) {
23
+ return {
24
+ module: FileModule_1,
25
+ imports: [...(options.imports || [])],
26
+ providers: [
27
+ {
28
+ provide: file_module_options_1.FILE_MODULE_CONFIG_OPTIONS,
29
+ useFactory: options.useFactory,
30
+ inject: options.inject,
31
+ },
32
+ ...providers,
33
+ ],
34
+ exports: [file_module_options_1.FILE_MODULE_CONFIG_OPTIONS, ...providers],
35
+ global: isGlobal,
36
+ };
37
+ }
38
+ };
39
+ exports.FileModule = FileModule;
40
+ exports.FileModule = FileModule = FileModule_1 = tslib_1.__decorate([
41
+ (0, common_1.Module)({})
42
+ ], FileModule);
43
+ //# sourceMappingURL=file.module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file.module.js","sourceRoot":"","sources":["../../../../packages/file/src/file.module.ts"],"names":[],"mappings":";;;;;AAAA,2CAAuD;AACvD,+DAG+B;AAC/B,iDAGwB;AACxB,MAAM,SAAS,GAAG,CAAC,4CAA6B,EAAE,2CAA4B,CAAC,CAAC;AAEzE,IAAM,UAAU,kBAAhB,MAAM,UAAU;IACrB,MAAM,CAAC,QAAQ,CACb,OAA0B,EAC1B,QAAkB;QAElB,OAAO;YACL,MAAM,EAAE,YAAU;YAClB,SAAS,EAAE;gBACT,EAAE,OAAO,EAAE,gDAA0B,EAAE,QAAQ,EAAE,OAAO,EAAE;gBAC1D,GAAG,SAAS;aACb;YACD,OAAO,EAAE,CAAC,gDAA0B,EAAE,GAAG,SAAS,CAAC;YACnD,MAAM,EAAE,QAAQ;SACjB,CAAC;IACJ,CAAC;IACD,MAAM,CAAC,aAAa,CAClB,OAA+B,EAC/B,QAAkB;QAElB,OAAO;YACL,MAAM,EAAE,YAAU;YAClB,OAAO,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC;YACrC,SAAS,EAAE;gBACT;oBACE,OAAO,EAAE,gDAA0B;oBACnC,UAAU,EAAE,OAAO,CAAC,UAAU;oBAC9B,MAAM,EAAE,OAAO,CAAC,MAAM;iBACvB;gBACD,GAAG,SAAS;aACb;YACD,OAAO,EAAE,CAAC,gDAA0B,EAAE,GAAG,SAAS,CAAC;YACnD,MAAM,EAAE,QAAQ;SACjB,CAAC;IACJ,CAAC;CACF,CAAA;AAlCY,gCAAU;qBAAV,UAAU;IADtB,IAAA,eAAM,EAAC,EAAE,CAAC;GACE,UAAU,CAkCtB"}
package/src/index.d.ts CHANGED
@@ -3,3 +3,4 @@ export * from './dtos';
3
3
  export * from './pipes';
4
4
  export * from './interceptors';
5
5
  export * from './decorators/file.decorator';
6
+ export * from './file.module';
package/src/index.js CHANGED
@@ -6,4 +6,5 @@ tslib_1.__exportStar(require("./dtos"), exports);
6
6
  tslib_1.__exportStar(require("./pipes"), exports);
7
7
  tslib_1.__exportStar(require("./interceptors"), exports);
8
8
  tslib_1.__exportStar(require("./decorators/file.decorator"), exports);
9
+ tslib_1.__exportStar(require("./file.module"), exports);
9
10
  //# sourceMappingURL=index.js.map
package/src/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/file/src/index.ts"],"names":[],"mappings":";;;AAAA,sDAA4B;AAC5B,iDAAuB;AACvB,kDAAwB;AACxB,yDAA+B;AAC/B,sEAA4C"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/file/src/index.ts"],"names":[],"mappings":";;;AAAA,sDAA4B;AAC5B,iDAAuB;AACvB,kDAAwB;AACxB,yDAA+B;AAC/B,sEAA4C;AAC5C,wDAA8B"}