@dsptch-work/api-client 0.19.0 → 0.20.0
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/CHANGELOG.md +28 -0
- package/dist/gen/index.d.ts +1 -1
- package/dist/gen/sdk.gen.d.ts +8 -8
- package/dist/gen/sdk.gen.js +8 -8
- package/dist/gen/types.gen.d.ts +525 -24
- package/dist/gen/zod.gen.d.ts +416 -55
- package/dist/gen/zod.gen.js +299 -43
- package/package.json +1 -1
package/dist/gen/zod.gen.js
CHANGED
|
@@ -8,7 +8,11 @@ export const zProblem = z.object({
|
|
|
8
8
|
title: z.string(),
|
|
9
9
|
status: z.int(),
|
|
10
10
|
detail: z.string(),
|
|
11
|
-
instance: z.url().optional()
|
|
11
|
+
instance: z.url().optional(),
|
|
12
|
+
errors: z.array(z.object({
|
|
13
|
+
detail: z.string(),
|
|
14
|
+
pointer: z.string().optional()
|
|
15
|
+
})).min(1).optional()
|
|
12
16
|
});
|
|
13
17
|
/**
|
|
14
18
|
* Error types
|
|
@@ -1024,7 +1028,7 @@ export const zTimecodeHistoryVersionObject = z.object({
|
|
|
1024
1028
|
* Request body for creating or updating a timecode; only `name` is required. On create, omitted fields take their model/DB defaults (noted per field). On update the request applies a bitemporal correction, so omitted fields keep the current version's values rather than reverting to defaults.
|
|
1025
1029
|
*/
|
|
1026
1030
|
export const zTimecodeParameters = z.object({
|
|
1027
|
-
name: z.string(),
|
|
1031
|
+
name: z.string().min(1),
|
|
1028
1032
|
description: z.string().nullish(),
|
|
1029
1033
|
description_is_required: z.boolean().optional(),
|
|
1030
1034
|
billable: z.boolean().optional(),
|
|
@@ -1052,7 +1056,7 @@ export const zTimecodeParameters = z.object({
|
|
|
1052
1056
|
export const zTimecodeCorrectionParameters = z.object({
|
|
1053
1057
|
effective_from: z.iso.datetime().optional(),
|
|
1054
1058
|
effective_to: z.iso.datetime().optional(),
|
|
1055
|
-
name: z.string().optional(),
|
|
1059
|
+
name: z.string().min(1).optional(),
|
|
1056
1060
|
description: z.string().nullish(),
|
|
1057
1061
|
description_is_required: z.boolean().optional(),
|
|
1058
1062
|
billable: z.boolean().optional(),
|
|
@@ -1190,7 +1194,7 @@ export const zAssetsAttributeResponseObject = z.object({
|
|
|
1190
1194
|
* Create or update an attribute definition. Options apply only to a select attribute and are ignored otherwise; data_type cannot be changed once any value has been filled.
|
|
1191
1195
|
*/
|
|
1192
1196
|
export const zAssetsAttributeParameters = z.object({
|
|
1193
|
-
name: z.string(),
|
|
1197
|
+
name: z.string().min(1),
|
|
1194
1198
|
data_type: z.enum([
|
|
1195
1199
|
'text',
|
|
1196
1200
|
'number',
|
|
@@ -1209,7 +1213,7 @@ export const zAssetsAttributeParameters = z.object({
|
|
|
1209
1213
|
* Update an attribute definition. All fields are optional — send only what changes. Options apply only to a select attribute and are ignored otherwise; data_type cannot be changed once any value has been filled.
|
|
1210
1214
|
*/
|
|
1211
1215
|
export const zAssetsAttributeUpdateParameters = z.object({
|
|
1212
|
-
name: z.string().optional(),
|
|
1216
|
+
name: z.string().min(1).optional(),
|
|
1213
1217
|
data_type: z.enum([
|
|
1214
1218
|
'text',
|
|
1215
1219
|
'number',
|
|
@@ -1247,7 +1251,7 @@ export const zAssetsCategoryResponseObject = z.object({
|
|
|
1247
1251
|
* Create or update a category; only name is required. `category_attributes` sets this category's direct attribute assignments.
|
|
1248
1252
|
*/
|
|
1249
1253
|
export const zAssetsCategoryParameters = z.object({
|
|
1250
|
-
name: z.string(),
|
|
1254
|
+
name: z.string().min(1),
|
|
1251
1255
|
parent_id: z.string().nullish(),
|
|
1252
1256
|
category_attributes: z.array(z.object({
|
|
1253
1257
|
id: z.string().optional(),
|
|
@@ -1262,7 +1266,7 @@ export const zAssetsCategoryParameters = z.object({
|
|
|
1262
1266
|
* Update a category. All fields are optional — send only what changes. `category_attributes` sets this category's direct attribute assignments.
|
|
1263
1267
|
*/
|
|
1264
1268
|
export const zAssetsCategoryUpdateParameters = z.object({
|
|
1265
|
-
name: z.string().optional(),
|
|
1269
|
+
name: z.string().min(1).optional(),
|
|
1266
1270
|
parent_id: z.string().nullish(),
|
|
1267
1271
|
category_attributes: z.array(z.object({
|
|
1268
1272
|
id: z.string().optional(),
|
|
@@ -1288,14 +1292,14 @@ export const zDepartmentResponseObject = z.object({
|
|
|
1288
1292
|
* Request body for creating a department.
|
|
1289
1293
|
*/
|
|
1290
1294
|
export const zDepartmentParameters = z.object({
|
|
1291
|
-
name: z.string(),
|
|
1295
|
+
name: z.string().min(1),
|
|
1292
1296
|
description: z.string().nullish()
|
|
1293
1297
|
});
|
|
1294
1298
|
/**
|
|
1295
1299
|
* Request body for updating a department. Send only the fields to change.
|
|
1296
1300
|
*/
|
|
1297
1301
|
export const zDepartmentUpdateParameters = z.object({
|
|
1298
|
-
name: z.string().optional(),
|
|
1302
|
+
name: z.string().min(1).optional(),
|
|
1299
1303
|
description: z.string().nullish()
|
|
1300
1304
|
});
|
|
1301
1305
|
/**
|
|
@@ -2077,15 +2081,15 @@ export const zPositionFunctionResponseObject = z.object({
|
|
|
2077
2081
|
* Request body for creating a position function.
|
|
2078
2082
|
*/
|
|
2079
2083
|
export const zPositionFunctionParameters = z.object({
|
|
2080
|
-
value: z.string(),
|
|
2081
|
-
description: z.string()
|
|
2084
|
+
value: z.string().min(1),
|
|
2085
|
+
description: z.string().min(1)
|
|
2082
2086
|
});
|
|
2083
2087
|
/**
|
|
2084
2088
|
* Request body for updating a position function. Send only the fields to change.
|
|
2085
2089
|
*/
|
|
2086
2090
|
export const zPositionFunctionUpdateParameters = z.object({
|
|
2087
|
-
value: z.string().optional(),
|
|
2088
|
-
description: z.string().optional()
|
|
2091
|
+
value: z.string().min(1).optional(),
|
|
2092
|
+
description: z.string().min(1).optional()
|
|
2089
2093
|
});
|
|
2090
2094
|
export const zCompanyResponseObject = z.object({
|
|
2091
2095
|
id: z.string(),
|
|
@@ -2266,7 +2270,7 @@ export const zCustomFieldConfigsResponseObject = z.object({
|
|
|
2266
2270
|
updated_at: z.iso.datetime()
|
|
2267
2271
|
});
|
|
2268
2272
|
/**
|
|
2269
|
-
* Request body for creating
|
|
2273
|
+
* Request body for creating a custom field definition. `name` and `model_type` are required.
|
|
2270
2274
|
*/
|
|
2271
2275
|
export const zCustomFieldConfigParameters = z.object({
|
|
2272
2276
|
name: z.string(),
|
|
@@ -2279,6 +2283,20 @@ export const zCustomFieldConfigParameters = z.object({
|
|
|
2279
2283
|
]),
|
|
2280
2284
|
visible: z.boolean().optional()
|
|
2281
2285
|
});
|
|
2286
|
+
/**
|
|
2287
|
+
* Request body for updating a custom field definition. Every field is optional; omit a field to preserve its current value. The resulting definition's name must remain unique for its company and model type.
|
|
2288
|
+
*/
|
|
2289
|
+
export const zCustomFieldConfigUpdateParameters = z.object({
|
|
2290
|
+
name: z.string().optional(),
|
|
2291
|
+
description: z.string().nullish(),
|
|
2292
|
+
model_type: z.enum([
|
|
2293
|
+
'apprenticeship_apprentice',
|
|
2294
|
+
'company',
|
|
2295
|
+
'job',
|
|
2296
|
+
'user_company'
|
|
2297
|
+
]).optional(),
|
|
2298
|
+
visible: z.boolean().optional()
|
|
2299
|
+
});
|
|
2282
2300
|
/**
|
|
2283
2301
|
* A user's membership in a group.
|
|
2284
2302
|
*/
|
|
@@ -2305,14 +2323,14 @@ export const zTimeCardStartDay = z.union([
|
|
|
2305
2323
|
z.literal(6)
|
|
2306
2324
|
]);
|
|
2307
2325
|
/**
|
|
2308
|
-
*
|
|
2326
|
+
* Fields shared by job creation and updates. Updates may omit any field to preserve its current value. The resulting job must still satisfy its schedule and PWA validation rules. Extra keys are accepted, including custom fields.
|
|
2309
2327
|
*/
|
|
2310
2328
|
export const zJobParameters = z.object({
|
|
2311
2329
|
template_id: z.string().nullish(),
|
|
2312
2330
|
name: z.string().nullish(),
|
|
2313
2331
|
description: z.string().optional(),
|
|
2314
|
-
requested_by_company_id: z.string(),
|
|
2315
|
-
created_by_user_id: z.string(),
|
|
2332
|
+
requested_by_company_id: z.string().optional(),
|
|
2333
|
+
created_by_user_id: z.string().optional(),
|
|
2316
2334
|
manager_user_ids: z.array(z.string()).nullish(),
|
|
2317
2335
|
purchase_order_number: z.string().nullish(),
|
|
2318
2336
|
project_id: z.string().nullish(),
|
|
@@ -2391,7 +2409,11 @@ export const zJobParameters = z.object({
|
|
|
2391
2409
|
}).optional()
|
|
2392
2410
|
});
|
|
2393
2411
|
/**
|
|
2394
|
-
* Parameters for
|
|
2412
|
+
* Parameters for creating a job. `requested_by_company_id` and `created_by_user_id` are required. Sets the job's schedule, work types, address, and optional Prevailing Wage / Apprenticeship (PWA) compliance.
|
|
2413
|
+
*/
|
|
2414
|
+
export const zJobCreateParameters = zJobParameters.and(z.record(z.string(), z.unknown()));
|
|
2415
|
+
/**
|
|
2416
|
+
* Parameters for updating an existing job. Every field is optional; omit a field to preserve its current value. The resulting job must still satisfy schedule and PWA validation rules. Accepts every shared job field plus a directly settable status.
|
|
2395
2417
|
*/
|
|
2396
2418
|
export const zJobUpdateParameters = zJobParameters.and(z.object({
|
|
2397
2419
|
status: z.enum([
|
|
@@ -3065,12 +3087,46 @@ export const zProjectResponseObject = z.object({
|
|
|
3065
3087
|
updated_at: z.iso.datetime()
|
|
3066
3088
|
});
|
|
3067
3089
|
/**
|
|
3068
|
-
* Request body for creating
|
|
3090
|
+
* Request body for creating a project. `name` is required by the schema; `created_by_user_id` is additionally required on create and must be a member of the owning company. The owning company is inferred from the API key and is not part of the body.
|
|
3069
3091
|
*/
|
|
3070
3092
|
export const zProjectParameters = z.object({
|
|
3071
3093
|
external_id: z.string().nullish(),
|
|
3072
3094
|
name: z.string(),
|
|
3073
3095
|
description: z.string().nullish(),
|
|
3096
|
+
created_by_user_id: z.string(),
|
|
3097
|
+
start_date: z.iso.date().nullish(),
|
|
3098
|
+
end_date: z.iso.date().nullish(),
|
|
3099
|
+
tz_name: z.string().nullish(),
|
|
3100
|
+
billing_start_day: z.int().nullish(),
|
|
3101
|
+
federal_pwa_mode: z.enum([
|
|
3102
|
+
'all',
|
|
3103
|
+
'pw_only',
|
|
3104
|
+
'ap_only',
|
|
3105
|
+
'none'
|
|
3106
|
+
]).optional(),
|
|
3107
|
+
regional_pwa_mode: z.enum([
|
|
3108
|
+
'all',
|
|
3109
|
+
'pw_only',
|
|
3110
|
+
'ap_only',
|
|
3111
|
+
'none'
|
|
3112
|
+
]).optional(),
|
|
3113
|
+
region: z.string().nullish(),
|
|
3114
|
+
asset_owner: z.boolean().optional(),
|
|
3115
|
+
administrator_name: z.string().nullish(),
|
|
3116
|
+
administrator_email: z.string().nullish(),
|
|
3117
|
+
administrator_phone: z.string().nullish(),
|
|
3118
|
+
budget: z.string().optional(),
|
|
3119
|
+
prevailing_wage_lock_in_date: z.iso.date().nullish(),
|
|
3120
|
+
beginning_of_construction_date: z.iso.date().nullish(),
|
|
3121
|
+
placed_in_service_date: z.iso.date().nullish()
|
|
3122
|
+
});
|
|
3123
|
+
/**
|
|
3124
|
+
* Request body for updating a project. Every field is optional; omit a field to preserve its current value. The resulting project must still satisfy conditional PWA, regional, and schedule validation rules. `created_by_user_id` is create-only and an update that names it is rejected.
|
|
3125
|
+
*/
|
|
3126
|
+
export const zProjectUpdateParameters = z.object({
|
|
3127
|
+
external_id: z.string().nullish(),
|
|
3128
|
+
name: z.string().optional(),
|
|
3129
|
+
description: z.string().nullish(),
|
|
3074
3130
|
created_by_user_id: z.string().nullish(),
|
|
3075
3131
|
start_date: z.iso.date().nullish(),
|
|
3076
3132
|
end_date: z.iso.date().nullish(),
|
|
@@ -3828,7 +3884,7 @@ export const zPositionParameters = z.object({
|
|
|
3828
3884
|
}).optional()
|
|
3829
3885
|
});
|
|
3830
3886
|
/**
|
|
3831
|
-
* Parameters for creating
|
|
3887
|
+
* Parameters for creating a per-unit scope price on a job. `scope_kind` and `unit_price` are required.
|
|
3832
3888
|
*/
|
|
3833
3889
|
export const zProductionJobScopePriceParameters = z.object({
|
|
3834
3890
|
scope_kind: z.string(),
|
|
@@ -3836,6 +3892,15 @@ export const zProductionJobScopePriceParameters = z.object({
|
|
|
3836
3892
|
contracted_count: z.int().nullish(),
|
|
3837
3893
|
unit_of_measure: z.string().optional()
|
|
3838
3894
|
});
|
|
3895
|
+
/**
|
|
3896
|
+
* Parameters for updating a per-unit scope price on a job. Every field is optional; omit a field to preserve its current value. The resulting price must retain a scope kind and non-negative unit price.
|
|
3897
|
+
*/
|
|
3898
|
+
export const zProductionJobScopePriceUpdateParameters = z.object({
|
|
3899
|
+
scope_kind: z.string().optional(),
|
|
3900
|
+
unit_price: z.string().optional(),
|
|
3901
|
+
contracted_count: z.int().nullish(),
|
|
3902
|
+
unit_of_measure: z.string().optional()
|
|
3903
|
+
});
|
|
3839
3904
|
/**
|
|
3840
3905
|
* A per-unit billing price for one scope of work on a job. Production completions bill against these prices.
|
|
3841
3906
|
*/
|
|
@@ -4019,7 +4084,7 @@ export const zCertificationResponseObject = z.object({
|
|
|
4019
4084
|
updated_at: z.iso.datetime()
|
|
4020
4085
|
});
|
|
4021
4086
|
/**
|
|
4022
|
-
* Request body for recording
|
|
4087
|
+
* Request body for recording a certification held by a worker — who holds it, which certification, when it was received, and optional proof, expiry, and verification details.
|
|
4023
4088
|
*/
|
|
4024
4089
|
export const zUserCertificationParameters = z.object({
|
|
4025
4090
|
user_id: z.string(),
|
|
@@ -4036,6 +4101,24 @@ export const zUserCertificationParameters = z.object({
|
|
|
4036
4101
|
archived_at: z.iso.datetime().nullish(),
|
|
4037
4102
|
approved_at: z.iso.datetime().nullish()
|
|
4038
4103
|
});
|
|
4104
|
+
/**
|
|
4105
|
+
* Request body for updating a certification held by a worker. Every field is optional; omit a field to preserve its current value. The resulting certification must still have a receipt date and verification state, and any expiry date must remain after its receipt date.
|
|
4106
|
+
*/
|
|
4107
|
+
export const zUserCertificationUpdateParameters = z.object({
|
|
4108
|
+
user_id: z.string().optional(),
|
|
4109
|
+
certification_id: z.string().optional(),
|
|
4110
|
+
received_at: z.iso.datetime().optional(),
|
|
4111
|
+
file: z.object({
|
|
4112
|
+
name: z.string().max(255).regex(/^[\w\s.-]*\.[A-Za-z0-9]+$/),
|
|
4113
|
+
content: z.string()
|
|
4114
|
+
}).nullish(),
|
|
4115
|
+
verified: z.boolean().optional(),
|
|
4116
|
+
expiration_date: z.iso.date().nullish(),
|
|
4117
|
+
credential_id: z.string().nullish(),
|
|
4118
|
+
approved_by_user_id: z.string().nullish(),
|
|
4119
|
+
archived_at: z.iso.datetime().nullish(),
|
|
4120
|
+
approved_at: z.iso.datetime().nullish()
|
|
4121
|
+
});
|
|
4039
4122
|
/**
|
|
4040
4123
|
* A certification held by a worker — the record that a worker earned a certification, with its receipt date, optional expiry, and verification state.
|
|
4041
4124
|
*/
|
|
@@ -5402,14 +5485,14 @@ export const zAssetsVendorResponseObject = z.object({
|
|
|
5402
5485
|
* Create or update a vendor. Only name is required.
|
|
5403
5486
|
*/
|
|
5404
5487
|
export const zAssetsVendorParameters = z.object({
|
|
5405
|
-
name: z.string(),
|
|
5488
|
+
name: z.string().min(1),
|
|
5406
5489
|
logo_signed_id: z.string().optional()
|
|
5407
5490
|
});
|
|
5408
5491
|
/**
|
|
5409
5492
|
* Update a vendor. All fields are optional — send only what changes.
|
|
5410
5493
|
*/
|
|
5411
5494
|
export const zAssetsVendorUpdateParameters = z.object({
|
|
5412
|
-
name: z.string().optional(),
|
|
5495
|
+
name: z.string().min(1).optional(),
|
|
5413
5496
|
logo_signed_id: z.string().optional()
|
|
5414
5497
|
});
|
|
5415
5498
|
/**
|
|
@@ -5515,6 +5598,39 @@ export const zAssetsFormAssignmentTriggerParameters = z.object({
|
|
|
5515
5598
|
assigned_user_ids: z.array(z.string()).optional(),
|
|
5516
5599
|
assets_product_ids: z.array(z.string()).optional()
|
|
5517
5600
|
});
|
|
5601
|
+
/**
|
|
5602
|
+
* Update a form-assignment trigger rule. All fields are optional — send only what changes. When changing first_due_by, include the matching day field when required; assigned_user_ids applies only to the custom assign_to mode.
|
|
5603
|
+
*/
|
|
5604
|
+
export const zAssetsFormAssignmentTriggerUpdateParameters = z.object({
|
|
5605
|
+
form_definition_id: z.string().optional(),
|
|
5606
|
+
triggered_by: z.enum(['assignment', 'unassignment']).optional(),
|
|
5607
|
+
assign_to: z.enum([
|
|
5608
|
+
'custom',
|
|
5609
|
+
'asset_assignee',
|
|
5610
|
+
'previous_asset_assignee'
|
|
5611
|
+
]).optional(),
|
|
5612
|
+
first_due_by: z.enum([
|
|
5613
|
+
'day_of_event',
|
|
5614
|
+
'day_of_week',
|
|
5615
|
+
'day_of_month'
|
|
5616
|
+
]).optional(),
|
|
5617
|
+
tz_name: z.string().optional(),
|
|
5618
|
+
time_of_day_due: z.string().optional(),
|
|
5619
|
+
name: z.string().nullish(),
|
|
5620
|
+
recurrence_frequency: z.enum([
|
|
5621
|
+
'DAILY',
|
|
5622
|
+
'WORKDAILY',
|
|
5623
|
+
'WORKDAILYSIX',
|
|
5624
|
+
'WEEKLY',
|
|
5625
|
+
'BIWEEKLY',
|
|
5626
|
+
'MONTHLY',
|
|
5627
|
+
'QUARTERLY'
|
|
5628
|
+
]).nullish(),
|
|
5629
|
+
day_of_week_due: z.int().nullish(),
|
|
5630
|
+
day_of_month_due: z.int().nullish(),
|
|
5631
|
+
assigned_user_ids: z.array(z.string()).optional(),
|
|
5632
|
+
assets_product_ids: z.array(z.string()).optional()
|
|
5633
|
+
});
|
|
5518
5634
|
/**
|
|
5519
5635
|
* A file attached to an asset — an item or product image, or a service-event attachment. Uploaded through the direct-upload flow; the response carries a URL to download it.
|
|
5520
5636
|
*/
|
|
@@ -5599,7 +5715,7 @@ export const zAssetsAttachmentParameters = z.object({
|
|
|
5599
5715
|
*/
|
|
5600
5716
|
export const zAssetsProductParameters = z.object({
|
|
5601
5717
|
type: z.enum(['serial', 'bulk']),
|
|
5602
|
-
name: z.string(),
|
|
5718
|
+
name: z.string().min(1),
|
|
5603
5719
|
description: z.string().nullish(),
|
|
5604
5720
|
assets_category_id: z.string().nullish(),
|
|
5605
5721
|
upc: z.string().nullish(),
|
|
@@ -5625,7 +5741,7 @@ export const zAssetsProductParameters = z.object({
|
|
|
5625
5741
|
* Update a catalog product. All fields are optional — send only what changes. `type` is immutable and `performed_by_user_id` is create-only, so neither is accepted here. `attribute_values` upserts the product's category-attribute values.
|
|
5626
5742
|
*/
|
|
5627
5743
|
export const zAssetsProductUpdateParameters = z.object({
|
|
5628
|
-
name: z.string().optional(),
|
|
5744
|
+
name: z.string().min(1).optional(),
|
|
5629
5745
|
description: z.string().nullish(),
|
|
5630
5746
|
assets_category_id: z.string().nullish(),
|
|
5631
5747
|
upc: z.string().nullish(),
|
|
@@ -5647,10 +5763,10 @@ export const zAssetsProductUpdateParameters = z.object({
|
|
|
5647
5763
|
images_attributes: z.array(zAssetsAttachmentParameters).optional()
|
|
5648
5764
|
});
|
|
5649
5765
|
/**
|
|
5650
|
-
* Create
|
|
5766
|
+
* Create an asset item. The write API creates serial items only; assets_product_id and serial_number identify the product and serial number. On create you may also place the item — assets_site_id to stock it at a site, or user_id to assign it to a user (the two are mutually exclusive). performed_by_user_id is required.
|
|
5651
5767
|
*/
|
|
5652
5768
|
export const zAssetsItemParameters = z.object({
|
|
5653
|
-
name: z.string(),
|
|
5769
|
+
name: z.string().min(1),
|
|
5654
5770
|
description: z.string().optional(),
|
|
5655
5771
|
assets_product_id: z.string(),
|
|
5656
5772
|
serial_number: z.string(),
|
|
@@ -5666,6 +5782,26 @@ export const zAssetsItemParameters = z.object({
|
|
|
5666
5782
|
assets_sub_location_id: z.string().optional(),
|
|
5667
5783
|
performed_by_user_id: z.string()
|
|
5668
5784
|
});
|
|
5785
|
+
/**
|
|
5786
|
+
* Update an asset item. All item fields are optional — send only what changes — but performed_by_user_id is required to record the updater and any placement. Omitted attributes retain their existing values.
|
|
5787
|
+
*/
|
|
5788
|
+
export const zAssetsItemUpdateParameters = z.object({
|
|
5789
|
+
name: z.string().min(1).optional(),
|
|
5790
|
+
description: z.string().optional(),
|
|
5791
|
+
assets_product_id: z.string().optional(),
|
|
5792
|
+
serial_number: z.string().optional(),
|
|
5793
|
+
status: z.enum(['available', 'assigned']).optional(),
|
|
5794
|
+
purchase_date: z.iso.datetime().optional(),
|
|
5795
|
+
purchase_price_cents: z.int().optional(),
|
|
5796
|
+
external_id: z.string().optional(),
|
|
5797
|
+
external_system_url: z.string().optional(),
|
|
5798
|
+
images_attributes: z.array(zAssetsAttachmentParameters).optional(),
|
|
5799
|
+
assets_site_id: z.string().optional(),
|
|
5800
|
+
user_id: z.string().optional(),
|
|
5801
|
+
container_item_id: z.string().optional(),
|
|
5802
|
+
assets_sub_location_id: z.string().optional(),
|
|
5803
|
+
performed_by_user_id: z.string()
|
|
5804
|
+
});
|
|
5669
5805
|
/**
|
|
5670
5806
|
* A file attached to an asset item — a document such as a manual, warranty, or certificate. Uploaded through the direct-upload flow and optionally marked as a certified copy.
|
|
5671
5807
|
*/
|
|
@@ -5694,6 +5830,14 @@ export const zAssetsDocumentParameters = z.object({
|
|
|
5694
5830
|
filename: z.string().nullish(),
|
|
5695
5831
|
description: z.string().nullish()
|
|
5696
5832
|
});
|
|
5833
|
+
/**
|
|
5834
|
+
* Update an asset-item document. All fields are optional — send only what changes. Omit file to retain the existing attachment, or supply a new signed_id to replace it.
|
|
5835
|
+
*/
|
|
5836
|
+
export const zAssetsDocumentUpdateParameters = z.object({
|
|
5837
|
+
file: z.string().optional(),
|
|
5838
|
+
filename: z.string().nullish(),
|
|
5839
|
+
description: z.string().nullish()
|
|
5840
|
+
});
|
|
5697
5841
|
/**
|
|
5698
5842
|
* One entry in an item document's change history, recorded whenever the document is created, updated, or deleted — including when only its attached file is replaced.
|
|
5699
5843
|
*/
|
|
@@ -5801,6 +5945,72 @@ export const zAssetsItemFormAssignmentParameters = z.object({
|
|
|
5801
5945
|
})).optional()
|
|
5802
5946
|
})
|
|
5803
5947
|
});
|
|
5948
|
+
/**
|
|
5949
|
+
* Update an item form assignment. All fields are optional — send only what changes. recurring gates the recurrence fields, and task_attributes.reminders_attributes replaces the existing reminder set when supplied.
|
|
5950
|
+
*/
|
|
5951
|
+
export const zAssetsItemFormAssignmentUpdateParameters = z.object({
|
|
5952
|
+
form_definition_id: z.string().optional(),
|
|
5953
|
+
recurring: z.boolean().optional(),
|
|
5954
|
+
task_attributes: z.object({
|
|
5955
|
+
name: z.string().nullish(),
|
|
5956
|
+
description: z.string().nullish(),
|
|
5957
|
+
created_by_user_id: z.string().optional(),
|
|
5958
|
+
updated_by_user_id: z.string().nullish(),
|
|
5959
|
+
time_due: z.iso.datetime().nullish(),
|
|
5960
|
+
tz_name: z.string().nullish(),
|
|
5961
|
+
frequency: z.enum([
|
|
5962
|
+
'DAILY',
|
|
5963
|
+
'WORKDAILY',
|
|
5964
|
+
'WORKDAILYSIX',
|
|
5965
|
+
'WEEKLY',
|
|
5966
|
+
'BIWEEKLY',
|
|
5967
|
+
'MONTHLY',
|
|
5968
|
+
'QUARTERLY'
|
|
5969
|
+
]).nullish(),
|
|
5970
|
+
recurrence_end_time: z.iso.datetime().nullish(),
|
|
5971
|
+
task_assignee_user_ids: z.array(z.string()).optional(),
|
|
5972
|
+
reminders_attributes: z.array(z.object({
|
|
5973
|
+
offset: z.enum([
|
|
5974
|
+
'PT0S',
|
|
5975
|
+
'PT-1M',
|
|
5976
|
+
'PT-5M',
|
|
5977
|
+
'PT-10M',
|
|
5978
|
+
'PT-15M',
|
|
5979
|
+
'PT-30M',
|
|
5980
|
+
'PT-1H',
|
|
5981
|
+
'PT-2H',
|
|
5982
|
+
'P-1D',
|
|
5983
|
+
'P-2D',
|
|
5984
|
+
'P-3D',
|
|
5985
|
+
'P-4D',
|
|
5986
|
+
'P-5D',
|
|
5987
|
+
'P-6D',
|
|
5988
|
+
'P-1W',
|
|
5989
|
+
'P-2W',
|
|
5990
|
+
'P-1M',
|
|
5991
|
+
'P-2M',
|
|
5992
|
+
'P-3M',
|
|
5993
|
+
'P-6M',
|
|
5994
|
+
'P-1Y',
|
|
5995
|
+
'PT5M',
|
|
5996
|
+
'PT15M',
|
|
5997
|
+
'PT30M',
|
|
5998
|
+
'PT1H',
|
|
5999
|
+
'PT6H',
|
|
6000
|
+
'PT12H',
|
|
6001
|
+
'P1D',
|
|
6002
|
+
'P2D',
|
|
6003
|
+
'P3D',
|
|
6004
|
+
'P4D',
|
|
6005
|
+
'P5D',
|
|
6006
|
+
'P6D',
|
|
6007
|
+
'P1W',
|
|
6008
|
+
'P2W',
|
|
6009
|
+
'P3W'
|
|
6010
|
+
])
|
|
6011
|
+
})).optional()
|
|
6012
|
+
}).optional()
|
|
6013
|
+
});
|
|
5804
6014
|
/**
|
|
5805
6015
|
* On-hand stock of an item at a site — one row per item, site, and storage location. Read-only. A site with none of the item has no row at all, since a row is removed once its count reaches zero.
|
|
5806
6016
|
*/
|
|
@@ -5922,6 +6132,22 @@ export const zAssetsServiceScheduleParameters = z.object({
|
|
|
5922
6132
|
last_serviced_on: z.iso.date().nullish(),
|
|
5923
6133
|
performed_by_user_id: z.string()
|
|
5924
6134
|
});
|
|
6135
|
+
/**
|
|
6136
|
+
* Update a service schedule. Cadence and last_serviced_on fields are optional — send only what changes — but performed_by_user_id is required to record the updater. next_due_date is recomputed.
|
|
6137
|
+
*/
|
|
6138
|
+
export const zAssetsServiceScheduleUpdateParameters = z.object({
|
|
6139
|
+
kind: z.enum(['calibration', 'maintenance']).optional(),
|
|
6140
|
+
name: z.string().nullish(),
|
|
6141
|
+
interval_unit: z.enum([
|
|
6142
|
+
'year',
|
|
6143
|
+
'month',
|
|
6144
|
+
'week',
|
|
6145
|
+
'day'
|
|
6146
|
+
]).optional(),
|
|
6147
|
+
interval_count: z.int().gte(1).optional(),
|
|
6148
|
+
last_serviced_on: z.iso.date().nullish(),
|
|
6149
|
+
performed_by_user_id: z.string()
|
|
6150
|
+
});
|
|
5925
6151
|
/**
|
|
5926
6152
|
* A service performed on a serial item — scheduled (satisfying a service schedule) or ad-hoc. Recording one advances the linked schedule's next_due_date.
|
|
5927
6153
|
*/
|
|
@@ -5957,6 +6183,21 @@ export const zAssetsServiceEventParameters = z.object({
|
|
|
5957
6183
|
performed_by_user_id: z.string(),
|
|
5958
6184
|
attachments_attributes: z.array(zAssetsAttachmentParameters).optional()
|
|
5959
6185
|
});
|
|
6186
|
+
/**
|
|
6187
|
+
* Update a service event. Event fields are optional — send only what changes — but performed_by_user_id is required to record the updater. A linked schedule dictates kind, and changing or removing the link recomputes affected due dates.
|
|
6188
|
+
*/
|
|
6189
|
+
export const zAssetsServiceEventUpdateParameters = z.object({
|
|
6190
|
+
kind: z.enum([
|
|
6191
|
+
'calibration',
|
|
6192
|
+
'maintenance',
|
|
6193
|
+
'repair'
|
|
6194
|
+
]).optional(),
|
|
6195
|
+
notes: z.string().nullish(),
|
|
6196
|
+
performed_on: z.iso.date().optional(),
|
|
6197
|
+
assets_service_schedule_id: z.string().nullish(),
|
|
6198
|
+
performed_by_user_id: z.string(),
|
|
6199
|
+
attachments_attributes: z.array(zAssetsAttachmentParameters).optional()
|
|
6200
|
+
});
|
|
5960
6201
|
/**
|
|
5961
6202
|
* A product-level service cadence that seeds and syncs the matching schedules on that product's items. Changing its defining fields (name, kind, interval) reconciles linked item schedules in the background.
|
|
5962
6203
|
*/
|
|
@@ -5991,6 +6232,21 @@ export const zAssetsServiceScheduleTemplateParameters = z.object({
|
|
|
5991
6232
|
interval_count: z.int().gte(1),
|
|
5992
6233
|
performed_by_user_id: z.string()
|
|
5993
6234
|
});
|
|
6235
|
+
/**
|
|
6236
|
+
* Update a service schedule template. Cadence fields are optional — send only what changes — but performed_by_user_id is required to record the updater. Changing defining fields reconciles linked item schedules in the background.
|
|
6237
|
+
*/
|
|
6238
|
+
export const zAssetsServiceScheduleTemplateUpdateParameters = z.object({
|
|
6239
|
+
kind: z.enum(['calibration', 'maintenance']).optional(),
|
|
6240
|
+
name: z.string().nullish(),
|
|
6241
|
+
interval_unit: z.enum([
|
|
6242
|
+
'year',
|
|
6243
|
+
'month',
|
|
6244
|
+
'week',
|
|
6245
|
+
'day'
|
|
6246
|
+
]).optional(),
|
|
6247
|
+
interval_count: z.int().gte(1).optional(),
|
|
6248
|
+
performed_by_user_id: z.string()
|
|
6249
|
+
});
|
|
5994
6250
|
/**
|
|
5995
6251
|
* A node of fixed storage structure inside a site or a container item — a zone, aisle, rack, shelf, bin, or drawer. Nodes form a tree per holder, and each carries a scannable path_code composed from its ancestors' codes.
|
|
5996
6252
|
*/
|
|
@@ -6029,8 +6285,8 @@ export const zAssetsSubLocationParameters = z.object({
|
|
|
6029
6285
|
'bin',
|
|
6030
6286
|
'drawer'
|
|
6031
6287
|
]).optional(),
|
|
6032
|
-
name: z.string(),
|
|
6033
|
-
code: z.string()
|
|
6288
|
+
name: z.string().min(1),
|
|
6289
|
+
code: z.string().min(1)
|
|
6034
6290
|
});
|
|
6035
6291
|
/**
|
|
6036
6292
|
* Update a storage location. All fields are optional — send only what changes. The holder fields cannot change after creation; renaming code cascades new path codes through the node's subtree.
|
|
@@ -6047,8 +6303,8 @@ export const zAssetsSubLocationUpdateParameters = z.object({
|
|
|
6047
6303
|
'bin',
|
|
6048
6304
|
'drawer'
|
|
6049
6305
|
]).optional(),
|
|
6050
|
-
name: z.string().optional(),
|
|
6051
|
-
code: z.string().optional()
|
|
6306
|
+
name: z.string().min(1).optional(),
|
|
6307
|
+
code: z.string().min(1).optional()
|
|
6052
6308
|
});
|
|
6053
6309
|
/**
|
|
6054
6310
|
* A completed movement of item stock between two holders, each a site, a user, or a container. Each line moves one item; applying the transfer records paired outbound and inbound transactions and updates the on-hand, custody, and containment counts. Transfers created through this API are always completed. One-sided moves (placing or removing an item with only one endpoint) record transactions but no transfer, and so are not represented by this resource.
|
|
@@ -6567,7 +6823,7 @@ export const zGetFormAssignmentTriggerPath = z.object({
|
|
|
6567
6823
|
* Success
|
|
6568
6824
|
*/
|
|
6569
6825
|
export const zGetFormAssignmentTriggerResponse = zAssetsFormAssignmentTriggerResponseObject;
|
|
6570
|
-
export const zUpdateFormAssignmentTriggerBody =
|
|
6826
|
+
export const zUpdateFormAssignmentTriggerBody = zAssetsFormAssignmentTriggerUpdateParameters;
|
|
6571
6827
|
export const zUpdateFormAssignmentTriggerPath = z.object({
|
|
6572
6828
|
id: z.string()
|
|
6573
6829
|
});
|
|
@@ -6636,7 +6892,7 @@ export const zGetItemPath = z.object({
|
|
|
6636
6892
|
* Success
|
|
6637
6893
|
*/
|
|
6638
6894
|
export const zGetItemResponse = zAssetsItemResponseObject;
|
|
6639
|
-
export const zUpdateItemBody =
|
|
6895
|
+
export const zUpdateItemBody = zAssetsItemUpdateParameters;
|
|
6640
6896
|
export const zUpdateItemPath = z.object({
|
|
6641
6897
|
id: z.string()
|
|
6642
6898
|
});
|
|
@@ -6707,7 +6963,7 @@ export const zGetServiceSchedulePath = z.object({
|
|
|
6707
6963
|
* Success
|
|
6708
6964
|
*/
|
|
6709
6965
|
export const zGetServiceScheduleResponse = zAssetsServiceScheduleResponseObject;
|
|
6710
|
-
export const zUpdateServiceScheduleBody =
|
|
6966
|
+
export const zUpdateServiceScheduleBody = zAssetsServiceScheduleUpdateParameters;
|
|
6711
6967
|
export const zUpdateServiceSchedulePath = z.object({
|
|
6712
6968
|
item_id: z.string(),
|
|
6713
6969
|
id: z.string()
|
|
@@ -6763,7 +7019,7 @@ export const zGetServiceEventPath = z.object({
|
|
|
6763
7019
|
* Success
|
|
6764
7020
|
*/
|
|
6765
7021
|
export const zGetServiceEventResponse = zAssetsServiceEventFullResponseObject;
|
|
6766
|
-
export const zUpdateServiceEventBody =
|
|
7022
|
+
export const zUpdateServiceEventBody = zAssetsServiceEventUpdateParameters;
|
|
6767
7023
|
export const zUpdateServiceEventPath = z.object({
|
|
6768
7024
|
item_id: z.string(),
|
|
6769
7025
|
id: z.string()
|
|
@@ -6804,7 +7060,7 @@ export const zGetFormAssignmentTaskPath = z.object({
|
|
|
6804
7060
|
* Success
|
|
6805
7061
|
*/
|
|
6806
7062
|
export const zGetFormAssignmentTaskResponse = zAssetsItemFormAssignmentResponseObject;
|
|
6807
|
-
export const zUpdateFormAssignmentTaskBody =
|
|
7063
|
+
export const zUpdateFormAssignmentTaskBody = zAssetsItemFormAssignmentUpdateParameters;
|
|
6808
7064
|
export const zUpdateFormAssignmentTaskPath = z.object({
|
|
6809
7065
|
item_id: z.string(),
|
|
6810
7066
|
id: z.string()
|
|
@@ -6855,7 +7111,7 @@ export const zGetDocumentPath = z.object({
|
|
|
6855
7111
|
* Success
|
|
6856
7112
|
*/
|
|
6857
7113
|
export const zGetDocumentResponse = zAssetsDocumentResponseObject;
|
|
6858
|
-
export const zUpdateDocumentBody =
|
|
7114
|
+
export const zUpdateDocumentBody = zAssetsDocumentUpdateParameters;
|
|
6859
7115
|
export const zUpdateDocumentPath = z.object({
|
|
6860
7116
|
item_id: z.string(),
|
|
6861
7117
|
id: z.string()
|
|
@@ -6999,7 +7255,7 @@ export const zGetServiceScheduleTemplatePath = z.object({
|
|
|
6999
7255
|
* Success
|
|
7000
7256
|
*/
|
|
7001
7257
|
export const zGetServiceScheduleTemplateResponse = zAssetsServiceScheduleTemplateResponseObject;
|
|
7002
|
-
export const zUpdateServiceScheduleTemplateBody =
|
|
7258
|
+
export const zUpdateServiceScheduleTemplateBody = zAssetsServiceScheduleTemplateUpdateParameters;
|
|
7003
7259
|
export const zUpdateServiceScheduleTemplatePath = z.object({
|
|
7004
7260
|
product_id: z.string(),
|
|
7005
7261
|
id: z.string()
|
|
@@ -7357,7 +7613,7 @@ export const zGetUserCertificationPath = z.object({
|
|
|
7357
7613
|
* Success
|
|
7358
7614
|
*/
|
|
7359
7615
|
export const zGetUserCertificationResponse = zUserCertificationResponseObject;
|
|
7360
|
-
export const zUpdateUserCertificationBody =
|
|
7616
|
+
export const zUpdateUserCertificationBody = zUserCertificationUpdateParameters;
|
|
7361
7617
|
export const zUpdateUserCertificationPath = z.object({
|
|
7362
7618
|
id: z.string()
|
|
7363
7619
|
});
|
|
@@ -7563,7 +7819,7 @@ export const zGetCustomFieldConfigPath = z.object({
|
|
|
7563
7819
|
* Success
|
|
7564
7820
|
*/
|
|
7565
7821
|
export const zGetCustomFieldConfigResponse = zCustomFieldConfigsResponseObject;
|
|
7566
|
-
export const zUpdateCustomFieldConfigBody =
|
|
7822
|
+
export const zUpdateCustomFieldConfigBody = zCustomFieldConfigUpdateParameters;
|
|
7567
7823
|
export const zUpdateCustomFieldConfigPath = z.object({
|
|
7568
7824
|
id: z.string()
|
|
7569
7825
|
});
|
|
@@ -7756,7 +8012,7 @@ export const zGetJobScopePricePath = z.object({
|
|
|
7756
8012
|
* Success
|
|
7757
8013
|
*/
|
|
7758
8014
|
export const zGetJobScopePriceResponse = zProductionJobScopePriceResponseObject;
|
|
7759
|
-
export const zUpdateJobScopePriceBody =
|
|
8015
|
+
export const zUpdateJobScopePriceBody = zProductionJobScopePriceUpdateParameters;
|
|
7760
8016
|
export const zUpdateJobScopePricePath = z.object({
|
|
7761
8017
|
job_id: z.string(),
|
|
7762
8018
|
id: z.string()
|
|
@@ -7997,7 +8253,7 @@ export const zListJobsResponse = z.object({
|
|
|
7997
8253
|
/**
|
|
7998
8254
|
* Create a job
|
|
7999
8255
|
*/
|
|
8000
|
-
export const zCreateJobBody =
|
|
8256
|
+
export const zCreateJobBody = zJobCreateParameters;
|
|
8001
8257
|
/**
|
|
8002
8258
|
* Created
|
|
8003
8259
|
*/
|
|
@@ -8884,7 +9140,7 @@ export const zGetProjectPath = z.object({
|
|
|
8884
9140
|
* Success
|
|
8885
9141
|
*/
|
|
8886
9142
|
export const zGetProjectResponse = zProjectResponseObject;
|
|
8887
|
-
export const zUpdateProjectBody =
|
|
9143
|
+
export const zUpdateProjectBody = zProjectUpdateParameters;
|
|
8888
9144
|
export const zUpdateProjectPath = z.object({
|
|
8889
9145
|
id: z.string()
|
|
8890
9146
|
});
|