@dsptch-work/api-client 0.1.0 → 0.2.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.
@@ -9,6 +9,16 @@ export const zErrorsObject = z.object({
9
9
  message: z.string().optional()
10
10
  })).optional()
11
11
  });
12
+ export const zApiKeyScopeResponseObject = z.object({
13
+ resource: z.string(),
14
+ action: z.enum([
15
+ 'read',
16
+ 'create',
17
+ 'update',
18
+ 'delete'
19
+ ]),
20
+ name: z.string()
21
+ });
12
22
  /**
13
23
  * Register a file for direct upload — send its metadata to receive a blob plus a one-time URL for uploading the file's bytes to storage.
14
24
  */
@@ -318,10 +328,48 @@ export const zTimecodeResponseObject = z.object({
318
328
  ]),
319
329
  default_for_company_id: z.string().nullable(),
320
330
  valid_from: z.iso.datetime(),
321
- valid_to: z.iso.datetime(),
331
+ valid_to: z.iso.datetime().nullable(),
332
+ transaction_from: z.iso.datetime(),
333
+ transaction_to: z.iso.datetime().nullable(),
322
334
  created_at: z.iso.datetime(),
323
335
  updated_at: z.iso.datetime()
324
336
  });
337
+ export const zTimecodeHistoryVersionObject = z.object({
338
+ id: z.string(),
339
+ name: z.string(),
340
+ description: z.string().nullable(),
341
+ description_is_required: z.boolean(),
342
+ billable: z.boolean(),
343
+ overtime_eligible: z.boolean(),
344
+ unpaid: z.boolean(),
345
+ holiday: z.boolean(),
346
+ pto: z.boolean(),
347
+ safety: z.boolean(),
348
+ lunch_shortcut: z.boolean(),
349
+ break_shortcut: z.boolean(),
350
+ pwa: z.boolean(),
351
+ rest_and_recovery: z.boolean(),
352
+ incentive_pay_eligible: z.boolean(),
353
+ restricted_to: z.enum([
354
+ 'none',
355
+ 'job',
356
+ 'non_job',
357
+ 'job_with_timecode'
358
+ ]),
359
+ default_for_company_id: z.string().nullable(),
360
+ valid_from: z.iso.datetime(),
361
+ valid_to: z.iso.datetime().nullable(),
362
+ transaction_from: z.iso.datetime(),
363
+ transaction_to: z.iso.datetime().nullable(),
364
+ created_at: z.iso.datetime(),
365
+ updated_at: z.iso.datetime(),
366
+ version_status: z.enum([
367
+ 'scheduled',
368
+ 'current',
369
+ 'historical'
370
+ ]),
371
+ corrections: z.array(zTimecodeResponseObject)
372
+ });
325
373
  /**
326
374
  * 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.
327
375
  */
@@ -380,31 +428,6 @@ export const zTimecodeScheduledChangeParameters = z.object({
380
428
  'job_with_timecode'
381
429
  ]).optional()
382
430
  });
383
- /**
384
- * Create or update a catalog product. `type` (serial or bulk) is required on create and cannot be changed afterward; `performed_by_user_id` is required on create. `attribute_values` upserts the product's category-attribute values.
385
- */
386
- export const zAssetsProductParameters = z.object({
387
- type: z.enum(['serial', 'bulk']),
388
- name: z.string(),
389
- description: z.string().nullish(),
390
- category_id: z.string().nullish(),
391
- upc: z.string().nullish(),
392
- internal_sku: z.string().nullish(),
393
- default_minimum_quantity: z.int().nullish(),
394
- make: z.string().nullish(),
395
- model: z.string().nullish(),
396
- counted_by: z.enum([
397
- 'each',
398
- 'pair',
399
- 'pack'
400
- ]).optional(),
401
- attribute_values: z.array(z.object({
402
- attribute_id: z.string(),
403
- value: z.string().nullish(),
404
- attribute_option_id: z.string().nullish()
405
- })).optional(),
406
- performed_by_user_id: z.string()
407
- });
408
431
  /**
409
432
  * A named daily allowance (meals, lodging, travel, and the like) that a company can attach to time.
410
433
  */
@@ -444,29 +467,6 @@ export const zAssetsAttributeValueObjects = z.array(z.object({
444
467
  value: z.string().nullable(),
445
468
  attribute_option_id: z.string().nullable()
446
469
  }));
447
- /**
448
- * A product in the company's asset catalog — a template that tracked items instantiate. `serialized` distinguishes an individually-tracked (serial) product from a quantity-counted (bulk) one.
449
- */
450
- export const zAssetsProductResponseObject = z.object({
451
- id: z.string(),
452
- company_id: z.string(),
453
- name: z.string(),
454
- upc: z.string().nullable(),
455
- internal_sku: z.string().nullable(),
456
- default_minimum_quantity: z.int().nullable(),
457
- make: z.string().nullable(),
458
- model: z.string().nullable(),
459
- counted_by: z.enum([
460
- 'each',
461
- 'pair',
462
- 'pack'
463
- ]),
464
- serialized: z.boolean(),
465
- category_id: z.string().nullable(),
466
- attributes: zAssetsAttributeValueObjects,
467
- created_at: z.iso.datetime(),
468
- updated_at: z.iso.datetime()
469
- });
470
470
  /**
471
471
  * A reusable custom-field definition (for example "Color" or "Voltage") that categories assign and products or items fill in.
472
472
  */
@@ -666,6 +666,49 @@ export const zPayPeriodConfigResponseObject = z.object({
666
666
  valid_to: z.iso.datetime().nullable(),
667
667
  created_at: z.iso.datetime()
668
668
  });
