@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,205 +1,220 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.filesContract = exports.FileResponseArraySchema = exports.UpdateFileSchema = exports.FileDownloadUrlResponseSchema = exports.FileResponseSchema = exports.GenerateUploadUrlResponseSchema = exports.GenerateUploadUrlSchema = 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.filesContract =
4
+ exports.FileResponseArraySchema =
5
+ exports.UpdateFileSchema =
6
+ exports.FileDownloadUrlResponseSchema =
7
+ exports.FileResponseSchema =
8
+ exports.GenerateUploadUrlResponseSchema =
9
+ exports.GenerateUploadUrlSchema =
10
+ void 0;
11
+ const core_1 = require('@ts-rest/core');
12
+ const zod_1 = require('zod');
13
+ const error_schemas_1 = require('../common/error-schemas');
7
14
  const c = (0, core_1.initContract)();
8
15
  exports.GenerateUploadUrlSchema = zod_1.z
9
- .object({
16
+ .object({
10
17
  fileName: zod_1.z
11
- .string()
12
- .min(1)
13
- .describe('The name of the file to be uploaded.'),
18
+ .string()
19
+ .min(1)
20
+ .describe('The name of the file to be uploaded.'),
14
21
  contentType: zod_1.z.string().min(1).describe('The MIME type of the file.'),
15
22
  size: zod_1.z.number().min(1).describe('The size of the file in bytes.'),
16
- })
17
- .openapi({ title: 'GenerateUploadUrl' });
23
+ })
24
+ .openapi({ title: 'GenerateUploadUrl' });
18
25
  exports.GenerateUploadUrlResponseSchema = zod_1.z
19
- .object({
26
+ .object({
20
27
  uploadUrl: zod_1.z
21
- .string()
22
- .describe('The pre-signed URL for the file upload (PUT request).'),
28
+ .string()
29
+ .describe('The pre-signed URL for the file upload (PUT request).'),
23
30
  fileId: zod_1.z
24
- .string()
25
- .uuid()
26
- .describe('The unique identifier of the created file record.'),
27
- })
28
- .openapi({ title: 'GenerateUploadUrlResponse' });
31
+ .string()
32
+ .uuid()
33
+ .describe('The unique identifier of the created file record.'),
34
+ })
35
+ .openapi({ title: 'GenerateUploadUrlResponse' });
29
36
  exports.FileResponseSchema = zod_1.z
30
- .object({
31
- id: zod_1.z.string().uuid().describe('The unique identifier of the file record.'),
37
+ .object({
38
+ id: zod_1.z
39
+ .string()
40
+ .uuid()
41
+ .describe('The unique identifier of the file record.'),
32
42
  originalName: zod_1.z
33
- .string()
34
- .describe('The original filename as uploaded by the user.'),
43
+ .string()
44
+ .describe('The original filename as uploaded by the user.'),
35
45
  storageKey: zod_1.z
36
- .string()
37
- .describe('The unique storage key where the file is stored.'),
46
+ .string()
47
+ .describe('The unique storage key where the file is stored.'),
38
48
  mimeType: zod_1.z.string().describe('The MIME type of the file.'),
39
49
  size: zod_1.z.number().describe('The size of the file in bytes.'),
40
50
  location: zod_1.z
41
- .string()
42
- .describe('The storage location or path where the file is stored.'),
51
+ .string()
52
+ .describe('The storage location or path where the file is stored.'),
43
53
  storageProvider: zod_1.z
44
- .string()
45
- .describe('The storage provider used (local, s3, azure, gcp).'),
54
+ .string()
55
+ .describe('The storage provider used (local, s3, azure, gcp).'),
46
56
  description: zod_1.z
47
- .string()
48
- .nullable()
49
- .describe('Optional user-provided description of the file.'),
57
+ .string()
58
+ .nullable()
59
+ .describe('Optional user-provided description of the file.'),
50
60
  entityType: zod_1.z
51
- .string()
52
- .nullable()
53
- .describe('The type of entity this file is attached to (WorkerQualification, ShareCode, Worker, etc.).'),
61
+ .string()
62
+ .nullable()
63
+ .describe(
64
+ 'The type of entity this file is attached to (WorkerQualification, ShareCode, Worker, etc.).',
65
+ ),
54
66
  entityId: zod_1.z
55
- .string()
56
- .uuid()
57
- .nullable()
58
- .describe('The UUID of the entity this file is attached to.'),
67
+ .string()
68
+ .uuid()
69
+ .nullable()
70
+ .describe('The UUID of the entity this file is attached to.'),
59
71
  userId: zod_1.z
60
- .string()
61
- .uuid()
62
- .describe('The UUID of the user who created this file.'),
72
+ .string()
73
+ .uuid()
74
+ .describe('The UUID of the user who created this file.'),
63
75
  createdAt: zod_1.z
64
- .union([zod_1.z.string().datetime(), zod_1.z.date()])
65
- .transform((val) => (val instanceof Date ? val.toISOString() : val))
66
- .describe('The timestamp when the file record was created.'),
76
+ .union([zod_1.z.string().datetime(), zod_1.z.date()])
77
+ .transform((val) => (val instanceof Date ? val.toISOString() : val))
78
+ .describe('The timestamp when the file record was created.'),
67
79
  updatedAt: zod_1.z
68
- .union([zod_1.z.string().datetime(), zod_1.z.date()])
69
- .transform((val) => (val instanceof Date ? val.toISOString() : val))
70
- .describe('The timestamp when the file record was last updated.'),
71
- })
72
- .openapi({ title: 'FileResponse' });
80
+ .union([zod_1.z.string().datetime(), zod_1.z.date()])
81
+ .transform((val) => (val instanceof Date ? val.toISOString() : val))
82
+ .describe('The timestamp when the file record was last updated.'),
83
+ })
84
+ .openapi({ title: 'FileResponse' });
73
85
  exports.FileDownloadUrlResponseSchema = zod_1.z
