@dakkitor/api-contracts 1.1.140 → 1.1.142

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 (75) hide show
  1. package/dist/abilities/first-agent.abilities.json +7 -4
  2. package/dist/abilities/second-agent.abilities.json +10 -0
  3. package/dist/actives/actives.contract.d.ts +3210 -1295
  4. package/dist/actives/actives.contract.d.ts.map +1 -1
  5. package/dist/actives/actives.contract.js +36 -2
  6. package/dist/agent-client-links/agent-client-links.contract.d.ts +1285 -1285
  7. package/dist/auth/auth.contract.d.ts +40 -28
  8. package/dist/auth/auth.contract.d.ts.map +1 -1
  9. package/dist/bookings/bookings.contract.d.ts +6359 -3709
  10. package/dist/bookings/bookings.contract.d.ts.map +1 -1
  11. package/dist/bookings/bookings.contract.js +30 -17
  12. package/dist/call-history/call-history.contract.d.ts +716 -745
  13. package/dist/call-history/call-history.contract.d.ts.map +1 -1
  14. package/dist/call-history/call-history.contract.js +2 -12
  15. package/dist/client-contacts/client-contacts.contract.d.ts +309 -309
  16. package/dist/client-contacts/client-contacts.contract.js +2 -2
  17. package/dist/clients/clients.contract.d.ts +173 -173
  18. package/dist/collaboration-checkings/collaboration-checkings.contract.d.ts +2328 -2328
  19. package/dist/collaborations/collaborations.contract.d.ts +2052 -2052
  20. package/dist/common/call-rating.schema.d.ts +12 -12
  21. package/dist/common/call-rating.schema.js +40 -48
  22. package/dist/common/common-schemas.d.ts +10 -4
  23. package/dist/common/common-schemas.d.ts.map +1 -1
  24. package/dist/common/common-schemas.js +2 -0
  25. package/dist/common/error-schemas.d.ts +5 -11
  26. package/dist/common/error-schemas.js +8 -11
  27. package/dist/common/openapi-metadata.d.ts +44 -54
  28. package/dist/common/openapi-metadata.js +129 -135
  29. package/dist/common/pagination-query.schema.d.ts +7 -13
  30. package/dist/common/pagination-query.schema.js +8 -11
  31. package/dist/companies/companies.contract.d.ts +26 -26
  32. package/dist/cron-executions/cron-executions.contract.d.ts +255 -7
  33. package/dist/cron-executions/cron-executions.contract.d.ts.map +1 -1
  34. package/dist/cron-executions/cron-executions.contract.js +28 -0
  35. package/dist/curated-workers/curated-workers.contract.d.ts +626 -558
  36. package/dist/curated-workers/curated-workers.contract.d.ts.map +1 -1
  37. package/dist/curated-workers/curated-workers.contract.js +2 -4
  38. package/dist/dashboards/agent-daily-metrics.contract.d.ts +20 -11
  39. package/dist/dashboards/agent-daily-metrics.contract.d.ts.map +1 -1
  40. package/dist/dashboards/agent-daily-metrics.contract.js +1 -0
  41. package/dist/dashboards/dashboard-widgets.contract.d.ts +62 -62
  42. package/dist/dashboards/dashboard-widgets.contract.d.ts.map +1 -1
  43. package/dist/dashboards/dashboard-widgets.contract.js +4 -1
  44. package/dist/dashboards/dashboard.contract.d.ts +12 -12
  45. package/dist/files/files.contract.d.ts +1189 -1556
  46. package/dist/files/files.contract.js +162 -177
  47. package/dist/health/health.contract.d.ts +144 -191
  48. package/dist/health/health.contract.js +40 -53
  49. package/dist/jobs/jobs.contract.d.ts +4427 -3769
  50. package/dist/jobs/jobs.contract.d.ts.map +1 -1
  51. package/dist/jobs/jobs.contract.js +106 -17
  52. package/dist/kpi-impersonation/kpi-impersonation.contract.d.ts +114 -114
  53. package/dist/lead-assignments/lead-assignments.contract.d.ts +606 -606
  54. package/dist/lead-distribution/agent-lead-distribution.contract.d.ts +217 -217
  55. package/dist/lead-distribution/lead-distribution-config.contract.d.ts +16 -16
  56. package/dist/leads/leads.contract.d.ts +167 -173
  57. package/dist/leads/leads.contract.d.ts.map +1 -1
  58. package/dist/leads/leads.contract.js +0 -4
  59. package/dist/locations/locations.contract.d.ts +28 -28
  60. package/dist/own-research/own-research.contract.d.ts +867 -867
  61. package/dist/postcodes/postcodes.contract.d.ts +6 -6
  62. package/dist/qualifications/qualifications.contract.d.ts +1387 -1898
  63. package/dist/qualifications/qualifications.contract.js +171 -193
  64. package/dist/trades/trades.contract.d.ts +763 -991
  65. package/dist/trades/trades.contract.js +89 -111
  66. package/dist/users/users.contract.d.ts +632 -285
  67. package/dist/users/users.contract.d.ts.map +1 -1
  68. package/dist/users/users.contract.js +38 -1
  69. package/dist/workers/workers.contract.d.ts +4581 -2712
  70. package/dist/workers/workers.contract.d.ts.map +1 -1
  71. package/dist/workers/workers.contract.js +277 -28
  72. package/package.json +1 -1
  73. package/dist/monitoring/monitoring.contract.d.ts +0 -615
  74. package/dist/monitoring/monitoring.contract.d.ts.map +0 -1
  75. package/dist/monitoring/monitoring.contract.js +0 -106