669
+ export const zPayPeriodConfigHistoryVersionObject = z.object({
670
+ uid: z.string(),
671
+ company_id: z.string(),
672
+ name: z.string(),
673
+ frequency: z.enum(['weekly', 'biweekly']),
674
+ start_day_of_week: z.int(),
675
+ tz_name: z.string(),
676
+ currency: z.string(),
677
+ status: z.enum([
678
+ 'synced',
679
+ 'pending',
680
+ 'failed'
681
+ ]),
682
+ payroll_mode: z.enum([
683
+ 'none',
684
+ 'base',
685
+ 'aggregate'
686
+ ]),
687
+ time_mode: z.enum([
688
+ 'none',
689
+ 'base',
690
+ 'aggregate'
691
+ ]),
692
+ payroll_system: z.enum([
693
+ 'rippling',
694
+ 'quickbooks_online',
695
+ 'paychex',
696
+ 'gusto'
697
+ ]),
698
+ actuals_enabled: z.boolean().nullable(),
699
+ requires_external_map_contributor: z.boolean(),
700
+ is_paid_after_holiday: z.boolean(),
701
+ is_demo: z.boolean().nullable(),
702
+ valid_from: z.iso.datetime(),
703
+ valid_to: z.iso.datetime().nullable(),
704
+ created_at: z.iso.datetime(),
705
+ version_status: z.enum([
706
+ 'scheduled',
707
+ 'current',
708
+ 'historical'
709
+ ]),
710
+ corrections: z.array(zPayPeriodConfigResponseObject)
711
+ });
669
712
  /**
670
713
  * Create or update a holiday on a pay schedule. name, holiday_type, and month are required; mday is required for fixed holidays and wday + week for floating holidays (enforced by model validation).
671
714
  */
@@ -1054,11 +1097,7 @@ export const zFormSubmissionResponseObject = z.object({
1054
1097
  user_id: z.string(),
1055
1098
  updated_by_user_id: z.string(),
1056
1099
  created_at: z.iso.datetime(),
1057
- updated_at: z.iso.datetime(),
1058
- valid_time: z.object({
1059
- start: z.string().optional(),
1060
- end: z.string().nullish()
1061
- })
1100
+ updated_at: z.iso.datetime()
1062
1101
  });
1063
1102
  /**
1064
1103
  * Request body for scheduling a future-dated compensation change. effective_date sets when the new values take effect; earlier history is preserved as its own version. Covers the pay, benefit, accrual, and department fields.
@@ -1622,14 +1661,52 @@ export const zPayrollExternalMapResponseObject = z.object({
1622
1661
  created_by_user_id: z.string().nullable(),
1623
1662
  global: z.boolean(),
1624
1663
  valid_from: z.iso.datetime(),
1625
- valid_to: z.iso.datetime(),
1664
+ valid_to: z.iso.datetime().nullable(),
1626
1665
  transaction_from: z.iso.datetime(),
1627
- transaction_to: z.iso.datetime(),
1666
+ transaction_to: z.iso.datetime().nullable(),
1628
1667
  created_at: z.iso.datetime(),
1629
1668
  updated_at: z.iso.datetime()
1630
1669
  });
1670
+ export const zPayrollExternalMapHistoryVersionObject = z.object({
1671
+ id: z.string(),
1672
+ bitemporal_id: z.string(),
1673
+ name: z.string(),
1674
+ compensation_element_id: z.string(),
1675
+ compensation_element_name: z.string(),
1676
+ compensation_element_category: z.enum([
1677
+ 'tax',
1678
+ 'health',
1679
+ 'retirement',
1680
+ 'insurance',
1681
+ 'earning',
1682
+ 'garnishment',
1683
+ 'other'
1684
+ ]),
1685
+ pay_period_config_uid: z.string().nullable(),
1686
+ fringe_benefit_plan_id: z.string().nullable(),
1687
+ contributor: z.enum([
1688
+ 'any',
1689
+ 'employee',
1690
+ 'employer'
1691
+ ]),
1692
+ annual_periods: z.int(),
1693
+ created_by_user_id: z.string().nullable(),
1694
+ global: z.boolean(),
1695
+ valid_from: z.iso.datetime(),
1696
+ valid_to: z.iso.datetime().nullable(),
1697
+ transaction_from: z.iso.datetime(),
1698
+ transaction_to: z.iso.datetime().nullable(),
1699
+ created_at: z.iso.datetime(),
1700
+ updated_at: z.iso.datetime(),
1701
+ version_status: z.enum([
1702
+ 'scheduled',
1703
+ 'current',
1704
+ 'historical'
1705
+ ]),
1706
+ corrections: z.array(zPayrollExternalMapResponseObject)
1707
+ });
1631
1708
  /**
1632
- * A payroll run — a record of one payroll-processing event as it occurred in the external payroll system (not a run initiated by DSPTCH). Paystubs belong to a run.
1709
+ * A payroll run — a record of one payroll-processing event, synced from an external payroll system or reported to DSPTCH (never a run DSPTCH itself initiates). Paystubs belong to a run.
1633
1710
  */
