@openmrp/sdk 0.21.0 → 0.22.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.
Files changed (214) hide show
  1. package/CHANGELOG.md +11 -2
  2. package/README.md +1 -1
  3. package/client.js +1 -1
  4. package/client.mjs +1 -1
  5. package/package.json +1 -1
  6. package/resources/auth/api-keys/api-keys.d.mts +4 -4
  7. package/resources/auth/api-keys/api-keys.d.ts +4 -4
  8. package/resources/core/audit-events.d.mts +4 -4
  9. package/resources/core/audit-events.d.mts.map +1 -1
  10. package/resources/core/audit-events.d.ts +4 -4
  11. package/resources/core/audit-events.d.ts.map +1 -1
  12. package/resources/core/core.d.mts +2 -2
  13. package/resources/core/core.d.mts.map +1 -1
  14. package/resources/core/core.d.ts +2 -2
  15. package/resources/core/core.d.ts.map +1 -1
  16. package/resources/core/core.js.map +1 -1
  17. package/resources/core/core.mjs.map +1 -1
  18. package/resources/core/jobs.d.mts +1 -1
  19. package/resources/core/jobs.d.mts.map +1 -1
  20. package/resources/core/jobs.d.ts +1 -1
  21. package/resources/core/jobs.d.ts.map +1 -1
  22. package/resources/messaging/conversations/conversations.d.mts +3 -3
  23. package/resources/messaging/conversations/conversations.d.mts.map +1 -1
  24. package/resources/messaging/conversations/conversations.d.ts +3 -3
  25. package/resources/messaging/conversations/conversations.d.ts.map +1 -1
  26. package/resources/messaging/conversations/conversations.js.map +1 -1
  27. package/resources/messaging/conversations/conversations.mjs.map +1 -1
  28. package/resources/messaging/conversations/links.d.mts +2 -2
  29. package/resources/messaging/conversations/links.d.mts.map +1 -1
  30. package/resources/messaging/conversations/links.d.ts +2 -2
  31. package/resources/messaging/conversations/links.d.ts.map +1 -1
  32. package/resources/messaging/conversations/messages.d.mts +2 -2
  33. package/resources/messaging/conversations/messages.d.mts.map +1 -1
  34. package/resources/messaging/conversations/messages.d.ts +2 -2
  35. package/resources/messaging/conversations/messages.d.ts.map +1 -1
  36. package/resources/messaging/notifications/notifications.d.mts +2 -2
  37. package/resources/messaging/notifications/notifications.d.mts.map +1 -1
  38. package/resources/messaging/notifications/notifications.d.ts +2 -2
  39. package/resources/messaging/notifications/notifications.d.ts.map +1 -1
  40. package/resources/messaging/notifications/notifications.js.map +1 -1
  41. package/resources/messaging/notifications/notifications.mjs.map +1 -1
  42. package/resources/operations/index.d.mts +2 -0
  43. package/resources/operations/index.d.mts.map +1 -1
  44. package/resources/operations/index.d.ts +2 -0
  45. package/resources/operations/index.d.ts.map +1 -1
  46. package/resources/operations/index.js +15 -11
  47. package/resources/operations/index.js.map +1 -1
  48. package/resources/operations/index.mjs +2 -0
  49. package/resources/operations/index.mjs.map +1 -1
  50. package/resources/operations/inventory-change-logs/actions.d.mts +60 -0
  51. package/resources/operations/inventory-change-logs/actions.d.mts.map +1 -0
  52. package/resources/operations/inventory-change-logs/actions.d.ts +60 -0
  53. package/resources/operations/inventory-change-logs/actions.d.ts.map +1 -0
  54. package/resources/operations/inventory-change-logs/actions.js +30 -0
  55. package/resources/operations/inventory-change-logs/actions.js.map +1 -0
  56. package/resources/operations/inventory-change-logs/actions.mjs +26 -0
  57. package/resources/operations/inventory-change-logs/actions.mjs.map +1 -0
  58. package/resources/operations/inventory-change-logs/index.d.mts +3 -0
  59. package/resources/operations/inventory-change-logs/index.d.mts.map +1 -0
  60. package/resources/operations/inventory-change-logs/index.d.ts +3 -0
  61. package/resources/operations/inventory-change-logs/index.d.ts.map +1 -0
  62. package/resources/operations/inventory-change-logs/index.js +9 -0
  63. package/resources/operations/inventory-change-logs/index.js.map +1 -0
  64. package/resources/operations/inventory-change-logs/index.mjs +4 -0
  65. package/resources/operations/inventory-change-logs/index.mjs.map +1 -0
  66. package/resources/operations/inventory-change-logs/inventory-change-logs.d.mts +188 -0
  67. package/resources/operations/inventory-change-logs/inventory-change-logs.d.mts.map +1 -0
  68. package/resources/operations/inventory-change-logs/inventory-change-logs.d.ts +188 -0
  69. package/resources/operations/inventory-change-logs/inventory-change-logs.d.ts.map +1 -0
  70. package/resources/operations/inventory-change-logs/inventory-change-logs.js +55 -0
  71. package/resources/operations/inventory-change-logs/inventory-change-logs.js.map +1 -0
  72. package/resources/operations/inventory-change-logs/inventory-change-logs.mjs +50 -0
  73. package/resources/operations/inventory-change-logs/inventory-change-logs.mjs.map +1 -0
  74. package/resources/operations/inventory-change-logs.d.mts +2 -0
  75. package/resources/operations/inventory-change-logs.d.mts.map +1 -0
  76. package/resources/operations/inventory-change-logs.d.ts +2 -0
  77. package/resources/operations/inventory-change-logs.d.ts.map +1 -0
  78. package/resources/operations/inventory-change-logs.js +6 -0
  79. package/resources/operations/inventory-change-logs.js.map +1 -0
  80. package/resources/operations/inventory-change-logs.mjs +3 -0
  81. package/resources/operations/inventory-change-logs.mjs.map +1 -0
  82. package/resources/operations/operations.d.mts +8 -0
  83. package/resources/operations/operations.d.mts.map +1 -1
  84. package/resources/operations/operations.d.ts +8 -0
  85. package/resources/operations/operations.d.ts.map +1 -1
  86. package/resources/operations/operations.js +8 -0
  87. package/resources/operations/operations.js.map +1 -1
  88. package/resources/operations/operations.mjs +8 -0
  89. package/resources/operations/operations.mjs.map +1 -1
  90. package/resources/operations/picks/actions.d.mts +111 -0
  91. package/resources/operations/picks/actions.d.mts.map +1 -0
  92. package/resources/operations/picks/actions.d.ts +111 -0
  93. package/resources/operations/picks/actions.d.ts.map +1 -0
  94. package/resources/operations/picks/actions.js +93 -0
  95. package/resources/operations/picks/actions.js.map +1 -0
  96. package/resources/operations/picks/actions.mjs +89 -0
  97. package/resources/operations/picks/actions.mjs.map +1 -0
  98. package/resources/operations/picks/index.d.mts +4 -0
  99. package/resources/operations/picks/index.d.mts.map +1 -0
  100. package/resources/operations/picks/index.d.ts +4 -0
  101. package/resources/operations/picks/index.d.ts.map +1 -0
  102. package/resources/operations/picks/index.js +11 -0
  103. package/resources/operations/picks/index.js.map +1 -0
  104. package/resources/operations/picks/index.mjs +5 -0
  105. package/resources/operations/picks/index.mjs.map +1 -0
  106. package/resources/operations/picks/lines/actions.d.mts +65 -0
  107. package/resources/operations/picks/lines/actions.d.mts.map +1 -0
  108. package/resources/operations/picks/lines/actions.d.ts +65 -0
  109. package/resources/operations/picks/lines/actions.d.ts.map +1 -0
  110. package/resources/operations/picks/lines/actions.js +59 -0
  111. package/resources/operations/picks/lines/actions.js.map +1 -0
  112. package/resources/operations/picks/lines/actions.mjs +55 -0
  113. package/resources/operations/picks/lines/actions.mjs.map +1 -0
  114. package/resources/operations/picks/lines/index.d.mts +3 -0
  115. package/resources/operations/picks/lines/index.d.mts.map +1 -0
  116. package/resources/operations/picks/lines/index.d.ts +3 -0
  117. package/resources/operations/picks/lines/index.d.ts.map +1 -0
  118. package/resources/operations/picks/lines/index.js +9 -0
  119. package/resources/operations/picks/lines/index.js.map +1 -0
  120. package/resources/operations/picks/lines/index.mjs +4 -0
  121. package/resources/operations/picks/lines/index.mjs.map +1 -0
  122. package/resources/operations/picks/lines/lines.d.mts +70 -0
  123. package/resources/operations/picks/lines/lines.d.mts.map +1 -0
  124. package/resources/operations/picks/lines/lines.d.ts +70 -0
  125. package/resources/operations/picks/lines/lines.d.ts.map +1 -0
  126. package/resources/operations/picks/lines/lines.js +48 -0
  127. package/resources/operations/picks/lines/lines.js.map +1 -0
  128. package/resources/operations/picks/lines/lines.mjs +43 -0
  129. package/resources/operations/picks/lines/lines.mjs.map +1 -0
  130. package/resources/operations/picks/lines.d.mts +2 -0
  131. package/resources/operations/picks/lines.d.mts.map +1 -0
  132. package/resources/operations/picks/lines.d.ts +2 -0
  133. package/resources/operations/picks/lines.d.ts.map +1 -0
  134. package/resources/operations/picks/lines.js +6 -0
  135. package/resources/operations/picks/lines.js.map +1 -0
  136. package/resources/operations/picks/lines.mjs +3 -0
  137. package/resources/operations/picks/lines.mjs.map +1 -0
  138. package/resources/operations/picks/picks.d.mts +383 -0
  139. package/resources/operations/picks/picks.d.mts.map +1 -0
  140. package/resources/operations/picks/picks.d.ts +383 -0
  141. package/resources/operations/picks/picks.d.ts.map +1 -0
  142. package/resources/operations/picks/picks.js +57 -0
  143. package/resources/operations/picks/picks.js.map +1 -0
  144. package/resources/operations/picks/picks.mjs +52 -0
  145. package/resources/operations/picks/picks.mjs.map +1 -0
  146. package/resources/operations/picks.d.mts +2 -0
  147. package/resources/operations/picks.d.mts.map +1 -0
  148. package/resources/operations/picks.d.ts +2 -0
  149. package/resources/operations/picks.d.ts.map +1 -0
  150. package/resources/operations/picks.js +6 -0
  151. package/resources/operations/picks.js.map +1 -0
  152. package/resources/operations/picks.mjs +3 -0
  153. package/resources/operations/picks.mjs.map +1 -0
  154. package/resources/sales/index.d.mts +1 -1
  155. package/resources/sales/index.d.mts.map +1 -1
  156. package/resources/sales/index.d.ts +1 -1
  157. package/resources/sales/index.d.ts.map +1 -1
  158. package/resources/sales/index.js.map +1 -1
  159. package/resources/sales/index.mjs.map +1 -1
  160. package/resources/sales/sales-orders/actions.d.mts +12 -40
  161. package/resources/sales/sales-orders/actions.d.mts.map +1 -1
  162. package/resources/sales/sales-orders/actions.d.ts +12 -40
  163. package/resources/sales/sales-orders/actions.d.ts.map +1 -1
  164. package/resources/sales/sales-orders/index.d.mts +1 -1
  165. package/resources/sales/sales-orders/index.d.mts.map +1 -1
  166. package/resources/sales/sales-orders/index.d.ts +1 -1
  167. package/resources/sales/sales-orders/index.d.ts.map +1 -1
  168. package/resources/sales/sales-orders/index.js.map +1 -1
  169. package/resources/sales/sales-orders/index.mjs.map +1 -1
  170. package/resources/sales/sales-orders/sales-orders.d.mts +105 -63
  171. package/resources/sales/sales-orders/sales-orders.d.mts.map +1 -1
  172. package/resources/sales/sales-orders/sales-orders.d.ts +105 -63
  173. package/resources/sales/sales-orders/sales-orders.d.ts.map +1 -1
  174. package/resources/sales/sales-orders/sales-orders.js.map +1 -1
  175. package/resources/sales/sales-orders/sales-orders.mjs.map +1 -1
  176. package/resources/sales/sales.d.mts +2 -2
  177. package/resources/sales/sales.d.mts.map +1 -1
  178. package/resources/sales/sales.d.ts +2 -2
  179. package/resources/sales/sales.d.ts.map +1 -1
  180. package/resources/sales/sales.js.map +1 -1
  181. package/resources/sales/sales.mjs.map +1 -1
  182. package/src/client.ts +1 -1
  183. package/src/resources/auth/api-keys/api-keys.ts +4 -4
  184. package/src/resources/core/audit-events.ts +16 -4
  185. package/src/resources/core/core.ts +8 -2
  186. package/src/resources/core/jobs.ts +4 -1
  187. package/src/resources/messaging/conversations/conversations.ts +12 -3
  188. package/src/resources/messaging/conversations/links.ts +8 -2
  189. package/src/resources/messaging/conversations/messages.ts +8 -2
  190. package/src/resources/messaging/notifications/notifications.ts +8 -2
  191. package/src/resources/operations/index.ts +19 -0
  192. package/src/resources/operations/inventory-change-logs/actions.ts +73 -0
  193. package/src/resources/operations/inventory-change-logs/index.ts +10 -0
  194. package/src/resources/operations/inventory-change-logs/inventory-change-logs.ts +239 -0
  195. package/src/resources/operations/inventory-change-logs.ts +3 -0
  196. package/src/resources/operations/operations.ts +47 -0
  197. package/src/resources/operations/picks/actions.ts +131 -0
  198. package/src/resources/operations/picks/index.ts +16 -0
  199. package/src/resources/operations/picks/lines/actions.ts +78 -0
  200. package/src/resources/operations/picks/lines/index.ts +4 -0
  201. package/src/resources/operations/picks/lines/lines.ts +100 -0
  202. package/src/resources/operations/picks/lines.ts +3 -0
  203. package/src/resources/operations/picks/picks.ts +502 -0
  204. package/src/resources/operations/picks.ts +3 -0
  205. package/src/resources/sales/index.ts +1 -0
  206. package/src/resources/sales/sales-orders/actions.ts +12 -55
  207. package/src/resources/sales/sales-orders/index.ts +1 -0
  208. package/src/resources/sales/sales-orders/sales-orders.ts +124 -79
  209. package/src/resources/sales/sales.ts +2 -0
  210. package/src/version.ts +1 -1
  211. package/version.d.mts +1 -1
  212. package/version.d.ts +1 -1
  213. package/version.js +1 -1
  214. package/version.mjs +1 -1
