@dakkitor/api-contracts 1.1.3 → 1.1.4
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/client-contacts/client-contacts.contract.d.ts +619 -322
- package/dist/client-contacts/client-contacts.contract.d.ts.map +1 -1
- package/dist/client-contacts/client-contacts.contract.js +14 -32
- package/dist/clients/clients.contract.d.ts +294 -268
- package/dist/clients/clients.contract.d.ts.map +1 -1
- package/dist/clients/clients.contract.js +14 -33
- package/dist/common/pagination.schema.d.ts +12 -6
- package/dist/common/pagination.schema.d.ts.map +1 -1
- package/dist/common/pagination.schema.js +6 -4
- package/dist/index.d.ts +507 -496
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -7
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clients.contract.d.ts","sourceRoot":"","sources":["../../contracts/clients/clients.contract.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"clients.contract.d.ts","sourceRoot":"","sources":["../../contracts/clients/clients.contract.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAUxB,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;EAK3B,CAAC;AAEH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiBvB,CAAC;AAEH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;EAI7B,CAAC;AAEH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4B5B,CAAC;AAEJ,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;EAK7B,CAAC;AAEH,eAAO,MAAM,gCAAgC;;;;;;;;;EAG3C,CAAC;AAEH,eAAO,MAAM,uBAAuB;;;;;;EAElC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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8EjC,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.clientsContractRouter = exports.PaginatedResponseSchema = exports.AutocompleteQuerySchema = exports.ClientAutocompleteResponseSchema = exports.FilterClientSchema = exports.UpdateClientSchema = exports.CreateClientSchema = exports.ClientSchema = exports.ClientUserSchema = void 0;
|
|
4
4
|
const core_1 = require("@ts-rest/core");
|
|
5
5
|
const zod_1 = require("zod");
|
|
6
6
|
const error_schemas_1 = require("../common/error-schemas");
|
|
@@ -10,7 +10,7 @@ const ClientStatusSchema = zod_1.z.enum([
|
|
|
10
10
|
'PENDING_VERIFICATION',
|
|
11
11
|
'BLACKLISTED',
|
|
12
12
|
]);
|
|
13
|
-
|
|
13
|
+
exports.ClientUserSchema = zod_1.z.object({
|
|
14
14
|
id: zod_1.z.string().uuid(),
|
|
15
15
|
firstName: zod_1.z.string(),
|
|
16
16
|
lastName: zod_1.z.string(),
|
|
@@ -28,7 +28,7 @@ exports.ClientSchema = zod_1.z.object({
|
|
|
28
28
|
.nullable()
|
|
29
29
|
.optional()
|
|
30
30
|
.describe('Reason for Blacklisting'),
|
|
31
|
-
lastUpdatedBy:
|
|
31
|
+
lastUpdatedBy: exports.ClientUserSchema.describe('Last Updated By'),
|
|
32
32
|
createdAt: zod_1.z.string().datetime().describe('Creation Date'),
|
|
33
33
|
updatedAt: zod_1.z.string().datetime().describe('Last Update Date'),
|
|
34
34
|
version: zod_1.z.number().describe('Version Number'),
|
|
@@ -80,17 +80,13 @@ exports.AutocompleteQuerySchema = zod_1.z.object({
|
|
|
80
80
|
});
|
|
81
81
|
exports.PaginatedResponseSchema = (0, pagination_schema_1.createPaginatedResponseSchema)(exports.ClientSchema);
|
|
82
82
|
const c = (0, core_1.initContract)();
|
|
83
|
-
|
|
83
|
+
exports.clientsContractRouter = c.router({
|
|
84
84
|
create: {
|
|
85
85
|
method: 'POST',
|
|
86
86
|
path: '/v2/clients',
|
|
87
87
|
responses: {
|
|
88
88
|
201: exports.ClientSchema,
|
|
89
|
-
400: error_schemas_1.ErrorResponseSchema,
|
|
90
|
-
401: error_schemas_1.ErrorResponseSchema,
|
|
91
|
-
403: error_schemas_1.ErrorResponseSchema,
|
|
92
89
|
409: error_schemas_1.ErrorResponseSchema,
|
|
93
|
-
500: error_schemas_1.ErrorResponseSchema,
|
|
94
90
|
},
|
|
95
91
|
body: exports.CreateClientSchema,
|
|
96
92
|
summary: 'Create a new client',
|
|
@@ -100,10 +96,6 @@ const clientsContractConfig = {
|
|
|
100
96
|
path: '/v2/clients',
|
|
101
97
|
responses: {
|
|
102
98
|
200: exports.PaginatedResponseSchema,
|
|
103
|
-
400: error_schemas_1.ErrorResponseSchema,
|
|
104
|
-
401: error_schemas_1.ErrorResponseSchema,
|
|
105
|
-
403: error_schemas_1.ErrorResponseSchema,
|
|
106
|
-
500: error_schemas_1.ErrorResponseSchema,
|
|
107
99
|
},
|
|
108
100
|
query: exports.FilterClientSchema,
|
|
109
101
|
summary: 'Get all clients',
|
|
@@ -113,10 +105,6 @@ const clientsContractConfig = {
|
|
|
113
105
|
path: '/v2/clients/autocomplete',
|
|
114
106
|
responses: {
|
|
115
107
|
200: zod_1.z.array(exports.ClientAutocompleteResponseSchema),
|
|
116
|
-
400: error_schemas_1.ErrorResponseSchema,
|
|
117
|
-
401: error_schemas_1.ErrorResponseSchema,
|
|
118
|
-
403: error_schemas_1.ErrorResponseSchema,
|
|
119
|
-
500: error_schemas_1.ErrorResponseSchema,
|
|
120
108
|
},
|
|
121
109
|
query: exports.AutocompleteQuerySchema,
|
|
122
110
|
summary: 'Get clients for autocomplete',
|
|
@@ -126,11 +114,7 @@ const clientsContractConfig = {
|
|
|
126
114
|
path: '/v2/clients/:id',
|
|
127
115
|
responses: {
|
|
128
116
|
200: exports.ClientSchema,
|
|
129
|
-
400: error_schemas_1.ErrorResponseSchema,
|
|
130
|
-
401: error_schemas_1.ErrorResponseSchema,
|
|
131
|
-
403: error_schemas_1.ErrorResponseSchema,
|
|
132
117
|
404: error_schemas_1.ErrorResponseSchema,
|
|
133
|
-
500: error_schemas_1.ErrorResponseSchema,
|
|
134
118
|
},
|
|
135
119
|
pathParams: zod_1.z.object({
|
|
136
120
|
id: zod_1.z.string().uuid(),
|
|
@@ -142,12 +126,8 @@ const clientsContractConfig = {
|
|
|
142
126
|
path: '/v2/clients/:id',
|
|
143
127
|
responses: {
|
|
144
128
|
200: exports.ClientSchema,
|
|
145
|
-
400: error_schemas_1.ErrorResponseSchema,
|
|
146
|
-
401: error_schemas_1.ErrorResponseSchema,
|
|
147
|
-
403: error_schemas_1.ErrorResponseSchema,
|
|
148
129
|
404: error_schemas_1.ErrorResponseSchema,
|
|
149
130
|
409: error_schemas_1.ErrorResponseSchema,
|
|
150
|
-
500: error_schemas_1.ErrorResponseSchema,
|
|
151
131
|
},
|
|
152
132
|
pathParams: zod_1.z.object({
|
|
153
133
|
id: zod_1.z.string().uuid(),
|
|
@@ -159,19 +139,20 @@ const clientsContractConfig = {
|
|
|
159
139
|
method: 'DELETE',
|
|
160
140
|
path: '/v2/clients/:id',
|
|
161
141
|
responses: {
|
|
162
|
-
204:
|
|
163
|
-
400: error_schemas_1.ErrorResponseSchema,
|
|
164
|
-
401: error_schemas_1.ErrorResponseSchema,
|
|
165
|
-
403: error_schemas_1.ErrorResponseSchema,
|
|
142
|
+
204: c.noBody(),
|
|
166
143
|
404: error_schemas_1.ErrorResponseSchema,
|
|
167
|
-
500: error_schemas_1.ErrorResponseSchema,
|
|
168
144
|
},
|
|
169
145
|
pathParams: zod_1.z.object({
|
|
170
146
|
id: zod_1.z.string().uuid(),
|
|
171
147
|
}),
|
|
172
|
-
body:
|
|
148
|
+
body: c.noBody(),
|
|
173
149
|
summary: 'Delete a client',
|
|
174
150
|
},
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
|
|
151
|
+
}, {
|
|
152
|
+
commonResponses: {
|
|
153
|
+
400: error_schemas_1.ErrorResponseSchema,
|
|
154
|
+
401: error_schemas_1.ErrorResponseSchema,
|
|
155
|
+
403: error_schemas_1.ErrorResponseSchema,
|
|
156
|
+
500: error_schemas_1.ErrorResponseSchema,
|
|
157
|
+
},
|
|
158
|
+
});
|
|
@@ -1,18 +1,24 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export declare const createPaginatedResponseSchema: <T extends z.ZodTypeAny>(itemSchema: T) => z.ZodObject<{
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
items: z.ZodArray<T, "many">;
|
|
4
|
+
totalCount: z.ZodNumber;
|
|
5
5
|
limit: z.ZodNumber;
|
|
6
6
|
skip: z.ZodNumber;
|
|
7
|
+
currentPage: z.ZodNumber;
|
|
8
|
+
totalPages: z.ZodNumber;
|
|
7
9
|
}, "strip", z.ZodTypeAny, {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
+
items: T["_output"][];
|
|
11
|
+
totalCount: number;
|
|
10
12
|
limit: number;
|
|
11
13
|
skip: number;
|
|
14
|
+
currentPage: number;
|
|
15
|
+
totalPages: number;
|
|
12
16
|
}, {
|
|
13
|
-
|
|
14
|
-
|
|
17
|
+
items: T["_input"][];
|
|
18
|
+
totalCount: number;
|
|
15
19
|
limit: number;
|
|
16
20
|
skip: number;
|
|
21
|
+
currentPage: number;
|
|
22
|
+
totalPages: number;
|
|
17
23
|
}>;
|
|
18
24
|
//# sourceMappingURL=pagination.schema.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pagination.schema.d.ts","sourceRoot":"","sources":["../../contracts/common/pagination.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,6BAA6B,GAAI,CAAC,SAAS,CAAC,CAAC,UAAU,EAClE,YAAY,CAAC
|
|
1
|
+
{"version":3,"file":"pagination.schema.d.ts","sourceRoot":"","sources":["../../contracts/common/pagination.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,6BAA6B,GAAI,CAAC,SAAS,CAAC,CAAC,UAAU,EAClE,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;EAUd,CAAC"}
|
|
@@ -4,10 +4,12 @@ exports.createPaginatedResponseSchema = void 0;
|
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const createPaginatedResponseSchema = (itemSchema) => {
|
|
6
6
|
return zod_1.z.object({
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
limit: zod_1.z.number().describe('
|
|
10
|
-
skip: zod_1.z.number().describe('
|
|
7
|
+
items: zod_1.z.array(itemSchema).describe('Array of items for the current page'),
|
|
8
|
+
totalCount: zod_1.z.number().describe('Total number of items available'),
|
|
9
|
+
limit: zod_1.z.number().describe('Number of items per page'),
|
|
10
|
+
skip: zod_1.z.number().describe('Number of items skipped (offset)'),
|
|
11
|
+
currentPage: zod_1.z.number().describe('Current page number'),
|
|
12
|
+
totalPages: zod_1.z.number().describe('Total number of pages'),
|
|
11
13
|
});
|
|
12
14
|
};
|
|
13
15
|
exports.createPaginatedResponseSchema = createPaginatedResponseSchema;
|