@klerick/json-api-nestjs 10.0.0-beta.11 → 10.0.0-beta.12
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/CHANGELOG.md +16 -0
- package/package.json +3 -2
- package/src/index.d.ts +1 -1
- package/src/index.js +2 -1
- package/src/index.js.map +1 -1
- package/src/lib/modules/mixin/decorators/index.d.ts +1 -0
- package/src/lib/modules/mixin/decorators/index.js +1 -0
- package/src/lib/modules/mixin/decorators/index.js.map +1 -1
- package/src/lib/modules/mixin/decorators/json-api-response-from/json-api-response-from.decorator.d.ts +19 -0
- package/src/lib/modules/mixin/decorators/json-api-response-from/json-api-response-from.decorator.js +35 -0
- package/src/lib/modules/mixin/decorators/json-api-response-from/json-api-response-from.decorator.js.map +1 -0
- package/src/lib/modules/mixin/swagger/error-response-model.d.ts +49 -0
- package/src/lib/modules/mixin/swagger/error-response-model.js +125 -0
- package/src/lib/modules/mixin/swagger/error-response-model.js.map +1 -0
- package/src/lib/modules/mixin/swagger/method/delete-one.js +3 -3
- package/src/lib/modules/mixin/swagger/method/delete-one.js.map +1 -1
- package/src/lib/modules/mixin/swagger/method/delete-relationship.js +4 -4
- package/src/lib/modules/mixin/swagger/method/delete-relationship.js.map +1 -1
- package/src/lib/modules/mixin/swagger/method/get-all.js +2 -1
- package/src/lib/modules/mixin/swagger/method/get-all.js.map +1 -1
- package/src/lib/modules/mixin/swagger/method/get-one.js +3 -2
- package/src/lib/modules/mixin/swagger/method/get-one.js.map +1 -1
- package/src/lib/modules/mixin/swagger/method/get-relationship.js +4 -3
- package/src/lib/modules/mixin/swagger/method/get-relationship.js.map +1 -1
- package/src/lib/modules/mixin/swagger/method/patch-one.js +3 -2
- package/src/lib/modules/mixin/swagger/method/patch-one.js.map +1 -1
- package/src/lib/modules/mixin/swagger/method/patch-relationship.js +4 -3
- package/src/lib/modules/mixin/swagger/method/patch-relationship.js.map +1 -1
- package/src/lib/modules/mixin/swagger/method/post-one.js +3 -2
- package/src/lib/modules/mixin/swagger/method/post-one.js.map +1 -1
- package/src/lib/modules/mixin/swagger/method/post-relationship.js +4 -3
- package/src/lib/modules/mixin/swagger/method/post-relationship.js.map +1 -1
- package/src/lib/modules/mixin/swagger/swagger-bind.service.d.ts +1 -0
- package/src/lib/modules/mixin/swagger/swagger-bind.service.js +38 -0
- package/src/lib/modules/mixin/swagger/swagger-bind.service.js.map +1 -1
- package/src/lib/modules/mixin/swagger/utils.d.ts +0 -38
- package/src/lib/modules/mixin/swagger/utils.js +1 -39
- package/src/lib/modules/mixin/swagger/utils.js.map +1 -1
- package/src/lib/modules/mixin/zod/zod-input-query-schema/filter.d.ts +4 -4
- package/src/lib/modules/mixin/zod/zod-input-query-schema/index.d.ts +4 -4
- package/src/lib/modules/mixin/zod/zod-query-schema/include.d.ts +9 -2
- package/src/lib/modules/mixin/zod/zod-query-schema/include.js +2 -1
- package/src/lib/modules/mixin/zod/zod-query-schema/include.js.map +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
## 10.0.0-beta.12 (2026-01-23)
|
|
2
|
+
|
|
3
|
+
### 🚀 Features
|
|
4
|
+
|
|
5
|
+
- **json-api-nestjs:** enhance ZodIncludeQuery with improved type definitions and utility functions ([c4a5856](https://github.com/klerick/nestjs-json-api/commit/c4a5856))
|
|
6
|
+
- **json-api-nestjs:** add JsonApiResponseFrom decorator for reusing response schemas across methods ([f1f49c1](https://github.com/klerick/nestjs-json-api/commit/f1f49c1))
|
|
7
|
+
- **json-api-nestjs:** replace `errorSchema` with `JsonApiErrorResponseModel`, update response schema handling across Swagger methods ([4e7f481](https://github.com/klerick/nestjs-json-api/commit/4e7f481))
|
|
8
|
+
|
|
9
|
+
### 🧱 Updated Dependencies
|
|
10
|
+
|
|
11
|
+
- Updated json-api-nestjs-shared to 1.0.0-beta.5
|
|
12
|
+
|
|
13
|
+
### ❤️ Thank You
|
|
14
|
+
|
|
15
|
+
- Alex H
|
|
16
|
+
|
|
1
17
|
## 10.0.0-beta.11 (2026-01-22)
|
|
2
18
|
|
|
3
19
|
### 🚀 Features
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@klerick/json-api-nestjs",
|
|
3
|
-
"version": "10.0.0-beta.
|
|
3
|
+
"version": "10.0.0-beta.12",
|
|
4
4
|
"type": "commonjs",
|
|
5
5
|
"description": "JsonApi Plugin for NestJs",
|
|
6
6
|
"keywords": [
|
|
@@ -21,7 +21,8 @@
|
|
|
21
21
|
"tslib": ">2.3.0"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@klerick/json-api-nestjs-shared": "^1.0.0-beta.
|
|
24
|
+
"@klerick/json-api-nestjs-shared": "^1.0.0-beta.5",
|
|
25
|
+
"ts-toolbelt": "^9.6.0",
|
|
25
26
|
"zod": "^4.1.0",
|
|
26
27
|
"zod-validation-error": "^4.0.0"
|
|
27
28
|
},
|
package/src/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { JsonApiModule } from './lib/json-api.module';
|
|
2
2
|
export { JsonBaseController } from './lib/modules/mixin/controllers/json-base.controller';
|
|
3
|
-
export { JsonApi, InjectService, JsonApiReadOnly, JsonApiImmutable } from './lib/modules/mixin/decorators';
|
|
3
|
+
export { JsonApi, InjectService, JsonApiReadOnly, JsonApiImmutable, JsonApiResponseFrom } from './lib/modules/mixin/decorators';
|
|
4
4
|
export { entityForClass, excludeMethod, patchInputData, } from './lib/modules/mixin/helpers/utils';
|
|
5
5
|
export { PrepareParams, NestProvider, ValidateQueryError, UnionToTuple, EntityParam, TypeField, Params, JsonApiReadOnlyField, JsonApiImmutableField, } from './lib/types';
|
|
6
6
|
export { JsonApiTransformerService, ErrorFormatService, EntityParamMapService } from './lib/modules/mixin/service';
|
package/src/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.METHOD_NAME = exports.CURRENT_ENTITY = exports.DEFAULT_QUERY_PAGE = exports.DEFAULT_PAGE_SIZE = exports.ENTITY_PARAM_MAP = exports.ORM_SERVICE = exports.RUN_IN_TRANSACTION_FUNCTION = exports.CHECK_RELATION_NAME = exports.FIND_ONE_ROW_ENTITY = exports.DESC = exports.ASC = exports.CONTROLLER_OPTIONS_TOKEN = exports.MODULE_OPTIONS_TOKEN = exports.EntityParamMapService = exports.ErrorFormatService = exports.JsonApiTransformerService = exports.TypeField = exports.patchInputData = exports.excludeMethod = exports.entityForClass = exports.JsonApiImmutable = exports.JsonApiReadOnly = exports.InjectService = exports.JsonApi = exports.JsonBaseController = exports.JsonApiModule = void 0;
|
|
3
|
+
exports.METHOD_NAME = exports.CURRENT_ENTITY = exports.DEFAULT_QUERY_PAGE = exports.DEFAULT_PAGE_SIZE = exports.ENTITY_PARAM_MAP = exports.ORM_SERVICE = exports.RUN_IN_TRANSACTION_FUNCTION = exports.CHECK_RELATION_NAME = exports.FIND_ONE_ROW_ENTITY = exports.DESC = exports.ASC = exports.CONTROLLER_OPTIONS_TOKEN = exports.MODULE_OPTIONS_TOKEN = exports.EntityParamMapService = exports.ErrorFormatService = exports.JsonApiTransformerService = exports.TypeField = exports.patchInputData = exports.excludeMethod = exports.entityForClass = exports.JsonApiResponseFrom = exports.JsonApiImmutable = exports.JsonApiReadOnly = exports.InjectService = exports.JsonApi = exports.JsonBaseController = exports.JsonApiModule = void 0;
|
|
4
4
|
var json_api_module_1 = require("./lib/json-api.module");
|
|
5
5
|
Object.defineProperty(exports, "JsonApiModule", { enumerable: true, get: function () { return json_api_module_1.JsonApiModule; } });
|
|
6
6
|
var json_base_controller_1 = require("./lib/modules/mixin/controllers/json-base.controller");
|
|
@@ -10,6 +10,7 @@ Object.defineProperty(exports, "JsonApi", { enumerable: true, get: function () {
|
|
|
10
10
|
Object.defineProperty(exports, "InjectService", { enumerable: true, get: function () { return decorators_1.InjectService; } });
|
|
11
11
|
Object.defineProperty(exports, "JsonApiReadOnly", { enumerable: true, get: function () { return decorators_1.JsonApiReadOnly; } });
|
|
12
12
|
Object.defineProperty(exports, "JsonApiImmutable", { enumerable: true, get: function () { return decorators_1.JsonApiImmutable; } });
|
|
13
|
+
Object.defineProperty(exports, "JsonApiResponseFrom", { enumerable: true, get: function () { return decorators_1.JsonApiResponseFrom; } });
|
|
13
14
|
var utils_1 = require("./lib/modules/mixin/helpers/utils");
|
|
14
15
|
Object.defineProperty(exports, "entityForClass", { enumerable: true, get: function () { return utils_1.entityForClass; } });
|
|
15
16
|
Object.defineProperty(exports, "excludeMethod", { enumerable: true, get: function () { return utils_1.excludeMethod; } });
|
package/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../libs/json-api/json-api-nestjs/src/index.ts"],"names":[],"mappings":";;;AAAA,yDAAsD;AAA7C,gHAAA,aAAa,OAAA;AAEtB,6FAA0F;AAAjF,0HAAA,kBAAkB,OAAA;AAC3B,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../libs/json-api/json-api-nestjs/src/index.ts"],"names":[],"mappings":";;;AAAA,yDAAsD;AAA7C,gHAAA,aAAa,OAAA;AAEtB,6FAA0F;AAAjF,0HAAA,kBAAkB,OAAA;AAC3B,6DAAgI;AAAvH,qGAAA,OAAO,OAAA;AAAE,2GAAA,aAAa,OAAA;AAAE,6GAAA,eAAe,OAAA;AAAE,8GAAA,gBAAgB,OAAA;AAAE,iHAAA,mBAAmB,OAAA;AACvF,2DAI2C;AAHzC,uGAAA,cAAc,OAAA;AACd,sGAAA,aAAa,OAAA;AACb,uGAAA,cAAc,OAAA;AAEhB,qCAUqB;AAJnB,kGAAA,SAAS,OAAA;AAKX,uDAIqC;AAHnC,oHAAA,yBAAyB,OAAA;AACzB,6GAAA,kBAAkB,OAAA;AAClB,gHAAA,qBAAqB,OAAA;AAEvB,6CAcyB;AAbvB,iHAAA,oBAAoB,OAAA;AACpB,qHAAA,wBAAwB,OAAA;AACxB,gGAAA,GAAG,OAAA;AACH,iGAAA,IAAI,OAAA;AACJ,gHAAA,mBAAmB,OAAA;AACnB,gHAAA,mBAAmB,OAAA;AACnB,wHAAA,2BAA2B,OAAA;AAC3B,wGAAA,WAAW,OAAA;AACX,6GAAA,gBAAgB,OAAA;AAChB,8GAAA,iBAAiB,OAAA;AACjB,+GAAA,kBAAkB,OAAA;AAClB,2GAAA,cAAc,OAAA;AACd,wGAAA,WAAW,OAAA"}
|
|
@@ -4,4 +4,5 @@ const tslib_1 = require("tslib");
|
|
|
4
4
|
tslib_1.__exportStar(require("./json-api/json-api.decorator"), exports);
|
|
5
5
|
tslib_1.__exportStar(require("./inject-service/inject-service.decorator"), exports);
|
|
6
6
|
tslib_1.__exportStar(require("./json-api-read-only/json-api-read-only.decorator"), exports);
|
|
7
|
+
tslib_1.__exportStar(require("./json-api-response-from/json-api-response-from.decorator"), exports);
|
|
7
8
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../libs/json-api/json-api-nestjs/src/lib/modules/mixin/decorators/index.ts"],"names":[],"mappings":";;;AAAA,wEAA8C;AAC9C,oFAA0D;AAC1D,4FAAkE"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../libs/json-api/json-api-nestjs/src/lib/modules/mixin/decorators/index.ts"],"names":[],"mappings":";;;AAAA,wEAA8C;AAC9C,oFAA0D;AAC1D,4FAAkE;AAClE,oGAA0E"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { MethodName } from '../../types';
|
|
2
|
+
export declare const JSON_API_RESPONSE_FROM = "JSON_API_RESPONSE_FROM";
|
|
3
|
+
export interface StatusMapping {
|
|
4
|
+
fromStatus: number;
|
|
5
|
+
toStatus: number;
|
|
6
|
+
}
|
|
7
|
+
export type SourceMethodStatuses = {
|
|
8
|
+
[K in MethodName]?: StatusMapping[];
|
|
9
|
+
};
|
|
10
|
+
export type JsonApiResponseFromMeta = {
|
|
11
|
+
[targetMethod: string]: SourceMethodStatuses;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Decorator to copy response schema from another JSON API method
|
|
15
|
+
* @param sourceMethod - name of the source method (e.g., 'getOne', 'getAll')
|
|
16
|
+
* @param fromStatus - HTTP status code to copy from source method
|
|
17
|
+
* @param toStatus - HTTP status code to apply to target method (defaults to fromStatus)
|
|
18
|
+
*/
|
|
19
|
+
export declare function JsonApiResponseFrom(sourceMethod: MethodName, fromStatus: number, toStatus?: number): MethodDecorator;
|
package/src/lib/modules/mixin/decorators/json-api-response-from/json-api-response-from.decorator.js
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.JSON_API_RESPONSE_FROM = void 0;
|
|
4
|
+
exports.JsonApiResponseFrom = JsonApiResponseFrom;
|
|
5
|
+
exports.JSON_API_RESPONSE_FROM = 'JSON_API_RESPONSE_FROM';
|
|
6
|
+
/**
|
|
7
|
+
* Decorator to copy response schema from another JSON API method
|
|
8
|
+
* @param sourceMethod - name of the source method (e.g., 'getOne', 'getAll')
|
|
9
|
+
* @param fromStatus - HTTP status code to copy from source method
|
|
10
|
+
* @param toStatus - HTTP status code to apply to target method (defaults to fromStatus)
|
|
11
|
+
*/
|
|
12
|
+
function JsonApiResponseFrom(sourceMethod, fromStatus, toStatus) {
|
|
13
|
+
return (target, propertyKey, descriptor) => {
|
|
14
|
+
const targetMethod = String(propertyKey);
|
|
15
|
+
const existingMeta = Reflect.getMetadata(exports.JSON_API_RESPONSE_FROM, target.constructor) || {};
|
|
16
|
+
if (!existingMeta[targetMethod]) {
|
|
17
|
+
existingMeta[targetMethod] = {};
|
|
18
|
+
}
|
|
19
|
+
if (!existingMeta[targetMethod][sourceMethod]) {
|
|
20
|
+
existingMeta[targetMethod][sourceMethod] = [];
|
|
21
|
+
}
|
|
22
|
+
const currentSourceArray = existingMeta[targetMethod][sourceMethod];
|
|
23
|
+
const mapping = {
|
|
24
|
+
fromStatus,
|
|
25
|
+
toStatus: toStatus ?? fromStatus,
|
|
26
|
+
};
|
|
27
|
+
const exists = currentSourceArray.some((m) => m.fromStatus === mapping.fromStatus && m.toStatus === mapping.toStatus);
|
|
28
|
+
if (!exists) {
|
|
29
|
+
currentSourceArray.push(mapping);
|
|
30
|
+
}
|
|
31
|
+
Reflect.defineMetadata(exports.JSON_API_RESPONSE_FROM, existingMeta, target.constructor);
|
|
32
|
+
return descriptor;
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=json-api-response-from.decorator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"json-api-response-from.decorator.js","sourceRoot":"","sources":["../../../../../../../../../../libs/json-api/json-api-nestjs/src/lib/modules/mixin/decorators/json-api-response-from/json-api-response-from.decorator.ts"],"names":[],"mappings":";;;AAmBA,kDAyCC;AA1DY,QAAA,sBAAsB,GAAG,wBAAwB,CAAC;AAW/D;;;;;GAKG;AACH,SAAgB,mBAAmB,CACjC,YAAwB,EACxB,UAAkB,EAClB,QAAiB;IAEjB,OAAO,CAAC,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE,EAAE;QACzC,MAAM,YAAY,GAAG,MAAM,CAAC,WAAW,CAAC,CAAC;QACzC,MAAM,YAAY,GAChB,OAAO,CAAC,WAAW,CAAC,8BAAsB,EAAE,MAAM,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC;QAExE,IAAI,CAAC,YAAY,CAAC,YAAY,CAAC,EAAE,CAAC;YAChC,YAAY,CAAC,YAAY,CAAC,GAAG,EAAE,CAAC;QAClC,CAAC;QAED,IAAI,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC,YAAY,CAAC,EAAE,CAAC;YAC9C,YAAY,CAAC,YAAY,CAAC,CAAC,YAAY,CAAC,GAAG,EAAE,CAAC;QAChD,CAAC;QACD,MAAM,kBAAkB,GAAG,YAAY,CAAC,YAAY,CAAC,CAAC,YAAY,CAAC,CAAC;QAEpE,MAAM,OAAO,GAAkB;YAC7B,UAAU;YACV,QAAQ,EAAE,QAAQ,IAAI,UAAU;SACjC,CAAC;QAEF,MAAM,MAAM,GAAG,kBAAkB,CAAC,IAAI,CACpC,CAAC,CAAC,EAAE,EAAE,CACJ,CAAC,CAAC,UAAU,KAAK,OAAO,CAAC,UAAU,IAAI,CAAC,CAAC,QAAQ,KAAK,OAAO,CAAC,QAAQ,CACzE,CAAC;QAEF,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,kBAAkB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACnC,CAAC;QAED,OAAO,CAAC,cAAc,CACpB,8BAAsB,EACtB,YAAY,EACZ,MAAM,CAAC,WAAW,CACnB,CAAC;QAEF,OAAO,UAAU,CAAC;IACpB,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
export declare const errorSchema: {
|
|
2
|
+
type: string;
|
|
3
|
+
properties: {
|
|
4
|
+
statusCode: {
|
|
5
|
+
type: string;
|
|
6
|
+
};
|
|
7
|
+
error: {
|
|
8
|
+
type: string;
|
|
9
|
+
};
|
|
10
|
+
message: {
|
|
11
|
+
type: string;
|
|
12
|
+
items: {
|
|
13
|
+
type: string;
|
|
14
|
+
properties: {
|
|
15
|
+
code: {
|
|
16
|
+
type: string;
|
|
17
|
+
};
|
|
18
|
+
message: {
|
|
19
|
+
type: string;
|
|
20
|
+
};
|
|
21
|
+
path: {
|
|
22
|
+
type: string;
|
|
23
|
+
items: {
|
|
24
|
+
type: string;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
keys: {
|
|
28
|
+
type: string;
|
|
29
|
+
items: {
|
|
30
|
+
type: string;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
required: string[];
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
export declare class JsonApiErrorMessageItem {
|
|
40
|
+
code: string;
|
|
41
|
+
message: string;
|
|
42
|
+
path: string[];
|
|
43
|
+
keys?: string[];
|
|
44
|
+
}
|
|
45
|
+
export declare class JsonApiErrorResponseModel {
|
|
46
|
+
statusCode: number;
|
|
47
|
+
error: string;
|
|
48
|
+
message: JsonApiErrorMessageItem[];
|
|
49
|
+
}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.JsonApiErrorResponseModel = exports.JsonApiErrorMessageItem = exports.errorSchema = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
6
|
+
exports.errorSchema = {
|
|
7
|
+
type: 'object',
|
|
8
|
+
properties: {
|
|
9
|
+
statusCode: {
|
|
10
|
+
type: 'number',
|
|
11
|
+
},
|
|
12
|
+
error: {
|
|
13
|
+
type: 'string',
|
|
14
|
+
},
|
|
15
|
+
message: {
|
|
16
|
+
type: 'array',
|
|
17
|
+
items: {
|
|
18
|
+
type: 'object',
|
|
19
|
+
properties: {
|
|
20
|
+
code: {
|
|
21
|
+
type: 'string',
|
|
22
|
+
},
|
|
23
|
+
message: {
|
|
24
|
+
type: 'string',
|
|
25
|
+
},
|
|
26
|
+
path: {
|
|
27
|
+
type: 'array',
|
|
28
|
+
items: {
|
|
29
|
+
type: 'string',
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
keys: {
|
|
33
|
+
type: 'array',
|
|
34
|
+
items: {
|
|
35
|
+
type: 'string',
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
required: ['code', 'message', 'path'],
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
};
|
|
44
|
+
const ErrorMessageItemSchema = {
|
|
45
|
+
type: 'object',
|
|
46
|
+
properties: {
|
|
47
|
+
code: {
|
|
48
|
+
type: 'string',
|
|
49
|
+
},
|
|
50
|
+
message: {
|
|
51
|
+
type: 'string',
|
|
52
|
+
},
|
|
53
|
+
path: {
|
|
54
|
+
type: 'array',
|
|
55
|
+
items: {
|
|
56
|
+
type: 'string',
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
keys: {
|
|
60
|
+
type: 'array',
|
|
61
|
+
items: {
|
|
62
|
+
type: 'string',
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
required: ['code', 'message', 'path'],
|
|
67
|
+
};
|
|
68
|
+
class JsonApiErrorMessageItem {
|
|
69
|
+
code;
|
|
70
|
+
message;
|
|
71
|
+
path;
|
|
72
|
+
keys;
|
|
73
|
+
}
|
|
74
|
+
exports.JsonApiErrorMessageItem = JsonApiErrorMessageItem;
|
|
75
|
+
tslib_1.__decorate([
|
|
76
|
+
(0, swagger_1.ApiProperty)({ type: 'string', title: 'Error code' }),
|
|
77
|
+
tslib_1.__metadata("design:type", String)
|
|
78
|
+
], JsonApiErrorMessageItem.prototype, "code", void 0);
|
|
79
|
+
tslib_1.__decorate([
|
|
80
|
+
(0, swagger_1.ApiProperty)({ type: 'string', title: 'Error message' }),
|
|
81
|
+
tslib_1.__metadata("design:type", String)
|
|
82
|
+
], JsonApiErrorMessageItem.prototype, "message", void 0);
|
|
83
|
+
tslib_1.__decorate([
|
|
84
|
+
(0, swagger_1.ApiProperty)({
|
|
85
|
+
type: 'array',
|
|
86
|
+
items: { type: 'string' },
|
|
87
|
+
title: 'Path to the error field',
|
|
88
|
+
}),
|
|
89
|
+
tslib_1.__metadata("design:type", Array)
|
|
90
|
+
], JsonApiErrorMessageItem.prototype, "path", void 0);
|
|
91
|
+
tslib_1.__decorate([
|
|
92
|
+
(0, swagger_1.ApiProperty)({
|
|
93
|
+
type: 'array',
|
|
94
|
+
items: { type: 'string' },
|
|
95
|
+
required: false,
|
|
96
|
+
title: 'Additional keys',
|
|
97
|
+
}),
|
|
98
|
+
tslib_1.__metadata("design:type", Array)
|
|
99
|
+
], JsonApiErrorMessageItem.prototype, "keys", void 0);
|
|
100
|
+
let JsonApiErrorResponseModel = class JsonApiErrorResponseModel {
|
|
101
|
+
statusCode;
|
|
102
|
+
error;
|
|
103
|
+
message;
|
|
104
|
+
};
|
|
105
|
+
exports.JsonApiErrorResponseModel = JsonApiErrorResponseModel;
|
|
106
|
+
tslib_1.__decorate([
|
|
107
|
+
(0, swagger_1.ApiProperty)({ type: 'number', title: 'HTTP status code' }),
|
|
108
|
+
tslib_1.__metadata("design:type", Number)
|
|
109
|
+
], JsonApiErrorResponseModel.prototype, "statusCode", void 0);
|
|
110
|
+
tslib_1.__decorate([
|
|
111
|
+
(0, swagger_1.ApiProperty)({ type: 'string', title: 'Error type' }),
|
|
112
|
+
tslib_1.__metadata("design:type", String)
|
|
113
|
+
], JsonApiErrorResponseModel.prototype, "error", void 0);
|
|
114
|
+
tslib_1.__decorate([
|
|
115
|
+
(0, swagger_1.ApiProperty)({
|
|
116
|
+
type: 'array',
|
|
117
|
+
items: { $ref: (0, swagger_1.getSchemaPath)(JsonApiErrorMessageItem) },
|
|
118
|
+
title: 'Error details',
|
|
119
|
+
}),
|
|
120
|
+
tslib_1.__metadata("design:type", Array)
|
|
121
|
+
], JsonApiErrorResponseModel.prototype, "message", void 0);
|
|
122
|
+
exports.JsonApiErrorResponseModel = JsonApiErrorResponseModel = tslib_1.__decorate([
|
|
123
|
+
(0, swagger_1.ApiExtraModels)(JsonApiErrorMessageItem)
|
|
124
|
+
], JsonApiErrorResponseModel);
|
|
125
|
+
//# sourceMappingURL=error-response-model.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error-response-model.js","sourceRoot":"","sources":["../../../../../../../../../libs/json-api/json-api-nestjs/src/lib/modules/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/swagger");
|
|
5
5
|
const types_1 = require("../../../../types");
|
|
6
|
-
const
|
|
6
|
+
const error_response_model_1 = require("../error-response-model");
|
|
7
7
|
function deleteOne(controller, descriptor, entity, mapEntity, methodName) {
|
|
8
8
|
const entityName = entity.name;
|
|
9
9
|
const { primaryColumnType } = mapEntity.getParamMap(entity);
|
|
@@ -20,7 +20,7 @@ function deleteOne(controller, descriptor, entity, mapEntity, methodName) {
|
|
|
20
20
|
(0, swagger_1.ApiResponse)({
|
|
21
21
|
status: 404,
|
|
22
22
|
description: `Item of resource "${entityName}" not found`,
|
|
23
|
-
schema:
|
|
23
|
+
schema: { $ref: (0, swagger_1.getSchemaPath)(error_response_model_1.JsonApiErrorResponseModel) },
|
|
24
24
|
})(controller, methodName, descriptor);
|
|
25
25
|
(0, swagger_1.ApiResponse)({
|
|
26
26
|
status: 204,
|
|
@@ -29,7 +29,7 @@ function deleteOne(controller, descriptor, entity, mapEntity, methodName) {
|
|
|
29
29
|
(0, swagger_1.ApiResponse)({
|
|
30
30
|
status: 400,
|
|
31
31
|
description: 'Wrong query parameters',
|
|
32
|
-
schema:
|
|
32
|
+
schema: { $ref: (0, swagger_1.getSchemaPath)(error_response_model_1.JsonApiErrorResponseModel) },
|
|
33
33
|
})(controller, methodName, descriptor);
|
|
34
34
|
}
|
|
35
35
|
//# sourceMappingURL=delete-one.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delete-one.js","sourceRoot":"","sources":["../../../../../../../../../../libs/json-api/json-api-nestjs/src/lib/modules/mixin/swagger/method/delete-one.ts"],"names":[],"mappings":";;AAQA,8BAuCC;AA9CD,
|
|
1
|
+
{"version":3,"file":"delete-one.js","sourceRoot":"","sources":["../../../../../../../../../../libs/json-api/json-api-nestjs/src/lib/modules/mixin/swagger/method/delete-one.ts"],"names":[],"mappings":";;AAQA,8BAuCC;AA9CD,6CAAqF;AAGrF,6CAA8C;AAE9C,kEAAoE;AAEpE,SAAgB,SAAS,CACvB,UAA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,CAAC,CAAC;AACzC,CAAC"}
|
|
@@ -5,7 +5,7 @@ const swagger_1 = require("@nestjs/swagger");
|
|
|
5
5
|
const zod_1 = require("zod");
|
|
6
6
|
const types_1 = require("../../../../types");
|
|
7
7
|
const zod_2 = require("../../zod");
|
|
8
|
-
const
|
|
8
|
+
const error_response_model_1 = require("../error-response-model");
|
|
9
9
|
function deleteRelationship(controller, descriptor, entity, mapEntity, methodName) {
|
|
10
10
|
const entityName = entity.name;
|
|
11
11
|
const { relations, primaryColumnType } = mapEntity.getParamMap(entity);
|
|
@@ -34,17 +34,17 @@ function deleteRelationship(controller, descriptor, entity, mapEntity, methodNam
|
|
|
34
34
|
(0, swagger_1.ApiResponse)({
|
|
35
35
|
status: 400,
|
|
36
36
|
description: 'Wrong url parameters',
|
|
37
|
-
schema:
|
|
37
|
+
schema: { $ref: (0, swagger_1.getSchemaPath)(error_response_model_1.JsonApiErrorResponseModel) },
|
|
38
38
|
})(controller, methodName, descriptor);
|
|
39
39
|
(0, swagger_1.ApiResponse)({
|
|
40
40
|
status: 422,
|
|
41
41
|
description: 'Incorrect type for relation',
|
|
42
|
-
schema:
|
|
42
|
+
schema: { $ref: (0, swagger_1.getSchemaPath)(error_response_model_1.JsonApiErrorResponseModel) },
|
|
43
43
|
})(controller, methodName, descriptor);
|
|
44
44
|
(0, swagger_1.ApiResponse)({
|
|
45
45
|
status: 404,
|
|
46
46
|
description: 'Resource not found ',
|
|
47
|
-
schema:
|
|
47
|
+
schema: { $ref: (0, swagger_1.getSchemaPath)(error_response_model_1.JsonApiErrorResponseModel) },
|
|
48
48
|
})(controller, methodName, descriptor);
|
|
49
49
|
(0, swagger_1.ApiResponse)({
|
|
50
50
|
status: 204,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delete-relationship.js","sourceRoot":"","sources":["../../../../../../../../../../libs/json-api/json-api-nestjs/src/lib/modules/mixin/swagger/method/delete-relationship.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"delete-relationship.js","sourceRoot":"","sources":["../../../../../../../../../../libs/json-api/json-api-nestjs/src/lib/modules/mixin/swagger/method/delete-relationship.ts"],"names":[],"mappings":";;AAqBA,gDAgEC;AArFD,6CAMyB;AACzB,6BAAwB;AAIxB,6CAA8C;AAC9C,mCAAiD;AAOjD,kEAAoE;AAEpE,SAAgB,kBAAkB,CAIhC,UAAqB,EACrB,UAA8B,EAC9B,MAAsB,EACtB,SAA0C,EAC1C,UAAkB;IAElB,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC;IAE/B,MAAM,EAAE,SAAS,EAAE,iBAAiB,EAAE,GAAG,SAAS,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;IAEvE,IAAA,sBAAY,EAAC;QACX,OAAO,EAAE,yCAAyC,UAAU,GAAG;QAC/D,WAAW,EAAE,GAAG,UAAU,CAAC,WAAW,CAAC,IAAI,IAAI,UAAU,EAAE;KAC5D,CAAC,CAAC,UAAU,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC;IAEvC,IAAA,kBAAQ,EAAC;QACP,IAAI,EAAE,IAAI;QACV,QAAQ,EAAE,IAAI;QACd,IAAI,EAAE,iBAAiB,KAAK,iBAAS,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ;QACnE,WAAW,EAAE,mBAAmB,UAAU,GAAG;KAC9C,CAAC,CAAC,UAAU,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC;IAEvC,IAAA,kBAAQ,EAAC;QACP,IAAI,EAAE,SAAS;QACf,QAAQ,EAAE,IAAI;QACd,IAAI,EAAE,QAAQ;QACd,IAAI,EAAE,SAAgB;QACtB,WAAW,EAAE,8BAA8B,UAAU,GAAG;KACzD,CAAC,CAAC,UAAU,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC;IAEvC,IAAA,iBAAO,EAAC;QACN,WAAW,EAAE,+BAA+B,UAAU,QAAQ;QAC9D,MAAM,EAAE,OAAC,CAAC,YAAY,CAAC,0BAAoB,CAExB;QACnB,QAAQ,EAAE,IAAI;KACf,CAAC,CAAC,UAAU,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC;IAEvC,IAAA,qBAAW,EAAC;QACV,MAAM,EAAE,GAAG;QACX,WAAW,EAAE,sBAAsB;QACnC,MAAM,EAAE,EAAE,IAAI,EAAE,IAAA,uBAAa,EAAC,gDAAyB,CAAC,EAAE;KAC3D,CAAC,CAAC,UAAU,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC;IAEvC,IAAA,qBAAW,EAAC;QACV,MAAM,EAAE,GAAG;QACX,WAAW,EAAE,6BAA6B;QAC1C,MAAM,EAAE,EAAE,IAAI,EAAE,IAAA,uBAAa,EAAC,gDAAyB,CAAC,EAAE;KAC3D,CAAC,CAAC,UAAU,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC;IAEvC,IAAA,qBAAW,EAAC;QACV,MAAM,EAAE,GAAG;QACX,WAAW,EAAE,qBAAqB;QAClC,MAAM,EAAE,EAAE,IAAI,EAAE,IAAA,uBAAa,EAAC,gDAAyB,CAAC,EAAE;KAC3D,CAAC,CAAC,UAAU,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC;IAEvC,IAAA,qBAAW,EAAC;QACV,MAAM,EAAE,GAAG;QACX,WAAW,EAAE,2BAA2B,UAAU,oBAAoB;KACvE,CAAC,CAAC,UAAU,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC;AACzC,CAAC"}
|
|
@@ -5,6 +5,7 @@ const swagger_1 = require("@nestjs/swagger");
|
|
|
5
5
|
const json_api_nestjs_shared_1 = require("@klerick/json-api-nestjs-shared");
|
|
6
6
|
const utils_1 = require("../utils");
|
|
7
7
|
const constants_1 = require("../../../../constants");
|
|
8
|
+
const error_response_model_1 = require("../error-response-model");
|
|
8
9
|
function getAll(controller, descriptor, entity, mapEntity, methodName) {
|
|
9
10
|
const { props, relations, relationProperty, primaryColumnName } = mapEntity.getParamMap(entity);
|
|
10
11
|
(0, utils_1.assertIsKeysOfObject)(entity, props);
|
|
@@ -230,7 +231,7 @@ function getAll(controller, descriptor, entity, mapEntity, methodName) {
|
|
|
230
231
|
(0, swagger_1.ApiResponse)({
|
|
231
232
|
status: 400,
|
|
232
233
|
description: 'Wrong query parameters',
|
|
233
|
-
schema:
|
|
234
|
+
schema: { $ref: (0, swagger_1.getSchemaPath)(error_response_model_1.JsonApiErrorResponseModel) },
|
|
234
235
|
})(controller, methodName, descriptor);
|
|
235
236
|
(0, swagger_1.ApiResponse)({
|
|
236
237
|
status: 200,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-all.js","sourceRoot":"","sources":["../../../../../../../../../../libs/json-api/json-api-nestjs/src/lib/modules/mixin/swagger/method/get-all.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"get-all.js","sourceRoot":"","sources":["../../../../../../../../../../libs/json-api/json-api-nestjs/src/lib/modules/mixin/swagger/method/get-all.ts"],"names":[],"mappings":";;AAqBA,wBAkQC;AAvRD,6CAKyB;AAEzB,4EAIyC;AAEzC,oCAGkB;AAClB,qDAA8E;AAE9E,kEAAoE;AAEpE,SAAgB,MAAM,CACpB,UAAqB,EACrB,UAA8B,EAC9B,MAAsB,EACtB,SAA0C,EAC1C,UAAkB;IAElB,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,GAC7D,SAAS,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;IAEhC,IAAA,4BAAoB,EAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IACpC,IAAA,4BAAoB,EAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IAExC,MAAM,uBAAuB,GAAG,EAAS,CAAC;IAC1C,MAAM,YAAY,GAAG,oCAAW,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC,MAAM,CAC/D,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE,EAAE;QACtB,MAAM,MAAM,G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AAE,CAAC;iBACX;gBACD,IAAI,EAAE;oBACJ,IAAI,EAAE,SAAS;oBACf,OAAO,EAAE,CAAC;oBACV,OAAO,EAAE,GAAG;iBACb;aACF;YACD,oBAAoB,EAAE,KAAK;SAC5B;QACD,WAAW,EAAE,IAAI,MAAM,CAAC,IAAI,wDAAwD;KACrF,CAAC,CAAC,UAAU,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC;IAEvC,IAAA,qBAAW,EAAC;QACV,MAAM,EAAE,GAAG;QACX,WAAW,EAAE,wBAAwB;QACrC,MAAM,EAAE,EAAE,IAAI,EAAE,IAAA,uBAAa,EAAC,gDAAyB,CAAC,EAAE;KAC3D,CAAC,CAAC,UAAU,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC;IAEvC,IAAA,qBAAW,EAAC;QACV,MAAM,EAAE,GAAG;QACX,WAAW,EAAE,qCAAqC;QAClD,MAAM,EAAE,IAAA,0BAAkB,EAAC,MAAM,EAAE,SAAS,EAAE,IAAI,CAAC;KACpD,CAAC,CAAC,UAAU,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC;AACzC,CAAC"}
|
|
@@ -5,6 +5,7 @@ const swagger_1 = require("@nestjs/swagger");
|
|
|
5
5
|
const json_api_nestjs_shared_1 = require("@klerick/json-api-nestjs-shared");
|
|
6
6
|
const utils_1 = require("../utils");
|
|
7
7
|
const types_1 = require("../../../../types");
|
|
8
|
+
const error_response_model_1 = require("../error-response-model");
|
|
8
9
|
function getOne(controller, descriptor, entity, mapEntity, methodName) {
|
|
9
10
|
const entityName = entity.name;
|
|
10
11
|
const { props, relations, relationProperty, primaryColumnName, primaryColumnType, } = mapEntity.getParamMap(entity);
|
|
@@ -77,12 +78,12 @@ function getOne(controller, descriptor, entity, mapEntity, methodName) {
|
|
|
77
78
|
(0, swagger_1.ApiResponse)({
|
|
78
79
|
status: 404,
|
|
79
80
|
description: `Item of resource "${entityName}" not found`,
|
|
80
|
-
schema:
|
|
81
|
+
schema: { $ref: (0, swagger_1.getSchemaPath)(error_response_model_1.JsonApiErrorResponseModel) },
|
|
81
82
|
})(controller, methodName, descriptor);
|
|
82
83
|
(0, swagger_1.ApiResponse)({
|
|
83
84
|
status: 400,
|
|
84
85
|
description: 'Wrong query parameters',
|
|
85
|
-
schema:
|
|
86
|
+
schema: { $ref: (0, swagger_1.getSchemaPath)(error_response_model_1.JsonApiErrorResponseModel) },
|
|
86
87
|
})(controller, methodName, descriptor);
|
|
87
88
|
(0, swagger_1.ApiResponse)({
|
|
88
89
|
status: 200,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-one.js","sourceRoot":"","sources":["../../../../../../../../../../libs/json-api/json-api-nestjs/src/lib/modules/mixin/swagger/method/get-one.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"get-one.js","sourceRoot":"","sources":["../../../../../../../../../../libs/json-api/json-api-nestjs/src/lib/modules/mixin/swagger/method/get-one.ts"],"names":[],"mappings":";;AAeA,wBA8GC;AA7HD,6CAMyB;AACzB,4EAA2E;AAG3E,oCAA8C;AAC9C,6CAA8C;AAE9C,kEAAoE;AAEpE,SAAgB,MAAM,CACpB,UAAqB,EACrB,UAA8B,EAC9B,MAAsB,EACtB,SAA0C,EAC1C,UAAkB;IAElB,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC;IAE/B,MAAM,EACJ,KAAK,EACL,SAAS,EACT,gBAAgB,EAChB,iBAAiB,EACjB,iBAAiB,GAClB,GAAG,SAAS,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;IAElC,MAAM,uBAAuB,GAAG,oCAAW,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC,MAAM,CAC1E,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE,EAAE;QACtB,MAAM,MAAM,GAAG,SAAS,CAAC,WAAW,CAAC,KAAK,CAAC,WAAkB,CAAC,CAAC;QAC/D,IAAI,CAAC,IAAI,CAAC,GAAG,MAAM,CAA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AU,EAAE,UAAU,CAAC,CAAC;IAEvC,IAAA,qBAAW,EAAC;QACV,MAAM,EAAE,GAAG;QACX,WAAW,EAAE,yCAAyC;QACtD,MAAM,EAAE,IAAA,0BAAkB,EAAC,MAAM,EAAE,SAAS,CAAC;KAC9C,CAAC,CAAC,UAAU,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC;AACzC,CAAC"}
|
|
@@ -4,6 +4,7 @@ exports.getRelationship = getRelationship;
|
|
|
4
4
|
const swagger_1 = require("@nestjs/swagger");
|
|
5
5
|
const types_1 = require("../../../../types");
|
|
6
6
|
const utils_1 = require("../utils");
|
|
7
|
+
const error_response_model_1 = require("../error-response-model");
|
|
7
8
|
function getRelationship(controller, descriptor, entity, mapEntity, methodName) {
|
|
8
9
|
const entityName = entity.name;
|
|
9
10
|
const { relations, primaryColumnType } = mapEntity.getParamMap(entity);
|
|
@@ -32,17 +33,17 @@ function getRelationship(controller, descriptor, entity, mapEntity, methodName)
|
|
|
32
33
|
(0, swagger_1.ApiResponse)({
|
|
33
34
|
status: 400,
|
|
34
35
|
description: 'Wrong url parameters',
|
|
35
|
-
schema:
|
|
36
|
+
schema: { $ref: (0, swagger_1.getSchemaPath)(error_response_model_1.JsonApiErrorResponseModel) },
|
|
36
37
|
})(controller, methodName, descriptor);
|
|
37
38
|
(0, swagger_1.ApiResponse)({
|
|
38
39
|
status: 422,
|
|
39
40
|
description: 'Incorrect type for relation',
|
|
40
|
-
schema:
|
|
41
|
+
schema: { $ref: (0, swagger_1.getSchemaPath)(error_response_model_1.JsonApiErrorResponseModel) },
|
|
41
42
|
})(controller, methodName, descriptor);
|
|
42
43
|
(0, swagger_1.ApiResponse)({
|
|
43
44
|
status: 404,
|
|
44
45
|
description: 'Resource not found ',
|
|
45
|
-
schema:
|
|
46
|
+
schema: { $ref: (0, swagger_1.getSchemaPath)(error_response_model_1.JsonApiErrorResponseModel) },
|
|
46
47
|
})(controller, methodName, descriptor);
|
|
47
48
|
}
|
|
48
49
|
//# sourceMappingURL=get-relationship.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-relationship.js","sourceRoot":"","sources":["../../../../../../../../../../libs/json-api/json-api-nestjs/src/lib/modules/mixin/swagger/method/get-relationship.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"get-relationship.js","sourceRoot":"","sources":["../../../../../../../../../../libs/json-api/json-api-nestjs/src/lib/modules/mixin/swagger/method/get-relationship.ts"],"names":[],"mappings":";;AAcA,0CAsDC;AAnED,6CAKyB;AAGzB,6CAA8C;AAC9C,oCAAiD;AAEjD,kEAAoE;AAEpE,SAAgB,eAAe,CAC7B,UAAqB,EACrB,UAA8B,EAC9B,MAAsB,EACtB,SAA0C,EAC1C,UAAkB;IAElB,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC;IAE/B,MAAM,EAAE,SAAS,EAAE,iBAAiB,EAAE,GAAG,SAAS,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;IAEvE,IAAA,sBAAY,EAAC;QACX,OAAO,EAAE,sCAAsC,UAAU,GAAG;QAC5D,WAAW,EAAE,GAAG,UAAU,CAAC,WAAW,CAAC,IAAI,IAAI,UAAU,EAAE;KAC5D,CAAC,CAAC,UAAU,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC;IAEvC,IAAA,kBAAQ,EAAC;QACP,IAAI,EAAE,IAAI;QACV,QAAQ,EAAE,IAAI;QACd,IAAI,EAAE,iBAAiB,KAAK,iBAAS,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ;QACnE,WAAW,EAAE,mBAAmB,UAAU,GAAG;KAC9C,CAAC,CAAC,UAAU,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC;IAEvC,IAAA,kBAAQ,EAAC;QACP,IAAI,EAAE,SAAS;QACf,QAAQ,EAAE,IAAI;QACd,IAAI,EAAE,QAAQ;QACd,IAAI,EAAE,SAAgB;QACtB,WAAW,EAAE,8BAA8B,UAAU,GAAG;KACzD,CAAC,CAAC,UAAU,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC;IAEvC,IAAA,qBAAW,EAAC;QACV,MAAM,EAAE,GAAG;QACX,MAAM,EAAE,6BAAqB;QAC7B,WAAW,EAAE,2BAA2B,UAAU,oBAAoB;KACvE,CAAC,CAAC,UAAU,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC;IAEvC,IAAA,qBAAW,EAAC;QACV,MAAM,EAAE,GAAG;QACX,WAAW,EAAE,sBAAsB;QACnC,MAAM,EAAE,EAAE,IAAI,EAAE,IAAA,uBAAa,EAAC,gDAAyB,CAAC,EAAE;KAC3D,CAAC,CAAC,UAAU,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC;IAEvC,IAAA,qBAAW,EAAC;QACV,MAAM,EAAE,GAAG;QACX,WAAW,EAAE,6BAA6B;QAC1C,MAAM,EAAE,EAAE,IAAI,EAAE,IAAA,uBAAa,EAAC,gDAAyB,CAAC,EAAE;KAC3D,CAAC,CAAC,UAAU,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC;IAEvC,IAAA,qBAAW,EAAC;QACV,MAAM,EAAE,GAAG;QACX,WAAW,EAAE,qBAAqB;QAClC,MAAM,EAAE,EAAE,IAAI,EAAE,IAAA,uBAAa,EAAC,gDAAyB,CAAC,EAAE;KAC3D,CAAC,CAAC,UAAU,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC;AACzC,CAAC"}
|
|
@@ -7,6 +7,7 @@ const types_1 = require("../../../../types");
|
|
|
7
7
|
const utils_1 = require("../utils");
|
|
8
8
|
const zod_2 = require("../../zod");
|
|
9
9
|
const decorators_1 = require("../../decorators");
|
|
10
|
+
const error_response_model_1 = require("../error-response-model");
|
|
10
11
|
function patchOne(controller, descriptor, entity, mapEntity, methodName) {
|
|
11
12
|
const entityName = entity.name;
|
|
12
13
|
const primaryColumnType = mapEntity.entityParaMap.primaryColumnType;
|
|
@@ -35,12 +36,12 @@ function patchOne(controller, descriptor, entity, mapEntity, methodName) {
|
|
|
35
36
|
(0, swagger_1.ApiResponse)({
|
|
36
37
|
status: 400,
|
|
37
38
|
description: 'Wrong body parameters',
|
|
38
|
-
schema:
|
|
39
|
+
schema: { $ref: (0, swagger_1.getSchemaPath)(error_response_model_1.JsonApiErrorResponseModel) },
|
|
39
40
|
})(controller, methodName, descriptor);
|
|
40
41
|
(0, swagger_1.ApiResponse)({
|
|
41
42
|
status: 422,
|
|
42
43
|
description: 'Unprocessable data',
|
|
43
|
-
schema:
|
|
44
|
+
schema: { $ref: (0, swagger_1.getSchemaPath)(error_response_model_1.JsonApiErrorResponseModel) },
|
|
44
45
|
})(controller, methodName, descriptor);
|
|
45
46
|
}
|
|
46
47
|
//# sourceMappingURL=patch-one.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"patch-one.js","sourceRoot":"","sources":["../../../../../../../../../../libs/json-api/json-api-nestjs/src/lib/modules/mixin/swagger/method/patch-one.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"patch-one.js","sourceRoot":"","sources":["../../../../../../../../../../libs/json-api/json-api-nestjs/src/lib/modules/mixin/swagger/method/patch-one.ts"],"names":[],"mappings":";;AAiCA,4BAuDC;AAvFD,6BAAwB;AAKxB,6CAMyB;AAGzB,6CAI2B;AAE3B,oCAGkB;AAClB,mCAAqC;AAErC,iDAG0B;AAC1B,kEAAoE;AAEpE,SAAgB,QAAQ,CACtB,UAAqB,EACrB,UAA8B,EAC9B,MAAsB,EACtB,SAA0C,EAC1C,UAAkB;IAElB,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC;IAE/B,MAAM,iBAAiB,GAAG,SAAS,CAAC,aAAa,CAAC,iBAAiB,CAAC;IACpE,MAAM,aAAa,GAAG,IAAA,qCAAwB,EAC5C,MAAM,CAC4B,CAAC;IACrC,MAAM,cAAc,GAAG,IAAA,sCAAyB,EAC9C,MAAM,CAC6B,CAAC;IAEtC,IAAA,sBAAY,EAA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EAAE,IAAI,EAAE,IAAA,uBAAa,EAAC,gDAAyB,CAAC,EAAE;KAC3D,CAAC,CAAC,UAAU,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC;AACzC,CAAC"}
|
|
@@ -6,6 +6,7 @@ const zod_1 = require("zod");
|
|
|
6
6
|
const types_1 = require("../../../../types");
|
|
7
7
|
const utils_1 = require("../utils");
|
|
8
8
|
const zod_2 = require("../../zod");
|
|
9
|
+
const error_response_model_1 = require("../error-response-model");
|
|
9
10
|
function patchRelationship(controller, descriptor, entity, mapEntity, methodName) {
|
|
10
11
|
const entityName = entity.name;
|
|
11
12
|
const { relations, primaryColumnType } = mapEntity.getParamMap(entity);
|
|
@@ -39,17 +40,17 @@ function patchRelationship(controller, descriptor, entity, mapEntity, methodName
|
|
|
39
40
|
(0, swagger_1.ApiResponse)({
|
|
40
41
|
status: 400,
|
|
41
42
|
description: 'Wrong url parameters',
|
|
42
|
-
schema:
|
|
43
|
+
schema: { $ref: (0, swagger_1.getSchemaPath)(error_response_model_1.JsonApiErrorResponseModel) },
|
|
43
44
|
})(controller.prototype, methodName, descriptor);
|
|
44
45
|
(0, swagger_1.ApiResponse)({
|
|
45
46
|
status: 422,
|
|
46
47
|
description: 'Incorrect type for relation',
|
|
47
|
-
schema:
|
|
48
|
+
schema: { $ref: (0, swagger_1.getSchemaPath)(error_response_model_1.JsonApiErrorResponseModel) },
|
|
48
49
|
})(controller.prototype, methodName, descriptor);
|
|
49
50
|
(0, swagger_1.ApiResponse)({
|
|
50
51
|
status: 404,
|
|
51
52
|
description: 'Resource not found ',
|
|
52
|
-
schema:
|
|
53
|
+
schema: { $ref: (0, swagger_1.getSchemaPath)(error_response_model_1.JsonApiErrorResponseModel) },
|
|
53
54
|
})(controller.prototype, methodName, descriptor);
|
|
54
55
|
}
|
|
55
56
|
//# sourceMappingURL=patch-relationship.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"patch-relationship.js","sourceRoot":"","sources":["../../../../../../../../../../libs/json-api/json-api-nestjs/src/lib/modules/mixin/swagger/method/patch-relationship.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"patch-relationship.js","sourceRoot":"","sources":["../../../../../../../../../../libs/json-api/json-api-nestjs/src/lib/modules/mixin/swagger/method/patch-relationship.ts"],"names":[],"mappings":";;AAqBA,8CAiEC;AAtFD,6CAMyB;AAKzB,6BAAwB;AAIxB,6CAA8C;AAC9C,oCAAiD;AACjD,mCAAiD;AAEjD,kEAAoE;AAEpE,SAAgB,iBAAiB,CAI/B,UAAqB,EACrB,UAA8B,EAC9B,MAAsB,EACtB,SAA0C,EAC1C,UAAkB;IAElB,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC;IAE/B,MAAM,EAAE,SAAS,EAAE,iBAAiB,EAAE,GAAG,SAAS,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;IAEvE,IAAA,sBAAY,EAAC;QACX,OAAO,EAAE,yCAAyC,UAAU,GAAG;QAC/D,WAAW,EAAE,GAAG,UAAU,CAAC,WAAW,CAAC,IAAI,IAAI,UAAU,EAAE;KAC5D,CAAC,CAAC,UAAU,CAAC,SAAS,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC;IAEjD,IAAA,kBAAQ,EAAC;QACP,IAAI,EAAE,IAAI;QACV,QAAQ,EAAE,IAAI;QACd,IAAI,EAAE,iBAAiB,KAAK,iBAAS,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ;QACnE,WAAW,EAAE,mBAAmB,UAAU,GAAG;KAC9C,CAAC,CAAC,UAAU,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC;IAEvC,IAAA,kBAAQ,EAAC;QACP,IAAI,EAAE,SAAS;QACf,QAAQ,EAAE,IAAI;QACd,IAAI,EAAE,QAAQ;QACd,IAAI,EAAE,SAAgB;QACtB,WAAW,EAAE,8BAA8B,UAAU,GAAG;KACzD,CAAC,CAAC,UAAU,CAAC,SAAS,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|
|
8
8
|
const decorators_1 = require("../../decorators");
|
|
9
|
+
const error_response_model_1 = require("../error-response-model");
|
|
9
10
|
function postOne(controller, descriptor, entity, mapEntity, methodName) {
|
|
10
11
|
const entityName = entity.name;
|
|
11
12
|
const readOnlyProps = (0, decorators_1.getJsonApiReadOnlyFields)(entity);
|
|
@@ -27,12 +28,12 @@ function postOne(controller, descriptor, entity, mapEntity, methodName) {
|
|
|
27
28
|
(0, swagger_1.ApiResponse)({
|
|
28
29
|
status: 400,
|
|
29
30
|
description: 'Wrong body parameters',
|
|
30
|
-
schema:
|
|
31
|
+
schema: { $ref: (0, swagger_1.getSchemaPath)(error_response_model_1.JsonApiErrorResponseModel) },
|
|
31
32
|
})(controller, methodName, descriptor);
|
|
32
33
|
(0, swagger_1.ApiResponse)({
|
|
33
34
|
status: 422,
|
|
34
35
|
description: 'Unprocessable data',
|
|
35
|
-
schema:
|
|
36
|
+
schema: { $ref: (0, swagger_1.getSchemaPath)(error_response_model_1.JsonApiErrorResponseModel) },
|
|
36
37
|
})(controller, methodName, descriptor);
|
|
37
38
|
}
|
|
38
39
|
//# sourceMappingURL=post-one.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"post-one.js","sourceRoot":"","sources":["../../../../../../../../../../libs/json-api/json-api-nestjs/src/lib/modules/mixin/swagger/method/post-one.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"post-one.js","sourceRoot":"","sources":["../../../../../../../../../../libs/json-api/json-api-nestjs/src/lib/modules/mixin/swagger/method/post-one.ts"],"names":[],"mappings":";;AAwBA,0BA+CC;AAvED,6CAKyB;AACzB,6BAAwB;AAQxB,oCAGkB;AAClB,mCAAoC;AAEpC,iDAAuF;AAEvF,kEAAoE;AAEpE,SAAgB,OAAO,CACrB,UAAqB,EACrB,UAA8B,EAC9B,MAAsB,EACtB,SAA0C,EAC1C,UAAkB;IAElB,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC;IAE/B,MAA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}
|
|
@@ -6,6 +6,7 @@ const swagger_1 = require("@nestjs/swagger");
|
|
|
6
6
|
const utils_1 = require("../utils");
|
|
7
7
|
const zod_2 = require("../../zod");
|
|
8
8
|
const types_1 = require("../../../../types");
|
|
9
|
+
const error_response_model_1 = require("../error-response-model");
|
|
9
10
|
function postRelationship(controller, descriptor, entity, mapEntity, methodName) {
|
|
10
11
|
const entityName = entity.name;
|
|
11
12
|
const { relations, primaryColumnType } = mapEntity.getParamMap(entity);
|
|
@@ -39,17 +40,17 @@ function postRelationship(controller, descriptor, entity, mapEntity, methodName)
|
|
|
39
40
|
(0, swagger_1.ApiResponse)({
|
|
40
41
|
status: 400,
|
|
41
42
|
description: 'Wrong url parameters',
|
|
42
|
-
schema:
|
|
43
|
+
schema: { $ref: (0, swagger_1.getSchemaPath)(error_response_model_1.JsonApiErrorResponseModel) },
|
|
43
44
|
})(controller, methodName, descriptor);
|
|
44
45
|
(0, swagger_1.ApiResponse)({
|
|
45
46
|
status: 422,
|
|
46
47
|
description: 'Incorrect type for relation',
|
|
47
|
-
schema:
|
|
48
|
+
schema: { $ref: (0, swagger_1.getSchemaPath)(error_response_model_1.JsonApiErrorResponseModel) },
|
|
48
49
|
})(controller, methodName, descriptor);
|
|
49
50
|
(0, swagger_1.ApiResponse)({
|
|
50
51
|
status: 404,
|
|
51
52
|
description: 'Resource not found ',
|
|
52
|
-
schema:
|
|
53
|
+
schema: { $ref: (0, swagger_1.getSchemaPath)(error_response_model_1.JsonApiErrorResponseModel) },
|
|
53
54
|
})(controller, methodName, descriptor);
|
|
54
55
|
}
|
|
55
56
|
//# sourceMappingURL=post-relationship.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"post-relationship.js","sourceRoot":"","sources":["../../../../../../../../../../libs/json-api/json-api-nestjs/src/lib/modules/mixin/swagger/method/post-relationship.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"post-relationship.js","sourceRoot":"","sources":["../../../../../../../../../../libs/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,UAAU,EAAE;KAC5D,CAAC,CAAC,UAAU,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC;IAEvC,IAAA,qBAAW,EAAC;QACV,MAAM,EAAE,GAAG;QACX,MAAM,EAAE,6BAAqB;QAC7B,WAAW,EAAE,2BAA2B,UAAU,oBAAoB;KACvE,CAAC,CAAC,UAAU,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC;IAEvC,IAAA,qBAAW,EAAC;QACV,MAAM,EAAE,GAAG;QACX,WAAW,EAAE,sBAAsB;QACnC,MAAM,EAAE,EAAE,IAAI,EAAE,IAAA,uBAAa,EAAC,gDAAyB,CAAC,EAAE;KAC3D,CAAC,CAAC,UAAU,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC;IAEvC,IAAA,qBAAW,EAAC;QACV,MAAM,EAAE,GAAG;QACX,WAAW,EAAE,6BAA6B;QAC1C,MAAM,EAAE,EAAE,IAAI,EAAE,IAAA,uBAAa,EAAC,gDAAyB,CAAC,EAAE;KAC3D,CAAC,CAAC,UAAU,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC;IAEvC,IAAA,qBAAW,EAAC;QACV,MAAM,EAAE,GAAG;QACX,WAAW,EAAE,qBAAqB;QAClC,MAAM,EAAE,EAAE,IAAI,EAAE,IAAA,uBAAa,EAAC,gDAAyB,CAAC,EAAE;KAC3D,CAAC,CAAC,UAAU,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC;AACzC,CAAC"}
|
|
@@ -16,6 +16,8 @@ const utils_1 = require("./utils");
|
|
|
16
16
|
const bindings_1 = require("../config/bindings");
|
|
17
17
|
const method_1 = require("./method");
|
|
18
18
|
const service_1 = require("../service");
|
|
19
|
+
const error_response_model_1 = require("./error-response-model");
|
|
20
|
+
const decorators_1 = require("../decorators");
|
|
19
21
|
let SwaggerBindService = class SwaggerBindService {
|
|
20
22
|
entity;
|
|
21
23
|
discoveryService;
|
|
@@ -43,6 +45,7 @@ let SwaggerBindService = class SwaggerBindService {
|
|
|
43
45
|
}
|
|
44
46
|
(0, swagger_1.ApiTags)(this.entity.name)(controller);
|
|
45
47
|
(0, swagger_1.ApiExtraModels)(filter_operand_model_1.FilterOperand)(controller);
|
|
48
|
+
(0, swagger_1.ApiExtraModels)(error_response_model_1.JsonApiErrorResponseModel)(controller);
|
|
46
49
|
(0, swagger_1.ApiExtraModels)((0, utils_1.createApiModels)(this.entity, mapProps))(controller);
|
|
47
50
|
const { allowMethod = json_api_nestjs_shared_1.ObjectTyped.keys(bindings_1.Bindings) } = this.config;
|
|
48
51
|
for (const method of json_api_nestjs_shared_1.ObjectTyped.keys(bindings_1.Bindings)) {
|
|
@@ -56,6 +59,41 @@ let SwaggerBindService = class SwaggerBindService {
|
|
|
56
59
|
method_1.swaggerMethod[method](controller.prototype, descriptor, this.entity, this.mapEntity, method);
|
|
57
60
|
Reflect.defineMetadata(constants_2.PARAMTYPES_METADATA, [Object], controller.prototype, method);
|
|
58
61
|
}
|
|
62
|
+
// Process JsonApiResponseFrom decorators on custom methods
|
|
63
|
+
this.processJsonApiResponseFrom(controller);
|
|
64
|
+
}
|
|
65
|
+
processJsonApiResponseFrom(controller) {
|
|
66
|
+
const responseMeta = Reflect.getMetadata(decorators_1.JSON_API_RESPONSE_FROM, controller);
|
|
67
|
+
if (!responseMeta)
|
|
68
|
+
return;
|
|
69
|
+
const prototype = controller.prototype;
|
|
70
|
+
for (const [targetMethod, sourceMapping] of Object.entries(responseMeta)) {
|
|
71
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(prototype, targetMethod);
|
|
72
|
+
if (!descriptor)
|
|
73
|
+
continue;
|
|
74
|
+
const targetResponses = Reflect.getMetadata(constants_1.DECORATORS.API_RESPONSE, descriptor.value);
|
|
75
|
+
if (!targetResponses)
|
|
76
|
+
continue;
|
|
77
|
+
for (const [sourceMethod, mappings] of Object.entries(sourceMapping)) {
|
|
78
|
+
const sourceDescriptor = Reflect.getOwnPropertyDescriptor(prototype, sourceMethod);
|
|
79
|
+
if (!sourceDescriptor)
|
|
80
|
+
continue;
|
|
81
|
+
const sourceResponses = Reflect.getMetadata(constants_1.DECORATORS.API_RESPONSE, sourceDescriptor.value);
|
|
82
|
+
if (!sourceResponses || !mappings)
|
|
83
|
+
continue;
|
|
84
|
+
for (const { fromStatus, toStatus } of [...mappings]) {
|
|
85
|
+
const sourceResponse = sourceResponses[fromStatus];
|
|
86
|
+
if (!sourceResponse?.schema)
|
|
87
|
+
continue;
|
|
88
|
+
const existingTarget = targetResponses[toStatus] || {};
|
|
89
|
+
(0, swagger_1.ApiResponse)({
|
|
90
|
+
status: toStatus,
|
|
91
|
+
...existingTarget,
|
|
92
|
+
schema: sourceResponse.schema,
|
|
93
|
+
})(prototype, targetMethod, descriptor);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
59
97
|
}
|
|
60
98
|
};
|
|
61
99
|
exports.SwaggerBindService = SwaggerBindService;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"swagger-bind.service.js","sourceRoot":"","sources":["../../../../../../../../../libs/json-api/json-api-nestjs/src/lib/modules/mixin/swagger/swagger-bind.service.ts"],"names":[],"mappings":";;;;AAAA,2CAAkE;AAClE,8DAA4D;AAC5D,
|
|
1
|
+
{"version":3,"file":"swagger-bind.service.js","sourceRoot":"","sources":["../../../../../../../../../libs/json-api/json-api-nestjs/src/lib/modules/mixin/swagger/swagger-bind.service.ts"],"names":[],"mappings":";;;;AAAA,2CAAkE;AAClE,8DAA4D;AAC5D,6CAAuE;AACvE,uCAAgD;AAChD,4EAA2E;AAC3E,wDAA+D;AAE/D,kDAK4B;AAC5B,wCAAqD;AACrD,gDAAoD;AAEpD,iEAAuD;AACvD,mCAA0C;AAC1C,iDAA8C;AAE9C,qCAAyC;AACzC,wCAAmD;AACnD,iEAAmE;AACnE,8CAGuB;AAGhB,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;IAGG,MAAM,CAAkB;IACtB,gBAAgB,CAAoB;IAC5B,MAAM,CAAo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AC,CAAC;gBAC1C,CAAC;YACH,CAAC;QAEH,CAAC;IACH,CAAC;CACF,CAAA;AArIY,gDAAkB;AAGG;IAA/B,IAAA,eAAM,EAAC,0BAAc,CAAC;;kDAAiC;AACtB;IAAjC,IAAA,eAAM,EAAC,uBAAgB,CAAC;sCAA4B,uBAAgB;4DAAC;AAC5B;IAAzC,IAAA,eAAM,EAAC,oCAAwB,CAAC;;kDAAmC;AAE7B;IAAtC,IAAA,eAAM,EAAC,+BAAqB,CAAC;sCAAqB,+BAAqB;qDAGtE;6BAVS,kBAAkB;IAD9B,IAAA,mBAAU,GAAE;GACA,kBAAkB,CAqI9B"}
|
|
@@ -6,44 +6,6 @@ import { EntityParamMapService } from '../service';
|
|
|
6
6
|
import { toJSONSchema } from 'zod';
|
|
7
7
|
export declare function assertIsKeysOfObject<E extends object>(object: EntityClass<E>, element: any): asserts element is readonly [keyof E];
|
|
8
8
|
export declare function assertIsKeyOfObject<E extends object>(object: EntityClass<E>, element: unknown): asserts element is PropertyKeys<E>;
|
|
9
|
-
export declare const errorSchema: {
|
|
10
|
-
type: string;
|
|
11
|
-
properties: {
|
|
12
|
-
statusCode: {
|
|
13
|
-
type: string;
|
|
14
|
-
};
|
|
15
|
-
error: {
|
|
16
|
-
type: string;
|
|
17
|
-
};
|
|
18
|
-
message: {
|
|
19
|
-
type: string;
|
|
20
|
-
items: {
|
|
21
|
-
type: string;
|
|
22
|
-
properties: {
|
|
23
|
-
code: {
|
|
24
|
-
type: string;
|
|
25
|
-
};
|
|
26
|
-
message: {
|
|
27
|
-
type: string;
|
|
28
|
-
};
|
|
29
|
-
path: {
|
|
30
|
-
type: string;
|
|
31
|
-
items: {
|
|
32
|
-
type: string;
|
|
33
|
-
};
|
|
34
|
-
};
|
|
35
|
-
keys: {
|
|
36
|
-
type: string;
|
|
37
|
-
items: {
|
|
38
|
-
type: string;
|
|
39
|
-
};
|
|
40
|
-
};
|
|
41
|
-
};
|
|
42
|
-
required: string[];
|
|
43
|
-
};
|
|
44
|
-
};
|
|
45
|
-
};
|
|
46
|
-
};
|
|
47
9
|
export declare function jsonSchemaResponse<E extends object, IdKey extends string = 'id'>(entity: EntityClass<E>, mapEntity: EntityParamMapService<E, IdKey>, array?: boolean): {
|
|
48
10
|
type: string;
|
|
49
11
|
properties: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.zodToJSONSchemaParams = exports.schemaTypeForRelation =
|
|
3
|
+
exports.zodToJSONSchemaParams = exports.schemaTypeForRelation = void 0;
|
|
4
4
|
exports.assertIsKeysOfObject = assertIsKeysOfObject;
|
|
5
5
|
exports.assertIsKeyOfObject = assertIsKeyOfObject;
|
|
6
6
|
exports.jsonSchemaResponse = jsonSchemaResponse;
|
|
@@ -22,44 +22,6 @@ function assertIsKeyOfObject(object, element) {
|
|
|
22
22
|
if (false)
|
|
23
23
|
throw new Error(element + 'not exist in ' + object.name);
|
|
24
24
|
}
|
|
25
|
-
exports.errorSchema = {
|
|
26
|
-
type: 'object',
|
|
27
|
-
properties: {
|
|
28
|
-
statusCode: {
|
|
29
|
-
type: 'number',
|
|
30
|
-
},
|
|
31
|
-
error: {
|
|
32
|
-
type: 'string',
|
|
33
|
-
},
|
|
34
|
-
message: {
|
|
35
|
-
type: 'array',
|
|
36
|
-
items: {
|
|
37
|
-
type: 'object',
|
|
38
|
-
properties: {
|
|
39
|
-
code: {
|
|
40
|
-
type: 'string',
|
|
41
|
-
},
|
|
42
|
-
message: {
|
|
43
|
-
type: 'string',
|
|
44
|
-
},
|
|
45
|
-
path: {
|
|
46
|
-
type: 'array',
|
|
47
|
-
items: {
|
|
48
|
-
type: 'string',
|
|
49
|
-
},
|
|
50
|
-
},
|
|
51
|
-
keys: {
|
|
52
|
-
type: 'array',
|
|
53
|
-
items: {
|
|
54
|
-
type: 'string',
|
|
55
|
-
},
|
|
56
|
-
},
|
|
57
|
-
},
|
|
58
|
-
required: ['code', 'message', 'path'],
|
|
59
|
-
},
|
|
60
|
-
},
|
|
61
|
-
},
|
|
62
|
-
};
|
|
63
25
|
function jsonSchemaResponse(entity, mapEntity, array = false) {
|
|
64
26
|
const { propsType, relations, relationProperty, primaryColumnName } = mapEntity.getParamMap(entity);
|
|
65
27
|
assertIsKeysOfObject(entity, relations);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../../../../../../libs/json-api/json-api-nestjs/src/lib/modules/mixin/swagger/utils.ts"],"names":[],"mappings":";;;AAiBA,oDAQC;AAED,kDAKC;
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../../../../../../libs/json-api/json-api-nestjs/src/lib/modules/mixin/swagger/utils.ts"],"names":[],"mappings":";;;AAiBA,oDAQC;AAED,kDAKC;AAED,gDAiLC;AAED,0CAwDC;AA6BD,8CAOC;AAjTD,6CAA8C;AAE9C,4EAKyC;AACzC,+DAAiD;AAEjD,0CAA0E;AAK1E,gCAAyD;AAEzD,SAAgB,oBAAoB,CAClC,MAAsB,EACtB,OAAY;IAEZ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;QAC5B,MAAM,IAAI,KAAK,CAAC,OAAO,GAAG,kBAAkB,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;IAC9D,CAAC;IACD,IAAI,KAAK;QAAE,MAAM,IAAI,KAAK,CAAC,OAAO,GAAG,gBAAgB,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;AACvE,CAAC;AAED,SAAgB,mBAAmB,CACjC,MAAsB,EACtB,OAAgB;IAEhB,IAAI,KAAK;QAAE,MAAM,IAAI,KAAK,CAAC,OAAO,GAAG,eAAe,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;AACtE,CAAC;AAED,SAAgB,kBAAkB,CAIhC,MAAsB,EACtB,SAA0C,EAC1C,KAAK,GAAG,KAAK;IAEb,MAAM,EA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AAsB;IAEtB,MAAM,SAAS,GAAG,SAAS,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IACxC,IAAI,CAAC,SAAS;QAAE,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAC3D,OAAO,SAAS,CAAC;AACnB,CAAC;AAGY,QAAA,qBAAqB,GAAuC;IACvE,eAAe,EAAE,KAAK;IACtB,QAAQ,CAAC,GAAG;QACV,MAAM,GAAG,GAAG,GAAG,CAAC,SAAS,CAAC,IAAI,CAAC,GAAG,CAAA;QAElC,IAAI,CAAC,GAAG,IAAI,CAAC,GAAG,EAAE,IAAI;YAAE,OAAM;QAC9B,IAAI,GAAG,CAAC,IAAI,KAAK,WAAW,EAAC,CAAC;YAC5B,MAAM,KAAK,GAAG,qCAA+B,CAAC,GAAG,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,CAAC,CAAA;YACrE,IAAI,CAAC,KAAK;gBAAE,OAAO;YACnB,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,UAAU,EAAE,KAAK,CAAC,CAAA;QACtC,CAAC;IACH,CAAC;CACF,CAAA"}
|
|
@@ -29,7 +29,7 @@ export type ConcatRelationField<E extends object, IdKey extends string> = UnionT
|
|
|
29
29
|
}[keyof EntityRelationProps<E, IdKey>]>;
|
|
30
30
|
export type ShapeArrayInput<E extends object, IdKey extends string> = EntityParam<E, IdKey>['props'] | EntityParam<E, IdKey>['relations'] | ConcatRelationField<E, IdKey>;
|
|
31
31
|
export declare function shapeForArray<E extends object, Z extends ZodType, IdKey extends string, PropsList extends ShapeArrayInput<E, IdKey>>(fields: PropsList, zodSchema: Z): Record<CastPropertyKey<PropsList[number]>, Z>;
|
|
32
|
-
export declare function zodFilterInputQuery<E extends object, IdKey extends string>(entityParamMapService: EntityParamMapService<E, IdKey>): z.ZodPipe<z.ZodOptional<z.ZodObject<Record<CastPropertyKey<UnionToTuple<Exclude<keyof E, import("@klerick/json-api-nestjs-shared").RelationKeys<E, IdKey
|
|
32
|
+
export declare function zodFilterInputQuery<E extends object, IdKey extends string>(entityParamMapService: EntityParamMapService<E, IdKey>): z.ZodPipe<z.ZodOptional<z.ZodObject<Record<CastPropertyKey<UnionToTuple<Exclude<Extract<keyof E, string>, IdKey | import("@klerick/json-api-nestjs-shared").RelationKeys<E, IdKey> | { [K in Extract<keyof E, string>]: E[K] extends Function ? K : never; }[Extract<keyof E, string>]>, import("ts-toolbelt/out/Union/Last").Last<Exclude<Extract<keyof E, string>, IdKey | import("@klerick/json-api-nestjs-shared").RelationKeys<E, IdKey> | { [K in Extract<keyof E, string>]: E[K] extends Function ? K : never; }[Extract<keyof E, string>]>>, [Exclude<Extract<keyof E, string>, IdKey | import("@klerick/json-api-nestjs-shared").RelationKeys<E, IdKey> | { [K in Extract<keyof E, string>]: E[K] extends Function ? K : never; }[Extract<keyof E, string>]>] extends [never] ? true : false>[number]>, z.ZodOptional<z.ZodUnion<readonly [z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodNumber]>, z.ZodTransform<string, string | number | null>>, z.ZodObject<{
|
|
33
33
|
some: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodNumber]>, z.ZodTransform<string, string | number | null>>>;
|
|
34
34
|
in: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodNumber]>, z.ZodTransform<string, string | number | null>>>;
|
|
35
35
|
eq: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodNumber]>, z.ZodTransform<string, string | number | null>>>;
|
|
@@ -45,7 +45,7 @@ export declare function zodFilterInputQuery<E extends object, IdKey extends stri
|
|
|
45
45
|
eq: z.ZodPipe<z.ZodUnion<readonly [z.ZodLiteral<"null">, z.ZodNull]>, z.ZodTransform<null, "null" | null>>;
|
|
46
46
|
}, z.core.$strict>, z.ZodObject<{
|
|
47
47
|
ne: z.ZodPipe<z.ZodUnion<readonly [z.ZodLiteral<"null">, z.ZodNull]>, z.ZodTransform<null, "null" | null>>;
|
|
48
|
-
}, z.core.$strict>]>>> & Record<CastPropertyKey<UnionToTuple<{ [
|
|
48
|
+
}, z.core.$strict>]>>> & Record<CastPropertyKey<UnionToTuple<{ [K_1 in keyof EntityRelationProps<E, IdKey>]: `${K_1}.${EntityRelationProps<E, IdKey>[K_1][number] & string}`; }[import("@klerick/json-api-nestjs-shared").RelationKeys<E, "id">], import("ts-toolbelt/out/Union/Last").Last<{ [K_1 in keyof EntityRelationProps<E, IdKey>]: `${K_1}.${EntityRelationProps<E, IdKey>[K_1][number] & string}`; }[import("@klerick/json-api-nestjs-shared").RelationKeys<E, "id">]>, [{ [K_1 in keyof EntityRelationProps<E, IdKey>]: `${K_1}.${EntityRelationProps<E, IdKey>[K_1][number] & string}`; }[import("@klerick/json-api-nestjs-shared").RelationKeys<E, "id">]] extends [never] ? true : false>[number]>, z.ZodOptional<z.ZodUnion<readonly [z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodNumber]>, z.ZodTransform<string, string | number | null>>, z.ZodObject<{
|
|
49
49
|
some: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodNumber]>, z.ZodTransform<string, string | number | null>>>;
|
|
50
50
|
in: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodNumber]>, z.ZodTransform<string, string | number | null>>>;
|
|
51
51
|
eq: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodNumber]>, z.ZodTransform<string, string | number | null>>>;
|
|
@@ -57,7 +57,7 @@ export declare function zodFilterInputQuery<E extends object, IdKey extends stri
|
|
|
57
57
|
ne: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodNumber]>, z.ZodTransform<string, string | number | null>>>;
|
|
58
58
|
regexp: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodNumber]>, z.ZodTransform<string, string | number | null>>>;
|
|
59
59
|
nin: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodNumber]>, z.ZodTransform<string, string | number | null>>>;
|
|
60
|
-
}, z.core.$strict>]>>> extends infer T ? { -readonly [P in keyof T]: T[P]; } : never, z.core.$strip>>, z.ZodTransform<OutPutFilter, z.core.$InferObjectOutput<Record<CastPropertyKey<UnionToTuple<Exclude<keyof E, import("@klerick/json-api-nestjs-shared").RelationKeys<E, IdKey
|
|
60
|
+
}, z.core.$strict>]>>> extends infer T ? { -readonly [P in keyof T]: T[P]; } : never, z.core.$strip>>, z.ZodTransform<OutPutFilter, z.core.$InferObjectOutput<Record<CastPropertyKey<UnionToTuple<Exclude<Extract<keyof E, string>, IdKey | import("@klerick/json-api-nestjs-shared").RelationKeys<E, IdKey> | { [K in Extract<keyof E, string>]: E[K] extends Function ? K : never; }[Extract<keyof E, string>]>, import("ts-toolbelt/out/Union/Last").Last<Exclude<Extract<keyof E, string>, IdKey | import("@klerick/json-api-nestjs-shared").RelationKeys<E, IdKey> | { [K in Extract<keyof E, string>]: E[K] extends Function ? K : never; }[Extract<keyof E, string>]>>, [Exclude<Extract<keyof E, string>, IdKey | import("@klerick/json-api-nestjs-shared").RelationKeys<E, IdKey> | { [K in Extract<keyof E, string>]: E[K] extends Function ? K : never; }[Extract<keyof E, string>]>] extends [never] ? true : false>[number]>, z.ZodOptional<z.ZodUnion<readonly [z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodNumber]>, z.ZodTransform<string, string | number | null>>, z.ZodObject<{
|
|
61
61
|
some: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodNumber]>, z.ZodTransform<string, string | number | null>>>;
|
|
62
62
|
in: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodNumber]>, z.ZodTransform<string, string | number | null>>>;
|
|
63
63
|
eq: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodNumber]>, z.ZodTransform<string, string | number | null>>>;
|
|
@@ -73,7 +73,7 @@ export declare function zodFilterInputQuery<E extends object, IdKey extends stri
|
|
|
73
73
|
eq: z.ZodPipe<z.ZodUnion<readonly [z.ZodLiteral<"null">, z.ZodNull]>, z.ZodTransform<null, "null" | null>>;
|
|
74
74
|
}, z.core.$strict>, z.ZodObject<{
|
|
75
75
|
ne: z.ZodPipe<z.ZodUnion<readonly [z.ZodLiteral<"null">, z.ZodNull]>, z.ZodTransform<null, "null" | null>>;
|
|
76
|
-
}, z.core.$strict>]>>> & Record<CastPropertyKey<UnionToTuple<{ [
|
|
76
|
+
}, z.core.$strict>]>>> & Record<CastPropertyKey<UnionToTuple<{ [K_1 in keyof EntityRelationProps<E, IdKey>]: `${K_1}.${EntityRelationProps<E, IdKey>[K_1][number] & string}`; }[import("@klerick/json-api-nestjs-shared").RelationKeys<E, "id">], import("ts-toolbelt/out/Union/Last").Last<{ [K_1 in keyof EntityRelationProps<E, IdKey>]: `${K_1}.${EntityRelationProps<E, IdKey>[K_1][number] & string}`; }[import("@klerick/json-api-nestjs-shared").RelationKeys<E, "id">]>, [{ [K_1 in keyof EntityRelationProps<E, IdKey>]: `${K_1}.${EntityRelationProps<E, IdKey>[K_1][number] & string}`; }[import("@klerick/json-api-nestjs-shared").RelationKeys<E, "id">]] extends [never] ? true : false>[number]>, z.ZodOptional<z.ZodUnion<readonly [z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodNumber]>, z.ZodTransform<string, string | number | null>>, z.ZodObject<{
|
|
77
77
|
some: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodNumber]>, z.ZodTransform<string, string | number | null>>>;
|
|
78
78
|
in: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodNumber]>, z.ZodTransform<string, string | number | null>>>;
|
|
79
79
|
eq: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodNumber]>, z.ZodTransform<string, string | number | null>>>;
|
|
@@ -10,7 +10,7 @@ export declare function zodInputQuery<E extends object, IdKey extends string>(en
|
|
|
10
10
|
} & { [P in import("../../../../types").UnionToTuple<import("@klerick/json-api-nestjs-shared").RelationKeys<E, IdKey>, import("ts-toolbelt/out/Union/Last").Last<import("@klerick/json-api-nestjs-shared").RelationKeys<E, IdKey>>, [import("@klerick/json-api-nestjs-shared").RelationKeys<E, IdKey>] extends [never] ? true : false>[number] extends infer T_1 ? T_1 extends import("../../../../types").UnionToTuple<import("@klerick/json-api-nestjs-shared").RelationKeys<E, IdKey>, import("ts-toolbelt/out/Union/Last").Last<import("@klerick/json-api-nestjs-shared").RelationKeys<E, IdKey>>, [import("@klerick/json-api-nestjs-shared").RelationKeys<E, IdKey>] extends [never] ? true : false>[number] ? T_1 extends PropertyKey ? T_1 : never : never : never]: z.ZodPipe<z.ZodOptional<z.ZodString>, z.ZodTransform<string[] | undefined, string | undefined>>; }, {}>> | null, z.core.$InferObjectOutput<{
|
|
11
11
|
target: z.ZodPipe<z.ZodOptional<z.ZodString>, z.ZodTransform<string[] | undefined, string | undefined>>;
|
|
12
12
|
} & { [P in import("../../../../types").UnionToTuple<import("@klerick/json-api-nestjs-shared").RelationKeys<E, IdKey>, import("ts-toolbelt/out/Union/Last").Last<import("@klerick/json-api-nestjs-shared").RelationKeys<E, IdKey>>, [import("@klerick/json-api-nestjs-shared").RelationKeys<E, IdKey>] extends [never] ? true : false>[number] extends infer T_2 ? T_2 extends import("../../../../types").UnionToTuple<import("@klerick/json-api-nestjs-shared").RelationKeys<E, IdKey>, import("ts-toolbelt/out/Union/Last").Last<import("@klerick/json-api-nestjs-shared").RelationKeys<E, IdKey>>, [import("@klerick/json-api-nestjs-shared").RelationKeys<E, IdKey>] extends [never] ? true : false>[number] ? T_2 extends PropertyKey ? T_2 : never : never : never]: z.ZodPipe<z.ZodOptional<z.ZodString>, z.ZodTransform<string[] | undefined, string | undefined>>; }, {}> | undefined>>;
|
|
13
|
-
filter: z.ZodPipe<z.ZodOptional<z.ZodObject<Record<import("../../../../types").UnionToTuple<Exclude<keyof E, import("@klerick/json-api-nestjs-shared").RelationKeys<E, IdKey
|
|
13
|
+
filter: z.ZodPipe<z.ZodOptional<z.ZodObject<Record<import("../../../../types").UnionToTuple<Exclude<Extract<keyof E, string>, IdKey | import("@klerick/json-api-nestjs-shared").RelationKeys<E, IdKey> | { [K in Extract<keyof E, string>]: E[K] extends Function ? K : never; }[Extract<keyof E, string>]>, import("ts-toolbelt/out/Union/Last").Last<Exclude<Extract<keyof E, string>, IdKey | import("@klerick/json-api-nestjs-shared").RelationKeys<E, IdKey> | { [K in Extract<keyof E, string>]: E[K] extends Function ? K : never; }[Extract<keyof E, string>]>>, [Exclude<Extract<keyof E, string>, IdKey | import("@klerick/json-api-nestjs-shared").RelationKeys<E, IdKey> | { [K in Extract<keyof E, string>]: E[K] extends Function ? K : never; }[Extract<keyof E, string>]>] extends [never] ? true : false>[number] extends infer T_4 ? T_4 extends import("../../../../types").UnionToTuple<Exclude<Extract<keyof E, string>, IdKey | import("@klerick/json-api-nestjs-shared").RelationKeys<E, IdKey> | { [K in Extract<keyof E, string>]: E[K] extends Function ? K : never; }[Extract<keyof E, string>]>, import("ts-toolbelt/out/Union/Last").Last<Exclude<Extract<keyof E, string>, IdKey | import("@klerick/json-api-nestjs-shared").RelationKeys<E, IdKey> | { [K in Extract<keyof E, string>]: E[K] extends Function ? K : never; }[Extract<keyof E, string>]>>, [Exclude<Extract<keyof E, string>, IdKey | import("@klerick/json-api-nestjs-shared").RelationKeys<E, IdKey> | { [K in Extract<keyof E, string>]: E[K] extends Function ? K : never; }[Extract<keyof E, string>]>] extends [never] ? true : false>[number] ? T_4 extends PropertyKey ? T_4 : never : never : never, z.ZodOptional<z.ZodUnion<readonly [z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodNumber]>, z.ZodTransform<string, string | number | null>>, z.ZodObject<{
|
|
14
14
|
some: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodNumber]>, z.ZodTransform<string, string | number | null>>>;
|
|
15
15
|
in: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodNumber]>, z.ZodTransform<string, string | number | null>>>;
|
|
16
16
|
eq: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodNumber]>, z.ZodTransform<string, string | number | null>>>;
|
|
@@ -26,7 +26,7 @@ export declare function zodInputQuery<E extends object, IdKey extends string>(en
|
|
|
26
26
|
eq: z.ZodPipe<z.ZodUnion<readonly [z.ZodLiteral<"null">, z.ZodNull]>, z.ZodTransform<null, "null" | null>>;
|
|
27
27
|
}, z.core.$strict>, z.ZodObject<{
|
|
28
28
|
ne: z.ZodPipe<z.ZodUnion<readonly [z.ZodLiteral<"null">, z.ZodNull]>, z.ZodTransform<null, "null" | null>>;
|
|
29
|
-
}, z.core.$strict>]>>> & Record<import("../../../../types").UnionToTuple<{ [
|
|
29
|
+
}, z.core.$strict>]>>> & Record<import("../../../../types").UnionToTuple<{ [K_1 in keyof import("../../../../types").EntityRelationProps<E, IdKey>]: `${K_1}.${import("../../../../types").EntityRelationProps<E, IdKey>[K_1][number] & string}`; }[import("@klerick/json-api-nestjs-shared").RelationKeys<E, "id">], import("ts-toolbelt/out/Union/Last").Last<{ [K_1 in keyof import("../../../../types").EntityRelationProps<E, IdKey>]: `${K_1}.${import("../../../../types").EntityRelationProps<E, IdKey>[K_1][number] & string}`; }[import("@klerick/json-api-nestjs-shared").RelationKeys<E, "id">]>, [{ [K_1 in keyof import("../../../../types").EntityRelationProps<E, IdKey>]: `${K_1}.${import("../../../../types").EntityRelationProps<E, IdKey>[K_1][number] & string}`; }[import("@klerick/json-api-nestjs-shared").RelationKeys<E, "id">]] extends [never] ? true : false>[number] extends infer T_6 ? T_6 extends import("../../../../types").UnionToTuple<{ [K_1 in keyof import("../../../../types").EntityRelationProps<E, IdKey>]: `${K_1}.${import("../../../../types").EntityRelationProps<E, IdKey>[K_1][number] & string}`; }[import("@klerick/json-api-nestjs-shared").RelationKeys<E, "id">], import("ts-toolbelt/out/Union/Last").Last<{ [K_1 in keyof import("../../../../types").EntityRelationProps<E, IdKey>]: `${K_1}.${import("../../../../types").EntityRelationProps<E, IdKey>[K_1][number] & string}`; }[import("@klerick/json-api-nestjs-shared").RelationKeys<E, "id">]>, [{ [K_1 in keyof import("../../../../types").EntityRelationProps<E, IdKey>]: `${K_1}.${import("../../../../types").EntityRelationProps<E, IdKey>[K_1][number] & string}`; }[import("@klerick/json-api-nestjs-shared").RelationKeys<E, "id">]] extends [never] ? true : false>[number] ? T_6 extends PropertyKey ? T_6 : never : never : never, z.ZodOptional<z.ZodUnion<readonly [z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodNumber]>, z.ZodTransform<string, string | number | null>>, z.ZodObject<{
|
|
30
30
|
some: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodNumber]>, z.ZodTransform<string, string | number | null>>>;
|
|
31
31
|
in: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodNumber]>, z.ZodTransform<string, string | number | null>>>;
|
|
32
32
|
eq: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodNumber]>, z.ZodTransform<string, string | number | null>>>;
|
|
@@ -65,7 +65,7 @@ export declare function zodInputQuery<E extends object, IdKey extends string>(en
|
|
|
65
65
|
nin: string | string[];
|
|
66
66
|
some: string | string[];
|
|
67
67
|
}>>;
|
|
68
|
-
}, z.core.$InferObjectOutput<Record<import("../../../../types").UnionToTuple<Exclude<keyof E, import("@klerick/json-api-nestjs-shared").RelationKeys<E, IdKey
|
|
68
|
+
}, z.core.$InferObjectOutput<Record<import("../../../../types").UnionToTuple<Exclude<Extract<keyof E, string>, IdKey | import("@klerick/json-api-nestjs-shared").RelationKeys<E, IdKey> | { [K in Extract<keyof E, string>]: E[K] extends Function ? K : never; }[Extract<keyof E, string>]>, import("ts-toolbelt/out/Union/Last").Last<Exclude<Extract<keyof E, string>, IdKey | import("@klerick/json-api-nestjs-shared").RelationKeys<E, IdKey> | { [K in Extract<keyof E, string>]: E[K] extends Function ? K : never; }[Extract<keyof E, string>]>>, [Exclude<Extract<keyof E, string>, IdKey | import("@klerick/json-api-nestjs-shared").RelationKeys<E, IdKey> | { [K in Extract<keyof E, string>]: E[K] extends Function ? K : never; }[Extract<keyof E, string>]>] extends [never] ? true : false>[number] extends infer T_8 ? T_8 extends import("../../../../types").UnionToTuple<Exclude<Extract<keyof E, string>, IdKey | import("@klerick/json-api-nestjs-shared").RelationKeys<E, IdKey> | { [K in Extract<keyof E, string>]: E[K] extends Function ? K : never; }[Extract<keyof E, string>]>, import("ts-toolbelt/out/Union/Last").Last<Exclude<Extract<keyof E, string>, IdKey | import("@klerick/json-api-nestjs-shared").RelationKeys<E, IdKey> | { [K in Extract<keyof E, string>]: E[K] extends Function ? K : never; }[Extract<keyof E, string>]>>, [Exclude<Extract<keyof E, string>, IdKey | import("@klerick/json-api-nestjs-shared").RelationKeys<E, IdKey> | { [K in Extract<keyof E, string>]: E[K] extends Function ? K : never; }[Extract<keyof E, string>]>] extends [never] ? true : false>[number] ? T_8 extends PropertyKey ? T_8 : never : never : never, z.ZodOptional<z.ZodUnion<readonly [z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodNumber]>, z.ZodTransform<string, string | number | null>>, z.ZodObject<{
|
|
69
69
|
some: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodNumber]>, z.ZodTransform<string, string | number | null>>>;
|
|
70
70
|
in: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodNumber]>, z.ZodTransform<string, string | number | null>>>;
|
|
71
71
|
eq: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodNumber]>, z.ZodTransform<string, string | number | null>>>;
|
|
@@ -81,7 +81,7 @@ export declare function zodInputQuery<E extends object, IdKey extends string>(en
|
|
|
81
81
|
eq: z.ZodPipe<z.ZodUnion<readonly [z.ZodLiteral<"null">, z.ZodNull]>, z.ZodTransform<null, "null" | null>>;
|
|
82
82
|
}, z.core.$strict>, z.ZodObject<{
|
|
83
83
|
ne: z.ZodPipe<z.ZodUnion<readonly [z.ZodLiteral<"null">, z.ZodNull]>, z.ZodTransform<null, "null" | null>>;
|
|
84
|
-
}, z.core.$strict>]>>> & Record<import("../../../../types").UnionToTuple<{ [
|
|
84
|
+
}, z.core.$strict>]>>> & Record<import("../../../../types").UnionToTuple<{ [K_1 in keyof import("../../../../types").EntityRelationProps<E, IdKey>]: `${K_1}.${import("../../../../types").EntityRelationProps<E, IdKey>[K_1][number] & string}`; }[import("@klerick/json-api-nestjs-shared").RelationKeys<E, "id">], import("ts-toolbelt/out/Union/Last").Last<{ [K_1 in keyof import("../../../../types").EntityRelationProps<E, IdKey>]: `${K_1}.${import("../../../../types").EntityRelationProps<E, IdKey>[K_1][number] & string}`; }[import("@klerick/json-api-nestjs-shared").RelationKeys<E, "id">]>, [{ [K_1 in keyof import("../../../../types").EntityRelationProps<E, IdKey>]: `${K_1}.${import("../../../../types").EntityRelationProps<E, IdKey>[K_1][number] & string}`; }[import("@klerick/json-api-nestjs-shared").RelationKeys<E, "id">]] extends [never] ? true : false>[number] extends infer T_10 ? T_10 extends import("../../../../types").UnionToTuple<{ [K_1 in keyof import("../../../../types").EntityRelationProps<E, IdKey>]: `${K_1}.${import("../../../../types").EntityRelationProps<E, IdKey>[K_1][number] & string}`; }[import("@klerick/json-api-nestjs-shared").RelationKeys<E, "id">], import("ts-toolbelt/out/Union/Last").Last<{ [K_1 in keyof import("../../../../types").EntityRelationProps<E, IdKey>]: `${K_1}.${import("../../../../types").EntityRelationProps<E, IdKey>[K_1][number] & string}`; }[import("@klerick/json-api-nestjs-shared").RelationKeys<E, "id">]>, [{ [K_1 in keyof import("../../../../types").EntityRelationProps<E, IdKey>]: `${K_1}.${import("../../../../types").EntityRelationProps<E, IdKey>[K_1][number] & string}`; }[import("@klerick/json-api-nestjs-shared").RelationKeys<E, "id">]] extends [never] ? true : false>[number] ? T_10 extends PropertyKey ? T_10 : never : never : never, z.ZodOptional<z.ZodUnion<readonly [z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodNumber]>, z.ZodTransform<string, string | number | null>>, z.ZodObject<{
|
|
85
85
|
some: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodNumber]>, z.ZodTransform<string, string | number | null>>>;
|
|
86
86
|
in: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodNumber]>, z.ZodTransform<string, string | number | null>>>;
|
|
87
87
|
eq: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodNumber]>, z.ZodTransform<string, string | number | null>>>;
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import type { ZodNullable, ZodArray, ZodEnum } from 'zod';
|
|
2
3
|
import { EntityParamMapService } from '../../service';
|
|
3
4
|
import { NonEmptyStringTuple } from '../../../../types';
|
|
4
|
-
|
|
5
|
-
|
|
5
|
+
type Relations<E extends object, IdKey extends string> = EntityParamMapService<E, IdKey>['entityParaMap']['relations'];
|
|
6
|
+
type RelationsTuple<E extends object, IdKey extends string> = NonEmptyStringTuple<Relations<E, IdKey>>;
|
|
7
|
+
type EnumLike<T extends readonly string[]> = {
|
|
8
|
+
[K in T[number]]: K;
|
|
9
|
+
};
|
|
10
|
+
export type ZodIncludeQuery<E extends object, IdKey extends string> = ZodNullable<ZodArray<ZodEnum<EnumLike<RelationsTuple<E, IdKey>>>>>;
|
|
11
|
+
export declare function zodIncludeQuery<E extends object, IdKey extends string>(entityParamMapService: EntityParamMapService<E, IdKey>): ZodIncludeQuery<E, IdKey>;
|
|
6
12
|
export type IncludeQuery<E extends object, IdKey extends string> = z.infer<ZodIncludeQuery<E, IdKey>>;
|
|
13
|
+
export {};
|
|
@@ -4,7 +4,8 @@ exports.zodIncludeQuery = zodIncludeQuery;
|
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const zod_utils_1 = require("../zod-utils");
|
|
6
6
|
function zodIncludeQuery(entityParamMapService) {
|
|
7
|
-
const relationProps = entityParamMapService
|
|
7
|
+
const relationProps = entityParamMapService
|
|
8
|
+
.entityParaMap.relations;
|
|
8
9
|
return zod_1.z
|
|
9
10
|
.enum(relationProps)
|
|
10
11
|
.array()
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"include.js","sourceRoot":"","sources":["../../../../../../../../../../libs/json-api/json-api-nestjs/src/lib/modules/mixin/zod/zod-query-schema/include.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"include.js","sourceRoot":"","sources":["../../../../../../../../../../libs/json-api/json-api-nestjs/src/lib/modules/mixin/zod/zod-query-schema/include.ts"],"names":[],"mappings":";;AAwBA,0CAcC;AAtCD,6BAAwB;AAGxB,4CAA2C;AAqB3C,SAAgB,eAAe,CAC7B,qBAAsD;IAEtD,MAAM,aAAa,GAA6B,qBAAqB;SAClE,aAAa,CAAC,SAAqC,CAAC;IAEvD,OAAO,OAAC;SACL,IAAI,CAAC,aAAa,CAAC;SACnB,KAAK,EAAE;SACP,QAAQ,EAAE;SACV,MAAM,CAAC,IAAA,uBAAW,GAAE,EAAE;QACrB,KAAK,EAAE,qCAAqC;KAC7C,CAAC;SACD,QAAQ,EAAE,CAAC;AAChB,CAAC"}
|