@liaisongroup/assist-api-js-client 0.0.0-alpha
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/LICENSE +21 -0
- package/README.md +38 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +9 -0
- package/dist/openapi.d.ts +6606 -0
- package/dist/openapi.json +16177 -0
- package/dist/openapi.zod.d.ts +31967 -0
- package/dist/openapi.zod.js +2008 -0
- package/dist/utils.d.ts +2 -0
- package/dist/utils.js +8 -0
- package/dist/zod_template.hbs +9 -0
- package/package.json +76 -0
|
@@ -0,0 +1,2008 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export const PasswordGrant = z.object({
|
|
3
|
+
grant_type: z.literal("password").optional(),
|
|
4
|
+
email: z.string().optional(),
|
|
5
|
+
password: z.string().optional(),
|
|
6
|
+
client_id: z.string(),
|
|
7
|
+
client_secret: z.string(),
|
|
8
|
+
});
|
|
9
|
+
export const RefreshTokenGrant = z.object({
|
|
10
|
+
grant_type: z.literal("refresh_token").optional(),
|
|
11
|
+
client_id: z.string(),
|
|
12
|
+
client_secret: z.string(),
|
|
13
|
+
refresh_token: z.string().optional(),
|
|
14
|
+
});
|
|
15
|
+
export const create_access_token_Body = z.union([
|
|
16
|
+
PasswordGrant,
|
|
17
|
+
RefreshTokenGrant,
|
|
18
|
+
]);
|
|
19
|
+
export const AccessToken = z
|
|
20
|
+
.object({
|
|
21
|
+
access_token: z.string(),
|
|
22
|
+
token_type: z.literal("Bearer"),
|
|
23
|
+
expires_in: z.number().int(),
|
|
24
|
+
refresh_token: z.string(),
|
|
25
|
+
scope: z.string(),
|
|
26
|
+
created_at: z.number().int(),
|
|
27
|
+
})
|
|
28
|
+
.partial();
|
|
29
|
+
export const revoke_access_token_Body = z.object({
|
|
30
|
+
token: z.string(),
|
|
31
|
+
client_id: z.string(),
|
|
32
|
+
client_secret: z.string(),
|
|
33
|
+
});
|
|
34
|
+
export const consume_saml_response_Body = z.object({
|
|
35
|
+
saml_response: z.string(),
|
|
36
|
+
client_id: z.string(),
|
|
37
|
+
client_secret: z.string(),
|
|
38
|
+
});
|
|
39
|
+
export const create_password_reset_Body = z.object({
|
|
40
|
+
email: z.string().email(),
|
|
41
|
+
destination_url: z.string().url(),
|
|
42
|
+
client_id: z.string(),
|
|
43
|
+
client_secret: z.string(),
|
|
44
|
+
});
|
|
45
|
+
export const SimpleErrors = z.object({ errors: z.array(z.string()) });
|
|
46
|
+
export const update_password_reset_Body = z.object({
|
|
47
|
+
password: z.string(),
|
|
48
|
+
password_confirmation: z.string(),
|
|
49
|
+
client_id: z.string(),
|
|
50
|
+
client_secret: z.string(),
|
|
51
|
+
});
|
|
52
|
+
export const Type = z.enum([
|
|
53
|
+
"action",
|
|
54
|
+
"case",
|
|
55
|
+
"case_activity_log",
|
|
56
|
+
"field",
|
|
57
|
+
"field_setting",
|
|
58
|
+
"list",
|
|
59
|
+
"list_saved_filter",
|
|
60
|
+
"note",
|
|
61
|
+
"notification",
|
|
62
|
+
"push_subscription",
|
|
63
|
+
"role",
|
|
64
|
+
"saved_filter",
|
|
65
|
+
"sso_config",
|
|
66
|
+
"tag",
|
|
67
|
+
"task",
|
|
68
|
+
"team",
|
|
69
|
+
"team_member",
|
|
70
|
+
"template",
|
|
71
|
+
"user",
|
|
72
|
+
]);
|
|
73
|
+
export const InternalEventAction = z
|
|
74
|
+
.object({
|
|
75
|
+
name: z.string(),
|
|
76
|
+
updated_at: z.string().datetime({ offset: true }),
|
|
77
|
+
created_at: z.string().datetime({ offset: true }),
|
|
78
|
+
active: z.boolean().default(false),
|
|
79
|
+
trigger_id: z.string().uuid(),
|
|
80
|
+
action_type: z.literal("internal_event"),
|
|
81
|
+
config: z.object({
|
|
82
|
+
resource: Type,
|
|
83
|
+
actions: z.array(z.enum(["create", "update", "destroy"])),
|
|
84
|
+
conditions: z
|
|
85
|
+
.array(z.object({ matcher: z.string(), value: z.unknown() }))
|
|
86
|
+
.optional(),
|
|
87
|
+
}),
|
|
88
|
+
})
|
|
89
|
+
.partial();
|
|
90
|
+
export const CalculationAction = z
|
|
91
|
+
.object({
|
|
92
|
+
name: z.string(),
|
|
93
|
+
updated_at: z.string().datetime({ offset: true }),
|
|
94
|
+
created_at: z.string().datetime({ offset: true }),
|
|
95
|
+
active: z.boolean().default(false),
|
|
96
|
+
trigger_id: z.string().uuid(),
|
|
97
|
+
action_type: z.literal("calculation"),
|
|
98
|
+
config: z.object({
|
|
99
|
+
fields: z.array(z.string()),
|
|
100
|
+
operation: z.enum(["sum", "average", "minimum", "maximum"]),
|
|
101
|
+
}),
|
|
102
|
+
})
|
|
103
|
+
.partial();
|
|
104
|
+
export const UpdateResourceAction = z
|
|
105
|
+
.object({
|
|
106
|
+
name: z.string(),
|
|
107
|
+
updated_at: z.string().datetime({ offset: true }),
|
|
108
|
+
created_at: z.string().datetime({ offset: true }),
|
|
109
|
+
active: z.boolean().default(false),
|
|
110
|
+
trigger_id: z.string().uuid(),
|
|
111
|
+
action_type: z.literal("update_resource"),
|
|
112
|
+
config: z.object({ field_to_update: z.string() }),
|
|
113
|
+
})
|
|
114
|
+
.partial();
|
|
115
|
+
export const CreateOrUpdateCaseAction = z
|
|
116
|
+
.object({
|
|
117
|
+
name: z.string(),
|
|
118
|
+
updated_at: z.string().datetime({ offset: true }),
|
|
119
|
+
created_at: z.string().datetime({ offset: true }),
|
|
120
|
+
active: z.boolean(),
|
|
121
|
+
trigger_id: z.string().uuid(),
|
|
122
|
+
action_type: z.literal("create_or_update_case"),
|
|
123
|
+
config: z.object({
|
|
124
|
+
identifying_fields: z.array(z.string()),
|
|
125
|
+
template_id: z.string().uuid(),
|
|
126
|
+
}),
|
|
127
|
+
})
|
|
128
|
+
.partial();
|
|
129
|
+
export const ActionAttributes = z.union([
|
|
130
|
+
InternalEventAction,
|
|
131
|
+
CalculationAction,
|
|
132
|
+
UpdateResourceAction,
|
|
133
|
+
CreateOrUpdateCaseAction,
|
|
134
|
+
]);
|
|
135
|
+
export const Links = z
|
|
136
|
+
.object({
|
|
137
|
+
self: z.string(),
|
|
138
|
+
current: z.string(),
|
|
139
|
+
prev: z.string(),
|
|
140
|
+
next: z.string(),
|
|
141
|
+
first: z.string(),
|
|
142
|
+
last: z.string(),
|
|
143
|
+
related: z.string(),
|
|
144
|
+
})
|
|
145
|
+
.partial();
|
|
146
|
+
export const ActionRelationshipTrigger = z
|
|
147
|
+
.object({
|
|
148
|
+
data: z.union([
|
|
149
|
+
z.null(),
|
|
150
|
+
z.object({ type: z.literal("action"), id: z.string().uuid() }).partial(),
|
|
151
|
+
]),
|
|
152
|
+
links: Links,
|
|
153
|
+
})
|
|
154
|
+
.partial();
|
|
155
|
+
export const ActionRelationships = z
|
|
156
|
+
.object({ trigger: ActionRelationshipTrigger })
|
|
157
|
+
.partial();
|
|
158
|
+
export const ActionData = z.object({
|
|
159
|
+
type: z.literal("action"),
|
|
160
|
+
id: z.string().uuid(),
|
|
161
|
+
attributes: ActionAttributes,
|
|
162
|
+
relationships: ActionRelationships,
|
|
163
|
+
});
|
|
164
|
+
export const Meta = z
|
|
165
|
+
.object({
|
|
166
|
+
pagination: z
|
|
167
|
+
.object({
|
|
168
|
+
current: z.number().int(),
|
|
169
|
+
records: z.number().int(),
|
|
170
|
+
prev: z.number().int(),
|
|
171
|
+
next: z.number().int(),
|
|
172
|
+
first: z.number().int(),
|
|
173
|
+
last: z.number().int(),
|
|
174
|
+
})
|
|
175
|
+
.partial(),
|
|
176
|
+
})
|
|
177
|
+
.partial();
|
|
178
|
+
export const ActionInclusion = z.object({
|
|
179
|
+
type: z.literal("action"),
|
|
180
|
+
id: z.string().uuid(),
|
|
181
|
+
attributes: ActionAttributes,
|
|
182
|
+
relationships: ActionRelationshipTrigger.optional(),
|
|
183
|
+
});
|
|
184
|
+
export const ActionInclusions = z.array(ActionInclusion);
|
|
185
|
+
export const Actions = z.object({
|
|
186
|
+
data: z.array(ActionData),
|
|
187
|
+
meta: Meta,
|
|
188
|
+
links: Links,
|
|
189
|
+
included: ActionInclusions.optional(),
|
|
190
|
+
});
|
|
191
|
+
export const Errors = z.object({
|
|
192
|
+
errors: z.array(z.object({
|
|
193
|
+
status: z.string(),
|
|
194
|
+
title: z.string(),
|
|
195
|
+
detail: z.union([z.null(), z.string()]),
|
|
196
|
+
code: z.union([z.null(), z.string()]).optional(),
|
|
197
|
+
source: z.union([
|
|
198
|
+
z.null(),
|
|
199
|
+
z.object({ pointer: z.string(), parameter: z.string() }).partial(),
|
|
200
|
+
]),
|
|
201
|
+
})),
|
|
202
|
+
});
|
|
203
|
+
export const Action = z.object({
|
|
204
|
+
data: ActionData,
|
|
205
|
+
links: Links,
|
|
206
|
+
included: ActionInclusions.optional(),
|
|
207
|
+
});
|
|
208
|
+
export const ActionErrorAttributes = z
|
|
209
|
+
.object({
|
|
210
|
+
error: z.string(),
|
|
211
|
+
arguments: z.object({}).partial(),
|
|
212
|
+
backtrace: z.array(z.string()),
|
|
213
|
+
created_at: z.string().datetime({ offset: true }),
|
|
214
|
+
updated_at: z.string().datetime({ offset: true }),
|
|
215
|
+
})
|
|
216
|
+
.partial();
|
|
217
|
+
export const ActionErrorRelationships = z
|
|
218
|
+
.object({ action: ActionRelationshipTrigger })
|
|
219
|
+
.partial();
|
|
220
|
+
export const ActionErrorData = z.object({
|
|
221
|
+
type: z.literal("action_error"),
|
|
222
|
+
id: z.string().uuid(),
|
|
223
|
+
attributes: ActionErrorAttributes,
|
|
224
|
+
relationships: ActionErrorRelationships.optional(),
|
|
225
|
+
});
|
|
226
|
+
export const ActionErrorInclusions = z.array(ActionInclusion);
|
|
227
|
+
export const ActionErrors = z.object({
|
|
228
|
+
data: z.array(ActionErrorData),
|
|
229
|
+
meta: Meta,
|
|
230
|
+
links: Links,
|
|
231
|
+
included: ActionErrorInclusions.optional(),
|
|
232
|
+
});
|
|
233
|
+
export const ActionError = z.object({
|
|
234
|
+
data: ActionErrorData,
|
|
235
|
+
links: Links,
|
|
236
|
+
included: ActionErrorInclusions.optional(),
|
|
237
|
+
});
|
|
238
|
+
export const ActionTypeInputsOutputs = z.array(z.enum(["resource_instance", "value", "attributes"]));
|
|
239
|
+
export const ActionTypeAttributes = z
|
|
240
|
+
.object({
|
|
241
|
+
display_name: z.string(),
|
|
242
|
+
inputs: ActionTypeInputsOutputs,
|
|
243
|
+
outputs: ActionTypeInputsOutputs,
|
|
244
|
+
is_trigger: z.boolean(),
|
|
245
|
+
})
|
|
246
|
+
.partial();
|
|
247
|
+
export const ActionTypeData = z.object({
|
|
248
|
+
type: z.literal("action_type"),
|
|
249
|
+
id: z.string(),
|
|
250
|
+
attributes: ActionTypeAttributes,
|
|
251
|
+
});
|
|
252
|
+
export const ActionTypes = z.object({
|
|
253
|
+
data: z.array(ActionTypeData),
|
|
254
|
+
meta: Meta,
|
|
255
|
+
links: Links,
|
|
256
|
+
});
|
|
257
|
+
export const ActionType = z.object({ data: ActionTypeData, links: Links });
|
|
258
|
+
export const AdministrableResources = z.array(z.enum(["user", "field", "template", "saved_filter", "list", "tag", "role"]));
|
|
259
|
+
export const RoleActions = z.enum(["create", "read", "update", "delete"]);
|
|
260
|
+
export const UserAttributes = z
|
|
261
|
+
.object({
|
|
262
|
+
name: z.string(),
|
|
263
|
+
email: z.string().email(),
|
|
264
|
+
active: z.boolean().default(true),
|
|
265
|
+
administrable_resources: AdministrableResources,
|
|
266
|
+
availability: z.enum(["online", "offline"]).default("offline"),
|
|
267
|
+
status: z.union([z.string(), z.null()]),
|
|
268
|
+
root: z.boolean(),
|
|
269
|
+
initials: z.string(),
|
|
270
|
+
short_name: z.string(),
|
|
271
|
+
role_ids: z.array(z.string().uuid()),
|
|
272
|
+
permissions: z.object({
|
|
273
|
+
action: z.array(RoleActions),
|
|
274
|
+
saved_filter: z.array(RoleActions),
|
|
275
|
+
list_saved_filter: z.array(RoleActions),
|
|
276
|
+
case: z.array(RoleActions),
|
|
277
|
+
case_activity_log: z.array(RoleActions),
|
|
278
|
+
task: z.array(RoleActions),
|
|
279
|
+
user: z.array(RoleActions),
|
|
280
|
+
team: z.array(RoleActions),
|
|
281
|
+
team_member: z.array(RoleActions),
|
|
282
|
+
tag: z.array(RoleActions),
|
|
283
|
+
list: z.array(RoleActions),
|
|
284
|
+
role: z.array(RoleActions),
|
|
285
|
+
field: z.array(RoleActions),
|
|
286
|
+
template: z.array(RoleActions),
|
|
287
|
+
sso_config: z.array(RoleActions),
|
|
288
|
+
field_setting: z.array(RoleActions),
|
|
289
|
+
note: z.array(RoleActions),
|
|
290
|
+
notification: z.array(RoleActions),
|
|
291
|
+
push_subscription: z.array(RoleActions),
|
|
292
|
+
}),
|
|
293
|
+
team_ids: z.array(z.string().uuid()),
|
|
294
|
+
created_at: z.string().datetime({ offset: true }),
|
|
295
|
+
updated_at: z.string().datetime({ offset: true }),
|
|
296
|
+
unread_notification_count: z.number().int(),
|
|
297
|
+
})
|
|
298
|
+
.partial();
|
|
299
|
+
export const TasksRelationship = z
|
|
300
|
+
.object({
|
|
301
|
+
data: z.array(z.object({ type: z.literal("task"), id: z.string().uuid() }).partial()),
|
|
302
|
+
})
|
|
303
|
+
.partial();
|
|
304
|
+
export const TeamsRelationship = z
|
|
305
|
+
.object({
|
|
306
|
+
data: z.array(z.object({ type: z.literal("team"), id: z.string().uuid() }).partial()),
|
|
307
|
+
links: Links,
|
|
308
|
+
})
|
|
309
|
+
.partial();
|
|
310
|
+
export const TeamMembersRelationship = z
|
|
311
|
+
.object({
|
|
312
|
+
data: z.array(z
|
|
313
|
+
.object({ type: z.literal("team_member"), id: z.string().uuid() })
|
|
314
|
+
.partial()),
|
|
315
|
+
links: Links,
|
|
316
|
+
})
|
|
317
|
+
.partial();
|
|
318
|
+
export const RolesRelationship = z
|
|
319
|
+
.object({
|
|
320
|
+
data: z.array(z.object({ type: z.literal("role"), id: z.string().uuid() }).partial()),
|
|
321
|
+
links: Links,
|
|
322
|
+
})
|
|
323
|
+
.partial();
|
|
324
|
+
export const NotificationsRelationship = z
|
|
325
|
+
.object({
|
|
326
|
+
data: z.array(z
|
|
327
|
+
.object({ type: z.literal("notification"), id: z.string().uuid() })
|
|
328
|
+
.partial()),
|
|
329
|
+
})
|
|
330
|
+
.partial();
|
|
331
|
+
export const UserRelationships = z
|
|
332
|
+
.object({
|
|
333
|
+
tasks: TasksRelationship,
|
|
334
|
+
teams: TeamsRelationship,
|
|
335
|
+
team_members: TeamMembersRelationship,
|
|
336
|
+
roles: RolesRelationship,
|
|
337
|
+
assigned_notifications: NotificationsRelationship,
|
|
338
|
+
})
|
|
339
|
+
.partial();
|
|
340
|
+
export const UserData = z.object({
|
|
341
|
+
type: z.literal("user"),
|
|
342
|
+
id: z.string().uuid(),
|
|
343
|
+
attributes: UserAttributes,
|
|
344
|
+
relationships: UserRelationships,
|
|
345
|
+
});
|
|
346
|
+
export const Currency = z.union([z.null(), z.literal("GBP")]);
|
|
347
|
+
export const DisplayCurrencySubunit = z.boolean();
|
|
348
|
+
export const StructuredValues = z.array(z
|
|
349
|
+
.object({
|
|
350
|
+
field_key: z.string(),
|
|
351
|
+
field_type: z.enum([
|
|
352
|
+
"string",
|
|
353
|
+
"integer",
|
|
354
|
+
"boolean",
|
|
355
|
+
"date",
|
|
356
|
+
"time",
|
|
357
|
+
"datetime",
|
|
358
|
+
"float",
|
|
359
|
+
"resource",
|
|
360
|
+
"composite",
|
|
361
|
+
]),
|
|
362
|
+
field_display_name: z.string(),
|
|
363
|
+
value: z.union([
|
|
364
|
+
z.boolean(),
|
|
365
|
+
z.number(),
|
|
366
|
+
z.string(),
|
|
367
|
+
z.null(),
|
|
368
|
+
z.number(),
|
|
369
|
+
z.array(z.any()),
|
|
370
|
+
z.object({
|
|
371
|
+
type: z.string(),
|
|
372
|
+
id: z.union([z.string(), z.null()]),
|
|
373
|
+
display_attribute: z.unknown().optional(),
|
|
374
|
+
secondary_display_attribute: z.unknown().optional(),
|
|
375
|
+
}),
|
|
376
|
+
]),
|
|
377
|
+
currency: Currency,
|
|
378
|
+
display_currency_subunit: DisplayCurrencySubunit.default(false),
|
|
379
|
+
})
|
|
380
|
+
.partial());
|
|
381
|
+
export const TaskAttributes = z
|
|
382
|
+
.object({
|
|
383
|
+
case_id: z.string().uuid(),
|
|
384
|
+
template_id: z.string().uuid(),
|
|
385
|
+
title: z.string(),
|
|
386
|
+
description: z.union([z.string(), z.null()]),
|
|
387
|
+
status: z.enum([
|
|
388
|
+
"pending",
|
|
389
|
+
"accepted",
|
|
390
|
+
"in_progress",
|
|
391
|
+
"completed",
|
|
392
|
+
"cancelled",
|
|
393
|
+
]),
|
|
394
|
+
tag_ids: z.array(z.string().uuid()),
|
|
395
|
+
values: z.object({}).partial(),
|
|
396
|
+
structured_values: StructuredValues,
|
|
397
|
+
start_at: z.string().datetime({ offset: true }),
|
|
398
|
+
end_at: z.union([z.null(), z.string()]),
|
|
399
|
+
user_ids: z.array(z.string().uuid()),
|
|
400
|
+
team_ids: z.array(z.string().uuid()),
|
|
401
|
+
created_at: z.string().datetime({ offset: true }),
|
|
402
|
+
updated_at: z.string().datetime({ offset: true }),
|
|
403
|
+
cancellation_reason: z.union([z.string(), z.null()]),
|
|
404
|
+
})
|
|
405
|
+
.partial();
|
|
406
|
+
export const CaseRelationship = z
|
|
407
|
+
.object({
|
|
408
|
+
data: z
|
|
409
|
+
.object({ type: z.literal("case"), id: z.string().uuid() })
|
|
410
|
+
.partial(),
|
|
411
|
+
links: Links,
|
|
412
|
+
})
|
|
413
|
+
.partial();
|
|
414
|
+
export const FieldsRelationship = z
|
|
415
|
+
.object({
|
|
416
|
+
data: z.array(z.object({ type: z.literal("field"), id: z.string().uuid() }).partial()),
|
|
417
|
+
links: Links,
|
|
418
|
+
})
|
|
419
|
+
.partial();
|
|
420
|
+
export const NotesRelationship = z
|
|
421
|
+
.object({
|
|
422
|
+
data: z.array(z.object({ type: z.literal("note"), id: z.string().uuid() }).partial()),
|
|
423
|
+
})
|
|
424
|
+
.partial();
|
|
425
|
+
export const UsersRelationship = z
|
|
426
|
+
.object({
|
|
427
|
+
data: z.array(z.object({ type: z.literal("user"), id: z.string().uuid() }).partial()),
|
|
428
|
+
links: Links,
|
|
429
|
+
})
|
|
430
|
+
.partial();
|
|
431
|
+
export const TagsRelationship = z
|
|
432
|
+
.object({
|
|
433
|
+
data: z.array(z.object({ type: z.literal("tag"), id: z.string().uuid() }).partial()),
|
|
434
|
+
})
|
|
435
|
+
.partial();
|
|
436
|
+
export const TemplateRelationship = z
|
|
437
|
+
.object({
|
|
438
|
+
data: z
|
|
439
|
+
.object({ type: z.literal("template"), id: z.string().uuid() })
|
|
440
|
+
.partial(),
|
|
441
|
+
links: Links,
|
|
442
|
+
})
|
|
443
|
+
.partial();
|
|
444
|
+
export const VersionsRelationship = z
|
|
445
|
+
.object({
|
|
446
|
+
data: z.array(z.object({ type: z.literal("version"), id: z.string().uuid() }).partial()),
|
|
447
|
+
})
|
|
448
|
+
.partial();
|
|
449
|
+
export const TaskRelationships = z
|
|
450
|
+
.object({
|
|
451
|
+
case: CaseRelationship,
|
|
452
|
+
fields: FieldsRelationship,
|
|
453
|
+
notes: NotesRelationship,
|
|
454
|
+
users: UsersRelationship,
|
|
455
|
+
tags: TagsRelationship,
|
|
456
|
+
teams: TeamsRelationship,
|
|
457
|
+
template: TemplateRelationship,
|
|
458
|
+
versions: VersionsRelationship,
|
|
459
|
+
})
|
|
460
|
+
.partial();
|
|
461
|
+
export const TaskInclusion = z.object({
|
|
462
|
+
type: z.literal("task"),
|
|
463
|
+
id: z.string().uuid(),
|
|
464
|
+
attributes: TaskAttributes,
|
|
465
|
+
relationships: TaskRelationships,
|
|
466
|
+
});
|
|
467
|
+
export const TeamAttributes = z
|
|
468
|
+
.object({
|
|
469
|
+
name: z.string(),
|
|
470
|
+
description: z.union([z.string(), z.null()]),
|
|
471
|
+
team_ids: z.array(z.string().uuid()),
|
|
472
|
+
created_at: z.string().datetime({ offset: true }),
|
|
473
|
+
updated_at: z.string().datetime({ offset: true }),
|
|
474
|
+
})
|
|
475
|
+
.partial();
|
|
476
|
+
export const TeamRelationships = z
|
|
477
|
+
.object({
|
|
478
|
+
users: UsersRelationship,
|
|
479
|
+
team_members: TeamMembersRelationship,
|
|
480
|
+
roles: RolesRelationship,
|
|
481
|
+
tasks: TasksRelationship,
|
|
482
|
+
})
|
|
483
|
+
.partial();
|
|
484
|
+
export const TeamInclusion = z.object({
|
|
485
|
+
type: z.literal("team"),
|
|
486
|
+
id: z.string().uuid(),
|
|
487
|
+
attributes: TeamAttributes,
|
|
488
|
+
relationships: TeamRelationships.optional(),
|
|
489
|
+
});
|
|
490
|
+
export const TeamMemberAttributes = z
|
|
491
|
+
.object({
|
|
492
|
+
team_id: z.string().uuid(),
|
|
493
|
+
user_id: z.string().uuid(),
|
|
494
|
+
availability: z.enum(["available", "unavailable"]).default("available"),
|
|
495
|
+
notifications: z.enum(["on", "off"]).default("on"),
|
|
496
|
+
created_at: z.string().datetime({ offset: true }),
|
|
497
|
+
updated_at: z.string().datetime({ offset: true }),
|
|
498
|
+
})
|
|
499
|
+
.partial();
|
|
500
|
+
export const TeamRelationship = z
|
|
501
|
+
.object({
|
|
502
|
+
data: z
|
|
503
|
+
.object({ type: z.literal("team"), id: z.string().uuid() })
|
|
504
|
+
.partial(),
|
|
505
|
+
links: Links,
|
|
506
|
+
})
|
|
507
|
+
.partial();
|
|
508
|
+
export const UserRelationship = z
|
|
509
|
+
.object({
|
|
510
|
+
data: z
|
|
511
|
+
.object({ type: z.literal("user"), id: z.string().uuid() })
|
|
512
|
+
.partial(),
|
|
513
|
+
links: Links,
|
|
514
|
+
})
|
|
515
|
+
.partial();
|
|
516
|
+
export const TeamMemberRelationships = z
|
|
517
|
+
.object({ team: TeamRelationship, user: UserRelationship })
|
|
518
|
+
.partial();
|
|
519
|
+
export const TeamMemberInclusion = z.object({
|
|
520
|
+
type: z.literal("team_member"),
|
|
521
|
+
id: z.string().uuid(),
|
|
522
|
+
attributes: TeamMemberAttributes,
|
|
523
|
+
relationships: TeamMemberRelationships.optional(),
|
|
524
|
+
});
|
|
525
|
+
export const SavedFilterCondition = z.object({
|
|
526
|
+
matcher: z.string(),
|
|
527
|
+
attribute: z.string().optional(),
|
|
528
|
+
value: z.union([z.string(), z.array(z.string())]).optional(),
|
|
529
|
+
});
|
|
530
|
+
export const RoleConfig = z.array(z.object({
|
|
531
|
+
type: z.enum(["permit", "deny"]),
|
|
532
|
+
resource: Type,
|
|
533
|
+
actions: z.array(z.enum(["create", "delete", "read", "update"])),
|
|
534
|
+
conditions: z.array(SavedFilterCondition).optional(),
|
|
535
|
+
}));
|
|
536
|
+
export const RoleAttributes = z
|
|
537
|
+
.object({
|
|
538
|
+
name: z.string(),
|
|
539
|
+
created_at: z.string().datetime({ offset: true }),
|
|
540
|
+
updated_at: z.string().datetime({ offset: true }),
|
|
541
|
+
user_ids: z.array(z.string().uuid()),
|
|
542
|
+
administrable_resources: AdministrableResources,
|
|
543
|
+
config: RoleConfig,
|
|
544
|
+
})
|
|
545
|
+
.partial();
|
|
546
|
+
export const FieldSettingsRelationship = z
|
|
547
|
+
.object({
|
|
548
|
+
data: z.array(z
|
|
549
|
+
.object({ type: z.literal("field_setting"), id: z.string().uuid() })
|
|
550
|
+
.partial()),
|
|
551
|
+
})
|
|
552
|
+
.partial();
|
|
553
|
+
export const RoleRelationships = z
|
|
554
|
+
.object({
|
|
555
|
+
field_settings: FieldSettingsRelationship,
|
|
556
|
+
teams: TeamsRelationship,
|
|
557
|
+
users: UsersRelationship,
|
|
558
|
+
})
|
|
559
|
+
.partial();
|
|
560
|
+
export const RoleInclusion = z.object({
|
|
561
|
+
type: z.literal("role"),
|
|
562
|
+
id: z.string().uuid(),
|
|
563
|
+
attributes: RoleAttributes,
|
|
564
|
+
relationships: RoleRelationships.optional(),
|
|
565
|
+
});
|
|
566
|
+
export const NotificationAttributes = z
|
|
567
|
+
.object({
|
|
568
|
+
message: z.string(),
|
|
569
|
+
body: z.string(),
|
|
570
|
+
read: z.boolean(),
|
|
571
|
+
created_at: z.string().datetime({ offset: true }),
|
|
572
|
+
updated_at: z.string().datetime({ offset: true }),
|
|
573
|
+
})
|
|
574
|
+
.partial();
|
|
575
|
+
export const TaskRelationship = z
|
|
576
|
+
.object({
|
|
577
|
+
data: z
|
|
578
|
+
.object({ type: z.literal("task"), id: z.string().uuid() })
|
|
579
|
+
.partial(),
|
|
580
|
+
links: Links,
|
|
581
|
+
})
|
|
582
|
+
.partial();
|
|
583
|
+
export const NotificationRelationships = z
|
|
584
|
+
.object({
|
|
585
|
+
subject: TaskRelationship,
|
|
586
|
+
assignee: UserRelationship,
|
|
587
|
+
assigner: UserRelationship,
|
|
588
|
+
})
|
|
589
|
+
.partial();
|
|
590
|
+
export const NotificationInclusion = z.object({
|
|
591
|
+
type: z.literal("notification"),
|
|
592
|
+
id: z.string().uuid(),
|
|
593
|
+
attributes: NotificationAttributes,
|
|
594
|
+
relationships: NotificationRelationships,
|
|
595
|
+
});
|
|
596
|
+
export const UserInclusions = z.array(z.union([
|
|
597
|
+
TaskInclusion,
|
|
598
|
+
TeamInclusion,
|
|
599
|
+
TeamMemberInclusion,
|
|
600
|
+
RoleInclusion,
|
|
601
|
+
NotificationInclusion,
|
|
602
|
+
]));
|
|
603
|
+
export const Users = z.object({
|
|
604
|
+
data: z.array(UserData),
|
|
605
|
+
meta: Meta,
|
|
606
|
+
links: Links,
|
|
607
|
+
included: UserInclusions.optional(),
|
|
608
|
+
});
|
|
609
|
+
export const name = z.string();
|
|
610
|
+
export const email = z.string();
|
|
611
|
+
export const active = z.boolean();
|
|
612
|
+
export const status = z.union([z.string(), z.null()]);
|
|
613
|
+
export const root = z.boolean();
|
|
614
|
+
export const role_ids = z.array(z.string().uuid());
|
|
615
|
+
export const UserCreateAttributes = z.object({
|
|
616
|
+
name: name,
|
|
617
|
+
email: email.email(),
|
|
618
|
+
password: z.union([z.string(), z.null()]).optional(),
|
|
619
|
+
password_required: z.boolean().optional().default(false),
|
|
620
|
+
send_invitation: z.boolean().optional().default(false),
|
|
621
|
+
invitation_destination_url: z.string().url().optional(),
|
|
622
|
+
set_password_destination_url: z.string().url().optional(),
|
|
623
|
+
active: active.optional().default(true),
|
|
624
|
+
availability: z.enum(["online", "offline"]).optional().default("offline"),
|
|
625
|
+
status: status.optional(),
|
|
626
|
+
root: root.optional(),
|
|
627
|
+
role_ids: role_ids.optional(),
|
|
628
|
+
});
|
|
629
|
+
export const User = z.object({
|
|
630
|
+
data: UserData,
|
|
631
|
+
links: Links,
|
|
632
|
+
included: UserInclusions.optional(),
|
|
633
|
+
});
|
|
634
|
+
export const UserUpdateAttributes = z
|
|
635
|
+
.object({
|
|
636
|
+
name: name,
|
|
637
|
+
email: email.email(),
|
|
638
|
+
password: z.union([z.string(), z.null()]),
|
|
639
|
+
active: active.default(true),
|
|
640
|
+
availability: z.enum(["online", "offline"]).default("offline"),
|
|
641
|
+
status: status,
|
|
642
|
+
root: root,
|
|
643
|
+
role_ids: role_ids,
|
|
644
|
+
})
|
|
645
|
+
.partial();
|
|
646
|
+
export const update_user_Body = z.object({
|
|
647
|
+
data: z.object({ attributes: UserUpdateAttributes }),
|
|
648
|
+
});
|
|
649
|
+
export const TeamData = z.object({
|
|
650
|
+
type: z.literal("team"),
|
|
651
|
+
id: z.string().uuid(),
|
|
652
|
+
attributes: TeamAttributes,
|
|
653
|
+
relationships: TeamRelationships,
|
|
654
|
+
links: Links.optional(),
|
|
655
|
+
});
|
|
656
|
+
export const UserInclusion = z.object({
|
|
657
|
+
type: z.literal("user"),
|
|
658
|
+
id: z.string().uuid(),
|
|
659
|
+
attributes: UserAttributes,
|
|
660
|
+
relationships: UserRelationships.optional(),
|
|
661
|
+
});
|
|
662
|
+
export const TeamInclusions = z.array(z.union([RoleInclusion, TaskInclusion, TeamMemberInclusion, UserInclusion]));
|
|
663
|
+
export const Teams = z.object({
|
|
664
|
+
data: z.array(TeamData),
|
|
665
|
+
meta: Meta,
|
|
666
|
+
links: Links,
|
|
667
|
+
included: TeamInclusions.optional(),
|
|
668
|
+
});
|
|
669
|
+
export const description = z.union([z.string(), z.null()]);
|
|
670
|
+
export const TeamCreateAttributes = z.object({
|
|
671
|
+
name: name,
|
|
672
|
+
description: description.optional(),
|
|
673
|
+
});
|
|
674
|
+
export const Team = z.object({
|
|
675
|
+
data: TeamData,
|
|
676
|
+
links: Links,
|
|
677
|
+
included: TeamInclusions.optional(),
|
|
678
|
+
});
|
|
679
|
+
export const TeamMemberData = z.object({
|
|
680
|
+
type: z.literal("team_member"),
|
|
681
|
+
id: z.string().uuid(),
|
|
682
|
+
attributes: TeamMemberAttributes,
|
|
683
|
+
relationships: z
|
|
684
|
+
.object({ team: TeamRelationship, user: UserRelationship })
|
|
685
|
+
.partial(),
|
|
686
|
+
});
|
|
687
|
+
export const TeamMembers = z.object({
|
|
688
|
+
data: z.array(TeamMemberData),
|
|
689
|
+
meta: Meta,
|
|
690
|
+
links: Links,
|
|
691
|
+
included: z.array(z.union([UserInclusion, TeamInclusion])).optional(),
|
|
692
|
+
});
|
|
693
|
+
export const team_id = z.string();
|
|
694
|
+
export const user_id = z.string();
|
|
695
|
+
export const availability = z.enum(["available", "unavailable"]);
|
|
696
|
+
export const notifications = z.enum(["on", "off"]);
|
|
697
|
+
export const TeamMemberCreateAttributes = z.object({
|
|
698
|
+
team_id: team_id.uuid(),
|
|
699
|
+
user_id: user_id.uuid(),
|
|
700
|
+
availability: availability.optional().default("available"),
|
|
701
|
+
notifications: notifications.optional().default("on"),
|
|
702
|
+
});
|
|
703
|
+
export const TeamMember = z.object({
|
|
704
|
+
data: TeamMemberData,
|
|
705
|
+
links: Links,
|
|
706
|
+
included: z.array(z.union([UserInclusion, TeamInclusion])).optional(),
|
|
707
|
+
});
|
|
708
|
+
export const TagAttributes = z
|
|
709
|
+
.object({
|
|
710
|
+
name: z.string(),
|
|
711
|
+
color: z.enum([
|
|
712
|
+
"red",
|
|
713
|
+
"green",
|
|
714
|
+
"blue",
|
|
715
|
+
"yellow",
|
|
716
|
+
"purple",
|
|
717
|
+
"orange",
|
|
718
|
+
"pink",
|
|
719
|
+
"brown",
|
|
720
|
+
"grey",
|
|
721
|
+
"black",
|
|
722
|
+
"white",
|
|
723
|
+
]),
|
|
724
|
+
active: z.boolean(),
|
|
725
|
+
created_at: z.string().datetime({ offset: true }),
|
|
726
|
+
updated_at: z.string().datetime({ offset: true }),
|
|
727
|
+
})
|
|
728
|
+
.partial();
|
|
729
|
+
export const CasesRelationship = z
|
|
730
|
+
.object({
|
|
731
|
+
data: z.array(z.object({ type: z.literal("case"), id: z.string().uuid() }).partial()),
|
|
732
|
+
})
|
|
733
|
+
.partial();
|
|
734
|
+
export const TagData = z.object({
|
|
735
|
+
type: z.literal("tag"),
|
|
736
|
+
id: z.string().uuid(),
|
|
737
|
+
attributes: TagAttributes,
|
|
738
|
+
relationships: z.object({ cases: CasesRelationship }).partial().optional(),
|
|
739
|
+
links: Links.optional(),
|
|
740
|
+
});
|
|
741
|
+
export const CaseAttributes = z
|
|
742
|
+
.object({
|
|
743
|
+
template_id: z.string().uuid(),
|
|
744
|
+
name: z.union([z.null(), z.string()]),
|
|
745
|
+
tag_ids: z.array(z.string().uuid()),
|
|
746
|
+
values: z.object({}).partial(),
|
|
747
|
+
structured_values: StructuredValues,
|
|
748
|
+
created_at: z.string().datetime({ offset: true }),
|
|
749
|
+
updated_at: z.string().datetime({ offset: true }),
|
|
750
|
+
})
|
|
751
|
+
.partial();
|
|
752
|
+
export const CaseRelationships = z
|
|
753
|
+
.object({
|
|
754
|
+
template: TemplateRelationship,
|
|
755
|
+
tags: TagsRelationship,
|
|
756
|
+
fields: FieldsRelationship,
|
|
757
|
+
field_settings: FieldSettingsRelationship,
|
|
758
|
+
versions: VersionsRelationship,
|
|
759
|
+
notes: NotesRelationship,
|
|
760
|
+
tasks: TasksRelationship,
|
|
761
|
+
})
|
|
762
|
+
.partial();
|
|
763
|
+
export const CaseInclusion = z.object({
|
|
764
|
+
type: z.literal("case"),
|
|
765
|
+
id: z.string().uuid(),
|
|
766
|
+
attributes: CaseAttributes,
|
|
767
|
+
relationships: CaseRelationships.optional(),
|
|
768
|
+
});
|
|
769
|
+
export const TagInclusions = z.array(CaseInclusion);
|
|
770
|
+
export const Tags = z.object({
|
|
771
|
+
data: z.array(TagData),
|
|
772
|
+
meta: Meta,
|
|
773
|
+
links: Links,
|
|
774
|
+
included: TagInclusions.optional(),
|
|
775
|
+
});
|
|
776
|
+
export const color = z.enum([
|
|
777
|
+
"red",
|
|
778
|
+
"green",
|
|
779
|
+
"blue",
|
|
780
|
+
"yellow",
|
|
781
|
+
"purple",
|
|
782
|
+
"orange",
|
|
783
|
+
"pink",
|
|
784
|
+
"brown",
|
|
785
|
+
"grey",
|
|
786
|
+
"black",
|
|
787
|
+
"white",
|
|
788
|
+
]);
|
|
789
|
+
export const TagCreateAttributes = z.object({
|
|
790
|
+
name: name,
|
|
791
|
+
color: color,
|
|
792
|
+
active: active.optional(),
|
|
793
|
+
});
|
|
794
|
+
export const Tag = z.object({
|
|
795
|
+
data: TagData,
|
|
796
|
+
links: Links,
|
|
797
|
+
included: TagInclusions.optional(),
|
|
798
|
+
});
|
|
799
|
+
export const ListAttributes = z
|
|
800
|
+
.object({
|
|
801
|
+
title: z.string(),
|
|
802
|
+
slug: z.string(),
|
|
803
|
+
description: z.union([z.string(), z.null()]),
|
|
804
|
+
list_type: z.enum(["list", "task", "case"]),
|
|
805
|
+
created_at: z.string().datetime({ offset: true }),
|
|
806
|
+
updated_at: z.string().datetime({ offset: true }),
|
|
807
|
+
admin_id: z.string().uuid(),
|
|
808
|
+
active: z.boolean().default(true),
|
|
809
|
+
position: z.number().int().default(0),
|
|
810
|
+
rules: z.array(SavedFilterCondition),
|
|
811
|
+
order: z.array(z
|
|
812
|
+
.object({ attribute: z.string(), direction: z.enum(["asc", "desc"]) })
|
|
813
|
+
.partial()),
|
|
814
|
+
filter_params: z.object({}).partial(),
|
|
815
|
+
sort_param: z.string(),
|
|
816
|
+
hidden_from_dashboard: z.boolean().default(false),
|
|
817
|
+
})
|
|
818
|
+
.partial();
|
|
819
|
+
export const ListsRelationship = z
|
|
820
|
+
.object({
|
|
821
|
+
data: z.array(z.object({ type: z.literal("list"), id: z.string().uuid() }).partial()),
|
|
822
|
+
links: Links,
|
|
823
|
+
})
|
|
824
|
+
.partial();
|
|
825
|
+
export const ListSavedFiltersRelationship = z
|
|
826
|
+
.object({
|
|
827
|
+
data: z.array(z
|
|
828
|
+
.object({ type: z.literal("list_saved_filter"), id: z.string().uuid() })
|
|
829
|
+
.partial()),
|
|
830
|
+
})
|
|
831
|
+
.partial();
|
|
832
|
+
export const SavedFiltersRelationship = z
|
|
833
|
+
.object({
|
|
834
|
+
data: z.array(z
|
|
835
|
+
.object({ type: z.literal("saved_filter"), id: z.string().uuid() })
|
|
836
|
+
.partial()),
|
|
837
|
+
})
|
|
838
|
+
.partial();
|
|
839
|
+
export const ListRelationships = z
|
|
840
|
+
.object({
|
|
841
|
+
admin: UserRelationship,
|
|
842
|
+
versions: VersionsRelationship,
|
|
843
|
+
cases: CasesRelationship,
|
|
844
|
+
tasks: TasksRelationship,
|
|
845
|
+
lists: ListsRelationship,
|
|
846
|
+
list_saved_filters: ListSavedFiltersRelationship,
|
|
847
|
+
saved_filters: SavedFiltersRelationship,
|
|
848
|
+
})
|
|
849
|
+
.partial();
|
|
850
|
+
export const ListData = z.object({
|
|
851
|
+
type: z.literal("list"),
|
|
852
|
+
id: z.string().uuid(),
|
|
853
|
+
attributes: ListAttributes,
|
|
854
|
+
relationships: ListRelationships,
|
|
855
|
+
});
|
|
856
|
+
export const FieldAttributes = z
|
|
857
|
+
.object({
|
|
858
|
+
name: z.string(),
|
|
859
|
+
key: z.string(),
|
|
860
|
+
field_type: z.enum([
|
|
861
|
+
"boolean",
|
|
862
|
+
"composite",
|
|
863
|
+
"date",
|
|
864
|
+
"datetime",
|
|
865
|
+
"float",
|
|
866
|
+
"integer",
|
|
867
|
+
"resource",
|
|
868
|
+
"string",
|
|
869
|
+
"time",
|
|
870
|
+
]),
|
|
871
|
+
display_field_type: z.enum([
|
|
872
|
+
"String",
|
|
873
|
+
"Integer",
|
|
874
|
+
"Boolean",
|
|
875
|
+
"Date",
|
|
876
|
+
"Time",
|
|
877
|
+
"Date and time",
|
|
878
|
+
"Float",
|
|
879
|
+
"Resource",
|
|
880
|
+
"Composite",
|
|
881
|
+
]),
|
|
882
|
+
title: z.union([z.string(), z.null()]),
|
|
883
|
+
description: z.union([z.string(), z.null()]),
|
|
884
|
+
read_only: z.boolean().default(false),
|
|
885
|
+
multiple: z.boolean().default(false),
|
|
886
|
+
case_quick_searchable: z.boolean().default(false),
|
|
887
|
+
task_quick_searchable: z.boolean().default(false),
|
|
888
|
+
uniqueness_scope: z.union([z.null(), z.enum(["global", "tasks", "cases"])]),
|
|
889
|
+
created_at: z.string().datetime({ offset: true }),
|
|
890
|
+
updated_at: z.string().datetime({ offset: true }),
|
|
891
|
+
spec: z
|
|
892
|
+
.object({
|
|
893
|
+
maximum: z.union([z.number(), z.number(), z.string(), z.null()]),
|
|
894
|
+
minimum: z.union([z.number(), z.number(), z.string(), z.null()]),
|
|
895
|
+
enum: z.union([
|
|
896
|
+
z.null(),
|
|
897
|
+
z.array(z.union([z.string(), z.number(), z.number()])),
|
|
898
|
+
]),
|
|
899
|
+
resource: Type,
|
|
900
|
+
conditions: z.union([z.null(), z.array(SavedFilterCondition)]),
|
|
901
|
+
multi_line: z.boolean(),
|
|
902
|
+
rounding: z.union([
|
|
903
|
+
z.null(),
|
|
904
|
+
z.union([z.literal(10), z.literal(100), z.literal(1000)]),
|
|
905
|
+
]),
|
|
906
|
+
index_path: z.string(),
|
|
907
|
+
display_attribute: z.string(),
|
|
908
|
+
secondary_display_attribute: z.string(),
|
|
909
|
+
currency: Currency,
|
|
910
|
+
display_currency_subunit: DisplayCurrencySubunit.default(false),
|
|
911
|
+
field_keys: z.array(z.string()).min(2),
|
|
912
|
+
})
|
|
913
|
+
.partial(),
|
|
914
|
+
suggested_operators: z.array(z.object({
|
|
915
|
+
id: z.enum([
|
|
916
|
+
"eq",
|
|
917
|
+
"ne",
|
|
918
|
+
"gt",
|
|
919
|
+
"gte",
|
|
920
|
+
"lt",
|
|
921
|
+
"lte",
|
|
922
|
+
"in",
|
|
923
|
+
"not_in",
|
|
924
|
+
"present",
|
|
925
|
+
"blank",
|
|
926
|
+
]),
|
|
927
|
+
display_name: z.string(),
|
|
928
|
+
requires_value: z.boolean(),
|
|
929
|
+
multiple_values: z.boolean(),
|
|
930
|
+
suggested_values: z.union([
|
|
931
|
+
z.null(),
|
|
932
|
+
z.array(z.union([z.string(), z.number(), z.number(), z.boolean()])),
|
|
933
|
+
]),
|
|
934
|
+
})),
|
|
935
|
+
suggested_constraints: z.array(z.object({
|
|
936
|
+
id: z.enum(["eq", "in", "gte", "lte", "present", "blank"]),
|
|
937
|
+
display_name: z.string(),
|
|
938
|
+
requires_value: z.boolean(),
|
|
939
|
+
multiple_values: z.boolean(),
|
|
940
|
+
suggested_values: z.union([
|
|
941
|
+
z.null(),
|
|
942
|
+
z.array(z.union([z.string(), z.number(), z.number(), z.boolean()])),
|
|
943
|
+
]),
|
|
944
|
+
})),
|
|
945
|
+
})
|
|
946
|
+
.partial();
|
|
947
|
+
export const TemplatesRelationship = z
|
|
948
|
+
.object({
|
|
949
|
+
data: z.array(z
|
|
950
|
+
.object({ type: z.literal("template"), id: z.string().uuid() })
|
|
951
|
+
.partial()),
|
|
952
|
+
links: Links,
|
|
953
|
+
})
|
|
954
|
+
.partial();
|
|
955
|
+
export const relationships = z
|
|
956
|
+
.object({
|
|
957
|
+
constituent_fields: FieldsRelationship,
|
|
958
|
+
field_settings: FieldSettingsRelationship,
|
|
959
|
+
templates: TemplatesRelationship,
|
|
960
|
+
versions: VersionsRelationship,
|
|
961
|
+
})
|
|
962
|
+
.partial();
|
|
963
|
+
export const FieldInclusion = z.object({
|
|
964
|
+
type: z.literal("field"),
|
|
965
|
+
id: z.string().uuid(),
|
|
966
|
+
attributes: FieldAttributes,
|
|
967
|
+
relationships: relationships,
|
|
968
|
+
});
|
|
969
|
+
export const FieldSettingAttributes = z
|
|
970
|
+
.object({
|
|
971
|
+
field_id: z.string().uuid(),
|
|
972
|
+
template_id: z.string().uuid(),
|
|
973
|
+
role_ids: z.array(z.string().uuid()),
|
|
974
|
+
required: z.boolean(),
|
|
975
|
+
position: z.number().int(),
|
|
976
|
+
meta: z
|
|
977
|
+
.object({
|
|
978
|
+
default: z.union([
|
|
979
|
+
z.string(),
|
|
980
|
+
z.number(),
|
|
981
|
+
z.number(),
|
|
982
|
+
z.boolean(),
|
|
983
|
+
z.array(z.union([z.string(), z.number(), z.number()])),
|
|
984
|
+
]),
|
|
985
|
+
restrictions: z.array(z.object({
|
|
986
|
+
operator: z.enum([
|
|
987
|
+
"eq",
|
|
988
|
+
"ne",
|
|
989
|
+
"gt",
|
|
990
|
+
"gte",
|
|
991
|
+
"lt",
|
|
992
|
+
"lte",
|
|
993
|
+
"in",
|
|
994
|
+
"not_in",
|
|
995
|
+
"present",
|
|
996
|
+
"blank",
|
|
997
|
+
]),
|
|
998
|
+
value: z
|
|
999
|
+
.union([
|
|
1000
|
+
z.string(),
|
|
1001
|
+
z.number(),
|
|
1002
|
+
z.number(),
|
|
1003
|
+
z.boolean(),
|
|
1004
|
+
z.array(z.union([z.string(), z.number(), z.number()])),
|
|
1005
|
+
])
|
|
1006
|
+
.optional(),
|
|
1007
|
+
target_field: z.string(),
|
|
1008
|
+
target_field_constraints: z
|
|
1009
|
+
.object({
|
|
1010
|
+
eq: z.union([z.string(), z.number(), z.number(), z.boolean()]),
|
|
1011
|
+
in: z.array(z.union([z.string(), z.number(), z.number()])),
|
|
1012
|
+
gte: z.union([z.number(), z.number()]),
|
|
1013
|
+
lte: z.union([z.number(), z.number()]),
|
|
1014
|
+
present: z.boolean(),
|
|
1015
|
+
blank: z.boolean(),
|
|
1016
|
+
})
|
|
1017
|
+
.partial(),
|
|
1018
|
+
})),
|
|
1019
|
+
})
|
|
1020
|
+
.partial(),
|
|
1021
|
+
created_at: z.string().datetime({ offset: true }),
|
|
1022
|
+
updated_at: z.string().datetime({ offset: true }),
|
|
1023
|
+
})
|
|
1024
|
+
.partial();
|
|
1025
|
+
export const FieldRelationship = z
|
|
1026
|
+
.object({
|
|
1027
|
+
data: z
|
|
1028
|
+
.object({ type: z.literal("field"), id: z.string().uuid() })
|
|
1029
|
+
.partial(),
|
|
1030
|
+
links: Links,
|
|
1031
|
+
})
|
|
1032
|
+
.partial();
|
|
1033
|
+
export const FieldSettingInclusion = z.object({
|
|
1034
|
+
type: z.literal("field_setting"),
|
|
1035
|
+
id: z.string().uuid(),
|
|
1036
|
+
attributes: FieldSettingAttributes,
|
|
1037
|
+
relationships: relationships,
|
|
1038
|
+
});
|
|
1039
|
+
export const ListInclusion = z.object({
|
|
1040
|
+
type: z.literal("list"),
|
|
1041
|
+
id: z.string().uuid(),
|
|
1042
|
+
attributes: ListAttributes,
|
|
1043
|
+
relationships: ListRelationships,
|
|
1044
|
+
});
|
|
1045
|
+
export const ListSavedFilterAttributes = z
|
|
1046
|
+
.object({
|
|
1047
|
+
position: z.number().int(),
|
|
1048
|
+
list_id: z.string().uuid(),
|
|
1049
|
+
saved_filter_id: z.string().uuid(),
|
|
1050
|
+
created_at: z.string().datetime({ offset: true }),
|
|
1051
|
+
updated_at: z.string().datetime({ offset: true }),
|
|
1052
|
+
})
|
|
1053
|
+
.partial();
|
|
1054
|
+
export const ListRelationship = z
|
|
1055
|
+
.object({
|
|
1056
|
+
data: z
|
|
1057
|
+
.object({ type: z.literal("list"), id: z.string().uuid() })
|
|
1058
|
+
.partial(),
|
|
1059
|
+
links: Links,
|
|
1060
|
+
})
|
|
1061
|
+
.partial();
|
|
1062
|
+
export const SavedFilterRelationship = z
|
|
1063
|
+
.object({
|
|
1064
|
+
data: z
|
|
1065
|
+
.object({ type: z.literal("saved_filter"), id: z.string().uuid() })
|
|
1066
|
+
.partial(),
|
|
1067
|
+
links: Links,
|
|
1068
|
+
})
|
|
1069
|
+
.partial();
|
|
1070
|
+
export const ListSavedFilterRelationships = z
|
|
1071
|
+
.object({ list: ListRelationship, saved_filter: SavedFilterRelationship })
|
|
1072
|
+
.partial();
|
|
1073
|
+
export const ListSavedFilterInclusion = z.object({
|
|
1074
|
+
type: z.literal("list_saved_filter"),
|
|
1075
|
+
id: z.string().uuid(),
|
|
1076
|
+
attributes: ListSavedFilterAttributes,
|
|
1077
|
+
relationships: ListSavedFilterRelationships.optional(),
|
|
1078
|
+
});
|
|
1079
|
+
export const NoteAttributes = z
|
|
1080
|
+
.object({
|
|
1081
|
+
title: z.string(),
|
|
1082
|
+
body: z.union([z.string(), z.null()]),
|
|
1083
|
+
created_at: z.string().datetime({ offset: true }),
|
|
1084
|
+
updated_at: z.string().datetime({ offset: true }),
|
|
1085
|
+
})
|
|
1086
|
+
.partial();
|
|
1087
|
+
export const NotableType = z.enum(["case", "task"]);
|
|
1088
|
+
export const NotableRelationship = z
|
|
1089
|
+
.object({
|
|
1090
|
+
data: z.object({ type: NotableType, id: z.string().uuid() }).partial(),
|
|
1091
|
+
links: Links,
|
|
1092
|
+
})
|
|
1093
|
+
.partial();
|
|
1094
|
+
export const NoteRelationships = z
|
|
1095
|
+
.object({ notable: NotableRelationship })
|
|
1096
|
+
.partial();
|
|
1097
|
+
export const NoteInclusion = z.object({
|
|
1098
|
+
type: z.literal("note"),
|
|
1099
|
+
id: z.string().uuid(),
|
|
1100
|
+
attributes: NoteAttributes,
|
|
1101
|
+
relationships: NoteRelationships,
|
|
1102
|
+
});
|
|
1103
|
+
export const SavedFilterAttributes = z
|
|
1104
|
+
.object({
|
|
1105
|
+
saved_filter_type: z.enum(["task", "list", "case"]),
|
|
1106
|
+
name: z.string(),
|
|
1107
|
+
description: z.union([z.null(), z.string()]),
|
|
1108
|
+
data: z.array(SavedFilterCondition),
|
|
1109
|
+
filter_params: z.object({}).partial(),
|
|
1110
|
+
created_at: z.string().datetime({ offset: true }),
|
|
1111
|
+
updated_at: z.string().datetime({ offset: true }),
|
|
1112
|
+
})
|
|
1113
|
+
.partial();
|
|
1114
|
+
export const SavedFilterRelationships = z
|
|
1115
|
+
.object({
|
|
1116
|
+
lists: ListsRelationship,
|
|
1117
|
+
list_saved_filters: ListSavedFiltersRelationship,
|
|
1118
|
+
})
|
|
1119
|
+
.partial();
|
|
1120
|
+
export const SavedFilterInclusion = z.object({
|
|
1121
|
+
type: z.literal("saved_filter"),
|
|
1122
|
+
id: z.string().uuid(),
|
|
1123
|
+
attributes: SavedFilterAttributes,
|
|
1124
|
+
relationships: SavedFilterRelationships,
|
|
1125
|
+
});
|
|
1126
|
+
export const TagInclusion = z.object({
|
|
1127
|
+
type: z.literal("tag"),
|
|
1128
|
+
id: z.string().uuid(),
|
|
1129
|
+
attributes: TagAttributes,
|
|
1130
|
+
relationships: relationships,
|
|
1131
|
+
});
|
|
1132
|
+
export const SimpleTemplateName = z.object({ key: z.string() }).partial();
|
|
1133
|
+
export const InterpolatedTemplateName = z
|
|
1134
|
+
.object({ interpolated_name: z.string() })
|
|
1135
|
+
.partial();
|
|
1136
|
+
export const TemplateAttributes = z
|
|
1137
|
+
.object({
|
|
1138
|
+
name: z.string(),
|
|
1139
|
+
description: z.union([z.string(), z.null()]),
|
|
1140
|
+
template_type: z.enum(["case", "task"]),
|
|
1141
|
+
active: z.boolean().default(true),
|
|
1142
|
+
schema: z
|
|
1143
|
+
.object({
|
|
1144
|
+
name: z.union([z.null(), SimpleTemplateName, InterpolatedTemplateName]),
|
|
1145
|
+
})
|
|
1146
|
+
.partial(),
|
|
1147
|
+
created_at: z.string().datetime({ offset: true }),
|
|
1148
|
+
updated_at: z.string().datetime({ offset: true }),
|
|
1149
|
+
})
|
|
1150
|
+
.partial();
|
|
1151
|
+
export const TemplateInclusion = z.object({
|
|
1152
|
+
type: z.literal("template"),
|
|
1153
|
+
id: z.string().uuid(),
|
|
1154
|
+
attributes: TemplateAttributes,
|
|
1155
|
+
relationships: relationships,
|
|
1156
|
+
});
|
|
1157
|
+
export const VersionAttributes = z.object({
|
|
1158
|
+
event: z.enum(["create", "update", "destroy"]),
|
|
1159
|
+
user_type: z.union([z.literal("user"), z.null()]),
|
|
1160
|
+
user_id: z.union([z.string(), z.null()]),
|
|
1161
|
+
created_at: z.string().datetime({ offset: true }),
|
|
1162
|
+
});
|
|
1163
|
+
export const VersionInclusion = z.object({
|
|
1164
|
+
type: z.literal("version"),
|
|
1165
|
+
id: z.string().uuid(),
|
|
1166
|
+
attributes: VersionAttributes,
|
|
1167
|
+
});
|
|
1168
|
+
export const ListInclusions = z.array(z.union([
|
|
1169
|
+
CaseInclusion,
|
|
1170
|
+
FieldInclusion,
|
|
1171
|
+
FieldSettingInclusion,
|
|
1172
|
+
ListInclusion,
|
|
1173
|
+
ListSavedFilterInclusion,
|
|
1174
|
+
NoteInclusion,
|
|
1175
|
+
RoleInclusion,
|
|
1176
|
+
SavedFilterInclusion,
|
|
1177
|
+
TagInclusion,
|
|
1178
|
+
TaskInclusion,
|
|
1179
|
+
TeamInclusion,
|
|
1180
|
+
TeamMemberInclusion,
|
|
1181
|
+
TemplateInclusion,
|
|
1182
|
+
UserInclusion,
|
|
1183
|
+
VersionInclusion,
|
|
1184
|
+
]));
|
|
1185
|
+
export const Lists = z.object({
|
|
1186
|
+
data: z.array(ListData),
|
|
1187
|
+
meta: Meta,
|
|
1188
|
+
links: Links,
|
|
1189
|
+
included: ListInclusions.optional(),
|
|
1190
|
+
});
|
|
1191
|
+
export const title = z.string();
|
|
1192
|
+
export const slug = z.string();
|
|
1193
|
+
export const list_type = z.enum(["list", "task", "case"]);
|
|
1194
|
+
export const admin_id = z.string();
|
|
1195
|
+
export const position = z.number();
|
|
1196
|
+
export const rules = z.array(SavedFilterCondition);
|
|
1197
|
+
export const order = z.array(z
|
|
1198
|
+
.object({ attribute: z.string(), direction: z.enum(["asc", "desc"]) })
|
|
1199
|
+
.partial());
|
|
1200
|
+
export const hidden_from_dashboard = z.boolean();
|
|
1201
|
+
export const ListCreateAttributes = z.object({
|
|
1202
|
+
title: title,
|
|
1203
|
+
slug: slug.optional(),
|
|
1204
|
+
description: description.optional(),
|
|
1205
|
+
list_type: list_type,
|
|
1206
|
+
admin_id: admin_id.uuid().optional(),
|
|
1207
|
+
active: active.optional().default(true),
|
|
1208
|
+
position: position.int().optional().default(0),
|
|
1209
|
+
rules: rules.optional(),
|
|
1210
|
+
order: order.optional(),
|
|
1211
|
+
hidden_from_dashboard: hidden_from_dashboard.optional().default(false),
|
|
1212
|
+
});
|
|
1213
|
+
export const create_list_Body = z.object({
|
|
1214
|
+
data: z.object({ attributes: ListCreateAttributes }),
|
|
1215
|
+
});
|
|
1216
|
+
export const List = z.object({
|
|
1217
|
+
data: ListData,
|
|
1218
|
+
links: Links,
|
|
1219
|
+
included: ListInclusions.optional(),
|
|
1220
|
+
});
|
|
1221
|
+
export const SamlConfig = z.object({
|
|
1222
|
+
sp_entity_id: z.string(),
|
|
1223
|
+
idp_metadata_url: z.string(),
|
|
1224
|
+
idp_sso_service_url: z.string(),
|
|
1225
|
+
});
|
|
1226
|
+
export const OidcConfig = z.object({
|
|
1227
|
+
client_id: z.string(),
|
|
1228
|
+
secret: z.string(),
|
|
1229
|
+
authorization_endpoint: z.string(),
|
|
1230
|
+
token_endpoint: z.string(),
|
|
1231
|
+
userinfo_endpoint: z.string(),
|
|
1232
|
+
});
|
|
1233
|
+
export const SSOConfigAttributes = z
|
|
1234
|
+
.object({
|
|
1235
|
+
name: z.string(),
|
|
1236
|
+
slug: z.string(),
|
|
1237
|
+
provider: z.enum(["saml", "oidc"]).default("saml"),
|
|
1238
|
+
application_id: z.string().uuid(),
|
|
1239
|
+
brand: z.literal("microsoft"),
|
|
1240
|
+
config: z.union([SamlConfig, OidcConfig]),
|
|
1241
|
+
exchange_uri: z.string().url(),
|
|
1242
|
+
created_at: z.string().datetime({ offset: true }),
|
|
1243
|
+
updated_at: z.string().datetime({ offset: true }),
|
|
1244
|
+
})
|
|
1245
|
+
.partial();
|
|
1246
|
+
export const SSOConfigData = z.object({
|
|
1247
|
+
type: z.literal("sso_config"),
|
|
1248
|
+
id: z.string().uuid(),
|
|
1249
|
+
attributes: SSOConfigAttributes,
|
|
1250
|
+
});
|
|
1251
|
+
export const SSOConfigs = z.object({
|
|
1252
|
+
data: z.array(SSOConfigData),
|
|
1253
|
+
meta: Meta,
|
|
1254
|
+
links: Links,
|
|
1255
|
+
});
|
|
1256
|
+
export const provider = z.enum(["saml", "oidc"]);
|
|
1257
|
+
export const brand = z.literal("microsoft");
|
|
1258
|
+
export const config = z.union([SamlConfig, OidcConfig]);
|
|
1259
|
+
export const SSOConfigCreateAttributes = z.object({
|
|
1260
|
+
name: name,
|
|
1261
|
+
slug: slug.optional(),
|
|
1262
|
+
provider: provider.optional().default("saml"),
|
|
1263
|
+
brand: brand,
|
|
1264
|
+
config: config,
|
|
1265
|
+
});
|
|
1266
|
+
export const SSOConfig = z.object({ data: SSOConfigData, links: Links });
|
|
1267
|
+
export const RoleData = z.object({
|
|
1268
|
+
type: z.literal("role"),
|
|
1269
|
+
id: z.string().uuid(),
|
|
1270
|
+
attributes: RoleAttributes,
|
|
1271
|
+
relationships: RoleRelationships,
|
|
1272
|
+
});
|
|
1273
|
+
export const RoleInclusions = z.array(z.union([UserInclusion, TeamInclusion]));
|
|
1274
|
+
export const Roles = z.object({
|
|
1275
|
+
data: z.array(RoleData),
|
|
1276
|
+
meta: Meta,
|
|
1277
|
+
links: Links,
|
|
1278
|
+
included: RoleInclusions.optional(),
|
|
1279
|
+
});
|
|
1280
|
+
export const user_ids = z.array(z.string().uuid());
|
|
1281
|
+
export const RoleCreateAttributes = z.object({
|
|
1282
|
+
name: name,
|
|
1283
|
+
user_ids: user_ids.optional(),
|
|
1284
|
+
config: RoleConfig,
|
|
1285
|
+
administrable_resources: AdministrableResources.optional(),
|
|
1286
|
+
});
|
|
1287
|
+
export const Role = z.object({
|
|
1288
|
+
data: RoleData,
|
|
1289
|
+
links: Links,
|
|
1290
|
+
included: RoleInclusions.optional(),
|
|
1291
|
+
});
|
|
1292
|
+
export const FieldData = z.object({
|
|
1293
|
+
type: z.literal("field"),
|
|
1294
|
+
id: z.string().uuid(),
|
|
1295
|
+
attributes: FieldAttributes,
|
|
1296
|
+
relationships: z
|
|
1297
|
+
.object({
|
|
1298
|
+
constituent_fields: FieldsRelationship,
|
|
1299
|
+
field_settings: FieldSettingsRelationship,
|
|
1300
|
+
templates: TemplatesRelationship,
|
|
1301
|
+
versions: VersionsRelationship,
|
|
1302
|
+
})
|
|
1303
|
+
.partial(),
|
|
1304
|
+
});
|
|
1305
|
+
export const FieldInclusions = z.array(z.union([
|
|
1306
|
+
CaseInclusion,
|
|
1307
|
+
FieldInclusion,
|
|
1308
|
+
FieldSettingInclusion,
|
|
1309
|
+
NoteInclusion,
|
|
1310
|
+
TagInclusion,
|
|
1311
|
+
TaskInclusion,
|
|
1312
|
+
TemplateInclusion,
|
|
1313
|
+
VersionInclusion,
|
|
1314
|
+
]));
|
|
1315
|
+
export const Fields = z.object({
|
|
1316
|
+
data: z.array(FieldData),
|
|
1317
|
+
meta: Meta,
|
|
1318
|
+
links: Links,
|
|
1319
|
+
included: FieldInclusions.optional(),
|
|
1320
|
+
});
|
|
1321
|
+
export const key = z.string();
|
|
1322
|
+
export const field_type = z.enum([
|
|
1323
|
+
"boolean",
|
|
1324
|
+
"composite",
|
|
1325
|
+
"date",
|
|
1326
|
+
"datetime",
|
|
1327
|
+
"float",
|
|
1328
|
+
"integer",
|
|
1329
|
+
"resource",
|
|
1330
|
+
"string",
|
|
1331
|
+
"time",
|
|
1332
|
+
]);
|
|
1333
|
+
export const read_only = z.boolean();
|
|
1334
|
+
export const spec = z
|
|
1335
|
+
.object({
|
|
1336
|
+
maximum: z.union([z.number(), z.number(), z.string(), z.null()]),
|
|
1337
|
+
minimum: z.union([z.number(), z.number(), z.string(), z.null()]),
|
|
1338
|
+
enum: z.union([
|
|
1339
|
+
z.null(),
|
|
1340
|
+
z.array(z.union([z.string(), z.number(), z.number()])),
|
|
1341
|
+
]),
|
|
1342
|
+
resource: Type,
|
|
1343
|
+
conditions: z.union([z.null(), z.array(SavedFilterCondition)]),
|
|
1344
|
+
multi_line: z.boolean(),
|
|
1345
|
+
rounding: z.union([
|
|
1346
|
+
z.null(),
|
|
1347
|
+
z.union([z.literal(10), z.literal(100), z.literal(1000)]),
|
|
1348
|
+
]),
|
|
1349
|
+
index_path: z.string(),
|
|
1350
|
+
display_attribute: z.string(),
|
|
1351
|
+
secondary_display_attribute: z.string(),
|
|
1352
|
+
currency: Currency,
|
|
1353
|
+
display_currency_subunit: DisplayCurrencySubunit.default(false),
|
|
1354
|
+
field_keys: z.array(z.string()).min(2),
|
|
1355
|
+
})
|
|
1356
|
+
.partial();
|
|
1357
|
+
export const FieldCreateAttributes = z.object({
|
|
1358
|
+
name: name,
|
|
1359
|
+
key: key,
|
|
1360
|
+
field_type: field_type,
|
|
1361
|
+
title: title.optional(),
|
|
1362
|
+
description: description.optional(),
|
|
1363
|
+
read_only: read_only.optional().default(false),
|
|
1364
|
+
spec: spec.optional(),
|
|
1365
|
+
});
|
|
1366
|
+
export const Field = z.object({
|
|
1367
|
+
data: FieldData,
|
|
1368
|
+
links: Links,
|
|
1369
|
+
included: FieldInclusions.optional(),
|
|
1370
|
+
});
|
|
1371
|
+
export const FieldUpdateAttributes = z
|
|
1372
|
+
.object({
|
|
1373
|
+
name: name,
|
|
1374
|
+
field_type: field_type,
|
|
1375
|
+
title: title,
|
|
1376
|
+
description: description,
|
|
1377
|
+
read_only: read_only.default(false),
|
|
1378
|
+
spec: spec,
|
|
1379
|
+
})
|
|
1380
|
+
.partial();
|
|
1381
|
+
export const TemplateData = z.object({
|
|
1382
|
+
type: z.literal("template"),
|
|
1383
|
+
id: z.string().uuid(),
|
|
1384
|
+
attributes: TemplateAttributes,
|
|
1385
|
+
relationships: z
|
|
1386
|
+
.object({
|
|
1387
|
+
versions: VersionsRelationship,
|
|
1388
|
+
field_settings: FieldSettingsRelationship,
|
|
1389
|
+
cases: CasesRelationship,
|
|
1390
|
+
tasks: TasksRelationship,
|
|
1391
|
+
})
|
|
1392
|
+
.partial(),
|
|
1393
|
+
});
|
|
1394
|
+
export const TemplateInclusions = z.array(z.union([
|
|
1395
|
+
CaseInclusion,
|
|
1396
|
+
FieldInclusion,
|
|
1397
|
+
FieldSettingInclusion,
|
|
1398
|
+
NoteInclusion,
|
|
1399
|
+
TagInclusion,
|
|
1400
|
+
TaskInclusion,
|
|
1401
|
+
TemplateInclusion,
|
|
1402
|
+
VersionInclusion,
|
|
1403
|
+
]));
|
|
1404
|
+
export const Templates = z.object({
|
|
1405
|
+
data: z.array(TemplateData),
|
|
1406
|
+
meta: Meta,
|
|
1407
|
+
links: Links,
|
|
1408
|
+
included: TemplateInclusions.optional(),
|
|
1409
|
+
});
|
|
1410
|
+
export const template_type = z.enum(["case", "task"]);
|
|
1411
|
+
export const schema = z
|
|
1412
|
+
.object({
|
|
1413
|
+
name: z.union([z.null(), SimpleTemplateName, InterpolatedTemplateName]),
|
|
1414
|
+
})
|
|
1415
|
+
.partial();
|
|
1416
|
+
export const TemplateCreateAttributes = z.object({
|
|
1417
|
+
name: name,
|
|
1418
|
+
description: description.optional(),
|
|
1419
|
+
template_type: template_type,
|
|
1420
|
+
active: active.optional().default(true),
|
|
1421
|
+
schema: schema.optional(),
|
|
1422
|
+
});
|
|
1423
|
+
export const Template = z.object({
|
|
1424
|
+
data: TemplateData,
|
|
1425
|
+
links: Links,
|
|
1426
|
+
included: TemplateInclusions.optional(),
|
|
1427
|
+
});
|
|
1428
|
+
export const FieldSettingData = z.object({
|
|
1429
|
+
type: z.literal("field_setting"),
|
|
1430
|
+
id: z.string().uuid(),
|
|
1431
|
+
attributes: FieldSettingAttributes,
|
|
1432
|
+
relationships: z
|
|
1433
|
+
.object({
|
|
1434
|
+
field: FieldRelationship,
|
|
1435
|
+
roles: RolesRelationship,
|
|
1436
|
+
template: TemplateRelationship,
|
|
1437
|
+
versions: VersionsRelationship,
|
|
1438
|
+
})
|
|
1439
|
+
.partial(),
|
|
1440
|
+
});
|
|
1441
|
+
export const FieldSettingInclusions = z.array(z.union([
|
|
1442
|
+
CaseInclusion,
|
|
1443
|
+
FieldInclusion,
|
|
1444
|
+
FieldSettingInclusion,
|
|
1445
|
+
NoteInclusion,
|
|
1446
|
+
RoleInclusion,
|
|
1447
|
+
TagInclusion,
|
|
1448
|
+
TaskInclusion,
|
|
1449
|
+
TemplateInclusion,
|
|
1450
|
+
VersionInclusion,
|
|
1451
|
+
]));
|
|
1452
|
+
export const FieldSettings = z.object({
|
|
1453
|
+
data: z.array(FieldSettingData),
|
|
1454
|
+
meta: Meta,
|
|
1455
|
+
links: Links,
|
|
1456
|
+
included: FieldSettingInclusions.optional(),
|
|
1457
|
+
});
|
|
1458
|
+
export const field_id = z.string();
|
|
1459
|
+
export const template_id = z.string();
|
|
1460
|
+
export const required = z.boolean();
|
|
1461
|
+
export const meta = z
|
|
1462
|
+
.object({
|
|
1463
|
+
default: z.union([
|
|
1464
|
+
z.string(),
|
|
1465
|
+
z.number(),
|
|
1466
|
+
z.number(),
|
|
1467
|
+
z.boolean(),
|
|
1468
|
+
z.array(z.union([z.string(), z.number(), z.number()])),
|
|
1469
|
+
]),
|
|
1470
|
+
restrictions: z.array(z.object({
|
|
1471
|
+
operator: z.enum([
|
|
1472
|
+
"eq",
|
|
1473
|
+
"ne",
|
|
1474
|
+
"gt",
|
|
1475
|
+
"gte",
|
|
1476
|
+
"lt",
|
|
1477
|
+
"lte",
|
|
1478
|
+
"in",
|
|
1479
|
+
"not_in",
|
|
1480
|
+
"present",
|
|
1481
|
+
"blank",
|
|
1482
|
+
]),
|
|
1483
|
+
value: z
|
|
1484
|
+
.union([
|
|
1485
|
+
z.string(),
|
|
1486
|
+
z.number(),
|
|
1487
|
+
z.number(),
|
|
1488
|
+
z.boolean(),
|
|
1489
|
+
z.array(z.union([z.string(), z.number(), z.number()])),
|
|
1490
|
+
])
|
|
1491
|
+
.optional(),
|
|
1492
|
+
target_field: z.string(),
|
|
1493
|
+
target_field_constraints: z
|
|
1494
|
+
.object({
|
|
1495
|
+
eq: z.union([z.string(), z.number(), z.number(), z.boolean()]),
|
|
1496
|
+
in: z.array(z.union([z.string(), z.number(), z.number()])),
|
|
1497
|
+
gte: z.union([z.number(), z.number()]),
|
|
1498
|
+
lte: z.union([z.number(), z.number()]),
|
|
1499
|
+
present: z.boolean(),
|
|
1500
|
+
blank: z.boolean(),
|
|
1501
|
+
})
|
|
1502
|
+
.partial(),
|
|
1503
|
+
})),
|
|
1504
|
+
})
|
|
1505
|
+
.partial();
|
|
1506
|
+
export const FieldSettingCreateAttributes = z.object({
|
|
1507
|
+
field_id: field_id.uuid(),
|
|
1508
|
+
template_id: template_id.uuid(),
|
|
1509
|
+
role_ids: role_ids.optional(),
|
|
1510
|
+
required: required.optional(),
|
|
1511
|
+
position: position.int().optional(),
|
|
1512
|
+
meta: meta.optional(),
|
|
1513
|
+
});
|
|
1514
|
+
export const FieldSetting = z.object({
|
|
1515
|
+
data: FieldSettingData,
|
|
1516
|
+
links: Links,
|
|
1517
|
+
included: FieldSettingInclusions.optional(),
|
|
1518
|
+
});
|
|
1519
|
+
export const CaseActivityLogRelationships = z
|
|
1520
|
+
.object({ case: CaseRelationship, fields: FieldsRelationship })
|
|
1521
|
+
.partial();
|
|
1522
|
+
export const CaseActivityLogData = z.object({
|
|
1523
|
+
id: z.string().uuid(),
|
|
1524
|
+
type: z.literal("case_activity_log"),
|
|
1525
|
+
relationships: CaseActivityLogRelationships.optional(),
|
|
1526
|
+
attributes: z
|
|
1527
|
+
.object({
|
|
1528
|
+
user_name: z.string(),
|
|
1529
|
+
target_type: z.enum(["Case", "Note", "Tag", "Task"]),
|
|
1530
|
+
target_id: z.union([z.null(), z.string()]),
|
|
1531
|
+
target_name: z.string(),
|
|
1532
|
+
event_type: z.enum(["create", "destroy", "update"]),
|
|
1533
|
+
event_reason: z.union([z.null(), z.string()]),
|
|
1534
|
+
created_at: z.string().datetime({ offset: true }),
|
|
1535
|
+
changes: z.array(z
|
|
1536
|
+
.object({
|
|
1537
|
+
key: z.string(),
|
|
1538
|
+
field_id: z.union([z.null(), z.string()]),
|
|
1539
|
+
simple_type: z
|
|
1540
|
+
.enum([
|
|
1541
|
+
"array_of_strings",
|
|
1542
|
+
"string",
|
|
1543
|
+
"integer",
|
|
1544
|
+
"boolean",
|
|
1545
|
+
"date",
|
|
1546
|
+
"time",
|
|
1547
|
+
"datetime",
|
|
1548
|
+
"float",
|
|
1549
|
+
"resource",
|
|
1550
|
+
"array",
|
|
1551
|
+
"array_of_user_summaries",
|
|
1552
|
+
"array_of_team_summaries",
|
|
1553
|
+
])
|
|
1554
|
+
.default("string"),
|
|
1555
|
+
from: z.unknown(),
|
|
1556
|
+
to: z.unknown(),
|
|
1557
|
+
})
|
|
1558
|
+
.partial()),
|
|
1559
|
+
})
|
|
1560
|
+
.partial(),
|
|
1561
|
+
});
|
|
1562
|
+
export const CaseActivityLogInclusions = z.array(z.union([CaseInclusion, FieldInclusion]));
|
|
1563
|
+
export const CaseActivityLogs = z.object({
|
|
1564
|
+
meta: Meta,
|
|
1565
|
+
links: Links,
|
|
1566
|
+
data: z.array(CaseActivityLogData),
|
|
1567
|
+
included: CaseActivityLogInclusions.optional(),
|
|
1568
|
+
});
|
|
1569
|
+
export const CaseData = z.object({
|
|
1570
|
+
type: z.literal("case"),
|
|
1571
|
+
id: z.string().uuid(),
|
|
1572
|
+
attributes: CaseAttributes,
|
|
1573
|
+
relationships: CaseRelationships,
|
|
1574
|
+
});
|
|
1575
|
+
export const CaseInclusions = z.array(z.union([
|
|
1576
|
+
TemplateInclusion,
|
|
1577
|
+
CaseInclusion,
|
|
1578
|
+
FieldInclusion,
|
|
1579
|
+
FieldSettingInclusion,
|
|
1580
|
+
NoteInclusion,
|
|
1581
|
+
TagInclusion,
|
|
1582
|
+
TaskInclusion,
|
|
1583
|
+
VersionInclusion,
|
|
1584
|
+
]));
|
|
1585
|
+
export const Cases = z.object({
|
|
1586
|
+
data: z.array(CaseData),
|
|
1587
|
+
meta: Meta,
|
|
1588
|
+
links: Links,
|
|
1589
|
+
included: CaseInclusions.optional(),
|
|
1590
|
+
});
|
|
1591
|
+
export const tag_ids = z.array(z.string().uuid());
|
|
1592
|
+
export const values = z.object({}).partial();
|
|
1593
|
+
export const CaseCreateAttributes = z.object({
|
|
1594
|
+
template_id: template_id.uuid(),
|
|
1595
|
+
tag_ids: tag_ids.optional(),
|
|
1596
|
+
values: values.optional(),
|
|
1597
|
+
});
|
|
1598
|
+
export const Case = z.object({
|
|
1599
|
+
data: CaseData,
|
|
1600
|
+
links: Links,
|
|
1601
|
+
included: CaseInclusions.optional(),
|
|
1602
|
+
});
|
|
1603
|
+
export const ResourceAttributeAttributes = z.object({
|
|
1604
|
+
name: z.string(),
|
|
1605
|
+
is_used_in_actions: z.boolean(),
|
|
1606
|
+
is_used_in_fields: z.boolean(),
|
|
1607
|
+
is_used_in_roles: z.boolean(),
|
|
1608
|
+
is_used_in_admin: z.boolean(),
|
|
1609
|
+
key_attributes: z.array(z.object({
|
|
1610
|
+
name: z.string(),
|
|
1611
|
+
display_name: z.string(),
|
|
1612
|
+
type: z.enum([
|
|
1613
|
+
"id",
|
|
1614
|
+
"string",
|
|
1615
|
+
"jsonb",
|
|
1616
|
+
"text",
|
|
1617
|
+
"integer",
|
|
1618
|
+
"float",
|
|
1619
|
+
"boolean",
|
|
1620
|
+
"date",
|
|
1621
|
+
"datetime",
|
|
1622
|
+
"time",
|
|
1623
|
+
]),
|
|
1624
|
+
index_path: z.string(),
|
|
1625
|
+
enum: z.union([z.null(), z.array(z.string())]).optional(),
|
|
1626
|
+
display_attribute: z.string(),
|
|
1627
|
+
secondary_display_attribute: z.union([z.string(), z.null()]),
|
|
1628
|
+
sortable: z.boolean(),
|
|
1629
|
+
matchers: z.array(z.object({
|
|
1630
|
+
id: z.string(),
|
|
1631
|
+
value: z.string(),
|
|
1632
|
+
display_name: z.string(),
|
|
1633
|
+
requires_value: z.boolean(),
|
|
1634
|
+
multiple_values: z.boolean(),
|
|
1635
|
+
value_picker: z.boolean(),
|
|
1636
|
+
})),
|
|
1637
|
+
})),
|
|
1638
|
+
});
|
|
1639
|
+
export const ResourceAttributeData = z.object({
|
|
1640
|
+
type: z.literal("resource_attribute"),
|
|
1641
|
+
id: Type,
|
|
1642
|
+
attributes: ResourceAttributeAttributes,
|
|
1643
|
+
});
|
|
1644
|
+
export const ResourceAttributes = z.object({
|
|
1645
|
+
data: z.array(ResourceAttributeData),
|
|
1646
|
+
meta: Meta,
|
|
1647
|
+
links: Links,
|
|
1648
|
+
});
|
|
1649
|
+
export const ResourceAttribute = z.object({
|
|
1650
|
+
data: ResourceAttributeData,
|
|
1651
|
+
links: Links,
|
|
1652
|
+
});
|
|
1653
|
+
export const KnownConfigIDs = z.enum([
|
|
1654
|
+
"action_resources",
|
|
1655
|
+
"admin_resources",
|
|
1656
|
+
"db_reset",
|
|
1657
|
+
"field_resources",
|
|
1658
|
+
"field_setting_restriction_constraints",
|
|
1659
|
+
"field_setting_restriction_operators",
|
|
1660
|
+
"hide_tasks",
|
|
1661
|
+
"hl7_message_lifespan",
|
|
1662
|
+
"password_regex",
|
|
1663
|
+
"password_regex_message",
|
|
1664
|
+
"role_resources",
|
|
1665
|
+
"skip_rack_attack",
|
|
1666
|
+
"task_cancellation_reasons",
|
|
1667
|
+
"task_delete_reasons",
|
|
1668
|
+
"task_duration",
|
|
1669
|
+
"time_to_overdue",
|
|
1670
|
+
]);
|
|
1671
|
+
export const ConfigAttributes = z
|
|
1672
|
+
.object({
|
|
1673
|
+
value: z.union([
|
|
1674
|
+
z.null(),
|
|
1675
|
+
z.string(),
|
|
1676
|
+
z.boolean(),
|
|
1677
|
+
z.array(z.any()),
|
|
1678
|
+
z.number(),
|
|
1679
|
+
]),
|
|
1680
|
+
})
|
|
1681
|
+
.partial();
|
|
1682
|
+
export const ConfigData = z.object({
|
|
1683
|
+
type: z.literal("config"),
|
|
1684
|
+
id: KnownConfigIDs,
|
|
1685
|
+
attributes: ConfigAttributes,
|
|
1686
|
+
});
|
|
1687
|
+
export const Configs = z.object({
|
|
1688
|
+
data: z.array(ConfigData),
|
|
1689
|
+
meta: Meta,
|
|
1690
|
+
links: Links,
|
|
1691
|
+
});
|
|
1692
|
+
export const Config = z.object({ data: ConfigData, links: Links });
|
|
1693
|
+
export const SavedFilterData = z.object({
|
|
1694
|
+
type: z.literal("saved_filter"),
|
|
1695
|
+
id: z.string().uuid(),
|
|
1696
|
+
attributes: SavedFilterAttributes,
|
|
1697
|
+
relationships: SavedFilterRelationships,
|
|
1698
|
+
});
|
|
1699
|
+
export const SavedFilterInclusions = z.array(z.union([ListInclusion, ListSavedFilterInclusion]));
|
|
1700
|
+
export const SavedFilters = z.object({
|
|
1701
|
+
data: z.array(SavedFilterData),
|
|
1702
|
+
meta: Meta,
|
|
1703
|
+
links: Links,
|
|
1704
|
+
included: SavedFilterInclusions.optional(),
|
|
1705
|
+
});
|
|
1706
|
+
export const saved_filter_type = z.enum(["task", "list", "case"]);
|
|
1707
|
+
export const data = z.array(SavedFilterCondition);
|
|
1708
|
+
export const SavedFilterCreateAttributes = z.object({
|
|
1709
|
+
saved_filter_type: saved_filter_type,
|
|
1710
|
+
name: name,
|
|
1711
|
+
description: description.optional(),
|
|
1712
|
+
data: data,
|
|
1713
|
+
});
|
|
1714
|
+
export const SavedFilter = z.object({
|
|
1715
|
+
data: SavedFilterData,
|
|
1716
|
+
links: Links,
|
|
1717
|
+
included: SavedFilterInclusions.optional(),
|
|
1718
|
+
});
|
|
1719
|
+
export const ListSavedFilterData = z.object({
|
|
1720
|
+
type: z.literal("list_saved_filter"),
|
|
1721
|
+
id: z.string().uuid(),
|
|
1722
|
+
attributes: ListSavedFilterAttributes,
|
|
1723
|
+
relationships: ListSavedFilterRelationships,
|
|
1724
|
+
});
|
|
1725
|
+
export const ListSavedFilterInclusions = z.array(z.union([ListInclusion, SavedFilterInclusion]));
|
|
1726
|
+
export const ListSavedFilters = z.object({
|
|
1727
|
+
data: z.array(ListSavedFilterData),
|
|
1728
|
+
meta: Meta,
|
|
1729
|
+
links: Links,
|
|
1730
|
+
included: ListSavedFilterInclusions.optional(),
|
|
1731
|
+
});
|
|
1732
|
+
export const list_id = z.string();
|
|
1733
|
+
export const saved_filter_id = z.string();
|
|
1734
|
+
export const ListSavedFilterCreateAttributes = z.object({
|
|
1735
|
+
position: position.int().optional(),
|
|
1736
|
+
list_id: list_id.uuid(),
|
|
1737
|
+
saved_filter_id: saved_filter_id.uuid(),
|
|
1738
|
+
});
|
|
1739
|
+
export const ListSavedFilter = z.object({
|
|
1740
|
+
data: ListSavedFilterData,
|
|
1741
|
+
links: Links,
|
|
1742
|
+
included: ListSavedFilterInclusions.optional(),
|
|
1743
|
+
});
|
|
1744
|
+
export const TaskData = z.object({
|
|
1745
|
+
type: z.literal("task"),
|
|
1746
|
+
id: z.string().uuid(),
|
|
1747
|
+
attributes: TaskAttributes,
|
|
1748
|
+
relationships: TaskRelationships,
|
|
1749
|
+
});
|
|
1750
|
+
export const TaskInclusions = z.array(z.union([
|
|
1751
|
+
CaseInclusion,
|
|
1752
|
+
FieldInclusion,
|
|
1753
|
+
NoteInclusion,
|
|
1754
|
+
TeamInclusion,
|
|
1755
|
+
TemplateInclusion,
|
|
1756
|
+
UserInclusion,
|
|
1757
|
+
VersionInclusion,
|
|
1758
|
+
]));
|
|
1759
|
+
export const Tasks = z.object({
|
|
1760
|
+
data: z.array(TaskData),
|
|
1761
|
+
meta: Meta,
|
|
1762
|
+
links: Links,
|
|
1763
|
+
included: TaskInclusions.optional(),
|
|
1764
|
+
});
|
|
1765
|
+
export const case_id = z.string();
|
|
1766
|
+
export const start_at = z.string();
|
|
1767
|
+
export const end_at = z.union([z.null(), z.string()]);
|
|
1768
|
+
export const team_ids = z.array(z.string().uuid());
|
|
1769
|
+
export const cancellation_reason = z.union([z.string(), z.null()]);
|
|
1770
|
+
export const TaskCreateAttributes = z.object({
|
|
1771
|
+
case_id: case_id.uuid(),
|
|
1772
|
+
template_id: template_id.uuid(),
|
|
1773
|
+
title: title,
|
|
1774
|
+
description: description.optional(),
|
|
1775
|
+
status: status,
|
|
1776
|
+
tag_ids: tag_ids.optional(),
|
|
1777
|
+
values: values,
|
|
1778
|
+
start_at: start_at.datetime({ offset: true }),
|
|
1779
|
+
end_at: end_at.optional(),
|
|
1780
|
+
user_ids: user_ids.optional(),
|
|
1781
|
+
team_ids: team_ids.optional(),
|
|
1782
|
+
cancellation_reason: cancellation_reason.optional(),
|
|
1783
|
+
});
|
|
1784
|
+
export const Task = z.object({
|
|
1785
|
+
data: TaskData,
|
|
1786
|
+
links: Links,
|
|
1787
|
+
included: TaskInclusions.optional(),
|
|
1788
|
+
});
|
|
1789
|
+
export const NoteData = z.object({
|
|
1790
|
+
type: z.literal("note"),
|
|
1791
|
+
id: z.string().uuid(),
|
|
1792
|
+
attributes: NoteAttributes,
|
|
1793
|
+
relationships: NoteRelationships,
|
|
1794
|
+
});
|
|
1795
|
+
export const NoteInclusions = z.array(z.union([CaseInclusion, TaskInclusion]));
|
|
1796
|
+
export const Notes = z.object({
|
|
1797
|
+
data: z.array(NoteData),
|
|
1798
|
+
meta: Meta,
|
|
1799
|
+
links: Links,
|
|
1800
|
+
included: NoteInclusions.optional(),
|
|
1801
|
+
});
|
|
1802
|
+
export const body = z.union([z.string(), z.null()]);
|
|
1803
|
+
export const NoteCreateAttributes = z.object({
|
|
1804
|
+
notable_type: z.enum(["Case", "Task"]),
|
|
1805
|
+
notable_id: z.string().uuid(),
|
|
1806
|
+
title: title,
|
|
1807
|
+
body: body.optional(),
|
|
1808
|
+
});
|
|
1809
|
+
export const Note = z.object({
|
|
1810
|
+
data: NoteData,
|
|
1811
|
+
links: Links,
|
|
1812
|
+
included: NoteInclusions.optional(),
|
|
1813
|
+
});
|
|
1814
|
+
export const NotificationData = z.object({
|
|
1815
|
+
type: z.literal("notification"),
|
|
1816
|
+
id: z.string().uuid(),
|
|
1817
|
+
attributes: NotificationAttributes,
|
|
1818
|
+
relationships: NotificationRelationships,
|
|
1819
|
+
});
|
|
1820
|
+
export const NotificationInclusions = z.array(z.union([TaskInclusion, UserInclusion]));
|
|
1821
|
+
export const Notifications = z.object({
|
|
1822
|
+
data: z.array(NotificationData),
|
|
1823
|
+
meta: Meta,
|
|
1824
|
+
links: Links,
|
|
1825
|
+
included: NotificationInclusions.optional(),
|
|
1826
|
+
});
|
|
1827
|
+
export const Notification = z.object({
|
|
1828
|
+
data: NotificationData,
|
|
1829
|
+
links: Links,
|
|
1830
|
+
included: NotificationInclusions.optional(),
|
|
1831
|
+
});
|
|
1832
|
+
export const XsltMapAttributes = z
|
|
1833
|
+
.object({
|
|
1834
|
+
name: z.string(),
|
|
1835
|
+
xslt: z.string(),
|
|
1836
|
+
created_at: z.string().datetime({ offset: true }),
|
|
1837
|
+
updated_at: z.string().datetime({ offset: true }),
|
|
1838
|
+
})
|
|
1839
|
+
.partial();
|
|
1840
|
+
export const XsltMapData = z.object({
|
|
1841
|
+
id: z.string().uuid(),
|
|
1842
|
+
type: z.literal("xslt_map"),
|
|
1843
|
+
attributes: XsltMapAttributes,
|
|
1844
|
+
});
|
|
1845
|
+
export const XsltMaps = z.object({
|
|
1846
|
+
data: z.array(XsltMapData),
|
|
1847
|
+
links: Links,
|
|
1848
|
+
meta: Meta,
|
|
1849
|
+
});
|
|
1850
|
+
export const XsltMap = z.object({ data: XsltMapData, links: Links.optional() });
|
|
1851
|
+
export const preview_xslt_map_Body = z.object({
|
|
1852
|
+
data: z.object({
|
|
1853
|
+
attributes: z.union([
|
|
1854
|
+
z.object({ message: z.string() }),
|
|
1855
|
+
z.object({ message_id: z.string().uuid() }),
|
|
1856
|
+
]),
|
|
1857
|
+
}),
|
|
1858
|
+
});
|
|
1859
|
+
export const XsltMapPreview = z.object({
|
|
1860
|
+
data: z.object({
|
|
1861
|
+
attributes: z.object({ result: z.object({}).partial() }),
|
|
1862
|
+
}),
|
|
1863
|
+
links: Links.optional(),
|
|
1864
|
+
});
|
|
1865
|
+
export const HL7MessageAttributes = z
|
|
1866
|
+
.object({
|
|
1867
|
+
message_id: z.string(),
|
|
1868
|
+
body: z.string(),
|
|
1869
|
+
retain: z.boolean(),
|
|
1870
|
+
created_at: z.string().datetime({ offset: true }),
|
|
1871
|
+
updated_at: z.string().datetime({ offset: true }),
|
|
1872
|
+
})
|
|
1873
|
+
.partial();
|
|
1874
|
+
export const HL7MessageData = z.object({
|
|
1875
|
+
type: z.literal("hl7_message"),
|
|
1876
|
+
id: z.string().uuid(),
|
|
1877
|
+
attributes: HL7MessageAttributes,
|
|
1878
|
+
});
|
|
1879
|
+
export const HL7Messages = z.object({
|
|
1880
|
+
data: z.array(HL7MessageData),
|
|
1881
|
+
meta: Meta,
|
|
1882
|
+
links: Links,
|
|
1883
|
+
});
|
|
1884
|
+
export const HL7Message = z.object({ data: HL7MessageData, links: Links });
|
|
1885
|
+
export const HL7MessageUpdateAttributes = z
|
|
1886
|
+
.object({ retain: z.boolean() })
|
|
1887
|
+
.partial();
|
|
1888
|
+
export const update_hl7_message_Body = z.object({
|
|
1889
|
+
data: z.object({ attributes: HL7MessageUpdateAttributes }),
|
|
1890
|
+
});
|
|
1891
|
+
export const OperationTypes = z.enum([
|
|
1892
|
+
"actions",
|
|
1893
|
+
"cases",
|
|
1894
|
+
"field_settings",
|
|
1895
|
+
"fields",
|
|
1896
|
+
"list_saved_filters",
|
|
1897
|
+
"lists",
|
|
1898
|
+
"notes",
|
|
1899
|
+
"roles",
|
|
1900
|
+
"saved_filters",
|
|
1901
|
+
"sso_configs",
|
|
1902
|
+
"tags",
|
|
1903
|
+
"tasks",
|
|
1904
|
+
"team_members",
|
|
1905
|
+
"teams",
|
|
1906
|
+
"templates",
|
|
1907
|
+
"users",
|
|
1908
|
+
]);
|
|
1909
|
+
export const atomic_operations_Body = z
|
|
1910
|
+
.object({
|
|
1911
|
+
"atomic:operations": z.array(z.union([
|
|
1912
|
+
z.object({
|
|
1913
|
+
op: z.enum(["add", "update"]),
|
|
1914
|
+
data: z.object({
|
|
1915
|
+
type: OperationTypes,
|
|
1916
|
+
id: z.string().uuid().optional(),
|
|
1917
|
+
attributes: z.object({}).partial(),
|
|
1918
|
+
}),
|
|
1919
|
+
}),
|
|
1920
|
+
z.object({
|
|
1921
|
+
op: z.literal("remove"),
|
|
1922
|
+
ref: z.object({ type: OperationTypes, id: z.string().uuid() }),
|
|
1923
|
+
}),
|
|
1924
|
+
])),
|
|
1925
|
+
})
|
|
1926
|
+
.partial();
|
|
1927
|
+
export const create_csv_cases_Body = z
|
|
1928
|
+
.object({ file: z.instanceof(File), template_id: z.string().uuid() })
|
|
1929
|
+
.partial();
|
|
1930
|
+
export const SimpleError = z.object({ error: z.string() });
|
|
1931
|
+
export const PushSubscriptionAttributes = z.object({
|
|
1932
|
+
endpoint: z.string().url(),
|
|
1933
|
+
p256dh_key: z.string(),
|
|
1934
|
+
auth_key: z.string(),
|
|
1935
|
+
created_at: z.string().datetime({ offset: true }).optional(),
|
|
1936
|
+
updated_at: z.string().datetime({ offset: true }).optional(),
|
|
1937
|
+
});
|
|
1938
|
+
export const PushSubscriptionRelationships = z
|
|
1939
|
+
.object({ user: UserRelationship })
|
|
1940
|
+
.partial();
|
|
1941
|
+
export const PushSubscriptionData = z.object({
|
|
1942
|
+
type: z.literal("push_subscription"),
|
|
1943
|
+
id: z.string().uuid(),
|
|
1944
|
+
attributes: PushSubscriptionAttributes,
|
|
1945
|
+
relationships: PushSubscriptionRelationships,
|
|
1946
|
+
});
|
|
1947
|
+
export const PushSubscription = z.object({
|
|
1948
|
+
data: PushSubscriptionData,
|
|
1949
|
+
links: Links,
|
|
1950
|
+
});
|
|
1951
|
+
export const AuthApplicationAttributes = z
|
|
1952
|
+
.object({ name: z.string(), uid: z.string() })
|
|
1953
|
+
.partial();
|
|
1954
|
+
export const AuthApplicationData = z.object({
|
|
1955
|
+
type: z.literal("auth_application"),
|
|
1956
|
+
id: z.string(),
|
|
1957
|
+
attributes: AuthApplicationAttributes,
|
|
1958
|
+
});
|
|
1959
|
+
export const AuthApplications = z.object({
|
|
1960
|
+
data: z.array(AuthApplicationData),
|
|
1961
|
+
meta: Meta,
|
|
1962
|
+
links: Links,
|
|
1963
|
+
});
|
|
1964
|
+
export const AuthApplication = z.object({
|
|
1965
|
+
data: AuthApplicationData,
|
|
1966
|
+
links: Links,
|
|
1967
|
+
});
|
|
1968
|
+
export const CaseActivityLog = z.object({
|
|
1969
|
+
data: CaseActivityLogData,
|
|
1970
|
+
links: Links,
|
|
1971
|
+
included: CaseActivityLogInclusions.optional(),
|
|
1972
|
+
});
|
|
1973
|
+
export const ChannelList = z.enum([
|
|
1974
|
+
"ActionErrorsChannel",
|
|
1975
|
+
"ActionsChannel",
|
|
1976
|
+
"CaseActivityLogsChannel",
|
|
1977
|
+
"CasesChannel",
|
|
1978
|
+
"FieldSettingsChannel",
|
|
1979
|
+
"FieldsChannel",
|
|
1980
|
+
"ListSavedFiltersChannel",
|
|
1981
|
+
"ListsChannel",
|
|
1982
|
+
"NotesChannel",
|
|
1983
|
+
"RolesChannel",
|
|
1984
|
+
"SavedFiltersChannel",
|
|
1985
|
+
"SsoConfigsChannel",
|
|
1986
|
+
"TagsChannel",
|
|
1987
|
+
"TasksChannel",
|
|
1988
|
+
"TeamMembersChannel",
|
|
1989
|
+
"TeamsChannel",
|
|
1990
|
+
"TemplatesChannel",
|
|
1991
|
+
"UsersChannel",
|
|
1992
|
+
]);
|
|
1993
|
+
export const UserSpecificChannel = z.literal("UserSpecificChannel");
|
|
1994
|
+
export const BroadcastEvent = z.object({
|
|
1995
|
+
type: z.enum(["destroyed", "updated", "created"]),
|
|
1996
|
+
data: z.object({ id: z.string().uuid() }),
|
|
1997
|
+
});
|
|
1998
|
+
export const BroadcastToEvent = z.object({
|
|
1999
|
+
type: z.literal("unread_notification_count_change"),
|
|
2000
|
+
data: z.object({ unread_notification_count: z.number().int().gte(0) }),
|
|
2001
|
+
});
|
|
2002
|
+
export const IdAttribute = z.object({ id: z.string().uuid() }).partial();
|
|
2003
|
+
export const UserSummary = z
|
|
2004
|
+
.object({ id: z.string().uuid(), name: z.string(), email: z.string() })
|
|
2005
|
+
.partial();
|
|
2006
|
+
export const TeamSummary = z
|
|
2007
|
+
.object({ id: z.string().uuid(), name: z.string() })
|
|
2008
|
+
.partial();
|