@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
@@ -10,69 +10,69 @@ const pagination_query_schema_1 = require("../common/pagination-query.schema");
10
10
  const pagination_schema_1 = require("../common/pagination.schema");
11
11
  (0, zod_openapi_1.extendZodWithOpenApi)(zod_1.z);
12
12
  exports.UserRoleSchema = zod_1.z.enum([
13
- "ADMIN",
14
- "SECOND_AGENT",
15
- "FIRST_AGENT",
16
- "COMPANY_CHECKING",
17
- "KPI",
18
- "TEAM_LEADS",
13
+ 'ADMIN',
14
+ 'SECOND_AGENT',
15
+ 'FIRST_AGENT',
16
+ 'COMPANY_CHECKING',
17
+ 'KPI',
18
+ 'TEAM_LEADS',
19
19
  ]);
20
20
  exports.UserOfficeSchema = zod_1.z.enum([
21
- "ALBANIA",
22
- "CRAIOVA",
23
- "DANI",
24
- "GABI_RECRUTARE",
25
- "GEORGIA",
26
- "INDIA",
27
- "IONITA",
28
- "MARIUS_DRAGAN",
29
- "MAX_MANGU",
30
- "MAXIM_VADIM",
31
- "MD_BOGDAN",
32
- "MD_DANIEL_CHISINAU",
33
- "NEACSU",
34
- "ROBERT_DENIS",
35
- "ROBERT_RADU",
36
- "VICTORIEI_MIRIAM",
37
- "VIZIRU",
38
- "Y_INDIVIDUALS_RECRUITMENT",
21
+ 'ALBANIA',
22
+ 'CRAIOVA',
23
+ 'DANI',
24
+ 'GABI_RECRUTARE',
25
+ 'GEORGIA',
26
+ 'INDIA',
27
+ 'IONITA',
28
+ 'MARIUS_DRAGAN',
29
+ 'MAX_MANGU',
30
+ 'MAXIM_VADIM',
31
+ 'MD_BOGDAN',
32
+ 'MD_DANIEL_CHISINAU',
33
+ 'NEACSU',
34
+ 'ROBERT_DENIS',
35
+ 'ROBERT_RADU',
36
+ 'VICTORIEI_MIRIAM',
37
+ 'VIZIRU',
38
+ 'Y_INDIVIDUALS_RECRUITMENT',
39
39
  ]);
40
40
  exports.UserSortableFieldsSchema = zod_1.z.enum([
41
- "lastName",
42
- "firstName",
43
- "email",
44
- "createdAt",
41
+ 'lastName',
42
+ 'firstName',
43
+ 'email',
44
+ 'createdAt',
45
45
  ]);
46
46
  exports.UserPhoneNumberSchema = common_schemas_1.PhoneNumberResponseSchema.openapi({
47
- title: "UserPhoneNumber",
47
+ title: 'UserPhoneNumber',
48
48
  });
49
49
  exports.CreateUserPhoneNumberSchema = common_schemas_1.CreatePhoneNumberSchema.openapi({
50
- title: "CreateUserPhoneNumber",
50
+ title: 'CreateUserPhoneNumber',
51
51
  });
52
52
  exports.UpsertUserPhoneNumberSchema = common_schemas_1.UpsertPhoneNumberSchema.openapi({
53
- title: "UpsertUserPhoneNumber",
53
+ title: 'UpsertUserPhoneNumber',
54
54
  });
55
55
  exports.UserAutocompleteResponseSchema = zod_1.z
56
56
  .object({
57
- id: zod_1.z.string().describe("The unique identifier of the user."),
58
- firstName: zod_1.z.string().describe("The first name of the user."),
59
- lastName: zod_1.z.string().describe("The last name of the user."),
57
+ id: zod_1.z.string().describe('The unique identifier of the user.'),
58
+ firstName: zod_1.z.string().describe('The first name of the user.'),
59
+ lastName: zod_1.z.string().describe('The last name of the user.'),
60
60
  })
61
- .openapi({ title: "UserAutocompleteResponse" });
61
+ .openapi({ title: 'UserAutocompleteResponse' });
62
62
  exports.UserAutocompleteArraySchema = zod_1.z
