@dsptch-work/api-client 0.38.0 → 0.39.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 +95 -0
- package/dist/gen/index.d.ts +1 -1
- package/dist/gen/sdk.gen.d.ts +29 -3
- package/dist/gen/sdk.gen.js +38 -2
- package/dist/gen/types.gen.d.ts +117 -62
- package/dist/gen/zod.gen.d.ts +146 -113
- package/dist/gen/zod.gen.js +57 -43
- package/package.json +1 -1
package/dist/gen/zod.gen.js
CHANGED
|
@@ -262,7 +262,7 @@ export const zProblem = z.object({
|
|
|
262
262
|
*
|
|
263
263
|
* **Unparseable Date Value**
|
|
264
264
|
*
|
|
265
|
-
* A date-time value cannot be parsed, falls outside the storable range, or has no UTC offset where one is required.
|
|
265
|
+
* A date or date-time value cannot be parsed, names a day that does not exist, falls outside the storable range, or has no UTC offset where one is required. Send a day as `2026-08-05` and an instant with its offset (`2026-08-05T14:30:00-04:00` or `2026-08-05T18:30:00Z`). The times of time entries and apprenticeship allocations, a compliance check's due time, a timecode correction's bounds, timestamp filter bounds, and `as_of[]` coordinates need the offset; a time sent without one is refused with the value to send.
|
|
266
266
|
*
|
|
267
267
|
* ### invalid_filter_value
|
|
268
268
|
*
|
|
@@ -930,7 +930,7 @@ export const zApprenticeshipAllocationCreateParameters = z.object({
|
|
|
930
930
|
apprenticeship_work_process_category_id: z.string().regex(/[^\x09-\x0D\x20
- ‧- ]|[‧]/).nullish(),
|
|
931
931
|
minutes: z.int(),
|
|
932
932
|
description: z.string().nullish(),
|
|
933
|
-
allocated_at: z.
|
|
933
|
+
allocated_at: z.iso.datetime().optional()
|
|
934
934
|
});
|
|
935
935
|
/**
|
|
936
936
|
* Correct an existing allocation's hours, work process category, description, or (for a standalone allocation) effective timestamp. The time card an allocation is linked to cannot be changed after creation. Any change that shifts progression rebuilds it and requests historical wage repricing in the background, including locked time cards.
|
|
@@ -939,7 +939,7 @@ export const zApprenticeshipAllocationUpdateParameters = z.object({
|
|
|
939
939
|
apprenticeship_work_process_category_id: z.string().regex(/[^\x09-\x0D\x20
- ‧- ]|[‧]/).nullish(),
|
|
940
940
|
minutes: z.int().optional(),
|
|
941
941
|
description: z.string().nullish(),
|
|
942
|
-
allocated_at: z.
|
|
942
|
+
allocated_at: z.iso.datetime().optional()
|
|
943
943
|
});
|
|
944
944
|
/**
|
|
945
945
|
* Enroll a user as an apprentice under an employer in a program; the employing program-employer record is derived from the enrolling company and the program in the URL path. Apprentices cannot be updated through the API, only created. Omitting a required field answers 400; a null for a non-nullable field, a blank ID, a wrong JSON type, an unlisted status, or a date that is not a YYYY-MM-DD calendar date answers 422.
|
|
@@ -1095,7 +1095,7 @@ export const zApprenticeshipWageScheduleParameters = z.object({
|
|
|
1095
1095
|
journeyworker_fringe_cents: z.string().regex(/^[0-9]+(\.[0-9]+)?$/).nullish(),
|
|
1096
1096
|
end_wage_cents: z.string().regex(/^[0-9]+(\.[0-9]+)?$/).optional(),
|
|
1097
1097
|
periods_attributes: z.array(z.object({
|
|
1098
|
-
id: z.string().optional(),
|
|
1098
|
+
id: z.string().regex(/[^\x09-\x0D\x20
- ‧- ]|[‧]/).optional(),
|
|
1099
1099
|
period_number: z.int().gte(0).optional(),
|
|
1100
1100
|
min_minutes: z.int().gte(0).nullish(),
|
|
1101
1101
|
max_minutes: z.int().gte(0).nullish(),
|
|
@@ -1142,7 +1142,7 @@ export const zApprenticeshipWageScheduleUpdateParameters = z.object({
|
|
|
1142
1142
|
journeyworker_fringe_cents: z.string().regex(/^[0-9]+(\.[0-9]+)?$/).nullish(),
|
|
1143
1143
|
end_wage_cents: z.string().regex(/^[0-9]+(\.[0-9]+)?$/).optional(),
|
|
1144
1144
|
periods_attributes: z.array(z.object({
|
|
1145
|
-
id: z.string().optional(),
|
|
1145
|
+
id: z.string().regex(/[^\x09-\x0D\x20
- ‧- ]|[‧]/).optional(),
|
|
1146
1146
|
period_number: z.int().gte(0).optional(),
|
|
1147
1147
|
min_minutes: z.int().gte(0).nullish(),
|
|
1148
1148
|
max_minutes: z.int().gte(0).nullish(),
|
|
@@ -1554,7 +1554,7 @@ export const zAssetsProductParameters = z.object({
|
|
|
1554
1554
|
assets_attribute_option_id: z.string().nullish()
|
|
1555
1555
|
})).optional(),
|
|
1556
1556
|
images_attributes: z.array(z.object({
|
|
1557
|
-
id: z.string().optional(),
|
|
1557
|
+
id: z.string().regex(/[^\x09-\x0D\x20
- ‧- ]|[‧]/).optional(),
|
|
1558
1558
|
file: z.string().regex(/[^\x09-\x0D\x20
- ‧- ]|[‧]/).optional(),
|
|
1559
1559
|
_destroy: z.boolean().optional()
|
|
1560
1560
|
})).optional(),
|
|
@@ -1585,7 +1585,7 @@ export const zAssetsProductUpdateParameters = z.object({
|
|
|
1585
1585
|
assets_attribute_option_id: z.string().nullish()
|
|
1586
1586
|
})).optional(),
|
|
1587
1587
|
images_attributes: z.array(z.object({
|
|
1588
|
-
id: z.string().optional(),
|
|
1588
|
+
id: z.string().regex(/[^\x09-\x0D\x20
- ‧- ]|[‧]/).optional(),
|
|
1589
1589
|
file: z.string().regex(/[^\x09-\x0D\x20
- ‧- ]|[‧]/).optional(),
|
|
1590
1590
|
_destroy: z.boolean().optional()
|
|
1591
1591
|
})).optional()
|
|
@@ -1678,7 +1678,7 @@ export const zAssetsAttributeParameters = z.object({
|
|
|
1678
1678
|
'select'
|
|
1679
1679
|
]),
|
|
1680
1680
|
options: z.array(z.object({
|
|
1681
|
-
id: z.string().optional(),
|
|
1681
|
+
id: z.string().regex(/[^\x09-\x0D\x20
- ‧- ]|[‧]/).optional(),
|
|
1682
1682
|
value: z.string().optional(),
|
|
1683
1683
|
position: z.int().optional(),
|
|
1684
1684
|
_destroy: z.boolean().optional()
|
|
@@ -1697,7 +1697,7 @@ export const zAssetsAttributeUpdateParameters = z.object({
|
|
|
1697
1697
|
'select'
|
|
1698
1698
|
]).optional(),
|
|
1699
1699
|
options: z.array(z.object({
|
|
1700
|
-
id: z.string().optional(),
|
|
1700
|
+
id: z.string().regex(/[^\x09-\x0D\x20
- ‧- ]|[‧]/).optional(),
|
|
1701
1701
|
value: z.string().optional(),
|
|
1702
1702
|
position: z.int().optional(),
|
|
1703
1703
|
_destroy: z.boolean().optional()
|
|
@@ -1729,7 +1729,7 @@ export const zAssetsCategoryParameters = z.object({
|
|
|
1729
1729
|
name: z.string().regex(/[^\x09-\x0D\x20
- ‧- ]|[‧]/),
|
|
1730
1730
|
parent_id: z.string().nullish(),
|
|
1731
1731
|
category_attributes: z.array(z.object({
|
|
1732
|
-
id: z.string().optional(),
|
|
1732
|
+
id: z.string().regex(/[^\x09-\x0D\x20
- ‧- ]|[‧]/).optional(),
|
|
1733
1733
|
assets_attribute_id: z.string().optional(),
|
|
1734
1734
|
fillable_on: z.enum(['product', 'item']).optional(),
|
|
1735
1735
|
required: z.boolean().optional(),
|
|
@@ -1744,7 +1744,7 @@ export const zAssetsCategoryUpdateParameters = z.object({
|
|
|
1744
1744
|
name: z.string().regex(/[^\x09-\x0D\x20
- ‧- ]|[‧]/).optional(),
|
|
1745
1745
|
parent_id: z.string().nullish(),
|
|
1746
1746
|
category_attributes: z.array(z.object({
|
|
1747
|
-
id: z.string().optional(),
|
|
1747
|
+
id: z.string().regex(/[^\x09-\x0D\x20
- ‧- ]|[‧]/).optional(),
|
|
1748
1748
|
assets_attribute_id: z.string().optional(),
|
|
1749
1749
|
fillable_on: z.enum(['product', 'item']).optional(),
|
|
1750
1750
|
required: z.boolean().optional(),
|
|
@@ -1786,8 +1786,8 @@ export const zTimeCardPerDiemResponseObject = z.object({
|
|
|
1786
1786
|
date: z.iso.date(),
|
|
1787
1787
|
approver_user_id: z.string(),
|
|
1788
1788
|
per_diem_id: z.string().nullable(),
|
|
1789
|
-
per_diem_rate_cents: z.string().
|
|
1790
|
-
per_diem_currency: z.string().
|
|
1789
|
+
per_diem_rate_cents: z.string().nullish(),
|
|
1790
|
+
per_diem_currency: z.string().nullish(),
|
|
1791
1791
|
taxable: z.boolean(),
|
|
1792
1792
|
created_at: z.iso.datetime(),
|
|
1793
1793
|
updated_at: z.iso.datetime()
|
|
@@ -2416,8 +2416,8 @@ export const zJobCreateParameters = z.object({
|
|
|
2416
2416
|
'none'
|
|
2417
2417
|
]).optional(),
|
|
2418
2418
|
region: z.string().nullish(),
|
|
2419
|
-
start_time: z.
|
|
2420
|
-
end_time: z.
|
|
2419
|
+
start_time: z.iso.date().nullish(),
|
|
2420
|
+
end_time: z.iso.date().nullish(),
|
|
2421
2421
|
tz_name: z.string().optional(),
|
|
2422
2422
|
time_card_start_day: z.int().gte(0).lte(6).optional(),
|
|
2423
2423
|
clock_in_requirement: z.enum([
|
|
@@ -2501,8 +2501,8 @@ export const zJobUpdateParameters = z.object({
|
|
|
2501
2501
|
'none'
|
|
2502
2502
|
]).optional(),
|
|
2503
2503
|
region: z.string().nullish(),
|
|
2504
|
-
start_time: z.
|
|
2505
|
-
end_time: z.
|
|
2504
|
+
start_time: z.iso.date().nullish(),
|
|
2505
|
+
end_time: z.iso.date().nullish(),
|
|
2506
2506
|
tz_name: z.string().optional(),
|
|
2507
2507
|
time_card_start_day: z.int().gte(0).lte(6).optional(),
|
|
2508
2508
|
clock_in_requirement: z.enum([
|
|
@@ -2863,7 +2863,7 @@ export const zFormDefinitionObject = z.object({
|
|
|
2863
2863
|
created_at: z.iso.datetime()
|
|
2864
2864
|
});
|
|
2865
2865
|
/**
|
|
2866
|
-
* A single form submission
|
|
2866
|
+
* A single form submission with resolved answers, returned by both show and create.
|
|
2867
2867
|
*/
|
|
2868
2868
|
export const zFormSubmissionResponseObject = z.object({
|
|
2869
2869
|
id: z.string(),
|
|
@@ -2880,6 +2880,15 @@ export const zFormSubmissionResponseObject = z.object({
|
|
|
2880
2880
|
created_at: z.iso.datetime(),
|
|
2881
2881
|
updated_at: z.iso.datetime()
|
|
2882
2882
|
});
|
|
2883
|
+
/**
|
|
2884
|
+
* Create a submission using supported keys from the form definition's submission_shape. Requires a user-scoped API key.
|
|
2885
|
+
*/
|
|
2886
|
+
export const zFormSubmissionCreateParameters = z.object({
|
|
2887
|
+
form_definition_id: z.string(),
|
|
2888
|
+
user_id: z.string(),
|
|
2889
|
+
json: z.record(z.string(), z.unknown()),
|
|
2890
|
+
timezone: z.string().optional()
|
|
2891
|
+
});
|
|
2883
2892
|
/**
|
|
2884
2893
|
* Request body for updating a worker's employment at your company. Corrects administrative fields (employment type, title, manager, payroll id, hire date, and time-and-attendance enrollment) across the whole employment history, and changes the custom-field values it lists. For time-effective pay changes, use the scheduled-changes endpoints instead. A value of the wrong JSON type, a null for a field that is not nullable, or a value outside a listed set answers 422 at its pointer, and nothing is written.
|
|
2885
2894
|
*/
|
|
@@ -3389,10 +3398,10 @@ export const zTimeCardResponseObject = z.object({
|
|
|
3389
3398
|
1.5: z.number(),
|
|
3390
3399
|
2: z.number()
|
|
3391
3400
|
}),
|
|
3392
|
-
pay_cents: z.string(),
|
|
3393
|
-
base_wage_pay_cents: z.string(),
|
|
3394
|
-
one_five_x_adder_cents: z.string(),
|
|
3395
|
-
two_x_adder_cents: z.string(),
|
|
3401
|
+
pay_cents: z.string().optional(),
|
|
3402
|
+
base_wage_pay_cents: z.string().optional(),
|
|
3403
|
+
one_five_x_adder_cents: z.string().optional(),
|
|
3404
|
+
two_x_adder_cents: z.string().optional(),
|
|
3396
3405
|
region_ids: z.array(z.string())
|
|
3397
3406
|
});
|
|
3398
3407
|
/**
|
|
@@ -3425,10 +3434,10 @@ export const zJobTimeCardDayResponseObject = z.object({
|
|
|
3425
3434
|
1.5: z.number(),
|
|
3426
3435
|
2: z.number()
|
|
3427
3436
|
}),
|
|
3428
|
-
pay_cents: z.string(),
|
|
3429
|
-
base_wage_pay_cents: z.string(),
|
|
3430
|
-
one_five_x_adder_cents: z.string(),
|
|
3431
|
-
two_x_adder_cents: z.string(),
|
|
3437
|
+
pay_cents: z.string().optional(),
|
|
3438
|
+
base_wage_pay_cents: z.string().optional(),
|
|
3439
|
+
one_five_x_adder_cents: z.string().optional(),
|
|
3440
|
+
two_x_adder_cents: z.string().optional(),
|
|
3432
3441
|
region_ids: z.array(z.string()),
|
|
3433
3442
|
cumulative_minutes_worked: z.int(),
|
|
3434
3443
|
weekly_cumulative_minutes_worked: z.int(),
|
|
@@ -3470,14 +3479,14 @@ export const zJobTimeCardDayResponseObject = z.object({
|
|
|
3470
3479
|
1.5: z.number(),
|
|
3471
3480
|
2: z.number()
|
|
3472
3481
|
}),
|
|
3473
|
-
cumulative_pay_cents: z.string(),
|
|
3474
|
-
weekly_cumulative_pay_cents: z.string(),
|
|
3475
|
-
cumulative_base_wage_pay_cents: z.string(),
|
|
3476
|
-
weekly_cumulative_base_wage_pay_cents: z.string(),
|
|
3477
|
-
cumulative_one_five_x_adder_cents: z.string(),
|
|
3478
|
-
weekly_cumulative_one_five_x_adder_cents: z.string(),
|
|
3479
|
-
cumulative_two_x_adder_cents: z.string(),
|
|
3480
|
-
weekly_cumulative_two_x_adder_cents: z.string(),
|
|
3482
|
+
cumulative_pay_cents: z.string().optional(),
|
|
3483
|
+
weekly_cumulative_pay_cents: z.string().optional(),
|
|
3484
|
+
cumulative_base_wage_pay_cents: z.string().optional(),
|
|
3485
|
+
weekly_cumulative_base_wage_pay_cents: z.string().optional(),
|
|
3486
|
+
cumulative_one_five_x_adder_cents: z.string().optional(),
|
|
3487
|
+
weekly_cumulative_one_five_x_adder_cents: z.string().optional(),
|
|
3488
|
+
cumulative_two_x_adder_cents: z.string().optional(),
|
|
3489
|
+
weekly_cumulative_two_x_adder_cents: z.string().optional(),
|
|
3481
3490
|
cumulative_region_ids: z.array(z.string()),
|
|
3482
3491
|
weekly_cumulative_region_ids: z.array(z.string()),
|
|
3483
3492
|
created_at: z.iso.datetime(),
|
|
@@ -4392,7 +4401,7 @@ export const zComplianceCheckDetailResponseObject = z.object({
|
|
|
4392
4401
|
*/
|
|
4393
4402
|
export const zComplianceCheckParameters = z.object({
|
|
4394
4403
|
status: z.enum(['dismissed', 'pending']).optional(),
|
|
4395
|
-
time_due: z.iso.
|
|
4404
|
+
time_due: z.iso.datetime().nullish(),
|
|
4396
4405
|
assignee_user_ids: z.array(z.string().regex(/[^\x09-\x0D\x20
- ‧- ]|[‧]/)).optional(),
|
|
4397
4406
|
file_signed_id: z.string().regex(/[^\x09-\x0D\x20
- ‧- ]|[‧]/).optional()
|
|
4398
4407
|
});
|
|
@@ -5689,8 +5698,8 @@ export const zJobResponseObject = z.object({
|
|
|
5689
5698
|
created_at: z.iso.datetime(),
|
|
5690
5699
|
updated_at: z.iso.datetime(),
|
|
5691
5700
|
status: z.string(),
|
|
5692
|
-
start_time: z.
|
|
5693
|
-
end_time: z.
|
|
5701
|
+
start_time: z.iso.date().nullable(),
|
|
5702
|
+
end_time: z.iso.date().nullable(),
|
|
5694
5703
|
purchase_order_number: z.string().nullable(),
|
|
5695
5704
|
time_card_start_day: zTimeCardStartDay,
|
|
5696
5705
|
tz_name: z.string(),
|
|
@@ -5988,7 +5997,7 @@ export const zFormDefinitionResponseObject = z.object({
|
|
|
5988
5997
|
data: z.array(zFormDefinitionObject)
|
|
5989
5998
|
});
|
|
5990
5999
|
/**
|
|
5991
|
-
* A page of form submissions — the lighter list representation. A submission is a user's completed form
|
|
6000
|
+
* A page of form submissions — the lighter list representation. A submission is a user's completed form, created in the app or through the API.
|
|
5992
6001
|
*/
|
|
5993
6002
|
export const zFormSubmissionIndexObject = z.object({
|
|
5994
6003
|
meta: zMeta,
|
|
@@ -7354,7 +7363,7 @@ export const zAssetsItemParameters = z.object({
|
|
|
7354
7363
|
assets_attribute_option_id: z.string().nullish()
|
|
7355
7364
|
})).optional(),
|
|
7356
7365
|
images_attributes: z.array(z.object({
|
|
7357
|
-
id: z.string().optional(),
|
|
7366
|
+
id: z.string().regex(/[^\x09-\x0D\x20
- ‧- ]|[‧]/).optional(),
|
|
7358
7367
|
file: z.string().regex(/[^\x09-\x0D\x20
- ‧- ]|[‧]/).optional(),
|
|
7359
7368
|
_destroy: z.boolean().optional()
|
|
7360
7369
|
})).optional(),
|
|
@@ -7383,7 +7392,7 @@ export const zAssetsItemUpdateParameters = z.object({
|
|
|
7383
7392
|
assets_attribute_option_id: z.string().nullish()
|
|
7384
7393
|
})).optional(),
|
|
7385
7394
|
images_attributes: z.array(z.object({
|
|
7386
|
-
id: z.string().optional(),
|
|
7395
|
+
id: z.string().regex(/[^\x09-\x0D\x20
- ‧- ]|[‧]/).optional(),
|
|
7387
7396
|
file: z.string().regex(/[^\x09-\x0D\x20
- ‧- ]|[‧]/).optional(),
|
|
7388
7397
|
_destroy: z.boolean().optional()
|
|
7389
7398
|
})).optional(),
|
|
@@ -7598,7 +7607,7 @@ export const zAssetsItemResponseObject = z.object({
|
|
|
7598
7607
|
type: z.enum(['serial', 'bulk']),
|
|
7599
7608
|
serial_number: z.string().nullable(),
|
|
7600
7609
|
status: z.enum(['available', 'assigned']).nullable(),
|
|
7601
|
-
purchase_date: z.iso.
|
|
7610
|
+
purchase_date: z.iso.date().nullable(),
|
|
7602
7611
|
purchase_price_cents: z.string().nullable(),
|
|
7603
7612
|
currency: z.string().nullable(),
|
|
7604
7613
|
external_id: z.string().nullable(),
|
|
@@ -7995,7 +8004,7 @@ export const zAssetsServiceEventParameters = z.object({
|
|
|
7995
8004
|
performed_on: z.iso.date(),
|
|
7996
8005
|
assets_service_schedule_id: z.string().nullish(),
|
|
7997
8006
|
attachments_attributes: z.array(z.object({
|
|
7998
|
-
id: z.string().optional(),
|
|
8007
|
+
id: z.string().regex(/[^\x09-\x0D\x20
- ‧- ]|[‧]/).optional(),
|
|
7999
8008
|
file: z.string().regex(/[^\x09-\x0D\x20
- ‧- ]|[‧]/).optional(),
|
|
8000
8009
|
_destroy: z.boolean().optional()
|
|
8001
8010
|
})).optional(),
|
|
@@ -8014,7 +8023,7 @@ export const zAssetsServiceEventUpdateParameters = z.object({
|
|
|
8014
8023
|
performed_on: z.iso.date().optional(),
|
|
8015
8024
|
assets_service_schedule_id: z.string().nullish(),
|
|
8016
8025
|
attachments_attributes: z.array(z.object({
|
|
8017
|
-
id: z.string().optional(),
|
|
8026
|
+
id: z.string().regex(/[^\x09-\x0D\x20
- ‧- ]|[‧]/).optional(),
|
|
8018
8027
|
file: z.string().regex(/[^\x09-\x0D\x20
- ‧- ]|[‧]/).optional(),
|
|
8019
8028
|
_destroy: z.boolean().optional()
|
|
8020
8029
|
})).optional(),
|
|
@@ -10382,6 +10391,11 @@ export const zListFormSubmissionsQuery = z.object({
|
|
|
10382
10391
|
* Success
|
|
10383
10392
|
*/
|
|
10384
10393
|
export const zListFormSubmissionsResponse = zFormSubmissionIndexObject;
|
|
10394
|
+
export const zCreateFormSubmissionBody = zFormSubmissionCreateParameters;
|
|
10395
|
+
/**
|
|
10396
|
+
* Created
|
|
10397
|
+
*/
|
|
10398
|
+
export const zCreateFormSubmissionResponse = zFormSubmissionResponseObject;
|
|
10385
10399
|
export const zGetFormSubmissionPath = z.object({
|
|
10386
10400
|
id: z.string()
|
|
10387
10401
|
});
|