1634
1711
  export const zPayrollRunResponseObject = z.object({
1635
1712
  id: z.string(),
@@ -1925,8 +2002,7 @@ export const zComplianceCheckResponseObject = z.object({
1925
2002
  'failed',
1926
2003
  'not_applicable',
1927
2004
  'dismissed',
1928
- 'pending',
1929
- 'error'
2005
+ 'pending'
1930
2006
  ]),
1931
2007
  requirement_id: z.string(),
1932
2008
  company_id: z.string().nullable(),
@@ -2341,7 +2417,7 @@ export const zUserCertificationResponseObject = z.object({
2341
2417
  date_received: z.iso.datetime(),
2342
2418
  is_verified: z.boolean(),
2343
2419
  issuer_company_id: z.string().nullable(),
2344
- expiration_date: z.iso.datetime().nullable(),
2420
+ expiration_date: z.iso.date().nullable(),
2345
2421
  credential_id: z.string().nullable(),
2346
2422
  approved_by_user_id: z.string().nullable(),
2347
2423
  created_by_user_id: z.string().nullable(),
@@ -2812,11 +2888,7 @@ export const zFormSubmissionIndexObject = z.object({
2812
2888
  user_id: z.string().optional(),
2813
2889
  updated_by_user_id: z.string().optional(),
2814
2890
  created_at: z.iso.datetime().optional(),
2815
- updated_at: z.iso.datetime().optional(),
2816
- valid_time: z.object({
2817
- start: z.string().optional(),
2818
- end: z.string().nullish()
2819
- }).optional()
2891
+ updated_at: z.iso.datetime().optional()
2820
2892
  })).optional()
2821
2893
  });
2822
2894
  /**
@@ -2973,13 +3045,6 @@ export const zLaborRatesResponseObject = z.object({
2973
3045
  links: zLinks,
2974
3046
  data: z.array(zLaborRateResponseObject)
2975
3047
  });
2976
- /**
2977
- * The time range over which this version of the wage determination is in effect. Half-open, so a null end means it is still current.
2978
- */
2979
- export const zWageDeterminationValidTime = z.object({
2980
- start: z.iso.datetime(),
2981
- end: z.iso.datetime().nullable()
2982
- });
2983
3048
  /**
2984
3049
  * A Federal (Davis-Bacon) wage determination on a job.
2985
3050
  */
@@ -2987,6 +3052,7 @@ export const zFederalJobWageDeterminationResponseObject = z.object({
2987
3052
  id: z.string(),
2988
3053
  uid: z.string(),
2989
3054
  job_id: z.string(),
3055
+ trade_id: z.string(),
2990
3056
  type: z.enum(['Pwa::JobWageDeterminations::Federal']),
2991
3057
  labor_classification: z.string(),
2992
3058
  hourly_rate_cents: z.string(),
@@ -2999,7 +3065,8 @@ export const zFederalJobWageDeterminationResponseObject = z.object({
2999
3065
  'residential'
3000
3066
  ]),
3001
3067
  general_wage_determination: z.string().nullable(),
3002
- valid_time: zWageDeterminationValidTime,
3068
+ valid_from: z.iso.datetime(),
3069
+ valid_to: z.iso.datetime().nullable(),
3003
3070
  created_at: z.iso.datetime(),
3004
3071
  updated_at: z.iso.datetime()
3005
3072
  });
@@ -3029,13 +3096,15 @@ export const zRegionalJobWageDeterminationResponseObject = z.object({
3029
3096
  id: z.string(),
3030
3097
  uid: z.string(),
3031
3098
  job_id: z.string(),
3099
+ trade_id: z.string(),
3032
3100
  type: z.enum(['Pwa::JobWageDeterminations::Regional']),
3033
3101
  labor_classification: z.string(),
3034
3102
  hourly_rate_cents: z.string(),
3035
3103
  fringe_rate_cents: z.string(),
3036
3104
  general_wage_determination: z.string().nullable(),
3037
3105
  regional_fields: zRegionalWageDeterminationFields,
3038
- valid_time: zWageDeterminationValidTime,
3106
+ valid_from: z.iso.datetime(),
3107
+ valid_to: z.iso.datetime().nullable(),
3039
3108
  created_at: z.iso.datetime(),
3040
3109
  updated_at: z.iso.datetime()
3041
3110
  });
@@ -3046,12 +3115,67 @@ export const zJobWageDeterminationResponseObject = z.discriminatedUnion('type',
3046
3115
  zFederalJobWageDeterminationResponseObject.extend({ type: z.literal('Pwa::JobWageDeterminations::Federal') }),
3047
3116
  zRegionalJobWageDeterminationResponseObject.extend({ type: z.literal('Pwa::JobWageDeterminations::Regional') })
3048
3117
  ]);
3118
+ export const zFederalJobWageDeterminationHistoryVersionObject = z.object({
3119
+ id: z.string(),
3120
+ uid: z.string(),
3121
+ job_id: z.string(),
3122
+ trade_id: z.string(),
3123
+ type: z.enum(['Pwa::JobWageDeterminations::Federal']),
3124
+ labor_classification: z.string(),
3125
+ hourly_rate_cents: z.string(),
3126
+ fringe_rate_cents: z.string(),
3127
+ class_code: z.string().nullable(),
3128
+ construction_category: z.enum([
3129
+ 'building',
3130
+ 'heavy',
3131
+ 'highway',
3132
+ 'residential'
3133
+ ]),
3134
+ general_wage_determination: z.string().nullable(),
3135
+ valid_from: z.iso.datetime(),
3136
+ valid_to: z.iso.datetime().nullable(),
3137
+ created_at: z.iso.datetime(),
3138
+ updated_at: z.iso.datetime(),
3139
+ version_status: z.enum([
3140
+ 'scheduled',
3141
+ 'current',
3142
+ 'historical'
3143
+ ]),
3144
+ corrections: z.array(zJobWageDeterminationResponseObject)
3145
+ });
3146
+ export const zRegionalJobWageDeterminationHistoryVersionObject = z.object({
3147
+ id: z.string(),
3148
+ uid: z.string(),
3149
+ job_id: z.string(),
3150
+ trade_id: z.string(),
3151
+ type: z.enum(['Pwa::JobWageDeterminations::Regional']),
3152
+ labor_classification: z.string(),
3153
+ hourly_rate_cents: z.string(),
3154
+ fringe_rate_cents: z.string(),
3155
+ general_wage_determination: z.string().nullable(),
3156
+ regional_fields: zRegionalWageDeterminationFields,
3157
+ valid_from: z.iso.datetime(),
3158
+ valid_to: z.iso.datetime().nullable(),
3159
+ created_at: z.iso.datetime(),
3160
+ updated_at: z.iso.datetime(),
3161
+ version_status: z.enum([
3162
+ 'scheduled',
3163
+ 'current',
3164
+ 'historical'
3165
+ ]),
3166
+ corrections: z.array(zJobWageDeterminationResponseObject)
3167
+ });
3168
+ export const zJobWageDeterminationHistoryVersionObject = z.discriminatedUnion('type', [
3169
+ zFederalJobWageDeterminationHistoryVersionObject.extend({ type: z.literal('Pwa::JobWageDeterminations::Federal') }),
3170
+ zRegionalJobWageDeterminationHistoryVersionObject.extend({ type: z.literal('Pwa::JobWageDeterminations::Regional') })
3171
+ ]);
3049
3172
  /**
3050
3173
  * Parameters for creating a Federal (Davis-Bacon) wage determination on a job.
3051
3174
  */
