@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
@@ -96,6 +96,14 @@ import {
96
96
  FulfillmentRecommendations,
97
97
  ListFulfillmentRecommendation,
98
98
  } from './fulfillment-recommendations/fulfillment-recommendations';
99
+ import * as InventoryChangeLogsAPI from './inventory-change-logs/inventory-change-logs';
100
+ import {
101
+ InventoryChangeLog,
102
+ InventoryChangeLogListParams,
103
+ InventoryChangeLogRetrieveParams,
104
+ InventoryChangeLogs,
105
+ ListInventoryChangeLog,
106
+ } from './inventory-change-logs/inventory-change-logs';
99
107
  import * as LocationsAPI from './locations/locations';
100
108
  import {
101
109
  CreateLocationRequest,
@@ -119,6 +127,19 @@ import {
119
127
  OperatingCalendars,
120
128
  UpdateOperatingCalendarRequest,
121
129
  } from './operating-calendars/operating-calendars';
130
+ import * as PicksAPI from './picks/picks';
131
+ import {
132
+ ListPick,
133
+ ListPickLine,
134
+ Pick,
135
+ PickLine,
136
+ PickListParams,
137
+ PickRelated,
138
+ PickRetrieveParams,
139
+ PickStageTotal,
140
+ PickTotals,
141
+ Picks,
142
+ } from './picks/picks';
122
143
  import * as ProductionScheduleSettingsAPI from './production-schedule-settings/production-schedule-settings';
123
144
  import {
124
145
  ProductionScheduleSettingUpdateParams,
@@ -173,6 +194,8 @@ export class Operations extends APIResource {
173
194
  shippingTerms: ShippingTermsAPI.ShippingTerms = new ShippingTermsAPI.ShippingTerms(this._client);
174
195
  carriers: CarriersAPI.Carriers = new CarriersAPI.Carriers(this._client);
175
196
  departments: DepartmentsAPI.Departments = new DepartmentsAPI.Departments(this._client);
197
+ inventoryChangeLogs: InventoryChangeLogsAPI.InventoryChangeLogs =
198
+ new InventoryChangeLogsAPI.InventoryChangeLogs(this._client);
176
199
  machines: MachinesAPI.Machines = new MachinesAPI.Machines(this._client);
177
200
  machineDowntimeEvents: MachineDowntimeEventsAPI.MachineDowntimeEvents =
178
201
  new MachineDowntimeEventsAPI.MachineDowntimeEvents(this._client);
@@ -186,6 +209,7 @@ export class Operations extends APIResource {
186
209
  operatingCalendars: OperatingCalendarsAPI.OperatingCalendars = new OperatingCalendarsAPI.OperatingCalendars(
187
210
  this._client,
188
211
  );
212
+ picks: PicksAPI.Picks = new PicksAPI.Picks(this._client);
189
213
  locations: LocationsAPI.Locations = new LocationsAPI.Locations(this._client);
190
214
  locationTypes: LocationTypesAPI.LocationTypes = new LocationTypesAPI.LocationTypes(this._client);
191
215
  shipments: ShipmentsAPI.Shipments = new ShipmentsAPI.Shipments(this._client);
@@ -785,12 +809,14 @@ export interface OperationRetrieveMachineStatusParams {
785
809
  Operations.ShippingTerms = ShippingTerms;
786
810
  Operations.Carriers = Carriers;
787
811
  Operations.Departments = Departments;
812
+ Operations.InventoryChangeLogs = InventoryChangeLogs;
788
813
  Operations.Machines = Machines;
789
814
  Operations.MachineDowntimeEvents = MachineDowntimeEvents;
790
815
  Operations.DemandOverrides = DemandOverrides;
791
816
  Operations.ProductionSchedules = ProductionSchedules;
792
817
  Operations.FulfillmentRecommendations = FulfillmentRecommendations;
793
818
  Operations.OperatingCalendars = OperatingCalendars;
819
+ Operations.Picks = Picks;
794
820
  Operations.Locations = Locations;
795
821
  Operations.LocationTypes = LocationTypes;
796
822
  Operations.Shipments = Shipments;
@@ -849,6 +875,14 @@ export declare namespace Operations {
849
875
  type DepartmentUpdateParams as DepartmentUpdateParams,
850
876
  };
851
877
 
878
+ export {
879
+ InventoryChangeLogs as InventoryChangeLogs,
880
+ type InventoryChangeLog as InventoryChangeLog,
881
+ type ListInventoryChangeLog as ListInventoryChangeLog,
882
+ type InventoryChangeLogListParams as InventoryChangeLogListParams,
883
+ type InventoryChangeLogRetrieveParams as InventoryChangeLogRetrieveParams,
884
+ };
885
+
852
886
  export {
853
887
  Machines as Machines,
854
888
  type CreateMachineRequest as CreateMachineRequest,
@@ -949,6 +983,19 @@ export declare namespace Operations {
949
983
  type OperatingCalendarUpdateParams as OperatingCalendarUpdateParams,
950
984
  };
951
985
 
986
+ export {
987
+ Picks as Picks,
988
+ type ListPick as ListPick,
989
+ type ListPickLine as ListPickLine,
990
+ type Pick as Pick,
991
+ type PickLine as PickLine,
992
+ type PickRelated as PickRelated,
993
+ type PickStageTotal as PickStageTotal,
994
+ type PickTotals as PickTotals,
995
+ type PickListParams as PickListParams,
996
+ type PickRetrieveParams as PickRetrieveParams,
997
+ };
998
+
952
999
  export {
953
1000
  Locations as Locations,
954
1001
  type CreateLocationRequest as CreateLocationRequest,
@@ -0,0 +1,131 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../../../core/resource';
4
+ import * as JobsAPI from '../../core/jobs';
5
+ import * as PicksAPI from './picks';
6
+ import { APIPromise } from '../../../core/api-promise';
7
+ import { RequestOptions } from '../../../internal/request-options';
8
+ import { path } from '../../../internal/utils/path';
9
+
10
+ /**
11
+ * List, view, pick, void, and pack picks and pick lines.
12
+ */
13
+ export class Actions extends APIResource {
14
+ /**
15
+ * Marks all lines on a pick as picked.
16
+ *
17
+ * Sets each unpacked line's picked quantity to the quantity still outstanding on
18
+ * its sales order line, after accounting for what other pick lines for that order
19
+ * line have already picked. Lines that have already been packed are unaffected.
20
+ * Use this to fill in a full pick in one call instead of picking each line
21
+ * individually; nothing is shipped until the pick is packed.
22
+ *
23
+ * This endpoint requires the permission: `picks:update`.
24
+ *
25
+ * @example
26
+ * ```ts
27
+ * const pick = await client.operations.picks.actions.pick(
28
+ * 'pk_6eilj488bq8d',
29
+ * );
30
+ * ```
31
+ */
32
+ pick(id: string, options?: RequestOptions): APIPromise<PicksAPI.Pick> {
33
+ return this._client.put(path`/v1/operations/picks/${id}/actions/pick`, options);
34
+ }
35
+
36
+ /**
37
+ * Voids a pick, undoing all picking work recorded on it.
38
+ *
39
+ * Resets the picked quantity on every unpacked line to zero and clears the pick's
40
+ * `finished_at` timestamp, so the pick starts over as open with nothing picked.
41
+ * The pick itself is not deleted, and the sales order is unaffected.
42
+ *
43
+ * Returns a validation error if any shipment exists for the pick's sales order.
44
+ * Voiding those shipments is not enough — they must be deleted, since a voided
45
+ * shipment still exists.
46
+ *
47
+ * This endpoint requires the permission: `picks:update`.
48
+ *
49
+ * @example
50
+ * ```ts
51
+ * const pick = await client.operations.picks.actions.void(
52
+ * 'pk_6eilj488bq8d',
53
+ * );
54
+ * ```
55
+ */
56
+ void(id: string, options?: RequestOptions): APIPromise<PicksAPI.Pick> {
57
+ return this._client.put(path`/v1/operations/picks/${id}/actions/void`, options);
58
+ }
59
+
60
+ /**
61
+ * Packs a pick, creating a shipment from the picked lines.
62
+ *
63
+ * Returns `202 Accepted` with a job, because packing writes a shipment, one
64
+ * shipment line per packed pick line, and the requested shipping cases. Poll the
65
+ * job at the returned `Location`; once it reports `completed`, its first result
66
+ * carries the new shipment's `id`, with the shipment line and shipping case ids in
67
+ * `sub_resource_ids`. Every unpacked line with a picked quantity greater than zero
68
+ * is marked as packed and added to a new shipment in `packed` status, which
69
+ * inherits the sales order's carrier, service level, and shipping address. When a
70
+ * sales order line still has outstanding quantity afterward and no unpacked pick
71
+ * line is already open for it, a new zero-quantity pick line is created for the
72
+ * remainder, so packing a partial pick leaves the pick open for the next round.
73
+ * The pick is marked finished only once every one of its lines is packed.
74
+ *
75
+ * Returns a validation error if no line on the pick has a picked quantity greater
76
+ * than zero.
77
+ *
78
+ * This endpoint requires the permission: `picks:update`.
79
+ *
80
+ * @example
81
+ * ```ts
82
+ * const job = await client.operations.picks.actions.pack(
83
+ * 'pk_6eilj488bq8d',
84
+ * { shipment_case_count: 3 },
85
+ * );
86
+ * ```
87
+ */
88
+ pack(id: string, params: ActionPackParams, options?: RequestOptions): APIPromise<JobsAPI.Job> {
89
+ const { include, ...body } = params;
90
+ return this._client.post(path`/v1/operations/picks/${id}/actions/pack`, {
91
+ query: { include },
92
+ body,
93
+ ...options,
94
+ });
95
+ }
96
+ }
97
+
98
+ /**
99
+ * Request to pack a pick, creating a shipment from the picked lines.
100
+ */
101
+ export interface PackPickRequest {
102
+ /**
103
+ * Number of shipping cases to create on the new shipment.
104
+ *
105
+ * Must be at least 1. Cases are numbered sequentially from the shipment number
106
+ * (e.g. `SO-001-1`, `SO-001-2`), and each starts with zero freight weight and
107
+ * freight cost for you to fill in later.
108
+ */
109
+ shipment_case_count: number;
110
+ }
111
+
112
+ export interface ActionPackParams {
113
+ /**
114
+ * Body param: Number of shipping cases to create on the new shipment.
115
+ *
116
+ * Must be at least 1. Cases are numbered sequentially from the shipment number
117
+ * (e.g. `SO-001-1`, `SO-001-2`), and each starts with zero freight weight and
118
+ * freight cost for you to fill in later.
119
+ */
120
+ shipment_case_count: number;
121
+
122
+ /**
123
+ * Query param: Sub-objects to expand in the response. When omitted, sub-objects
124
+ * are returned as `null`.
125
+ */
126
+ include?: Array<'created_by' | 'created_by.role'>;
127
+ }
128
+
129
+ export declare namespace Actions {
130
+ export { type PackPickRequest as PackPickRequest, type ActionPackParams as ActionPackParams };
131
+ }
@@ -0,0 +1,16 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ export { Actions, type PackPickRequest, type ActionPackParams } from './actions';
4
+ export { Lines, type UpdatePickLineRequest, type LineUpdateParams } from './lines/index';
5
+ export {
6
+ Picks,
7
+ type ListPick,
8
+ type ListPickLine,
9
+ type Pick,
10
+ type PickLine,
11
+ type PickRelated,
12
+ type PickStageTotal,
13
+ type PickTotals,
14
+ type PickListParams,
15
+ type PickRetrieveParams,
16
+ } from './picks';
@@ -0,0 +1,78 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../../../../core/resource';
4
+ import * as PicksAPI from '../picks';
5
+ import { APIPromise } from '../../../../core/api-promise';
6
+ import { RequestOptions } from '../../../../internal/request-options';
7
+ import { path } from '../../../../internal/utils/path';
8
+
9
+ /**
10
+ * List, view, pick, void, and pack picks and pick lines.
11
+ */
12
+ export class Actions extends APIResource {
13
+ /**
14
+ * Marks a pick line as fully picked.
15
+ *
16
+ * Sets the line's picked quantity to its sales order line's ordered quantity less
17
+ * everything already picked for that order line, including whatever this line had
18
+ * picked before the call. To record a short pick instead, set the quantity
19
+ * yourself with Update Pick Line. Has no effect on a line that has already been
20
+ * packed.
21
+ *
22
+ * This endpoint requires the permission: `picks:update`.
23
+ *
24
+ * @example
25
+ * ```ts
26
+ * const pickLine =
27
+ * await client.operations.picks.lines.actions.pick(
28
+ * 'example',
29
+ * { pick_id: 'pk_6eilj488bq8d' },
30
+ * );
31
+ * ```
32
+ */
33
+ pick(id: string, params: ActionPickParams, options?: RequestOptions): APIPromise<PicksAPI.PickLine> {
34
+ const { pick_id } = params;
35
+ return this._client.put(path`/v1/operations/picks/${pick_id}/lines/${id}/actions/pick`, options);
36
+ }
37
+
38
+ /**
39
+ * Voids a pick line, undoing the picking work recorded on it.
40
+ *
41
+ * Resets the line's picked quantity to zero without deleting the line, so the
42
+ * quantity can be picked again. Returns a validation error if the line has already
43
+ * been packed.
44
+ *
45
+ * This endpoint requires the permission: `picks:update`.
46
+ *
47
+ * @example
48
+ * ```ts
49
+ * const pickLine =
50
+ * await client.operations.picks.lines.actions.void(
51
+ * 'example',
52
+ * { pick_id: 'pk_6eilj488bq8d' },
53
+ * );
54
+ * ```
55
+ */
56
+ void(id: string, params: ActionVoidParams, options?: RequestOptions): APIPromise<PicksAPI.PickLine> {
57
+ const { pick_id } = params;
58
+ return this._client.put(path`/v1/operations/picks/${pick_id}/lines/${id}/actions/void`, options);
59
+ }
60
+ }
61
+
62
+ export interface ActionPickParams {
63
+ /**
64
+ * Pick ID.
65
+ */
66
+ pick_id: string;
67
+ }
68
+
69
+ export interface ActionVoidParams {
70
+ /**
71
+ * Pick ID.
72
+ */
73
+ pick_id: string;
74
+ }
75
+
76
+ export declare namespace Actions {
77
+ export { type ActionPickParams as ActionPickParams, type ActionVoidParams as ActionVoidParams };
78
+ }
@@ -0,0 +1,4 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ export { Actions, type ActionPickParams, type ActionVoidParams } from './actions';
4
+ export { Lines, type UpdatePickLineRequest, type LineUpdateParams } from './lines';
@@ -0,0 +1,100 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../../../../core/resource';
4
+ import * as PicksAPI from '../picks';
5
+ import * as ActionsAPI from './actions';
6
+ import { ActionPickParams, ActionVoidParams, Actions } from './actions';
7
+ import { APIPromise } from '../../../../core/api-promise';
8
+ import { RequestOptions } from '../../../../internal/request-options';
9
+ import { path } from '../../../../internal/utils/path';
10
+
11
+ /**
12
+ * List, view, pick, void, and pack picks and pick lines.
13
+ */
14
+ export class Lines extends APIResource {
15
+ actions: ActionsAPI.Actions = new ActionsAPI.Actions(this._client);
16
+
17
+ /**
18
+ * Updates a pick line's picked quantity.
19
+ *
20
+ * Use this to record a short or partial pick; Pick Pick Line fills in the full
21
+ * outstanding quantity instead.
22
+ *
23
+ * This endpoint requires the permission: `picks:update`.
24
+ *
25
+ * @example
26
+ * ```ts
27
+ * const pickLine = await client.operations.picks.lines.update(
28
+ * 'example',
29
+ * {
30
+ * pick_id: 'pk_6eilj488bq8d',
31
+ * quantity_value: '10.000000000000000000000000000000',
32
+ * },
33
+ * );
34
+ * ```
35
+ */
36
+ update(id: string, params: LineUpdateParams, options?: RequestOptions): APIPromise<PicksAPI.PickLine> {
37
+ const { pick_id, include, ...body } = params;
38
+ return this._client.patch(path`/v1/operations/picks/${pick_id}/lines/${id}`, {
39
+ query: { include },
40
+ body,
41
+ ...options,
42
+ });
43
+ }
44
+ }
45
+
46
+ /**
47
+ * Request to update a pick line's picked quantity.
48
+ */
49
+ export interface UpdatePickLineRequest {
50
+ /**
51
+ * New picked quantity for the line, as a decimal string read in the unit the sales
52
+ * order line was sold in, stored as given and not capped at the ordered quantity.
53
+ *
54
+ * Must not be negative. Pulling more than was ordered is a real floor event and is
55
+ * kept as recorded; pulling a negative amount is not.
56
+ */
57
+ quantity_value?: string;
58
+ }
59
+
60
+ export interface LineUpdateParams {
61
+ /**
62
+ * Path param: Pick ID.
63
+ */
64
+ pick_id: string;
65
+
66
+ /**
67
+ * Query param: Sub-objects to expand in the response. When omitted, sub-objects
68
+ * are returned as `null`.
69
+ */
70
+ include?: Array<
71
+ | 'sales_order_line'
72
+ | 'sales_order_line.product'
73
+ | 'quantity'
74
+ | 'quantity.unit'
75
+ | 'ordered_quantity'
76
+ | 'ordered_quantity.unit'
77
+ >;
78
+
79
+ /**
80
+ * Body param: New picked quantity for the line, as a decimal string read in the
81
+ * unit the sales order line was sold in, stored as given and not capped at the
82
+ * ordered quantity.
83
+ *
84
+ * Must not be negative. Pulling more than was ordered is a real floor event and is
85
+ * kept as recorded; pulling a negative amount is not.
86
+ */
87
+ quantity_value?: string;
88
+ }
89
+
90
+ Lines.Actions = Actions;
91
+
92
+ export declare namespace Lines {
93
+ export { type UpdatePickLineRequest as UpdatePickLineRequest, type LineUpdateParams as LineUpdateParams };
94
+
95
+ export {
96
+ Actions as Actions,
97
+ type ActionPickParams as ActionPickParams,
98
+ type ActionVoidParams as ActionVoidParams,
99
+ };
100
+ }
@@ -0,0 +1,3 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ export * from './lines/index';