@dsptch-work/api-client 0.34.0 → 0.35.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.
@@ -310,7 +310,7 @@ export const zProblem = z.object({
310
310
  *
311
311
  * **Foreign Subtype Attributes**
312
312
  *
313
- * A nested-attributes write carries keys the record's resolved subtype does not accept. Send only the keys valid for that subtype; the message names the offending ones.
313
+ * A write carries keys the record's resolved subtype does not accept, whether nested or beside the record's own fields (a serial item's fields sent for a bulk item). Send only the keys valid for that subtype; the message names the offending ones, and each one's entry in `errors` points at it. Nothing is written.
314
314
  *
315
315
  * ### synced_determination
316
316
  *
@@ -604,6 +604,16 @@ export const zCompetencyCriterionResponseObject = z.object({
604
604
  number: z.string().nullable(),
605
605
  body: z.string().nullable(),
606
606
  evidence_note: z.string().nullable(),
607
+ assessment_method: z.enum([
608
+ 'direct_observation',
609
+ 'simulation',
610
+ 'oral_questioning',
611
+ 'written_questioning',
612
+ 'products_of_work',
613
+ 'recognized_prior_learning',
614
+ 'witness_testimony',
615
+ 'other'
616
+ ]).nullable(),
607
617
  created_at: z.iso.datetime(),
608
618
  updated_at: z.iso.datetime()
609
619
  });
@@ -613,7 +623,17 @@ export const zCompetencyCriterionResponseObject = z.object({
613
623
  export const zCompetencyCriterionParameters = z.object({
614
624
  number: z.string().nullish(),
615
625
  body: z.string().nullish(),
616
- evidence_note: z.string().nullish()
626
+ evidence_note: z.string().nullish(),
627
+ assessment_method: z.enum([
628
+ 'direct_observation',
629
+ 'simulation',
630
+ 'oral_questioning',
631
+ 'written_questioning',
632
+ 'products_of_work',
633
+ 'recognized_prior_learning',
634
+ 'witness_testimony',
635
+ 'other'
636
+ ]).nullish()
617
637
  });
618
638
  /**
619
639
  * Swap a draft catalog row with its neighbor. The row cannot move past either end of the list.
@@ -1531,6 +1551,66 @@ export const zTimecodeScheduledChangeParameters = z.object({
1531
1551
  'job_with_timecode'
1532
1552
  ]).optional()
1533
1553
  });
1554
+ /**
1555
+ * Create a catalog product. `type` (serial or bulk) is required and immutable. `attribute_values` upserts the product's category-attribute values.
1556
+ */
1557
+ export const zAssetsProductParameters = z.object({
1558
+ name: z.string().regex(/[^\x09-\x0D\x20…   - ‧-‪   ]|[‧‪]/),
1559
+ description: z.string().nullish(),
1560
+ make: z.string().nullish(),
1561
+ model: z.string().nullish(),
1562
+ upc: z.string().nullish(),
1563
+ internal_sku: z.string().nullish(),
1564
+ default_minimum_quantity: z.int().nullish(),
1565
+ counted_by: z.enum([
1566
+ 'each',
1567
+ 'pair',
1568
+ 'pack'
1569
+ ]).optional(),
1570
+ assets_category_id: z.string().nullish(),
1571
+ container: z.boolean().optional(),
1572
+ attribute_values: z.array(z.object({
1573
+ assets_attribute_id: z.string().regex(/[^\x09-\x0D\x20…   - ‧-‪   ]|[‧‪]/),
1574
+ value: z.string().nullish(),
1575
+ assets_attribute_option_id: z.string().nullish()
1576
+ })).optional(),
1577
+ images_attributes: z.array(z.object({
1578
+ id: z.string().optional(),
1579
+ file: z.string().regex(/[^\x09-\x0D\x20…   - ‧-‪   ]|[‧‪]/).optional(),
1580
+ _destroy: z.boolean().optional()
1581
+ })).optional(),
1582
+ type: z.enum(['serial', 'bulk']),
1583
+ performed_by_user_id: z.string().regex(/[^\x09-\x0D\x20…   - ‧-‪   ]|[‧‪]/)
1584
+ });
1585
+ /**
1586
+ * 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.
1587
+ */
1588
+ export const zAssetsProductUpdateParameters = z.object({
1589
+ name: z.string().regex(/[^\x09-\x0D\x20…   - ‧-‪   ]|[‧‪]/).optional(),
1590
+ description: z.string().nullish(),
1591
+ make: z.string().nullish(),
1592
+ model: z.string().nullish(),
1593
+ upc: z.string().nullish(),
1594
+ internal_sku: z.string().nullish(),
1595
+ default_minimum_quantity: z.int().nullish(),
1596
+ counted_by: z.enum([
1597
+ 'each',
1598
+ 'pair',
1599
+ 'pack'
1600
+ ]).optional(),
1601
+ assets_category_id: z.string().nullish(),
1602
+ container: z.boolean().optional(),
1603
+ attribute_values: z.array(z.object({
1604
+ assets_attribute_id: z.string().regex(/[^\x09-\x0D\x20…   - ‧-‪   ]|[‧‪]/),
1605
+ value: z.string().nullish(),
1606
+ assets_attribute_option_id: z.string().nullish()
1607
+ })).optional(),
1608
+ images_attributes: z.array(z.object({
1609
+ id: z.string().optional(),
1610
+ file: z.string().regex(/[^\x09-\x0D\x20…   - ‧-‪   ]|[‧‪]/).optional(),
1611
+ _destroy: z.boolean().optional()
1612
+ })).optional()
1613
+ });
1534
1614
  /**
1535
1615
  * A named daily allowance (meals, lodging, travel, and the like) that a company can attach to time.
1536
1616
  */
@@ -1664,30 +1744,30 @@ export const zAssetsCategoryResponseObject = z.object({
1664
1744
  updated_at: z.iso.datetime()
1665
1745
  });
1666
1746
  /**
1667
- * Create or update a category; only name is required. `category_attributes` sets this category's direct attribute assignments.
1747
+ * Create a category. Only name is required; omitting it answers 400, and a blank or null name or any wrong-typed value answers 422. A null or blank parent_id files the category at the root. `category_attributes` sets this category's direct attribute assignments.
1668
1748
  */
1669
1749
  export const zAssetsCategoryParameters = z.object({
1670
- name: z.string().min(1),
1750
+ name: z.string().regex(/[^\x09-\x0D\x20…   - ‧-‪   ]|[‧‪]/),
1671
1751
  parent_id: z.string().nullish(),
1672
1752
  category_attributes: z.array(z.object({
1673
1753
  id: z.string().optional(),
1674
- assets_attribute_id: z.string(),
1675
- fillable_on: z.enum(['product', 'item']),
1754
+ assets_attribute_id: z.string().optional(),
1755
+ fillable_on: z.enum(['product', 'item']).optional(),
1676
1756
  required: z.boolean().optional(),
1677
1757
  position: z.int().optional(),
1678
1758
  _destroy: z.boolean().optional()
1679
1759
  })).optional()
1680
1760
  });
1681
1761
  /**
1682
- * Update a category. All fields are optional — send only what changes. `category_attributes` sets this category's direct attribute assignments.
1762
+ * Update a category. All fields are optional — send only what changes. A blank or null name or any wrong-typed value answers 422, and a null or blank parent_id moves the category to the root. `category_attributes` sets this category's direct attribute assignments.
1683
1763
  */
1684
1764
  export const zAssetsCategoryUpdateParameters = z.object({
1685
- name: z.string().min(1).optional(),
1765
+ name: z.string().regex(/[^\x09-\x0D\x20…   - ‧-‪   ]|[‧‪]/).optional(),
1686
1766
  parent_id: z.string().nullish(),
1687
1767
  category_attributes: z.array(z.object({
1688
1768
  id: z.string().optional(),
1689
- assets_attribute_id: z.string(),
1690
- fillable_on: z.enum(['product', 'item']),
1769
+ assets_attribute_id: z.string().optional(),
1770
+ fillable_on: z.enum(['product', 'item']).optional(),
1691
1771
  required: z.boolean().optional(),
1692
1772
  position: z.int().optional(),
1693
1773
  _destroy: z.boolean().optional()
@@ -4992,49 +5072,30 @@ export const zProductionJobScopePriceResponseObject = z.object({
4992
5072
  updated_at: z.iso.datetime()
4993
5073
  });
4994
5074
  /**
4995
- * Update a completion. Send only the fields to change. The scope price, filer, and feature reference are fixed at creation. Sending production_job_scope_price_id or performed_by_user_id on update returns 400 unknown_key. Feature completions accept no completable changes; quantity completions accept quantity_completed. A key for the other subtype returns 422.
5075
+ * Record a completion against a scope price. The server takes the completable subtype from the production tracking kind of the scope price's job, never from the request: a feature-tracked job records which feature was completed, and a quantity-tracked job how many units were completed. completable_attributes declares both kinds' keys; sending the other kind's key answers 422 subtype_foreign_keys with an entry pointing at it, and nothing is written.
4996
5076
  */
4997
- export const zProductionCompletionUpdateParameters = z.object({
5077
+ export const zProductionCompletionParameters = z.object({
5078
+ production_job_scope_price_id: z.string().regex(/[^\x09-\x0D\x20…   - ‧-‪   ]|[‧‪]/),
5079
+ performed_by_user_id: z.string().regex(/[^\x09-\x0D\x20…   - ‧-‪   ]|[‧‪]/),
4998
5080
  notes: z.string().nullish(),
4999
5081
  work_date: z.iso.date().optional(),
5000
5082
  position_ids: z.array(z.string().regex(/[^\x09-\x0D\x20…   - ‧-‪   ]|[‧‪]/)).optional(),
5001
5083
  completable_attributes: z.object({
5002
- quantity_completed: z.int().optional()
5084
+ feature_id: z.string().regex(/[^\x09-\x0D\x20…   - ‧-‪   ]|[‧‪]/).optional(),
5085
+ quantity_completed: z.int().gte(1).optional()
5003
5086
  }).optional()
5004
5087
  });
5005
5088
  /**
5006
- * Fields shared by both completion payload kinds.
5089
+ * Update a completion. Send only the fields to change. The scope price, filer, and feature reference are fixed at creation. Sending production_job_scope_price_id or performed_by_user_id on update returns 400 unknown_key. Feature completions accept no completable changes, so quantity_completed on one answers 422 subtype_foreign_keys with an entry pointing at it; quantity completions accept quantity_completed.
5007
5090
  */
5008
- export const zProductionCompletionBaseParameters = z.object({
5009
- production_job_scope_price_id: z.string(),
5010
- performed_by_user_id: z.string().regex(/[^\x09-\x0D\x20…   - ‧-‪   ]|[‧‪]/),
5091
+ export const zProductionCompletionUpdateParameters = z.object({
5011
5092
  notes: z.string().nullish(),
5012
5093
  work_date: z.iso.date().optional(),
5013
- position_ids: z.array(z.string().regex(/[^\x09-\x0D\x20…   - ‧-‪   ]|[‧‪]/)).optional()
5014
- });
5015
- /**
5016
- * Payload for completions on feature-tracked jobs (the scope price's job tracks production by feature). quantity_completed is not accepted; the feature reference is immutable after create, so update accepts no completable_attributes at all.
5017
- */
5018
- export const zProductionFeatureCompletionParameters = zProductionCompletionBaseParameters.and(z.object({
5019
- completable_attributes: z.object({
5020
- feature_id: z.string().optional()
5021
- }).optional()
5022
- }));
5023
- /**
5024
- * Payload for completions on quantity-tracked jobs (the scope price's job tracks production by quantity). feature_id is not accepted.
5025
- */
5026
- export const zProductionQuantityCompletionParameters = zProductionCompletionBaseParameters.and(z.object({
5094
+ position_ids: z.array(z.string().regex(/[^\x09-\x0D\x20…   - ‧-‪   ]|[‧‪]/)).optional(),
5027
5095
  completable_attributes: z.object({
5028
- quantity_completed: z.int().optional()
5096
+ quantity_completed: z.int().gte(1).optional()
5029
5097
  }).optional()
5030
- }));
5031
- /**
5032
- * A completion's payload shape follows the production tracking kind of the scope price's job — the server derives the completable subtype from the job, never from the request. Feature-tracked jobs record which feature was completed (feature payload); quantity-tracked jobs record how many units were completed (quantity payload). The two payloads are mutually exclusive: sending the other kind's completable key returns 422.
5033
- */
5034
- export const zProductionCompletionParameters = z.union([
5035
- zProductionFeatureCompletionParameters,
5036
- zProductionQuantityCompletionParameters
5037
- ]);
5098
+ });
5038
5099
  /**
5039
5100
  * A completion recorded on a feature-tracked job — a unit of scoped work finished by a crew, identifying which feature was completed.
5040
5101
  */
@@ -6596,15 +6657,15 @@ export const zRateRuleEffect = z.object({
6596
6657
  */
6597
6658
  export const zRateRuleTimeRangeCondition = z.object({
6598
6659
  type: z.enum(['time_range']),
6599
- start_time: z.string(),
6600
- end_time: z.string()
6660
+ start_time: z.string().regex(/^([01][0-9]|2[0-3]):[0-5][0-9]$/),
6661
+ end_time: z.string().regex(/^([01][0-9]|2[0-3]):[0-5][0-9]$/)
6601
6662
  });
6602
6663
  /**
6603
6664
  * Restricts the rule to specific days of the week.
6604
6665
  */
6605
6666
  export const zRateRuleDaysCondition = z.object({
6606
6667
  type: z.enum(['days']),
6607
- days: z.array(z.int())
6668
+ days: z.array(z.int().gte(0).lte(6)).min(1)
6608
6669
  });
6609
6670
  /**
6610
6671
  * Restricts the rule to a single calendar date.
@@ -6618,15 +6679,15 @@ export const zRateRuleSpecificDateCondition = z.object({
6618
6679
  */
6619
6680
  export const zRateRuleApprenticePeriodCondition = z.object({
6620
6681
  type: z.enum(['apprentice_period']),
6621
- period: z.int()
6682
+ period: z.int().gte(1).lte(100)
6622
6683
  });
6623
6684
  /**
6624
6685
  * Restricts the rule to a cumulative-apprentice-hours band.
6625
6686
  */
6626
6687
  export const zRateRuleApprenticeHoursCondition = z.object({
6627
6688
  type: z.enum(['apprentice_hours']),
6628
- min_hours: z.int(),
6629
- max_hours: z.int()
6689
+ min_hours: z.int().gte(0).lte(100000),
6690
+ max_hours: z.int().gte(0).lte(100000)
6630
6691
  });
6631
6692
  /**
6632
6693
  * Restricts the rule to a specific overtime tier.
@@ -6748,17 +6809,37 @@ export const zPayRatesRuleResponseObject = z.object({
6748
6809
  * Parameters for creating a conditional wage or fringe adjustment in a pay-rate rule package.
6749
6810
  */
6750
6811
  export const zPayRatesRuleParameters = z.object({
6751
- effect: zRateRuleEffect,
6752
- conditions: z.array(zRateRuleCondition).optional(),
6753
- effective_date: z.iso.date().optional()
6812
+ effective_date: z.iso.date().optional(),
6813
+ effect: z.object({
6814
+ type: z.enum(['wage_increment', 'fringe_increment']),
6815
+ amount_cents: z.string()
6816
+ }),
6817
+ conditions: z.array(z.union([
6818
+ zRateRuleTimeRangeCondition,
6819
+ zRateRuleDaysCondition,
6820
+ zRateRuleSpecificDateCondition,
6821
+ zRateRuleApprenticePeriodCondition,
6822
+ zRateRuleApprenticeHoursCondition,
6823
+ zRateRuleOvertimeMultiplierCondition
6824
+ ])).optional()
6754
6825
  });
6755
6826
  /**
6756
6827
  * Change a rule from an effective date forward. Omitted effect or conditions keep that part of the targeted version. When the targeted recipe changes, the resulting complete recipe applies from that coordinate across later scheduled versions; an unchanged recipe does not alter later scheduled versions. An empty conditions list makes the rule unconditional. Omit effective_from to correct the selected version from its exact existing start. A rule with an unbounded lower limit requires effective_from.
6757
6828
  */
6758
6829
  export const zPayRatesRuleUpdateParameters = z.object({
6759
- effect: zRateRuleEffect.optional(),
6760
- conditions: z.array(zRateRuleCondition).optional(),
6761
- effective_from: z.iso.date().optional()
6830
+ effective_from: z.iso.date().optional(),
6831
+ effect: z.object({
6832
+ type: z.enum(['wage_increment', 'fringe_increment']),
6833
+ amount_cents: z.string()
6834
+ }).optional(),
6835
+ conditions: z.array(z.union([
6836
+ zRateRuleTimeRangeCondition,
6837
+ zRateRuleDaysCondition,
6838
+ zRateRuleSpecificDateCondition,
6839
+ zRateRuleApprenticePeriodCondition,
6840
+ zRateRuleApprenticeHoursCondition,
6841
+ zRateRuleOvertimeMultiplierCondition
6842
+ ])).optional()
6762
6843
  });
6763
6844
  /**
6764
6845
  * Parameters for moving where a pay-rate rule family's valid-time timeline begins.
@@ -6777,8 +6858,18 @@ export const zPayRatesRuleScheduledTerminationParameters = z.object({
6777
6858
  */
6778
6859
  export const zPayRatesRuleScheduledChangeParameters = z.object({
6779
6860
  effective_date: z.iso.date(),
6780
- effect: zRateRuleEffect.optional(),
6781
- conditions: z.array(zRateRuleCondition).optional()
6861
+ effect: z.object({
6862
+ type: z.enum(['wage_increment', 'fringe_increment']),
6863
+ amount_cents: z.string()
6864
+ }).optional(),
6865
+ conditions: z.array(z.union([
6866
+ zRateRuleTimeRangeCondition,
6867
+ zRateRuleDaysCondition,
6868
+ zRateRuleSpecificDateCondition,
6869
+ zRateRuleApprenticePeriodCondition,
6870
+ zRateRuleApprenticeHoursCondition,
6871
+ zRateRuleOvertimeMultiplierCondition
6872
+ ])).optional()
6782
6873
  });
6783
6874
  export const zPayRatesRuleHistoryCorrectionObject = z.object({
6784
6875
  pay_rates_rule_id: z.string(),
@@ -6984,8 +7075,72 @@ export const zOvertimeRuleScheduledTerminationParameters = z.object({
6984
7075
  */
6985
7076
  export const zRateRuleParameters = z.object({
6986
7077
  effective_date: z.iso.date().nullish(),
6987
- effect: zRateRuleEffect,
6988
- conditions: z.array(zRateRuleCondition).optional()
7078
+ effect: z.object({
7079
+ type: z.enum(['wage_increment', 'fringe_increment']),
7080
+ amount_cents: z.string()
7081
+ }),
7082
+ conditions: z.array(z.union([
7083
+ zRateRuleTimeRangeCondition,
7084
+ zRateRuleDaysCondition,
7085
+ zRateRuleSpecificDateCondition,
7086
+ zRateRuleApprenticePeriodCondition,
7087
+ zRateRuleApprenticeHoursCondition,
7088
+ zRateRuleOvertimeMultiplierCondition
7089
+ ])).optional()
7090
+ });
7091
+ /**
7092
+ * Create an asset item. The write API creates serial items only; assets_product_id and serial_number identify the product and serial number. `attribute_values` fills the item-level attributes of the product's category. 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.
7093
+ */
7094
+ export const zAssetsItemParameters = z.object({
7095
+ name: z.string().regex(/[^\x09-\x0D\x20…   - ‧-‪   ]|[‧‪]/),
7096
+ description: z.string().nullish(),
7097
+ assets_product_id: z.string(),
7098
+ serial_number: z.string().nullish(),
7099
+ status: z.enum(['available', 'assigned']).optional(),
7100
+ purchase_date: z.string().nullish(),
7101
+ purchase_price_cents: z.int().nullish(),
7102
+ external_id: z.string().nullish(),
7103
+ external_system_url: z.string().nullish(),
7104
+ attribute_values: z.array(z.object({
7105
+ assets_attribute_id: z.string().regex(/[^\x09-\x0D\x20…   - ‧-‪   ]|[‧‪]/),
7106
+ value: z.string().nullish(),
7107
+ assets_attribute_option_id: z.string().nullish()
7108
+ })).optional(),
7109
+ images_attributes: z.array(z.object({
7110
+ id: z.string().optional(),
7111
+ file: z.string().regex(/[^\x09-\x0D\x20…   - ‧-‪   ]|[‧‪]/).optional(),
7112
+ _destroy: z.boolean().optional()
7113
+ })).optional(),
7114
+ performed_by_user_id: z.string().regex(/[^\x09-\x0D\x20…   - ‧-‪   ]|[‧‪]/),
7115
+ assets_site_id: z.string().nullish(),
7116
+ user_id: z.string().nullish(),
7117
+ container_item_id: z.string().nullish(),
7118
+ assets_sub_location_id: z.string().nullish()
7119
+ });
7120
+ /**
7121
+ * Update an asset item. All item fields are optional — send only what changes — but performed_by_user_id is required to record the updater. Omitted attributes retain their existing values. `attribute_values` upserts the item-level attributes of the product's category. The serial-only fields (serial_number, status, purchase_date, purchase_price_cents, external_id, external_system_url) apply to a serial item; sending one for a bulk item answers 422 subtype_foreign_keys with an entry pointing at each such field, and nothing is written.
7122
+ */
7123
+ export const zAssetsItemUpdateParameters = z.object({
7124
+ name: z.string().regex(/[^\x09-\x0D\x20…   - ‧-‪   ]|[‧‪]/).optional(),
7125
+ description: z.string().nullish(),
7126
+ assets_product_id: z.string().optional(),
7127
+ serial_number: z.string().nullish(),
7128
+ status: z.enum(['available', 'assigned']).optional(),
7129
+ purchase_date: z.string().nullish(),
7130
+ purchase_price_cents: z.int().nullish(),
7131
+ external_id: z.string().nullish(),
7132
+ external_system_url: z.string().nullish(),
7133
+ attribute_values: z.array(z.object({
7134
+ assets_attribute_id: z.string().regex(/[^\x09-\x0D\x20…   - ‧-‪   ]|[‧‪]/),
7135
+ value: z.string().nullish(),
7136
+ assets_attribute_option_id: z.string().nullish()
7137
+ })).optional(),
7138
+ images_attributes: z.array(z.object({
7139
+ id: z.string().optional(),
7140
+ file: z.string().regex(/[^\x09-\x0D\x20…   - ‧-‪   ]|[‧‪]/).optional(),
7141
+ _destroy: z.boolean().optional()
7142
+ })).optional(),
7143
+ performed_by_user_id: z.string().regex(/[^\x09-\x0D\x20…   - ‧-‪   ]|[‧‪]/)
6989
7144
  });
6990
7145
  /**
6991
7146
  * A vendor in the company's asset catalog — a supplier or manufacturer that products are sourced from.
@@ -7216,112 +7371,6 @@ export const zAssetsItemResponseObject = z.object({
7216
7371
  created_at: z.iso.datetime(),
7217
7372
  updated_at: z.iso.datetime()
7218
7373
  });
7219
- /**
7220
- * One attachment in a nested collection. Send file with a signed_id to add one; send id (with _destroy) to remove an existing one.
7221
- */
7222
- export const zAssetsAttachmentParameters = z.object({
7223
- id: z.string().optional(),
7224
- file: z.string().optional(),
7225
- _destroy: z.boolean().optional()
7226
- });
7227
- /**
7228
- * Create a catalog product. `type` (serial or bulk) is required and immutable. `attribute_values` upserts the product's category-attribute values.
7229
- */
7230
- export const zAssetsProductParameters = z.object({
7231
- type: z.enum(['serial', 'bulk']),
7232
- name: z.string().min(1),
7233
- description: z.string().nullish(),
7234
- assets_category_id: z.string().nullish(),
7235
- upc: z.string().nullish(),
7236
- internal_sku: z.string().nullish(),
7237
- default_minimum_quantity: z.int().nullish(),
7238
- make: z.string().nullish(),
7239
- model: z.string().nullish(),
7240
- counted_by: z.enum([
7241
- 'each',
7242
- 'pair',
7243
- 'pack'
7244
- ]).optional(),
7245
- container: z.boolean().optional(),
7246
- attribute_values: z.array(z.object({
7247
- assets_attribute_id: z.string(),
7248
- value: z.string().nullish(),
7249
- assets_attribute_option_id: z.string().nullish()
7250
- })).optional(),
7251
- images_attributes: z.array(zAssetsAttachmentParameters).optional(),
7252
- performed_by_user_id: z.string().regex(/[^\x09-\x0D\x20…   - ‧-‪   ]|[‧‪]/)
7253
- });
7254
- /**
7255
- * 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.
7256
- */
7257
- export const zAssetsProductUpdateParameters = z.object({
7258
- name: z.string().min(1).optional(),
7259
- description: z.string().nullish(),
7260
- assets_category_id: z.string().nullish(),
7261
- upc: z.string().nullish(),
7262
- internal_sku: z.string().nullish(),
7263
- default_minimum_quantity: z.int().nullish(),
7264
- make: z.string().nullish(),
7265
- model: z.string().nullish(),
7266
- counted_by: z.enum([
7267
- 'each',
7268
- 'pair',
7269
- 'pack'
7270
- ]).optional(),
7271
- container: z.boolean().optional(),
7272
- attribute_values: z.array(z.object({
7273
- assets_attribute_id: z.string(),
7274
- value: z.string().nullish(),
7275
- assets_attribute_option_id: z.string().nullish()
7276
- })).optional(),
7277
- images_attributes: z.array(zAssetsAttachmentParameters).optional()
7278
- });
7279
- /**
7280
- * Create an asset item. The write API creates serial items only; assets_product_id and serial_number identify the product and serial number. `attribute_values` fills the item-level attributes of the product's category. 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.
7281
- */
7282
- export const zAssetsItemParameters = z.object({
7283
- name: z.string().min(1),
7284
- description: z.string().optional(),
7285
- assets_product_id: z.string(),
7286
- serial_number: z.string(),
7287
- status: z.enum(['available', 'assigned']).optional(),
7288
- purchase_date: z.iso.datetime().optional(),
7289
- purchase_price_cents: z.int().optional(),
7290
- external_id: z.string().optional(),
7291
- external_system_url: z.string().optional(),
7292
- attribute_values: z.array(z.object({
7293
- assets_attribute_id: z.string(),
7294
- value: z.string().nullish(),
7295
- assets_attribute_option_id: z.string().nullish()
7296
- })).optional(),
7297
- images_attributes: z.array(zAssetsAttachmentParameters).optional(),
7298
- assets_site_id: z.string().optional(),
7299
- user_id: z.string().optional(),
7300
- container_item_id: z.string().optional(),
7301
- assets_sub_location_id: z.string().optional(),
7302
- performed_by_user_id: z.string().regex(/[^\x09-\x0D\x20…   - ‧-‪   ]|[‧‪]/)
7303
- });
7304
- /**
7305
- * Update an asset item. All item fields are optional — send only what changes — but performed_by_user_id is required to record the updater. Omitted attributes retain their existing values. `attribute_values` upserts the item-level attributes of the product's category.
7306
- */
7307
- export const zAssetsItemUpdateParameters = z.object({
7308
- name: z.string().min(1).optional(),
7309
- description: z.string().optional(),
7310
- assets_product_id: z.string().optional(),
7311
- serial_number: z.string().optional(),
7312
- status: z.enum(['available', 'assigned']).optional(),
7313
- purchase_date: z.iso.datetime().optional(),
7314
- purchase_price_cents: z.int().optional(),
7315
- external_id: z.string().optional(),
7316
- external_system_url: z.string().optional(),
7317
- attribute_values: z.array(z.object({
7318
- assets_attribute_id: z.string(),
7319
- value: z.string().nullish(),
7320
- assets_attribute_option_id: z.string().nullish()
7321
- })).optional(),
7322
- images_attributes: z.array(zAssetsAttachmentParameters).optional(),
7323
- performed_by_user_id: z.string().regex(/[^\x09-\x0D\x20…   - ‧-‪   ]|[‧‪]/)
7324
- });
7325
7374
  /**
7326
7375
  * 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.
7327
7376
  */
@@ -7698,8 +7747,12 @@ export const zAssetsServiceEventParameters = z.object({
7698
7747
  notes: z.string().nullish(),
7699
7748
  performed_on: z.iso.date(),
7700
7749
  assets_service_schedule_id: z.string().nullish(),
7701
- performed_by_user_id: z.string().regex(/[^\x09-\x0D\x20…   - ‧-‪   ]|[‧‪]/),
7702
- attachments_attributes: z.array(zAssetsAttachmentParameters).optional()
7750
+ attachments_attributes: z.array(z.object({
7751
+ id: z.string().optional(),
7752
+ file: z.string().regex(/[^\x09-\x0D\x20…   - ‧-‪   ]|[‧‪]/).optional(),
7753
+ _destroy: z.boolean().optional()
7754
+ })).optional(),
7755
+ performed_by_user_id: z.string().regex(/[^\x09-\x0D\x20…   - ‧-‪   ]|[‧‪]/)
7703
7756
  });
7704
7757
  /**
7705
7758
  * 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.
@@ -7713,8 +7766,12 @@ export const zAssetsServiceEventUpdateParameters = z.object({
7713
7766
  notes: z.string().nullish(),
7714
7767
  performed_on: z.iso.date().optional(),
7715
7768
  assets_service_schedule_id: z.string().nullish(),
7716
- performed_by_user_id: z.string().regex(/[^\x09-\x0D\x20…   - ‧-‪   ]|[‧‪]/),
7717
- attachments_attributes: z.array(zAssetsAttachmentParameters).optional()
7769
+ attachments_attributes: z.array(z.object({
7770
+ id: z.string().optional(),
7771
+ file: z.string().regex(/[^\x09-\x0D\x20…   - ‧-‪   ]|[‧‪]/).optional(),
7772
+ _destroy: z.boolean().optional()
7773
+ })).optional(),
7774
+ performed_by_user_id: z.string().regex(/[^\x09-\x0D\x20…   - ‧-‪   ]|[‧‪]/)
7718
7775
  });
7719
7776
  /**
7720
7777
  * 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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dsptch-work/api-client",
3
- "version": "0.34.0",
3
+ "version": "0.35.0",
4
4
  "description": "Generated TypeScript client for the DSPTCH REST API.",
5
5
  "keywords": [
6
6
  "dsptch",