@addev-be/ui 0.21.7 → 1.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.
@@ -1,87 +1,85 @@
1
- import * as t from 'io-ts';
2
- export declare const loginRequestDtoCodec: t.TypeC<{
3
- username: t.StringC;
4
- password: t.StringC;
5
- }>;
6
- export declare const loginResponseDtoCodec: t.TypeC<{
7
- status: t.NumberC;
8
- token: t.StringC;
9
- user: t.UnionC<[t.IntersectionC<[t.TypeC<{
10
- username: t.StringC;
11
- permissions: t.ArrayC<t.StringC>;
12
- isAdmin: t.BooleanC;
13
- profile: t.UnionC<[t.TypeC<{
14
- name: t.StringC;
15
- permissions: t.ArrayC<t.StringC>;
16
- isAdmin: t.BooleanC;
17
- id: t.UnionC<[t.StringC, t.NullC]>;
18
- }>, t.NullC]>;
19
- id: t.UnionC<[t.StringC, t.NullC]>;
20
- }>, t.PartialC<{
21
- name: t.StringC;
22
- email: t.StringC;
23
- lastLogin: t.UnionC<[t.StringC, t.NullC]>;
24
- }>]>, t.NullC]>;
25
- }>;
26
- export type LoginRequestDTO = t.TypeOf<typeof loginRequestDtoCodec>;
27
- export type LoginResponseDTO = t.TypeOf<typeof loginResponseDtoCodec>;
1
+ import { z } from 'zod';
2
+ export declare const loginRequestDtoSchema: z.ZodObject<{
3
+ username: z.ZodString;
4
+ password: z.ZodString;
5
+ }, z.core.$strip>;
6
+ export declare const loginResponseDtoSchema: z.ZodObject<{
7
+ status: z.ZodNumber;
8
+ token: z.ZodString;
9
+ user: z.ZodNullable<z.ZodObject<{
10
+ id: z.ZodNullable<z.ZodString>;
11
+ username: z.ZodString;
12
+ permissions: z.ZodArray<z.ZodString>;
13
+ isAdmin: z.ZodBoolean;
14
+ profile: z.ZodNullable<z.ZodObject<{
15
+ id: z.ZodNullable<z.ZodString>;
16
+ name: z.ZodString;
17
+ permissions: z.ZodArray<z.ZodString>;
18
+ isAdmin: z.ZodBoolean;
19
+ }, z.core.$strip>>;
20
+ name: z.ZodOptional<z.ZodString>;
21
+ email: z.ZodOptional<z.ZodString>;
22
+ lastLogin: z.ZodOptional<z.ZodNullable<z.ZodString>>;
23
+ }, z.core.$strip>>;
24
+ }, z.core.$strip>;
25
+ export type LoginRequestDTO = z.infer<typeof loginRequestDtoSchema>;
26
+ export type LoginResponseDTO = z.infer<typeof loginResponseDtoSchema>;
28
27
  /*****/
29
- export declare const logoutRequestDtoCodec: t.TypeC<{}>;
30
- export declare const logoutResponseDtoCodec: t.TypeC<{
31
- status: t.NumberC;
32
- }>;
33
- export type LogoutRequestDTO = t.TypeOf<typeof logoutRequestDtoCodec>;
34
- export type LogoutResponseDTO = t.TypeOf<typeof logoutResponseDtoCodec>;
28
+ export declare const logoutRequestDtoSchema: z.ZodObject<{}, z.core.$strip>;
29
+ export declare const logoutResponseDtoSchema: z.ZodObject<{
30
+ status: z.ZodNumber;
31
+ }, z.core.$strip>;
32
+ export type LogoutRequestDTO = z.infer<typeof logoutRequestDtoSchema>;
33
+ export type LogoutResponseDTO = z.infer<typeof logoutResponseDtoSchema>;
35
34
  /*****/
