@augno/sdk 0.18.2 → 0.19.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 +3 -3
- package/package.json +1 -1
- package/resources/catalog/catalog.d.mts +6 -6
- package/resources/catalog/catalog.d.mts.map +1 -1
- package/resources/catalog/catalog.d.ts +6 -6
- package/resources/catalog/catalog.d.ts.map +1 -1
- package/resources/catalog/catalog.js.map +1 -1
- package/resources/catalog/catalog.mjs.map +1 -1
- package/resources/catalog/index.d.mts +3 -3
- package/resources/catalog/index.d.mts.map +1 -1
- package/resources/catalog/index.d.ts +3 -3
- package/resources/catalog/index.d.ts.map +1 -1
- package/resources/catalog/index.js.map +1 -1
- package/resources/catalog/index.mjs.map +1 -1
- package/resources/catalog/items/actions.d.mts +249 -0
- package/resources/catalog/items/actions.d.mts.map +1 -0
- package/resources/catalog/items/actions.d.ts +249 -0
- package/resources/catalog/items/actions.d.ts.map +1 -0
- package/resources/catalog/items/actions.js +46 -0
- package/resources/catalog/items/actions.js.map +1 -0
- package/resources/catalog/items/actions.mjs +42 -0
- package/resources/catalog/items/actions.mjs.map +1 -0
- package/resources/catalog/items/index.d.mts +3 -1
- package/resources/catalog/items/index.d.mts.map +1 -1
- package/resources/catalog/items/index.d.ts +3 -1
- package/resources/catalog/items/index.d.ts.map +1 -1
- package/resources/catalog/items/index.js +5 -1
- package/resources/catalog/items/index.js.map +1 -1
- package/resources/catalog/items/index.mjs +2 -0
- package/resources/catalog/items/index.mjs.map +1 -1
- package/resources/catalog/items/inventory.d.mts +247 -0
- package/resources/catalog/items/inventory.d.mts.map +1 -0
- package/resources/catalog/items/inventory.d.ts +247 -0
- package/resources/catalog/items/inventory.d.ts.map +1 -0
- package/resources/catalog/items/inventory.js +75 -0
- package/resources/catalog/items/inventory.js.map +1 -0
- package/resources/catalog/items/inventory.mjs +71 -0
- package/resources/catalog/items/inventory.mjs.map +1 -0
- package/resources/catalog/items/items.d.mts +9 -104
- package/resources/catalog/items/items.d.mts.map +1 -1
- package/resources/catalog/items/items.d.ts +9 -104
- package/resources/catalog/items/items.d.ts.map +1 -1
- package/resources/catalog/items/items.js +8 -21
- package/resources/catalog/items/items.js.map +1 -1
- package/resources/catalog/items/items.mjs +8 -21
- package/resources/catalog/items/items.mjs.map +1 -1
- package/resources/catalog/materials/index.d.mts +1 -1
- package/resources/catalog/materials/index.d.mts.map +1 -1
- package/resources/catalog/materials/index.d.ts +1 -1
- package/resources/catalog/materials/index.d.ts.map +1 -1
- package/resources/catalog/materials/index.js.map +1 -1
- package/resources/catalog/materials/index.mjs.map +1 -1
- package/resources/catalog/materials/materials.d.mts +36 -3
- package/resources/catalog/materials/materials.d.mts.map +1 -1
- package/resources/catalog/materials/materials.d.ts +36 -3
- package/resources/catalog/materials/materials.d.ts.map +1 -1
- package/resources/catalog/materials/materials.js.map +1 -1
- package/resources/catalog/materials/materials.mjs.map +1 -1
- package/resources/catalog/product-lines/index.d.mts +1 -1
- package/resources/catalog/product-lines/index.d.mts.map +1 -1
- package/resources/catalog/product-lines/index.d.ts +1 -1
- package/resources/catalog/product-lines/index.d.ts.map +1 -1
- package/resources/catalog/product-lines/index.js.map +1 -1
- package/resources/catalog/product-lines/index.mjs.map +1 -1
- package/resources/catalog/product-lines/product-lines.d.mts +8 -23
- package/resources/catalog/product-lines/product-lines.d.mts.map +1 -1
- package/resources/catalog/product-lines/product-lines.d.ts +8 -23
- package/resources/catalog/product-lines/product-lines.d.ts.map +1 -1
- package/resources/catalog/product-lines/product-lines.js.map +1 -1
- package/resources/catalog/product-lines/product-lines.mjs.map +1 -1
- package/resources/core/audit-events.d.mts +4 -4
- package/resources/core/audit-events.d.mts.map +1 -1
- package/resources/core/audit-events.d.ts +4 -4
- package/resources/core/audit-events.d.ts.map +1 -1
- package/resources/core/core.d.mts +2 -2
- package/resources/core/core.d.mts.map +1 -1
- package/resources/core/core.d.ts +2 -2
- package/resources/core/core.d.ts.map +1 -1
- package/resources/core/core.js.map +1 -1
- package/resources/core/core.mjs.map +1 -1
- package/resources/core/jobs.d.mts +2 -2
- package/resources/core/jobs.d.mts.map +1 -1
- package/resources/core/jobs.d.ts +2 -2
- package/resources/core/jobs.d.ts.map +1 -1
- package/resources/messaging/blocks.d.mts +4 -3
- package/resources/messaging/blocks.d.mts.map +1 -1
- package/resources/messaging/blocks.d.ts +4 -3
- package/resources/messaging/blocks.d.ts.map +1 -1
- package/resources/messaging/blocks.js.map +1 -1
- package/resources/messaging/blocks.mjs.map +1 -1
- package/resources/messaging/conversations/conversations.d.mts +3 -3
- package/resources/messaging/conversations/conversations.d.mts.map +1 -1
- package/resources/messaging/conversations/conversations.d.ts +3 -3
- package/resources/messaging/conversations/conversations.d.ts.map +1 -1
- package/resources/messaging/conversations/conversations.js.map +1 -1
- package/resources/messaging/conversations/conversations.mjs.map +1 -1
- package/resources/messaging/conversations/links.d.mts +2 -2
- package/resources/messaging/conversations/links.d.mts.map +1 -1
- package/resources/messaging/conversations/links.d.ts +2 -2
- package/resources/messaging/conversations/links.d.ts.map +1 -1
- package/resources/messaging/conversations/messages.d.mts +2 -2
- package/resources/messaging/conversations/messages.d.mts.map +1 -1
- package/resources/messaging/conversations/messages.d.ts +2 -2
- package/resources/messaging/conversations/messages.d.ts.map +1 -1
- package/resources/messaging/notifications/notifications.d.mts +2 -2
- package/resources/messaging/notifications/notifications.d.mts.map +1 -1
- package/resources/messaging/notifications/notifications.d.ts +2 -2
- package/resources/messaging/notifications/notifications.d.ts.map +1 -1
- package/resources/messaging/notifications/notifications.js.map +1 -1
- package/resources/messaging/notifications/notifications.mjs.map +1 -1
- package/resources/operations/machine-downtime-events.d.mts +5 -5
- package/resources/operations/machine-downtime-events.d.mts.map +1 -1
- package/resources/operations/machine-downtime-events.d.ts +5 -5
- package/resources/operations/machine-downtime-events.d.ts.map +1 -1
- package/resources/operations/shipping-terms.d.mts +9 -9
- package/resources/operations/shipping-terms.d.mts.map +1 -1
- package/resources/operations/shipping-terms.d.ts +9 -9
- package/resources/operations/shipping-terms.d.ts.map +1 -1
- package/resources/sales/account-prices/account-prices.d.mts +3 -3
- package/resources/sales/account-prices/account-prices.d.mts.map +1 -1
- package/resources/sales/account-prices/account-prices.d.ts +3 -3
- package/resources/sales/account-prices/account-prices.d.ts.map +1 -1
- package/resources/sales/account-users/sales-targets.d.mts +2 -2
- package/resources/sales/account-users/sales-targets.d.mts.map +1 -1
- package/resources/sales/account-users/sales-targets.d.ts +2 -2
- package/resources/sales/account-users/sales-targets.d.ts.map +1 -1
- package/resources/sales/customers/customers.d.mts +5 -5
- package/resources/sales/customers/customers.d.mts.map +1 -1
- package/resources/sales/customers/customers.d.ts +5 -5
- package/resources/sales/customers/customers.d.ts.map +1 -1
- package/resources/sales/sales-orders/lines/lines.d.mts +5 -5
- package/resources/sales/sales-orders/lines/lines.d.mts.map +1 -1
- package/resources/sales/sales-orders/lines/lines.d.ts +5 -5
- package/resources/sales/sales-orders/lines/lines.d.ts.map +1 -1
- package/resources/sales/sales-orders/sales-orders.d.mts +8 -4
- package/resources/sales/sales-orders/sales-orders.d.mts.map +1 -1
- package/resources/sales/sales-orders/sales-orders.d.ts +8 -4
- package/resources/sales/sales-orders/sales-orders.d.ts.map +1 -1
- package/resources/sales/sales-orders/sales-orders.js.map +1 -1
- package/resources/sales/sales-orders/sales-orders.mjs.map +1 -1
- package/src/resources/catalog/catalog.ts +2 -8
- package/src/resources/catalog/index.ts +1 -4
- package/src/resources/catalog/items/actions.ts +296 -0
- package/src/resources/catalog/items/index.ts +23 -3
- package/src/resources/catalog/items/inventory.ts +294 -0
- package/src/resources/catalog/items/items.ts +54 -124
- package/src/resources/catalog/materials/index.ts +1 -0
- package/src/resources/catalog/materials/materials.ts +41 -2
- package/src/resources/catalog/product-lines/index.ts +0 -1
- package/src/resources/catalog/product-lines/product-lines.ts +7 -25
- package/src/resources/core/audit-events.ts +26 -10
- package/src/resources/core/core.ts +13 -5
- package/src/resources/core/jobs.ts +7 -3
- package/src/resources/messaging/blocks.ts +4 -3
- package/src/resources/messaging/conversations/conversations.ts +21 -9
- package/src/resources/messaging/conversations/links.ts +14 -6
- package/src/resources/messaging/conversations/messages.ts +14 -6
- package/src/resources/messaging/notifications/notifications.ts +14 -6
- package/src/resources/operations/machine-downtime-events.ts +5 -5
- package/src/resources/operations/shipping-terms.ts +9 -9
- package/src/resources/sales/account-prices/account-prices.ts +3 -3
- package/src/resources/sales/account-users/sales-targets.ts +2 -2
- package/src/resources/sales/customers/customers.ts +5 -5
- package/src/resources/sales/sales-orders/lines/lines.ts +5 -5
- package/src/resources/sales/sales-orders/sales-orders.ts +9 -4
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
import { APIResource } from "../../../core/resource.js";
|
|
2
|
+
import * as APIKeysAPI from "../../auth/api-keys/api-keys.js";
|
|
3
|
+
import { APIPromise } from "../../../core/api-promise.js";
|
|
4
|
+
import { RequestOptions } from "../../../internal/request-options.js";
|
|
5
|
+
/**
|
|
6
|
+
* List and manage inventory items.
|
|
7
|
+
*/
|
|
8
|
+
export declare class Actions extends APIResource {
|
|
9
|
+
/**
|
|
10
|
+
* Reconciles inventory for multiple items by SKU in one call, the bulk equivalent
|
|
11
|
+
* of counting stock and correcting the books.
|
|
12
|
+
*
|
|
13
|
+
* `reconcile_type` controls whether each quantity is added to the item's current
|
|
14
|
+
* quantity (`addition`) or replaces it (`force`). The figure a `force` measures
|
|
15
|
+
* against is what is on hand net of demand nothing has covered, the same basis the
|
|
16
|
+
* single-item endpoint uses. The response reports each item as reconciled, skipped
|
|
17
|
+
* (e.g. unknown SKU), or errored (e.g. unknown unit), so a problem with one item
|
|
18
|
+
* does not fail the rest of the batch.
|
|
19
|
+
*
|
|
20
|
+
* Each correction is written to the item's inventory audit trail as a user
|
|
21
|
+
* correction, attributed to the caller.
|
|
22
|
+
*
|
|
23
|
+
* This endpoint requires the permission: `items:create`.
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```ts
|
|
27
|
+
* const bulkReconcileItemsResponse =
|
|
28
|
+
* await client.catalog.items.actions.bulkReconcile({
|
|
29
|
+
* data: [
|
|
30
|
+
* {
|
|
31
|
+
* sku: 'ALM-2024-1001',
|
|
32
|
+
* unit: 'kg',
|
|
33
|
+
* quantity: '10.5',
|
|
34
|
+
* },
|
|
35
|
+
* ],
|
|
36
|
+
* reconcile_type: 'addition',
|
|
37
|
+
* });
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
bulkReconcile(body: ActionBulkReconcileParams, options?: RequestOptions): APIPromise<BulkReconcileItemsResponse>;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* One item to reconcile in a bulk reconcile request.
|
|
44
|
+
*/
|
|
45
|
+
export interface BulkReconcileItemInput {
|
|
46
|
+
/**
|
|
47
|
+
* Quantity to apply, interpreted according to the request's `reconcile_type`.
|
|
48
|
+
*
|
|
49
|
+
* A decimal string rather than a number: a quantity that has been through a binary
|
|
50
|
+
* float is not the quantity you sent.
|
|
51
|
+
*/
|
|
52
|
+
quantity: string;
|
|
53
|
+
/**
|
|
54
|
+
* SKU of the item to reconcile.
|
|
55
|
+
*
|
|
56
|
+
* Items whose SKU does not match an existing item are reported in the response's
|
|
57
|
+
* `skipped_items` rather than failing the request.
|
|
58
|
+
*/
|
|
59
|
+
sku: string;
|
|
60
|
+
/**
|
|
61
|
+
* Abbreviation of a unit available to your account (e.g. `kg`).
|
|
62
|
+
*
|
|
63
|
+
* The unit is checked for existence only: the quantity is always recorded in the
|
|
64
|
+
* item's own base unit, so send figures already expressed in that unit. Rows
|
|
65
|
+
* naming an abbreviation that matches no built-in or account-defined unit are
|
|
66
|
+
* reported in the response's `errors`.
|
|
67
|
+
*/
|
|
68
|
+
unit: string;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Request to reconcile inventory for many items at once.
|
|
72
|
+
*/
|
|
73
|
+
export interface BulkReconcileItemsRequest {
|
|
74
|
+
/**
|
|
75
|
+
* Items to reconcile.
|
|
76
|
+
*/
|
|
77
|
+
data: Array<BulkReconcileItemInput>;
|
|
78
|
+
/**
|
|
79
|
+
* How each item's quantity is applied to its current quantity.
|
|
80
|
+
*
|
|
81
|
+
* - `addition`: adds the quantity to the item's current quantity.
|
|
82
|
+
* - `force`: sets the item's current quantity to exactly the given quantity.
|
|
83
|
+
*/
|
|
84
|
+
reconcile_type: string;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* The outcome of a bulk inventory reconciliation, reported as three separate
|
|
88
|
+
* lists.
|
|
89
|
+
*/
|
|
90
|
+
export interface BulkReconcileItemsResponse {
|
|
91
|
+
/**
|
|
92
|
+
* A single page of resources, together with the metadata needed to page through
|
|
93
|
+
* the rest of the result set.
|
|
94
|
+
*/
|
|
95
|
+
errors: ListReconcileErrorResult | null;
|
|
96
|
+
/**
|
|
97
|
+
* Resource type identifier.
|
|
98
|
+
*/
|
|
99
|
+
object: 'bulk_reconcile_items_response';
|
|
100
|
+
/**
|
|
101
|
+
* A single page of resources, together with the metadata needed to page through
|
|
102
|
+
* the rest of the result set.
|
|
103
|
+
*/
|
|
104
|
+
reconciled_items: ListReconciledItemResult | null;
|
|
105
|
+
/**
|
|
106
|
+
* A single page of resources, together with the metadata needed to page through
|
|
107
|
+
* the rest of the result set.
|
|
108
|
+
*/
|
|
109
|
+
skipped_items: ListSkippedItemResult | null;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* A single page of resources, together with the metadata needed to page through
|
|
113
|
+
* the rest of the result set.
|
|
114
|
+
*/
|
|
115
|
+
export interface ListReconcileErrorResult {
|
|
116
|
+
/**
|
|
117
|
+
* Resources in this page.
|
|
118
|
+
*/
|
|
119
|
+
data: Array<ReconcileErrorResult>;
|
|
120
|
+
/**
|
|
121
|
+
* Resource type identifier.
|
|
122
|
+
*/
|
|
123
|
+
object: 'list';
|
|
124
|
+
/**
|
|
125
|
+
* PageInfo describes where the current page sits within a paginated result set and
|
|
126
|
+
* how to move to the adjacent pages.
|
|
127
|
+
*
|
|
128
|
+
* Page a list by following the URLs below rather than assembling cursors yourself.
|
|
129
|
+
* For a top-level list endpoint the URL repeats the original request's query
|
|
130
|
+
* string with only the cursor swapped, so following it preserves the same filters,
|
|
131
|
+
* search term, and page size.
|
|
132
|
+
*/
|
|
133
|
+
page_info: APIKeysAPI.PageInfo;
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* A single page of resources, together with the metadata needed to page through
|
|
137
|
+
* the rest of the result set.
|
|
138
|
+
*/
|
|
139
|
+
export interface ListReconciledItemResult {
|
|
140
|
+
/**
|
|
141
|
+
* Resources in this page.
|
|
142
|
+
*/
|
|
143
|
+
data: Array<ReconciledItemResult>;
|
|
144
|
+
/**
|
|
145
|
+
* Resource type identifier.
|
|
146
|
+
*/
|
|
147
|
+
object: 'list';
|
|
148
|
+
/**
|
|
149
|
+
* PageInfo describes where the current page sits within a paginated result set and
|
|
150
|
+
* how to move to the adjacent pages.
|
|
151
|
+
*
|
|
152
|
+
* Page a list by following the URLs below rather than assembling cursors yourself.
|
|
153
|
+
* For a top-level list endpoint the URL repeats the original request's query
|
|
154
|
+
* string with only the cursor swapped, so following it preserves the same filters,
|
|
155
|
+
* search term, and page size.
|
|
156
|
+
*/
|
|
157
|
+
page_info: APIKeysAPI.PageInfo;
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* A single page of resources, together with the metadata needed to page through
|
|
161
|
+
* the rest of the result set.
|
|
162
|
+
*/
|
|
163
|
+
export interface ListSkippedItemResult {
|
|
164
|
+
/**
|
|
165
|
+
* Resources in this page.
|
|
166
|
+
*/
|
|
167
|
+
data: Array<SkippedItemResult>;
|
|
168
|
+
/**
|
|
169
|
+
* Resource type identifier.
|
|
170
|
+
*/
|
|
171
|
+
object: 'list';
|
|
172
|
+
/**
|
|
173
|
+
* PageInfo describes where the current page sits within a paginated result set and
|
|
174
|
+
* how to move to the adjacent pages.
|
|
175
|
+
*
|
|
176
|
+
* Page a list by following the URLs below rather than assembling cursors yourself.
|
|
177
|
+
* For a top-level list endpoint the URL repeats the original request's query
|
|
178
|
+
* string with only the cursor swapped, so following it preserves the same filters,
|
|
179
|
+
* search term, and page size.
|
|
180
|
+
*/
|
|
181
|
+
page_info: APIKeysAPI.PageInfo;
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* A submitted row that could not be reconciled.
|
|
185
|
+
*/
|
|
186
|
+
export interface ReconcileErrorResult {
|
|
187
|
+
/**
|
|
188
|
+
* Error message.
|
|
189
|
+
*/
|
|
190
|
+
error: string;
|
|
191
|
+
/**
|
|
192
|
+
* Item SKU.
|
|
193
|
+
*/
|
|
194
|
+
sku: string;
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* An item whose on-hand quantity was successfully reconciled.
|
|
198
|
+
*
|
|
199
|
+
* Both quantities are expressed in the item's own base unit, not in the unit
|
|
200
|
+
* submitted with the request.
|
|
201
|
+
*/
|
|
202
|
+
export interface ReconciledItemResult {
|
|
203
|
+
/**
|
|
204
|
+
* Item ID.
|
|
205
|
+
*/
|
|
206
|
+
item_id: string;
|
|
207
|
+
/**
|
|
208
|
+
* Quantity after the reconciliation, as a decimal string.
|
|
209
|
+
*/
|
|
210
|
+
new_quantity: string;
|
|
211
|
+
/**
|
|
212
|
+
* Quantity before the reconciliation, as a decimal string.
|
|
213
|
+
*/
|
|
214
|
+
previous_quantity: string;
|
|
215
|
+
/**
|
|
216
|
+
* Item SKU.
|
|
217
|
+
*/
|
|
218
|
+
sku: string;
|
|
219
|
+
}
|
|
220
|
+
/**
|
|
221
|
+
* A submitted row that was skipped rather than reconciled.
|
|
222
|
+
*/
|
|
223
|
+
export interface SkippedItemResult {
|
|
224
|
+
/**
|
|
225
|
+
* Human-readable reason the item was skipped.
|
|
226
|
+
*/
|
|
227
|
+
reason: string;
|
|
228
|
+
/**
|
|
229
|
+
* Item SKU.
|
|
230
|
+
*/
|
|
231
|
+
sku: string;
|
|
232
|
+
}
|
|
233
|
+
export interface ActionBulkReconcileParams {
|
|
234
|
+
/**
|
|
235
|
+
* Items to reconcile.
|
|
236
|
+
*/
|
|
237
|
+
data: Array<BulkReconcileItemInput>;
|
|
238
|
+
/**
|
|
239
|
+
* How each item's quantity is applied to its current quantity.
|
|
240
|
+
*
|
|
241
|
+
* - `addition`: adds the quantity to the item's current quantity.
|
|
242
|
+
* - `force`: sets the item's current quantity to exactly the given quantity.
|
|
243
|
+
*/
|
|
244
|
+
reconcile_type: string;
|
|
245
|
+
}
|
|
246
|
+
export declare namespace Actions {
|
|
247
|
+
export { type BulkReconcileItemInput as BulkReconcileItemInput, type BulkReconcileItemsRequest as BulkReconcileItemsRequest, type BulkReconcileItemsResponse as BulkReconcileItemsResponse, type ListReconcileErrorResult as ListReconcileErrorResult, type ListReconciledItemResult as ListReconciledItemResult, type ListSkippedItemResult as ListSkippedItemResult, type ReconcileErrorResult as ReconcileErrorResult, type ReconciledItemResult as ReconciledItemResult, type SkippedItemResult as SkippedItemResult, type ActionBulkReconcileParams as ActionBulkReconcileParams, };
|
|
248
|
+
}
|
|
249
|
+
//# sourceMappingURL=actions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../../../src/resources/catalog/items/actions.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,UAAU;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAEzB;;GAEG;AACH,qBAAa,OAAQ,SAAQ,WAAW;IACtC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA8BG;IACH,aAAa,CACX,IAAI,EAAE,yBAAyB,EAC/B,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,0BAA0B,CAAC;CAG1C;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC;;;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IACnC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;CACb;AAED;;;;;GAKG;AACH,MAAM,WAAW,oBAAoB;IACnC;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,iBAAiB,EAAE,MAAM,CAAC;IAE1B;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;CACb;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,yBAAyB;IACxC;;OAEG;IACH,IAAI,EAAE,KAAK,CAAC,sBAAsB,CAAC,CAAC;IAEpC;;;;;OAKG;IACH,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,CAAC,OAAO,WAAW,OAAO,CAAC;IAC/B,OAAO,EACL,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,yBAAyB,IAAI,yBAAyB,EAC3D,KAAK,0BAA0B,IAAI,0BAA0B,EAC7D,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,yBAAyB,IAAI,yBAAyB,GAC5D,CAAC;CACH"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.Actions = void 0;
|
|
5
|
+
const resource_1 = require("../../../core/resource.js");
|
|
6
|
+
/**
|
|
7
|
+
* List and manage inventory items.
|
|
8
|
+
*/
|
|
9
|
+
class Actions extends resource_1.APIResource {
|
|
10
|
+
/**
|
|
11
|
+
* Reconciles inventory for multiple items by SKU in one call, the bulk equivalent
|
|
12
|
+
* of counting stock and correcting the books.
|
|
13
|
+
*
|
|
14
|
+
* `reconcile_type` controls whether each quantity is added to the item's current
|
|
15
|
+
* quantity (`addition`) or replaces it (`force`). The figure a `force` measures
|
|
16
|
+
* against is what is on hand net of demand nothing has covered, the same basis the
|
|
17
|
+
* single-item endpoint uses. The response reports each item as reconciled, skipped
|
|
18
|
+
* (e.g. unknown SKU), or errored (e.g. unknown unit), so a problem with one item
|
|
19
|
+
* does not fail the rest of the batch.
|
|
20
|
+
*
|
|
21
|
+
* Each correction is written to the item's inventory audit trail as a user
|
|
22
|
+
* correction, attributed to the caller.
|
|
23
|
+
*
|
|
24
|
+
* This endpoint requires the permission: `items:create`.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```ts
|
|
28
|
+
* const bulkReconcileItemsResponse =
|
|
29
|
+
* await client.catalog.items.actions.bulkReconcile({
|
|
30
|
+
* data: [
|
|
31
|
+
* {
|
|
32
|
+
* sku: 'ALM-2024-1001',
|
|
33
|
+
* unit: 'kg',
|
|
34
|
+
* quantity: '10.5',
|
|
35
|
+
* },
|
|
36
|
+
* ],
|
|
37
|
+
* reconcile_type: 'addition',
|
|
38
|
+
* });
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
bulkReconcile(body, options) {
|
|
42
|
+
return this._client.post('/v1/catalog/items/actions/bulk-reconcile', { body, ...options });
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
exports.Actions = Actions;
|
|
46
|
+
//# sourceMappingURL=actions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"actions.js","sourceRoot":"","sources":["../../../src/resources/catalog/items/actions.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,wDAAqD;AAKrD;;GAEG;AACH,MAAa,OAAQ,SAAQ,sBAAW;IACtC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA8BG;IACH,aAAa,CACX,IAA+B,EAC/B,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,0CAA0C,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC7F,CAAC;CACF;AAtCD,0BAsCC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
import { APIResource } from "../../../core/resource.mjs";
|
|
3
|
+
/**
|
|
4
|
+
* List and manage inventory items.
|
|
5
|
+
*/
|
|
6
|
+
export class Actions extends APIResource {
|
|
7
|
+
/**
|
|
8
|
+
* Reconciles inventory for multiple items by SKU in one call, the bulk equivalent
|
|
9
|
+
* of counting stock and correcting the books.
|
|
10
|
+
*
|
|
11
|
+
* `reconcile_type` controls whether each quantity is added to the item's current
|
|
12
|
+
* quantity (`addition`) or replaces it (`force`). The figure a `force` measures
|
|
13
|
+
* against is what is on hand net of demand nothing has covered, the same basis the
|
|
14
|
+
* single-item endpoint uses. The response reports each item as reconciled, skipped
|
|
15
|
+
* (e.g. unknown SKU), or errored (e.g. unknown unit), so a problem with one item
|
|
16
|
+
* does not fail the rest of the batch.
|
|
17
|
+
*
|
|
18
|
+
* Each correction is written to the item's inventory audit trail as a user
|
|
19
|
+
* correction, attributed to the caller.
|
|
20
|
+
*
|
|
21
|
+
* This endpoint requires the permission: `items:create`.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```ts
|
|
25
|
+
* const bulkReconcileItemsResponse =
|
|
26
|
+
* await client.catalog.items.actions.bulkReconcile({
|
|
27
|
+
* data: [
|
|
28
|
+
* {
|
|
29
|
+
* sku: 'ALM-2024-1001',
|
|
30
|
+
* unit: 'kg',
|
|
31
|
+
* quantity: '10.5',
|
|
32
|
+
* },
|
|
33
|
+
* ],
|
|
34
|
+
* reconcile_type: 'addition',
|
|
35
|
+
* });
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
bulkReconcile(body, options) {
|
|
39
|
+
return this._client.post('/v1/catalog/items/actions/bulk-reconcile', { body, ...options });
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=actions.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"actions.mjs","sourceRoot":"","sources":["../../../src/resources/catalog/items/actions.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;AAKtB;;GAEG;AACH,MAAM,OAAO,OAAQ,SAAQ,WAAW;IACtC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA8BG;IACH,aAAa,CACX,IAA+B,EAC/B,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,0CAA0C,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC7F,CAAC;CACF"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
export { Actions, type BulkReconcileItemInput, type BulkReconcileItemsRequest, type BulkReconcileItemsResponse, type ListReconcileErrorResult, type ListReconciledItemResult, type ListSkippedItemResult, type ReconcileErrorResult, type ReconciledItemResult, type SkippedItemResult, type ActionBulkReconcileParams, } from "./actions.mjs";
|
|
1
2
|
export { Attributes, type AttributeUpdateParams, type AttributeDeleteParams } from "./attributes.mjs";
|
|
2
|
-
export {
|
|
3
|
+
export { Inventory, type ComputedQuantity, type ItemInventory, type QuantityInput, type UpdateItemInventoryRequest, type InventoryUpdateResponse, type InventoryListParams, type InventoryUpdateParams, } from "./inventory.mjs";
|
|
4
|
+
export { Items, type Item, type ItemCategory, type ItemLotDefault, type ListItem, type Rate, type ItemListParams, type ItemRetrieveParams, type ItemRetrieveLotDefaultParams, type ItemChangeCategoryParams, } from "./items.mjs";
|
|
3
5
|
//# sourceMappingURL=index.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/resources/catalog/items/index.ts"],"names":[],"mappings":"OAEO,EAAE,UAAU,EAAE,KAAK,qBAAqB,EAAE,KAAK,qBAAqB,EAAE;OACtE,EACL,
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/resources/catalog/items/index.ts"],"names":[],"mappings":"OAEO,EACL,OAAO,EACP,KAAK,sBAAsB,EAC3B,KAAK,yBAAyB,EAC9B,KAAK,0BAA0B,EAC/B,KAAK,wBAAwB,EAC7B,KAAK,wBAAwB,EAC7B,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,iBAAiB,EACtB,KAAK,yBAAyB,GAC/B;OACM,EAAE,UAAU,EAAE,KAAK,qBAAqB,EAAE,KAAK,qBAAqB,EAAE;OACtE,EACL,SAAS,EACT,KAAK,gBAAgB,EACrB,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,0BAA0B,EAC/B,KAAK,uBAAuB,EAC5B,KAAK,mBAAmB,EACxB,KAAK,qBAAqB,GAC3B;OACM,EACL,KAAK,EACL,KAAK,IAAI,EACT,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,KAAK,QAAQ,EACb,KAAK,IAAI,EACT,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACvB,KAAK,4BAA4B,EACjC,KAAK,wBAAwB,GAC9B"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
export { Actions, type BulkReconcileItemInput, type BulkReconcileItemsRequest, type BulkReconcileItemsResponse, type ListReconcileErrorResult, type ListReconciledItemResult, type ListSkippedItemResult, type ReconcileErrorResult, type ReconciledItemResult, type SkippedItemResult, type ActionBulkReconcileParams, } from "./actions.js";
|
|
1
2
|
export { Attributes, type AttributeUpdateParams, type AttributeDeleteParams } from "./attributes.js";
|
|
2
|
-
export {
|
|
3
|
+
export { Inventory, type ComputedQuantity, type ItemInventory, type QuantityInput, type UpdateItemInventoryRequest, type InventoryUpdateResponse, type InventoryListParams, type InventoryUpdateParams, } from "./inventory.js";
|
|
4
|
+
export { Items, type Item, type ItemCategory, type ItemLotDefault, type ListItem, type Rate, type ItemListParams, type ItemRetrieveParams, type ItemRetrieveLotDefaultParams, type ItemChangeCategoryParams, } from "./items.js";
|
|
3
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/resources/catalog/items/index.ts"],"names":[],"mappings":"OAEO,EAAE,UAAU,EAAE,KAAK,qBAAqB,EAAE,KAAK,qBAAqB,EAAE;OACtE,EACL,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/resources/catalog/items/index.ts"],"names":[],"mappings":"OAEO,EACL,OAAO,EACP,KAAK,sBAAsB,EAC3B,KAAK,yBAAyB,EAC9B,KAAK,0BAA0B,EAC/B,KAAK,wBAAwB,EAC7B,KAAK,wBAAwB,EAC7B,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,iBAAiB,EACtB,KAAK,yBAAyB,GAC/B;OACM,EAAE,UAAU,EAAE,KAAK,qBAAqB,EAAE,KAAK,qBAAqB,EAAE;OACtE,EACL,SAAS,EACT,KAAK,gBAAgB,EACrB,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,0BAA0B,EAC/B,KAAK,uBAAuB,EAC5B,KAAK,mBAAmB,EACxB,KAAK,qBAAqB,GAC3B;OACM,EACL,KAAK,EACL,KAAK,IAAI,EACT,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,KAAK,QAAQ,EACb,KAAK,IAAI,EACT,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACvB,KAAK,4BAA4B,EACjC,KAAK,wBAAwB,GAC9B"}
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.Items = exports.Attributes = void 0;
|
|
4
|
+
exports.Items = exports.Inventory = exports.Attributes = exports.Actions = void 0;
|
|
5
|
+
var actions_1 = require("./actions.js");
|
|
6
|
+
Object.defineProperty(exports, "Actions", { enumerable: true, get: function () { return actions_1.Actions; } });
|
|
5
7
|
var attributes_1 = require("./attributes.js");
|
|
6
8
|
Object.defineProperty(exports, "Attributes", { enumerable: true, get: function () { return attributes_1.Attributes; } });
|
|
9
|
+
var inventory_1 = require("./inventory.js");
|
|
10
|
+
Object.defineProperty(exports, "Inventory", { enumerable: true, get: function () { return inventory_1.Inventory; } });
|
|
7
11
|
var items_1 = require("./items.js");
|
|
8
12
|
Object.defineProperty(exports, "Items", { enumerable: true, get: function () { return items_1.Items; } });
|
|
9
13
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/resources/catalog/items/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,8CAAkG;AAAzF,wGAAA,UAAU,OAAA;AACnB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/resources/catalog/items/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,wCAYmB;AAXjB,kGAAA,OAAO,OAAA;AAYT,8CAAkG;AAAzF,wGAAA,UAAU,OAAA;AACnB,4CASqB;AARnB,sGAAA,SAAS,OAAA;AASX,oCAWiB;AAVf,8FAAA,KAAK,OAAA"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
export { Actions, } from "./actions.mjs";
|
|
2
3
|
export { Attributes } from "./attributes.mjs";
|
|
4
|
+
export { Inventory, } from "./inventory.mjs";
|
|
3
5
|
export { Items, } from "./items.mjs";
|
|
4
6
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/resources/catalog/items/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,UAAU,EAA0D;OACtE,EACL,KAAK,
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/resources/catalog/items/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EACL,OAAO,GAWR;OACM,EAAE,UAAU,EAA0D;OACtE,EACL,SAAS,GAQV;OACM,EACL,KAAK,GAUN"}
|
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
import { APIResource } from "../../../core/resource.mjs";
|
|
2
|
+
import * as UnitsAPI from "../units/units.mjs";
|
|
3
|
+
import { APIPromise } from "../../../core/api-promise.mjs";
|
|
4
|
+
import { RequestOptions } from "../../../internal/request-options.mjs";
|
|
5
|
+
/**
|
|
6
|
+
* List and manage inventory items.
|
|
7
|
+
*/
|
|
8
|
+
export declare class Inventory extends APIResource {
|
|
9
|
+
/**
|
|
10
|
+
* Returns the stock position for an item: what is on hand, what is reserved
|
|
11
|
+
* against existing orders, what is free to promise, and what is short.
|
|
12
|
+
*
|
|
13
|
+
* Stock your account either owns or holds counts toward the on-hand figure, so
|
|
14
|
+
* customer-supplied material sitting in your facility is included. All four
|
|
15
|
+
* quantities are reported in the base unit of the item's category.
|
|
16
|
+
*
|
|
17
|
+
* This endpoint requires the permission: `items:read`.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```ts
|
|
21
|
+
* const itemInventory =
|
|
22
|
+
* await client.catalog.items.inventory.list(
|
|
23
|
+
* 'it_pej07ckhvu62',
|
|
24
|
+
* );
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
list(id: string, query?: InventoryListParams | null | undefined, options?: RequestOptions): APIPromise<ItemInventory>;
|
|
28
|
+
/**
|
|
29
|
+
* Adjusts or reconciles the quantity of an item you hold.
|
|
30
|
+
*
|
|
31
|
+
* With `operation` set to `adjust` (the behavior when it is omitted), `quantity`
|
|
32
|
+
* is added to the current quantity; with `reconcile`, the current quantity is set
|
|
33
|
+
* to exactly `quantity`. Either way it is the resulting difference that gets
|
|
34
|
+
* written, so a difference of zero moves no stock.
|
|
35
|
+
*
|
|
36
|
+
* The figure a `reconcile` measures against is what is on hand net of demand
|
|
37
|
+
* nothing has covered — the same figure `available_to_promise` is derived from,
|
|
38
|
+
* not the raw on-hand total. Reconciling to the quantity already reported
|
|
39
|
+
* therefore writes nothing.
|
|
40
|
+
*
|
|
41
|
+
* Stock that arrives is allocated against unfilled demand for the item, so an
|
|
42
|
+
* adjustment can settle a shortfall instead of raising the quantity free to
|
|
43
|
+
* promise. That allocation happens just after the request rather than inside it,
|
|
44
|
+
* because it walks every open issue for the item. The change is recorded in the
|
|
45
|
+
* item's inventory audit trail as a user correction attributed to the caller.
|
|
46
|
+
*
|
|
47
|
+
* This endpoint requires the permission: `items:update`.
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* ```ts
|
|
51
|
+
* const inventory =
|
|
52
|
+
* await client.catalog.items.inventory.update(
|
|
53
|
+
* 'it_pej07ckhvu62',
|
|
54
|
+
* {
|
|
55
|
+
* quantity: {
|
|
56
|
+
* value: '10.5',
|
|
57
|
+
* unit_id: 'un_82bd37dae5po',
|
|
58
|
+
* },
|
|
59
|
+
* customer_id: 'ac_opnlh43ymyee',
|
|
60
|
+
* location_id: 'lc_yonnys0hx3ju',
|
|
61
|
+
* operation: 'adjust',
|
|
62
|
+
* },
|
|
63
|
+
* );
|
|
64
|
+
* ```
|
|
65
|
+
*/
|
|
66
|
+
update(id: string, body: InventoryUpdateParams, options?: RequestOptions): APIPromise<InventoryUpdateResponse>;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* An amount calculated on demand rather than stored.
|
|
70
|
+
*
|
|
71
|
+
* The same shape as a quantity minus the ID, because nothing was written: it is
|
|
72
|
+
* derived per request, such as a total rolled up across invoiced lines for one
|
|
73
|
+
* analysis.
|
|
74
|
+
*/
|
|
75
|
+
export interface ComputedQuantity {
|
|
76
|
+
/**
|
|
77
|
+
* Formatted value with unit abbreviation (e.g. "1,200 pr").
|
|
78
|
+
*/
|
|
79
|
+
display_value: string;
|
|
80
|
+
/**
|
|
81
|
+
* Resource type identifier.
|
|
82
|
+
*/
|
|
83
|
+
object: 'computed_quantity';
|
|
84
|
+
/**
|
|
85
|
+
* Unit of measurement used for conversions and product quantities.
|
|
86
|
+
*/
|
|
87
|
+
unit: UnitsAPI.Unit | null;
|
|
88
|
+
/**
|
|
89
|
+
* Raw decimal value, as a string to preserve precision.
|
|
90
|
+
*
|
|
91
|
+
* This is the unformatted machine value; see `display_value` for the
|
|
92
|
+
* human-readable rendering.
|
|
93
|
+
*/
|
|
94
|
+
value: string;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* The stock position for an item: what is in stock, what is already committed, and
|
|
98
|
+
* what is still free to sell.
|
|
99
|
+
*
|
|
100
|
+
* All four quantities are reported in the same unit — the base unit of the item's
|
|
101
|
+
* category. Derived figures, not stored rows: each is netted out of the ledger at
|
|
102
|
+
* read time, so none of them carries a quantity id.
|
|
103
|
+
*/
|
|
104
|
+
export interface ItemInventory {
|
|
105
|
+
/**
|
|
106
|
+
* An amount calculated on demand rather than stored.
|
|
107
|
+
*
|
|
108
|
+
* The same shape as a quantity minus the ID, because nothing was written: it is
|
|
109
|
+
* derived per request, such as a total rolled up across invoiced lines for one
|
|
110
|
+
* analysis.
|
|
111
|
+
*/
|
|
112
|
+
available_to_promise: ComputedQuantity | null;
|
|
113
|
+
/**
|
|
114
|
+
* Resource type identifier.
|
|
115
|
+
*/
|
|
116
|
+
object: 'item_inventory';
|
|
117
|
+
/**
|
|
118
|
+
* An amount calculated on demand rather than stored.
|
|
119
|
+
*
|
|
120
|
+
* The same shape as a quantity minus the ID, because nothing was written: it is
|
|
121
|
+
* derived per request, such as a total rolled up across invoiced lines for one
|
|
122
|
+
* analysis.
|
|
123
|
+
*/
|
|
124
|
+
on_hand: ComputedQuantity | null;
|
|
125
|
+
/**
|
|
126
|
+
* An amount calculated on demand rather than stored.
|
|
127
|
+
*
|
|
128
|
+
* The same shape as a quantity minus the ID, because nothing was written: it is
|
|
129
|
+
* derived per request, such as a total rolled up across invoiced lines for one
|
|
130
|
+
* analysis.
|
|
131
|
+
*/
|
|
132
|
+
reserved: ComputedQuantity | null;
|
|
133
|
+
/**
|
|
134
|
+
* An amount calculated on demand rather than stored.
|
|
135
|
+
*
|
|
136
|
+
* The same shape as a quantity minus the ID, because nothing was written: it is
|
|
137
|
+
* derived per request, such as a total rolled up across invoiced lines for one
|
|
138
|
+
* analysis.
|
|
139
|
+
*/
|
|
140
|
+
short: ComputedQuantity | null;
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* An amount together with the unit it is expressed in.
|
|
144
|
+
*
|
|
145
|
+
* The unit may be a currency, so money amounts such as a credit limit are written
|
|
146
|
+
* the same way as physical amounts like weights or counts.
|
|
147
|
+
*/
|
|
148
|
+
export interface QuantityInput {
|
|
149
|
+
/**
|
|
150
|
+
* ID of the unit of measure for the value.
|
|
151
|
+
*/
|
|
152
|
+
unit_id: string;
|
|
153
|
+
/**
|
|
154
|
+
* Decimal value, as a string to preserve precision.
|
|
155
|
+
*/
|
|
156
|
+
value: string;
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Request to adjust or reconcile inventory for an item.
|
|
160
|
+
*/
|
|
161
|
+
export interface UpdateItemInventoryRequest {
|
|
162
|
+
/**
|
|
163
|
+
* An amount together with the unit it is expressed in.
|
|
164
|
+
*
|
|
165
|
+
* The unit may be a currency, so money amounts such as a credit limit are written
|
|
166
|
+
* the same way as physical amounts like weights or counts.
|
|
167
|
+
*/
|
|
168
|
+
quantity: QuantityInput;
|
|
169
|
+
/**
|
|
170
|
+
* ID of the customer account that owns the resulting inventory.
|
|
171
|
+
*
|
|
172
|
+
* Use this for stock you hold but do not own, such as customer-supplied material.
|
|
173
|
+
* It only affects quantity being added: your account stays the holder, the
|
|
174
|
+
* customer becomes the owner, and the current quantity a `reconcile` measures
|
|
175
|
+
* against is still your account's. Requires edit access to that customer.
|
|
176
|
+
*/
|
|
177
|
+
customer_id?: string;
|
|
178
|
+
/**
|
|
179
|
+
* ID of the location to record the inventory change against.
|
|
180
|
+
*
|
|
181
|
+
* Must be a location in your account.
|
|
182
|
+
*/
|
|
183
|
+
location_id?: string;
|
|
184
|
+
/**
|
|
185
|
+
* Lot number to record the inventory change against.
|
|
186
|
+
*
|
|
187
|
+
* The lot is created for the item if it does not already exist.
|
|
188
|
+
*/
|
|
189
|
+
lot_number?: string;
|
|
190
|
+
/**
|
|
191
|
+
* How `quantity` is applied.
|
|
192
|
+
*
|
|
193
|
+
* - `adjust`: adds `quantity` to the current quantity.
|
|
194
|
+
* - `reconcile`: sets the current quantity to exactly `quantity`.
|
|
195
|
+
*/
|
|
196
|
+
operation?: 'adjust' | 'reconcile';
|
|
197
|
+
}
|
|
198
|
+
export interface InventoryUpdateResponse {
|
|
199
|
+
}
|
|
200
|
+
export interface InventoryListParams {
|
|
201
|
+
/**
|
|
202
|
+
* Sub-objects to expand in the response. When omitted, sub-objects are returned as
|
|
203
|
+
* `null`.
|
|
204
|
+
*/
|
|
205
|
+
include?: Array<'on_hand' | 'reserved' | 'available_to_promise' | 'short'>;
|
|
206
|
+
}
|
|
207
|
+
export interface InventoryUpdateParams {
|
|
208
|
+
/**
|
|
209
|
+
* An amount together with the unit it is expressed in.
|
|
210
|
+
*
|
|
211
|
+
* The unit may be a currency, so money amounts such as a credit limit are written
|
|
212
|
+
* the same way as physical amounts like weights or counts.
|
|
213
|
+
*/
|
|
214
|
+
quantity: QuantityInput;
|
|
215
|
+
/**
|
|
216
|
+
* ID of the customer account that owns the resulting inventory.
|
|
217
|
+
*
|
|
218
|
+
* Use this for stock you hold but do not own, such as customer-supplied material.
|
|
219
|
+
* It only affects quantity being added: your account stays the holder, the
|
|
220
|
+
* customer becomes the owner, and the current quantity a `reconcile` measures
|
|
221
|
+
* against is still your account's. Requires edit access to that customer.
|
|
222
|
+
*/
|
|
223
|
+
customer_id?: string;
|
|
224
|
+
/**
|
|
225
|
+
* ID of the location to record the inventory change against.
|
|
226
|
+
*
|
|
227
|
+
* Must be a location in your account.
|
|
228
|
+
*/
|
|
229
|
+
location_id?: string;
|
|
230
|
+
/**
|
|
231
|
+
* Lot number to record the inventory change against.
|
|
232
|
+
*
|
|
233
|
+
* The lot is created for the item if it does not already exist.
|
|
234
|
+
*/
|
|
235
|
+
lot_number?: string;
|
|
236
|
+
/**
|
|
237
|
+
* How `quantity` is applied.
|
|
238
|
+
*
|
|
239
|
+
* - `adjust`: adds `quantity` to the current quantity.
|
|
240
|
+
* - `reconcile`: sets the current quantity to exactly `quantity`.
|
|
241
|
+
*/
|
|
242
|
+
operation?: 'adjust' | 'reconcile';
|
|
243
|
+
}
|
|
244
|
+
export declare namespace Inventory {
|
|
245
|
+
export { type ComputedQuantity as ComputedQuantity, type ItemInventory as ItemInventory, type QuantityInput as QuantityInput, type UpdateItemInventoryRequest as UpdateItemInventoryRequest, type InventoryUpdateResponse as InventoryUpdateResponse, type InventoryListParams as InventoryListParams, type InventoryUpdateParams as InventoryUpdateParams, };
|
|
246
|
+
}
|
|
247
|
+
//# sourceMappingURL=inventory.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inventory.d.mts","sourceRoot":"","sources":["../../../src/resources/catalog/items/inventory.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,QAAQ;OACb,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAGzB;;GAEG;AACH,qBAAa,SAAU,SAAQ,WAAW;IACxC;;;;;;;;;;;;;;;;;OAiBG;IACH,IAAI,CACF,EAAE,EAAE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