@dakkitor/api-contracts 1.1.131 → 1.1.133
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/abilities/abilities.contract.d.ts +19 -13
- package/dist/abilities/abilities.contract.js +33 -18
- package/dist/abilities/first-agent.abilities.json +68 -56
- package/dist/abilities/second-agent.abilities.json +3 -3
- package/dist/abilities/team-leads.json +3 -6
- package/dist/actives/actives.contract.d.ts +6313 -6313
- package/dist/actives/actives.contract.js +92 -92
- package/dist/agent-client-links/agent-client-links.contract.d.ts +511 -511
- package/dist/auth/auth.contract.d.ts +16 -16
- package/dist/bookings/bookings.contract.d.ts +23378 -23378
- package/dist/call-history/call-history.contract.d.ts +366 -366
- package/dist/call-history/call-history.contract.js +67 -67
- package/dist/client-contacts/client-contacts.contract.d.ts +159 -159
- package/dist/clients/clients.contract.d.ts +72 -72
- package/dist/collaboration-checkings/collaboration-checkings.contract.d.ts +1330 -1330
- package/dist/collaborations/collaborations.contract.d.ts +1198 -1198
- package/dist/common/call-rating.schema.d.ts +12 -12
- package/dist/common/call-rating.schema.js +48 -40
- package/dist/common/common-schemas.d.ts +4 -4
- package/dist/common/common-schemas.d.ts.map +1 -1
- package/dist/common/common-schemas.js +1 -2
- package/dist/common/error-schemas.d.ts +11 -5
- package/dist/common/error-schemas.js +11 -8
- package/dist/common/openapi-metadata.d.ts +54 -44
- package/dist/common/openapi-metadata.js +135 -129
- package/dist/common/pagination-query.schema.d.ts +11 -5
- package/dist/common/pagination-query.schema.js +11 -8
- package/dist/companies/companies.contract.d.ts +40 -40
- package/dist/cron-executions/cron-executions.contract.d.ts +14 -14
- package/dist/curated-workers/curated-workers.contract.d.ts +211 -211
- package/dist/dashboards/agent-daily-metrics.contract.d.ts +798 -616
- package/dist/dashboards/agent-daily-metrics.contract.js +100 -89
- package/dist/dashboards/dashboard-widgets.contract.d.ts +75 -75
- package/dist/dashboards/dashboard-widgets.contract.js +89 -89
- package/dist/dashboards/dashboard.contract.d.ts +305 -215
- package/dist/files/files.contract.d.ts +1544 -1177
- package/dist/files/files.contract.js +177 -162
- package/dist/health/health.contract.d.ts +191 -144
- package/dist/health/health.contract.js +53 -40
- package/dist/index.d.ts +67 -67
- package/dist/jobs/jobs.contract.d.ts +2553 -2553
- package/dist/jobs/jobs.contract.js +150 -150
- package/dist/lead-assignments/lead-assignments.contract.d.ts +587 -587
- package/dist/lead-distribution/agent-lead-distribution.contract.d.ts +239 -239
- package/dist/lead-distribution/lead-distribution-config.contract.d.ts +25 -25
- package/dist/leads/leads.contract.d.ts +108 -108
- package/dist/leads/leads.contract.js +119 -119
- package/dist/locations/locations.contract.d.ts +7 -7
- package/dist/monitoring/monitoring.contract.d.ts +13 -13
- package/dist/monitoring/monitoring.contract.js +37 -37
- package/dist/own-research/own-research.contract.d.ts +535 -134
- package/dist/own-research/own-research.contract.d.ts.map +1 -1
- package/dist/own-research/own-research.contract.js +88 -56
- package/dist/postcodes/postcodes.contract.d.ts +24 -24
- package/dist/qualifications/qualifications.contract.d.ts +1898 -1387
- package/dist/qualifications/qualifications.contract.js +193 -171
- package/dist/trades/trades.contract.d.ts +991 -763
- package/dist/trades/trades.contract.js +111 -89
- package/dist/users/users.contract.d.ts +202 -202
- package/dist/users/users.contract.js +121 -121
- package/dist/workers/workers.contract.d.ts +710 -710
- package/dist/workers/workers.contract.js +150 -150
- package/package.json +1 -1
|
@@ -1,215 +1,237 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports,
|
|
3
|
-
exports.qualificationsContract =
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
3
|
+
exports.qualificationsContract =
|
|
4
|
+
exports.QualificationArraySchema =
|
|
5
|
+
exports.UpdateQualificationTypeSchema =
|
|
6
|
+
exports.UpdateQualificationSchema =
|
|
7
|
+
exports.UpsertQualificationTypeSchema =
|
|
8
|
+
exports.CreateQualificationSchema =
|
|
9
|
+
exports.CreateQualificationTypeSchema =
|
|
10
|
+
exports.QualificationSchema =
|
|
11
|
+
exports.QualificationTypeSchema =
|
|
12
|
+
void 0;
|
|
13
|
+
const core_1 = require('@ts-rest/core');
|
|
14
|
+
const zod_1 = require('zod');
|
|
15
|
+
const error_schemas_1 = require('../common/error-schemas');
|
|
7
16
|
const c = (0, core_1.initContract)();
|
|
8
17
|
// --- Schemas ---
|
|
9
18
|
exports.QualificationTypeSchema = zod_1.z
|
|
10
|
-
|
|
19
|
+
.object({
|
|
11
20
|
id: zod_1.z
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
21
|
+
.string()
|
|
22
|
+
.uuid()
|
|
23
|
+
.describe('Unique identifier for the qualification type'),
|
|
15
24
|
name: zod_1.z.string().describe('Name of the qualification type'),
|
|
16
|
-
})
|
|
17
|
-
|
|
25
|
+
})
|
|
26
|
+
.openapi({ title: 'QualificationType' });
|
|
18
27
|
exports.QualificationSchema = zod_1.z
|
|
19
|
-
|
|
20
|
-
id: zod_1.z
|
|
28
|
+
.object({
|
|
29
|
+
id: zod_1.z
|
|
30
|
+
.string()
|
|
31
|
+
.uuid()
|
|
32
|
+
.describe('Unique identifier for the qualification'),
|
|
21
33
|
name: zod_1.z.string().describe('Name of the qualification'),
|
|
22
34
|
description: zod_1.z
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
35
|
+
.string()
|
|
36
|
+
.nullable()
|
|
37
|
+
.describe('Description of the qualification'),
|
|
26
38
|
types: zod_1.z
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
})
|
|
30
|
-
|
|
39
|
+
.array(exports.QualificationTypeSchema)
|
|
40
|
+
.describe('List of specific types associated with this qualification'),
|
|
41
|
+
})
|
|
42
|
+
.openapi({ title: 'Qualification' });
|
|
31
43
|
exports.CreateQualificationTypeSchema = zod_1.z
|
|
32
|
-
|
|
44
|
+
.object({
|
|
33
45
|
name: zod_1.z.string().min(1).describe('Name of the qualification type'),
|
|
34
|
-
})
|
|
35
|
-
|
|
46
|
+
})
|
|
47
|
+
.openapi({ title: 'CreateQualificationType' });
|
|
36
48
|
exports.CreateQualificationSchema = zod_1.z
|
|
37
|
-
|
|
49
|
+
.object({
|
|
38
50
|
name: zod_1.z.string().min(1).describe('Name of the qualification'),
|
|
39
|
-
description: zod_1.z
|
|
51
|
+
description: zod_1.z
|
|
52
|
+
.string()
|
|
53
|
+
.min(1)
|
|
54
|
+
.describe('Description of the qualification'),
|
|
40
55
|
types: zod_1.z
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
})
|
|
45
|
-
|
|
56
|
+
.array(exports.CreateQualificationTypeSchema)
|
|
57
|
+
.optional()
|
|
58
|
+
.describe('Optional list of types for the qualification'),
|
|
59
|
+
})
|
|
60
|
+
.openapi({ title: 'CreateQualification' });
|
|
46
61
|
exports.UpsertQualificationTypeSchema = zod_1.z
|
|
47
|
-
|
|
62
|
+
.object({
|
|
48
63
|
id: zod_1.z
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
64
|
+
.string()
|
|
65
|
+
.uuid()
|
|
66
|
+
.optional()
|
|
67
|
+
.describe(
|
|
68
|
+
'ID of the existing qualification type to update. Omit to create a new type.',
|
|
69
|
+
),
|
|
53
70
|
name: zod_1.z.string().min(1).describe('Name of the qualification type'),
|
|
54
|
-
})
|
|
55
|
-
|
|
71
|
+
})
|
|
72
|
+
.openapi({ title: 'UpsertQualificationType' });
|
|
56
73
|
exports.UpdateQualificationSchema = zod_1.z
|
|
57
|
-
|
|
74
|
+
.object({
|
|
58
75
|
name: zod_1.z
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
76
|
+
.string()
|
|
77
|
+
.min(1)
|
|
78
|
+
.optional()
|
|
79
|
+
.describe('New name of the qualification'),
|
|
63
80
|
description: zod_1.z
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
81
|
+
.string()
|
|
82
|
+
.min(1)
|
|
83
|
+
.optional()
|
|
84
|
+
.describe('New description of the qualification'),
|
|
68
85
|
types: zod_1.z
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
86
|
+
.array(exports.UpsertQualificationTypeSchema)
|
|
87
|
+
.optional()
|
|
88
|
+
.describe(
|
|
89
|
+
'List of types to create, update, or associate with the qualification.',
|
|
90
|
+
),
|
|
91
|
+
})
|
|
92
|
+
.openapi({ title: 'UpdateQualification' });
|
|
74
93
|
exports.UpdateQualificationTypeSchema = zod_1.z
|
|
75
|
-
|
|
94
|
+
.object({
|
|
76
95
|
name: zod_1.z
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
})
|
|
82
|
-
|
|
96
|
+
.string()
|
|
97
|
+
.min(1)
|
|
98
|
+
.optional()
|
|
99
|
+
.describe('Name of the qualification type'),
|
|
100
|
+
})
|
|
101
|
+
.openapi({ title: 'UpdateQualificationType' });
|
|
83
102
|
exports.QualificationArraySchema = zod_1.z
|
|
84
|
-
|
|
85
|
-
|
|
103
|
+
.array(exports.QualificationSchema)
|
|
104
|
+
.openapi({ title: 'QualificationArray' });
|
|
86
105
|
// --- Contract ---
|
|
87
|
-
exports.qualificationsContract = c.router(
|
|
106
|
+
exports.qualificationsContract = c.router(
|
|
107
|
+
{
|
|
88
108
|
create: {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
109
|
+
method: 'POST',
|
|
110
|
+
path: '/qualifications',
|
|
111
|
+
body: exports.CreateQualificationSchema,
|
|
112
|
+
responses: {
|
|
113
|
+
201: exports.QualificationSchema,
|
|
114
|
+
409: error_schemas_1.ErrorResponseSchema,
|
|
115
|
+
},
|
|
116
|
+
summary: 'Create a new qualification',
|
|
117
|
+
metadata: {
|
|
118
|
+
tags: ['Qualifications'],
|
|
119
|
+
},
|
|
100
120
|
},
|
|
101
121
|
findAll: {
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
122
|
+
method: 'GET',
|
|
123
|
+
path: '/qualifications',
|
|
124
|
+
responses: {
|
|
125
|
+
200: exports.QualificationArraySchema,
|
|
126
|
+
},
|
|
127
|
+
summary: 'Retrieve all qualifications',
|
|
128
|
+
metadata: {
|
|
129
|
+
tags: ['Qualifications'],
|
|
130
|
+
},
|
|
111
131
|
},
|
|
112
132
|
findOne: {
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
133
|
+
method: 'GET',
|
|
134
|
+
path: '/qualifications/:id',
|
|
135
|
+
pathParams: zod_1.z.object({
|
|
136
|
+
id: zod_1.z.string().uuid(),
|
|
137
|
+
}),
|
|
138
|
+
responses: {
|
|
139
|
+
200: exports.QualificationSchema,
|
|
140
|
+
404: error_schemas_1.ErrorResponseSchema,
|
|
141
|
+
},
|
|
142
|
+
summary: 'Retrieve a qualification by ID',
|
|
143
|
+
metadata: {
|
|
144
|
+
tags: ['Qualifications'],
|
|
145
|
+
},
|
|
126
146
|
},
|
|
127
147
|
update: {
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
148
|
+
method: 'PATCH',
|
|
149
|
+
path: '/qualifications/:id',
|
|
150
|
+
pathParams: zod_1.z.object({
|
|
151
|
+
id: zod_1.z.string().uuid(),
|
|
152
|
+
}),
|
|
153
|
+
body: exports.UpdateQualificationSchema,
|
|
154
|
+
responses: {
|
|
155
|
+
200: exports.QualificationSchema,
|
|
156
|
+
404: error_schemas_1.ErrorResponseSchema,
|
|
157
|
+
},
|
|
158
|
+
summary: 'Update an existing qualification',
|
|
159
|
+
metadata: {
|
|
160
|
+
tags: ['Qualifications'],
|
|
161
|
+
},
|
|
142
162
|
},
|
|
143
163
|
remove: {
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
164
|
+
method: 'DELETE',
|
|
165
|
+
path: '/qualifications/:id',
|
|
166
|
+
pathParams: zod_1.z.object({
|
|
167
|
+
id: zod_1.z.string().uuid(),
|
|
168
|
+
}),
|
|
169
|
+
body: c.noBody(),
|
|
170
|
+
responses: {
|
|
171
|
+
204: zod_1.z.undefined(),
|
|
172
|
+
404: error_schemas_1.ErrorResponseSchema,
|
|
173
|
+
},
|
|
174
|
+
summary: 'Delete a qualification',
|
|
175
|
+
metadata: {
|
|
176
|
+
tags: ['Qualifications'],
|
|
177
|
+
},
|
|
158
178
|
},
|
|
159
179
|
createType: {
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
180
|
+
method: 'POST',
|
|
181
|
+
path: '/qualifications/:qualificationId/types',
|
|
182
|
+
pathParams: zod_1.z.object({
|
|
183
|
+
qualificationId: zod_1.z.string().uuid(),
|
|
184
|
+
}),
|
|
185
|
+
body: exports.CreateQualificationTypeSchema,
|
|
186
|
+
responses: {
|
|
187
|
+
201: exports.QualificationSchema, // Controller returns the parent Qualification
|
|
188
|
+
404: error_schemas_1.ErrorResponseSchema,
|
|
189
|
+
},
|
|
190
|
+
summary: 'Add a new type to a qualification',
|
|
191
|
+
metadata: {
|
|
192
|
+
tags: ['Qualifications'],
|
|
193
|
+
},
|
|
174
194
|
},
|
|
175
195
|
updateType: {
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
196
|
+
method: 'PATCH',
|
|
197
|
+
path: '/qualifications/types/:id',
|
|
198
|
+
pathParams: zod_1.z.object({
|
|
199
|
+
id: zod_1.z.string().uuid(),
|
|
200
|
+
}),
|
|
201
|
+
body: exports.UpdateQualificationTypeSchema,
|
|
202
|
+
responses: {
|
|
203
|
+
200: exports.QualificationTypeSchema,
|
|
204
|
+
404: error_schemas_1.ErrorResponseSchema,
|
|
205
|
+
},
|
|
206
|
+
summary: 'Update an existing qualification type',
|
|
207
|
+
metadata: {
|
|
208
|
+
tags: ['Qualifications'],
|
|
209
|
+
},
|
|
190
210
|
},
|
|
191
211
|
removeType: {
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
212
|
+
method: 'DELETE',
|
|
213
|
+
path: '/qualifications/types/:id',
|
|
214
|
+
pathParams: zod_1.z.object({
|
|
215
|
+
id: zod_1.z.string().uuid(),
|
|
216
|
+
}),
|
|
217
|
+
body: c.noBody(),
|
|
218
|
+
responses: {
|
|
219
|
+
204: zod_1.z.undefined(),
|
|
220
|
+
404: error_schemas_1.ErrorResponseSchema,
|
|
221
|
+
},
|
|
222
|
+
summary: 'Delete a qualification type',
|
|
223
|
+
metadata: {
|
|
224
|
+
tags: ['Qualifications Management'],
|
|
225
|
+
},
|
|
206
226
|
},
|
|
207
|
-
},
|
|
227
|
+
},
|
|
228
|
+
{
|
|
208
229
|
pathPrefix: '/v2',
|
|
209
230
|
commonResponses: {
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
231
|
+
400: error_schemas_1.ErrorResponseSchema,
|
|
232
|
+
401: error_schemas_1.ErrorResponseSchema,
|
|
233
|
+
403: error_schemas_1.ErrorResponseSchema,
|
|
234
|
+
500: error_schemas_1.ErrorResponseSchema,
|
|
214
235
|
},
|
|
215
|
-
}
|
|
236
|
+
},
|
|
237
|
+
);
|