@open-dpp/dto 6.1.4 → 6.2.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/dist/shared/filter.dto.d.ts +13 -0
- package/dist/shared/filter.dto.d.ts.map +1 -1
- package/dist/shared/filter.dto.js +9 -2
- package/dist/shared/get-all-params.dto.d.ts +20 -0
- package/dist/shared/get-all-params.dto.d.ts.map +1 -1
- package/dist/shared/get-all-params.dto.js +4 -1
- package/package.json +3 -3
- package/src/shared/filter.dto.ts +13 -3
- package/src/shared/get-all-params.dto.ts +7 -1
|
@@ -5,6 +5,19 @@ export declare const FilterParamsDtoSchema: z.ZodObject<{
|
|
|
5
5
|
readonly Published: "Published";
|
|
6
6
|
readonly Archived: "Archived";
|
|
7
7
|
}>>>;
|
|
8
|
+
startDate: z.ZodOptional<z.ZodISODateTime>;
|
|
9
|
+
endDate: z.ZodOptional<z.ZodISODateTime>;
|
|
8
10
|
}, z.core.$strip>;
|
|
9
11
|
export type FilterParamsDto = z.infer<typeof FilterParamsDtoSchema>;
|
|
12
|
+
export declare const PassportFilterParamsDtoSchema: z.ZodObject<{
|
|
13
|
+
status: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
14
|
+
readonly Draft: "Draft";
|
|
15
|
+
readonly Published: "Published";
|
|
16
|
+
readonly Archived: "Archived";
|
|
17
|
+
}>>>;
|
|
18
|
+
startDate: z.ZodOptional<z.ZodISODateTime>;
|
|
19
|
+
endDate: z.ZodOptional<z.ZodISODateTime>;
|
|
20
|
+
templateIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
21
|
+
}, z.core.$strip>;
|
|
22
|
+
export type PassportFilterParamsDto = z.infer<typeof PassportFilterParamsDtoSchema>;
|
|
10
23
|
//# sourceMappingURL=filter.dto.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filter.dto.d.ts","sourceRoot":"","sources":["../../src/shared/filter.dto.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"filter.dto.d.ts","sourceRoot":"","sources":["../../src/shared/filter.dto.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,qBAAqB;;;;;;;;iBAIF,CAAC;AAEjC,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAGpE,eAAO,MAAM,6BAA6B;;;;;;;;;iBAExC,CAAC;AAEH,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC"}
|
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.FilterParamsDtoSchema = void 0;
|
|
3
|
+
exports.PassportFilterParamsDtoSchema = exports.FilterParamsDtoSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
|
+
const time_dto_1 = require("./time.dto");
|
|
5
6
|
const digital_product_document_schemas_1 = require("../digital-product-document/digital-product-document.schemas");
|
|
6
|
-
exports.FilterParamsDtoSchema = zod_1.z
|
|
7
|
+
exports.FilterParamsDtoSchema = zod_1.z
|
|
8
|
+
.object({
|
|
7
9
|
status: digital_product_document_schemas_1.DigitalProductDocumentStatusDtoEnum.array().optional(),
|
|
10
|
+
})
|
|
11
|
+
.extend(time_dto_1.PeriodDtoSchema.shape);
|
|
12
|
+
// Passport-only filters: templates have no template ids of their own.
|
|
13
|
+
exports.PassportFilterParamsDtoSchema = exports.FilterParamsDtoSchema.extend({
|
|
14
|
+
templateIds: zod_1.z.string().min(1).array().optional(),
|
|
8
15
|
});
|
|
@@ -11,7 +11,27 @@ export declare const GetAllParamsDtoSchema: z.ZodObject<{
|
|
|
11
11
|
readonly Published: "Published";
|
|
12
12
|
readonly Archived: "Archived";
|
|
13
13
|
}>>>;
|
|
14
|
+
startDate: z.ZodOptional<z.ZodISODateTime>;
|
|
15
|
+
endDate: z.ZodOptional<z.ZodISODateTime>;
|
|
14
16
|
}, z.core.$strip>>;
|
|
15
17
|
}, z.core.$strip>;
|
|
16
18
|
export type GetAllParamsDto = z.infer<typeof GetAllParamsDtoSchema>;
|
|
19
|
+
export declare const GetAllPassportsParamsDtoSchema: z.ZodObject<{
|
|
20
|
+
pagination: z.ZodOptional<z.ZodObject<{
|
|
21
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
22
|
+
cursor: z.ZodOptional<z.ZodString>;
|
|
23
|
+
}, z.core.$strip>>;
|
|
24
|
+
populate: z.ZodOptional<z.ZodPipe<z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>, z.ZodTransform<string[], string | string[] | undefined>>>;
|
|
25
|
+
filter: z.ZodOptional<z.ZodObject<{
|
|
26
|
+
status: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
27
|
+
readonly Draft: "Draft";
|
|
28
|
+
readonly Published: "Published";
|
|
29
|
+
readonly Archived: "Archived";
|
|
30
|
+
}>>>;
|
|
31
|
+
startDate: z.ZodOptional<z.ZodISODateTime>;
|
|
32
|
+
endDate: z.ZodOptional<z.ZodISODateTime>;
|
|
33
|
+
templateIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
34
|
+
}, z.core.$strip>>;
|
|
35
|
+
}, z.core.$strip>;
|
|
36
|
+
export type GetAllPassportsParamsDto = z.infer<typeof GetAllPassportsParamsDtoSchema>;
|
|
17
37
|
//# sourceMappingURL=get-all-params.dto.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-all-params.dto.d.ts","sourceRoot":"","sources":["../../src/shared/get-all-params.dto.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,qBAAqB
|
|
1
|
+
{"version":3,"file":"get-all-params.dto.d.ts","sourceRoot":"","sources":["../../src/shared/get-all-params.dto.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;iBAIhC,CAAC;AAEH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEpE,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;iBAEzC,CAAC;AAEH,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GetAllParamsDtoSchema = void 0;
|
|
3
|
+
exports.GetAllPassportsParamsDtoSchema = exports.GetAllParamsDtoSchema = void 0;
|
|
4
4
|
const populate_dto_1 = require("./populate.dto");
|
|
5
5
|
const pagination_dto_1 = require("./pagination.dto");
|
|
6
6
|
const zod_1 = require("zod");
|
|
@@ -10,3 +10,6 @@ exports.GetAllParamsDtoSchema = zod_1.z.object({
|
|
|
10
10
|
populate: populate_dto_1.PopulateSchema.optional(),
|
|
11
11
|
filter: filter_dto_1.FilterParamsDtoSchema.optional(),
|
|
12
12
|
});
|
|
13
|
+
exports.GetAllPassportsParamsDtoSchema = exports.GetAllParamsDtoSchema.extend({
|
|
14
|
+
filter: filter_dto_1.PassportFilterParamsDtoSchema.optional(),
|
|
15
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-dpp/dto",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.2.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"homepage": "https://github.com/open-dpp/open-dpp#readme",
|
|
@@ -37,12 +37,12 @@
|
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@jest/globals": "^30.3.0",
|
|
40
|
-
"@swc/core": "^1.16.
|
|
40
|
+
"@swc/core": "^1.16.13",
|
|
41
41
|
"@swc/jest": "^0.2.39",
|
|
42
42
|
"@tsconfig/node-lts": "^24.0.0",
|
|
43
43
|
"@tsconfig/node-ts": "^23.6.4",
|
|
44
44
|
"@types/jest": "^30.0.0",
|
|
45
|
-
"@types/node": "^22.20.
|
|
45
|
+
"@types/node": "^22.20.5",
|
|
46
46
|
"jest": "^30.4.2",
|
|
47
47
|
"typescript": "^5.9.3"
|
|
48
48
|
},
|
package/src/shared/filter.dto.ts
CHANGED
|
@@ -1,8 +1,18 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
import { PeriodDtoSchema } from "./time.dto";
|
|
2
3
|
import { DigitalProductDocumentStatusDtoEnum } from "../digital-product-document/digital-product-document.schemas";
|
|
3
4
|
|
|
4
|
-
export const FilterParamsDtoSchema = z
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
export const FilterParamsDtoSchema = z
|
|
6
|
+
.object({
|
|
7
|
+
status: DigitalProductDocumentStatusDtoEnum.array().optional(),
|
|
8
|
+
})
|
|
9
|
+
.extend(PeriodDtoSchema.shape);
|
|
7
10
|
|
|
8
11
|
export type FilterParamsDto = z.infer<typeof FilterParamsDtoSchema>;
|
|
12
|
+
|
|
13
|
+
// Passport-only filters: templates have no template ids of their own.
|
|
14
|
+
export const PassportFilterParamsDtoSchema = FilterParamsDtoSchema.extend({
|
|
15
|
+
templateIds: z.string().min(1).array().optional(),
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
export type PassportFilterParamsDto = z.infer<typeof PassportFilterParamsDtoSchema>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { PopulateSchema } from "./populate.dto";
|
|
2
2
|
import { PagingParamsDtoSchema } from "./pagination.dto";
|
|
3
3
|
import { z } from "zod";
|
|
4
|
-
import { FilterParamsDtoSchema } from "./filter.dto";
|
|
4
|
+
import { FilterParamsDtoSchema, PassportFilterParamsDtoSchema } from "./filter.dto";
|
|
5
5
|
|
|
6
6
|
export const GetAllParamsDtoSchema = z.object({
|
|
7
7
|
pagination: PagingParamsDtoSchema.optional(),
|
|
@@ -10,3 +10,9 @@ export const GetAllParamsDtoSchema = z.object({
|
|
|
10
10
|
});
|
|
11
11
|
|
|
12
12
|
export type GetAllParamsDto = z.infer<typeof GetAllParamsDtoSchema>;
|
|
13
|
+
|
|
14
|
+
export const GetAllPassportsParamsDtoSchema = GetAllParamsDtoSchema.extend({
|
|
15
|
+
filter: PassportFilterParamsDtoSchema.optional(),
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
export type GetAllPassportsParamsDto = z.infer<typeof GetAllPassportsParamsDtoSchema>;
|