@@ -0,0 +1,502 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../../../core/resource';
4
+ import * as APIKeysAPI from '../../auth/api-keys/api-keys';
5
+ import * as ItemsAPI from '../../catalog/items/items';
6
+ import * as MaterialsAPI from '../../catalog/materials/materials';
7
+ import * as ActionsAPI from './actions';
8
+ import { ActionPackParams, Actions, PackPickRequest } from './actions';
9
+ import * as AccountPricesAPI from '../../sales/account-prices/account-prices';
10
+ import * as SalesOrdersAPI from '../../sales/sales-orders/sales-orders';
11
+ import * as LinesAPI from './lines/lines';
12
+ import { LineUpdateParams, Lines, UpdatePickLineRequest } from './lines/lines';
13
+ import { APIPromise } from '../../../core/api-promise';
14
+ import { RequestOptions } from '../../../internal/request-options';
15
+ import { path } from '../../../internal/utils/path';
16
+
17
+ /**
18
+ * List, view, pick, void, and pack picks and pick lines.
19
+ */
20
+ export class Picks extends APIResource {
21
+ actions: ActionsAPI.Actions = new ActionsAPI.Actions(this._client);
22
+ lines: LinesAPI.Lines = new LinesAPI.Lines(this._client);
23
+
24
+ /**
25
+ * Returns a paginated list of picks, soonest ship-by date first.
26
+ *
27
+ * The `q` search term matches the pick number, the sales order number, the
28
+ * customer PO number, and the customer's name or number.
29
+ *
30
+ * This endpoint requires the permissions: `picks:read`, `customers:read`,
31
+ * `suppliers:read`.
32
+ *
33
+ * @example
34
+ * ```ts
35
+ * const listPick = await client.operations.picks.list();
36
+ * ```
37
+ */
38
+ list(query: PickListParams | null | undefined = {}, options?: RequestOptions): APIPromise<ListPick> {
39
+ return this._client.get('/v1/operations/picks', { query, ...options });
40
+ }
41
+
42
+ /**
43
+ * Returns a pick by ID.
44
+ *
45
+ * This endpoint requires the permission: `picks:read`.
46
+ *
47
+ * @example
48
+ * ```ts
49
+ * const pick = await client.operations.picks.retrieve(
50
+ * 'pk_6eilj488bq8d',
51
+ * );
52
+ * ```
53
+ */
54
+ retrieve(
55
+ id: string,
56
+ query: PickRetrieveParams | null | undefined = {},
57
+ options?: RequestOptions,
58
+ ): APIPromise<Pick> {
59
+ return this._client.get(path`/v1/operations/picks/${id}`, { query, ...options });
60
+ }
61
+ }
62
+
63
+ /**
64
+ * A single page of resources, together with the metadata needed to page through
65
+ * the rest of the result set.
66
+ */
67
+ export interface ListPick {
68
+ /**
69
+ * Resources in this page.
70
+ */
71
+ data: Array<Pick>;
72
+
73
+ /**
74
+ * Resource type identifier.
75
+ */
76
+ object: 'list';
77
+
78
+ /**
79
+ * PageInfo describes where the current page sits within a paginated result set and
80
+ * how to move to the adjacent pages.
81
+ *
82
+ * Page a list by following the URLs below rather than assembling cursors yourself.
83
+ * For a top-level list endpoint the URL repeats the original request's query
84
+ * string with only the cursor swapped, so following it preserves the same filters,
85
+ * search term, and page size.
86
+ */
87
+ page_info: APIKeysAPI.PageInfo;
88
+ }
89
+
90
+ /**
91
+ * A single page of resources, together with the metadata needed to page through
92
+ * the rest of the result set.
93
+ */
94
+ export interface ListPickLine {
95
+ /**
96
+ * Resources in this page.
97
+ */
98
+ data: Array<PickLine>;
99
+
100
+ /**
101
+ * Resource type identifier.
102
+ */
103
+ object: 'list';
104
+
105
+ /**
106
+ * PageInfo describes where the current page sits within a paginated result set and
107
+ * how to move to the adjacent pages.
108
+ *
109
+ * Page a list by following the URLs below rather than assembling cursors yourself.
110
+ * For a top-level list endpoint the URL repeats the original request's query
111
+ * string with only the cursor swapped, so following it preserves the same filters,
112
+ * search term, and page size.
113
+ */
114
+ page_info: APIKeysAPI.PageInfo;
115
+ }
116
+
117
+ /**
118
+ * A warehouse picking task for a sales order, tracking the quantities to pull from
119
+ * inventory and pack for shipment.
120
+ *
121
+ * A pick is created automatically when a sales order is issued, with one line for
122
+ * each order line whose product is of type `sale` service, shipping, tax, credit
123
+ * and return lines are skipped — and nothing picked yet.
124
+ */
125
+ export interface Pick {
126
+ /**
127
+ * Pick ID.
128
+ */
129
+ id: string;
130
+
131
+ /**
132
+ * Commitment describes when a record is due to ship: what was asked for, what that
133
+ * resolved to, and which rule decided.
134
+ *
135
+ * It is a generic, reusable sub-resource shared by anything carrying a ship-by
136
+ * commitment — a sales order, the pick that fulfills it, or a preview of an order
137
+ * that does not exist yet.
138
+ *
139
+ * The three inputs are alternative answers to the same question and at most one is
140
+ * ever set; `lead_time_source` reports which of them, or which level of the
141
+ * customer chain, produced the date. They are written flat on the create and
142
+ * update bodies, the way a carrier is written as `carrier_id` and read back under
143
+ * `freight`.
144
+ */
145
+ commitment: SalesOrdersAPI.Commitment | null;
146
+
147
+ /**
148
+ * Creation timestamp.
149
+ */
150
+ created_at: string;
151
+
152
+ /**
153
+ * CreatedBy describes who created a resource and their relationship to the account
154
+ * that owns it.
155
+ *
156
+ * It is resolved from the resource's create audit event.
157
+ */
158
+ created_by: SalesOrdersAPI.CreatedBy | null;
159
+
160
+ /**
161
+ * A business you sell to, with its contact details, default fulfillment settings,
162
+ * and order policies.
163
+ */
164
+ customer: AccountPricesAPI.Customer | null;
165
+
166
+ /**
167
+ * The customer's own purchase order number for the sales order this pick fulfills.
168
+ */
169
+ customer_purchase_order_number: string | null;
170
+
171
+ /**
172
+ * Timestamp when the pick was finished.
173
+ */
174
+ finished_at: string | null;
175
+
176
+ /**
177
+ * Freight describes the carrier selection and freight billing for a record.
178
+ *
179
+ * It is a generic, reusable sub-resource shared by anything that carries shipping
180
+ * configuration — a sales order, a purchase order, or a shipment.
181
+ */
182
+ freight: SalesOrdersAPI.Freight | null;
183
+
184
+ /**
185
+ * Timestamp of the most recent shipment sent (null until shipped).
186
+ */
187
+ last_shipped_at: string | null;
188
+
189
+ /**
190
+ * Number of lines on this pick.
191
+ */
192
+ line_count: number;
193
+
194
+ /**
195
+ * A single page of resources, together with the metadata needed to page through
196
+ * the rest of the result set.
197
+ */
198
+ lines: ListPickLine | null;
199
+
200
+ /**
201
+ * Free-form note carried from the sales order this pick fulfills.
202
+ */
203
+ note: string | null;
204
+
205
+ /**
206
+ * Human-readable number that identifies the pick, distinct from the `id`.
207
+ */
208
+ number: string;
209
+
210
+ /**
211
+ * Resource type identifier.
212
+ */
213
+ object: 'pick';
214
+
215
+ /**
216
+ * How urgently the pick should be worked.
217
+ */
218
+ priority: 'low' | 'normal' | 'high';
219
+
220
+ /**
221
+ * Groups the records a pick sits between — the order it fulfills and the shipments
222
+ * packed from it — and is returned only once at least one member has been
223
+ * expanded.
224
+ */
225
+ related: PickRelated | null;
226
+
227
+ /**
228
+ * A saved address that can be used for billing and shipping on sales orders,
229
+ * invoices, and shipments.
230
+ */
231
+ ship_to: APIKeysAPI.Address | null;
232
+
233
+ /**
234
+ * Progress through each fulfillment stage of a pick.
235
+ */
236
+ totals: PickTotals | null;
237
+
238
+ /**
239
+ * Last updated timestamp.
240
+ */
241
+ updated_at: string;
242
+ }
243
+
244
+ /**
245
+ * A single line on a pick, tracking the quantity picked against one sales order
246
+ * line.
247
+ */
248
+ export interface PickLine {
249
+ /**
250
+ * Pick line ID.
251
+ */
252
+ id: string;
253
+
254
+ /**
255
+ * Creation timestamp.
256
+ */
257
+ created_at: string;
258
+
259
+ /**
260
+ * An entry in your catalog: something you sell, consume, or build with.
261
+ */
262
+ item: ItemsAPI.Item | null;
263
+
264
+ /**
265
+ * Resource type identifier.
266
+ */
267
+ object: 'pick_line';
268
+
269
+ /**
270
+ * A measured amount: a numeric value together with the unit it is expressed in.
271
+ *
272
+ * Quantities are shared building blocks rather than standalone records — other
273
+ * resources point at them to report stock levels, ordered and packed amounts,
274
+ * money, weights, and durations.
275
+ */
276
+ ordered_quantity: MaterialsAPI.Quantity | null;
277
+
278
+ /**
279
+ * Timestamp when the line was packed.
280
+ */
281
+ packed_at: string | null;
282
+
283
+ /**
284
+ * A measured amount: a numeric value together with the unit it is expressed in.
285
+ *
286
+ * Quantities are shared building blocks rather than standalone records — other
287
+ * resources point at them to report stock levels, ordered and packed amounts,
288
+ * money, weights, and durations.
289
+ */
290
+ quantity: MaterialsAPI.Quantity | null;
291
+
292
+ /**
293
+ * A single line item on a sales order.
294
+ */
295
+ sales_order_line: SalesOrdersAPI.SalesOrderLine | null;
296
+
297
+ /**
298
+ * Last updated timestamp.
299
+ */
300
+ updated_at: string;
301
+ }
302
+
303
+ /**
304
+ * Groups the records a pick sits between — the order it fulfills and the shipments
305
+ * packed from it — and is returned only once at least one member has been
306
+ * expanded.
307
+ */
308
+ export interface PickRelated {
309
+ /**
310
+ * Resource type identifier.
311
+ */
312
+ object: 'pick_related';
313
+
314
+ /**
315
+ * Record is a lightweight reference to a business record — a sales order, purchase
316
+ * order, pick, shipment, production run, invoice, etc.
317
+ *
318
+ * Like the `actor` and `entity` references, it carries just enough to identify and
319
+ * label the referenced record without embedding its full resource. The `status`
320
+ * and `metadata` fields hold type-specific detail that varies by the kind of
321
+ * record referenced.
322
+ */
323
+ sales_order: SalesOrdersAPI.Record | null;
324
+
325
+ /**
326
+ * A single page of resources, together with the metadata needed to page through
327
+ * the rest of the result set.
328
+ */
329
+ shipments: SalesOrdersAPI.ListRecord | null;
330
+ }
331
+
332
+ /**
333
+ * How far one fulfillment stage of a pick has progressed.
334
+ */
335
+ export interface PickStageTotal {
336
+ /**
337
+ * Progress as a fraction between 0 and 1.
338
+ */
339
+ completion: number;
340
+
341
+ /**
342
+ * Resource type identifier.
343
+ */
344
+ object: 'pick_stage_total';
345
+ }
346
+
347
+ /**
348
+ * Progress through each fulfillment stage of a pick.
349
+ */
350
+ export interface PickTotals {
351
+ /**
352
+ * Resource type identifier.
353
+ */
354
+ object: 'pick_totals';
355
+
356
+ /**
357
+ * How far one fulfillment stage of a pick has progressed.
358
+ */
359
+ packed: PickStageTotal;
360
+
361
+ /**
362
+ * How far one fulfillment stage of a pick has progressed.
363
+ */
364
+ picked: PickStageTotal;
365
+ }
366
+
367
+ export interface PickListParams {
368
+ /**
369
+ * Opaque cursor token identifying where the page of results starts.
370
+ *
371
+ * Use the `cursor` value embedded in a previous response's `next_page_url` or
372
+ * `previous_page_url` to fetch the adjacent page. Omit to start from the first
373
+ * page.
374
+ */
375
+ cursor?: string;
376
+
377
+ /**
378
+ * Restricts results to picks whose customer belongs to any of these account
379
+ * groups, matching the `type` on the customer.
380
+ */
381
+ customer_group_ids?: Array<string>;
382
+
383
+ /**
384
+ * Restricts results to picks raised for any of these customers.
385
+ */
386
+ customer_ids?: Array<string>;
387
+
388
+ /**
389
+ * Latest pick creation date to include, in `YYYY-MM-DD` format. Inclusive of the
390
+ * date itself.
391
+ */
392
+ ends_at?: string;
393
+
394
+ /**
395
+ * Sub-objects to expand in the response. When omitted, sub-objects are returned as
396
+ * `null`.
397
+ */
398
+ include?: Array<
399
+ | 'customer'
400
+ | 'created_by'
401
+ | 'freight'
402
+ | 'related.sales_order'
403
+ | 'related.shipments'
404
+ | 'lines'
405
+ | 'lines.item'
406
+ | 'lines.sales_order_line'
407
+ | 'lines.sales_order_line.product'
408
+ | 'lines.quantity'
409
+ | 'lines.quantity.unit'
410
+ | 'lines.ordered_quantity'
411
+ | 'lines.ordered_quantity.unit'
412
+ >;
413
+
414
+ /**
415
+ * Maximum number of results to return in a single page.
416
+ */
417
+ limit?: number;
418
+
419
+ /**
420
+ * Restricts results to picks with at least one line whose product belongs to any
421
+ * of these product lines.
422
+ */
423
+ product_line_ids?: Array<string>;
424
+
425
+ /**
426
+ * Free-text search term used to filter results.
427
+ *
428
+ * Which fields are matched against the term varies by endpoint.
429
+ */
430
+ q?: string;
431
+
432
+ /**
433
+ * Orders the results: `ship_by_date` puts the soonest delivery commitment first,
434
+ * with picks whose order has no ship-by date last; `created_at` puts the newest
435
+ * pick first.
436
+ */
437
+ sort?: 'ship_by_date' | 'created_at';
438
+
439
+ /**
440
+ * Earliest pick creation date to include, in `YYYY-MM-DD` format.
441
+ */
442
+ starts_at?: string;
443
+
444
+ /**
445
+ * Restricts results to picks in this state.
446
+ *
447
+ * - `open`: picks that have not been finished.
448
+ * - `closed`: picks that have been finished.
449
+ */
450
+ status?: 'open' | 'closed';
451
+ }
452
+
453
+ export interface PickRetrieveParams {
454
+ /**
455
+ * Sub-objects to expand in the response. When omitted, sub-objects are returned as
456
+ * `null`.
457
+ */
458
+ include?: Array<
459
+ | 'customer'
460
+ | 'created_by'
461
+ | 'freight'
462
+ | 'related.sales_order'
463
+ | 'related.shipments'
464
+ | 'lines'
465
+ | 'lines.item'
466
+ | 'lines.sales_order_line'
467
+ | 'lines.sales_order_line.product'
468
+ | 'lines.quantity'
469
+ | 'lines.quantity.unit'
470
+ | 'lines.ordered_quantity'
471
+ | 'lines.ordered_quantity.unit'
472
+ >;
473
+ }
474
+
475
+ Picks.Actions = Actions;
476
+ Picks.Lines = Lines;
477
+
478
+ export declare namespace Picks {
479
+ export {
480
+ type ListPick as ListPick,
481
+ type ListPickLine as ListPickLine,
482
+ type Pick as Pick,
483
+ type PickLine as PickLine,
484
+ type PickRelated as PickRelated,
485
+ type PickStageTotal as PickStageTotal,
486
+ type PickTotals as PickTotals,
487
+ type PickListParams as PickListParams,
488
+ type PickRetrieveParams as PickRetrieveParams,
489
+ };
490
+
491
+ export {
492
+ Actions as Actions,
493
+ type PackPickRequest as PackPickRequest,
494
+ type ActionPackParams as ActionPackParams,
495
+ };
496
+
497
+ export {
498
+ Lines as Lines,
499
+ type UpdatePickLineRequest as UpdatePickLineRequest,
500
+ type LineUpdateParams as LineUpdateParams,
501
+ };
502
+ }
@@ -0,0 +1,3 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ export * from './picks/index';
@@ -87,6 +87,7 @@ export {
87
87
  SalesOrders,
88
88
  type CheckoutSalesOrderRequest,
89
89
  type CheckoutSalesOrderResponse,
90
+ type Commitment,
90
91
  type ComputedRate,
91
92
  type CreateSalesOrderLineInput,
92
93
  type CreateSalesOrderRequest,
@@ -409,73 +409,30 @@ export interface QuoteSalesOrderCommitmentRequest {
409
409
  */
410
410
  export interface QuoteSalesOrderCommitmentResponse {
411
411
  /**
412
- * Days the receiving and shipping calendars pulled the date back, beyond what
413
- * transit accounted for.
414
- */
415
- calendar_adjustment_days: number;
416
-
417
- /**
418
- * When freight leaving on the ship-by date would reach the customer: transit
419
- * walked forward from it and landed on a day their dock receives. Null whenever
420
- * `transit_days` is, since an arrival with no journey behind it would just be the
421
- * ship date wearing a different name.
412
+ * Commitment describes when a record is due to ship: what was asked for, what that
413
+ * resolved to, and which rule decided.
422
414
  *
423
- * Reported for every basis, including the ones that do not use transit to decide
424
- * the ship-by date. An order committed on a lead time has the same journey ahead
425
- * of it; it simply was not worked backwards from.
426
- */
427
- estimated_delivery_date: string | null;
428
-
429
- /**
430
- * Calendar days between issue and the ship-by date.
431
- */
432
- lead_time_days: number | null;
433
-
434
- /**
435
- * Which rule produced the date.
415
+ * It is a generic, reusable sub-resource shared by anything carrying a ship-by
416
+ * commitment a sales order, the pick that fulfills it, or a preview of an order
417
+ * that does not exist yet.
418
+ *
419
+ * The three inputs are alternative answers to the same question and at most one is
420
+ * ever set; `lead_time_source` reports which of them, or which level of the
421
+ * customer chain, produced the date. They are written flat on the create and
422
+ * update bodies, the way a carrier is written as `carrier_id` and read back under
423
+ * `freight`.
436
424
  */
437
- lead_time_source:
438
- | 'customer'
439
- | 'parent_customer'
440
- | 'account_group'
441
- | 'account'
442
- | 'manual'
443
- | 'order_lead_time'
444
- | 'order_ship_by'
445
- | null;
425
+ commitment: SalesOrdersAPI.Commitment | null;
446
426
 
447
427
  /**
448
428
  * Resource type identifier.
449
429
  */
450
430
  object: 'sales_order_commitment_quote';
451
431
 
452
- /**
453
- * That date at the plant's pickup cutoff — the moment freight would have to be
454
- * tendered by. Null when the shipping calendar carries no cutoff.
455
- */
456
- ship_by_cutoff_at: string | null;
457
-
458
- /**
459
- * The date the order would be due to ship, or null when no rule resolves one.
460
- */
461
- ship_by_date: string | null;
462
-
463
432
  /**
464
433
  * The derivation in order, one entry per rule that moved the date.
465
434
  */
466
435
  steps: Array<CommitmentQuoteStep>;
467
-
468
- /**
469
- * Days the carrier needs to cover the lane. Null when the lane has never been
470
- * quoted and the service level carries no default, or when no service level was
471
- * supplied to quote one on.
472
- */
473
- transit_days: number | null;
474
-
475
- /**
476
- * Where the transit estimate came from.
477
- */
478
- transit_source: 'carrier_lane' | 'service_level' | null;
479
436
  }
480
437
 
481
438
  /**
@@ -28,6 +28,7 @@ export {
28
28
  SalesOrders,
29
29
  type CheckoutSalesOrderRequest,
30
30
  type CheckoutSalesOrderResponse,
31
+ type Commitment,
31
32
  type ComputedRate,
32
33
  type CreateSalesOrderLineInput,
33
34
  type CreateSalesOrderRequest,