@dsptch-work/api-client 0.45.0 → 0.46.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 CHANGED
@@ -5,6 +5,25 @@ All notable changes to `@dsptch-work/api-client` are documented here. The format
5
5
  [Semantic Versioning](https://semver.org) — currently `0.x`, so breaking changes may land in a
6
6
  minor bump until `1.0.0`. See [RELEASING.md](./RELEASING.md) for the release and versioning process.
7
7
 
8
+ ## [0.46.0] - 2026-10-28
9
+
10
+ ### Added
11
+
12
+ - `AssetsProducts.restockProduct()` and `adjustProductInventory()` accept `user_id` or
13
+ `container_item_id` in `AssetsRestockParameters` and `AssetsAdjustmentParameters`, and
14
+ `assets_site_id` is now optional. Supply exactly one holder: the API returns `422` for none or
15
+ multiple holders. A site or container can include `assets_sub_location_id`; a user cannot. The
16
+ generated types do not enforce the exactly-one constraint.
17
+
18
+ ### Changed
19
+
20
+ - **Breaking runtime validation:** `AssetsItems.createItem()` returns `422` when
21
+ `assets_sub_location_id` is supplied with `user_id` or without a placement. Remove the sublocation
22
+ from affected requests; the generated type does not enforce this constraint.
23
+
24
+ See the [October 28 API changelog](https://dsptch.app/support/docs/developers/api-changelog#2026-10-28)
25
+ for the full REST contract details.
26
+
8
27
  ## [0.45.0] - 2026-10-27
9
28
 
10
29
  ### Added
@@ -936,7 +936,7 @@ export declare class AssetsProducts {
936
936
  */
937
937
  static archiveProduct<ThrowOnError extends boolean = false>(options: Options<ArchiveProductData, ThrowOnError>): RequestResult<ArchiveProductResponses, ArchiveProductErrors, ThrowOnError>;
938
938
  /**
939
- * Adjust inventory on-hand count
939
+ * Adjust bulk product count
940
940
  *
941
941
  * **Required scope:**
942
942
  *
@@ -945,7 +945,7 @@ export declare class AssetsProducts {
945
945
  */
946
946
  static adjustProductInventory<ThrowOnError extends boolean = false>(options: Options<AdjustProductInventoryData, ThrowOnError>): RequestResult<AdjustProductInventoryResponses, AdjustProductInventoryErrors, ThrowOnError>;
947
947
  /**
948
- * Restock bulk product at site
948
+ * Restock bulk product
949
949
  *
950
950
  * **Required scope:**
951
951
  *
@@ -1597,7 +1597,7 @@ export class AssetsProducts {
1597
1597
  });
1598
1598
  }
1599
1599
  /**
1600
- * Adjust inventory on-hand count
1600
+ * Adjust bulk product count
1601
1601
  *
1602
1602
  * **Required scope:**
1603
1603
  *
@@ -1616,7 +1616,7 @@ export class AssetsProducts {
1616
1616
  });
1617
1617
  }
1618
1618
  /**
1619
- * Restock bulk product at site
1619
+ * Restock bulk product
1620
1620
  *
1621
1621
  * **Required scope:**
1622
1622
  *
@@ -2145,7 +2145,7 @@ export type PeopleEmploymentResponseObject = {
2145
2145
  */
2146
2146
  training_annual_minutes: number | null;
2147
2147
  /**
2148
- * Minutes per workweek the fixed salary is intended to compensate. Not time worked, and separate from worked_annual_minutes.
2148
+ * Minutes per workweek the fixed salary is intended to compensate. This is the salary's fixed-hours basis, not time worked, and is separate from worked_annual_minutes.
2149
2149
  */
2150
2150
  salary_weekly_minutes: number;
2151
2151
  /**
@@ -2157,7 +2157,7 @@ export type PeopleEmploymentResponseObject = {
2157
2157
  */
2158
2158
  training_annual_amount_cents?: string | null;
2159
2159
  /**
2160
- * Annual fixed-hours salary in cents as a decimal string; present for company keys, company administrators, and the employed person, and null when authorized but unset.
2160
+ * Annual fixed-hours salary in cents as a decimal string; present for company keys, company administrators, and the employed person, and null when authorized but unset. Variable-hours and fluctuating-workweek salaries are not supported.
2161
2161
  */
2162
2162
  salary_annual_amount_cents?: string | null;
2163
2163
  /**
@@ -2266,11 +2266,11 @@ export type PeopleEmploymentCreateParameters = {
2266
2266
  */
2267
2267
  employer_combined_savings_cents?: string | null;
2268
2268
  /**
2269
- * Annual fixed-hours salary in cents as a decimal string. Omit or send null to leave it unset.
2269
+ * Annual fixed-hours salary in cents as a decimal string. Variable-hours and fluctuating-workweek salaries are not supported. Omit or send null to leave it unset.
2270
2270
  */
2271
2271
  salary_annual_amount_cents?: string | null;
2272
2272
  /**
2273
- * Minutes per workweek the fixed salary is intended to compensate, as a whole number from 1 to 10080 (one week). Omit to use 2400 (40 hours); null is refused.
2273
+ * Minutes per workweek the fixed salary is intended to compensate, as a whole number from 1 to 10080 (one week). This is the salary's fixed-hours basis, not observed time. Omit to use 2400 (40 hours); null is refused.
2274
2274
  */
2275
2275
  salary_weekly_minutes?: number;
2276
2276
  };
@@ -2327,11 +2327,11 @@ export type PeopleEmploymentScheduledChangeCreateParameters = {
2327
2327
  */
2328
2328
  employer_combined_savings_cents?: string | null;
2329
2329
  /**
2330
- * Annual fixed-hours salary in cents as a decimal string. Omit to carry forward the preceding version, or send null to clear it.
2330
+ * Annual fixed-hours salary in cents as a decimal string. Variable-hours and fluctuating-workweek salaries are not supported. Omit to carry forward the preceding version, or send null to clear it.
2331
2331
  */
2332
2332
  salary_annual_amount_cents?: string | null;
2333
2333
  /**
2334
- * Minutes per workweek the fixed salary is intended to compensate, as a whole number from 1 to 10080 (one week). Omit to carry forward the preceding version; null is refused.
2334
+ * Minutes per workweek the fixed salary is intended to compensate, as a whole number from 1 to 10080 (one week). This is the salary's fixed-hours basis, not observed time. Omit to carry forward the preceding version; null is refused.
2335
2335
  */
2336
2336
  salary_weekly_minutes?: number;
2337
2337
  /**
@@ -2388,11 +2388,11 @@ export type PeopleEmploymentScheduledChangeUpdateParameters = {
2388
2388
  */
2389
2389
  employer_combined_savings_cents?: string | null;
2390
2390
  /**
2391
- * Annual fixed-hours salary in cents as a decimal string. Omit to preserve the value at the targeted boundary, or send null to clear it.
2391
+ * Annual fixed-hours salary in cents as a decimal string. Variable-hours and fluctuating-workweek salaries are not supported. Omit to preserve the value at the targeted boundary, or send null to clear it.
2392
2392
  */
2393
2393
  salary_annual_amount_cents?: string | null;
2394
2394
  /**
2395
- * Minutes per workweek the fixed salary is intended to compensate, as a whole number from 1 to 10080 (one week). Omit to preserve the value at the targeted boundary; null is refused.
2395
+ * Minutes per workweek the fixed salary is intended to compensate, as a whole number from 1 to 10080 (one week). This is the salary's fixed-hours basis, not observed time. Omit to preserve the value at the targeted boundary; null is refused.
2396
2396
  */
2397
2397
  salary_weekly_minutes?: number;
2398
2398
  /**
@@ -6206,7 +6206,7 @@ export type TimeEntryResponseObject = {
6206
6206
  */
6207
6207
  currency?: string;
6208
6208
  /**
6209
- * Where the base rate came from: one of user_default, position, prevailing_wage, or custom; null when no rate is set. (The schema types this as a free-form nullable string; the value set is defined by the model enum.) Present for company keys and for administrators of the company whose pay schedule holds the entry; omitted for other user keys.
6209
+ * Where the base rate came from: one of user_default, position, prevailing_wage, or custom; null when no rate is set. A fixed-hours salary is a user_default rate. (The schema types this as a free-form nullable string; the value set is defined by the model enum.) Present for company keys and for administrators of the company whose pay schedule holds the entry; omitted for other user keys.
6210
6210
  */
6211
6211
  hourly_rate_src_type?: string | null;
6212
6212
  /**
@@ -15281,7 +15281,7 @@ export type AssetsItemParameters = {
15281
15281
  */
15282
15282
  container_item_id?: string | null;
15283
15283
  /**
15284
- * Optional, create only. The storage location within the placement site or container the item lands in; must belong to that holder. Omit for an unbinned placement. Ignored for a user assignment.
15284
+ * Optional, create only. The storage location within the placement site or container the item lands in; must belong to that holder. Omit for an unbinned placement. One named with user_id, or without a placement, answers 422 at its pointer.
15285
15285
  */
15286
15286
  assets_sub_location_id?: string | null;
15287
15287
  };
@@ -16785,15 +16785,23 @@ export type AssetsTransferParameters = {
16785
16785
  }>;
16786
16786
  };
16787
16787
  /**
16788
- * Add stock of a bulk product at a site, recording a receive transaction. Bulk products only.
16788
+ * Add stock of a bulk product to a holder — a site, a user's custody, or a container — recording a receive transaction. Name the holder with exactly one of assets_site_id, user_id, or container_item_id; several answer 422 at each named key, and none answers 422. Bulk products only.
16789
16789
  */
16790
16790
  export type AssetsRestockParameters = {
16791
16791
  /**
16792
16792
  * ID of the site to add the stock to. A site the API key cannot see answers 404.
16793
16793
  */
16794
- assets_site_id: string;
16794
+ assets_site_id?: string;
16795
+ /**
16796
+ * ID of the user to give the stock to. A user outside the company, or one whose employment has ended, answers 404.
16797
+ */
16798
+ user_id?: string;
16799
+ /**
16800
+ * ID of the container item to place the stock in. A container the API key cannot see answers 404; an item that is not a container answers 422.
16801
+ */
16802
+ container_item_id?: string;
16795
16803
  /**
16796
- * Optional. The site's storage location the stock lands in; one that is not the site's answers 404. Omit or send null for the site's unbinned stock.
16804
+ * Optional. The site's or container's storage location the stock lands in; one that is not the holder's answers 404, and one named with user_id answers 422 at its pointer. Omit or send null for the holder's unbinned stock.
16797
16805
  */
16798
16806
  assets_sub_location_id?: string | null;
16799
16807
  /**
@@ -16806,19 +16814,27 @@ export type AssetsRestockParameters = {
16806
16814
  performed_by_user_id: string;
16807
16815
  };
16808
16816
  /**
16809
- * Set the on-hand count of a bulk product at a site to a specific number, recording the difference as an adjustment transaction. The site must already stock the product. Bulk products only.
16817
+ * Set the count of a bulk product held by a holder — a site, a user's custody, or a container — to a specific number, recording the difference as an adjustment transaction. Name the holder with exactly one of assets_site_id, user_id, or container_item_id; several answer 422 at each named key, and none answers 422. The holder must already hold the product. Bulk products only.
16810
16818
  */
16811
16819
  export type AssetsAdjustmentParameters = {
16812
16820
  /**
16813
16821
  * ID of the site whose on-hand count is being set. A site the API key cannot see answers 404.
16814
16822
  */
16815
- assets_site_id: string;
16823
+ assets_site_id?: string;
16824
+ /**
16825
+ * ID of the user whose held count is being set. A user outside the company, or one whose employment has ended, answers 404.
16826
+ */
16827
+ user_id?: string;
16828
+ /**
16829
+ * ID of the container item whose held count is being set. A container the API key cannot see answers 404.
16830
+ */
16831
+ container_item_id?: string;
16816
16832
  /**
16817
- * Optional. The site's storage location whose count is being set; one that is not the site's answers 404. Omit or send null to set the site's unbinned count.
16833
+ * Optional. The site's or container's storage location whose count is being set; one that is not the holder's answers 404, and one named with user_id answers 422 at its pointer. Omit or send null to set the holder's unbinned count.
16818
16834
  */
16819
16835
  assets_sub_location_id?: string | null;
16820
16836
  /**
16821
- * The corrected on-hand count for the site, as an integer of 0 or more; any other value answers 422. The difference from the current count is recorded as the adjustment.
16837
+ * The corrected count for the holder, as an integer of 0 or more; any other value answers 422. The difference from the current count is recorded as the adjustment.
16822
16838
  */
16823
16839
  new_quantity: number;
16824
16840
  /**
@@ -11519,19 +11519,23 @@ export declare const zAssetsTransferParameters: z.ZodObject<{
11519
11519
  }, z.core.$strip>>;
11520
11520
  }, z.core.$strip>;
11521
11521
  /**
11522
- * Add stock of a bulk product at a site, recording a receive transaction. Bulk products only.
11522
+ * Add stock of a bulk product to a holder — a site, a user's custody, or a container — recording a receive transaction. Name the holder with exactly one of assets_site_id, user_id, or container_item_id; several answer 422 at each named key, and none answers 422. Bulk products only.
11523
11523
  */
11524
11524
  export declare const zAssetsRestockParameters: z.ZodObject<{
11525
- assets_site_id: z.ZodString;
11525
+ assets_site_id: z.ZodOptional<z.ZodString>;
11526
+ user_id: z.ZodOptional<z.ZodString>;
11527
+ container_item_id: z.ZodOptional<z.ZodString>;
11526
11528
  assets_sub_location_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
11527
11529
  quantity: z.ZodInt;
11528
11530
  performed_by_user_id: z.ZodString;
11529
11531
  }, z.core.$strip>;
11530
11532
  /**
11531
- * Set the on-hand count of a bulk product at a site to a specific number, recording the difference as an adjustment transaction. The site must already stock the product. Bulk products only.
11533
+ * Set the count of a bulk product held by a holder — a site, a user's custody, or a container — to a specific number, recording the difference as an adjustment transaction. Name the holder with exactly one of assets_site_id, user_id, or container_item_id; several answer 422 at each named key, and none answers 422. The holder must already hold the product. Bulk products only.
11532
11534
  */
11533
11535
  export declare const zAssetsAdjustmentParameters: z.ZodObject<{
11534
- assets_site_id: z.ZodString;
11536
+ assets_site_id: z.ZodOptional<z.ZodString>;
11537
+ user_id: z.ZodOptional<z.ZodString>;
11538
+ container_item_id: z.ZodOptional<z.ZodString>;
11535
11539
  assets_sub_location_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
11536
11540
  new_quantity: z.ZodInt;
11537
11541
  performed_by_user_id: z.ZodString;
@@ -15307,7 +15311,9 @@ export declare const zArchiveProductResponse: z.ZodObject<{
15307
15311
  updated_at: z.ZodISODateTime;
15308
15312
  }, z.core.$strip>;
15309
15313
  export declare const zAdjustProductInventoryBody: z.ZodObject<{
15310
- assets_site_id: z.ZodString;
15314
+ assets_site_id: z.ZodOptional<z.ZodString>;
15315
+ user_id: z.ZodOptional<z.ZodString>;
15316
+ container_item_id: z.ZodOptional<z.ZodString>;
15311
15317
  assets_sub_location_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
15312
15318
  new_quantity: z.ZodInt;
15313
15319
  performed_by_user_id: z.ZodString;
@@ -15357,7 +15363,9 @@ export declare const zAdjustProductInventoryResponse: z.ZodObject<{
15357
15363
  updated_at: z.ZodISODateTime;
15358
15364
  }, z.core.$strip>;
15359
15365
  export declare const zRestockProductBody: z.ZodObject<{
15360
- assets_site_id: z.ZodString;
15366
+ assets_site_id: z.ZodOptional<z.ZodString>;
15367
+ user_id: z.ZodOptional<z.ZodString>;
15368
+ container_item_id: z.ZodOptional<z.ZodString>;
15361
15369
  assets_sub_location_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
15362
15370
  quantity: z.ZodInt;
15363
15371
  performed_by_user_id: z.ZodString;
@@ -8732,19 +8732,23 @@ export const zAssetsTransferParameters = z.object({
8732
8732
  })).min(1)
8733
8733
  });
8734
8734
  /**
8735
- * Add stock of a bulk product at a site, recording a receive transaction. Bulk products only.
8735
+ * Add stock of a bulk product to a holder — a site, a user's custody, or a container — recording a receive transaction. Name the holder with exactly one of assets_site_id, user_id, or container_item_id; several answer 422 at each named key, and none answers 422. Bulk products only.
8736
8736
  */
8737
8737
  export const zAssetsRestockParameters = z.object({
8738
- assets_site_id: z.string().regex(/[^\x09-\x0D\x20…   - ‧-‪   ]|[‧‪]/),
8738
+ assets_site_id: z.string().regex(/[^\x09-\x0D\x20…   - ‧-‪   ]|[‧‪]/).optional(),
8739
+ user_id: z.string().regex(/[^\x09-\x0D\x20…   - ‧-‪   ]|[‧‪]/).optional(),
8740
+ container_item_id: z.string().regex(/[^\x09-\x0D\x20…   - ‧-‪   ]|[‧‪]/).optional(),
8739
8741
  assets_sub_location_id: z.string().regex(/[^\x09-\x0D\x20…   - ‧-‪   ]|[‧‪]/).nullish(),
8740
8742
  quantity: z.int().gte(1),
8741
8743
  performed_by_user_id: z.string().regex(/[^\x09-\x0D\x20…   - ‧-‪   ]|[‧‪]/)
8742
8744
  });
8743
8745
  /**
8744
- * Set the on-hand count of a bulk product at a site to a specific number, recording the difference as an adjustment transaction. The site must already stock the product. Bulk products only.
8746
+ * Set the count of a bulk product held by a holder — a site, a user's custody, or a container — to a specific number, recording the difference as an adjustment transaction. Name the holder with exactly one of assets_site_id, user_id, or container_item_id; several answer 422 at each named key, and none answers 422. The holder must already hold the product. Bulk products only.
8745
8747
  */
8746
8748
  export const zAssetsAdjustmentParameters = z.object({
8747
- assets_site_id: z.string().regex(/[^\x09-\x0D\x20…   - ‧-‪   ]|[‧‪]/),
8749
+ assets_site_id: z.string().regex(/[^\x09-\x0D\x20…   - ‧-‪   ]|[‧‪]/).optional(),
8750
+ user_id: z.string().regex(/[^\x09-\x0D\x20…   - ‧-‪   ]|[‧‪]/).optional(),
8751
+ container_item_id: z.string().regex(/[^\x09-\x0D\x20…   - ‧-‪   ]|[‧‪]/).optional(),
8748
8752
  assets_sub_location_id: z.string().regex(/[^\x09-\x0D\x20…   - ‧-‪   ]|[‧‪]/).nullish(),
8749
8753
  new_quantity: z.int().gte(0),
8750
8754
  performed_by_user_id: z.string().regex(/[^\x09-\x0D\x20…   - ‧-‪   ]|[‧‪]/)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dsptch-work/api-client",
3
- "version": "0.45.0",
3
+ "version": "0.46.0",
4
4
  "description": "Generated TypeScript client for the DSPTCH REST API.",
5
5
  "keywords": [
6
6
  "dsptch",