@@ -1,220 +1,205 @@
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');
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");
14
7
  const c = (0, core_1.initContract)();
15
8
  exports.GenerateUploadUrlSchema = zod_1.z
16
- .object({
9
+ .object({
17
10
  fileName: zod_1.z
18
- .string()
19
- .min(1)
20
- .describe('The name of the file to be uploaded.'),
11
+ .string()
12
+ .min(1)
13
+ .describe('The name of the file to be uploaded.'),
21
14
  contentType: zod_1.z.string().min(1).describe('The MIME type of the file.'),
22
15
  size: zod_1.z.number().min(1).describe('The size of the file in bytes.'),
23
- })
24
- .openapi({ title: 'GenerateUploadUrl' });
16
+ })
17
+ .openapi({ title: 'GenerateUploadUrl' });
25
18
  exports.GenerateUploadUrlResponseSchema = zod_1.z
26
- .object({
19
+ .object({
27
20
  uploadUrl: zod_1.z
28
- .string()
29
- .describe('The pre-signed URL for the file upload (PUT request).'),
21
+ .string()
22
+ .describe('The pre-signed URL for the file upload (PUT request).'),
30
23
  fileId: zod_1.z
31
- .string()
32
- .uuid()
33
- .describe('The unique identifier of the created file record.'),
34
- })
35
- .openapi({ title: 'GenerateUploadUrlResponse' });
24
+ .string()
25
+ .uuid()
26
+ .describe('The unique identifier of the created file record.'),
27
+ })
28
+ .openapi({ title: 'GenerateUploadUrlResponse' });
36
29
  exports.FileResponseSchema = zod_1.z
