@volare.finance/nestjs.plugins 1.1.7 → 1.1.9

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.
@@ -0,0 +1,5 @@
1
+ /**
2
+ * @file api.empty.response.decorator.ts
3
+ * @date 2024
4
+ */
5
+ export declare const ApiEmptyResponse: (description?: string) => any;
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ /**
3
+ * @file api.empty.response.decorator.ts
4
+ * @date 2024
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.ApiEmptyResponse = void 0;
8
+ const common_1 = require("@nestjs/common");
9
+ const swagger_1 = require("@nestjs/swagger");
10
+ const response_dto_1 = require("./response.dto");
11
+ const ApiEmptyResponse = (description) => {
12
+ return (0, common_1.applyDecorators)((0, swagger_1.ApiExtraModels)(response_dto_1.ResponseDto), (0, swagger_1.ApiOkResponse)({
13
+ schema: {
14
+ allOf: [
15
+ { $ref: (0, swagger_1.getSchemaPath)(response_dto_1.ResponseDto) },
16
+ {
17
+ properties: {
18
+ code: { type: 'number', default: 0 },
19
+ },
20
+ },
21
+ ],
22
+ },
23
+ description,
24
+ }));
25
+ };
26
+ exports.ApiEmptyResponse = ApiEmptyResponse;
27
+ //# sourceMappingURL=api.empty.response.decorator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api.empty.response.decorator.js","sourceRoot":"","sources":["../../src/decorators/api.empty.response.decorator.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,2CAAiD;AACjD,6CAA+E;AAC/E,iDAA6C;AAEtC,MAAM,gBAAgB,GAAG,CAAC,WAAoB,EAAO,EAAE;IAC5D,OAAO,IAAA,wBAAe,EACpB,IAAA,wBAAc,EAAC,0BAAW,CAAC,EAC3B,IAAA,uBAAa,EAAC;QACZ,MAAM,EAAE;YACN,KAAK,EAAE;gBACL,EAAE,IAAI,EAAE,IAAA,uBAAa,EAAC,0BAAW,CAAC,EAAE;gBACpC;oBACE,UAAU,EAAE;wBACV,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,EAAE;qBACrC;iBACF;aACF;SACF;QACD,WAAW;KACZ,CAAC,CACH,CAAC;AACJ,CAAC,CAAC;AAjBW,QAAA,gBAAgB,oBAiB3B"}
@@ -9,14 +9,13 @@ const common_1 = require("@nestjs/common");
9
9
  const swagger_1 = require("@nestjs/swagger");
10
10
  const response_dto_1 = require("./response.dto");
11
11
  const ApiListResponse = (model, description) => {
12
- return (0, common_1.applyDecorators)((0, swagger_1.ApiOkResponse)({
12
+ return (0, common_1.applyDecorators)((0, swagger_1.ApiExtraModels)(response_dto_1.ResponseListDto, model), (0, swagger_1.ApiOkResponse)({
13
13
  schema: {
14
14
  allOf: [
15
15
  { $ref: (0, swagger_1.getSchemaPath)(response_dto_1.ResponseListDto) },
16
16
  {
17
17
  properties: {
18
- // code: { type: 'number', default: 0 },
19
- // message: { type: 'string', default: 'OK' },
18
+ code: { type: 'number', default: 0 },
20
19
  data: {
21
20
  type: 'array',
22
21
  items: { $ref: (0, swagger_1.getSchemaPath)(model) },
@@ -26,7 +25,7 @@ const ApiListResponse = (model, description) => {
26
25
  ],
27
26
  },
28
27
  description,
29
- }), (0, swagger_1.ApiExtraModels)(response_dto_1.ResponseListDto), (0, swagger_1.ApiExtraModels)(model));
28
+ }));
30
29
  };
31
30
  exports.ApiListResponse = ApiListResponse;
32
31
  //# sourceMappingURL=api.list.response.decorator.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"api.list.response.decorator.js","sourceRoot":"","sources":["../../src/decorators/api.list.response.decorator.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,2CAAuD;AACvD,6CAA+E;AAC/E,iDAAiD;AAE1C,MAAM,eAAe,GAAG,CAA2B,KAAa,EAAE,WAAoB,EAAO,EAAE;IACpG,OAAO,IAAA,wBAAe,EACpB,IAAA,uBAAa,EAAC;QACZ,MAAM,EAAE;YACN,KAAK,EAAE;gBACL,EAAE,IAAI,EAAE,IAAA,uBAAa,EAAC,8BAAe,CAAC,EAAE;gBACxC;oBACE,UAAU,EAAE;wBACV,wCAAwC;wBACxC,8CAA8C;wBAC9C,IAAI,EAAE;4BACJ,IAAI,EAAE,OAAO;4BACb,KAAK,EAAE,EAAE,IAAI,EAAE,IAAA,uBAAa,EAAC,KAAK,CAAC,EAAE;yBACtC;qBACF;iBACF;aACF;SACF;QACD,WAAW;KACZ,CAAC,EACF,IAAA,wBAAc,EAAC,8BAAe,CAAC,EAC/B,IAAA,wBAAc,EAAC,KAAK,CAAC,CACtB,CAAC;AACJ,CAAC,CAAC;AAvBW,QAAA,eAAe,mBAuB1B"}
1
+ {"version":3,"file":"api.list.response.decorator.js","sourceRoot":"","sources":["../../src/decorators/api.list.response.decorator.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,2CAAuD;AACvD,6CAA+E;AAC/E,iDAAiD;AAE1C,MAAM,eAAe,GAAG,CAA2B,KAAa,EAAE,WAAoB,EAAO,EAAE;IACpG,OAAO,IAAA,wBAAe,EACpB,IAAA,wBAAc,EAAC,8BAAe,EAAE,KAAK,CAAC,EACtC,IAAA,uBAAa,EAAC;QACZ,MAAM,EAAE;YACN,KAAK,EAAE;gBACL,EAAE,IAAI,EAAE,IAAA,uBAAa,EAAC,8BAAe,CAAC,EAAE;gBACxC;oBACE,UAAU,EAAE;wBACV,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,EAAE;wBACpC,IAAI,EAAE;4BACJ,IAAI,EAAE,OAAO;4BACb,KAAK,EAAE,EAAE,IAAI,EAAE,IAAA,uBAAa,EAAC,KAAK,CAAC,EAAE;yBACtC;qBACF;iBACF;aACF;SACF;QACD,WAAW;KACZ,CAAC,CACH,CAAC;AACJ,CAAC,CAAC;AArBW,QAAA,eAAe,mBAqB1B"}
@@ -9,21 +9,20 @@ const common_1 = require("@nestjs/common");
9
9
  const swagger_1 = require("@nestjs/swagger");
10
10
  const response_dto_1 = require("./response.dto");
11
11
  const ApiObjResponse = (model, description) => {
12
- return (0, common_1.applyDecorators)((0, swagger_1.ApiOkResponse)({
12
+ return (0, common_1.applyDecorators)((0, swagger_1.ApiExtraModels)(response_dto_1.ResponseObjDto, model), (0, swagger_1.ApiOkResponse)({
13
13
  schema: {
14
14
  allOf: [
15
15
  { $ref: (0, swagger_1.getSchemaPath)(response_dto_1.ResponseObjDto) },
16
16
  {
17
17
  properties: {
18
- // code: { type: 'number', default: 0 },
19
- // message: { type: 'string', default: 'OK' },
18
+ code: { type: 'number', default: 0 },
20
19
  data: { $ref: (0, swagger_1.getSchemaPath)(model) },
21
20
  },
22
21
  },
23
22
  ],
24
23
  },
25
24
  description,
26
- }), (0, swagger_1.ApiExtraModels)(response_dto_1.ResponseObjDto), (0, swagger_1.ApiExtraModels)(model));
25
+ }));
27
26
  };
28
27
  exports.ApiObjResponse = ApiObjResponse;
29
28
  //# sourceMappingURL=api.obj.response.decorator.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"api.obj.response.decorator.js","sourceRoot":"","sources":["../../src/decorators/api.obj.response.decorator.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,2CAAuD;AACvD,6CAA+E;AAC/E,iDAAgD;AAEzC,MAAM,cAAc,GAAG,CAA2B,KAAa,EAAE,WAAoB,EAAO,EAAE;IACnG,OAAO,IAAA,wBAAe,EACpB,IAAA,uBAAa,EAAC;QACZ,MAAM,EAAE;YACN,KAAK,EAAE;gBACL,EAAE,IAAI,EAAE,IAAA,uBAAa,EAAC,6BAAc,CAAC,EAAE;gBACvC;oBACE,UAAU,EAAE;wBACV,wCAAwC;wBACxC,8CAA8C;wBAC9C,IAAI,EAAE,EAAE,IAAI,EAAE,IAAA,uBAAa,EAAC,KAAK,CAAC,EAAE;qBACrC;iBACF;aACF;SACF;QACD,WAAW;KACZ,CAAC,EACF,IAAA,wBAAc,EAAC,6BAAc,CAAC,EAC9B,IAAA,wBAAc,EAAC,KAAK,CAAC,CACtB,CAAC;AACJ,CAAC,CAAC;AApBW,QAAA,cAAc,kBAoBzB"}
1
+ {"version":3,"file":"api.obj.response.decorator.js","sourceRoot":"","sources":["../../src/decorators/api.obj.response.decorator.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,2CAAuD;AACvD,6CAA+E;AAC/E,iDAAgD;AAEzC,MAAM,cAAc,GAAG,CAA2B,KAAa,EAAE,WAAoB,EAAO,EAAE;IACnG,OAAO,IAAA,wBAAe,EACpB,IAAA,wBAAc,EAAC,6BAAc,EAAE,KAAK,CAAC,EACrC,IAAA,uBAAa,EAAC;QACZ,MAAM,EAAE;YACN,KAAK,EAAE;gBACL,EAAE,IAAI,EAAE,IAAA,uBAAa,EAAC,6BAAc,CAAC,EAAE;gBACvC;oBACE,UAAU,EAAE;wBACV,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,EAAE;wBACpC,IAAI,EAAE,EAAE,IAAI,EAAE,IAAA,uBAAa,EAAC,KAAK,CAAC,EAAE;qBACrC;iBACF;aACF;SACF;QACD,WAAW;KACZ,CAAC,CACH,CAAC;AACJ,CAAC,CAAC;AAlBW,QAAA,cAAc,kBAkBzB"}
@@ -3,5 +3,6 @@
3
3
  * @date 2024
4
4
  */
