shipbob-node-sdk 0.0.10 → 0.0.12
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/README.md +177 -36
- package/dist/WebScraper.d.ts +19 -0
- package/dist/WebScraper.js +143 -0
- package/dist/WebScraper.js.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +25 -12
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +17 -1
- package/dist/types.js.map +1 -1
- package/package.json +11 -2
package/README.md
CHANGED
|
@@ -1,32 +1,33 @@
|
|
|
1
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
2
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
Not really sure anybody will ever need this as many common platforms probably have integrations. There are a couple of other community SDKs. They do not have `/2.0/*` or `/experimental/*` endpoints:
|
|
7
|
-
- [shipbob-sdk-python](https://github.com/community-phone-company/shipbob-sdk-python)
|
|
8
|
-
- [shipbob-go](https://github.com/stryd/shipbob-go) - generated from Open API
|
|
3
|
+
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.
|
|
9
4
|
|
|
10
|
-
|
|
11
|
-
```bash
|
|
12
|
-
$ yarn generate:client
|
|
13
|
-
```
|
|
14
|
-
The included script using OpenAPI can generate clients in various languages.
|
|
5
|
+
This library uses the built-in node.js fetch, so you'll want a newer node version with undici support.
|
|
15
6
|
|
|
16
7
|
This SDK exposes some endpoints not available in the OpenAPI including:
|
|
8
|
+
|
|
17
9
|
- `/2.0/receiving-extended`
|
|
18
10
|
- `/2.0/product`
|
|
19
11
|
- `/experimental/product` :skull:
|
|
20
12
|
- `/experimental/receiving` :skull:
|
|
21
13
|
|
|
22
|
-
Have a look in the `/test` folder.
|
|
23
|
-
|
|
14
|
+
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 like this:
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
# for the PAT (Personal Access Token) login (recommended)
|
|
24
18
|
SHIPBOB_API_TOKEN=<redacted>
|
|
19
|
+
# for the oAuth login
|
|
20
|
+
SHIPBOB_CLIENT_ID=<redacted>
|
|
21
|
+
SHIPBOB_CLIENT_SECRET=<redacted>
|
|
22
|
+
# for the Web UI scraper (web.shipbob.com) login
|
|
23
|
+
SHIPBOB_WEB_UI_EMAIL=email@company.com
|
|
24
|
+
SHIPBOB_WEB_UI_PASSWORD=<redacted>
|
|
25
25
|
```
|
|
26
26
|
|
|
27
27
|
# API implementation progress
|
|
28
28
|
|
|
29
29
|
## Legend
|
|
30
|
+
|
|
30
31
|
:x: = I haven't needed this
|
|
31
32
|
|
|
32
33
|
:heavy_check_mark: = implemented
|
|
@@ -36,6 +37,7 @@ SHIPBOB_API_TOKEN=<redacted>
|
|
|
36
37
|
:question: = might add support soon - under investigation
|
|
37
38
|
|
|
38
39
|
## Orders
|
|
40
|
+
|
|
39
41
|
- :x: Estimate Fulfillment Cost For Order
|
|
40
42
|
- :question: Get Order - don't see the point of this endpoint, unless you store their Ids
|
|
41
43
|
- :heavy_check_mark: Get Orders: api.getOrders(...)
|
|
@@ -57,7 +59,9 @@ SHIPBOB_API_TOKEN=<redacted>
|
|
|
57
59
|
- :heavy_check_mark: Get shipping methods: api.getShippingMethods()
|
|
58
60
|
|
|
59
61
|
## Shipments
|
|
62
|
+
|
|
60
63
|
Turns out the webhooks aren't reliable, so polling is needed to get shipment information.
|
|
64
|
+
|
|
61
65
|
1. `order_shipped` webhook can fire without tracking details
|
|
62
66
|
2. `shipment_delivered` webhook may not be sent. Additionally, exceptions (return to sender) have no webhook.
|
|
63
67
|
|
|
@@ -70,34 +74,44 @@ Turns out the webhooks aren't reliable, so polling is needed to get shipment inf
|
|
|
70
74
|
- :heavy_check_mark: Get shipping methods: `api.getShippingMethods()`
|
|
71
75
|
|
|
72
76
|
## Products 1.0
|
|
77
|
+
|
|
73
78
|
- :heavy_check_mark: Get multiple products: `api.getProducts1_0(...)`
|
|
74
79
|
- :heavy_check_mark: Add a single product to the store: `api.createProduct1_0(...)`
|
|
75
80
|
- :x: Modify a single product (using 2.0 for additional properties)
|
|
76
81
|
- :x: Add multiple products to the store
|
|
77
82
|
|
|
78
83
|
## Products 2.0
|
|
84
|
+
|
|
79
85
|
These are not documented on the site yet:
|
|
86
|
+
|
|
80
87
|
- :heavy_check_mark: Get multiple products: `api.getProducts2_0(...)`
|
|
81
88
|
- :heavy_check_mark: Add a single product to the store: `api.createProduct2_0(...)`
|
|
82
89
|
- :heavy_check_mark: Modify a single product: `api.updateProducts2_0(...)`
|
|
83
90
|
- :x: Add multiple products to the store
|
|
84
91
|
|
|
85
92
|
## Products Experimental
|
|
93
|
+
|
|
86
94
|
Kindly note as it's experimental subject to change/removal :skull:
|
|
95
|
+
|
|
87
96
|
- :heavy_check_mark: Get multiple products: `api.getProductsExperimental(...)`
|
|
88
97
|
- :heavy_check_mark: Add a single product to the store: `api.createProductExperimental(...)`
|
|
89
98
|
- :heavy_check_mark: Modify a single product: `api.updateProductsExperimental(...)`
|
|
90
99
|
- :x: Add multiple products to the store
|
|
91
100
|
|
|
92
101
|
## Inventory
|
|
102
|
+
|
|
93
103
|
- [ ] Get an inventory item
|
|
94
104
|
- :heavy_check_mark: List inventory items: `api.listInventory(...)`
|
|
95
105
|
- :x: Get a list of inventory items by product id (we don't know product_id)
|
|
96
106
|
|
|
97
107
|
## Channels
|
|
98
|
-
|
|
108
|
+
|
|
109
|
+
- :heavy_check_mark: Get user-authorized channels `api.getChannels()`
|
|
110
|
+
|
|
111
|
+
**NOTE:** This fails with a web UI scraper account (you need `channels_read` scope)
|
|
99
112
|
|
|
100
113
|
## Returns
|
|
114
|
+
|
|
101
115
|
- :question: Get Return Order
|
|
102
116
|
- :question: Modify Return Order
|
|
103
117
|
- :question: Get Return Orders
|
|
@@ -106,6 +120,7 @@ Kindly note as it's experimental subject to change/removal :skull:
|
|
|
106
120
|
- :question: Get One Return's status history
|
|
107
121
|
|
|
108
122
|
## Receiving
|
|
123
|
+
|
|
109
124
|
- :heavy_check_mark: Get Fulfillment Centers: `api.getFulfillmentCenters()`
|
|
110
125
|
- :heavy_check_mark: Get Warehouse Receiving Order: `api.getWarehouseReceivingOrder(...)`
|
|
111
126
|
- :heavy_check_mark: Get Warehouse Receiving Order Boxes: `api.getWarehouseReceivingOrderBoxes(...)`
|
|
@@ -117,38 +132,75 @@ Kindly note as it's experimental subject to change/removal :skull:
|
|
|
117
132
|
- Get Warehouse Receiving Order
|
|
118
133
|
- Get a Warehouse Receiving Order by Purchase Order Number
|
|
119
134
|
- Create Warehouse Receiving Order
|
|
120
|
-
- Get Warehouse Receiving Order Box Labels
|
|
135
|
+
- Get Warehouse Receiving Order Box Labels
|
|
121
136
|
- Cancel Warehouse Receiving Order
|
|
122
137
|
|
|
123
138
|
## Receiving-Extended (not in API docs)
|
|
139
|
+
|
|
124
140
|
- :heavy_check_mark: Get Receiving Extended: `api.getReceivingExtended(...)` (will include this in a recipe that uses SetExternalSync)
|
|
125
141
|
|
|
126
142
|
## Receiving Experimental
|
|
143
|
+
|
|
127
144
|
Kindly note as it's experimental subject to change/removal :skull:
|
|
128
145
|
|
|
129
|
-
I'll try to share a recipe for using this for marking completed WROs.
|
|
130
146
|
- :heavy_check_mark: Receiving Set External Sync: `api.experimentalReceivingSetExternalSync(...)`
|
|
131
147
|
|
|
148
|
+
**NOTE:** See the section below `How to sync WROs` for some guidance.
|
|
149
|
+
|
|
132
150
|
## Webhooks
|
|
133
|
-
|
|
151
|
+
|
|
152
|
+
- :heavy_check_mark: Get Webhooks: `api.getWebhooks()`
|
|
134
153
|
- :heavy_check_mark: Create a new webhook subscription: `api.registerWebhookSubscription(...)`
|
|
135
154
|
- :heavy_check_mark: Delete an existing webhook subscription: `api.unregisterWebhookSubscription(...)`
|
|
136
155
|
|
|
156
|
+
As a personal note. I regret implementing webhooks at all, since I needed to implement polling anyway. There are various gaps in the webhooks. Using their table is perhaps the best way to explain:
|
|
157
|
+
|
|
158
|
+
| Shipment Status | Status Detail Name | Comment |
|
|
159
|
+
| --------------- | ------------------ | ----------------------------------------------------------------------------------------------- |
|
|
160
|
+
| Processing | Labeled | I think this maps to "order_shipped" webhook, doesn't always have tracking (or invoice amounts) |
|
|
161
|
+
| Completed | Delivered | Does not always fire when delivered (seems to be carrier dependent) |
|
|
162
|
+
| Completed | Delivery Exception | No Webhook (need to poll for RTS, etc.) |
|
|
163
|
+
| Exception | \* | These do fire, but are not useful for delivery |
|
|
164
|
+
|
|
165
|
+
ie: No webhooks for delivery exceptions ie: `Completed` -> `DeliveryException` when carrier needs more details. The `shipment_exception` webhook only applies to before the shipment leaves their FC (ie: inventory related issue).
|
|
166
|
+
|
|
167
|
+
Partial rows of table from here: _(https://developer.shipbob.com/#shipment-statuses)_
|
|
168
|
+
|
|
137
169
|
## Locations
|
|
170
|
+
|
|
138
171
|
- :x: Get locations
|
|
139
172
|
|
|
140
|
-
##
|
|
141
|
-
|
|
173
|
+
## Follow URIs
|
|
174
|
+
|
|
175
|
+
This is not part of the API, but instead allows you to follow URI's returned in the API (see tests for examples). They use some kind of HATEOAS, but it's inconsistent across API versions.
|
|
176
|
+
|
|
142
177
|
- :heavy_check_mark: Retrive a path from a provided resource ie: header `next-page`: `api.getPath<T>(response.headers['next-page'])`
|
|
143
178
|
|
|
144
179
|
# Building locally
|
|
145
|
-
|
|
180
|
+
|
|
181
|
+
For making changes to this library locally - use `yarn link` to test out the changes easily. This is useful if you would like to contribute.
|
|
182
|
+
|
|
183
|
+
# Other options
|
|
184
|
+
|
|
185
|
+
Not really sure anybody will ever need this as many common platforms probably have integrations. There are a couple of other community SDKs. They do not have `/2.0/*` or `/experimental/*` endpoints:
|
|
186
|
+
|
|
187
|
+
- [shipbob-sdk-python](https://github.com/community-phone-company/shipbob-sdk-python)
|
|
188
|
+
- [shipbob-go](https://github.com/stryd/shipbob-go) - generated from Open API
|
|
189
|
+
|
|
190
|
+
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. Maybe those generated typings at least belong here.
|
|
191
|
+
|
|
192
|
+
```bash
|
|
193
|
+
$ yarn generate:client
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
The included script using OpenAPI can generate clients in various languages.
|
|
146
197
|
|
|
147
198
|
# Testing
|
|
148
|
-
|
|
199
|
+
|
|
200
|
+
You can fake out this library itself, or otherwise mocking the ShipBob API http calls are quite easy to simulate with `nock`. Here's a way to test creating an order verifying idempotent operation.
|
|
149
201
|
|
|
150
202
|
```javascript
|
|
151
|
-
// NOTE: nock > 14 is needed to mock underlying fetch calls
|
|
203
|
+
// NOTE: nock > 14 with undici is needed to mock underlying "fetch" calls
|
|
152
204
|
const CHANNELS_RESPONSE: ChannelsResponse = [{
|
|
153
205
|
id: 1,
|
|
154
206
|
application_name: 'SMA',
|
|
@@ -178,28 +230,26 @@ const nockScope = nock('https://sandbox-api.shipbob.com')
|
|
|
178
230
|
...
|
|
179
231
|
assert.ok(nockScope.isDone(), 'should have completed nock requests');
|
|
180
232
|
```
|
|
233
|
+
|
|
181
234
|
# Adding more events
|
|
235
|
+
|
|
182
236
|
To replace what could be considered "missing" webhooks, such as WRO completed (Receiving has no webhooks!).
|
|
183
237
|
|
|
184
|
-
You can
|
|
238
|
+
You can follow the section `How to sync WROs` for a more robust solution. Read on if you are interested in how this works, but also why it won't work!
|
|
185
239
|
|
|
186
240
|
If you want something more event driven, you can use the emails they send out with an inbound email processor:
|
|
187
241
|
ie:
|
|
242
|
+
|
|
188
243
|
```javascript
|
|
244
|
+
// this is done using Mandrill/Mailchimp Inbound mail processor:
|
|
189
245
|
for (const event of events) {
|
|
190
246
|
const { subject } = event.msg;
|
|
191
247
|
switch (subject) {
|
|
192
248
|
case 'Your WRO is now complete':
|
|
193
249
|
// ie: Your WRO 756713 is now complete and all associated inventory is ready to ship! ...
|
|
194
250
|
// https://web.shipbob.com/app/Merchant/#/inventory/receiving/756713/summary ...
|
|
195
|
-
const match = /Your WRO (?<wro>\d+) is now complete/i.exec(
|
|
196
|
-
|
|
197
|
-
);
|
|
198
|
-
if (
|
|
199
|
-
match === null ||
|
|
200
|
-
match.groups === undefined ||
|
|
201
|
-
!('wro' in match.groups)
|
|
202
|
-
) {
|
|
251
|
+
const match = /Your WRO (?<wro>\d+) is now complete/i.exec(event.msg.text);
|
|
252
|
+
if (match === null || match.groups === undefined || !('wro' in match.groups)) {
|
|
203
253
|
throw new Error(`cannot find wro in email '${taskStorageId}'`);
|
|
204
254
|
}
|
|
205
255
|
const wro = match.groups.wro;
|
|
@@ -217,17 +267,108 @@ for (const event of events) {
|
|
|
217
267
|
|
|
218
268
|
You can publish that as an event or push to a queue and it will act as a "webhook".
|
|
219
269
|
|
|
270
|
+
**NOTE:** I discovered after writing the above inbound mail handler that a WRO you create may be split. ie: we created 1 WRO and it was split into 6 more WROs by the ShipBob team, so it's not really possible to link back to your system when that occurs. There's no hierarchical relationship with the split WROs they are creating. I believe UROs (Unidentified Receiving Orders) may have same behaviour. In other words, you will need to implement polling anyway, so adding this is probably not worthwhile.
|
|
271
|
+
|
|
220
272
|
# OAuth
|
|
221
|
-
|
|
222
|
-
|
|
273
|
+
|
|
274
|
+
There is no S2S (server-to-server) oAuth. User intervention is required. There are only helper methods to help with that. You could bypass that with a webscraper (see next section).
|
|
275
|
+
|
|
276
|
+
- `oAuthGetConnectUrl()` direct an end user to follow the generated URL. Use `offline_access` as part of scope to get a refresh token.
|
|
223
277
|
- `oAuthGetAccessToken()` call this with the `code` query string fragment `https://yourname.ngrok.io/#code=...&id_token=...` the redirect_uri (and your client Id and secret from ShipBob App)
|
|
224
278
|
- `oAuthRefreshAccessToken()` call this with the last `refresh_token` you received, otherwise the same as `oAuthGetAccessToken()` without `code`.
|
|
225
279
|
|
|
226
280
|
The method to get/refresh access token both return `access_token`, so you provide that to `createShipBobApi(...)` with your application name.
|
|
227
|
-
|
|
281
|
+
|
|
282
|
+
If you create products with your API, you will not be able to see them with an oAuth app. I went down a big rabbit hole here - something to do with different channels. Try not to waste as much time as I did here and avoid using oAuth unless you are building actually an app IMO.
|
|
283
|
+
|
|
284
|
+
# Access APIs available to web.shipbob.com
|
|
285
|
+
|
|
286
|
+
The Web UI has a much broader set of unsupported APIs (ordersapi.shipbob.com, shippingservice.shipbob.com, merchantpricingapi.shipbob.com, etc.). For example, you cannot "patch" a WRO on the public receiving API, but you can somehow with a web login, so it unlocks extra functionality and has a separate rate limit from the API.
|
|
287
|
+
You would need to create a ShipBob account and then use those credentials to login with a scraper (see /src/WebScraper.ts). The account can only be logged with one session at a time. Look at `AuthScopesWeb` type and you can probably work backwards the scopes needed for each API. If you go this route then the peer dependency on puppeteer is not optional.
|
|
288
|
+
|
|
289
|
+
There is no documentation for these extra APIs - you can look through network tracing in the browser. See unit tests for full example:
|
|
290
|
+
|
|
291
|
+
```typescript
|
|
292
|
+
// scrape web.shipbob.com website:
|
|
293
|
+
const authResponse = await getAccessTokenUI({
|
|
294
|
+
email,
|
|
295
|
+
password,
|
|
296
|
+
});
|
|
297
|
+
|
|
298
|
+
const missingChannelScope = authResponse.scopes.indexOf('channel_read') === -1;
|
|
299
|
+
|
|
300
|
+
const webUIAPI = await createShipBobApi(authResponse.accessToken, url, '<unused>', {
|
|
301
|
+
skipChannelLoad: missingChannelScope,
|
|
302
|
+
});
|
|
303
|
+
|
|
304
|
+
const inventoryListResponse = await webUIAPI.listInventory({ Ids: [20104984] });
|
|
305
|
+
```
|
|
228
306
|
|
|
229
307
|
# Polling Orders for tracking
|
|
230
|
-
|
|
308
|
+
|
|
309
|
+
This is a suggested way to track orders from ShipBob. This may be better than using the webhook, sometimes the `order_shipped` webhook fires with no tracking information.
|
|
310
|
+
|
|
311
|
+
1. Poll GET `/1.0/order?HasTracking=true&IsTrackingUploaded=false&startDate=03-25-2025`
|
|
312
|
+
|
|
313
|
+
```typescript
|
|
314
|
+
const results = await api.getOrders({
|
|
315
|
+
HasTracking: true,
|
|
316
|
+
IsTrackingUploaded: false,
|
|
317
|
+
StartDate: '03-25-2025',
|
|
318
|
+
});
|
|
319
|
+
```
|
|
320
|
+
|
|
231
321
|
2. Iterate through each order (and each shipment)
|
|
232
322
|
3. Sync the tracking back to your platform
|
|
233
|
-
4. Mark the order as shipped using this endpoint (https://developer.shipbob.com/api-docs/#tag/Orders/paths/~11.0~1shipment~1%7BshipmentId%7D/put). Or, you can mark it as shipped using the bulk mark as shipped endpoint (https://developer.shipbob.com/api-docs/#tag/Orders/paths/~11.0~1shipment~1:bulkUpdateTrackingUpload/post).
|
|
323
|
+
4. Mark the order as shipped using this endpoint (https://developer.shipbob.com/api-docs/#tag/Orders/paths/~11.0~1shipment~1%7BshipmentId%7D/put). Or, you can mark it as shipped using the bulk mark as shipped endpoint (https://developer.shipbob.com/api-docs/#tag/Orders/paths/~11.0~1shipment~1:bulkUpdateTrackingUpload/post).
|
|
324
|
+
|
|
325
|
+
**NOTE:** `PUT`/`POST` to `/1.0/shipment` not implemented in this library yet.
|
|
326
|
+
|
|
327
|
+
# How to sync WROs
|
|
328
|
+
|
|
329
|
+
Syncing WROs (Warehouse Receiving Orders) back to your system has 2 options.
|
|
330
|
+
|
|
331
|
+
## Option #1 - Simple (wait until the WRO status is Completed)
|
|
332
|
+
|
|
333
|
+
- Poll our GET WRO endpoint for WROs in Completed status:
|
|
334
|
+
GET https://sandbox-api.shipbob.com/2.0/receiving-extended?Statuses=Completed&ExternalSync=false
|
|
335
|
+
|
|
336
|
+
```typescript
|
|
337
|
+
// with this library
|
|
338
|
+
const results = await api.getReceivingExtended({
|
|
339
|
+
Statuses: 'Completed',
|
|
340
|
+
ExternalSync: false,
|
|
341
|
+
});
|
|
342
|
+
```
|
|
343
|
+
|
|
344
|
+
- Iterate through each inventory id in the inventory_quantities array and sync the stowed_quantity back to your system
|
|
345
|
+
- Mark the WRO as synced (see below for the endpoint to use and sample request)
|
|
346
|
+
- Poll the GET WRO endpoint again and 442946 will no longer show up as you already synced this and ExternalSync is now set to true
|
|
347
|
+
|
|
348
|
+
Mark the WRO as synced (this is optional and a alternative option to continuously polling completed WROs that you may or may not know you have already synced)
|
|
349
|
+
|
|
350
|
+
POST https://sandbox-api.shipbob.com/experimental/receiving/:set-external-sync
|
|
351
|
+
|
|
352
|
+
```json
|
|
353
|
+
{
|
|
354
|
+
"ids": [442946],
|
|
355
|
+
"is_external_sync": true
|
|
356
|
+
}
|
|
357
|
+
```
|
|
358
|
+
|
|
359
|
+
```typescript
|
|
360
|
+
// with this library
|
|
361
|
+
// use Ids from "getReceivingExtended" with ExternalSync: false.
|
|
362
|
+
const results = await api.experimentalReceivingSetExternalSync([443001], true);
|
|
363
|
+
```
|
|
364
|
+
|
|
365
|
+
## Option #2 - Advanced (partial receiving)
|
|
366
|
+
|
|
367
|
+
- Poll our GET WRO endpoint for WROs with statuses "processing" and "completed": https://sandbox-api.shipbob.com/2.0/receiving-extended?Statuses=Processing,Completed&ExternalSync=false.
|
|
368
|
+
|
|
369
|
+
**Note:** When initially testing you can remove the statuses from the query params, and you will see the default status of "AwaitingArrival" whenever a WRO is created. There is no sandbox simulation to move these forward.
|
|
370
|
+
|
|
371
|
+
- For each WRO, make a request to the Get Warehouse Receiving Order Boxes endpoint: https://sandbox-api.shipbob.com/2.0/receiving/442997/boxes
|
|
372
|
+
- Iterate through each box
|
|
373
|
+
- Iterate through each item in the box_items array
|
|
374
|
+
- Sync the stowed_quantity for each item back to your system
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export type AuthResponse = {
|
|
2
|
+
success: false;
|
|
3
|
+
reason: string;
|
|
4
|
+
} | {
|
|
5
|
+
success: true;
|
|
6
|
+
accessToken: string;
|
|
7
|
+
refreshToken: string;
|
|
8
|
+
scopes: string[];
|
|
9
|
+
};
|
|
10
|
+
export type Credentials = {
|
|
11
|
+
email: string;
|
|
12
|
+
password: string;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Retrieves an auth and refresh token from web.shipbob.com Merchant Login
|
|
16
|
+
*
|
|
17
|
+
* NOTE: this is obviously brittle and unsupported - can break at any time - even a small UI update on ShipBob side.
|
|
18
|
+
*/
|
|
19
|
+
export declare const getAccessTokenUI: (credentials: Credentials, timeoutInSeconds?: number) => Promise<AuthResponse>;
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getAccessTokenUI = void 0;
|
|
4
|
+
const puppeteer_1 = require("puppeteer");
|
|
5
|
+
/**
|
|
6
|
+
* This is the /connect/token in regular auth flow
|
|
7
|
+
*/
|
|
8
|
+
const SAVE_TOKEN_PAGE = '/Account/SaveToken';
|
|
9
|
+
/**
|
|
10
|
+
* Attempt to login and return an auth token (that can in turn be used to access API)
|
|
11
|
+
*/
|
|
12
|
+
const loginShipBob = async (page, credentials, waitTimoutInSeconds = 30) => {
|
|
13
|
+
// hopefully this doesn't change!
|
|
14
|
+
await page.goto('https://web.shipbob.com/app/Merchant/#/Login', {
|
|
15
|
+
timeout: 0, // no timeout - it's a slow page
|
|
16
|
+
});
|
|
17
|
+
await page.waitForNavigation({ waitUntil: 'networkidle0' });
|
|
18
|
+
await page.waitForSelector('input[name=Username]');
|
|
19
|
+
// <input name="Username" type="email" data-sb-automation="username-input" ...>
|
|
20
|
+
await page.type('input[name=Username]', credentials.email);
|
|
21
|
+
// await page.type('input[type="password"]', password);
|
|
22
|
+
// <input name="Password" id="password-input" type="password" data-sb-automation="password-input">
|
|
23
|
+
await page.type('input[name=Password]', credentials.password);
|
|
24
|
+
// we will attach to this context as we progress authentication
|
|
25
|
+
const context = {
|
|
26
|
+
scopes: [],
|
|
27
|
+
};
|
|
28
|
+
const interceptorPromise = new Promise((resolve, reject) => {
|
|
29
|
+
const loginTimoutHandle = setTimeout(() => {
|
|
30
|
+
reject(new Error('timeout occured waiting to login'));
|
|
31
|
+
}, waitTimoutInSeconds * 1000);
|
|
32
|
+
// setup interception, before clicking login button
|
|
33
|
+
page.setRequestInterception(true);
|
|
34
|
+
// probably we could use only "request" and it would work, too. Untested.
|
|
35
|
+
page.on('request', (request) => {
|
|
36
|
+
const { host, pathname, searchParams } = new URL(request.url());
|
|
37
|
+
// lots of the traffic for "i.clarity.ms", "px.ads.linkedin.com", "connect.facebook.net", "www.facebook.com", etc.
|
|
38
|
+
// we only care about auth.shipbob.com and web.shipbob.com:
|
|
39
|
+
if (host.endsWith('shipbob.com')) {
|
|
40
|
+
console.log(`request > host:${host}${pathname.substring(10)}...`);
|
|
41
|
+
switch (pathname) {
|
|
42
|
+
case '/connect/authorize/callback':
|
|
43
|
+
console.log(' > returning to shipbob UI...');
|
|
44
|
+
break;
|
|
45
|
+
case '/app/Merchant/signin-callback':
|
|
46
|
+
// cancel timout for logging in (hopefully our continuation works. CF clearance and API token).
|
|
47
|
+
clearTimeout(loginTimoutHandle);
|
|
48
|
+
console.log(' > Checking for code querystring fragment (and storing scope)');
|
|
49
|
+
if (searchParams.has('code')) {
|
|
50
|
+
const authToken = searchParams.get('code');
|
|
51
|
+
const scopes = searchParams.get('scope');
|
|
52
|
+
console.log('short-lived auth token received');
|
|
53
|
+
if (authToken === null || scopes === null) {
|
|
54
|
+
reject(new Error('Authtoken or scope null'));
|
|
55
|
+
break;
|
|
56
|
+
}
|
|
57
|
+
// attach the scopes to context. ie: channel_read not available
|
|
58
|
+
const decodedScopes = decodeURIComponent(scopes);
|
|
59
|
+
context.scopes = decodedScopes.split(' ');
|
|
60
|
+
}
|
|
61
|
+
break;
|
|
62
|
+
// this seems to be what makes the account allow one login (everybody else gets spinners)
|
|
63
|
+
// if you haven't hit this page, you will get a 401 with the "short-lived" token
|
|
64
|
+
case SAVE_TOKEN_PAGE:
|
|
65
|
+
{
|
|
66
|
+
page.on('response', (event) => {
|
|
67
|
+
const { host, pathname } = new URL(event.url());
|
|
68
|
+
console.log(` > response from: ${host}${pathname}`);
|
|
69
|
+
if (host.endsWith('shipbob.com')) {
|
|
70
|
+
if (pathname === SAVE_TOKEN_PAGE) {
|
|
71
|
+
const responseHeaders = event.headers();
|
|
72
|
+
const accessToken = responseHeaders['accesstoken'];
|
|
73
|
+
const refreshToken = responseHeaders['refreshtoken'];
|
|
74
|
+
if (accessToken === undefined) {
|
|
75
|
+
reject(new Error(`response is missing access token: ${Object.keys(responseHeaders)}`));
|
|
76
|
+
}
|
|
77
|
+
page.removeAllListeners();
|
|
78
|
+
resolve({
|
|
79
|
+
success: true,
|
|
80
|
+
accessToken,
|
|
81
|
+
refreshToken,
|
|
82
|
+
scopes: context.scopes,
|
|
83
|
+
});
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
break;
|
|
90
|
+
default:
|
|
91
|
+
if (!pathname.endsWith('js') && !pathname.endsWith('css')) {
|
|
92
|
+
// this is where cf-clearance cookies are set:
|
|
93
|
+
console.log(` > Shipbob ignored path: ${pathname}`);
|
|
94
|
+
}
|
|
95
|
+
break;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
request.continue();
|
|
99
|
+
});
|
|
100
|
+
// kick off login process - navigation listeners are already registered
|
|
101
|
+
Promise.all([page.waitForNavigation({ waitUntil: 'networkidle0' }), page.click('#login-button')]).then(() => {
|
|
102
|
+
console.log(' > Login clicked (interceptors are running)');
|
|
103
|
+
});
|
|
104
|
+
});
|
|
105
|
+
return interceptorPromise;
|
|
106
|
+
};
|
|
107
|
+
/**
|
|
108
|
+
* Retrieves an auth and refresh token from web.shipbob.com Merchant Login
|
|
109
|
+
*
|
|
110
|
+
* NOTE: this is obviously brittle and unsupported - can break at any time - even a small UI update on ShipBob side.
|
|
111
|
+
*/
|
|
112
|
+
const getAccessTokenUI = async (credentials, timeoutInSeconds = 60) => {
|
|
113
|
+
let browser = null;
|
|
114
|
+
try {
|
|
115
|
+
browser = await puppeteer_1.default.launch({
|
|
116
|
+
headless: true, // for v16.2.0
|
|
117
|
+
// headless: 'new', // equivalent to headless:true in the future - use for Chrome > 112
|
|
118
|
+
args: [
|
|
119
|
+
'--no-sandbox', // not running as root
|
|
120
|
+
'--disable-setuid-sandbox',
|
|
121
|
+
],
|
|
122
|
+
});
|
|
123
|
+
const page = await browser.newPage();
|
|
124
|
+
await page.setViewport({ width: 1920, height: 1080 });
|
|
125
|
+
page.setUserAgent('Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:136.0) Gecko/20100101 Firefox/136.0');
|
|
126
|
+
const loginResponse = await loginShipBob(page, credentials, timeoutInSeconds);
|
|
127
|
+
if (loginResponse.success !== true) {
|
|
128
|
+
console.error('reason:', loginResponse.reason);
|
|
129
|
+
}
|
|
130
|
+
return loginResponse;
|
|
131
|
+
}
|
|
132
|
+
catch (e) {
|
|
133
|
+
console.error(e);
|
|
134
|
+
throw e;
|
|
135
|
+
}
|
|
136
|
+
finally {
|
|
137
|
+
if (browser !== null) {
|
|
138
|
+
await browser.close();
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
};
|
|
142
|
+
exports.getAccessTokenUI = getAccessTokenUI;
|
|
143
|
+
//# sourceMappingURL=WebScraper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WebScraper.js","sourceRoot":"","sources":["../src/WebScraper.ts"],"names":[],"mappings":";;;AAAA,yCAAqD;AAcrD;;GAEG;AACH,MAAM,eAAe,GAAG,oBAAoB,CAAC;AAQ7C;;GAEG;AACH,MAAM,YAAY,GAAG,KAAK,EAAE,IAAU,EAAE,WAAwB,EAAE,mBAAmB,GAAG,EAAE,EAAyB,EAAE;IACnH,iCAAiC;IACjC,MAAM,IAAI,CAAC,IAAI,CAAC,8CAA8C,EAAE;QAC9D,OAAO,EAAE,CAAC,EAAE,gCAAgC;KAC7C,CAAC,CAAC;IAEH,MAAM,IAAI,CAAC,iBAAiB,CAAC,EAAE,SAAS,EAAE,cAAc,EAAE,CAAC,CAAC;IAC5D,MAAM,IAAI,CAAC,eAAe,CA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MAAM,CAAC;YAC/B,QAAQ,EAAE,IAAI,EAAE,cAAc;YAC9B,uFAAuF;YACvF,IAAI,EAAE;gBACJ,cAAc,EAAE,sBAAsB;gBACtC,0BAA0B;aAC3B;SACF,CAAC,CAAC;QAEH,MAAM,IAAI,GAAG,MAAM,OAAO,CAAC,OAAO,EAAE,CAAC;QACrC,MAAM,IAAI,CAAC,WAAW,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;QACtD,IAAI,CAAC,YAAY,CAAC,kFAAkF,CAAC,CAAC;QAEtG,MAAM,aAAa,GAAG,MAAM,YAAY,CAAC,IAAI,EAAE,WAAW,EAAE,gBAAgB,CAAC,CAAC;QAC9E,IAAI,aAAa,CAAC,OAAO,KAAK,IAAI,EAAE,CAAC;YACnC,OAAO,CAAC,KAAK,CAAC,SAAS,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;QACjD,CAAC;QAED,OAAO,aAAa,CAAC;IACvB,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QACjB,MAAM,CAAC,CAAC;IACV,CAAC;YAAS,CAAC;QACT,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;YACrB,MAAM,OAAO,CAAC,KAAK,EAAE,CAAC;QACxB,CAAC;IACH,CAAC;AACH,CAAC,CAAC;AA9BW,QAAA,gBAAgB,oBA8B3B"}
|
package/dist/index.d.ts
CHANGED
|
@@ -183,7 +183,7 @@ export declare const createShipBobApi: (token: string | undefined, apiBaseUrl?:
|
|
|
183
183
|
/**
|
|
184
184
|
* NOTE: should verify the response type matches the product 1.0 endpoint
|
|
185
185
|
*/
|
|
186
|
-
listInventory: (query
|
|
186
|
+
listInventory: (query?: Partial<ListInventoryQueryStrings>) => Promise<DataResponse<GetInventory1_0Result[]>>;
|
|
187
187
|
/**
|
|
188
188
|
* Only for sandbox: https://developer.shipbob.com/sandbox-simulations/
|
|
189
189
|
*/
|
package/dist/index.js
CHANGED
|
@@ -60,6 +60,7 @@ const DEFAULT_CHANNEL_APPLICATION_NAME = 'SMA';
|
|
|
60
60
|
*/
|
|
61
61
|
const createShipBobApi = async (token, apiBaseUrl = 'sandbox-api.shipbob.com', channelPredicateOrApplicationName = DEFAULT_CHANNEL_APPLICATION_NAME, options = {
|
|
62
62
|
logTraffic: false,
|
|
63
|
+
skipChannelLoad: false,
|
|
63
64
|
}) => {
|
|
64
65
|
if (token === undefined || token === '') {
|
|
65
66
|
throw new Error('Cannot create a ShipBob API without a PAT');
|
|
@@ -104,6 +105,7 @@ const createShipBobApi = async (token, apiBaseUrl = 'sandbox-api.shipbob.com', c
|
|
|
104
105
|
retryAfter,
|
|
105
106
|
};
|
|
106
107
|
const hasJsonContentHeader = (res) => {
|
|
108
|
+
// TODO: consider making this case-insensitive
|
|
107
109
|
const contentType = res.headers.has(CONTENT_TYPE) ? res.headers.get(CONTENT_TYPE) : null;
|
|
108
110
|
return (contentType &&
|
|
109
111
|
(contentType.startsWith('application/json') || contentType.startsWith('application/problem+json')));
|
|
@@ -145,6 +147,12 @@ const createShipBobApi = async (token, apiBaseUrl = 'sandbox-api.shipbob.com', c
|
|
|
145
147
|
if (credentials.channelId && apiConfiguration.sendChannelId !== false) {
|
|
146
148
|
headers['shipbob_channel_id'] = credentials.channelId.toString();
|
|
147
149
|
}
|
|
150
|
+
if (options.extraHeaders) {
|
|
151
|
+
for (const key of Object.keys(options.extraHeaders)) {
|
|
152
|
+
// these will be logged if they are configured
|
|
153
|
+
headers[key] = options.extraHeaders[key];
|
|
154
|
+
}
|
|
155
|
+
}
|
|
148
156
|
if (options.logTraffic === true) {
|
|
149
157
|
const headersToLog = Object.keys(headers).reduce((prev, cur) => {
|
|
150
158
|
prev.push(cur === 'Authorization' ? `${cur}:Bearer <redacted>` : `${cur}:${headers[cur]}`);
|
|
@@ -203,20 +211,25 @@ const createShipBobApi = async (token, apiBaseUrl = 'sandbox-api.shipbob.com', c
|
|
|
203
211
|
const res = await fetch(url.href, opts);
|
|
204
212
|
return getResult(res);
|
|
205
213
|
};
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
214
|
+
if (options.skipChannelLoad !== true) {
|
|
215
|
+
const channelsResponse = await httpGet(credentials, PATH_1_0_CHANNEL);
|
|
216
|
+
if (!channelsResponse.success) {
|
|
217
|
+
throw new Error(` > GET /1.0/channel -> ${channelsResponse.statusCode} '${channelsResponse.data}'`);
|
|
218
|
+
}
|
|
219
|
+
const selectedChannel = typeof channelPredicateOrApplicationName === 'string'
|
|
220
|
+
? channelsResponse.data.find((c) => c.application_name === channelPredicateOrApplicationName)
|
|
221
|
+
: channelPredicateOrApplicationName(channelsResponse.data);
|
|
222
|
+
if (selectedChannel === undefined) {
|
|
223
|
+
throw new Error(`Did not find channel. Available application names: {${channelsResponse.data.map((c) => c.application_name).join(',')}}`);
|
|
224
|
+
}
|
|
225
|
+
if (options.logTraffic) {
|
|
226
|
+
console.log(` > Found channel id: ${selectedChannel.id} with application name: '${selectedChannel.application_name}'`);
|
|
227
|
+
}
|
|
228
|
+
credentials.channelId = selectedChannel.id;
|
|
215
229
|
}
|
|
216
|
-
|
|
217
|
-
console.
|
|
230
|
+
else {
|
|
231
|
+
console.warn(' > channel load skipped. All requests will be sent without a channel id.');
|
|
218
232
|
}
|
|
219
|
-
credentials.channelId = selectedChannel.id;
|
|
220
233
|
return {
|
|
221
234
|
get sendingChannelIds() {
|
|
222
235
|
return apiConfiguration.sendChannelId;
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,mEAAmE;AACnE,uCAA+B,CAAC,SAAS;AAgCzC,0CAAwB;AACxB,0CAAwB;AA8CxB,WAAW;A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AAkB,EAAE,KAAK,CAAC,CAAC;QACxF,CAAC;QACD;;WAEG;QACH,gBAAgB,EAAE,KAAK,EAAE,OAAgC,EAAE,EAAE;YAC3D,OAAO,MAAM,QAAQ,CAA2B,WAAW,EAAE,OAAO,EAAE,GAAG,iBAAiB,WAAW,CAAC,CAAC;QACzG,CAAC;QACD;;;;;WAKG;QACH,mBAAmB,EAAE,KAAK,EAAE,YAAoB,EAAE,EAAE;YAClD,OAAO,MAAM,OAAO,CAAqB,WAAW,EAAE,GAAG,iBAAiB,WAAW,YAAY,EAAE,CAAC,CAAC;QACvG,CAAC;KACF,CAAC;AACJ,CAAC,CAAC;AA3dW,QAAA,gBAAgB,oBA2d3B"}
|
package/dist/types.d.ts
CHANGED
|
@@ -1263,8 +1263,9 @@ export type ListInventoryQueryStrings = {
|
|
|
1263
1263
|
* ShipBob recommends sending only 150/request
|
|
1264
1264
|
*
|
|
1265
1265
|
* NOTE: if you pass ie: 250 IDs then you will get 404s from shipbob.
|
|
1266
|
+
* NOTE: it's IDs in the documentation. Web UI sends "Ids", so probably case-insensitive
|
|
1266
1267
|
*/
|
|
1267
|
-
|
|
1268
|
+
Ids: number[];
|
|
1268
1269
|
/**
|
|
1269
1270
|
* 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
|
|
1270
1271
|
*
|
|
@@ -1449,7 +1450,22 @@ export type CreateOptions = {
|
|
|
1449
1450
|
* Setup if the API sends the channel. You can alter/check this on the API object after API builder creation.
|
|
1450
1451
|
*/
|
|
1451
1452
|
sendChannelId?: boolean;
|
|
1453
|
+
/**
|
|
1454
|
+
* Set to `true` to skip checking channels on init and/or are missing "channels_read" scope.
|
|
1455
|
+
*
|
|
1456
|
+
* ie: If you scrape web.shipbob.com with a web login, it will not have access to `/channels/1.0`
|
|
1457
|
+
*/
|
|
1458
|
+
skipChannelLoad?: boolean;
|
|
1459
|
+
/**
|
|
1460
|
+
* Send these along with each request
|
|
1461
|
+
*
|
|
1462
|
+
* ie: You can send extra headers like User-Agent. This may be needed to bypass cloudflare.
|
|
1463
|
+
*/
|
|
1464
|
+
extraHeaders?: Record<string, string>;
|
|
1452
1465
|
};
|
|
1466
|
+
/**
|
|
1467
|
+
* NOTE: no `channels_read`, so you'll need to use "skipChannelLoad" when creating an API from this.
|
|
1468
|
+
*/
|
|
1453
1469
|
export type AuthScopesWeb = 'openid' | 'profile' | 'email' | 'read' | 'write' | 'offline_access' | 'inboundManagement_read' | 'fulfillments_read' | 'orders_read' | 'orders_write' | 'orderstateapi_read' | 'receiving_read' | 'receiving_write' | 'returns_read' | 'returns_write' | 'addressValidation' | 'labeling_read' | 'shipment_tracking_read' | 'labeling_write' | 'inventory_read' | 'inventory_write' | 'channels_read' | 'locations_read' | 'locations_write' | 'workOrders_read' | 'workOrders_write' | 'powerBIconfig_read' | 'products_read' | 'pricing_read' | 'fulfillment_customization_write' | 'fulfillment_customization_read' | 'cartbob_write' | 'cartbob_read' | 'onboarding_read' | 'onboarding_write' | 'inventoryallocation_read' | 'internal_integrations_read' | 'internal_integrations_write' | 'internal_fulfillments_write' | 'fba_read' | 'fba_write' | 'pricing_write' | 'token_management' | 'products_write' | 'b2bpacking_read' | 'b2bpacking_write' | 'membership_read' | 'membership_write' | 'useraccounts_read' | 'useraccounts_write' | 'shippingservice_read' | 'inventory_views_read' | 'inventory_views_write';
|
|
1454
1470
|
/**
|
|
1455
1471
|
* These are the scopes granted by generated OAuth clients
|
package/dist/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";;;AA+lCA,IAAY,oBAWX;AAXD,WAAY,oBAAoB;IAC9B,wBAAwB;IACxB,qFAAqB,CAAA;IACrB,qEAAW,CAAA;IACX,6EAAiB,CAAA;IACjB,iGAA2B,CAAA;IAC3B,qEAAa,CAAA;IACb,yEAAe,CAAA;IACf,2EAAgB,CAAA;IAChB,uLAAs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,YAAY;IACtB;;OAEG;IACH,qDAAW,CAAA;IACX;;OAEG;IACH,2DAAc,CAAA;IACd;;OAEG;IACH,qDAAW,CAAA;AACb,CAAC,EAbW,YAAY,4BAAZ,YAAY,QAavB;AAmUD;;;;GAIG;AACH,IAAY,YA8BX;AA9BD,WAAY,YAAY;IACtB;;;;OAIG;IACH,8CAA8B,CAAA;IAC9B;;;OAGG;IACH,wDAAwC,CAAA;IACxC;;;;OAIG;IACH,wDAAwC,CAAA;IACxC;;;;OAIG;IACH,kDAAkC,CAAA;IAClC;;;;OAIG;IACH,wDAAwC,CAAA;AAC1C,CAAC,EA9BW,YAAY,4BAAZ,YAAY,QA8BvB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "shipbob-node-sdk",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.12",
|
|
4
4
|
"description": "ShipBob API node SDK",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"prebuild": "rimraf dist && eslint . --ignore-pattern generated/ && prettier \"**/*.ts\" --check",
|
|
10
10
|
"build": "tsc",
|
|
11
11
|
"lint": "eslint . --ignore-pattern generated/",
|
|
12
|
-
"prettier:write": "prettier \"**/*.ts\" --write",
|
|
12
|
+
"prettier:write": "prettier \"**/*.ts\" \"*.md\" --write",
|
|
13
13
|
"generate:client": "openapi-generator-cli generate -i openapi.json -g typescript -o generated/openapi --additional-properties=npmName=restClient,supportsES6=true,withInterfaces=true",
|
|
14
14
|
"test": "mocha"
|
|
15
15
|
},
|
|
@@ -24,9 +24,18 @@
|
|
|
24
24
|
"eslint": "^9.20.1",
|
|
25
25
|
"mocha": "^11.1.0",
|
|
26
26
|
"prettier": "^3.5.1",
|
|
27
|
+
"puppeteer": "^24.5.0",
|
|
27
28
|
"rimraf": "^6.0.1",
|
|
28
29
|
"tsx": "^4.19.3",
|
|
29
30
|
"typescript": "^5.7.3",
|
|
30
31
|
"typescript-eslint": "^8.24.1"
|
|
32
|
+
},
|
|
33
|
+
"peerDependencies": {
|
|
34
|
+
"puppeteer": ">=22"
|
|
35
|
+
},
|
|
36
|
+
"peerDependenciesMeta": {
|
|
37
|
+
"puppeteer": {
|
|
38
|
+
"optional": true
|
|
39
|
+
}
|
|
31
40
|
}
|
|
32
41
|
}
|