37
- .object({
38
- id: zod_1.z
39
- .string()
40
- .uuid()
41
- .describe('The unique identifier of the file record.'),
30
+ .object({
31
+ id: zod_1.z.string().uuid().describe('The unique identifier of the file record.'),
42
32
  originalName: zod_1.z
43
- .string()
44
- .describe('The original filename as uploaded by the user.'),
33
+ .string()
34
+ .describe('The original filename as uploaded by the user.'),
45
35
  storageKey: zod_1.z
46
- .string()
47
- .describe('The unique storage key where the file is stored.'),
36
+ .string()
37
+ .describe('The unique storage key where the file is stored.'),
48
38
  mimeType: zod_1.z.string().describe('The MIME type of the file.'),
49
39
  size: zod_1.z.number().describe('The size of the file in bytes.'),
50
40
  location: zod_1.z
51
- .string()
52
- .describe('The storage location or path where the file is stored.'),
41
+ .string()
42
+ .describe('The storage location or path where the file is stored.'),
53
43
  storageProvider: zod_1.z
54
- .string()
55
- .describe('The storage provider used (local, s3, azure, gcp).'),
44
+ .string()
45
+ .describe('The storage provider used (local, s3, azure, gcp).'),
56
46
  description: zod_1.z
57
- .string()
58
- .nullable()
59
- .describe('Optional user-provided description of the file.'),
47
+ .string()
48
+ .nullable()
49
+ .describe('Optional user-provided description of the file.'),
60
50
  entityType: zod_1.z
61
- .string()
62
- .nullable()
63
- .describe(
64
- 'The type of entity this file is attached to (WorkerQualification, ShareCode, Worker, etc.).',
65
- ),
51
+ .string()
52
+ .nullable()
53
+ .describe('The type of entity this file is attached to (WorkerQualification, ShareCode, Worker, etc.).'),
66
54
  entityId: zod_1.z
67
- .string()
68
- .uuid()
69
- .nullable()
70
- .describe('The UUID of the entity this file is attached to.'),
55
+ .string()
56
+ .uuid()
57
+ .nullable()
58
+ .describe('The UUID of the entity this file is attached to.'),
71
59
  userId: zod_1.z
72
- .string()
73
- .uuid()
74
- .describe('The UUID of the user who created this file.'),
60
+ .string()
61
+ .uuid()
62
+ .describe('The UUID of the user who created this file.'),
75
63
  createdAt: zod_1.z
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.'),
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.'),
79
67
  updatedAt: zod_1.z
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' });
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' });
85
73
  exports.FileDownloadUrlResponseSchema = zod_1.z
86
- .object({
74
+ .object({
87
75
  url: zod_1.z.string().describe('Pre-signed URL to download the file'),
88
76
  mimeType: zod_1.z.string().describe('MIME type of the file'),
89
- })
90
- .openapi({ title: 'FileDownloadUrlResponse' });
77
+ })
78
+ .openapi({ title: 'FileDownloadUrlResponse' });
91
79
  exports.UpdateFileSchema = zod_1.z
92
- .object({
80
+ .object({
93
81
  description: zod_1.z
94
- .string()
95
- .max(500)
96
- .optional()
97
- .describe('Optional description of the file.'),
98
- })
99
- .openapi({ title: 'UpdateFile' });
82
+ .string()
83
+ .max(500)
84
+ .optional()
85
+ .describe('Optional description of the file.'),
86
+ })
87
+ .openapi({ title: 'UpdateFile' });
100
88
  exports.FileResponseArraySchema = zod_1.z
101
- .array(exports.FileResponseSchema)
102
- .openapi({ title: 'FileResponseArray' });
103
- exports.filesContract = c.router(
104
- {
89
+ .array(exports.FileResponseSchema)
90
+ .openapi({ title: 'FileResponseArray' });
91
+ exports.filesContract = c.router({
105
92
  generateUploadUrl: {
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
- },
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
+ },
117
104
  },
118
105
  findAll: {
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
- },
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
+ },
129
116
  },
130
117
  findByEntity: {
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
- },
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
+ },
145
132
  },
146
133
  findOne: {
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
- },
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
+ },
161
148
  },
162
149
  getDownloadUrl: {
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
- },
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
+ },
177
164
  },
178
165
  update: {
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
- },
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
+ },
194
181
  },
195
182
  remove: {
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
- },
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
+ },
211
198
  },
212
- },
213
- {
199
+ }, {
214
200
  commonResponses: {
215
- 400: error_schemas_1.ErrorResponseSchema,
216
- 401: error_schemas_1.ErrorResponseSchema,
217
- 500: error_schemas_1.ErrorResponseSchema,
201
+ 400: error_schemas_1.ErrorResponseSchema,
202
+ 401: error_schemas_1.ErrorResponseSchema,
203
+ 500: error_schemas_1.ErrorResponseSchema,
218
204
  },
219
- },
220
- );
205
+ });