shipbob-node-sdk 0.0.1 → 0.0.2
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/dist/index.d.ts +729 -0
- package/dist/index.js +303 -0
- package/dist/index.js.map +1 -0
- package/package.json +3 -3
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,729 @@
|
|
|
1
|
+
export type Nullable<T> = T | null;
|
|
2
|
+
export declare enum WebhookTopic {
|
|
3
|
+
OrderShipped = "order_shipped",
|
|
4
|
+
ShipmentDelivered = "shipment_delivered",
|
|
5
|
+
ShipmentException = "shipment_exception",
|
|
6
|
+
ShipmentOnHold = "shipment_onhold",
|
|
7
|
+
ShipmentCancelled = "shipment_cancelled"
|
|
8
|
+
}
|
|
9
|
+
export type Credentials = {
|
|
10
|
+
token: string;
|
|
11
|
+
channelId?: number;
|
|
12
|
+
};
|
|
13
|
+
export type DataResponse<T> = ({
|
|
14
|
+
/**
|
|
15
|
+
* HTTP status code received was in 200's.
|
|
16
|
+
*/
|
|
17
|
+
success: true;
|
|
18
|
+
data: T;
|
|
19
|
+
} | {
|
|
20
|
+
/**
|
|
21
|
+
* HTTP status code not in 200s (ie: 302 (auth redirect - check location header), 422 (validation), 524 (cloudflare))
|
|
22
|
+
*/
|
|
23
|
+
success: false;
|
|
24
|
+
/**
|
|
25
|
+
* for 422 is Record<keyof T, string[]>?
|
|
26
|
+
*/
|
|
27
|
+
data: object | string;
|
|
28
|
+
}) & {
|
|
29
|
+
statusCode: number;
|
|
30
|
+
};
|
|
31
|
+
export type ChannelsResponse = {
|
|
32
|
+
id: number;
|
|
33
|
+
name: string;
|
|
34
|
+
application_name: string;
|
|
35
|
+
scopes: string[];
|
|
36
|
+
}[];
|
|
37
|
+
export type Address = {
|
|
38
|
+
/**
|
|
39
|
+
* First line of the address
|
|
40
|
+
*/
|
|
41
|
+
address1: string;
|
|
42
|
+
/**
|
|
43
|
+
* Second line of the address
|
|
44
|
+
*/
|
|
45
|
+
address2?: Nullable<string>;
|
|
46
|
+
/**
|
|
47
|
+
* Name of the company receiving the shipment
|
|
48
|
+
*/
|
|
49
|
+
company_name?: Nullable<string>;
|
|
50
|
+
/**
|
|
51
|
+
* The city
|
|
52
|
+
*/
|
|
53
|
+
city: Required<string>;
|
|
54
|
+
/**
|
|
55
|
+
* The state or province
|
|
56
|
+
* Not required, but not all countries have state/province
|
|
57
|
+
*/
|
|
58
|
+
state: Nullable<string>;
|
|
59
|
+
/**
|
|
60
|
+
* The country (Must be ISO Alpha-2 for estimates)
|
|
61
|
+
*/
|
|
62
|
+
country: string;
|
|
63
|
+
/**
|
|
64
|
+
* The zip code or postal code
|
|
65
|
+
*/
|
|
66
|
+
zip_code: string;
|
|
67
|
+
};
|
|
68
|
+
/**
|
|
69
|
+
* Returns also everything else including onhand, etc. Stuff that makes no sense at this point.
|
|
70
|
+
*/
|
|
71
|
+
export type AddProductResponse = {
|
|
72
|
+
id: number;
|
|
73
|
+
reference_id: string;
|
|
74
|
+
};
|
|
75
|
+
export type GetProductResult = {
|
|
76
|
+
id: number;
|
|
77
|
+
reference_id: string;
|
|
78
|
+
};
|
|
79
|
+
export type OrderType = 'DTC' | 'DropShip' | 'B2B' | 'Transportation';
|
|
80
|
+
export type AnyProduct = ({
|
|
81
|
+
/**
|
|
82
|
+
* Unique reference id of the product
|
|
83
|
+
*/
|
|
84
|
+
reference_id: string;
|
|
85
|
+
/**
|
|
86
|
+
* Name of the product. Required if there is not an existing ShipBob product with a matching reference_id value.
|
|
87
|
+
*/
|
|
88
|
+
name?: Nullable<string>;
|
|
89
|
+
/**
|
|
90
|
+
* Global Trade Item Number - unique and internationally recognized identifier assigned to item by company GS1 (0-50 chars)
|
|
91
|
+
*/
|
|
92
|
+
gtin?: Nullable<string>;
|
|
93
|
+
/**
|
|
94
|
+
* Universal Product Code - Unique external identifier
|
|
95
|
+
*/
|
|
96
|
+
upc?: Nullable<string>;
|
|
97
|
+
/**
|
|
98
|
+
* Price for one item
|
|
99
|
+
*/
|
|
100
|
+
unit_price?: Nullable<number>;
|
|
101
|
+
/**
|
|
102
|
+
* Product SKU
|
|
103
|
+
*/
|
|
104
|
+
sku?: Nullable<string>;
|
|
105
|
+
} & {
|
|
106
|
+
/**
|
|
107
|
+
* Unique Id of the product. Not sure who would track **their** product ids..
|
|
108
|
+
*/
|
|
109
|
+
id: number;
|
|
110
|
+
}) | {
|
|
111
|
+
/**
|
|
112
|
+
* Numeric assignment per item. Used as a reference number for multiple purposes such as split orders, split containers, etc.
|
|
113
|
+
*/
|
|
114
|
+
external_line_id?: number;
|
|
115
|
+
/**
|
|
116
|
+
* The quantity of this product ordered
|
|
117
|
+
* (< 2147483647 LOL)
|
|
118
|
+
*/
|
|
119
|
+
quantity: number;
|
|
120
|
+
/**
|
|
121
|
+
* Defined standard for measure for an item (each, inner pack, case, pallet). Values: EA, INP, CS and PL
|
|
122
|
+
*/
|
|
123
|
+
quantity_unit_of_measure_code?: Nullable<string>;
|
|
124
|
+
required_lot?: {
|
|
125
|
+
lot_number: Nullable<string>;
|
|
126
|
+
/**
|
|
127
|
+
* string or null <date-time>
|
|
128
|
+
* Manually specified lot date
|
|
129
|
+
*/
|
|
130
|
+
lot_date: Nullable<string>;
|
|
131
|
+
};
|
|
132
|
+
};
|
|
133
|
+
export type CancelOrderResponse = {
|
|
134
|
+
order_id: number;
|
|
135
|
+
order: {
|
|
136
|
+
id: number;
|
|
137
|
+
reference_id: string;
|
|
138
|
+
order_number: string;
|
|
139
|
+
status: string;
|
|
140
|
+
};
|
|
141
|
+
/**
|
|
142
|
+
* ie: "Success"
|
|
143
|
+
*/
|
|
144
|
+
status: string;
|
|
145
|
+
canceled_shipment_results: {
|
|
146
|
+
/**
|
|
147
|
+
* ie: "Cancel". The docs are wrong. This is actually a number like 6.
|
|
148
|
+
*/
|
|
149
|
+
action: number;
|
|
150
|
+
shipment_id: number;
|
|
151
|
+
is_success: boolean;
|
|
152
|
+
/**
|
|
153
|
+
* ie: "Order cancelled"
|
|
154
|
+
*/
|
|
155
|
+
reason: string;
|
|
156
|
+
}[];
|
|
157
|
+
};
|
|
158
|
+
export type PlaceOrderResponse = {
|
|
159
|
+
id: number;
|
|
160
|
+
/**
|
|
161
|
+
* ISO date. ie: "2019-08-24T14:15:22Z"
|
|
162
|
+
*/
|
|
163
|
+
created_date: string;
|
|
164
|
+
/**
|
|
165
|
+
* ISO date. ie: "2019-08-24T14:15:22Z"
|
|
166
|
+
*/
|
|
167
|
+
purchase_date: string;
|
|
168
|
+
reference_id: string;
|
|
169
|
+
order_number: string;
|
|
170
|
+
/**
|
|
171
|
+
* probably always "Processing" - we should be able to get order status updates via webhook
|
|
172
|
+
*/
|
|
173
|
+
status: 'Processing';
|
|
174
|
+
type: OrderType;
|
|
175
|
+
channel: {
|
|
176
|
+
id: number;
|
|
177
|
+
/**
|
|
178
|
+
* ie: "ShipBobs-Shopify-Store"
|
|
179
|
+
*/
|
|
180
|
+
name: string;
|
|
181
|
+
};
|
|
182
|
+
/**
|
|
183
|
+
* ie: "Free 2-day Shipping"
|
|
184
|
+
*/
|
|
185
|
+
shipping_method: string;
|
|
186
|
+
recipient: {
|
|
187
|
+
name: string;
|
|
188
|
+
address: Address;
|
|
189
|
+
email: string;
|
|
190
|
+
phone_number: string;
|
|
191
|
+
};
|
|
192
|
+
products: {
|
|
193
|
+
id: number;
|
|
194
|
+
reference_id: string;
|
|
195
|
+
quantity: number;
|
|
196
|
+
quantity_unit_of_measure_code: string;
|
|
197
|
+
sku: string;
|
|
198
|
+
gtin: string;
|
|
199
|
+
upc: string;
|
|
200
|
+
unit_price: number;
|
|
201
|
+
external_line_id: number;
|
|
202
|
+
}[];
|
|
203
|
+
tags: string[];
|
|
204
|
+
shipments: {
|
|
205
|
+
id: number;
|
|
206
|
+
order_id: number;
|
|
207
|
+
reference_id: string;
|
|
208
|
+
recipient: {
|
|
209
|
+
name: string;
|
|
210
|
+
address: Address;
|
|
211
|
+
email: string;
|
|
212
|
+
phone_number: string;
|
|
213
|
+
};
|
|
214
|
+
}[];
|
|
215
|
+
gift_message: string;
|
|
216
|
+
shipping_terms: {
|
|
217
|
+
/**
|
|
218
|
+
* ie: "Parcel"
|
|
219
|
+
*/
|
|
220
|
+
carrier_type: CarrierShipType;
|
|
221
|
+
payment_term: PaymentShipTerm;
|
|
222
|
+
};
|
|
223
|
+
};
|
|
224
|
+
export type PaymentShipTerm = 'Collect' | 'ThirdParty' | 'Prepaid' | 'MerchantResponsible';
|
|
225
|
+
export type CarrierShipType = 'Parcel' | 'Freight';
|
|
226
|
+
export type PlaceOrderRequest = {
|
|
227
|
+
/**
|
|
228
|
+
* User friendly orderId or store order number that will be shown on the Orders Page. If not provided, referenceId will be used (<= 400 characters)
|
|
229
|
+
*/
|
|
230
|
+
order_number: Nullable<string>;
|
|
231
|
+
recipient: {
|
|
232
|
+
name: string;
|
|
233
|
+
address: Address;
|
|
234
|
+
/**
|
|
235
|
+
* Email address of the recipient
|
|
236
|
+
*/
|
|
237
|
+
email?: Nullable<string>;
|
|
238
|
+
/**
|
|
239
|
+
* Phone number of the recipient (<= 50 characters)
|
|
240
|
+
*/
|
|
241
|
+
phone_number?: Nullable<string>;
|
|
242
|
+
};
|
|
243
|
+
/**
|
|
244
|
+
* Products included in the order. Products identified by reference_id must also include the product name if there is no matching ShipBob product.
|
|
245
|
+
*/
|
|
246
|
+
products: AnyProduct[];
|
|
247
|
+
/**
|
|
248
|
+
* Unique and immutable order identifier from your upstream system.
|
|
249
|
+
*
|
|
250
|
+
* Discussions with Simon. This is a forever unique identifier. ie: cannot be an IC order number like 18888888 - we could not reship.
|
|
251
|
+
*
|
|
252
|
+
* NOTE: reusing generates 422 error: "Cannot insert order with existing ReferenceId"
|
|
253
|
+
*/
|
|
254
|
+
reference_id: string;
|
|
255
|
+
/**
|
|
256
|
+
* Contains properties that needs to be used for fulfilling B2B/Dropship orders.
|
|
257
|
+
*/
|
|
258
|
+
retailer_program_data?: {
|
|
259
|
+
/**
|
|
260
|
+
* First initial documentation sent from buyer to seller with item(s) and quantities.
|
|
261
|
+
*/
|
|
262
|
+
purchase_order_number: string;
|
|
263
|
+
/**
|
|
264
|
+
* Identifies retailer-merchant combination
|
|
265
|
+
*/
|
|
266
|
+
retailer_program_type: string;
|
|
267
|
+
/**
|
|
268
|
+
* Store Number
|
|
269
|
+
*/
|
|
270
|
+
mark_for_store?: Nullable<string>;
|
|
271
|
+
/**
|
|
272
|
+
* Identifies a merchant's store department
|
|
273
|
+
*/
|
|
274
|
+
department?: Nullable<string>;
|
|
275
|
+
/**
|
|
276
|
+
* Expected delivery date
|
|
277
|
+
*/
|
|
278
|
+
delivery_date?: Nullable<string>;
|
|
279
|
+
/**
|
|
280
|
+
* Customer Ticket Number
|
|
281
|
+
*/
|
|
282
|
+
customer_ticket_number?: Nullable<string>;
|
|
283
|
+
/**
|
|
284
|
+
* The date the retailer has requested the order to ship by.
|
|
285
|
+
*/
|
|
286
|
+
shipByDate?: Nullable<string>;
|
|
287
|
+
/**
|
|
288
|
+
* The date the retailer does not want the order shipped by.
|
|
289
|
+
*/
|
|
290
|
+
doNotShipBeforeDate?: Nullable<string>;
|
|
291
|
+
};
|
|
292
|
+
/**
|
|
293
|
+
* Client-defined shipping method matching what the user has listed as the shipping method on the Ship Option Mapping setup page in the ShipBob Merchant Portal.
|
|
294
|
+
* If they don’t match, we will create a new one and default it to Standard
|
|
295
|
+
* (non-empty)
|
|
296
|
+
* ie: "Standard"
|
|
297
|
+
*/
|
|
298
|
+
shipping_method: string;
|
|
299
|
+
/**
|
|
300
|
+
* Contains shipping properties that need to be used for fulfilling an order.
|
|
301
|
+
*/
|
|
302
|
+
shipping_terms?: {
|
|
303
|
+
/**
|
|
304
|
+
* CarrierShipType: Enum: "Parcel" "Freight"
|
|
305
|
+
*/
|
|
306
|
+
carrier_type: CarrierShipType;
|
|
307
|
+
/**
|
|
308
|
+
* PaymentShipTerm
|
|
309
|
+
*/
|
|
310
|
+
payment_term: PaymentShipTerm;
|
|
311
|
+
};
|
|
312
|
+
/**
|
|
313
|
+
* Enum: "DTC" "DropShip" "B2B" "Transportation"
|
|
314
|
+
*/
|
|
315
|
+
type: OrderType;
|
|
316
|
+
};
|
|
317
|
+
export type Webhook = {
|
|
318
|
+
id: number;
|
|
319
|
+
/**
|
|
320
|
+
* ISO date format: "2025-02-14T22:21:33.4911731"
|
|
321
|
+
*/
|
|
322
|
+
created_at: string;
|
|
323
|
+
/**
|
|
324
|
+
* The subscription topic for the webhook
|
|
325
|
+
*/
|
|
326
|
+
topic: WebhookTopic;
|
|
327
|
+
/**
|
|
328
|
+
* This is what we provided to them.
|
|
329
|
+
*/
|
|
330
|
+
subscription_url: string;
|
|
331
|
+
};
|
|
332
|
+
export type FulfillmentCenter = {
|
|
333
|
+
id: number;
|
|
334
|
+
/**
|
|
335
|
+
* ie: "Cicero (IL)"
|
|
336
|
+
*/
|
|
337
|
+
name: string;
|
|
338
|
+
/**
|
|
339
|
+
* ie: "Central Standard Time"
|
|
340
|
+
*/
|
|
341
|
+
timezone: string;
|
|
342
|
+
address1: string;
|
|
343
|
+
address2: string;
|
|
344
|
+
city: string;
|
|
345
|
+
/**
|
|
346
|
+
* ie: "IL"
|
|
347
|
+
*/
|
|
348
|
+
state: string;
|
|
349
|
+
/**
|
|
350
|
+
* ie: "USA"
|
|
351
|
+
*/
|
|
352
|
+
country: string;
|
|
353
|
+
zip_code: string;
|
|
354
|
+
phone_number: string;
|
|
355
|
+
email: string;
|
|
356
|
+
};
|
|
357
|
+
export type PackageType = 'Package' | 'Pallet' | 'FloorLoadedContainer';
|
|
358
|
+
export type BoxPackagingType = 'EverythingInOneBox' | 'OneSkuPerBox' | 'MultipleSkuPerBox';
|
|
359
|
+
/**
|
|
360
|
+
* The receiving order to create
|
|
361
|
+
*/
|
|
362
|
+
export type WarehouseReceivingOrderRequest = {
|
|
363
|
+
/**
|
|
364
|
+
* Model containing information that assigns a receiving order to a fulfillment center.
|
|
365
|
+
* If the fulfillment center provided is in a receiving hub region, then the response will be the receiving hub location.
|
|
366
|
+
*/
|
|
367
|
+
fulfillment_center: {
|
|
368
|
+
/**
|
|
369
|
+
* ID of the fulfillment center to assign this receiving order to
|
|
370
|
+
*/
|
|
371
|
+
id: number;
|
|
372
|
+
};
|
|
373
|
+
package_type: PackageType;
|
|
374
|
+
box_packaging_type: BoxPackagingType;
|
|
375
|
+
/**
|
|
376
|
+
* Box shipments to be added to this receiving order
|
|
377
|
+
*/
|
|
378
|
+
boxes: {
|
|
379
|
+
/**
|
|
380
|
+
* Tracking number for the box shipment.
|
|
381
|
+
*
|
|
382
|
+
* The API docs say "string or null", but if you pass null will get a 400: Boxes[...] 'The TrackingNumber field is required.'
|
|
383
|
+
*/
|
|
384
|
+
tracking_number: string;
|
|
385
|
+
/**
|
|
386
|
+
* Items contained in this box
|
|
387
|
+
*/
|
|
388
|
+
box_items: {
|
|
389
|
+
/**
|
|
390
|
+
* Quantity of the items in the box
|
|
391
|
+
*
|
|
392
|
+
* NOTE: integer <int32> [ 1 .. 2147483647 ]. LOL. 2 billion
|
|
393
|
+
*/
|
|
394
|
+
quantity: number;
|
|
395
|
+
/**
|
|
396
|
+
* Unique inventory id of the items in the box
|
|
397
|
+
*/
|
|
398
|
+
inventory_id: number;
|
|
399
|
+
/**
|
|
400
|
+
* Lot number of the items in the box
|
|
401
|
+
*/
|
|
402
|
+
lot_number?: Nullable<string>;
|
|
403
|
+
/**
|
|
404
|
+
* Lot expiration date for the items in the box
|
|
405
|
+
*/
|
|
406
|
+
lot_date?: Nullable<string>;
|
|
407
|
+
}[];
|
|
408
|
+
}[];
|
|
409
|
+
/**
|
|
410
|
+
* Expected arrival date of all the box shipments in this receiving order
|
|
411
|
+
* ie: ISO date "2019-08-24T14:15:22Z"
|
|
412
|
+
*/
|
|
413
|
+
expected_arrival_date: string;
|
|
414
|
+
/**
|
|
415
|
+
* Purchase order number for this receiving order,
|
|
416
|
+
*
|
|
417
|
+
* NOTE: Supporting idempotency this must be unique across WROs
|
|
418
|
+
* Otherwise 422: "Request could not be completed, PO reference already exists and must be a unique value"
|
|
419
|
+
*/
|
|
420
|
+
purchase_order_number?: Nullable<string>;
|
|
421
|
+
};
|
|
422
|
+
export type ReceivingStatus = 'Awaiting' | 'Processing' | 'Completed' | 'Cancelled' | 'Incomplete' | 'Arrived' | 'PartiallyArrived' | 'PartiallyArrivedAtHub' | 'ArrivedAtHub' | 'ProcessingAtHub' | 'InternalTransfer';
|
|
423
|
+
export type WarehouseReceivingOrderResponse = {
|
|
424
|
+
id: number;
|
|
425
|
+
/**
|
|
426
|
+
* Not sure what these could be. "Awaiting" is a staging status.
|
|
427
|
+
*/
|
|
428
|
+
status: ReceivingStatus;
|
|
429
|
+
/**
|
|
430
|
+
* What was sent in the request
|
|
431
|
+
*/
|
|
432
|
+
package_type: PackageType;
|
|
433
|
+
/**
|
|
434
|
+
* What was sent in the request
|
|
435
|
+
*/
|
|
436
|
+
box_packaging_type: BoxPackagingType;
|
|
437
|
+
/**
|
|
438
|
+
* What was sent in the request (ISO date)
|
|
439
|
+
*/
|
|
440
|
+
expected_arrival_date: string;
|
|
441
|
+
/**
|
|
442
|
+
* ISO date: "2025-02-18T19:25:13.034265+00:00"
|
|
443
|
+
*/
|
|
444
|
+
insert_date: string;
|
|
445
|
+
/**
|
|
446
|
+
* ISO date
|
|
447
|
+
*/
|
|
448
|
+
last_updated_date: string;
|
|
449
|
+
/**
|
|
450
|
+
* ie: "/2.0/receiving/442945/labels"
|
|
451
|
+
*/
|
|
452
|
+
box_labels_uri: string;
|
|
453
|
+
fulfillment_center: FulfillmentCenter;
|
|
454
|
+
purchase_order_number: Nullable<string>;
|
|
455
|
+
inventory_quantities: {
|
|
456
|
+
inventory_id: number;
|
|
457
|
+
sku: string;
|
|
458
|
+
expected_quantity: number;
|
|
459
|
+
received_quantity: number;
|
|
460
|
+
stowed_quantity: number;
|
|
461
|
+
}[];
|
|
462
|
+
/**
|
|
463
|
+
* The timestamp in UTC when a 3rd party integrator has set in ShipBob system
|
|
464
|
+
*
|
|
465
|
+
* We set this in their receiving-extended API endpoints. Use case is for acknowledging completed orders.
|
|
466
|
+
* Their API has example: "2019-08-24T14:15:22Z"
|
|
467
|
+
*/
|
|
468
|
+
external_sync_timestamp: Nullable<string>;
|
|
469
|
+
};
|
|
470
|
+
/**
|
|
471
|
+
* The simulation will work on our SandBox Environment.
|
|
472
|
+
*/
|
|
473
|
+
export type Simulation = {
|
|
474
|
+
/**
|
|
475
|
+
* Identifies what action to perform on shipment.
|
|
476
|
+
*/
|
|
477
|
+
action: 'ShipOrder' | 'DeliverOrder';
|
|
478
|
+
/**
|
|
479
|
+
* Delay time for action in minutes to be triggered after.
|
|
480
|
+
*
|
|
481
|
+
* NOTE: anything over 2880 will be clamped
|
|
482
|
+
*/
|
|
483
|
+
delay?: Nullable<number>;
|
|
484
|
+
/**
|
|
485
|
+
* Next simulation action to be performed after it.
|
|
486
|
+
*/
|
|
487
|
+
next?: Nullable<SimulateShipmentRequest>;
|
|
488
|
+
};
|
|
489
|
+
export type SimulateShipmentRequest = {
|
|
490
|
+
/**
|
|
491
|
+
* Shipment Id for simulation.
|
|
492
|
+
*/
|
|
493
|
+
shipment_id: number;
|
|
494
|
+
/**
|
|
495
|
+
* Simulation actions object.
|
|
496
|
+
*/
|
|
497
|
+
simulation: Simulation;
|
|
498
|
+
};
|
|
499
|
+
export type SimulateShipmentResponse = {
|
|
500
|
+
/**
|
|
501
|
+
* Simulation id for register simulation request.
|
|
502
|
+
* UUID ie: 439a9dec-9bff-4339-9564-89975d3a8f5c
|
|
503
|
+
*/
|
|
504
|
+
simulation_id: string;
|
|
505
|
+
/**
|
|
506
|
+
* ie: "Simulation registered successfully"
|
|
507
|
+
*/
|
|
508
|
+
message: string;
|
|
509
|
+
};
|
|
510
|
+
export type SimulationDetails = {
|
|
511
|
+
/**
|
|
512
|
+
* Identifies the action that was performed.
|
|
513
|
+
*/
|
|
514
|
+
action: 'ShipOrder' | 'DeliverOrder';
|
|
515
|
+
/**
|
|
516
|
+
* Status of the simulation action.
|
|
517
|
+
*/
|
|
518
|
+
status: 'Success' | 'Failed' | 'Pending' | 'Skipped';
|
|
519
|
+
/**
|
|
520
|
+
* Additional message for the action.
|
|
521
|
+
*
|
|
522
|
+
* ie:
|
|
523
|
+
* - "This simulated action has been completed successfully."
|
|
524
|
+
* - "This simulation action is not executed yet."
|
|
525
|
+
*/
|
|
526
|
+
message: string;
|
|
527
|
+
/**
|
|
528
|
+
* Scheduled time if the action had a delay.
|
|
529
|
+
* ie: ISO date '2025-02-19T00:09:53.77' or NULL
|
|
530
|
+
*/
|
|
531
|
+
schedule_time: Nullable<string>;
|
|
532
|
+
/**
|
|
533
|
+
* Nested object with details of subsequent simulation actions. This value would be null if there is no subsequent action.
|
|
534
|
+
*/
|
|
535
|
+
next: Nullable<SimulationDetails>;
|
|
536
|
+
};
|
|
537
|
+
export type SimulationResponse = {
|
|
538
|
+
/**
|
|
539
|
+
* Simulation id for register simulation request.
|
|
540
|
+
*/
|
|
541
|
+
simulation_id: string;
|
|
542
|
+
/**
|
|
543
|
+
* ID of the entity for which the simulation was registered.
|
|
544
|
+
*/
|
|
545
|
+
entity_id: string;
|
|
546
|
+
/**
|
|
547
|
+
* Type of entity for which the simulation was registered.
|
|
548
|
+
*
|
|
549
|
+
* ie: "Order"
|
|
550
|
+
*/
|
|
551
|
+
entity_type: string;
|
|
552
|
+
/**
|
|
553
|
+
* Object with details of simulation actions
|
|
554
|
+
* type: SimulationDetails (not described in docs)
|
|
555
|
+
*/
|
|
556
|
+
simulation: SimulationDetails;
|
|
557
|
+
};
|
|
558
|
+
/**
|
|
559
|
+
* For each WRO that was supplied, if ExternalSync was updated
|
|
560
|
+
*/
|
|
561
|
+
export type SetExternalSyncResponse = {
|
|
562
|
+
results: {
|
|
563
|
+
id: number;
|
|
564
|
+
action: 'ExternalSync';
|
|
565
|
+
is_success: boolean;
|
|
566
|
+
/**
|
|
567
|
+
* Probably a reason if it didn't succeed. Empty when it does succeed.
|
|
568
|
+
* ie: ""
|
|
569
|
+
*/
|
|
570
|
+
reason: string;
|
|
571
|
+
}[];
|
|
572
|
+
};
|
|
573
|
+
export type BoxStatus = 'Awaiting' | 'Arrived' | 'Completed' | 'Counting' | 'Stowing' | 'Cancelled' | 'InternalTransfer';
|
|
574
|
+
/**
|
|
575
|
+
* Get Warehouse Receiving Order Boxes response
|
|
576
|
+
*/
|
|
577
|
+
export type WarehouseReceivingOrderBoxesResponse = {
|
|
578
|
+
box_id: number;
|
|
579
|
+
/**
|
|
580
|
+
* The number of the box in the receiving order
|
|
581
|
+
*/
|
|
582
|
+
box_number: number;
|
|
583
|
+
box_status: BoxStatus;
|
|
584
|
+
/**
|
|
585
|
+
* Date the box arrived
|
|
586
|
+
*/
|
|
587
|
+
arrived_date: Nullable<string>;
|
|
588
|
+
/**
|
|
589
|
+
* Date the box was received
|
|
590
|
+
*/
|
|
591
|
+
received_date: Nullable<string>;
|
|
592
|
+
/**
|
|
593
|
+
* Date counting of the box's inventory items started
|
|
594
|
+
*/
|
|
595
|
+
counting_started_date: Nullable<string>;
|
|
596
|
+
/**
|
|
597
|
+
* Tracking number of the box shipment
|
|
598
|
+
*/
|
|
599
|
+
tracking_number: Nullable<string>;
|
|
600
|
+
/**
|
|
601
|
+
* type: BoxItemViewModel
|
|
602
|
+
*/
|
|
603
|
+
box_items: {
|
|
604
|
+
/**
|
|
605
|
+
* Quantity of the item included
|
|
606
|
+
*/
|
|
607
|
+
quantity: number;
|
|
608
|
+
/**
|
|
609
|
+
* Quantity of the item that was received after processing the receiving order
|
|
610
|
+
*/
|
|
611
|
+
received_quantity: number;
|
|
612
|
+
/**
|
|
613
|
+
* Quantity of the item that has been stowed
|
|
614
|
+
*/
|
|
615
|
+
stowed_quantity: number;
|
|
616
|
+
/**
|
|
617
|
+
* Unique identifier of the inventory item
|
|
618
|
+
*/
|
|
619
|
+
inventory_id: number;
|
|
620
|
+
/**
|
|
621
|
+
* Lot number the item belongs to
|
|
622
|
+
*/
|
|
623
|
+
lot_number: Nullable<string>;
|
|
624
|
+
/**
|
|
625
|
+
* Expiration date of the item's lot
|
|
626
|
+
*/
|
|
627
|
+
lot_date: Nullable<string>;
|
|
628
|
+
}[];
|
|
629
|
+
}[];
|
|
630
|
+
/**
|
|
631
|
+
* Create API with PAT (personal access token) - defaults to sandbox endpoints and "SMA" channel.
|
|
632
|
+
*
|
|
633
|
+
* NOTE: We used token based auth, so did not need to implement the other auth mechanism(s).
|
|
634
|
+
*
|
|
635
|
+
* TODO: Consider adding global parameters like timeout (or per method). Some endpoints are slower than others.
|
|
636
|
+
*
|
|
637
|
+
* @param personalAccessToken passing *undefined* or empty string has a guar clause that will throw
|
|
638
|
+
* @param apiBaseUrl
|
|
639
|
+
* @param channelApplicationName
|
|
640
|
+
* @returns
|
|
641
|
+
*/
|
|
642
|
+
export declare const createShipBobApi: (personalAccessToken: string | undefined, apiBaseUrl?: string, channelApplicationName?: string) => Promise<{
|
|
643
|
+
getProductById: (productId: number) => Promise<DataResponse<GetProductResult>>;
|
|
644
|
+
getProducts: (query: Partial<{
|
|
645
|
+
ReferenceIds: string;
|
|
646
|
+
Page: number;
|
|
647
|
+
Limit: number;
|
|
648
|
+
IDs: string;
|
|
649
|
+
Search: string;
|
|
650
|
+
ActiveStatus: "Any" | "Active" | "Inactive";
|
|
651
|
+
BundleStatus: "Any" | "Bundle" | "NotBundle";
|
|
652
|
+
}>) => Promise<DataResponse<GetProductResult[]>>;
|
|
653
|
+
addProduct: (product: {
|
|
654
|
+
reference_id: string;
|
|
655
|
+
sku: string;
|
|
656
|
+
name: string;
|
|
657
|
+
barcode: string;
|
|
658
|
+
}) => Promise<DataResponse<AddProductResponse>>;
|
|
659
|
+
placeOrder: (order: PlaceOrderRequest) => Promise<DataResponse<PlaceOrderResponse>>;
|
|
660
|
+
/**
|
|
661
|
+
* Cancel single Order by Order Id
|
|
662
|
+
*
|
|
663
|
+
* @param orderId The order Id to cancel
|
|
664
|
+
*/
|
|
665
|
+
cancelSingleOrderByOrderId: (orderId: number) => Promise<DataResponse<CancelOrderResponse>>;
|
|
666
|
+
getWebhooks: () => Promise<DataResponse<Webhook[][]>>;
|
|
667
|
+
createWebhookSubscription: (webhook: Omit<Webhook, "id" | "created_at">) => Promise<DataResponse<Webhook>>;
|
|
668
|
+
getFulfillmentCenters: () => Promise<DataResponse<FulfillmentCenter[]>>;
|
|
669
|
+
createWarehouseReceivingOrder: (request: WarehouseReceivingOrderRequest) => Promise<DataResponse<WarehouseReceivingOrderResponse>>;
|
|
670
|
+
getWarehouseReceivingOrder: (orderId: number) => Promise<DataResponse<WarehouseReceivingOrderResponse>>;
|
|
671
|
+
getWarehouseReceivingOrderBoxes: (orderId: number) => Promise<DataResponse<WarehouseReceivingOrderBoxesResponse>>;
|
|
672
|
+
getReceivingExtended: (query: Partial<{
|
|
673
|
+
Statuses: string;
|
|
674
|
+
ExternalSync: boolean;
|
|
675
|
+
}>) => Promise<DataResponse<GetProductResult[]>>;
|
|
676
|
+
/**
|
|
677
|
+
* This must be for setting/clearing if it has been synced externally.
|
|
678
|
+
*
|
|
679
|
+
* Use case is interop via searching for "completed" that are not yet synced.
|
|
680
|
+
*
|
|
681
|
+
* NOTE: this is tagged experimental, so might change or be dropped
|
|
682
|
+
*/
|
|
683
|
+
experimentalReceivingSetExternalSync: (ids: number[], isExternalSync: boolean) => Promise<DataResponse<SetExternalSyncResponse>>;
|
|
684
|
+
listInventory: (query: Partial<{
|
|
685
|
+
/**
|
|
686
|
+
* Page of inventory items to get
|
|
687
|
+
*/
|
|
688
|
+
Page: number;
|
|
689
|
+
/**
|
|
690
|
+
* Amount of inventory items per page to request
|
|
691
|
+
*/
|
|
692
|
+
Limit: number;
|
|
693
|
+
IsActive: boolean;
|
|
694
|
+
IsDigital: boolean;
|
|
695
|
+
IDs: number[];
|
|
696
|
+
/**
|
|
697
|
+
* Sort will default to ascending order for each field. To sort in descending order please pass a "-" in front of the field name. For example, Sort=-onHand,name will sort by onHand descending
|
|
698
|
+
*
|
|
699
|
+
* NOTE: if you sort a non-valid field will be a 422. ie: on_hand is not an available sort property
|
|
700
|
+
*
|
|
701
|
+
* NOTE: their API is a mix of pascalCase and snake_case.
|
|
702
|
+
*/
|
|
703
|
+
Sort: string;
|
|
704
|
+
/**
|
|
705
|
+
* Search is available for 2 fields, Inventory ID and Name -
|
|
706
|
+
*
|
|
707
|
+
* Expected behavior for search by Inventory ID is exact match
|
|
708
|
+
* Expected behavior for search by Inventory Name is partial match, i.e. does not have to be start of word, but must be consecutive characters. This is not case sensitive.
|
|
709
|
+
*/
|
|
710
|
+
Search: string;
|
|
711
|
+
/**
|
|
712
|
+
* LocationType is valid for hub, spoke, or lts. LocationType will default to all locations.
|
|
713
|
+
*/
|
|
714
|
+
LocationType: string;
|
|
715
|
+
}>) => Promise<DataResponse<GetProductResult[]>>;
|
|
716
|
+
/**
|
|
717
|
+
* Only for sandbox: https://developer.shipbob.com/sandbox-simulations/
|
|
718
|
+
*
|
|
719
|
+
* NOTE: generates a 200 instead of a 201 like everywhere else
|
|
720
|
+
*/
|
|
721
|
+
simulateShipment: (request: SimulateShipmentRequest) => Promise<DataResponse<SimulateShipmentResponse>>;
|
|
722
|
+
/**
|
|
723
|
+
*
|
|
724
|
+
* Only for sandbox: https://developer.shipbob.com/sandbox-simulations/
|
|
725
|
+
*
|
|
726
|
+
* @param simulationId UUID from "/2.0/simulate/shipment" call
|
|
727
|
+
*/
|
|
728
|
+
getSimulationStatus: (simulationId: string) => Promise<DataResponse<SimulationResponse>>;
|
|
729
|
+
}>;
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,303 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/consistent-type-definitions */
|
|
2
|
+
import https from 'https';
|
|
3
|
+
import url from 'url';
|
|
4
|
+
export var WebhookTopic;
|
|
5
|
+
(function (WebhookTopic) {
|
|
6
|
+
WebhookTopic["OrderShipped"] = "order_shipped";
|
|
7
|
+
WebhookTopic["ShipmentDelivered"] = "shipment_delivered";
|
|
8
|
+
WebhookTopic["ShipmentException"] = "shipment_exception";
|
|
9
|
+
WebhookTopic["ShipmentOnHold"] = "shipment_onhold";
|
|
10
|
+
WebhookTopic["ShipmentCancelled"] = "shipment_cancelled";
|
|
11
|
+
})(WebhookTopic || (WebhookTopic = {}));
|
|
12
|
+
// ShipBob is potentially extending their 2.0 release 2025-04
|
|
13
|
+
const PATH_1_0_CHANNEL = '/1.0/channel';
|
|
14
|
+
const PATH_1_0_PRODUCT = '/1.0/product';
|
|
15
|
+
const PATH_1_0_ORDER = '/1.0/order';
|
|
16
|
+
/**
|
|
17
|
+
* Warehouse Receiving Order
|
|
18
|
+
*/
|
|
19
|
+
const PATH_2_0_RECEIVING = '/2.0/receiving';
|
|
20
|
+
/**
|
|
21
|
+
* Note part of API docs
|
|
22
|
+
*/
|
|
23
|
+
const PATH_2_0_RECEIVING_EXTENDED = '/2.0/receiving-extended';
|
|
24
|
+
/**
|
|
25
|
+
* Warehouse Receiving Order
|
|
26
|
+
*/
|
|
27
|
+
const PATH_EXPERIMENTAL_RECEIVING = '/experimental/receiving';
|
|
28
|
+
const PATH_1_0_INVENTORY = '/1.0/inventory';
|
|
29
|
+
const PATH_1_0_FULFILLMENT_CENTER = '/1.0/fulfillmentCenter';
|
|
30
|
+
const PATH_1_0_WEBHOOK = '/1.0/webhook';
|
|
31
|
+
const PATH_2_0_SIMULATE = '/2.0/simulate';
|
|
32
|
+
/**
|
|
33
|
+
* Works for GET and POST/PATCH responses. Some types area JSON.
|
|
34
|
+
*/
|
|
35
|
+
function resolvePromise(response, messageBody, resolve, reject) {
|
|
36
|
+
if (response.statusCode !== undefined && (response.statusCode < 200 || response.statusCode > 299)) {
|
|
37
|
+
/**
|
|
38
|
+
* Maybe we should be looking at the header Content-Type for parsing
|
|
39
|
+
*/
|
|
40
|
+
switch (response.statusCode) {
|
|
41
|
+
case 400:
|
|
42
|
+
case 422:
|
|
43
|
+
resolve({
|
|
44
|
+
success: false,
|
|
45
|
+
statusCode: response.statusCode,
|
|
46
|
+
data: JSON.parse(messageBody),
|
|
47
|
+
});
|
|
48
|
+
break;
|
|
49
|
+
default:
|
|
50
|
+
// this could be a 524 from CloudFlare, for example.
|
|
51
|
+
resolve({
|
|
52
|
+
success: false,
|
|
53
|
+
statusCode: response.statusCode,
|
|
54
|
+
data: messageBody,
|
|
55
|
+
});
|
|
56
|
+
break;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
try {
|
|
61
|
+
resolve({
|
|
62
|
+
success: true,
|
|
63
|
+
statusCode: response.statusCode,
|
|
64
|
+
data: JSON.parse(messageBody),
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
catch (e) {
|
|
68
|
+
console.error('unable to parse JSON');
|
|
69
|
+
reject(e);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Create API with PAT (personal access token) - defaults to sandbox endpoints and "SMA" channel.
|
|
75
|
+
*
|
|
76
|
+
* NOTE: We used token based auth, so did not need to implement the other auth mechanism(s).
|
|
77
|
+
*
|
|
78
|
+
* TODO: Consider adding global parameters like timeout (or per method). Some endpoints are slower than others.
|
|
79
|
+
*
|
|
80
|
+
* @param personalAccessToken passing *undefined* or empty string has a guar clause that will throw
|
|
81
|
+
* @param apiBaseUrl
|
|
82
|
+
* @param channelApplicationName
|
|
83
|
+
* @returns
|
|
84
|
+
*/
|
|
85
|
+
export const createShipBobApi = async (personalAccessToken, apiBaseUrl = 'sandbox-api.shipbob.com', channelApplicationName = 'SMA' /*, authBaseUrl = 'authstage.shipbob.com'*/) => {
|
|
86
|
+
if (personalAccessToken === undefined || personalAccessToken === '') {
|
|
87
|
+
throw new Error('Cannot create a ShipBob API without a PAT');
|
|
88
|
+
}
|
|
89
|
+
const credentials = {
|
|
90
|
+
token: personalAccessToken,
|
|
91
|
+
};
|
|
92
|
+
/**
|
|
93
|
+
* Will GET using our PAT and SAM channel
|
|
94
|
+
*/
|
|
95
|
+
const httpGet = async (credentials, path, query, timeoutMilliseconds = 5000, port) => {
|
|
96
|
+
const requestUrl = url.parse(url.format({
|
|
97
|
+
protocol: 'https',
|
|
98
|
+
hostname: apiBaseUrl,
|
|
99
|
+
pathname: path,
|
|
100
|
+
query,
|
|
101
|
+
}));
|
|
102
|
+
console.log(` > GET: ${requestUrl.hostname}${requestUrl.path}`);
|
|
103
|
+
const options = {
|
|
104
|
+
hostname: requestUrl.hostname,
|
|
105
|
+
port: port ?? 443,
|
|
106
|
+
path: requestUrl.path,
|
|
107
|
+
method: 'GET',
|
|
108
|
+
timeout: timeoutMilliseconds,
|
|
109
|
+
headers: {
|
|
110
|
+
Authorization: `Bearer ${credentials.token}`,
|
|
111
|
+
'Content-Type': 'application/json',
|
|
112
|
+
Accept: 'application/json',
|
|
113
|
+
'User-Agent': 'KITS SDK interface',
|
|
114
|
+
},
|
|
115
|
+
};
|
|
116
|
+
return new Promise((resolve, reject) => {
|
|
117
|
+
const req = https.request(options, (response) => {
|
|
118
|
+
const body = [];
|
|
119
|
+
response.on('data', (chunk) => {
|
|
120
|
+
body.push(chunk);
|
|
121
|
+
});
|
|
122
|
+
response.on('end', () => {
|
|
123
|
+
const messageBody = body.join('');
|
|
124
|
+
resolvePromise(response, messageBody, resolve, reject);
|
|
125
|
+
});
|
|
126
|
+
});
|
|
127
|
+
req.on('error', (error) => {
|
|
128
|
+
reject(error);
|
|
129
|
+
});
|
|
130
|
+
req.end();
|
|
131
|
+
});
|
|
132
|
+
};
|
|
133
|
+
/**
|
|
134
|
+
* Will post to Shipbob a request as JSON. Can be used for any type of request
|
|
135
|
+
*/
|
|
136
|
+
const httpData = async (credentials, data, path, timeoutMilliseconds = 5000, port) => {
|
|
137
|
+
if (credentials.channelId === undefined) {
|
|
138
|
+
throw new Error('Channel ID missing');
|
|
139
|
+
}
|
|
140
|
+
// NOTE: we're not sending content-length. Their API is OK with that.
|
|
141
|
+
const options = {
|
|
142
|
+
hostname: apiBaseUrl,
|
|
143
|
+
port: port ?? 443,
|
|
144
|
+
path,
|
|
145
|
+
method: 'POST',
|
|
146
|
+
timeout: timeoutMilliseconds,
|
|
147
|
+
headers: {
|
|
148
|
+
Authorization: `Bearer ${credentials.token}`,
|
|
149
|
+
'Content-Type': 'application/json',
|
|
150
|
+
Accept: 'application/json',
|
|
151
|
+
'User-Agent': 'KITS SDK interface',
|
|
152
|
+
shipbob_channel_id: credentials.channelId,
|
|
153
|
+
},
|
|
154
|
+
};
|
|
155
|
+
return new Promise((resolve, reject) => {
|
|
156
|
+
const req = https.request(options, (response) => {
|
|
157
|
+
const body = [];
|
|
158
|
+
response.on('data', (chunk) => {
|
|
159
|
+
body.push(chunk);
|
|
160
|
+
});
|
|
161
|
+
response.on('end', () => {
|
|
162
|
+
const messageBody = body.join('');
|
|
163
|
+
resolvePromise(response, messageBody, resolve, reject);
|
|
164
|
+
});
|
|
165
|
+
});
|
|
166
|
+
req.on('error', (error) => {
|
|
167
|
+
reject(error);
|
|
168
|
+
});
|
|
169
|
+
if (data) {
|
|
170
|
+
const postBody = JSON.stringify(data);
|
|
171
|
+
req.write(postBody);
|
|
172
|
+
}
|
|
173
|
+
req.end();
|
|
174
|
+
});
|
|
175
|
+
};
|
|
176
|
+
const channelsResponse = await httpGet(credentials, PATH_1_0_CHANNEL);
|
|
177
|
+
if (!channelsResponse.success) {
|
|
178
|
+
throw new Error(`${channelsResponse.statusCode} '${channelsResponse.data}'`);
|
|
179
|
+
}
|
|
180
|
+
const smaChannel = channelsResponse.data.find((c) => c.application_name === channelApplicationName);
|
|
181
|
+
if (smaChannel === undefined) {
|
|
182
|
+
throw new Error(`Did not find SMA channel {${channelsResponse.data.map((c) => c.application_name).join(',')}}`);
|
|
183
|
+
}
|
|
184
|
+
credentials.channelId = smaChannel.id;
|
|
185
|
+
return {
|
|
186
|
+
getProductById: async (productId) => {
|
|
187
|
+
// productId would need to be URL encoded - not for us, it's just numeric digits
|
|
188
|
+
// NOTE: /1.0/product/888290263059
|
|
189
|
+
// ERROR: {"productId":["The value '888290263059' is not valid."]}
|
|
190
|
+
const getProductResult = await httpGet(credentials, `${PATH_1_0_PRODUCT}/${productId}`);
|
|
191
|
+
console.log('get product:', getProductResult.success, getProductResult.success === false ? getProductResult.statusCode : 'found');
|
|
192
|
+
return getProductResult;
|
|
193
|
+
},
|
|
194
|
+
getProducts: async (query) => {
|
|
195
|
+
const getProductResult = await httpGet(credentials, PATH_1_0_PRODUCT, query);
|
|
196
|
+
console.log('get product:', getProductResult.success, getProductResult.success === false ? getProductResult.statusCode : 'found');
|
|
197
|
+
return getProductResult;
|
|
198
|
+
},
|
|
199
|
+
addProduct: async (product) => {
|
|
200
|
+
const addProductResponse = await httpData(credentials, product, PATH_1_0_PRODUCT);
|
|
201
|
+
console.log(' > Added product:', addProductResponse.success ? addProductResponse.data.reference_id : 'failed');
|
|
202
|
+
return addProductResponse;
|
|
203
|
+
},
|
|
204
|
+
placeOrder: async (order) => {
|
|
205
|
+
const placeOrderResponse = await httpData(credentials, order, PATH_1_0_ORDER);
|
|
206
|
+
console.log('place order:', placeOrderResponse);
|
|
207
|
+
return placeOrderResponse;
|
|
208
|
+
},
|
|
209
|
+
/**
|
|
210
|
+
* Cancel single Order by Order Id
|
|
211
|
+
*
|
|
212
|
+
* @param orderId The order Id to cancel
|
|
213
|
+
*/
|
|
214
|
+
cancelSingleOrderByOrderId: async (orderId) => {
|
|
215
|
+
const placeOrderResponse = await httpData(credentials, undefined, `${PATH_1_0_ORDER}/${orderId}/cancel`);
|
|
216
|
+
console.log('place order:', placeOrderResponse);
|
|
217
|
+
return placeOrderResponse;
|
|
218
|
+
},
|
|
219
|
+
getWebhooks: async () => {
|
|
220
|
+
const webhooks = await httpGet(credentials, PATH_1_0_WEBHOOK);
|
|
221
|
+
console.log('webhooks:', webhooks);
|
|
222
|
+
return webhooks;
|
|
223
|
+
},
|
|
224
|
+
createWebhookSubscription: async (webhook) => {
|
|
225
|
+
const createdWebhook = await httpData(credentials, webhook, PATH_1_0_WEBHOOK);
|
|
226
|
+
return createdWebhook;
|
|
227
|
+
},
|
|
228
|
+
getFulfillmentCenters: async () => {
|
|
229
|
+
const fulfillmentCenters = await httpGet(credentials, PATH_1_0_FULFILLMENT_CENTER);
|
|
230
|
+
console.log('fulfillment centers:', fulfillmentCenters);
|
|
231
|
+
return fulfillmentCenters;
|
|
232
|
+
},
|
|
233
|
+
createWarehouseReceivingOrder: async (request) => {
|
|
234
|
+
const createdWRO = await httpData(credentials, request, PATH_2_0_RECEIVING);
|
|
235
|
+
return createdWRO;
|
|
236
|
+
},
|
|
237
|
+
getWarehouseReceivingOrder: async (orderId) => {
|
|
238
|
+
const wro = await httpGet(credentials, `${PATH_2_0_RECEIVING}/${orderId}`);
|
|
239
|
+
return wro;
|
|
240
|
+
},
|
|
241
|
+
getWarehouseReceivingOrderBoxes: async (orderId) => {
|
|
242
|
+
const wroBoxes = await httpGet(credentials, `${PATH_2_0_RECEIVING}/${orderId}/boxes`);
|
|
243
|
+
return wroBoxes;
|
|
244
|
+
},
|
|
245
|
+
getReceivingExtended: async (query) => {
|
|
246
|
+
const getReceivingExtendedResult = await httpGet(credentials, PATH_2_0_RECEIVING_EXTENDED, query);
|
|
247
|
+
console.log('get receiving extended:', getReceivingExtendedResult.success, getReceivingExtendedResult.success === false ? getReceivingExtendedResult.statusCode : 'found');
|
|
248
|
+
return getReceivingExtendedResult;
|
|
249
|
+
},
|
|
250
|
+
/**
|
|
251
|
+
* This must be for setting/clearing if it has been synced externally.
|
|
252
|
+
*
|
|
253
|
+
* Use case is interop via searching for "completed" that are not yet synced.
|
|
254
|
+
*
|
|
255
|
+
* NOTE: this is tagged experimental, so might change or be dropped
|
|
256
|
+
*/
|
|
257
|
+
experimentalReceivingSetExternalSync: async (ids, isExternalSync) => {
|
|
258
|
+
console.log(`Setting: ${ids.join(',')} to external sync: ${isExternalSync}`);
|
|
259
|
+
const response = await httpData(credentials, {
|
|
260
|
+
ids,
|
|
261
|
+
is_external_sync: isExternalSync,
|
|
262
|
+
}, `${PATH_EXPERIMENTAL_RECEIVING}/:set-external-sync`);
|
|
263
|
+
if (response.success) {
|
|
264
|
+
for (const result of response.data.results) {
|
|
265
|
+
console.log(` > ${result.id} ${result.action}. Success: ${result.is_success} Reason:'${result.reason}'`);
|
|
266
|
+
}
|
|
267
|
+
console.log('');
|
|
268
|
+
}
|
|
269
|
+
return response;
|
|
270
|
+
},
|
|
271
|
+
listInventory: async (query) => {
|
|
272
|
+
const getInventoryResult = await httpGet(credentials, PATH_1_0_INVENTORY, query);
|
|
273
|
+
console.log('get inventory:', getInventoryResult.success, getInventoryResult.success === false ? getInventoryResult.statusCode : 'found');
|
|
274
|
+
return getInventoryResult;
|
|
275
|
+
},
|
|
276
|
+
/**
|
|
277
|
+
* Only for sandbox: https://developer.shipbob.com/sandbox-simulations/
|
|
278
|
+
*
|
|
279
|
+
* NOTE: generates a 200 instead of a 201 like everywhere else
|
|
280
|
+
*/
|
|
281
|
+
simulateShipment: async (request) => {
|
|
282
|
+
const result = await httpData(credentials, request, `${PATH_2_0_SIMULATE}/shipment`);
|
|
283
|
+
if (result.success) {
|
|
284
|
+
console.log('simulate shipment sent', result.data.simulation_id, result.data.message);
|
|
285
|
+
}
|
|
286
|
+
else {
|
|
287
|
+
console.log('simulate shipment failed:', result.data);
|
|
288
|
+
}
|
|
289
|
+
return result;
|
|
290
|
+
},
|
|
291
|
+
/**
|
|
292
|
+
*
|
|
293
|
+
* Only for sandbox: https://developer.shipbob.com/sandbox-simulations/
|
|
294
|
+
*
|
|
295
|
+
* @param simulationId UUID from "/2.0/simulate/shipment" call
|
|
296
|
+
*/
|
|
297
|
+
getSimulationStatus: async (simulationId) => {
|
|
298
|
+
const result = await httpGet(credentials, `${PATH_2_0_SIMULATE}/status/${simulationId}`);
|
|
299
|
+
return result;
|
|
300
|
+
},
|
|
301
|
+
};
|
|
302
|
+
};
|
|
303
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{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AG,MAAM,OAAO,CAAqB,WAAW,EAAE,kBAAkB,EAAE,KAAK,CAAC,CAAC;YACrG,OAAO,CAAC,GAAG,CACT,gBAAgB,EAChB,kBAAkB,CAAC,OAAO,EAC1B,kBAAkB,CAAC,OAAO,KAAK,KAAK,CAAC,CAAC,CAAC,kBAAkB,CAAC,UAAU,CAAC,CAAC,CAAC,OAAO,CAC/E,CAAC;YACF,OAAO,kBAAkB,CAAC;QAC5B,CAAC;QACD;;;;WAIG;QACH,gBAAgB,EAAE,KAAK,EAAE,OAAgC,EAAE,EAAE;YAC3D,MAAM,MAAM,GAAG,MAAM,QAAQ,CAA2B,WAAW,EAAE,OAAO,EAAE,GAAG,iBAAiB,WAAW,CAAC,CAAC;YAC/G,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;gBACnB,OAAO,CAAC,GAAG,CAAC,wBAAwB,EAAE,MAAM,CAAC,IAAI,CAAC,aAAa,EAAE,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YACxF,CAAC;iBAAM,CAAC;gBACN,OAAO,CAAC,GAAG,CAAC,2BAA2B,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;YACxD,CAAC;YACD,OAAO,MAAM,CAAC;QAChB,CAAC;QACD;;;;;WAKG;QACH,mBAAmB,EAAE,KAAK,EAAE,YAAoB,EAAE,EAAE;YAClD,MAAM,MAAM,GAAG,MAAM,OAAO,CAAqB,WAAW,EAAE,GAAG,iBAAiB,WAAW,YAAY,EAAE,CAAC,CAAC;YAC7G,OAAO,MAAM,CAAC;QAChB,CAAC;KACF,CAAC;AACJ,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "shipbob-node-sdk",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.2",
|
|
4
4
|
"description": "ShipBob API node SDK",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"scripts": {
|
|
8
|
-
"prebuild": "rimraf dist && eslint && prettier \"**/*.ts\" --check",
|
|
8
|
+
"prebuild": "rimraf dist && eslint . --ignore-pattern generated/ && prettier \"**/*.ts\" --check",
|
|
9
9
|
"build": "tsc",
|
|
10
|
-
"lint": "eslint .",
|
|
10
|
+
"lint": "eslint . --ignore-pattern generated/",
|
|
11
11
|
"prettier:write": "prettier \"**/*.ts\" --write",
|
|
12
12
|
"generate:client": "openapi-generator-cli generate -i openapi.json -g typescript -o generated/openapi --additional-properties=npmName=restClient,supportsES6=true,withInterfaces=true",
|
|
13
13
|
"test": "mocha"
|