@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
|
@@ -26,10 +26,10 @@ var CallType;
|
|
|
26
26
|
CallType["OWN_RESEARCH"] = "own_research";
|
|
27
27
|
})(CallType || (exports.CallType = CallType = {}));
|
|
28
28
|
exports.CALL_TYPE_LABELS = {
|
|
29
|
-
[CallType.ASSIGNMENT]:
|
|
30
|
-
[CallType.AGENT_FOLLOW_UP]:
|
|
31
|
-
[CallType.LEAD_CALLBACK]:
|
|
32
|
-
[CallType.OWN_RESEARCH]:
|
|
29
|
+
[CallType.ASSIGNMENT]: 'Assignment Call',
|
|
30
|
+
[CallType.AGENT_FOLLOW_UP]: 'Agent Follow-up',
|
|
31
|
+
[CallType.LEAD_CALLBACK]: 'Lead Callback',
|
|
32
|
+
[CallType.OWN_RESEARCH]: 'Own Research',
|
|
33
33
|
};
|
|
34
34
|
var LeadSource;
|
|
35
35
|
(function (LeadSource) {
|
|
@@ -37,8 +37,8 @@ var LeadSource;
|
|
|
37
37
|
LeadSource["LEADS_TABLE"] = "leads_table";
|
|
38
38
|
})(LeadSource || (exports.LeadSource = LeadSource = {}));
|
|
39
39
|
exports.LEAD_SOURCE_LABELS = {
|
|
40
|
-
[LeadSource.OWN_RESEARCH]:
|
|
41
|
-
[LeadSource.LEADS_TABLE]:
|
|
40
|
+
[LeadSource.OWN_RESEARCH]: 'Own Research',
|
|
41
|
+
[LeadSource.LEADS_TABLE]: 'Leads Table',
|
|
42
42
|
};
|
|
43
43
|
var CallHistorySortableFields;
|
|
44
44
|
(function (CallHistorySortableFields) {
|
|
@@ -48,26 +48,26 @@ var CallHistorySortableFields;
|
|
|
48
48
|
CallHistorySortableFields["RATING_WEIGHT"] = "ratingWeight";
|
|
49
49
|
})(CallHistorySortableFields || (exports.CallHistorySortableFields = CallHistorySortableFields = {}));
|
|
50
50
|
exports.CallTypeSchema = zod_1.z.nativeEnum(CallType).openapi({
|
|
51
|
-
title:
|
|
52
|
-
description:
|
|
51
|
+
title: 'CallType',
|
|
52
|
+
description: 'Type of the call',
|
|
53
53
|
});
|
|
54
54
|
exports.LeadSourceSchema = zod_1.z.nativeEnum(LeadSource).openapi({
|
|
55
|
-
title:
|
|
56
|
-
description:
|
|
55
|
+
title: 'LeadSource',
|
|
56
|
+
description: 'Source of the lead',
|
|
57
57
|
});
|
|
58
58
|
exports.CallHistorySortableFieldsSchema = zod_1.z
|
|
59
59
|
.nativeEnum(CallHistorySortableFields)
|
|
60
60
|
.openapi({
|
|
61
|
-
title:
|
|
61
|
+
title: 'CallHistorySortableFields',
|
|
62
62
|
});
|
|
63
63
|
// Schemas
|
|
64
64
|
exports.CallHistorySchema = zod_1.z
|
|
65
65
|
.object({
|
|
66
|
-
id: zod_1.z.string().uuid().describe(
|
|
66
|
+
id: zod_1.z.string().uuid().describe('The unique identifier of the call record'),
|
|
67
67
|
assignmentId: zod_1.z
|
|
68
68
|
.string()
|
|
69
69
|
.uuid()
|
|
70
|
-
.describe(
|
|
70
|
+
.describe('The ID of the assignment that generated this call record'),
|
|
71
71
|
// leadId and agentId are derived from assignment usually, but existing DTO has them?
|
|
72
72
|
// Looking at CallHistoryResponseDto, it exposes leadId and agentId.
|
|
73
73
|
// However, the entity CallHistory only has assignmentId.
|
|
@@ -78,132 +78,132 @@ exports.CallHistorySchema = zod_1.z
|
|
|
78
78
|
leadId: zod_1.z
|
|
79
79
|
.string()
|
|
80
80
|
.uuid()
|
|
81
|
-
.describe(
|
|
81
|
+
.describe('The ID of the lead that was called')
|
|
82
82
|
.optional(),
|
|
83
83
|
agentId: zod_1.z
|
|
84
84
|
.string()
|
|
85
85
|
.uuid()
|
|
86
|
-
.describe(
|
|
86
|
+
.describe('The ID of the agent who made the call')
|
|
87
87
|
.optional(),
|
|
88
|
-
assignment: lead_assignments_contract_1.LeadAssignmentSchema.describe(
|
|
88
|
+
assignment: lead_assignments_contract_1.LeadAssignmentSchema.describe('The assignment that generated this call record')
|
|
89
89
|
.optional()
|
|
90
90
|
.nullable(),
|
|
91
91
|
callDate: zod_1.z
|
|
92
92
|
.union([zod_1.z.string().datetime(), zod_1.z.date()])
|
|
93
93
|
.transform((val) => (val instanceof Date ? val.toISOString() : val))
|
|
94
|
-
.describe(
|
|
94
|
+
.describe('The date and time when the call was made'),
|
|
95
95
|
callType: exports.CallTypeSchema,
|
|
96
96
|
leadSource: exports.LeadSourceSchema,
|
|
97
|
-
rating: call_rating_schema_1.CallRatingSchema.describe(
|
|
97
|
+
rating: call_rating_schema_1.CallRatingSchema.describe('The rating given to the call outcome'),
|
|
98
98
|
ratingWeight: zod_1.z.coerce
|
|
99
99
|
.number()
|
|
100
|
-
.describe(
|
|
100
|
+
.describe('The weight associated with the call rating for performance calculations'),
|
|
101
101
|
notes: zod_1.z
|
|
102
102
|
.string()
|
|
103
|
-
.describe(
|
|
103
|
+
.describe('Optional notes about the call conversation')
|
|
104
104
|
.nullable(),
|
|
105
105
|
createdAt: zod_1.z
|
|
106
106
|
.union([zod_1.z.string().datetime(), zod_1.z.date()])
|
|
107
107
|
.transform((val) => (val instanceof Date ? val.toISOString() : val))
|
|
108
|
-
.describe(
|
|
108
|
+
.describe('The timestamp when the call record was created'),
|
|
109
109
|
updatedAt: zod_1.z
|
|
110
110
|
.union([zod_1.z.string().datetime(), zod_1.z.date()])
|
|
111
111
|
.transform((val) => (val instanceof Date ? val.toISOString() : val))
|
|
112
|
-
.describe(
|
|
112
|
+
.describe('The timestamp when the call record was last updated'),
|
|
113
113
|
})
|
|
114
|
-
.openapi({ title:
|
|
114
|
+
.openapi({ title: 'CallHistory' });
|
|
115
115
|
exports.PaginatedCallHistoryResponseSchema = (0, pagination_schema_1.createPaginatedResponseSchema)(exports.CallHistorySchema).openapi({
|
|
116
|
-
title:
|
|
116
|
+
title: 'PaginatedCallHistoryResponse',
|
|
117
117
|
});
|
|
118
118
|
exports.CreateCallHistorySchema = zod_1.z
|
|
119
119
|
.object({
|
|
120
120
|
assignmentId: zod_1.z
|
|
121
121
|
.string()
|
|
122
122
|
.uuid()
|
|
123
|
-
.describe(
|
|
124
|
-
rating: call_rating_schema_1.CallRatingSchema.describe(
|
|
123
|
+
.describe('The ID of the assignment that generated this call record'),
|
|
124
|
+
rating: call_rating_schema_1.CallRatingSchema.describe('The rating given to the call outcome'),
|
|
125
125
|
notes: zod_1.z
|
|
126
126
|
.string()
|
|
127
127
|
.max(1000)
|
|
128
|
-
.describe(
|
|
128
|
+
.describe('Optional notes about the call conversation')
|
|
129
129
|
.optional(),
|
|
130
130
|
callType: exports.CallTypeSchema,
|
|
131
131
|
})
|
|
132
|
-
.openapi({ title:
|
|
132
|
+
.openapi({ title: 'CreateCallHistory' });
|
|
133
133
|
exports.UpdateCallHistorySchema = zod_1.z
|
|
134
134
|
.object({
|
|
135
135
|
callDate: zod_1.z
|
|
136
136
|
.string() // IsDateString in DTO
|
|
137
137
|
.datetime()
|
|
138
|
-
.describe(
|
|
138
|
+
.describe('The date and time when the call was made')
|
|
139
139
|
.optional(),
|
|
140
|
-
rating: call_rating_schema_1.CallRatingSchema.optional().describe(
|
|
140
|
+
rating: call_rating_schema_1.CallRatingSchema.optional().describe('The rating given to the call outcome'),
|
|
141
141
|
notes: zod_1.z
|
|
142
142
|
.string()
|
|
143
143
|
.max(1000)
|
|
144
|
-
.describe(
|
|
144
|
+
.describe('Optional notes about the call conversation')
|
|
145
145
|
.nullable()
|
|
146
146
|
.optional(),
|
|
147
147
|
})
|
|
148
|
-
.openapi({ title:
|
|
148
|
+
.openapi({ title: 'UpdateCallHistory' });
|
|
149
149
|
exports.FilterCallHistorySchema = pagination_query_schema_1.PaginationQuerySchema.extend({
|
|
150
150
|
callDate: common_schemas_1.DateRangeSchema.optional()
|
|
151
151
|
.nullable()
|
|
152
|
-
.describe(
|
|
153
|
-
agentId: zod_1.z.string().uuid().describe(
|
|
154
|
-
companyId: zod_1.z.string().uuid().describe(
|
|
152
|
+
.describe('Filter by call date range'),
|
|
153
|
+
agentId: zod_1.z.string().uuid().describe('Search First Agent').optional(),
|
|
154
|
+
companyId: zod_1.z.string().uuid().describe('Search Company').optional(),
|
|
155
155
|
rating: common_schemas_1.RatingRangeSchema.optional()
|
|
156
156
|
.nullable()
|
|
157
|
-
.describe(
|
|
157
|
+
.describe('Filter by rating range'),
|
|
158
158
|
callType: exports.CallTypeSchema.optional(),
|
|
159
159
|
leadSource: exports.LeadSourceSchema.optional(),
|
|
160
|
-
phoneNumber: zod_1.z.string().optional().describe(
|
|
161
|
-
leadName: zod_1.z.string().optional().describe(
|
|
160
|
+
phoneNumber: zod_1.z.string().optional().describe('Search by phone number'),
|
|
161
|
+
leadName: zod_1.z.string().optional().describe('Search by lead name'),
|
|
162
162
|
sortBy: exports.CallHistorySortableFieldsSchema.default(CallHistorySortableFields.CREATED_AT)
|
|
163
|
-
.describe(
|
|
163
|
+
.describe('The field to sort the results by')
|
|
164
164
|
.optional(),
|
|
165
|
-
sortOrder: common_schemas_1.SortOrderSchema.default(
|
|
166
|
-
.describe(
|
|
165
|
+
sortOrder: common_schemas_1.SortOrderSchema.default('DESC')
|
|
166
|
+
.describe('The order to sort the results by')
|
|
167
167
|
.optional(),
|
|
168
|
-
}).openapi({ title:
|
|
168
|
+
}).openapi({ title: 'FilterCallHistory' });
|
|
169
169
|
exports.CallHistoryStatsSchema = zod_1.z
|
|
170
170
|
.object({
|
|
171
|
-
totalCalls: zod_1.z.number().describe(
|
|
172
|
-
averageRatingWeight: zod_1.z.number().describe(
|
|
171
|
+
totalCalls: zod_1.z.number().describe('Total number of calls made'),
|
|
172
|
+
averageRatingWeight: zod_1.z.number().describe('Average rating weight of calls'),
|
|
173
173
|
callsByRating: zod_1.z
|
|
174
174
|
.record(zod_1.z.string(), zod_1.z.number())
|
|
175
|
-
.describe(
|
|
175
|
+
.describe('Distribution of calls by rating'),
|
|
176
176
|
})
|
|
177
|
-
.openapi({ title:
|
|
177
|
+
.openapi({ title: 'CallHistoryStats' });
|
|
178
178
|
exports.callHistoryContract = c.router({
|
|
179
179
|
create: {
|
|
180
|
-
method:
|
|
181
|
-
path:
|
|
180
|
+
method: 'POST',
|
|
181
|
+
path: '/call-history',
|
|
182
182
|
body: exports.CreateCallHistorySchema,
|
|
183
183
|
responses: {
|
|
184
184
|
201: exports.CallHistorySchema,
|
|
185
185
|
409: error_schemas_1.ErrorResponseSchema,
|
|
186
186
|
},
|
|
187
|
-
summary:
|
|
187
|
+
summary: 'Create a new call history record',
|
|
188
188
|
metadata: {
|
|
189
|
-
tags: [
|
|
189
|
+
tags: ['Call History'],
|
|
190
190
|
},
|
|
191
191
|
},
|
|
192
192
|
findAll: {
|
|
193
|
-
method:
|
|
194
|
-
path:
|
|
193
|
+
method: 'GET',
|
|
194
|
+
path: '/call-history',
|
|
195
195
|
query: exports.FilterCallHistorySchema,
|
|
196
196
|
responses: {
|
|
197
197
|
200: exports.PaginatedCallHistoryResponseSchema,
|
|
198
198
|
},
|
|
199
|
-
summary:
|
|
199
|
+
summary: 'Get call history records',
|
|
200
200
|
metadata: {
|
|
201
|
-
tags: [
|
|
201
|
+
tags: ['Call History'],
|
|
202
202
|
},
|
|
203
203
|
},
|
|
204
204
|
findOne: {
|
|
205
|
-
method:
|
|
206
|
-
path:
|
|
205
|
+
method: 'GET',
|
|
206
|
+
path: '/call-history/:id',
|
|
207
207
|
pathParams: zod_1.z.object({
|
|
208
208
|
id: zod_1.z.string().uuid(),
|
|
209
209
|
}),
|
|
@@ -211,14 +211,14 @@ exports.callHistoryContract = c.router({
|
|
|
211
211
|
200: exports.CallHistorySchema,
|
|
212
212
|
404: error_schemas_1.ErrorResponseSchema,
|
|
213
213
|
},
|
|
214
|
-
summary:
|
|
214
|
+
summary: 'Get a specific call history record',
|
|
215
215
|
metadata: {
|
|
216
|
-
tags: [
|
|
216
|
+
tags: ['Call History'],
|
|
217
217
|
},
|
|
218
218
|
},
|
|
219
219
|
update: {
|
|
220
|
-
method:
|
|
221
|
-
path:
|
|
220
|
+
method: 'PATCH',
|
|
221
|
+
path: '/call-history/:id',
|
|
222
222
|
pathParams: zod_1.z.object({
|
|
223
223
|
id: zod_1.z.string().uuid(),
|
|
224
224
|
}),
|
|
@@ -227,24 +227,24 @@ exports.callHistoryContract = c.router({
|
|
|
227
227
|
200: exports.CallHistorySchema,
|
|
228
228
|
404: error_schemas_1.ErrorResponseSchema,
|
|
229
229
|
},
|
|
230
|
-
summary:
|
|
230
|
+
summary: 'Update call history notes',
|
|
231
231
|
metadata: {
|
|
232
|
-
tags: [
|
|
232
|
+
tags: ['Call History'],
|
|
233
233
|
},
|
|
234
234
|
},
|
|
235
235
|
getAgentStats: {
|
|
236
|
-
method:
|
|
237
|
-
path:
|
|
236
|
+
method: 'GET',
|
|
237
|
+
path: '/call-history/stats/agent',
|
|
238
238
|
responses: {
|
|
239
239
|
200: exports.CallHistoryStatsSchema,
|
|
240
240
|
},
|
|
241
|
-
summary:
|
|
241
|
+
summary: 'Get agent performance statistics',
|
|
242
242
|
metadata: {
|
|
243
|
-
tags: [
|
|
243
|
+
tags: ['Call History'],
|
|
244
244
|
},
|
|
245
245
|
},
|
|
246
246
|
}, {
|
|
247
|
-
pathPrefix:
|
|
247
|
+
pathPrefix: '/v2',
|
|
248
248
|
commonResponses: {
|
|
249
249
|
400: error_schemas_1.ErrorResponseSchema,
|
|
250
250
|
401: error_schemas_1.ErrorResponseSchema,
|