36
- export declare const authenticateRequestDtoCodec: t.TypeC<{
37
- token: t.StringC;
38
- }>;
39
- export declare const authenticateResponseDtoCodec: t.TypeC<{
40
- status: t.NumberC;
41
- user: t.UnionC<[t.IntersectionC<[t.TypeC<{
42
- username: t.StringC;
43
- permissions: t.ArrayC<t.StringC>;
44
- isAdmin: t.BooleanC;
45
- profile: t.UnionC<[t.TypeC<{
46
- name: t.StringC;
47
- permissions: t.ArrayC<t.StringC>;
48
- isAdmin: t.BooleanC;
49
- id: t.UnionC<[t.StringC, t.NullC]>;
50
- }>, t.NullC]>;
51
- id: t.UnionC<[t.StringC, t.NullC]>;
52
- }>, t.PartialC<{
53
- name: t.StringC;
54
- email: t.StringC;
55
- lastLogin: t.UnionC<[t.StringC, t.NullC]>;
56
- }>]>, t.NullC]>;
57
- }>;
58
- export type AuthenticateRequestDTO = t.TypeOf<typeof authenticateRequestDtoCodec>;
59
- export type AuthenticateResponseDTO = t.TypeOf<typeof authenticateResponseDtoCodec>;
35
+ export declare const authenticateRequestDtoSchema: z.ZodObject<{
36
+ token: z.ZodString;
37
+ }, z.core.$strip>;
38
+ export declare const authenticateResponseDtoSchema: z.ZodObject<{
39
+ status: z.ZodNumber;
40
+ user: z.ZodNullable<z.ZodObject<{
41
+ id: z.ZodNullable<z.ZodString>;
42
+ username: z.ZodString;
43
+ permissions: z.ZodArray<z.ZodString>;
44
+ isAdmin: z.ZodBoolean;
45
+ profile: z.ZodNullable<z.ZodObject<{
46
+ id: z.ZodNullable<z.ZodString>;
47
+ name: z.ZodString;
48
+ permissions: z.ZodArray<z.ZodString>;
49
+ isAdmin: z.ZodBoolean;
50
+ }, z.core.$strip>>;
51
+ name: z.ZodOptional<z.ZodString>;
52
+ email: z.ZodOptional<z.ZodString>;
53
+ lastLogin: z.ZodOptional<z.ZodNullable<z.ZodString>>;
54
+ }, z.core.$strip>>;
55
+ }, z.core.$strip>;
56
+ export type AuthenticateRequestDTO = z.infer<typeof authenticateRequestDtoSchema>;
57
+ export type AuthenticateResponseDTO = z.infer<typeof authenticateResponseDtoSchema>;
60
58
  /*****/
61
- export declare const sendRecoveryKeyRequestDtoCodec: t.TypeC<{
62
- email: t.StringC;
63
- }>;
64
- export declare const sendRecoveryKeyResponseDtoCodec: t.TypeC<{
65
- status: t.NumberC;
66
- }>;
67
- export type SendRecoveryKeyRequestDTO = t.TypeOf<typeof sendRecoveryKeyRequestDtoCodec>;
68
- export type SendRecoveryKeyResponseDTO = t.TypeOf<typeof sendRecoveryKeyResponseDtoCodec>;
59
+ export declare const sendRecoveryKeyRequestDtoSchema: z.ZodObject<{
60
+ email: z.ZodString;
61
+ }, z.core.$strip>;
62
+ export declare const sendRecoveryKeyResponseDtoSchema: z.ZodObject<{
63
+ status: z.ZodNumber;
64
+ }, z.core.$strip>;
65
+ export type SendRecoveryKeyRequestDTO = z.infer<typeof sendRecoveryKeyRequestDtoSchema>;
66
+ export type SendRecoveryKeyResponseDTO = z.infer<typeof sendRecoveryKeyResponseDtoSchema>;
69
67
  /*****/
70
- export declare const checkRecoveryKeyRequestDtoCodec: t.TypeC<{
71
- key: t.StringC;
72
- }>;
73
- export declare const checkRecoveryKeyResponseDtoCodec: t.TypeC<{
74
- status: t.NumberC;
75
- }>;
76
- export type CheckRecoveryKeyRequestDTO = t.TypeOf<typeof checkRecoveryKeyRequestDtoCodec>;
77
- export type CheckRecoveryKeyResponseDTO = t.TypeOf<typeof checkRecoveryKeyResponseDtoCodec>;
68
+ export declare const checkRecoveryKeyRequestDtoSchema: z.ZodObject<{
69
+ key: z.ZodString;
70
+ }, z.core.$strip>;
71
+ export declare const checkRecoveryKeyResponseDtoSchema: z.ZodObject<{
72
+ status: z.ZodNumber;
73
+ }, z.core.$strip>;
74
+ export type CheckRecoveryKeyRequestDTO = z.infer<typeof checkRecoveryKeyRequestDtoSchema>;
75
+ export type CheckRecoveryKeyResponseDTO = z.infer<typeof checkRecoveryKeyResponseDtoSchema>;
78
76
  /*****/
