@klerick/json-api-nestjs 10.0.0-beta.8 → 10.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +167 -0
- package/README.md +299 -23
- package/package.json +4 -8
- package/src/index.d.ts +2 -2
- package/src/index.js +3 -1
- package/src/index.js.map +1 -1
- package/src/lib/constants/di.d.ts +1 -0
- package/src/lib/constants/di.js +2 -1
- package/src/lib/constants/di.js.map +1 -1
- package/src/lib/json-api.module.js +3 -2
- package/src/lib/json-api.module.js.map +1 -1
- package/src/lib/modules/atomic-operation/atomic-operation.module.d.ts +1 -2
- package/src/lib/modules/atomic-operation/atomic-operation.module.js +6 -5
- package/src/lib/modules/atomic-operation/atomic-operation.module.js.map +1 -1
- package/src/lib/modules/atomic-operation/controllers/operation.controller.js +4 -4
- package/src/lib/modules/atomic-operation/controllers/operation.controller.js.map +1 -1
- package/src/lib/modules/atomic-operation/factory/map-controller-entity.d.ts +1 -2
- package/src/lib/modules/atomic-operation/factory/map-controller-entity.js +8 -7
- package/src/lib/modules/atomic-operation/factory/map-controller-entity.js.map +1 -1
- package/src/lib/modules/atomic-operation/pipes/input-operation.pipe.js.map +1 -1
- package/src/lib/modules/atomic-operation/service/execute.service.d.ts +13 -3
- package/src/lib/modules/atomic-operation/service/execute.service.js +80 -33
- package/src/lib/modules/atomic-operation/service/execute.service.js.map +1 -1
- package/src/lib/modules/atomic-operation/service/explorer.service.js +10 -6
- package/src/lib/modules/atomic-operation/service/explorer.service.js.map +1 -1
- package/src/lib/modules/atomic-operation/service/swagger.service.js +6 -6
- package/src/lib/modules/atomic-operation/service/swagger.service.js.map +1 -1
- package/src/lib/modules/atomic-operation/utils/zod/zod-helper.d.ts +14 -7
- package/src/lib/modules/atomic-operation/utils/zod/zod-helper.js +12 -9
- package/src/lib/modules/atomic-operation/utils/zod/zod-helper.js.map +1 -1
- package/src/lib/modules/mixin/config/bindings.js +20 -0
- package/src/lib/modules/mixin/config/bindings.js.map +1 -1
- package/src/lib/modules/mixin/controllers/json-base.controller.d.ts +5 -5
- package/src/lib/modules/mixin/controllers/json-base.controller.js +5 -5
- package/src/lib/modules/mixin/controllers/json-base.controller.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/factory/zod-validate.factory.d.ts +2 -1
- package/src/lib/modules/mixin/factory/zod-validate.factory.js +5 -1
- package/src/lib/modules/mixin/factory/zod-validate.factory.js.map +1 -1
- package/src/lib/modules/mixin/helpers/bind-controller.js +4 -1
- package/src/lib/modules/mixin/helpers/bind-controller.js.map +1 -1
- package/src/lib/modules/mixin/helpers/utils.d.ts +2 -0
- package/src/lib/modules/mixin/helpers/utils.js +10 -0
- package/src/lib/modules/mixin/helpers/utils.js.map +1 -1
- package/src/lib/modules/mixin/mixin.module.js +1 -0
- package/src/lib/modules/mixin/mixin.module.js.map +1 -1
- package/src/lib/modules/mixin/pipe/index.d.ts +1 -0
- package/src/lib/modules/mixin/pipe/index.js +5 -0
- package/src/lib/modules/mixin/pipe/index.js.map +1 -1
- package/src/lib/modules/mixin/pipe/meta-extractor/index.d.ts +1 -0
- package/src/lib/modules/mixin/pipe/meta-extractor/index.js +5 -0
- package/src/lib/modules/mixin/pipe/meta-extractor/index.js.map +1 -0
- package/src/lib/modules/mixin/pipe/meta-extractor/meta-extractor.pipe.d.ts +6 -0
- package/src/lib/modules/mixin/pipe/meta-extractor/meta-extractor.pipe.js +27 -0
- package/src/lib/modules/mixin/pipe/meta-extractor/meta-extractor.pipe.js.map +1 -0
- package/src/lib/modules/mixin/service/json-api-transformer.service.d.ts +2 -2
- package/src/lib/modules/mixin/service/json-api-transformer.service.js.map +1 -1
- package/src/lib/modules/mixin/swagger/error-response-model.d.ts +11 -0
- package/src/lib/modules/mixin/swagger/error-response-model.js +63 -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 +6 -6
- package/src/lib/modules/mixin/swagger/method/delete-relationship.js.map +1 -1
- package/src/lib/modules/mixin/swagger/method/get-all.js +9 -39
- package/src/lib/modules/mixin/swagger/method/get-all.js.map +1 -1
- package/src/lib/modules/mixin/swagger/method/get-one.js +5 -5
- package/src/lib/modules/mixin/swagger/method/get-one.js.map +1 -1
- package/src/lib/modules/mixin/swagger/method/get-relationship.js +5 -4
- package/src/lib/modules/mixin/swagger/method/get-relationship.js.map +1 -1
- package/src/lib/modules/mixin/swagger/method/patch-one.js +5 -5
- package/src/lib/modules/mixin/swagger/method/patch-one.js.map +1 -1
- package/src/lib/modules/mixin/swagger/method/patch-relationship.js +7 -7
- package/src/lib/modules/mixin/swagger/method/patch-relationship.js.map +1 -1
- package/src/lib/modules/mixin/swagger/method/post-one.js +5 -5
- package/src/lib/modules/mixin/swagger/method/post-one.js.map +1 -1
- package/src/lib/modules/mixin/swagger/method/post-relationship.js +7 -7
- package/src/lib/modules/mixin/swagger/method/post-relationship.js.map +1 -1
- package/src/lib/modules/mixin/swagger/open-api-types.d.ts +18 -0
- package/src/lib/modules/mixin/swagger/open-api-types.js +3 -0
- package/src/lib/modules/mixin/swagger/open-api-types.js.map +1 -0
- package/src/lib/modules/mixin/swagger/swagger-bind.service.d.ts +1 -0
- package/src/lib/modules/mixin/swagger/swagger-bind.service.js +52 -13
- package/src/lib/modules/mixin/swagger/swagger-bind.service.js.map +1 -1
- package/src/lib/modules/mixin/swagger/utils.d.ts +17 -142
- package/src/lib/modules/mixin/swagger/utils.js +178 -124
- package/src/lib/modules/mixin/swagger/utils.js.map +1 -1
- package/src/lib/modules/mixin/zod/index.d.ts +1 -1
- package/src/lib/modules/mixin/zod/index.js +4 -0
- package/src/lib/modules/mixin/zod/index.js.map +1 -1
- package/src/lib/modules/mixin/zod/map-transform-to-json-shema.d.ts +2 -0
- package/src/lib/modules/mixin/zod/map-transform-to-json-shema.js +10 -0
- package/src/lib/modules/mixin/zod/map-transform-to-json-shema.js.map +1 -1
- package/src/lib/modules/mixin/zod/zod-input-patch-relationship-schema/index.d.ts +8 -0
- package/src/lib/modules/mixin/zod/zod-input-patch-relationship-schema/index.js +8 -3
- package/src/lib/modules/mixin/zod/zod-input-patch-relationship-schema/index.js.map +1 -1
- package/src/lib/modules/mixin/zod/zod-input-patch-schema/index.d.ts +14 -3
- package/src/lib/modules/mixin/zod/zod-input-patch-schema/index.js +1 -0
- package/src/lib/modules/mixin/zod/zod-input-patch-schema/index.js.map +1 -1
- package/src/lib/modules/mixin/zod/zod-input-post-relationship-schema/index.d.ts +1 -0
- package/src/lib/modules/mixin/zod/zod-input-post-relationship-schema/index.js +1 -0
- package/src/lib/modules/mixin/zod/zod-input-post-relationship-schema/index.js.map +1 -1
- package/src/lib/modules/mixin/zod/zod-input-post-schema/index.d.ts +16 -6
- package/src/lib/modules/mixin/zod/zod-input-post-schema/index.js +2 -11
- package/src/lib/modules/mixin/zod/zod-input-post-schema/index.js.map +1 -1
- package/src/lib/modules/mixin/zod/zod-input-query-schema/fields.d.ts +8 -5
- package/src/lib/modules/mixin/zod/zod-input-query-schema/fields.js +16 -12
- package/src/lib/modules/mixin/zod/zod-input-query-schema/fields.js.map +1 -1
- package/src/lib/modules/mixin/zod/zod-input-query-schema/filter.d.ts +76 -6
- package/src/lib/modules/mixin/zod/zod-input-query-schema/filter.js +32 -10
- package/src/lib/modules/mixin/zod/zod-input-query-schema/filter.js.map +1 -1
- package/src/lib/modules/mixin/zod/zod-input-query-schema/index.d.ts +40 -15
- package/src/lib/modules/mixin/zod/zod-input-query-schema/index.js +3 -1
- package/src/lib/modules/mixin/zod/zod-input-query-schema/index.js.map +1 -1
- package/src/lib/modules/mixin/zod/zod-query-schema/fields.d.ts +1 -1
- package/src/lib/modules/mixin/zod/zod-query-schema/fields.js +5 -4
- package/src/lib/modules/mixin/zod/zod-query-schema/fields.js.map +1 -1
- package/src/lib/modules/mixin/zod/zod-query-schema/filter.d.ts +4 -2
- package/src/lib/modules/mixin/zod/zod-query-schema/filter.js +19 -8
- package/src/lib/modules/mixin/zod/zod-query-schema/filter.js.map +1 -1
- 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/src/lib/modules/mixin/zod/zod-query-schema/sort.d.ts +2 -2
- package/src/lib/modules/mixin/zod/zod-query-schema/sort.js +5 -4
- package/src/lib/modules/mixin/zod/zod-query-schema/sort.js.map +1 -1
- package/src/lib/modules/mixin/zod/zod-share/attributes.d.ts +12 -6
- package/src/lib/modules/mixin/zod/zod-share/attributes.js +12 -7
- package/src/lib/modules/mixin/zod/zod-share/attributes.js.map +1 -1
- package/src/lib/modules/mixin/zod/zod-share/id.d.ts +12 -0
- package/src/lib/modules/mixin/zod/zod-share/id.js +17 -0
- package/src/lib/modules/mixin/zod/zod-share/id.js.map +1 -1
- package/src/lib/modules/mixin/zod/zod-share/index.d.ts +1 -0
- package/src/lib/modules/mixin/zod/zod-share/index.js +1 -0
- package/src/lib/modules/mixin/zod/zod-share/index.js.map +1 -1
- package/src/lib/modules/mixin/zod/zod-share/meta.d.ts +11 -0
- package/src/lib/modules/mixin/zod/zod-share/meta.js +15 -0
- package/src/lib/modules/mixin/zod/zod-share/meta.js.map +1 -0
- package/src/lib/modules/mixin/zod/zod-share/page.d.ts +2 -2
- package/src/lib/modules/mixin/zod/zod-utils.d.ts +2 -0
- package/src/lib/modules/mixin/zod/zod-utils.js +20 -0
- package/src/lib/modules/mixin/zod/zod-utils.js.map +1 -1
- package/src/lib/types/entity-param.type.d.ts +10 -9
- package/src/lib/types/entity-param.type.js +13 -0
- package/src/lib/types/entity-param.type.js.map +1 -1
- package/src/lib/types/module-options.types.d.ts +1 -0
- package/src/lib/utils/module-helper.js +1 -0
- package/src/lib/utils/module-helper.js.map +1 -1
|
@@ -1,20 +1,30 @@
|
|
|
1
1
|
import { z, ZodObject, ZodOptional } from 'zod';
|
|
2
2
|
import { ExtractJsonApiReadOnlyKeys, ExtractJsonApiImmutableKeys } from '../../../../types';
|
|
3
|
-
import {
|
|
3
|
+
import { ZodPrimaryKeyId, ZodType, ZodAttributes, ZodRelationships, Id, Attributes, Relationships, ZodMeta } from '../zod-share';
|
|
4
4
|
import { EntityParamMapService } from '../../service';
|
|
5
5
|
type ZodInputPostShape<E extends object, IdKey extends string> = {
|
|
6
|
-
id: ZodOptional<
|
|
6
|
+
id: ZodOptional<ZodPrimaryKeyId>;
|
|
7
7
|
type: ZodType<string>;
|
|
8
|
-
attributes: ZodAttributes<
|
|
8
|
+
attributes: ZodAttributes<E, IdKey>;
|
|
9
9
|
relationships: ZodOptional<ZodRelationships<E, IdKey>>;
|
|
10
10
|
};
|
|
11
11
|
type ZodInputPostSchema<E extends object, IdKey extends string> = ZodObject<ZodInputPostShape<E, IdKey>, z.core.$strict>;
|
|
12
12
|
type ZodInputPostDataShape<E extends object, IdKey extends string> = {
|
|
13
13
|
data: ZodInputPostSchema<E, IdKey>;
|
|
14
|
+
meta: ZodMeta;
|
|
14
15
|
};
|
|
15
16
|
export declare function zodPost<E extends object, IdKey extends string>(entityParamMapService: EntityParamMapService<E, IdKey>, readOnlyProps?: ExtractJsonApiReadOnlyKeys<E>[], immutableProps?: ExtractJsonApiImmutableKeys<E>[]): ZodPost<E, IdKey>;
|
|
16
17
|
export type ZodPost<E extends object, IdKey extends string> = ZodObject<ZodInputPostDataShape<E, IdKey>, z.core.$strict>;
|
|
17
|
-
export type
|
|
18
|
-
type
|
|
19
|
-
export type PostData<E extends object, IdKey extends string> =
|
|
18
|
+
export type PostDataRaw<E extends object, IdKey extends string> = Post<E, IdKey>['data'];
|
|
19
|
+
type PostAttributesType<E extends object, IdKey extends string> = Omit<Attributes<E, IdKey, false>, ExtractJsonApiReadOnlyKeys<E> | ExtractJsonApiImmutableKeys<E>> & Partial<Pick<Attributes<E, IdKey, false>, Extract<ExtractJsonApiImmutableKeys<E>, keyof Attributes<E, IdKey, false>>>>;
|
|
20
|
+
export type PostData<E extends object, IdKey extends string> = {
|
|
21
|
+
id?: Id;
|
|
22
|
+
type: string;
|
|
23
|
+
attributes: PostAttributesType<E, IdKey>;
|
|
24
|
+
relationships?: Relationships<E, IdKey, false>;
|
|
25
|
+
};
|
|
26
|
+
export type Post<E extends object, IdKey extends string> = {
|
|
27
|
+
data: PostData<E, IdKey>;
|
|
28
|
+
meta?: Record<string, unknown>;
|
|
29
|
+
};
|
|
20
30
|
export {};
|
|
@@ -5,7 +5,7 @@ const zod_1 = require("zod");
|
|
|
5
5
|
const zod_share_1 = require("../zod-share");
|
|
6
6
|
function getShape(entityParamMapService, readOnlyProps = [], immutableProps = []) {
|
|
7
7
|
const shape = {
|
|
8
|
-
id: (0, zod_share_1.
|
|
8
|
+
id: (0, zod_share_1.zodPrimaryKeyId)(entityParamMapService.entityParaMap.primaryColumnType).optional(),
|
|
9
9
|
type: (0, zod_share_1.zodType)(entityParamMapService.entityParaMap.typeName),
|
|
10
10
|
attributes: (0, zod_share_1.zodAttributes)(entityParamMapService, false, readOnlyProps, immutableProps),
|
|
11
11
|
relationships: (0, zod_share_1.zodRelationships)(entityParamMapService, false).optional(),
|
|
@@ -15,16 +15,7 @@ function getShape(entityParamMapService, readOnlyProps = [], immutableProps = []
|
|
|
15
15
|
function zodPost(entityParamMapService, readOnlyProps = [], immutableProps = []) {
|
|
16
16
|
return zod_1.z.strictObject({
|
|
17
17
|
data: getShape(entityParamMapService, readOnlyProps, immutableProps),
|
|
18
|
+
meta: zod_share_1.zodMeta,
|
|
18
19
|
});
|
|
19
20
|
}
|
|
20
|
-
class Users {
|
|
21
|
-
id;
|
|
22
|
-
login;
|
|
23
|
-
}
|
|
24
|
-
class Test {
|
|
25
|
-
id;
|
|
26
|
-
name;
|
|
27
|
-
updatedAt = new Date();
|
|
28
|
-
createdBy;
|
|
29
|
-
}
|
|
30
21
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../../libs/json-api/json-api-nestjs/src/lib/modules/mixin/zod/zod-input-post-schema/index.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../../libs/json-api/json-api-nestjs/src/lib/modules/mixin/zod/zod-input-post-schema/index.ts"],"names":[],"mappings":";;AAgEA,0BASC;AAzED,6BAAgD;AAOhD,4CAcsB;AAqBtB,SAAS,QAAQ,CACf,qBAAsD,EACtD,gBAAiD,EAAE,EACnD,iBAAmD,EAAE;IAErD,MAAM,KAAK,GAAG;QACZ,EAAE,EAAE,IAAA,2BAAe,EACjB,qBAAqB,CAAC,aAAa,CAAC,iBAA8B,CACnE,CAAC,QAAQ,EAAE;QACZ,IAAI,EAAE,IAAA,mBAAO,EAAC,qBAAqB,CAAC,aAAa,CAAC,QAAQ,CAAC;QAC3D,UAAU,EAAE,IAAA,yBAAa,EACvB,qBAAqB,EACrB,KAAK,EACL,aAAa,EACb,cAAc,CACf;QACD,aAAa,EAAE,IAAA,4BAAgB,EAAC,qBAAqB,EAAE,KAAK,CAAC,CAAC,QAAQ,EAAE;KACzE,CAAC;IAEF,OAAO,OAAC,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;AAC/B,CAAC;AAED,SAAgB,OAAO,CACrB,qBAAsD,EACtD,gBAAiD,EAAE,EACnD,iBAAmD,EAAE;IAErD,OAAO,OAAC,CAAC,YAAY,CAAC;QACpB,IAAI,EAAE,QAAQ,CAAC,qBAAqB,EAAE,aAAa,EAAE,cAAc,CAAC;QACpE,IAAI,EAAE,mBAAO;KACd,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { EntityParam } from '../../../../types';
|
|
3
3
|
import { EntityParamMapService } from '../../service';
|
|
4
|
-
declare
|
|
5
|
-
type ZodRule =
|
|
4
|
+
export declare const zodFieldSelectRule: z.ZodPipe<z.ZodOptional<z.ZodString>, z.ZodTransform<string[] | undefined, string | undefined>>;
|
|
5
|
+
export type ZodRule = z.infer<typeof zodFieldSelectRule>;
|
|
6
6
|
type CastPropertyKey<T> = T extends PropertyKey ? T : never;
|
|
7
7
|
type ZorRelationType<E extends object, IdKey extends string> = Record<CastPropertyKey<EntityParam<E, IdKey>['relations'][number]>, ZodRule>;
|
|
8
|
+
export declare function zodFieldsInputQuerySwagger<E extends object, IdKey extends string>(entityParamMapService: EntityParamMapService<E, IdKey>): z.ZodOptional<z.ZodObject<{
|
|
9
|
+
target: z.ZodPipe<z.ZodOptional<z.ZodString>, z.ZodTransform<string[] | undefined, string | undefined>>;
|
|
10
|
+
} & ZorRelationType<E, IdKey> extends infer T ? { -readonly [P in keyof T]: T[P]; } : never, z.core.$strict>>;
|
|
8
11
|
export declare function zodFieldsInputQuery<E extends object, IdKey extends string>(entityParamMapService: EntityParamMapService<E, IdKey>): z.ZodPipe<z.ZodOptional<z.ZodObject<{
|
|
9
12
|
target: z.ZodPipe<z.ZodOptional<z.ZodString>, z.ZodTransform<string[] | undefined, string | undefined>>;
|
|
10
|
-
} & ZorRelationType<E, IdKey
|
|
13
|
+
} & ZorRelationType<E, IdKey> extends infer T ? { -readonly [P in keyof T]: T[P]; } : never, z.core.$strict>>, z.ZodTransform<Awaited<z.core.$InferObjectOutput<{
|
|
11
14
|
target: z.ZodPipe<z.ZodOptional<z.ZodString>, z.ZodTransform<string[] | undefined, string | undefined>>;
|
|
12
|
-
} & ZorRelationType<E, IdKey
|
|
15
|
+
} & ZorRelationType<E, IdKey> extends infer T_1 ? { -readonly [P in keyof T_1]: T_1[P]; } : never, {}>> | null, z.core.$InferObjectOutput<{
|
|
13
16
|
target: z.ZodPipe<z.ZodOptional<z.ZodString>, z.ZodTransform<string[] | undefined, string | undefined>>;
|
|
14
|
-
} & ZorRelationType<E, IdKey
|
|
17
|
+
} & ZorRelationType<E, IdKey> extends infer T_2 ? { -readonly [P in keyof T_2]: T_2[P]; } : never, {}> | undefined>>;
|
|
15
18
|
export type ZodFieldsInputQuery<E extends object, IdKey extends string> = z.infer<ReturnType<typeof zodFieldsInputQuery<E, IdKey>>>;
|
|
16
19
|
export {};
|
|
@@ -1,25 +1,26 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.zodFieldSelectRule = void 0;
|
|
4
|
+
exports.zodFieldsInputQuerySwagger = zodFieldsInputQuerySwagger;
|
|
3
5
|
exports.zodFieldsInputQuery = zodFieldsInputQuery;
|
|
4
6
|
const json_api_nestjs_shared_1 = require("@klerick/json-api-nestjs-shared");
|
|
5
7
|
const zod_1 = require("zod");
|
|
6
8
|
const zod_utils_1 = require("../zod-utils");
|
|
7
9
|
const map_transform_to_json_shema_1 = require("../map-transform-to-json-shema");
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
function zodFieldsInputQuery(entityParamMapService) {
|
|
10
|
+
exports.zodFieldSelectRule = zod_1.z
|
|
11
|
+
.string()
|
|
12
|
+
.optional()
|
|
13
|
+
.transform(map_transform_to_json_shema_1.transformStringToArray)
|
|
14
|
+
.meta({ id: 'FieldSelectRule' });
|
|
15
|
+
function zodFieldsInputQuerySwagger(entityParamMapService) {
|
|
15
16
|
const { relations } = entityParamMapService.entityParaMap;
|
|
16
17
|
const relation = relations.reduce((acum, item) => ({
|
|
17
18
|
...acum,
|
|
18
|
-
[item]:
|
|
19
|
+
[item]: exports.zodFieldSelectRule,
|
|
19
20
|
}), {});
|
|
20
|
-
return
|
|
21
|
+
return zod_1.z
|
|
21
22
|
.strictObject({
|
|
22
|
-
target:
|
|
23
|
+
target: exports.zodFieldSelectRule,
|
|
23
24
|
...relation,
|
|
24
25
|
}, {
|
|
25
26
|
error: (err) => err.code === 'unrecognized_keys'
|
|
@@ -33,7 +34,10 @@ function zodFieldsInputQuery(entityParamMapService) {
|
|
|
33
34
|
.refine((0, zod_utils_1.nonEmptyObject)(), {
|
|
34
35
|
message: 'Validation error: Need select field for target or relation',
|
|
35
36
|
})
|
|
36
|
-
.optional()
|
|
37
|
+
.optional();
|
|
38
|
+
}
|
|
39
|
+
function zodFieldsInputQuery(entityParamMapService) {
|
|
40
|
+
return zodFieldsInputQuerySwagger(entityParamMapService)
|
|
37
41
|
.transform((input) => {
|
|
38
42
|
if (!input)
|
|
39
43
|
return null;
|
|
@@ -47,6 +51,6 @@ function zodFieldsInputQuery(entityParamMapService) {
|
|
|
47
51
|
};
|
|
48
52
|
}, {});
|
|
49
53
|
return Object.keys(result).length > 0 ? result : null;
|
|
50
|
-
})
|
|
54
|
+
});
|
|
51
55
|
}
|
|
52
56
|
//# sourceMappingURL=fields.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fields.js","sourceRoot":"","sources":["../../../../../../../../../../libs/json-api/json-api-nestjs/src/lib/modules/mixin/zod/zod-input-query-schema/fields.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"fields.js","sourceRoot":"","sources":["../../../../../../../../../../libs/json-api/json-api-nestjs/src/lib/modules/mixin/zod/zod-input-query-schema/fields.ts"],"names":[],"mappings":";;;AAkBA,gEAqCC;AAED,kDA0BC;AAnFD,4EAA8D;AAC9D,6BAAwB;AAGxB,4CAA2E;AAE3E,gFAAwE;AAE3D,QAAA,kBAAkB,GAAG,OAAC;KAChC,MAAM,EAAE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AI,KAAK,CAAC,MAAM,KAAK,CAAC;gBAAE,OAAO,IAAI,CAAC;YAE9C,OAAO;gBACL,GAAG,IAAI;gBACP,CAAC,GAAG,CAAC,EAAE,KAAK;aACb,CAAC;QACJ,CAAC,EACD,EAAkB,CACnB,CAAC;QAEF,OAAO,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC;IACxD,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -9,7 +9,7 @@ type OutPutFilter = {
|
|
|
9
9
|
relation: null | Record<string, Record<string, FilterType>>;
|
|
10
10
|
target: null | Record<string, FilterType>;
|
|
11
11
|
};
|
|
12
|
-
declare
|
|
12
|
+
export declare const zodRulesForFilterOperator: z.ZodOptional<z.ZodUnion<readonly [z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodNumber]>, z.ZodTransform<string, string | number | null>>, z.ZodObject<{
|
|
13
13
|
some: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodNumber]>, z.ZodTransform<string, string | number | null>>>;
|
|
14
14
|
in: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodNumber]>, z.ZodTransform<string, string | number | null>>>;
|
|
15
15
|
eq: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodNumber]>, z.ZodTransform<string, string | number | null>>>;
|
|
@@ -22,14 +22,31 @@ declare function getZodRulesForFilterOperator(): z.ZodOptional<z.ZodUnion<readon
|
|
|
22
22
|
regexp: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodNumber]>, z.ZodTransform<string, string | number | null>>>;
|
|
23
23
|
nin: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodNumber]>, z.ZodTransform<string, string | number | null>>>;
|
|
24
24
|
}, z.core.$strict>]>>;
|
|
25
|
-
export type ZodRulesForFilterOperator =
|
|
25
|
+
export type ZodRulesForFilterOperator = typeof zodRulesForFilterOperator;
|
|
26
|
+
export declare const zodRulesForRelation: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
27
|
+
eq: z.ZodPipe<z.ZodUnion<readonly [z.ZodLiteral<"null">, z.ZodNull]>, z.ZodTransform<null, "null" | null>>;
|
|
28
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
29
|
+
ne: z.ZodPipe<z.ZodUnion<readonly [z.ZodLiteral<"null">, z.ZodNull]>, z.ZodTransform<null, "null" | null>>;
|
|
30
|
+
}, z.core.$strict>]>>;
|
|
26
31
|
type CastPropertyKey<T> = T extends PropertyKey ? T : never;
|
|
27
32
|
export type ConcatRelationField<E extends object, IdKey extends string> = UnionToTuple<{
|
|
28
33
|
[K in keyof EntityRelationProps<E, IdKey>]: `${K & string}.${EntityRelationProps<E, IdKey>[K][number] & string}`;
|
|
29
34
|
}[keyof EntityRelationProps<E, IdKey>]>;
|
|
30
35
|
export type ShapeArrayInput<E extends object, IdKey extends string> = EntityParam<E, IdKey>['props'] | EntityParam<E, IdKey>['relations'] | ConcatRelationField<E, IdKey>;
|
|
31
36
|
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
|
|
37
|
+
export declare function zodFilterInputQuerySwagger<E extends object, IdKey extends string>(entityParamMapService: EntityParamMapService<E, IdKey>): z.ZodOptional<z.ZodObject<{ [Id in IdKey]: z.ZodOptional<z.ZodUnion<readonly [z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodNumber]>, z.ZodTransform<string, string | number | null>>, z.ZodObject<{
|
|
38
|
+
some: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodNumber]>, z.ZodTransform<string, string | number | null>>>;
|
|
39
|
+
in: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodNumber]>, z.ZodTransform<string, string | number | null>>>;
|
|
40
|
+
eq: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodNumber]>, z.ZodTransform<string, string | number | null>>>;
|
|
41
|
+
gt: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodNumber]>, z.ZodTransform<string, string | number | null>>>;
|
|
42
|
+
gte: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodNumber]>, z.ZodTransform<string, string | number | null>>>;
|
|
43
|
+
like: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodNumber]>, z.ZodTransform<string, string | number | null>>>;
|
|
44
|
+
lt: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodNumber]>, z.ZodTransform<string, string | number | null>>>;
|
|
45
|
+
lte: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodNumber]>, z.ZodTransform<string, string | number | null>>>;
|
|
46
|
+
ne: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodNumber]>, z.ZodTransform<string, string | number | null>>>;
|
|
47
|
+
regexp: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodNumber]>, z.ZodTransform<string, string | number | null>>>;
|
|
48
|
+
nin: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodNumber]>, z.ZodTransform<string, string | number | null>>>;
|
|
49
|
+
}, z.core.$strict>]>>; } & Record<CastPropertyKey<UnionToTuple<Exclude<Exclude<Extract<keyof E, string>, 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>]>, IdKey>, import("ts-toolbelt/out/Union/Last").Last<Exclude<Exclude<Extract<keyof E, string>, 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>]>, IdKey>>, [Exclude<Exclude<Extract<keyof E, string>, 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>]>, IdKey>] 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
50
|
some: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodNumber]>, z.ZodTransform<string, string | number | null>>>;
|
|
34
51
|
in: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodNumber]>, z.ZodTransform<string, string | number | null>>>;
|
|
35
52
|
eq: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodNumber]>, z.ZodTransform<string, string | number | null>>>;
|
|
@@ -45,7 +62,60 @@ export declare function zodFilterInputQuery<E extends object, IdKey extends stri
|
|
|
45
62
|
eq: z.ZodPipe<z.ZodUnion<readonly [z.ZodLiteral<"null">, z.ZodNull]>, z.ZodTransform<null, "null" | null>>;
|
|
46
63
|
}, z.core.$strict>, z.ZodObject<{
|
|
47
64
|
ne: z.ZodPipe<z.ZodUnion<readonly [z.ZodLiteral<"null">, z.ZodNull]>, z.ZodTransform<null, "null" | null>>;
|
|
48
|
-
}, z.core.$strict>]>>> & Record<CastPropertyKey<UnionToTuple<{ [
|
|
65
|
+
}, 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<{
|
|
66
|
+
some: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodNumber]>, z.ZodTransform<string, string | number | null>>>;
|
|
67
|
+
in: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodNumber]>, z.ZodTransform<string, string | number | null>>>;
|
|
68
|
+
eq: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodNumber]>, z.ZodTransform<string, string | number | null>>>;
|
|
69
|
+
gt: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodNumber]>, z.ZodTransform<string, string | number | null>>>;
|
|
70
|
+
gte: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodNumber]>, z.ZodTransform<string, string | number | null>>>;
|
|
71
|
+
like: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodNumber]>, z.ZodTransform<string, string | number | null>>>;
|
|
72
|
+
lt: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodNumber]>, z.ZodTransform<string, string | number | null>>>;
|
|
73
|
+
lte: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodNumber]>, z.ZodTransform<string, string | number | null>>>;
|
|
74
|
+
ne: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodNumber]>, z.ZodTransform<string, string | number | null>>>;
|
|
75
|
+
regexp: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodNumber]>, z.ZodTransform<string, string | number | null>>>;
|
|
76
|
+
nin: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodNumber]>, z.ZodTransform<string, string | number | null>>>;
|
|
77
|
+
}, z.core.$strict>]>>> extends infer T ? { -readonly [P in keyof T]: T[P]; } : never, z.core.$strip>>;
|
|
78
|
+
export declare function zodFilterInputQuery<E extends object, IdKey extends string>(entityParamMapService: EntityParamMapService<E, IdKey>): z.ZodPipe<z.ZodOptional<z.ZodObject<{ [Id in IdKey]: z.ZodOptional<z.ZodUnion<readonly [z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodNumber]>, z.ZodTransform<string, string | number | null>>, z.ZodObject<{
|
|
79
|
+
some: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodNumber]>, z.ZodTransform<string, string | number | null>>>;
|
|
80
|
+
in: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodNumber]>, z.ZodTransform<string, string | number | null>>>;
|
|
81
|
+
eq: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodNumber]>, z.ZodTransform<string, string | number | null>>>;
|
|
82
|
+
gt: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodNumber]>, z.ZodTransform<string, string | number | null>>>;
|
|
83
|
+
gte: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodNumber]>, z.ZodTransform<string, string | number | null>>>;
|
|
84
|
+
like: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodNumber]>, z.ZodTransform<string, string | number | null>>>;
|
|
85
|
+
lt: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodNumber]>, z.ZodTransform<string, string | number | null>>>;
|
|
86
|
+
lte: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodNumber]>, z.ZodTransform<string, string | number | null>>>;
|
|
87
|
+
ne: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodNumber]>, z.ZodTransform<string, string | number | null>>>;
|
|
88
|
+
regexp: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodNumber]>, z.ZodTransform<string, string | number | null>>>;
|
|
89
|
+
nin: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodNumber]>, z.ZodTransform<string, string | number | null>>>;
|
|
90
|
+
}, z.core.$strict>]>>; } & Record<CastPropertyKey<UnionToTuple<Exclude<Exclude<Extract<keyof E, string>, 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>]>, IdKey>, import("ts-toolbelt/out/Union/Last").Last<Exclude<Exclude<Extract<keyof E, string>, 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>]>, IdKey>>, [Exclude<Exclude<Extract<keyof E, string>, 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>]>, IdKey>] 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<{
|
|
91
|
+
some: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodNumber]>, z.ZodTransform<string, string | number | null>>>;
|
|
92
|
+
in: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodNumber]>, z.ZodTransform<string, string | number | null>>>;
|
|
93
|
+
eq: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodNumber]>, z.ZodTransform<string, string | number | null>>>;
|
|
94
|
+
gt: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodNumber]>, z.ZodTransform<string, string | number | null>>>;
|
|
95
|
+
gte: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodNumber]>, z.ZodTransform<string, string | number | null>>>;
|
|
96
|
+
like: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodNumber]>, z.ZodTransform<string, string | number | null>>>;
|
|
97
|
+
lt: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodNumber]>, z.ZodTransform<string, string | number | null>>>;
|
|
98
|
+
lte: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodNumber]>, z.ZodTransform<string, string | number | null>>>;
|
|
99
|
+
ne: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodNumber]>, z.ZodTransform<string, string | number | null>>>;
|
|
100
|
+
regexp: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodNumber]>, z.ZodTransform<string, string | number | null>>>;
|
|
101
|
+
nin: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodNumber]>, z.ZodTransform<string, string | number | null>>>;
|
|
102
|
+
}, z.core.$strict>]>>> & Record<CastPropertyKey<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]>, z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
103
|
+
eq: z.ZodPipe<z.ZodUnion<readonly [z.ZodLiteral<"null">, z.ZodNull]>, z.ZodTransform<null, "null" | null>>;
|
|
104
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
105
|
+
ne: z.ZodPipe<z.ZodUnion<readonly [z.ZodLiteral<"null">, z.ZodNull]>, z.ZodTransform<null, "null" | null>>;
|
|
106
|
+
}, 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<{
|
|
107
|
+
some: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodNumber]>, z.ZodTransform<string, string | number | null>>>;
|
|
108
|
+
in: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodNumber]>, z.ZodTransform<string, string | number | null>>>;
|
|
109
|
+
eq: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodNumber]>, z.ZodTransform<string, string | number | null>>>;
|
|
110
|
+
gt: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodNumber]>, z.ZodTransform<string, string | number | null>>>;
|
|
111
|
+
gte: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodNumber]>, z.ZodTransform<string, string | number | null>>>;
|
|
112
|
+
like: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodNumber]>, z.ZodTransform<string, string | number | null>>>;
|
|
113
|
+
lt: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodNumber]>, z.ZodTransform<string, string | number | null>>>;
|
|
114
|
+
lte: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodNumber]>, z.ZodTransform<string, string | number | null>>>;
|
|
115
|
+
ne: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodNumber]>, z.ZodTransform<string, string | number | null>>>;
|
|
116
|
+
regexp: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodNumber]>, z.ZodTransform<string, string | number | null>>>;
|
|
117
|
+
nin: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodNumber]>, z.ZodTransform<string, string | number | null>>>;
|
|
118
|
+
}, z.core.$strict>]>>> extends infer T ? { -readonly [P in keyof T]: T[P]; } : never, z.core.$strip>>, z.ZodTransform<OutPutFilter, z.core.$InferObjectOutput<{ [Id in IdKey]: 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
119
|
some: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodNumber]>, z.ZodTransform<string, string | number | null>>>;
|
|
50
120
|
in: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodNumber]>, z.ZodTransform<string, string | number | null>>>;
|
|
51
121
|
eq: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodNumber]>, z.ZodTransform<string, string | number | null>>>;
|
|
@@ -57,7 +127,7 @@ export declare function zodFilterInputQuery<E extends object, IdKey extends stri
|
|
|
57
127
|
ne: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodNumber]>, z.ZodTransform<string, string | number | null>>>;
|
|
58
128
|
regexp: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodNumber]>, z.ZodTransform<string, string | number | null>>>;
|
|
59
129
|
nin: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodNumber]>, z.ZodTransform<string, string | number | null>>>;
|
|
60
|
-
}, z.core.$strict>]
|
|
130
|
+
}, z.core.$strict>]>>; } & Record<CastPropertyKey<UnionToTuple<Exclude<Exclude<Extract<keyof E, string>, 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>]>, IdKey>, import("ts-toolbelt/out/Union/Last").Last<Exclude<Exclude<Extract<keyof E, string>, 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>]>, IdKey>>, [Exclude<Exclude<Extract<keyof E, string>, 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>]>, IdKey>] 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
131
|
some: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodNumber]>, z.ZodTransform<string, string | number | null>>>;
|
|
62
132
|
in: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodNumber]>, z.ZodTransform<string, string | number | null>>>;
|
|
63
133
|
eq: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodNumber]>, z.ZodTransform<string, string | number | null>>>;
|
|
@@ -73,7 +143,7 @@ export declare function zodFilterInputQuery<E extends object, IdKey extends stri
|
|
|
73
143
|
eq: z.ZodPipe<z.ZodUnion<readonly [z.ZodLiteral<"null">, z.ZodNull]>, z.ZodTransform<null, "null" | null>>;
|
|
74
144
|
}, z.core.$strict>, z.ZodObject<{
|
|
75
145
|
ne: z.ZodPipe<z.ZodUnion<readonly [z.ZodLiteral<"null">, z.ZodNull]>, z.ZodTransform<null, "null" | null>>;
|
|
76
|
-
}, z.core.$strict>]>>> & Record<CastPropertyKey<UnionToTuple<{ [
|
|
146
|
+
}, 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
147
|
some: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodNumber]>, z.ZodTransform<string, string | number | null>>>;
|
|
78
148
|
in: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodNumber]>, z.ZodTransform<string, string | number | null>>>;
|
|
79
149
|
eq: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodNumber]>, z.ZodTransform<string, string | number | null>>>;
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.zodRulesForRelation = exports.zodRulesForFilterOperator = void 0;
|
|
3
4
|
exports.shapeForArray = shapeForArray;
|
|
5
|
+
exports.zodFilterInputQuerySwagger = zodFilterInputQuerySwagger;
|
|
4
6
|
exports.zodFilterInputQuery = zodFilterInputQuery;
|
|
5
7
|
const json_api_nestjs_shared_1 = require("@klerick/json-api-nestjs-shared");
|
|
6
8
|
const zod_1 = require("zod");
|
|
7
9
|
const zod_utils_1 = require("../zod-utils");
|
|
10
|
+
const map_transform_to_json_shema_1 = require("../map-transform-to-json-shema");
|
|
8
11
|
const arrayOp = {
|
|
9
12
|
[json_api_nestjs_shared_1.FilterOperand.in]: true,
|
|
10
13
|
[json_api_nestjs_shared_1.FilterOperand.nin]: true,
|
|
@@ -31,7 +34,7 @@ function convertToFilterObject(value) {
|
|
|
31
34
|
function getZodRulesForFilterOperator() {
|
|
32
35
|
const filterConditional = zod_1.z
|
|
33
36
|
.union([zod_1.z.string().refine((0, zod_utils_1.stringLongerThan)()), zod_1.z.null(), zod_1.z.number()])
|
|
34
|
-
.transform(
|
|
37
|
+
.transform(map_transform_to_json_shema_1.transformFilterValueToString);
|
|
35
38
|
const conditional = zod_1.z
|
|
36
39
|
.object(json_api_nestjs_shared_1.ObjectTyped.values(json_api_nestjs_shared_1.FilterOperand).reduce((acum, item) => {
|
|
37
40
|
acum[item] = filterConditional;
|
|
@@ -44,6 +47,8 @@ function getZodRulesForFilterOperator() {
|
|
|
44
47
|
});
|
|
45
48
|
return zod_1.z.union([filterConditional, conditional]).optional();
|
|
46
49
|
}
|
|
50
|
+
exports.zodRulesForFilterOperator = getZodRulesForFilterOperator()
|
|
51
|
+
.meta({ id: 'FilterOperatorRule' });
|
|
47
52
|
function getZodRulesForRelation() {
|
|
48
53
|
return zod_1.z
|
|
49
54
|
.union([
|
|
@@ -51,19 +56,21 @@ function getZodRulesForRelation() {
|
|
|
51
56
|
.object({
|
|
52
57
|
[json_api_nestjs_shared_1.FilterOperand.eq]: zod_1.z
|
|
53
58
|
.union([zod_1.z.literal('null'), zod_1.z.null()])
|
|
54
|
-
.transform(
|
|
59
|
+
.transform(map_transform_to_json_shema_1.transformToNull),
|
|
55
60
|
})
|
|
56
61
|
.strict(),
|
|
57
62
|
zod_1.z
|
|
58
63
|
.object({
|
|
59
64
|
[json_api_nestjs_shared_1.FilterOperand.ne]: zod_1.z
|
|
60
65
|
.union([zod_1.z.literal('null'), zod_1.z.null()])
|
|
61
|
-
.transform(
|
|
66
|
+
.transform(map_transform_to_json_shema_1.transformToNull),
|
|
62
67
|
})
|
|
63
68
|
.strict(),
|
|
64
69
|
])
|
|
65
70
|
.optional();
|
|
66
71
|
}
|
|
72
|
+
exports.zodRulesForRelation = getZodRulesForRelation()
|
|
73
|
+
.meta({ id: 'FilterRelationRule' });
|
|
67
74
|
function getTupleConcatRelationFields(relationList) {
|
|
68
75
|
const result = [];
|
|
69
76
|
for (const [key, val] of json_api_nestjs_shared_1.ObjectTyped.entries(relationList)) {
|
|
@@ -80,17 +87,32 @@ function shapeForArray(fields, zodSchema) {
|
|
|
80
87
|
[item]: zodSchema,
|
|
81
88
|
}), {});
|
|
82
89
|
}
|
|
83
|
-
function
|
|
84
|
-
const target =
|
|
85
|
-
|
|
90
|
+
function zodFilterInputQuerySwagger(entityParamMapService) {
|
|
91
|
+
const target = {
|
|
92
|
+
...{
|
|
93
|
+
[entityParamMapService.entityParaMap.primaryColumnName]: exports.zodRulesForFilterOperator,
|
|
94
|
+
},
|
|
95
|
+
...shapeForArray(entityParamMapService.entityParaMap.props, exports.zodRulesForFilterOperator),
|
|
96
|
+
};
|
|
97
|
+
const relations = shapeForArray(entityParamMapService.entityParaMap.relations, exports.zodRulesForRelation);
|
|
86
98
|
const relationList = (0, zod_utils_1.getRelationProps)(entityParamMapService);
|
|
87
|
-
const
|
|
88
|
-
|
|
99
|
+
const relationPrimaryName = (0, zod_utils_1.getRelationPrimaryName)(entityParamMapService);
|
|
100
|
+
for (const [key, val] of json_api_nestjs_shared_1.ObjectTyped.entries(relationPrimaryName)) {
|
|
101
|
+
if (relationList[key].includes(val))
|
|
102
|
+
continue;
|
|
103
|
+
relationList[key].push(val);
|
|
104
|
+
}
|
|
105
|
+
const relationFields = shapeForArray(getTupleConcatRelationFields(relationList), exports.zodRulesForFilterOperator);
|
|
106
|
+
return zod_1.z
|
|
107
|
+
.object({
|
|
89
108
|
...target,
|
|
90
109
|
...relations,
|
|
91
|
-
...relationFields
|
|
110
|
+
...relationFields,
|
|
92
111
|
})
|
|
93
|
-
.optional()
|
|
112
|
+
.optional();
|
|
113
|
+
}
|
|
114
|
+
function zodFilterInputQuery(entityParamMapService) {
|
|
115
|
+
return zodFilterInputQuerySwagger(entityParamMapService)
|
|
94
116
|
.transform((data) => {
|
|
95
117
|
if (!data) {
|
|
96
118
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filter.js","sourceRoot":"","sources":["../../../../../../../../../../libs/json-api/json-api-nestjs/src/lib/modules/mixin/zod/zod-input-query-schema/filter.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"filter.js","sourceRoot":"","sources":["../../../../../../../../../../libs/json-api/json-api-nestjs/src/lib/modules/mixin/zod/zod-input-query-schema/filter.ts"],"names":[],"mappings":";;;AAmIA,sCAgBC;AAED,gEA4CC;AAED,kDAiCC;AApOD,4EAIyC;AACzC,6BAAiC;AAGjC,4CAAiG;AACjG,gFAA+F;AAgB/F,MAAM,OAAO,GAAG;IACd,CAAC,sCAAa,CAAC,EAAE,CAAC,EAAE,IAAI;IACxB,CAAC,sCAAa,CAAC,GAAG,CAAC,EAAE,IAAI;IACzB,CAAC,sCAAa,CAAC,IAAI,CAAC,EAAE,IAAI;CAC3B,CAAC;AAEF,SAAS,qBAAqB,CAC5B,KAAsC;IAItC,IAAI,IAAA,iCAAQ,EAA0C,KAAK,CAAC,EAAE,CAAC;QAC7D,OAAO;YACL,CAAC,sCAAa,CAAC,EAAE,CAAC,EAAE,KAAK;SAC1B,CAAC;IACJ,CAAC;SAAM,CAAC;QACN,OAAO,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,KAAK,CAAC,EAAE,EAAE;YACxD,IAAI,EAAE,IAAI,OAAO,EAAE,CAAC;gBAClB,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,IAAA,iCAAQ,EAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC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