@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.
- package/dist/abilities/first-agent.abilities.json +7 -4
- package/dist/abilities/second-agent.abilities.json +10 -0
- package/dist/actives/actives.contract.d.ts +3210 -1295
- package/dist/actives/actives.contract.d.ts.map +1 -1
- package/dist/actives/actives.contract.js +36 -2
- package/dist/agent-client-links/agent-client-links.contract.d.ts +1285 -1285
- package/dist/auth/auth.contract.d.ts +40 -28
- package/dist/auth/auth.contract.d.ts.map +1 -1
- package/dist/bookings/bookings.contract.d.ts +6359 -3709
- package/dist/bookings/bookings.contract.d.ts.map +1 -1
- package/dist/bookings/bookings.contract.js +30 -17
- package/dist/call-history/call-history.contract.d.ts +716 -745
- package/dist/call-history/call-history.contract.d.ts.map +1 -1
- package/dist/call-history/call-history.contract.js +2 -12
- package/dist/client-contacts/client-contacts.contract.d.ts +309 -309
- package/dist/client-contacts/client-contacts.contract.js +2 -2
- package/dist/clients/clients.contract.d.ts +173 -173
- package/dist/collaboration-checkings/collaboration-checkings.contract.d.ts +2328 -2328
- package/dist/collaborations/collaborations.contract.d.ts +2052 -2052
- package/dist/common/call-rating.schema.d.ts +12 -12
- package/dist/common/call-rating.schema.js +40 -48
- package/dist/common/common-schemas.d.ts +10 -4
- package/dist/common/common-schemas.d.ts.map +1 -1
- package/dist/common/common-schemas.js +2 -0
- package/dist/common/error-schemas.d.ts +5 -11
- package/dist/common/error-schemas.js +8 -11
- package/dist/common/openapi-metadata.d.ts +44 -54
- package/dist/common/openapi-metadata.js +129 -135
- package/dist/common/pagination-query.schema.d.ts +7 -13
- package/dist/common/pagination-query.schema.js +8 -11
- package/dist/companies/companies.contract.d.ts +26 -26
- package/dist/cron-executions/cron-executions.contract.d.ts +255 -7
- package/dist/cron-executions/cron-executions.contract.d.ts.map +1 -1
- package/dist/cron-executions/cron-executions.contract.js +28 -0
- package/dist/curated-workers/curated-workers.contract.d.ts +626 -558
- package/dist/curated-workers/curated-workers.contract.d.ts.map +1 -1
- package/dist/curated-workers/curated-workers.contract.js +2 -4
- package/dist/dashboards/agent-daily-metrics.contract.d.ts +20 -11
- package/dist/dashboards/agent-daily-metrics.contract.d.ts.map +1 -1
- package/dist/dashboards/agent-daily-metrics.contract.js +1 -0
- package/dist/dashboards/dashboard-widgets.contract.d.ts +62 -62
- package/dist/dashboards/dashboard-widgets.contract.d.ts.map +1 -1
- package/dist/dashboards/dashboard-widgets.contract.js +4 -1
- package/dist/dashboards/dashboard.contract.d.ts +12 -12
- package/dist/files/files.contract.d.ts +1189 -1556
- package/dist/files/files.contract.js +162 -177
- package/dist/health/health.contract.d.ts +144 -191
- package/dist/health/health.contract.js +40 -53
- package/dist/jobs/jobs.contract.d.ts +4427 -3769
- package/dist/jobs/jobs.contract.d.ts.map +1 -1
- package/dist/jobs/jobs.contract.js +106 -17
- package/dist/kpi-impersonation/kpi-impersonation.contract.d.ts +114 -114
- package/dist/lead-assignments/lead-assignments.contract.d.ts +606 -606
- package/dist/lead-distribution/agent-lead-distribution.contract.d.ts +217 -217
- package/dist/lead-distribution/lead-distribution-config.contract.d.ts +16 -16
- package/dist/leads/leads.contract.d.ts +167 -173
- package/dist/leads/leads.contract.d.ts.map +1 -1
- package/dist/leads/leads.contract.js +0 -4
- package/dist/locations/locations.contract.d.ts +28 -28
- package/dist/own-research/own-research.contract.d.ts +867 -867
- package/dist/postcodes/postcodes.contract.d.ts +6 -6
- package/dist/qualifications/qualifications.contract.d.ts +1387 -1898
- package/dist/qualifications/qualifications.contract.js +171 -193
- package/dist/trades/trades.contract.d.ts +763 -991
- package/dist/trades/trades.contract.js +89 -111
- package/dist/users/users.contract.d.ts +632 -285
- package/dist/users/users.contract.d.ts.map +1 -1
- package/dist/users/users.contract.js +38 -1
- package/dist/workers/workers.contract.d.ts +4581 -2712
- package/dist/workers/workers.contract.d.ts.map +1 -1
- package/dist/workers/workers.contract.js +277 -28
- package/package.json +1 -1
- package/dist/monitoring/monitoring.contract.d.ts +0 -615
- package/dist/monitoring/monitoring.contract.d.ts.map +0 -1
- package/dist/monitoring/monitoring.contract.js +0 -106
|
@@ -1,220 +1,205 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports,
|
|
3
|
-
exports.filesContract =
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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
|
-
|
|
9
|
+
.object({
|
|
17
10
|
fileName: zod_1.z
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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
|
-
|
|
16
|
+
})
|
|
17
|
+
.openapi({ title: 'GenerateUploadUrl' });
|
|
25
18
|
exports.GenerateUploadUrlResponseSchema = zod_1.z
|
|
26
|
-
|
|
19
|
+
.object({
|
|
27
20
|
uploadUrl: zod_1.z
|
|
28
|
-
|
|
29
|
-
|
|
21
|
+
.string()
|
|
22
|
+
.describe('The pre-signed URL for the file upload (PUT request).'),
|
|
30
23
|
fileId: zod_1.z
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
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
|
-
|
|
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
|
-
|
|
44
|
-
|
|
33
|
+
.string()
|
|
34
|
+
.describe('The original filename as uploaded by the user.'),
|
|
45
35
|
storageKey: zod_1.z
|
|
46
|
-
|
|
47
|
-
|
|
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
|
-
|
|
52
|
-
|
|
41
|
+
.string()
|
|
42
|
+
.describe('The storage location or path where the file is stored.'),
|
|
53
43
|
storageProvider: zod_1.z
|
|
54
|
-
|
|
55
|
-
|
|
44
|
+
.string()
|
|
45
|
+
.describe('The storage provider used (local, s3, azure, gcp).'),
|
|
56
46
|
description: zod_1.z
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
47
|
+
.string()
|
|
48
|
+
.nullable()
|
|
49
|
+
.describe('Optional user-provided description of the file.'),
|
|
60
50
|
entityType: zod_1.z
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
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
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
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
|
-
|
|
73
|
-
|
|
74
|
-
|
|
60
|
+
.string()
|
|
61
|
+
.uuid()
|
|
62
|
+
.describe('The UUID of the user who created this file.'),
|
|
75
63
|
createdAt: zod_1.z
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
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
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
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
|
-
|
|
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
|
-
|
|
77
|
+
})
|
|
78
|
+
.openapi({ title: 'FileDownloadUrlResponse' });
|
|
91
79
|
exports.UpdateFileSchema = zod_1.z
|
|
92
|
-
|
|
80
|
+
.object({
|
|
93
81
|
description: zod_1.z
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
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
|
-
|
|
102
|
-
|
|
103
|
-
exports.filesContract = c.router(
|
|
104
|
-
{
|
|
89
|
+
.array(exports.FileResponseSchema)
|
|
90
|
+
.openapi({ title: 'FileResponseArray' });
|
|
91
|
+
exports.filesContract = c.router({
|
|
105
92
|
generateUploadUrl: {
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
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
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
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
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
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
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
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
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
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
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
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
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
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
|
-
|
|
216
|
-
|
|
217
|
-
|
|
201
|
+
400: error_schemas_1.ErrorResponseSchema,
|
|
202
|
+
401: error_schemas_1.ErrorResponseSchema,
|
|
203
|
+
500: error_schemas_1.ErrorResponseSchema,
|
|
218
204
|
},
|
|
219
|
-
|
|
220
|
-
);
|
|
205
|
+
});
|