5
5
  export * from './response.dto';
6
+ export * from './api.empty.response.decorator';
6
7
  export * from './api.list.response.decorator';
7
8
  export * from './api.obj.response.decorator';
@@ -6,6 +6,7 @@
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
7
  const tslib_1 = require("tslib");
8
8
  tslib_1.__exportStar(require("./response.dto"), exports);
9
+ tslib_1.__exportStar(require("./api.empty.response.decorator"), exports);
9
10
  tslib_1.__exportStar(require("./api.list.response.decorator"), exports);
10
11
  tslib_1.__exportStar(require("./api.obj.response.decorator"), exports);
11
12
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/decorators/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,yDAA+B;AAC/B,wEAA8C;AAC9C,uEAA6C"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/decorators/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,yDAA+B;AAC/B,yEAA+C;AAC/C,wEAA8C;AAC9C,uEAA6C"}
@@ -4,7 +4,6 @@
4
4
  */
5
5
  export declare class ResponseDto {
6
6
  code: number;
7
- message: string;
8
7
  reason?: string;
9
8
  }
10
9
  export declare class ResponseObjDto<TData> extends ResponseDto {
@@ -11,24 +11,21 @@ class ResponseDto {
11
11
  }
12
12
  exports.ResponseDto = ResponseDto;
13
13
  tslib_1.__decorate([
14
- (0, swagger_1.ApiProperty)({ description: 'The result code, 0 means success, greater than 0 means failure.', example: 0 })
14
+ (0, swagger_1.ApiProperty)({ type: 'number', description: 'The result code, 0 means success, greater than 0 means failure.', example: 0 })
15
15
  ], ResponseDto.prototype, "code", void 0);
16
16
  tslib_1.__decorate([
17
- (0, swagger_1.ApiProperty)({ description: 'The result message', example: 'OK' })
18
- ], ResponseDto.prototype, "message", void 0);
19
- tslib_1.__decorate([
20
- (0, swagger_1.ApiPropertyOptional)({ description: 'The failure reason.' })
17
+ (0, swagger_1.ApiPropertyOptional)({ type: 'string', description: 'The failure reason.', example: '' })
21
18
  ], ResponseDto.prototype, "reason", void 0);
22
19
  class ResponseObjDto extends ResponseDto {
23
20
  }
24
21
  exports.ResponseObjDto = ResponseObjDto;
25
22
  tslib_1.__decorate([
26
- (0, swagger_1.ApiProperty)()
23
+ (0, swagger_1.ApiProperty)({ type: Object })
27
24
  ], ResponseObjDto.prototype, "data", void 0);
28
25
  class ResponseListDto extends ResponseDto {
29
26
  }
30
27
  exports.ResponseListDto = ResponseListDto;
31
28
  tslib_1.__decorate([
32
- (0, swagger_1.ApiProperty)()
29
+ (0, swagger_1.ApiProperty)({ type: Object, isArray: true })
33
30
  ], ResponseListDto.prototype, "data", void 0);
34
31
  //# sourceMappingURL=response.dto.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"response.dto.js","sourceRoot":"","sources":["../../src/decorators/response.dto.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;AAEH,6CAAmE;AAEnE,MAAa,WAAW;CASvB;AATD,kCASC;AAPC;IADC,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,iEAAiE,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;yCAC/F;AAGb;IADC,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,oBAAoB,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;4CAClD;AAGhB;IADC,IAAA,6BAAmB,EAAC,EAAE,WAAW,EAAE,qBAAqB,EAAE,CAAC;2CAC5C;AAGlB,MAAa,cAAsB,SAAQ,WAAW;CAGrD;AAHD,wCAGC;AADC;IADC,IAAA,qBAAW,GAAE;4CACF;AAGd,MAAa,eAAuB,SAAQ,WAAW;CAGtD;AAHD,0CAGC;AADC;IADC,IAAA,qBAAW,GAAE;6CACA"}
1
+ {"version":3,"file":"response.dto.js","sourceRoot":"","sources":["../../src/decorators/response.dto.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;AAEH,6CAAmE;AAEnE,MAAa,WAAW;CAMvB;AAND,kCAMC;AAJC;IADC,IAAA,qBAAW,EAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,iEAAiE,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;yCAC/G;AAGb;IADC,IAAA,6BAAmB,EAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,qBAAqB,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;2CACzE;AAGlB,MAAa,cAAsB,SAAQ,WAAW;CAGrD;AAHD,wCAGC;AADC;IADC,IAAA,qBAAW,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;4CAClB;AAGd,MAAa,eAAuB,SAAQ,WAAW;CAGtD;AAHD,0CAGC;AADC;IADC,IAAA,qBAAW,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;6CAC/B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@volare.finance/nestjs.plugins",
3
- "version": "1.1.7",
3
+ "version": "1.1.9",
4
4
  "description": "@volare.finance/nestjs.plugins",
5
5
  "keywords": [
6
6
  "nest.js",
@@ -19,22 +19,21 @@
19
19
  "dependencies": {
20
20
  "@aws-sdk/client-s3": "^3.332.0",
21
21
  "@nestjs/common": "^10.2.0",
22
- "@nestjs/swagger": "^7.1.10",
22
+ "@nestjs/swagger": "^8.1.0",
23
23
  "axios": "^1.7.0",
24
24
  "dotenv": "^16.4.0",
25
25
  "winston": "^3.12.0"
26
26
  },
27
27
  "devDependencies": {
28
- "@types/express": "^4.17.21",
28
+ "@types/express": "^5.0.0",
29
29
  "@types/node": "^20.3.1",
30
- "@typescript-eslint/eslint-plugin": "^6.0.0",
31
- "@typescript-eslint/parser": "^6.0.0",
32
- "eslint": "^8.42.0",
30
+ "@typescript-eslint/eslint-plugin": "^8.0.0",
31
+ "@typescript-eslint/parser": "^8.0.0",
32
+ "eslint": "^8.56.0",
33
33
  "eslint-config-prettier": "^9.0.0",
34
34
  "eslint-plugin-prettier": "^5.0.0",
35
- "express": "^4.19.2",
36
- "prettier": "^3.0.0",
37
- "typescript": "^5.1.3"
35
+ "express": "^5.0.0",
36
+ "prettier": "^3.0.0"
38
37
  },
39
38
  "homepage": "https://github.com/volare-dev/nestjs.plugins#readme",
40
39
  "repository": {