74
- .object({
86
+ .object({
75
87
  url: zod_1.z.string().describe('Pre-signed URL to download the file'),
76
88
  mimeType: zod_1.z.string().describe('MIME type of the file'),
77
- })
78
- .openapi({ title: 'FileDownloadUrlResponse' });
89
+ })
90
+ .openapi({ title: 'FileDownloadUrlResponse' });
79
91
  exports.UpdateFileSchema = zod_1.z
80
- .object({
92
+ .object({
81
93
  description: zod_1.z
82
- .string()
83
- .max(500)
84
- .optional()
85
- .describe('Optional description of the file.'),
86
- })
87
- .openapi({ title: 'UpdateFile' });
94
+ .string()
95
+ .max(500)
96
+ .optional()
97
+ .describe('Optional description of the file.'),
98
+ })
99
+ .openapi({ title: 'UpdateFile' });
88
100
  exports.FileResponseArraySchema = zod_1.z
89
- .array(exports.FileResponseSchema)
90
- .openapi({ title: 'FileResponseArray' });
91
- exports.filesContract = c.router({
101
+ .array(exports.FileResponseSchema)
102
+ .openapi({ title: 'FileResponseArray' });
103
+ exports.filesContract = c.router(
104
+ {
92
105
  generateUploadUrl: {
93
- method: 'POST',
94
- path: '/v2/files/generate-upload-url',
95
- body: exports.GenerateUploadUrlSchema,
96
- responses: {
97
- 201: exports.GenerateUploadUrlResponseSchema,
98
- 403: error_schemas_1.ErrorResponseSchema,
99
- },
100
- summary: 'Generate a pre-signed URL for file upload',
101
- metadata: {
102
- tags: ['Files'],
103
- },
106
+ method: 'POST',
107
+ path: '/v2/files/generate-upload-url',
108
+ body: exports.GenerateUploadUrlSchema,
109
+ responses: {
110
+ 201: exports.GenerateUploadUrlResponseSchema,
111
+ 403: error_schemas_1.ErrorResponseSchema,
112
+ },
113
+ summary: 'Generate a pre-signed URL for file upload',
114
+ metadata: {
115
+ tags: ['Files'],
116
+ },
104
117
  },
105
118
  findAll: {
106
- method: 'GET',
107
- path: '/v2/files',
108
- responses: {
109
- 200: exports.FileResponseArraySchema,
110
- 403: error_schemas_1.ErrorResponseSchema,
111
- },
112
- summary: 'Get all files',
113
- metadata: {
114
- tags: ['Files'],
115
- },
119
+ method: 'GET',
120
+ path: '/v2/files',
121
+ responses: {
122
+ 200: exports.FileResponseArraySchema,
123
+ 403: error_schemas_1.ErrorResponseSchema,
124
+ },
125
+ summary: 'Get all files',
126
+ metadata: {
127
+ tags: ['Files'],
128
+ },
116
129
  },
117
130
  findByEntity: {
118
- method: 'GET',
119
- path: '/v2/files/entity/:entityType/:entityId',
120
- pathParams: zod_1.z.object({
121
- entityType: zod_1.z.string().describe('Type of entity'),
122
- entityId: zod_1.z.string().uuid().describe('UUID of the entity'),
123
- }),
124
- responses: {
125
- 200: exports.FileResponseArraySchema,
126
- 403: error_schemas_1.ErrorResponseSchema,
127
- },
128
- summary: 'Get all files for a specific entity',
129
- metadata: {
130
- tags: ['Files'],
131
- },
131
+ method: 'GET',
132
+ path: '/v2/files/entity/:entityType/:entityId',
133
+ pathParams: zod_1.z.object({
134
+ entityType: zod_1.z.string().describe('Type of entity'),
135
+ entityId: zod_1.z.string().uuid().describe('UUID of the entity'),
136
+ }),
137
+ responses: {
138
+ 200: exports.FileResponseArraySchema,
139
+ 403: error_schemas_1.ErrorResponseSchema,
140
+ },
141
+ summary: 'Get all files for a specific entity',
142
+ metadata: {
143
+ tags: ['Files'],
144
+ },
132
145
  },
133
146
  findOne: {
134
- method: 'GET',
135
- path: '/v2/files/:id',
136
- pathParams: zod_1.z.object({
137
- id: zod_1.z.string().uuid().describe('File ID'),
138
- }),
139
- responses: {
140
- 200: exports.FileResponseSchema,
141
- 404: error_schemas_1.ErrorResponseSchema,
142
- 403: error_schemas_1.ErrorResponseSchema,
143
- },
144
- summary: 'Get a file metadata by ID',
145
- metadata: {
146
- tags: ['Files'],
147
- },
147
+ method: 'GET',
148
+ path: '/v2/files/:id',
149
+ pathParams: zod_1.z.object({
150
+ id: zod_1.z.string().uuid().describe('File ID'),
151
+ }),
152
+ responses: {
153
+ 200: exports.FileResponseSchema,
154
+ 404: error_schemas_1.ErrorResponseSchema,
155
+ 403: error_schemas_1.ErrorResponseSchema,
156
+ },
157
+ summary: 'Get a file metadata by ID',
158
+ metadata: {
159
+ tags: ['Files'],
160
+ },
148
161
  },
149
162
  getDownloadUrl: {
150
- method: 'GET',
151
- path: '/v2/files/:id/download',
152
- pathParams: zod_1.z.object({
153
- id: zod_1.z.string().uuid().describe('File ID'),
154
- }),
155
- responses: {
156
- 200: exports.FileDownloadUrlResponseSchema,
157
- 404: error_schemas_1.ErrorResponseSchema,
158
- 403: error_schemas_1.ErrorResponseSchema,
159
- },
160
- summary: 'Get a pre-signed URL to download a file',
161
- metadata: {
162
- tags: ['Files'],
163
- },
163
+ method: 'GET',
164
+ path: '/v2/files/:id/download',
165
+ pathParams: zod_1.z.object({
166
+ id: zod_1.z.string().uuid().describe('File ID'),
167
+ }),
168
+ responses: {
169
+ 200: exports.FileDownloadUrlResponseSchema,
170
+ 404: error_schemas_1.ErrorResponseSchema,
171
+ 403: error_schemas_1.ErrorResponseSchema,
172
+ },
173
+ summary: 'Get a pre-signed URL to download a file',
174
+ metadata: {
175
+ tags: ['Files'],
176
+ },
164
177
  },
165
178
  update: {
166
- method: 'PATCH',
167
- path: '/v2/files/:id',
168
- pathParams: zod_1.z.object({
169
- id: zod_1.z.string().uuid().describe('File ID'),
170
- }),
171
- body: exports.UpdateFileSchema,
172
- responses: {
173
- 200: exports.FileResponseSchema,
174
- 404: error_schemas_1.ErrorResponseSchema,
175
- 403: error_schemas_1.ErrorResponseSchema,
176
- },
177
- summary: 'Update a file metadata',
178
- metadata: {
179
- tags: ['Files'],
180
- },
179
+ method: 'PATCH',
180
+ path: '/v2/files/:id',
181
+ pathParams: zod_1.z.object({
182
+ id: zod_1.z.string().uuid().describe('File ID'),
183
+ }),
184
+ body: exports.UpdateFileSchema,
185
+ responses: {
186
+ 200: exports.FileResponseSchema,
187
+ 404: error_schemas_1.ErrorResponseSchema,
188
+ 403: error_schemas_1.ErrorResponseSchema,
189
+ },
190
+ summary: 'Update a file metadata',
191
+ metadata: {
192
+ tags: ['Files'],
193
+ },
181
194
  },
182
195
  remove: {
183
- method: 'DELETE',
184
- path: '/v2/files/:id',
185
- pathParams: zod_1.z.object({
186
- id: zod_1.z.string().uuid().describe('File ID'),
187
- }),
188
- body: zod_1.z.object({}),
189
- responses: {
190
- 204: zod_1.z.undefined(),
191
- 404: error_schemas_1.ErrorResponseSchema,
192
- 403: error_schemas_1.ErrorResponseSchema,
193
- },
194
- summary: 'Delete a file',
195
- metadata: {
196
- tags: ['Files'],
197
- },
196
+ method: 'DELETE',
197
+ path: '/v2/files/:id',
198
+ pathParams: zod_1.z.object({
199
+ id: zod_1.z.string().uuid().describe('File ID'),
200
+ }),
201
+ body: zod_1.z.object({}),
202
+ responses: {
203
+ 204: zod_1.z.undefined(),
204
+ 404: error_schemas_1.ErrorResponseSchema,
205
+ 403: error_schemas_1.ErrorResponseSchema,
206
+ },
207
+ summary: 'Delete a file',
208
+ metadata: {
209
+ tags: ['Files'],
210
+ },
198
211
  },
199
- }, {
212
+ },
213
+ {
200
214
  commonResponses: {
201
- 400: error_schemas_1.ErrorResponseSchema,
202
- 401: error_schemas_1.ErrorResponseSchema,
203
- 500: error_schemas_1.ErrorResponseSchema,
215
+ 400: error_schemas_1.ErrorResponseSchema,
216
+ 401: error_schemas_1.ErrorResponseSchema,
217
+ 500: error_schemas_1.ErrorResponseSchema,
204
218
  },
205
- });
219
+ },
220
+ );