@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":"client-contacts.contract.d.ts","sourceRoot":"","sources":["../../contracts/client-contacts/client-contacts.contract.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"client-contacts.contract.d.ts","sourceRoot":"","sources":["../../contracts/client-contacts/client-contacts.contract.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAqBxB,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;EAKlC,CAAC;AAEH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAa9B,CAAC;AAEH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAOpC,CAAC;AAEH,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkFxC,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.clientContactsContractRouter = exports.ClientContactPaginatedResponseSchema = exports.FilterClientContactSchema = exports.UpdateClientContactSchema = exports.CreateClientContactBodySchema = exports.CreateClientContactSchema = exports.ClientContactSchema = exports.ClientContactUserSchema = void 0;
|
|
4
4
|
const core_1 = require("@ts-rest/core");
|
|
5
5
|
const zod_1 = require("zod");
|
|
6
6
|
const clients_contract_1 = require("../clients/clients.contract");
|
|
@@ -20,7 +20,7 @@ const ResourceIdSchema = zod_1.z.object({
|
|
|
20
20
|
id: zod_1.z.string().uuid(),
|
|
21
21
|
});
|
|
22
22
|
// User Schema (duplicated from clients for now to avoid export issues, ideally should be in common)
|
|
23
|
-
|
|
23
|
+
exports.ClientContactUserSchema = zod_1.z.object({
|
|
24
24
|
id: zod_1.z.string().uuid(),
|
|
25
25
|
firstName: zod_1.z.string(),
|
|
26
26
|
lastName: zod_1.z.string(),
|
|
@@ -35,7 +35,7 @@ exports.ClientContactSchema = zod_1.z.object({
|
|
|
35
35
|
phone: zod_1.z.string().describe('Phone Number'),
|
|
36
36
|
email: zod_1.z.string().email().describe('Email Address'),
|
|
37
37
|
source: zod_1.z.string().optional().describe('Source'),
|
|
38
|
-
createdBy:
|
|
38
|
+
createdBy: exports.ClientContactUserSchema.describe('Created By'),
|
|
39
39
|
createdAt: zod_1.z.string().datetime().describe('Creation Date'),
|
|
40
40
|
updatedAt: zod_1.z.string().datetime().describe('Last Update Date'),
|
|
41
41
|
version: zod_1.z.number().describe('Version Number'),
|
|
@@ -67,18 +67,15 @@ exports.FilterClientContactSchema = zod_1.z.object({
|
|
|
67
67
|
sortBy: ClientContactSortableFieldsSchema.default('createdAt').describe('Sort field'),
|
|
68
68
|
sortOrder: SortOrderSchema.default('DESC').describe('Sort order'),
|
|
69
69
|
});
|
|
70
|
+
exports.ClientContactPaginatedResponseSchema = (0, pagination_schema_1.createPaginatedResponseSchema)(exports.ClientContactSchema);
|
|
70
71
|
const c = (0, core_1.initContract)();
|
|
71
|
-
|
|
72
|
+
exports.clientContactsContractRouter = c.router({
|
|
72
73
|
create: {
|
|
73
74
|
method: 'POST',
|
|
74
75
|
path: '/v2/client-contacts',
|
|
75
76
|
responses: {
|
|
76
77
|
201: exports.ClientContactSchema,
|
|
77
|
-
400: error_schemas_1.ErrorResponseSchema,
|
|
78
|
-
401: error_schemas_1.ErrorResponseSchema,
|
|
79
|
-
403: error_schemas_1.ErrorResponseSchema,
|
|
80
78
|
409: error_schemas_1.ErrorResponseSchema,
|
|
81
|
-
500: error_schemas_1.ErrorResponseSchema,
|
|
82
79
|
},
|
|
83
80
|
body: exports.CreateClientContactSchema,
|
|
84
81
|
summary: 'Create a new client contact',
|
|
@@ -88,11 +85,7 @@ const clientContactsContractConfig = {
|
|
|
88
85
|
path: '/v2/client-contacts/client/:clientId',
|
|
89
86
|
responses: {
|
|
90
87
|
201: exports.ClientContactSchema,
|
|
91
|
-
400: error_schemas_1.ErrorResponseSchema,
|
|
92
|
-
401: error_schemas_1.ErrorResponseSchema,
|
|
93
|
-
403: error_schemas_1.ErrorResponseSchema,
|
|
94
88
|
409: error_schemas_1.ErrorResponseSchema,
|
|
95
|
-
500: error_schemas_1.ErrorResponseSchema,
|
|
96
89
|
},
|
|
97
90
|
pathParams: zod_1.z.object({
|
|
98
91
|
clientId: zod_1.z.string().uuid(),
|
|
@@ -104,11 +97,7 @@ const clientContactsContractConfig = {
|
|
|
104
97
|
method: 'GET',
|
|
105
98
|
path: '/v2/client-contacts',
|
|
106
99
|
responses: {
|
|
107
|
-
200:
|
|
108
|
-
400: error_schemas_1.ErrorResponseSchema,
|
|
109
|
-
401: error_schemas_1.ErrorResponseSchema,
|
|
110
|
-
403: error_schemas_1.ErrorResponseSchema,
|
|
111
|
-
500: error_schemas_1.ErrorResponseSchema,
|
|
100
|
+
200: exports.ClientContactPaginatedResponseSchema,
|
|
112
101
|
},
|
|
113
102
|
query: exports.FilterClientContactSchema,
|
|
114
103
|
summary: 'Get all client contacts',
|
|
@@ -118,11 +107,7 @@ const clientContactsContractConfig = {
|
|
|
118
107
|
path: '/v2/client-contacts/:contactId',
|
|
119
108
|
responses: {
|
|
120
109
|
200: exports.ClientContactSchema,
|
|
121
|
-
400: error_schemas_1.ErrorResponseSchema,
|
|
122
|
-
401: error_schemas_1.ErrorResponseSchema,
|
|
123
|
-
403: error_schemas_1.ErrorResponseSchema,
|
|
124
110
|
404: error_schemas_1.ErrorResponseSchema,
|
|
125
|
-
500: error_schemas_1.ErrorResponseSchema,
|
|
126
111
|
},
|
|
127
112
|
pathParams: zod_1.z.object({
|
|
128
113
|
contactId: zod_1.z.string().uuid(),
|
|
@@ -134,12 +119,8 @@ const clientContactsContractConfig = {
|
|
|
134
119
|
path: '/v2/client-contacts/:contactId',
|
|
135
120
|
responses: {
|
|
136
121
|
200: exports.ClientContactSchema,
|
|
137
|
-
400: error_schemas_1.ErrorResponseSchema,
|
|
138
|
-
401: error_schemas_1.ErrorResponseSchema,
|
|
139
|
-
403: error_schemas_1.ErrorResponseSchema,
|
|
140
122
|
404: error_schemas_1.ErrorResponseSchema,
|
|
141
123
|
409: error_schemas_1.ErrorResponseSchema,
|
|
142
|
-
500: error_schemas_1.ErrorResponseSchema,
|
|
143
124
|
},
|
|
144
125
|
pathParams: zod_1.z.object({
|
|
145
126
|
contactId: zod_1.z.string().uuid(),
|
|
@@ -152,11 +133,7 @@ const clientContactsContractConfig = {
|
|
|
152
133
|
path: '/v2/client-contacts/:contactId',
|
|
153
134
|
responses: {
|
|
154
135
|
204: c.noBody(),
|
|
155
|
-
400: error_schemas_1.ErrorResponseSchema,
|
|
156
|
-
401: error_schemas_1.ErrorResponseSchema,
|
|
157
|
-
403: error_schemas_1.ErrorResponseSchema,
|
|
158
136
|
404: error_schemas_1.ErrorResponseSchema,
|
|
159
|
-
500: error_schemas_1.ErrorResponseSchema,
|
|
160
137
|
},
|
|
161
138
|
pathParams: zod_1.z.object({
|
|
162
139
|
contactId: zod_1.z.string().uuid(),
|
|
@@ -164,6 +141,11 @@ const clientContactsContractConfig = {
|
|
|
164
141
|
body: c.noBody(),
|
|
165
142
|
summary: 'Delete a client contact',
|
|
166
143
|
},
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
|
|
144
|
+
}, {
|
|
145
|
+
commonResponses: {
|
|
146
|
+
400: error_schemas_1.ErrorResponseSchema,
|
|
147
|
+
401: error_schemas_1.ErrorResponseSchema,
|
|
148
|
+
403: error_schemas_1.ErrorResponseSchema,
|
|
149
|
+
500: error_schemas_1.ErrorResponseSchema,
|
|
150
|
+
},
|
|
151
|
+
});
|