79
- export declare const resetPasswordRequestDtoCodec: t.TypeC<{
80
- key: t.StringC;
81
- password: t.StringC;
82
- }>;
83
- export declare const resetPasswordResponseDtoCodec: t.TypeC<{
84
- status: t.NumberC;
85
- }>;
86
- export type ResetPasswordRequestDTO = t.TypeOf<typeof resetPasswordRequestDtoCodec>;
87
- export type ResetPasswordResponseDTO = t.TypeOf<typeof resetPasswordResponseDtoCodec>;
77
+ export declare const resetPasswordRequestDtoSchema: z.ZodObject<{
78
+ key: z.ZodString;
79
+ password: z.ZodString;
80
+ }, z.core.$strip>;
81
+ export declare const resetPasswordResponseDtoSchema: z.ZodObject<{
82
+ status: z.ZodNumber;
83
+ }, z.core.$strip>;
84
+ export type ResetPasswordRequestDTO = z.infer<typeof resetPasswordRequestDtoSchema>;
85
+ export type ResetPasswordResponseDTO = z.infer<typeof resetPasswordResponseDtoSchema>;
@@ -1,72 +1,49 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
2
  Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.resetPasswordResponseDtoCodec = exports.resetPasswordRequestDtoCodec = exports.checkRecoveryKeyResponseDtoCodec = exports.checkRecoveryKeyRequestDtoCodec = exports.sendRecoveryKeyResponseDtoCodec = exports.sendRecoveryKeyRequestDtoCodec = exports.authenticateResponseDtoCodec = exports.authenticateRequestDtoCodec = exports.logoutResponseDtoCodec = exports.logoutRequestDtoCodec = exports.loginResponseDtoCodec = exports.loginRequestDtoCodec = void 0;
27
- var t = __importStar(require("io-ts"));
3
+ exports.resetPasswordResponseDtoSchema = exports.resetPasswordRequestDtoSchema = exports.checkRecoveryKeyResponseDtoSchema = exports.checkRecoveryKeyRequestDtoSchema = exports.sendRecoveryKeyResponseDtoSchema = exports.sendRecoveryKeyRequestDtoSchema = exports.authenticateResponseDtoSchema = exports.authenticateRequestDtoSchema = exports.logoutResponseDtoSchema = exports.logoutRequestDtoSchema = exports.loginResponseDtoSchema = exports.loginRequestDtoSchema = void 0;
4
+ var zod_1 = require("zod");
28
5
  var users_1 = require("./users");
29
- exports.loginRequestDtoCodec = t.type({
30
- username: t.string,
31
- password: t.string,
32
- }, 'LoginRequestDTO');
33
- exports.loginResponseDtoCodec = t.type({
34
- status: t.number,
35
- token: t.string,
36
- user: t.union([users_1.userDtoCodec, t.null]),
37
- }, 'LoginResponseDTO');
6
+ exports.loginRequestDtoSchema = zod_1.z.object({
7
+ username: zod_1.z.string(),
8
+ password: zod_1.z.string(),
9
+ });
10
+ exports.loginResponseDtoSchema = zod_1.z.object({
11
+ status: zod_1.z.number(),
12
+ token: zod_1.z.string(),
13
+ user: users_1.userDtoSchema.nullable(),
14
+ });
38
15
  /*****/
39
- exports.logoutRequestDtoCodec = t.type({}, 'LogoutRequestDTO');
40
- exports.logoutResponseDtoCodec = t.type({
41
- status: t.number,
42
- }, 'LogoutResponseDTO');
16
+ exports.logoutRequestDtoSchema = zod_1.z.object({});
17
+ exports.logoutResponseDtoSchema = zod_1.z.object({
18
+ status: zod_1.z.number(),
19
+ });
43
20
  /*****/
