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