@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,205 +1,220 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports,
|
|
3
|
-
exports.filesContract =
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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
|
-
|
|
16
|
+
.object({
|
|
10
17
|
fileName: zod_1.z
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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
|
-
|
|
23
|
+
})
|
|
24
|
+
.openapi({ title: 'GenerateUploadUrl' });
|
|
18
25
|
exports.GenerateUploadUrlResponseSchema = zod_1.z
|
|
19
|
-
|
|
26
|
+
.object({
|
|
20
27
|
uploadUrl: zod_1.z
|
|
21
|
-
|
|
22
|
-
|
|
28
|
+
.string()
|
|
29
|
+
.describe('The pre-signed URL for the file upload (PUT request).'),
|
|
23
30
|
fileId: zod_1.z
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
})
|
|
28
|
-
|
|
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
|
-
|
|
31
|
-
id: zod_1.z
|
|
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
|
-
|
|
34
|
-
|
|
43
|
+
.string()
|
|
44
|
+
.describe('The original filename as uploaded by the user.'),
|
|
35
45
|
storageKey: zod_1.z
|
|
36
|
-
|
|
37
|
-
|
|
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
|
-
|
|
42
|
-
|
|
51
|
+
.string()
|
|
52
|
+
.describe('The storage location or path where the file is stored.'),
|
|
43
53
|
storageProvider: zod_1.z
|
|
44
|
-
|
|
45
|
-
|
|
54
|
+
.string()
|
|
55
|
+
.describe('The storage provider used (local, s3, azure, gcp).'),
|
|
46
56
|
description: zod_1.z
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
57
|
+
.string()
|
|
58
|
+
.nullable()
|
|
59
|
+
.describe('Optional user-provided description of the file.'),
|
|
50
60
|
entityType: zod_1.z
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
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
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
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
|
-
|
|
61
|
-
|
|
62
|
-
|
|
72
|
+
.string()
|
|
73
|
+
.uuid()
|
|
74
|
+
.describe('The UUID of the user who created this file.'),
|
|
63
75
|
createdAt: zod_1.z
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
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
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
})
|
|
72
|
-
|
|
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
|
-
|
|
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
|
-
|
|
89
|
+
})
|
|
90
|
+
.openapi({ title: 'FileDownloadUrlResponse' });
|
|
79
91
|
exports.UpdateFileSchema = zod_1.z
|
|
80
|
-
|
|
92
|
+
.object({
|
|
81
93
|
description: zod_1.z
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
})
|
|
87
|
-
|
|
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
|
-
|
|
90
|
-
|
|
91
|
-
exports.filesContract = c.router(
|
|
101
|
+
.array(exports.FileResponseSchema)
|
|
102
|
+
.openapi({ title: 'FileResponseArray' });
|
|
103
|
+
exports.filesContract = c.router(
|
|
104
|
+
{
|
|
92
105
|
generateUploadUrl: {
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
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
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
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
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
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
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
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
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
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
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
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
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
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
|
-
|
|
202
|
-
|
|
203
|
-
|
|
215
|
+
400: error_schemas_1.ErrorResponseSchema,
|
|
216
|
+
401: error_schemas_1.ErrorResponseSchema,
|
|
217
|
+
500: error_schemas_1.ErrorResponseSchema,
|
|
204
218
|
},
|
|
205
|
-
}
|
|
219
|
+
},
|
|
220
|
+
);
|