44
- exports.authenticateRequestDtoCodec = t.type({
45
- token: t.string,
46
- }, 'AuthenticateRequestDTO');
47
- exports.authenticateResponseDtoCodec = t.type({
48
- status: t.number,
49
- user: t.union([users_1.userDtoCodec, t.null]),
50
- }, 'AuthenticateResponseDTO');
21
+ exports.authenticateRequestDtoSchema = zod_1.z.object({
22
+ token: zod_1.z.string(),
23
+ });
24
+ exports.authenticateResponseDtoSchema = zod_1.z.object({
25
+ status: zod_1.z.number(),
26
+ user: users_1.userDtoSchema.nullable(),
27
+ });
51
28
  /*****/
52
- exports.sendRecoveryKeyRequestDtoCodec = t.type({
53
- email: t.string,
54
- }, 'SendRecoveryKeyRequestDTO');
55
- exports.sendRecoveryKeyResponseDtoCodec = t.type({
56
- status: t.number,
57
- }, 'SendRecoveryKeyResponseDTO');
29
+ exports.sendRecoveryKeyRequestDtoSchema = zod_1.z.object({
30
+ email: zod_1.z.string(),
31
+ });
32
+ exports.sendRecoveryKeyResponseDtoSchema = zod_1.z.object({
33
+ status: zod_1.z.number(),
34
+ });
58
35
  /*****/
59
- exports.checkRecoveryKeyRequestDtoCodec = t.type({
60
- key: t.string,
61
- }, 'CheckRecoveryKeyRequestDTO');
62
- exports.checkRecoveryKeyResponseDtoCodec = t.type({
63
- status: t.number,
64
- }, 'CheckRecoveryKeyResponseDTO');
36
+ exports.checkRecoveryKeyRequestDtoSchema = zod_1.z.object({
37
+ key: zod_1.z.string(),
38
+ });
39
+ exports.checkRecoveryKeyResponseDtoSchema = zod_1.z.object({
40
+ status: zod_1.z.number(),
41
+ });
65
42
  /*****/
66
- exports.resetPasswordRequestDtoCodec = t.type({
67
- key: t.string,
68
- password: t.string,
69
- }, 'ResetPasswordRequestDTO');
70
- exports.resetPasswordResponseDtoCodec = t.type({
71
- status: t.number,
72
- }, 'ResetPasswordResponseDTO');
43
+ exports.resetPasswordRequestDtoSchema = zod_1.z.object({
44
+ key: zod_1.z.string(),
45
+ password: zod_1.z.string(),
46
+ });
47
+ exports.resetPasswordResponseDtoSchema = zod_1.z.object({
48
+ status: zod_1.z.number(),
49
+ });
@@ -1,6 +1,6 @@
1
- import * as t from 'io-ts';
2
- export declare const baseModelDtoCodec: t.TypeC<{
3
- id: t.UnionC<[t.StringC, t.NullC]>;
4
- }>;
5
- export type BaseModelDTO = t.TypeOf<typeof baseModelDtoCodec>;
1
+ import { z } from 'zod';
2
+ export declare const baseModelDtoSchema: z.ZodObject<{
3
+ id: z.ZodNullable<z.ZodString>;
4
+ }, z.core.$strip>;
5
+ export type BaseModelDTO = z.infer<typeof baseModelDtoSchema>;
6
6
  export declare const UUID_REGEX: RegExp;
@@ -1,31 +1,8 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
2
  Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.UUID_REGEX = exports.baseModelDtoCodec = void 0;
