shipbob-node-sdk 0.0.1

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.
@@ -0,0 +1,3 @@
1
+ /dist
2
+ /generated
3
+ /.vscode
package/.prettierrc ADDED
@@ -0,0 +1,9 @@
1
+ {
2
+ "printWidth": 120,
3
+ "bracketSameLine": false,
4
+ "singleQuote": true,
5
+ "tabWidth": 2,
6
+ "trailingComma": "es5",
7
+ "semi": true,
8
+ "endOfLine": "lf"
9
+ }
package/README.md ADDED
@@ -0,0 +1,104 @@
1
+ # ShipBob Node SDK
2
+ First of all there are no official SDKs for ShipBob. I'm just dropping this here, in case it will speed up somebody else getting started using their API.
3
+
4
+ These is just a starting point for anybody looking to integrate ShipBob into a Node.js application.
5
+
6
+ You could make it run in the browser by replacing `https` with `fetch` or `axios`. I could have used fetch as well, but in case somebody is on Node < v18 (and it wasn't stable till v21 anyway).
7
+
8
+ This is not an official or supported library. If you extend or have any issues kindly open a PR. Not really sure anybody will ever need this as most common platforms probably have built-in support.
9
+
10
+ NOTE: I did not notice until all this code was written that ShipBob had published an Open API spec :facepunch:. You may have better luck generating your own client.
11
+ ```bash
12
+ $ yarn generate:client
13
+ ```
14
+ The included script using OpenAPI to generate clients in various languages. It's generating TypeScript. This SDK exposes some endpoints not available in the OpenAPI - the `2.0/receiving-extended` and `experimental/receiving` endpoints.
15
+
16
+ Have a look in the `/test` folder. You might like more something like PostMan, but you can run and debug these "tests" in VS Code. You need a `.env` file with a Personal Access Token:
17
+ ```
18
+ SHIPBOB_API_TOKEN=<redacted>
19
+ ```
20
+
21
+ # API implementation progress
22
+
23
+ ## Legend
24
+ > [x] = I haven't needed this
25
+
26
+ > [✓] = implemented
27
+
28
+ > [ ] = intend to add
29
+
30
+ > [?] = might add support soon - under investigation
31
+
32
+ ## Orders
33
+ - [x] Estimate Fulfillment Cost For Order
34
+ - [?] Get Order
35
+ - [?] Get Orders
36
+ - [✓] Create Order: api.placeOrder(...)
37
+ - [✓] Cancel single Order by Order ID: api.cancelSingleOrderByOrderId()
38
+ - [x] Get Order Store Json
39
+ - [x] Save the Store Order Json (The JSON that represent the order on the Third Party Source)
40
+ - [x] Get one Shipment by Order Id and Shipment Id
41
+ - [x] Cancel one Shipment by Order Id and Shipment Id
42
+ - [x] Get one Shipment's status timeline by Order Id and Shipment Id
43
+ - [?] Get all Shipments for Order
44
+ - [x] Get logs for one Shipment by Order Id and Shipment Id
45
+
46
+ ## Shipments
47
+ - [?] Get one Shipment by Shipment Id (webhooks are enough?)
48
+ - [?] Update a Shipment (marked with tracking information uploaded to a third-party system where the order originated)
49
+ - [?] Cancel one Shipment by Shipment Id
50
+ - [x] Cancel multiple Shipments by Shipment Id
51
+ - [x] Get one Shipment's status timeline by Shipment Id
52
+ - [x] Get logs for one Shipment by Shipment Id
53
+ - [?] Get shipping methods (hard-code shipping methods?)
54
+
55
+ ## Products
56
+ - [✓] Get multiple products: api.getProducts(...)
57
+ - [✓] Add a single product to the store: api.addProduct(...)
58
+ - [ ] Modify a single product (we will need this to add multiple barcodes)
59
+ - [x] Add multiple products to the store
60
+
61
+ ## Inventory
62
+ - [ ] Get an inventory item
63
+ - [✓] List inventory items: api.listInventory(...)
64
+ - [x] Get a list of inventory items by product id (we don't know product_id)
65
+
66
+ ## Channels
67
+ - [✓] Get user-authorized channel info: not in api, but used on init
68
+
69
+ ## Returns
70
+ - [?] Get Return Order
71
+ - [?] Modify Return Order
72
+ - [?] Get Return Orders
73
+ - [?] Create Return Order
74
+ - [?] Cancel Return Order
75
+ - [?] Get One Return's status history
76
+
77
+ ## Receiving
78
+ - [x] Get Fulfillment Centers
79
+ - [✓] Get Warehouse Receiving Order
80
+ - [✓] Get Warehouse Receiving Order Boxes
81
+ - [ ] Get Multiple Warehouse Receiving Orders (we probably need this to filter by statuses)
82
+ - [✓] Create Warehouse Receiving Order: api.createWarehouseReceivingOrder(...)
83
+ - [x] Get Warehouse Receiving Order Box Labels
84
+ - [x] Cancel Warehouse Receiving Order (could be done manually, if needed?)
85
+ - [x] 5 x DEPRECATED '/1.0/receiving
86
+ - Get Warehouse Receiving Order
87
+ - Get a Warehouse Receiving Order by Purchase Order Number
88
+ - Create Warehouse Receiving Order
89
+ - Get Warehouse Receiving Order Box Labels
90
+ - Cancel Warehouse Receiving Order
91
+
92
+ ## Receiving-Extended (not in API docs)
93
+ - [✓] Get Receiving Extended: api.getReceivingExtended(...)
94
+
95
+ ## Experimental/receiving (not in API docs. can change/be removed)
96
+ - [✓] Receiving Set External Sync: api.experimentalReceivingSetExternalSync(...)
97
+
98
+ ## Webhooks
99
+ - [✓] Get Webhooks: api.getWebhooks()
100
+ - [✓] Create a new webhook subscription: api.createWebhookSubscription(...)
101
+ - [ ] Delete an existing webhook subscription
102
+
103
+ ## Locations
104
+ - [x] Get locations
@@ -0,0 +1,13 @@
1
+ import eslint from "@eslint/js";
2
+ import tseslint from "typescript-eslint";
3
+
4
+ export default tseslint.config(
5
+ eslint.configs.recommended,
6
+ ...tseslint.configs.recommended,
7
+ ...tseslint.configs.stylistic,
8
+ {
9
+ rules: {
10
+ "@typescript-eslint/consistent-type-definitions": "warn"
11
+ }
12
+ }
13
+ );