@openmrp/sdk 0.20.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.
- package/CHANGELOG.md +11 -2
- package/README.md +1 -1
- package/client.js +1 -1
- package/client.mjs +1 -1
- package/package.json +1 -1
- package/resources/auth/api-keys/api-keys.d.mts +4 -4
- package/resources/auth/api-keys/api-keys.d.ts +4 -4
- 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 +1 -1
- package/resources/core/jobs.d.mts.map +1 -1
- package/resources/core/jobs.d.ts +1 -1
- package/resources/core/jobs.d.ts.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/index.d.mts +2 -0
- package/resources/operations/index.d.mts.map +1 -1
- package/resources/operations/index.d.ts +2 -0
- package/resources/operations/index.d.ts.map +1 -1
- package/resources/operations/index.js +15 -11
- package/resources/operations/index.js.map +1 -1
- package/resources/operations/index.mjs +2 -0
- package/resources/operations/index.mjs.map +1 -1
- package/resources/operations/inventory-change-logs/actions.d.mts +60 -0
- package/resources/operations/inventory-change-logs/actions.d.mts.map +1 -0
- package/resources/operations/inventory-change-logs/actions.d.ts +60 -0
- package/resources/operations/inventory-change-logs/actions.d.ts.map +1 -0
- package/resources/operations/inventory-change-logs/actions.js +30 -0
- package/resources/operations/inventory-change-logs/actions.js.map +1 -0
- package/resources/operations/inventory-change-logs/actions.mjs +26 -0
- package/resources/operations/inventory-change-logs/actions.mjs.map +1 -0
- package/resources/operations/inventory-change-logs/index.d.mts +3 -0
- package/resources/operations/inventory-change-logs/index.d.mts.map +1 -0
- package/resources/operations/inventory-change-logs/index.d.ts +3 -0
- package/resources/operations/inventory-change-logs/index.d.ts.map +1 -0
- package/resources/operations/inventory-change-logs/index.js +9 -0
- package/resources/operations/inventory-change-logs/index.js.map +1 -0
- package/resources/operations/inventory-change-logs/index.mjs +4 -0
- package/resources/operations/inventory-change-logs/index.mjs.map +1 -0
- package/resources/operations/inventory-change-logs/inventory-change-logs.d.mts +188 -0
- package/resources/operations/inventory-change-logs/inventory-change-logs.d.mts.map +1 -0
- package/resources/operations/inventory-change-logs/inventory-change-logs.d.ts +188 -0
- package/resources/operations/inventory-change-logs/inventory-change-logs.d.ts.map +1 -0
- package/resources/operations/inventory-change-logs/inventory-change-logs.js +55 -0
- package/resources/operations/inventory-change-logs/inventory-change-logs.js.map +1 -0
- package/resources/operations/inventory-change-logs/inventory-change-logs.mjs +50 -0
- package/resources/operations/inventory-change-logs/inventory-change-logs.mjs.map +1 -0
- package/resources/operations/inventory-change-logs.d.mts +2 -0
- package/resources/operations/inventory-change-logs.d.mts.map +1 -0
- package/resources/operations/inventory-change-logs.d.ts +2 -0
- package/resources/operations/inventory-change-logs.d.ts.map +1 -0
- package/resources/operations/inventory-change-logs.js +6 -0
- package/resources/operations/inventory-change-logs.js.map +1 -0
- package/resources/operations/inventory-change-logs.mjs +3 -0
- package/resources/operations/inventory-change-logs.mjs.map +1 -0
- package/resources/operations/operations.d.mts +8 -0
- package/resources/operations/operations.d.mts.map +1 -1
- package/resources/operations/operations.d.ts +8 -0
- package/resources/operations/operations.d.ts.map +1 -1
- package/resources/operations/operations.js +8 -0
- package/resources/operations/operations.js.map +1 -1
- package/resources/operations/operations.mjs +8 -0
- package/resources/operations/operations.mjs.map +1 -1
- package/resources/operations/picks/actions.d.mts +111 -0
- package/resources/operations/picks/actions.d.mts.map +1 -0
- package/resources/operations/picks/actions.d.ts +111 -0
- package/resources/operations/picks/actions.d.ts.map +1 -0
- package/resources/operations/picks/actions.js +93 -0
- package/resources/operations/picks/actions.js.map +1 -0
- package/resources/operations/picks/actions.mjs +89 -0
- package/resources/operations/picks/actions.mjs.map +1 -0
- package/resources/operations/picks/index.d.mts +4 -0
- package/resources/operations/picks/index.d.mts.map +1 -0
- package/resources/operations/picks/index.d.ts +4 -0
- package/resources/operations/picks/index.d.ts.map +1 -0
- package/resources/operations/picks/index.js +11 -0
- package/resources/operations/picks/index.js.map +1 -0
- package/resources/operations/picks/index.mjs +5 -0
- package/resources/operations/picks/index.mjs.map +1 -0
- package/resources/operations/picks/lines/actions.d.mts +65 -0
- package/resources/operations/picks/lines/actions.d.mts.map +1 -0
- package/resources/operations/picks/lines/actions.d.ts +65 -0
- package/resources/operations/picks/lines/actions.d.ts.map +1 -0
- package/resources/operations/picks/lines/actions.js +59 -0
- package/resources/operations/picks/lines/actions.js.map +1 -0
- package/resources/operations/picks/lines/actions.mjs +55 -0
- package/resources/operations/picks/lines/actions.mjs.map +1 -0
- package/resources/operations/picks/lines/index.d.mts +3 -0
- package/resources/operations/picks/lines/index.d.mts.map +1 -0
- package/resources/operations/picks/lines/index.d.ts +3 -0
- package/resources/operations/picks/lines/index.d.ts.map +1 -0
- package/resources/operations/picks/lines/index.js +9 -0
- package/resources/operations/picks/lines/index.js.map +1 -0
- package/resources/operations/picks/lines/index.mjs +4 -0
- package/resources/operations/picks/lines/index.mjs.map +1 -0
- package/resources/operations/picks/lines/lines.d.mts +70 -0
- package/resources/operations/picks/lines/lines.d.mts.map +1 -0
- package/resources/operations/picks/lines/lines.d.ts +70 -0
- package/resources/operations/picks/lines/lines.d.ts.map +1 -0
- package/resources/operations/picks/lines/lines.js +48 -0
- package/resources/operations/picks/lines/lines.js.map +1 -0
- package/resources/operations/picks/lines/lines.mjs +43 -0
- package/resources/operations/picks/lines/lines.mjs.map +1 -0
- package/resources/operations/picks/lines.d.mts +2 -0
- package/resources/operations/picks/lines.d.mts.map +1 -0
- package/resources/operations/picks/lines.d.ts +2 -0
- package/resources/operations/picks/lines.d.ts.map +1 -0
- package/resources/operations/picks/lines.js +6 -0
- package/resources/operations/picks/lines.js.map +1 -0
- package/resources/operations/picks/lines.mjs +3 -0
- package/resources/operations/picks/lines.mjs.map +1 -0
- package/resources/operations/picks/picks.d.mts +383 -0
- package/resources/operations/picks/picks.d.mts.map +1 -0
- package/resources/operations/picks/picks.d.ts +383 -0
- package/resources/operations/picks/picks.d.ts.map +1 -0
- package/resources/operations/picks/picks.js +57 -0
- package/resources/operations/picks/picks.js.map +1 -0
- package/resources/operations/picks/picks.mjs +52 -0
- package/resources/operations/picks/picks.mjs.map +1 -0
- package/resources/operations/picks.d.mts +2 -0
- package/resources/operations/picks.d.mts.map +1 -0
- package/resources/operations/picks.d.ts +2 -0
- package/resources/operations/picks.d.ts.map +1 -0
- package/resources/operations/picks.js +6 -0
- package/resources/operations/picks.js.map +1 -0
- package/resources/operations/picks.mjs +3 -0
- package/resources/operations/picks.mjs.map +1 -0
- package/resources/sales/account-prices/account-prices.d.mts +13 -0
- package/resources/sales/account-prices/account-prices.d.mts.map +1 -1
- package/resources/sales/account-prices/account-prices.d.ts +13 -0
- package/resources/sales/account-prices/account-prices.d.ts.map +1 -1
- package/resources/sales/account-prices/account-prices.js.map +1 -1
- package/resources/sales/account-prices/account-prices.mjs.map +1 -1
- package/resources/sales/customers/customers.d.mts +54 -0
- package/resources/sales/customers/customers.d.mts.map +1 -1
- package/resources/sales/customers/customers.d.ts +54 -0
- package/resources/sales/customers/customers.d.ts.map +1 -1
- package/resources/sales/customers/customers.js +2 -0
- package/resources/sales/customers/customers.js.map +1 -1
- package/resources/sales/customers/customers.mjs +2 -0
- package/resources/sales/customers/customers.mjs.map +1 -1
- package/resources/sales/index.d.mts +1 -1
- package/resources/sales/index.d.mts.map +1 -1
- package/resources/sales/index.d.ts +1 -1
- package/resources/sales/index.d.ts.map +1 -1
- package/resources/sales/index.js.map +1 -1
- package/resources/sales/index.mjs.map +1 -1
- package/resources/sales/sales-orders/actions.d.mts +12 -40
- package/resources/sales/sales-orders/actions.d.mts.map +1 -1
- package/resources/sales/sales-orders/actions.d.ts +12 -40
- package/resources/sales/sales-orders/actions.d.ts.map +1 -1
- package/resources/sales/sales-orders/index.d.mts +1 -1
- package/resources/sales/sales-orders/index.d.mts.map +1 -1
- package/resources/sales/sales-orders/index.d.ts +1 -1
- package/resources/sales/sales-orders/index.d.ts.map +1 -1
- package/resources/sales/sales-orders/index.js.map +1 -1
- package/resources/sales/sales-orders/index.mjs.map +1 -1
- package/resources/sales/sales-orders/sales-orders.d.mts +105 -63
- package/resources/sales/sales-orders/sales-orders.d.mts.map +1 -1
- package/resources/sales/sales-orders/sales-orders.d.ts +105 -63
- 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/resources/sales/sales.d.mts +2 -2
- package/resources/sales/sales.d.mts.map +1 -1
- package/resources/sales/sales.d.ts +2 -2
- package/resources/sales/sales.d.ts.map +1 -1
- package/resources/sales/sales.js.map +1 -1
- package/resources/sales/sales.mjs.map +1 -1
- package/src/client.ts +1 -1
- package/src/resources/auth/api-keys/api-keys.ts +4 -4
- package/src/resources/core/audit-events.ts +16 -4
- package/src/resources/core/core.ts +8 -2
- package/src/resources/core/jobs.ts +4 -1
- package/src/resources/messaging/conversations/conversations.ts +12 -3
- package/src/resources/messaging/conversations/links.ts +8 -2
- package/src/resources/messaging/conversations/messages.ts +8 -2
- package/src/resources/messaging/notifications/notifications.ts +8 -2
- package/src/resources/operations/index.ts +19 -0
- package/src/resources/operations/inventory-change-logs/actions.ts +73 -0
- package/src/resources/operations/inventory-change-logs/index.ts +10 -0
- package/src/resources/operations/inventory-change-logs/inventory-change-logs.ts +239 -0
- package/src/resources/operations/inventory-change-logs.ts +3 -0
- package/src/resources/operations/operations.ts +47 -0
- package/src/resources/operations/picks/actions.ts +131 -0
- package/src/resources/operations/picks/index.ts +16 -0
- package/src/resources/operations/picks/lines/actions.ts +78 -0
- package/src/resources/operations/picks/lines/index.ts +4 -0
- package/src/resources/operations/picks/lines/lines.ts +100 -0
- package/src/resources/operations/picks/lines.ts +3 -0
- package/src/resources/operations/picks/picks.ts +502 -0
- package/src/resources/operations/picks.ts +3 -0
- package/src/resources/sales/account-prices/account-prices.ts +14 -0
- package/src/resources/sales/customers/customers.ts +58 -0
- package/src/resources/sales/index.ts +1 -0
- package/src/resources/sales/sales-orders/actions.ts +12 -55
- package/src/resources/sales/sales-orders/index.ts +1 -0
- package/src/resources/sales/sales-orders/sales-orders.ts +124 -79
- package/src/resources/sales/sales.ts +2 -0
- 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
|
@@ -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,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
|
+
}
|