3052
3175
  export const zFederalJobWageDeterminationParameters = z.object({
3053
3176
  type: z.enum(['Pwa::JobWageDeterminations::Federal']),
3054
3177
  labor_classification: z.string(),
3178
+ trade_id: z.string(),
3055
3179
  hourly_rate_cents: z.string(),
3056
3180
  fringe_rate_cents: z.string(),
3057
3181
  class_code: z.string().nullish(),
@@ -3069,6 +3193,7 @@ export const zFederalJobWageDeterminationParameters = z.object({
3069
3193
  export const zRegionalJobWageDeterminationParameters = z.object({
3070
3194
  type: z.enum(['Pwa::JobWageDeterminations::Regional']),
3071
3195
  labor_classification: z.string(),
3196
+ trade_id: z.string(),
3072
3197
  hourly_rate_cents: z.string(),
3073
3198
  fringe_rate_cents: z.string().optional(),
3074
3199
  general_wage_determination: z.string().nullish(),
@@ -3144,7 +3269,7 @@ export const zRateRuleCondition = z.discriminatedUnion('type', [
3144
3269
  zRateRuleOvertimeMultiplierCondition.extend({ type: z.literal('overtime_multiplier') })
3145
3270
  ]);
3146
3271
  /**
3147
- * A conditional rate-modification rule on a job wage determination — it adds wage or fringe cents when its conditions match. `valid_time` is the temporal window over which this version of the rule is in effect.
3272
+ * A conditional rate-modification rule on a job wage determination — it adds wage or fringe cents when its conditions match. `valid_from` and `valid_to` bound the window over which this version of the rule is in effect.
3148
3273
  */
3149
3274
  export const zRateRuleResponseObject = z.object({
3150
3275
  id: z.string(),
@@ -3153,10 +3278,29 @@ export const zRateRuleResponseObject = z.object({
3153
3278
  pay_rates_rule_package_id: z.string(),
3154
3279
  effect: zRateRuleEffect,
3155
3280
  conditions: z.array(zRateRuleCondition),
3156
- valid_time: zWageDeterminationValidTime,
3281
+ valid_from: z.iso.datetime(),
3282
+ valid_to: z.iso.datetime().nullable(),
3157
3283
  created_at: z.iso.datetime(),
3158
3284
  updated_at: z.iso.datetime()
3159
3285
  });
3286
+ export const zRateRuleHistoryVersionObject = z.object({
3287
+ id: z.string(),
3288
+ uid: z.string(),
3289
+ job_wage_determination_id: z.string(),
3290
+ pay_rates_rule_package_id: z.string(),
3291
+ effect: zRateRuleEffect,
3292
+ conditions: z.array(zRateRuleCondition),
3293
+ valid_from: z.iso.datetime(),
3294
+ valid_to: z.iso.datetime().nullable(),
3295
+ created_at: z.iso.datetime(),
3296
+ updated_at: z.iso.datetime(),
3297
+ version_status: z.enum([
3298
+ 'scheduled',
3299
+ 'current',
3300
+ 'historical'
3301
+ ]),
3302
+ corrections: z.array(zRateRuleResponseObject)
3303
+ });
3160
3304
  /**
3161
3305
  * Create a rate rule on a job wage determination. `effect` is required. `conditions` is optional — an omitted or empty list makes the rule always apply. `effective_date` (YYYY-MM-DD) sets when the rule takes effect; it defaults to today and cannot predate the earliest applicable wage determination.
3162
3306
  */
@@ -3165,55 +3309,6 @@ export const zRateRuleParameters = z.object({
3165
3309
  effect: zRateRuleEffect,
3166
3310
  conditions: z.array(zRateRuleCondition).optional()
3167
3311
  });
3168
- /**
3169
- * A tracked physical asset owned by a company and typed by a product — either an individually-tracked serial unit or a quantity-tracked bulk stock record. The serial-only fields (serial_number, status, purchase_date, purchase_price_cents, currency, external_id, external_system_url) are null on a bulk item.
3170
- */
3171
- export const zAssetsItemResponseObject = z.object({
3172
- id: z.string(),
3173
- name: z.string(),
3174
- description: z.string().nullable(),
3175
- assets_product_id: z.string(),
3176
- company_id: z.string(),
3177
- type: z.enum(['serial', 'bulk']),
3178
- serial_number: z.string().nullable(),
3179
- status: z.enum([
3180
- 'available',
3181
- 'assigned',
3182
- 'transit',
3183
- 'maintenance',
3184
- 'retired'
3185
- ]),
3186
- purchase_date: z.iso.datetime().nullable(),
3187
- purchase_price_cents: z.string().nullable(),
3188
- currency: z.string().nullable(),
3189
- external_id: z.string().nullable(),
3190
- external_system_url: z.string().nullable(),
3191
- created_at: z.iso.datetime(),
3192
- updated_at: z.iso.datetime()
3193
- });
3194
- /**
3195
- * Create or update an asset item. The write API creates serial items only; assets_product_id and serial_number are set on create and ignored on update. 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.
3196
- */
3197
- export const zAssetsItemParameters = z.object({
3198
- name: z.string(),
3199
- description: z.string().optional(),
3200
- assets_product_id: z.string(),
3201
- serial_number: z.string(),
3202
- status: z.enum([
3203
- 'available',
3204
- 'assigned',
3205
- 'transit',
3206
- 'maintenance',
3207
- 'retired'
3208
- ]).optional(),
3209
- purchase_date: z.iso.datetime().optional(),
3210
- purchase_price_cents: z.int().optional(),
3211
- external_id: z.string().optional(),
3212
- external_system_url: z.string().optional(),
3213
- assets_site_id: z.string().optional(),
3214
- user_id: z.string().optional(),
3215
- performed_by_user_id: z.string()
3216
- });
3217
3312
  /**
3218
3313
  * A vendor in the company's asset catalog — a supplier or manufacturer that products are sourced from.
3219
3314
  */
@@ -3221,6 +3316,7 @@ export const zAssetsVendorResponseObject = z.object({
3221
3316
  id: z.string(),
3222
3317
  name: z.string(),
3223
3318
  company_id: z.string(),
3319
+ logo_url: z.string().nullable(),
3224
3320
  created_at: z.iso.datetime(),
3225
3321
  updated_at: z.iso.datetime()
3226
3322
  });
@@ -3228,7 +3324,8 @@ export const zAssetsVendorResponseObject = z.object({
3228
3324
  * Create or update a vendor. Only name is required.
3229
3325
  */
3230
3326
  export const zAssetsVendorParameters = z.object({
3231
- name: z.string()
3327
+ name: z.string(),
3328
+ logo_signed_id: z.string().optional()
3232
3329
  });
3233
3330
  /**
3234
3331
  * A physical container that holds a company's assets and inventory — either a fixed, Atlas-mapped location (warehouse or yard) or a standalone mobile container (trailer, truck, van, or conex).
@@ -3346,6 +3443,153 @@ export const zAssetsFormAssignmentTriggerParameters = z.object({
3346
3443
  assigned_user_ids: z.array(z.string()).optional(),
3347
3444
  product_ids: z.array(z.string()).optional()
3348
3445
  });
3446
+ /**
3447
+ * 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.
3448
+ */
3449
+ export const zAssetsAttachmentResponseObject = z.object({
3450
+ id: z.string(),
3451
+ file: z.object({
3452
+ filename: z.string(),
3453
+ content_type: z.string().nullish(),
3454
+ byte_size: z.int(),
3455
+ url: z.string()
3456
+ }).nullable(),
3457
+ created_at: z.iso.datetime(),
3458
+ updated_at: z.iso.datetime()
3459
+ });
3460
+ /**
3461
+ * A product in the company's asset catalog — a template that tracked items instantiate. `serialized` distinguishes an individually-tracked (serial) product from a quantity-counted (bulk) one.
3462
+ */
3463
+ export const zAssetsProductResponseObject = z.object({
3464
+ id: z.string(),
3465
+ company_id: z.string(),
3466
+ name: z.string(),
3467
+ upc: z.string().nullable(),
3468
+ internal_sku: z.string().nullable(),
3469
+ default_minimum_quantity: z.int().nullable(),
3470
+ make: z.string().nullable(),
3471
+ model: z.string().nullable(),
3472
+ counted_by: z.enum([
3473
+ 'each',
3474
+ 'pair',
3475
+ 'pack'
3476
+ ]),
3477
+ serialized: z.boolean(),
3478
+ category_id: z.string().nullable(),
3479
+ attributes: zAssetsAttributeValueObjects,
3480
+ images: z.array(zAssetsAttachmentResponseObject),
3481
+ created_at: z.iso.datetime(),
3482
+ updated_at: z.iso.datetime()
3483
+ });
3484
+ /**
3485
+ * A tracked physical asset owned by a company and typed by a product — either an individually-tracked serial unit or a quantity-tracked bulk stock record. The serial-only fields (serial_number, status, purchase_date, purchase_price_cents, currency, external_id, external_system_url) are null on a bulk item.
3486
+ */
3487
+ export const zAssetsItemResponseObject = z.object({
3488
+ id: z.string(),
3489
+ name: z.string(),
3490
+ description: z.string().nullable(),
3491
+ assets_product_id: z.string(),
3492
+ company_id: z.string(),
3493
+ type: z.enum(['serial', 'bulk']),
3494
+ serial_number: z.string().nullable(),
3495
+ status: z.enum([
3496
+ 'available',
3497
+ 'assigned',
3498
+ 'transit',
3499
+ 'maintenance',
3500
+ 'retired'
3501
+ ]),
3502
+ purchase_date: z.iso.datetime().nullable(),
3503
+ purchase_price_cents: z.string().nullable(),
3504
+ currency: z.string().nullable(),
3505
+ external_id: z.string().nullable(),
3506
+ external_system_url: z.string().nullable(),
3507
+ images: z.array(zAssetsAttachmentResponseObject),
3508
+ created_at: z.iso.datetime(),
3509
+ updated_at: z.iso.datetime()
3510
+ });
3511
+ /**
3512
+ * One attachment in a nested collection. Send file with a signed_id to add one; send id (with _destroy) to remove an existing one.
3513
+ */
3514
+ export const zAssetsAttachmentParameters = z.object({
3515
+ id: z.string().optional(),
3516
+ file: z.string().optional(),
3517
+ _destroy: z.boolean().optional()
3518
+ });
3519
+ /**
3520
+ * Create a catalog product. `type` (serial or bulk) is required and immutable. `attribute_values` upserts the product's category-attribute values.
3521
+ */
3522
+ export const zAssetsProductParameters = z.object({
3523
+ type: z.enum(['serial', 'bulk']),
3524
+ name: z.string(),
3525
+ description: z.string().nullish(),
3526
+ category_id: z.string().nullish(),
3527
+ upc: z.string().nullish(),
3528
+ internal_sku: z.string().nullish(),
3529
+ default_minimum_quantity: z.int().nullish(),
3530
+ make: z.string().nullish(),
3531
+ model: z.string().nullish(),
3532
+ counted_by: z.enum([
3533
+ 'each',
3534
+ 'pair',
3535
+ 'pack'
3536
+ ]).optional(),
3537
+ attribute_values: z.array(z.object({
3538
+ attribute_id: z.string(),
3539
+ value: z.string().nullish(),
3540
+ attribute_option_id: z.string().nullish()
3541
+ })).optional(),
3542
+ images_attributes: z.array(zAssetsAttachmentParameters).optional(),
3543
+ performed_by_user_id: z.string()
3544
+ });
3545
+ /**
3546
+ * 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.
3547
+ */
3548
+ export const zAssetsProductUpdateParameters = z.object({
3549
+ name: z.string().optional(),
3550
+ description: z.string().nullish(),
3551
+ category_id: z.string().nullish(),
3552
+ upc: z.string().nullish(),
3553
+ internal_sku: z.string().nullish(),
3554
+ default_minimum_quantity: z.int().nullish(),
3555
+ make: z.string().nullish(),
3556
+ model: z.string().nullish(),
3557
+ counted_by: z.enum([
3558
+ 'each',
3559
+ 'pair',
3560
+ 'pack'
3561
+ ]).optional(),
3562
+ attribute_values: z.array(z.object({
3563
+ attribute_id: z.string(),
3564
+ value: z.string().nullish(),
3565
+ attribute_option_id: z.string().nullish()
3566
+ })).optional(),
3567
+ images_attributes: z.array(zAssetsAttachmentParameters).optional()
3568
+ });
3569
+ /**
3570
+ * Create or update an asset item. The write API creates serial items only; assets_product_id and serial_number are set on create and ignored on update. 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.
3571
+ */
3572
+ export const zAssetsItemParameters = z.object({
3573
+ name: z.string(),
3574
+ description: z.string().optional(),
3575
+ assets_product_id: z.string(),
3576
+ serial_number: z.string(),
3577
+ status: z.enum([
3578
+ 'available',
3579
+ 'assigned',
3580
+ 'transit',
3581
+ 'maintenance',
3582
+ 'retired'
3583
+ ]).optional(),
3584
+ purchase_date: z.iso.datetime().optional(),
3585
+ purchase_price_cents: z.int().optional(),
3586
+ external_id: z.string().optional(),
3587
+ external_system_url: z.string().optional(),
3588
+ images_attributes: z.array(zAssetsAttachmentParameters).optional(),
3589
+ assets_site_id: z.string().optional(),
3590
+ user_id: z.string().optional(),
3591
+ performed_by_user_id: z.string()
3592
+ });
3349
3593
  /**
3350
3594
  * 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.
3351
3595
  */
@@ -3358,10 +3602,10 @@ export const zAssetsDocumentResponseObject = z.object({
3358
3602
  certified: z.boolean(),
3359
3603
  created_by_user_id: z.string(),
3360
3604
  file: z.object({
3361
- signed_id: z.string(),
3362
3605
  filename: z.string(),
3363
3606
  content_type: z.string().nullish(),
3364
- byte_size: z.int()
3607
+ byte_size: z.int(),
3608
+ url: z.string()
3365
3609
  }).nullable(),
3366
3610
  created_at: z.iso.datetime(),
3367
3611
  updated_at: z.iso.datetime()
@@ -3578,27 +3822,24 @@ export const zAssetsServiceEventFullResponseObject = z.object({
3578
3822
  ]),
3579
3823
  notes: z.string().nullable(),
3580
3824
  performed_at: z.iso.datetime(),
3825
+ attachments: z.array(zAssetsAttachmentResponseObject),
3581
3826
  created_at: z.iso.datetime(),
3582
3827
  updated_at: z.iso.datetime()
3583
3828
  });
3584
3829
  /**
3585
- * Record a service on an item. kind, performed_on, and performed_by_user_id are required. Link a schedule with assets_service_schedule_id to satisfy it — the schedule then dictates the kind or omit it for an ad-hoc service or a repair.
3830
+ * Record a service on an item. performed_on and performed_by_user_id are required. When a schedule is linked with assets_service_schedule_id, the schedule dictates the kind; otherwise provide kind for the ad-hoc service or repair.
3586
3831
  */
3587
3832
  export const zAssetsServiceEventParameters = z.object({
3588
3833
  kind: z.enum([
3589
3834
  'calibration',
3590
3835
  'maintenance',
3591
3836
  'repair'
3592
- ]),
3837
+ ]).optional(),
3593
3838
  notes: z.string().nullish(),
3594
3839
  performed_on: z.iso.date(),
3595
3840
  assets_service_schedule_id: z.string().nullish(),
3596
3841
  performed_by_user_id: z.string(),
3597
- attachments_attributes: z.array(z.object({
3598
- id: z.string().optional(),
3599
- file: z.string().optional(),
3600
- _destroy: z.boolean().optional()
3601
- })).optional()
3842
+ attachments_attributes: z.array(zAssetsAttachmentParameters).optional()
3602
3843
  });
3603
3844
  /**
3604
3845
  * 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.
@@ -3696,6 +3937,12 @@ export const zAssetsAdjustmentParameters = z.object({
3696
3937
  export const zAssetsRetirementParameters = z.object({
3697
3938
  performed_by_user_id: z.string()
3698
3939
  });
3940
+ /**
3941
+ * Success
3942
+ */
3943
+ export const zListApiKeyScopesResponse = z.object({
3944
+ data: z.array(zApiKeyScopeResponseObject).optional()
3945
+ });
3699
3946
  export const zListApprenticesPath = z.object({
3700
3947
  program_id: z.string()
3701
3948
  });
@@ -4139,7 +4386,7 @@ export const zListItemsResponse = z.object({
4139
4386
  });
4140
4387
  export const zCreateItemBody = zAssetsItemParameters;
4141
4388
  /**
4142
- * Created with placement at site
4389
+ * Created with an image
4143
4390
  */
4144
4391
  export const zCreateItemResponse = zAssetsItemResponseObject;
4145
4392
  export const zDeleteItemPath = z.object({
@@ -4161,7 +4408,7 @@ export const zUpdateItemPath = z.object({
4161
4408
  id: z.string()
4162
4409
  });
4163
4410
  /**
4164
- * Success
4411
+ * Removes an image
4165
4412
  */
4166
4413
  export const zUpdateItemResponse = zAssetsItemResponseObject;
4167
4414
  export const zUnretireItemPath = z.object({
@@ -4417,7 +4664,7 @@ export const zListProductsResponse = z.object({
4417
4664
  });
4418
4665
  export const zCreateProductBody = zAssetsProductParameters;
4419
4666
  /**
4420
- * Created (with category and attribute values)
4667
+ * Created (with an image)
4421
4668
  */
4422
4669
  export const zCreateProductResponse = zAssetsProductResponseObject;
4423
4670
  export const zDeleteProductPath = z.object({
@@ -4434,7 +4681,7 @@ export const zGetProductPath = z.object({
4434
4681
  * Success
4435
4682
  */
4436
4683
  export const zGetProductResponse = zAssetsProductResponseObject;
4437
- export const zUpdateProductBody = zAssetsProductParameters;
4684
+ export const zUpdateProductBody = zAssetsProductUpdateParameters;
4438
4685
  export const zUpdateProductPath = z.object({
4439
4686
  id: z.string()
4440
4687
  });
@@ -4628,7 +4875,7 @@ export const zListVendorsResponse = z.object({
4628
4875
  });
4629
4876
  export const zCreateVendorBody = zAssetsVendorParameters;
4630
4877
  /**
4631
- * Created
4878
+ * Created with a logo
4632
4879
  */
4633
4880
  export const zCreateVendorResponse = zAssetsVendorResponseObject;
4634
4881
  export const zDeleteVendorPath = z.object({
@@ -4650,7 +4897,7 @@ export const zUpdateVendorPath = z.object({
4650
4897
  id: z.string()
4651
4898
  });
4652
4899
  /**
4653
- * Success
4900
+ * Updated with a logo
4654
4901
  */
4655
4902
  export const zUpdateVendorResponse = zAssetsVendorResponseObject;
4656
4903
  export const zListFeaturesQuery = z.object({
@@ -4915,8 +5162,7 @@ export const zListChecksQuery = z.object({
4915
5162
  'failed',
4916
5163
  'not_applicable',
4917
5164
  'dismissed',
4918
- 'pending',
4919
- 'error'
5165
+ 'pending'
4920
5166
  ]).optional(),
4921
5167
  'filter[type]': z.string().optional(),
4922
5168
  'filter[job_id]': z.string().optional(),
@@ -5178,9 +5424,25 @@ export const zCreateJobTradePath = z.object({
5178
5424
  * Created
5179
5425
  */
5180
5426
  export const zCreateJobTradeResponse = zPwaTradeResponseObject;
5427
+ export const zListRateRuleHistoryPath = z.object({
5428
+ job_id: z.string(),
5429
+ wage_determination_uid: z.string(),
5430
+ rate_rule_uid: z.string()
5431
+ });
5432
+ export const zListRateRuleHistoryQuery = z.object({
5433
+ 'as_of[valid]': z.string().optional()
5434
+ });
5435
+ /**
5436
+ * Success
5437
+ */
5438
+ export const zListRateRuleHistoryResponse = z.object({
5439
+ meta: zMeta.optional(),
5440
+ links: zLinks.optional(),
5441
+ data: z.array(zRateRuleHistoryVersionObject).optional()
5442
+ });
5181
5443
  export const zListRateRulesPath = z.object({
5182
5444
  job_id: z.string(),
5183
- wage_determination_id: z.string()
5445
+ wage_determination_uid: z.string()
5184
5446
  });
5185
5447
  export const zListRateRulesQuery = z.object({
5186
5448
  'as_of[valid]': z.iso.datetime().optional(),
@@ -5200,7 +5462,7 @@ export const zListRateRulesResponse = z.object({
5200
5462
  export const zCreateRateRuleBody = zRateRuleParameters;
5201
5463
  export const zCreateRateRulePath = z.object({
5202
5464
  job_id: z.string(),
5203
- wage_determination_id: z.string()
5465
+ wage_determination_uid: z.string()
5204
5466
  });
5205
5467
  /**
5206
5468
  * Created
@@ -5208,13 +5470,31 @@ export const zCreateRateRulePath = z.object({
5208
5470
  export const zCreateRateRuleResponse = zRateRuleResponseObject;
5209
5471
  export const zGetRateRulePath = z.object({
5210
5472
  job_id: z.string(),
5211
- wage_determination_id: z.string(),
5212
- id: z.string()
5473
+ wage_determination_uid: z.string(),
5474
+ uid: z.string()
5475
+ });
5476
+ export const zGetRateRuleQuery = z.object({
5477
+ 'as_of[valid]': z.iso.datetime().optional()
5213
5478
  });
5214
5479
  /**
5215
5480
  * Success
5216
5481
  */
5217
5482
  export const zGetRateRuleResponse = zRateRuleResponseObject;
5483
+ export const zListJobWageDeterminationHistoryPath = z.object({
5484
+ job_id: z.string(),
5485
+ wage_determination_uid: z.string()
5486
+ });
5487
+ export const zListJobWageDeterminationHistoryQuery = z.object({
5488
+ 'as_of[valid]': z.string().optional()
5489
+ });
5490
+ /**
5491
+ * Success
5492
+ */
5493
+ export const zListJobWageDeterminationHistoryResponse = z.object({
5494
+ meta: zMeta.optional(),
5495
+ links: zLinks.optional(),
5496
+ data: z.array(zJobWageDeterminationHistoryVersionObject).optional()
5497
+ });
5218
5498
  export const zListJobWageDeterminationsPath = z.object({
5219
5499
  job_id: z.string()
5220
5500
  });
@@ -5243,7 +5523,7 @@ export const zCreateWageDeterminationPath = z.object({
5243
5523
  export const zCreateWageDeterminationResponse = zJobWageDeterminationResponseObject;
5244
5524
  export const zDeleteWageDeterminationPath = z.object({
5245
5525
  job_id: z.string(),
5246
- id: z.string()
5526
+ uid: z.string()
5247
5527
  });
5248
5528
  /**
5249
5529
  * Success
@@ -5251,7 +5531,10 @@ export const zDeleteWageDeterminationPath = z.object({
5251
5531
  export const zDeleteWageDeterminationResponse = zJobWageDeterminationResponseObject;
5252
5532
  export const zGetJobWageDeterminationPath = z.object({
5253
5533
  job_id: z.string(),
5254
- id: z.string()
5534
+ uid: z.string()
5535
+ });
5536
+ export const zGetJobWageDeterminationQuery = z.object({
5537
+ 'as_of[valid]': z.iso.datetime().optional()
5255
5538
  });
5256
5539
  /**
5257
5540
  * Success
@@ -5327,6 +5610,21 @@ export const zGetCompensationElementPath = z.object({
5327
5610
  * Success
5328
5611
  */
5329
5612
  export const zGetCompensationElementResponse = zCompensationElementResponseObject;
5613
+ export const zListExternalMapHistoryPath = z.object({
5614
+ external_map_id: z.string()
5615
+ });
5616
+ export const zListExternalMapHistoryQuery = z.object({
5617
+ 'as_of[transaction]': z.iso.datetime().optional(),
5618
+ 'as_of[valid]': z.string().optional()
5619
+ });
5620
+ /**
5621
+ * Success
5622
+ */
5623
+ export const zListExternalMapHistoryResponse = z.object({
5624
+ meta: zMeta.optional(),
5625
+ links: zLinks.optional(),
5626
+ data: z.array(zPayrollExternalMapHistoryVersionObject).optional()
5627
+ });
5330
5628
  export const zListExternalMapsQuery = z.object({
5331
5629
  'filter[name]': z.string().optional(),
5332
5630
  'filter[pay_period_config_uid]': z.string().optional(),
@@ -5353,6 +5651,10 @@ export const zListExternalMapsResponse = z.object({
5353
5651
  export const zGetExternalMapPath = z.object({
5354
5652
  id: z.string()
5355
5653
  });
5654
+ export const zGetExternalMapQuery = z.object({
5655
+ 'as_of[valid]': z.iso.datetime().optional(),
5656
+ 'as_of[transaction]': z.iso.datetime().optional()
5657
+ });
5356
5658
  /**
5357
5659
  * Success
5358
5660
  */
@@ -6016,6 +6318,21 @@ export const zUpdateTimeEntryPath = z.object({
6016
6318
  * Success
6017
6319
  */
6018
6320
  export const zUpdateTimeEntryResponse = zTimeEntryResponseObject;
6321
+ export const zListTimecodeHistoryPath = z.object({
6322
+ timecode_id: z.string()
6323
+ });
6324
+ export const zListTimecodeHistoryQuery = z.object({
6325
+ 'as_of[transaction]': z.iso.datetime().optional(),
6326
+ 'as_of[valid]': z.string().optional()
6327
+ });
6328
+ /**
6329
+ * Success
6330
+ */
6331
+ export const zListTimecodeHistoryResponse = z.object({
6332
+ meta: zMeta.optional(),
6333
+ links: zLinks.optional(),
6334
+ data: z.array(zTimecodeHistoryVersionObject).optional()
6335
+ });
6019
6336
  export const zCancelTimecodeScheduledChangesPath = z.object({
6020
6337
  timecode_id: z.string()
6021
6338
  });
@@ -6085,6 +6402,10 @@ export const zTerminateTimecodeResponse = zTimecodeResponseObject;
6085
6402
  export const zGetTimecodePath = z.object({
6086
6403
  id: z.string()
6087
6404
  });
6405
+ export const zGetTimecodeQuery = z.object({
6406
+ 'as_of[valid]': z.iso.datetime().optional(),
6407
+ 'as_of[transaction]': z.iso.datetime().optional()
6408
+ });
6088
6409
  /**
6089
6410
  * Success
6090
6411
  */
@@ -6167,6 +6488,20 @@ export const zGetAttestationConfigPath = z.object({
6167
6488
  * Success
6168
6489
  */
6169
6490
  export const zGetAttestationConfigResponse = zAttestationConfigResponseObject;
6491
+ export const zListPayPeriodConfigHistoryPath = z.object({
6492
+ pay_period_config_uid: z.string()
6493
+ });
6494
+ export const zListPayPeriodConfigHistoryQuery = z.object({
6495
+ 'as_of[valid]': z.string().optional()
6496
+ });
6497
+ /**
6498
+ * Success
6499
+ */
6500
+ export const zListPayPeriodConfigHistoryResponse = z.object({
6501
+ meta: zMeta.optional(),
6502
+ links: zLinks.optional(),
6503
+ data: z.array(zPayPeriodConfigHistoryVersionObject).optional()
6504
+ });
6170
6505
  export const zListHolidaysPath = z.object({
6171
6506
  pay_period_config_uid: z.string()
6172
6507
  });
@@ -6237,6 +6572,9 @@ export const zListPayPeriodConfigsResponse = z.object({
6237
6572
  export const zGetPayPeriodConfigPath = z.object({
6238
6573
  uid: z.string()
6239
6574
  });
6575
+ export const zGetPayPeriodConfigQuery = z.object({
6576
+ 'as_of[valid]': z.iso.datetime().optional()
6577
+ });
6240
6578
  /**
6241
6579
  * Success
6242
6580
  */