63
63
  .array(exports.UserAutocompleteResponseSchema)
64
- .openapi({ title: "UserAutocompleteArray" });
64
+ .openapi({ title: 'UserAutocompleteArray' });
65
65
  exports.RolesFilterSchema = zod_1.z.object({
66
66
  values: zod_1.z
67
67
  .array(exports.UserRoleSchema)
68
68
  .optional()
69
- .describe("Array of roles to filter by"),
69
+ .describe('Array of roles to filter by'),
70
70
  requireAll: zod_1.z
71
- .preprocess((val) => (val === "true" ? true : val === "false" ? false : val), zod_1.z.boolean().optional())
72
- .describe("If true, user must have ALL roles. If false, user must have ANY role."),
71
+ .preprocess((val) => (val === 'true' ? true : val === 'false' ? false : val), zod_1.z.boolean().optional())
72
+ .describe('If true, user must have ALL roles. If false, user must have ANY role.'),
73
73
  });
74
74
  exports.UserSchema = zod_1.z.object({
75
- id: zod_1.z.string().uuid().describe("The unique identifier of the user."),
75
+ id: zod_1.z.string().uuid().describe('The unique identifier of the user.'),
76
76
  firstName: zod_1.z.string().describe("The user's first name."),
77
77
  lastName: zod_1.z.string().describe("The user's last name."),
78
78
  email: zod_1.z.string().email().describe("The user's email address."),
@@ -80,206 +80,206 @@ exports.UserSchema = zod_1.z.object({
80
80
  .array(exports.UserPhoneNumberSchema)
81
81
  .optional()
82
82
  .default([])
83
- .describe("Phone Numbers"),
83
+ .describe('Phone Numbers'),
84
84
  roles: zod_1.z.array(exports.UserRoleSchema).optional().describe("The user's roles."),
85
85
  office: exports.UserOfficeSchema.nullable().optional().describe("The user's office."),
86
86
  canImpersonateUsers: zod_1.z
87
87
  .array(exports.UserAutocompleteResponseSchema)
88
88
  .optional()
89
- .describe("Users that this KPI user can impersonate"),
89
+ .describe('Users that this KPI user can impersonate'),
90
90
  createdAt: zod_1.z
91
91
  .union([zod_1.z.string().datetime(), zod_1.z.date()])
92
92
  .transform((val) => (val instanceof Date ? val.toISOString() : val))
93
- .describe("The date and time the user was created."),
93
+ .describe('The date and time the user was created.'),
94
94
  updatedAt: zod_1.z
95
95
  .union([zod_1.z.string().datetime(), zod_1.z.date()])
96
96
  .transform((val) => (val instanceof Date ? val.toISOString() : val))
97
- .describe("The date and time the user was last updated."),
97
+ .describe('The date and time the user was last updated.'),
98
98
  });
99
99
  exports.CreateUserSchema = zod_1.z
100
100
  .object({
101
- firstName: zod_1.z.string().min(1).describe("Enter first name"),
102
- lastName: zod_1.z.string().min(1).describe("Enter last name"),
103
- email: zod_1.z.string().email().describe("Enter email address"),
101
+ firstName: zod_1.z.string().min(1).describe('Enter first name'),
102
+ lastName: zod_1.z.string().min(1).describe('Enter last name'),
103
+ email: zod_1.z.string().email().describe('Enter email address'),
104
104
  phoneNumbers: zod_1.z
105
105
  .array(exports.CreateUserPhoneNumberSchema)
106
- .min(1, { message: "At least one phone number is required" })
106
+ .min(1, { message: 'At least one phone number is required' })
107
107
  .refine((phoneNumbers) => phoneNumbers.some((phone) => phone.isPrimary), {
108
- message: "Must have at least one primary phone number",
108
+ message: 'Must have at least one primary phone number',
109
109
  })
110
- .describe("Phone Numbers"),
111
- password: zod_1.z.string().min(8).optional().describe("Enter password"),
112
- roles: zod_1.z.array(exports.UserRoleSchema).optional().describe("Select roles"),
113
- office: exports.UserOfficeSchema.nullable().optional().describe("Select office"),
110
+ .describe('Phone Numbers'),
111
+ password: zod_1.z.string().min(8).optional().describe('Enter password'),
112
+ roles: zod_1.z.array(exports.UserRoleSchema).optional().describe('Select roles'),
113
+ office: exports.UserOfficeSchema.nullable().optional().describe('Select office'),
114
114
  })
115
- .openapi({ title: "CreateUser" });
115
+ .openapi({ title: 'CreateUser' });
116
116
  exports.UpdateUserSchema = zod_1.z
117
117
  .object({
118
- firstName: zod_1.z.string().min(1).describe("Enter first name"),
119
- lastName: zod_1.z.string().min(1).describe("Enter last name"),
120
- email: zod_1.z.string().email().describe("Enter email address"),
118
+ firstName: zod_1.z.string().min(1).describe('Enter first name'),
119
+ lastName: zod_1.z.string().min(1).describe('Enter last name'),
120
+ email: zod_1.z.string().email().describe('Enter email address'),
121
121
  phoneNumbers: zod_1.z
122
122
  .array(exports.UpsertUserPhoneNumberSchema)
123
- .min(1, { message: "At least one phone number is required" })
123
+ .min(1, { message: 'At least one phone number is required' })
124
124
  .refine((phoneNumbers) => phoneNumbers.some((phone) => phone.isPrimary), {
125
- message: "Must have at least one primary phone number",
125
+ message: 'Must have at least one primary phone number',
126
126
  })
127
- .describe("Phone Numbers"),
128
- password: zod_1.z.string().min(8).optional().describe("Enter password"),
129
- roles: zod_1.z.array(exports.UserRoleSchema).optional().describe("Select roles"),
130
- office: exports.UserOfficeSchema.nullable().optional().describe("Select office"),
127
+ .describe('Phone Numbers'),
128
+ password: zod_1.z.string().min(8).optional().describe('Enter password'),
129
+ roles: zod_1.z.array(exports.UserRoleSchema).optional().describe('Select roles'),
130
+ office: exports.UserOfficeSchema.nullable().optional().describe('Select office'),
131
131
  canImpersonateUserIds: zod_1.z
132
132
  .array(zod_1.z.string().uuid())
133
133
  .optional()
134
- .describe("User IDs that this KPI user can impersonate"),
134
+ .describe('User IDs that this KPI user can impersonate'),
135
135
  })
136
136
  .partial()
137
- .openapi({ title: "UpdateUser" });
137
+ .openapi({ title: 'UpdateUser' });
138
138
  exports.FilterUserSchema = pagination_query_schema_1.PaginationQuerySchema.extend({
139
139
  name: zod_1.z
140
140
  .string()
141
141
  .optional()
142
- .describe("Filter users by name using fuzzy search (searches firstName and lastName)"),
142
+ .describe('Filter users by name using fuzzy search (searches firstName and lastName)'),
143
143
  email: zod_1.z
144
144
  .string()
145
145
  .optional()
146
- .describe("Filter users by email (case-insensitive, partial match)"),
146
+ .describe('Filter users by email (case-insensitive, partial match)'),
147
147
  phone: zod_1.z
148
148
  .string()
149
149
  .optional()
150
- .describe("Filter users by phone number (partial match)"),
151
- roles: exports.RolesFilterSchema.optional().describe("Filter users by roles."),
152
- office: exports.UserOfficeSchema.optional().describe("Filter users by office."),
153
- sortBy: exports.UserSortableFieldsSchema.optional().describe("Field to sort users by."),
154
- sortOrder: common_schemas_1.SortOrderSchema.optional().describe("Sort order (ASC or DESC)"),
150
+ .describe('Filter users by phone number (partial match)'),
151
+ roles: exports.RolesFilterSchema.optional().describe('Filter users by roles.'),
152
+ office: exports.UserOfficeSchema.optional().describe('Filter users by office.'),
153
+ sortBy: exports.UserSortableFieldsSchema.optional().describe('Field to sort users by.'),
154
+ sortOrder: common_schemas_1.SortOrderSchema.optional().describe('Sort order (ASC or DESC)'),
155
155
  });
156
156
  exports.ProfileSchema = zod_1.z
157
157
  .object({
158
- id: zod_1.z.string().describe("The unique identifier of the user."),
159
- email: zod_1.z.string().describe("The email address of the user."),
160
- firstName: zod_1.z.string().optional().describe("The first name of the user."),
161
- lastName: zod_1.z.string().optional().describe("The last name of the user."),
158
+ id: zod_1.z.string().describe('The unique identifier of the user.'),
159
+ email: zod_1.z.string().describe('The email address of the user.'),
160
+ firstName: zod_1.z.string().optional().describe('The first name of the user.'),
161
+ lastName: zod_1.z.string().optional().describe('The last name of the user.'),
162
162
  phoneNumbers: zod_1.z
163
163
  .array(exports.UserPhoneNumberSchema)
164
164
  .optional()
165
165
  .default([])
166
- .describe("Phone Numbers"),
166
+ .describe('Phone Numbers'),
167
167
  roles: zod_1.z
168
168
  .array(exports.UserRoleSchema)
169
169
  .optional()
170
- .describe("The roles assigned to the user."),
170
+ .describe('The roles assigned to the user.'),
171
171
  impersonatedBy: zod_1.z
172
172
  .string()
173
173
  .optional()
174
- .describe("The ID of the admin who is impersonating this user."),
174
+ .describe('The ID of the admin who is impersonating this user.'),
175
175
  })
176
- .openapi({ title: "Profile" });
176
+ .openapi({ title: 'Profile' });
177
177
  exports.PaginatedUserResponseSchema = (0, pagination_schema_1.createPaginatedResponseSchema)(exports.UserSchema)
178
- .describe("Resources retrieved successfully.")
179
- .openapi({ title: "UsersPaginatedResponse" });
178
+ .describe('Resources retrieved successfully.')
179
+ .openapi({ title: 'UsersPaginatedResponse' });
180
180
  const c = (0, core_1.initContract)();
181
181
  exports.usersContract = c.router({
182
182
  create: {
183
- method: "POST",
184
- path: "/v2/users",
183
+ method: 'POST',
184
+ path: '/v2/users',
185
185
  responses: {
186
186
  201: exports.UserSchema,
187
187
  409: error_schemas_1.ErrorResponseSchema,
188
188
  },
189
189
  body: exports.CreateUserSchema,
190
- summary: "Create a new user",
191
- metadata: { tags: ["Users"] },
190
+ summary: 'Create a new user',
191
+ metadata: { tags: ['Users'] },
192
192
  },
193
193
  findAll: {
194
- method: "GET",
195
- path: "/v2/users",
194
+ method: 'GET',
195
+ path: '/v2/users',
196
196
  responses: {
197
197
  200: exports.PaginatedUserResponseSchema,
198
198
  },
199
199
  query: exports.FilterUserSchema,
200
- summary: "Get all users",
201
- metadata: { tags: ["Users"] },
200
+ summary: 'Get all users',
201
+ metadata: { tags: ['Users'] },
202
202
  },
203
203
  autocomplete: {
204
- method: "GET",
205
- path: "/v2/users/autocomplete",
204
+ method: 'GET',
205
+ path: '/v2/users/autocomplete',
206
206
  responses: {
207
207
  200: exports.UserAutocompleteArraySchema,
208
208
  },
209
209
  query: common_schemas_1.AutocompleteQuerySchema,
210
- summary: "Get users for autocomplete",
211
- metadata: { tags: ["Users"] },
210
+ summary: 'Get users for autocomplete',
211
+ metadata: { tags: ['Users'] },
212
212
  },
213
213
  autocompleteFirstAgent: {
214
- method: "GET",
215
- path: "/v2/users/autocomplete/first-agent",
214
+ method: 'GET',
215
+ path: '/v2/users/autocomplete/first-agent',
216
216
  responses: {
217
217
  200: exports.UserAutocompleteArraySchema,
218
218
  },
219
219
  query: common_schemas_1.AutocompleteQuerySchema,
220
- summary: "Get users with FIRST_AGENT role for autocomplete",
221
- metadata: { tags: ["Users"] },
220
+ summary: 'Get users with FIRST_AGENT role for autocomplete',
221
+ metadata: { tags: ['Users'] },
222
222
  },
223
223
  autocompleteSecondAgent: {
224
- method: "GET",
225
- path: "/v2/users/autocomplete/second-agent",
224
+ method: 'GET',
225
+ path: '/v2/users/autocomplete/second-agent',
226
226
  responses: {
227
227
  200: exports.UserAutocompleteArraySchema,
228
228
  },
229
229
  query: common_schemas_1.AutocompleteQuerySchema,
230
- summary: "Get users with SECOND_AGENT role for autocomplete",
231
- metadata: { tags: ["Users"] },
230
+ summary: 'Get users with SECOND_AGENT role for autocomplete',
231
+ metadata: { tags: ['Users'] },
232
232
  },
233
233
  me: {
234
- method: "GET",
235
- path: "/v2/users/me",
234
+ method: 'GET',
235
+ path: '/v2/users/me',
236
236
  responses: {
237
237
  200: exports.ProfileSchema,
238
238
  },
239
- summary: "Get current user profile",
240
- metadata: { tags: ["Users"] },
239
+ summary: 'Get current user profile',
240
+ metadata: { tags: ['Users'] },
241
241
  },
242
242
  findOne: {
243
- method: "GET",
244
- path: "/v2/users/:id",
243
+ method: 'GET',
244
+ path: '/v2/users/:id',
245
245
  responses: {
246
246
  200: exports.UserSchema,
247
247
  404: error_schemas_1.ErrorResponseSchema,
248
248
  },
249
249
  pathParams: zod_1.z.object({
250
- id: zod_1.z.string().uuid().describe("The ID of the resource (UUID format)."),
250
+ id: zod_1.z.string().uuid().describe('The ID of the resource (UUID format).'),
251
251
  }),
252
- summary: "Get a user by ID",
253
- metadata: { tags: ["Users"] },
252
+ summary: 'Get a user by ID',
253
+ metadata: { tags: ['Users'] },
254
254
  },
255
255
  update: {
256
- method: "PATCH",
257
- path: "/v2/users/:id",
256
+ method: 'PATCH',
257
+ path: '/v2/users/:id',
258
258
  responses: {
259
259
  200: exports.UserSchema,
260
260
  404: error_schemas_1.ErrorResponseSchema,
261
261
  409: error_schemas_1.ErrorResponseSchema,
262
262
  },
263
263
  pathParams: zod_1.z.object({
264
- id: zod_1.z.string().uuid().describe("The ID of the resource (UUID format)."),
264
+ id: zod_1.z.string().uuid().describe('The ID of the resource (UUID format).'),
265
265
  }),
266
266
  body: exports.UpdateUserSchema,
267
- summary: "Update a user by ID",
268
- metadata: { tags: ["Users"] },
267
+ summary: 'Update a user by ID',
268
+ metadata: { tags: ['Users'] },
269
269
  },
270
270
  remove: {
271
- method: "DELETE",
272
- path: "/v2/users/:id",
271
+ method: 'DELETE',
272
+ path: '/v2/users/:id',
273
273
  responses: {
274
274
  204: zod_1.z.undefined(),
275
275
  404: error_schemas_1.ErrorResponseSchema,
276
276
  },
277
277
  pathParams: zod_1.z.object({
278
- id: zod_1.z.string().uuid().describe("The ID of the resource (UUID format)."),
278
+ id: zod_1.z.string().uuid().describe('The ID of the resource (UUID format).'),
279
279
  }),
280
280
  body: zod_1.z.undefined(),
281
- summary: "Delete a user by ID",
282
- metadata: { tags: ["Users"] },
281
+ summary: 'Delete a user by ID',
282
+ metadata: { tags: ['Users'] },
283
283
  },
284
284
  }, {
285
285
  commonResponses: {