27
- var t = __importStar(require("io-ts"));
28
- exports.baseModelDtoCodec = t.type({
29
- id: t.union([t.string, t.null]),
3
+ exports.UUID_REGEX = exports.baseModelDtoSchema = void 0;
4
+ var zod_1 = require("zod");
5
+ exports.baseModelDtoSchema = zod_1.z.object({
6
+ id: zod_1.z.string().nullable(),
30
7
  });
31
8
  exports.UUID_REGEX = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
@@ -1,44 +1,43 @@
1
- import * as t from 'io-ts';
2
- export declare const genericGetRequestDtoCodec: t.TypeC<{
3
- id: t.StringC;
4
- }>;
5
- export declare const getGenericGetResponseDtoCodec: <C extends t.Mixed>(codec: C) => t.TypeC<{
6
- status: t.NumberC;
7
- data: C;
8
- }>;
9
- export type GenericGetRequestDTO = t.TypeOf<typeof genericGetRequestDtoCodec>;
1
+ import { z } from 'zod';
2
+ export declare const genericGetRequestDtoSchema: z.ZodObject<{
3
+ id: z.ZodString;
4
+ }, z.core.$strip>;
5
+ export declare const getGenericGetResponseDtoSchema: <T extends z.ZodType>(schema: T) => z.ZodObject<{
6
+ status: z.ZodNumber;
7
+ data: T;
8
+ }, z.core.$strip>;
9
+ export type GenericGetRequestDTO = z.infer<typeof genericGetRequestDtoSchema>;
10
10
  /*****/
11
- export declare const genericGetAllRequestDtoCodec: t.TypeC<{}>;
12
- export declare const getGenericGetAllResponseDtoCodec: <C extends t.Mixed>(codec: C) => t.TypeC<{
13
- status: t.NumberC;
14
- data: t.ArrayC<C>;
15
- }>;
16
- export type GenericGetAllRequestDTO = t.TypeOf<typeof genericGetAllRequestDtoCodec>;
11
+ export declare const genericGetAllRequestDtoSchema: z.ZodObject<{}, z.core.$strip>;
12
+ export declare const getGenericGetAllResponseDtoSchema: <T extends z.ZodType>(schema: T) => z.ZodObject<{
13
+ status: z.ZodNumber;
14
+ data: z.ZodArray<T>;
15
+ }, z.core.$strip>;
16
+ export type GenericGetAllRequestDTO = z.infer<typeof genericGetAllRequestDtoSchema>;
17
17
  /*****/
18
- export declare const getGenericSaveRequestDtoCodec: <C extends t.Mixed>(codec: C) => t.TypeC<{
19
- data: C;
20
- }>;
21
- export declare const getGenericSaveResponseDtoCodec: <C extends t.Mixed>(codec: C) => t.TypeC<{
22
- status: t.NumberC;
23
- data: C;
24
- }>;
18
+ export declare const getGenericSaveRequestDtoSchema: <T extends z.ZodType>(schema: T) => z.ZodObject<{
19
+ data: T;
20
+ }, z.core.$strip>;
21
+ export declare const getGenericSaveResponseDtoSchema: <T extends z.ZodType>(schema: T) => z.ZodObject<{
22
+ status: z.ZodNumber;
23
+ data: T;
24
+ }, z.core.$strip>;
25
25
  /*****/
26
- export declare const genericArchiveRequestDtoCodec: t.IntersectionC<[t.TypeC<{
27
- ids: t.ArrayC<t.StringC>;
28
- }>, t.PartialC<{
29
- archived: t.BooleanC;
30
- }>]>;
31
- export declare const genericArchiveResponseDtoCodec: t.TypeC<{
32
- status: t.ArrayC<t.NumberC>;
33
- }>;
34
- export type GenericArchiveRequestDTO = t.TypeOf<typeof genericArchiveRequestDtoCodec>;
35
- export type GenericArchiveResponseDTO = t.TypeOf<typeof genericArchiveResponseDtoCodec>;
26
+ export declare const genericArchiveRequestDtoSchema: z.ZodObject<{
27
+ ids: z.ZodArray<z.ZodString>;
28
+ archived: z.ZodOptional<z.ZodBoolean>;
29
+ }, z.core.$strip>;
30
+ export declare const genericArchiveResponseDtoSchema: z.ZodObject<{
31
+ status: z.ZodArray<z.ZodNumber>;
32
+ }, z.core.$strip>;
33
+ export type GenericArchiveRequestDTO = z.infer<typeof genericArchiveRequestDtoSchema>;
34
+ export type GenericArchiveResponseDTO = z.infer<typeof genericArchiveResponseDtoSchema>;
36
35
  /*****/
37
- export declare const genericDeleteRequestDtoCodec: t.TypeC<{
38
- ids: t.ArrayC<t.StringC>;
39
- }>;
40
- export declare const genericDeleteResponseDtoCodec: t.TypeC<{
41
- status: t.ArrayC<t.NumberC>;
42
- }>;
43
- export type GenericDeleteRequestDTO = t.TypeOf<typeof genericDeleteRequestDtoCodec>;
44
- export type GenericDeleteResponseDTO = t.TypeOf<typeof genericDeleteResponseDtoCodec>;
36
+ export declare const genericDeleteRequestDtoSchema: z.ZodObject<{
37
+ ids: z.ZodArray<z.ZodString>;
38
+ }, z.core.$strip>;
39
+ export declare const genericDeleteResponseDtoSchema: z.ZodObject<{
40
+ status: z.ZodArray<z.ZodNumber>;
41
+ }, z.core.$strip>;
42
+ export type GenericDeleteRequestDTO = z.infer<typeof genericDeleteRequestDtoSchema>;
43
+ export type GenericDeleteResponseDTO = z.infer<typeof genericDeleteResponseDtoSchema>;
@@ -1,79 +1,52 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
2
  Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.genericDeleteResponseDtoCodec = exports.genericDeleteRequestDtoCodec = exports.genericArchiveResponseDtoCodec = exports.genericArchiveRequestDtoCodec = exports.getGenericSaveResponseDtoCodec = exports.getGenericSaveRequestDtoCodec = exports.getGenericGetAllResponseDtoCodec = exports.genericGetAllRequestDtoCodec = exports.getGenericGetResponseDtoCodec = exports.genericGetRequestDtoCodec = void 0;
27
- var t = __importStar(require("io-ts"));
28
- exports.genericGetRequestDtoCodec = t.type({
29
- id: t.string,
30
- }, 'GenericGetRequestDTO');
31
- var getGenericGetResponseDtoCodec = function (codec) {
32
- return t.type({
33
- status: t.number,
34
- data: codec,
3
+ exports.genericDeleteResponseDtoSchema = exports.genericDeleteRequestDtoSchema = exports.genericArchiveResponseDtoSchema = exports.genericArchiveRequestDtoSchema = exports.getGenericSaveResponseDtoSchema = exports.getGenericSaveRequestDtoSchema = exports.getGenericGetAllResponseDtoSchema = exports.genericGetAllRequestDtoSchema = exports.getGenericGetResponseDtoSchema = exports.genericGetRequestDtoSchema = void 0;
4
+ var zod_1 = require("zod");
5
+ exports.genericGetRequestDtoSchema = zod_1.z.object({
6
+ id: zod_1.z.string(),
7
+ });
8
+ var getGenericGetResponseDtoSchema = function (schema) {
9
+ return zod_1.z.object({
10
+ status: zod_1.z.number(),
11
+ data: schema,
35
12
  });
36
13
  };
37
- exports.getGenericGetResponseDtoCodec = getGenericGetResponseDtoCodec;
14
+ exports.getGenericGetResponseDtoSchema = getGenericGetResponseDtoSchema;
38
15
  /*****/
39
- exports.genericGetAllRequestDtoCodec = t.type({}, 'GenericGetAllRequestDTO');
40
- var getGenericGetAllResponseDtoCodec = function (codec) {
41
- return t.type({
42
- status: t.number,
43
- data: t.array(codec),
16
+ exports.genericGetAllRequestDtoSchema = zod_1.z.object({});
17
+ var getGenericGetAllResponseDtoSchema = function (schema) {
18
+ return zod_1.z.object({
19
+ status: zod_1.z.number(),
20
+ data: zod_1.z.array(schema),
44
21
  });
45
22
  };
46
- exports.getGenericGetAllResponseDtoCodec = getGenericGetAllResponseDtoCodec;
23
+ exports.getGenericGetAllResponseDtoSchema = getGenericGetAllResponseDtoSchema;
47
24
  /*****/
48
- var getGenericSaveRequestDtoCodec = function (codec) {
49
- return t.type({
50
- data: codec,
25
+ var getGenericSaveRequestDtoSchema = function (schema) {
26
+ return zod_1.z.object({
27
+ data: schema,
51
28
  });
52
29
  };
53
- exports.getGenericSaveRequestDtoCodec = getGenericSaveRequestDtoCodec;
54
- var getGenericSaveResponseDtoCodec = function (codec) {
55
- return t.type({
56
- status: t.number,
57
- data: codec,
30
+ exports.getGenericSaveRequestDtoSchema = getGenericSaveRequestDtoSchema;
31
+ var getGenericSaveResponseDtoSchema = function (schema) {
32
+ return zod_1.z.object({
33
+ status: zod_1.z.number(),
34
+ data: schema,
58
35
  });
59
36
  };
60
- exports.getGenericSaveResponseDtoCodec = getGenericSaveResponseDtoCodec;
37
+ exports.getGenericSaveResponseDtoSchema = getGenericSaveResponseDtoSchema;
61
38
  /*****/
62
- exports.genericArchiveRequestDtoCodec = t.intersection([
63
- t.type({
64
- ids: t.array(t.string),
65
- }),
66
- t.partial({
67
- archived: t.boolean,
68
- }),
69
- ], 'GenericArchiveRequestDTO');
70
- exports.genericArchiveResponseDtoCodec = t.type({
71
- status: t.array(t.number),
72
- }, 'GenericArchiveResponseDTO');
39
+ exports.genericArchiveRequestDtoSchema = zod_1.z.object({
40
+ ids: zod_1.z.array(zod_1.z.string()),
41
+ archived: zod_1.z.boolean().optional(),
42
+ });
43
+ exports.genericArchiveResponseDtoSchema = zod_1.z.object({
44
+ status: zod_1.z.array(zod_1.z.number()),
45
+ });
73
46
  /*****/
74
- exports.genericDeleteRequestDtoCodec = t.type({
75
- ids: t.array(t.string),
76
- }, 'GenericDeleteRequestDTO');
77
- exports.genericDeleteResponseDtoCodec = t.type({
78
- status: t.array(t.number),
79
- }, 'GenericDeleteResponseDTO');
47
+ exports.genericDeleteRequestDtoSchema = zod_1.z.object({
48
+ ids: zod_1.z.array(zod_1.z.string()),
49
+ });
50
+ exports.genericDeleteResponseDtoSchema = zod_1.z.object({
51
+ status: zod_1.z.array(zod_1.z.number()),
52
+ });
@@ -1,24 +1,24 @@
1
- import * as t from 'io-ts';
2
- export declare const trackingEventDtoCodec: t.TypeC<{
3
- name: t.StringC;
4
- details: t.RecordC<t.StringC, t.UnionC<[t.StringC, t.NumberC, t.BooleanC, t.NullC]>>;
5
- id: t.UnionC<[t.StringC, t.NullC]>;
6
- }>;
7
- export type TrackingEventDTO = t.TypeOf<typeof trackingEventDtoCodec>;
8
- export declare const sendTrackingEventRequestDtoCodec: t.TypeC<{
9
- data: t.TypeC<{
10
- name: t.StringC;
11
- details: t.RecordC<t.StringC, t.UnionC<[t.StringC, t.NumberC, t.BooleanC, t.NullC]>>;
12
- id: t.UnionC<[t.StringC, t.NullC]>;
13
- }>;
14
- }>;
15
- export declare const sendTrackingEventResponseDtoCodec: t.TypeC<{
16
- status: t.NumberC;
17
- data: t.TypeC<{
18
- name: t.StringC;
19
- details: t.RecordC<t.StringC, t.UnionC<[t.StringC, t.NumberC, t.BooleanC, t.NullC]>>;
20
- id: t.UnionC<[t.StringC, t.NullC]>;
21
- }>;
22
- }>;
23
- export type SendTrackingEventRequestDTO = t.TypeOf<typeof sendTrackingEventRequestDtoCodec>;
24
- export type SendTrackingEventResponseDTO = t.TypeOf<typeof sendTrackingEventResponseDtoCodec>;
1
+ import { z } from 'zod';
2
+ export declare const trackingEventDtoSchema: z.ZodObject<{
3
+ id: z.ZodNullable<z.ZodString>;
4
+ name: z.ZodString;
5
+ details: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>;
6
+ }, z.core.$strip>;
7
+ export type TrackingEventDTO = z.infer<typeof trackingEventDtoSchema>;
8
+ export declare const sendTrackingEventRequestDtoSchema: z.ZodObject<{
9
+ data: z.ZodObject<{
10
+ id: z.ZodNullable<z.ZodString>;
11
+ name: z.ZodString;
12
+ details: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>;
13
+ }, z.core.$strip>;
14
+ }, z.core.$strip>;
15
+ export declare const sendTrackingEventResponseDtoSchema: z.ZodObject<{
16
+ status: z.ZodNumber;
17
+ data: z.ZodObject<{
18
+ id: z.ZodNullable<z.ZodString>;
19
+ name: z.ZodString;
20
+ details: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>;
21
+ }, z.core.$strip>;
22
+ }, z.core.$strip>;
23
+ export type SendTrackingEventRequestDTO = z.infer<typeof sendTrackingEventRequestDtoSchema>;
24
+ export type SendTrackingEventResponseDTO = z.infer<typeof sendTrackingEventResponseDtoSchema>;