@sp-api-sdk/vendor-direct-fulfillment-shipping-api-v1 1.8.2 → 1.10.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/README.md CHANGED
@@ -64,6 +64,29 @@ const client = new VendorDirectFulfillmentShippingApiClient({
64
64
 
65
65
  The rate limits used for each route are specified in the [API documentation](https://developer-docs.amazon.com/sp-api/docs).
66
66
 
67
+ ## Logging
68
+
69
+ You can enable logging for both SP-API requests and responses by configuring the `logging.request` and `logging.response` properties.
70
+
71
+ ```javascript
72
+ const client = new VendorDirectFulfillmentShippingApiClient({
73
+ auth,
74
+ region: 'eu',
75
+ logging: {
76
+ request: {
77
+ logger: console.debug
78
+ },
79
+ response: {
80
+ logger: console.debug
81
+ }
82
+ },
83
+ })
84
+ ```
85
+
86
+ Specifying `true` will use the default options, specifying an object will allow you to override the default options.
87
+ This uses [axios-logger](https://github.com/hg-pyun/axios-logger) under the hood.
88
+
89
+
67
90
  ## License
68
91
 
69
92
  MIT
package/dist/cjs/index.js CHANGED
@@ -2,5 +2,4 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
4
  tslib_1.__exportStar(require("./src/client"), exports);
5
- tslib_1.__exportStar(require("./src/error"), exports);
6
5
  tslib_1.__exportStar(require("./src/api-model/models"), exports);
@@ -27,6 +27,90 @@ const base_1 = require("../base");
27
27
  */
28
28
  const VendorShippingApiAxiosParamCreator = function (configuration) {
29
29
  return {
30
+ /**
31
+ * Returns a customer invoice based on the purchaseOrderNumber that you specify. **Usage Plans:** | Plan type | Rate (requests per second) | Burst | | ---- | ---- | ---- | |Default| 10 | 10 | |Selling partner specific| Variable | Variable | The x-amzn-RateLimit-Limit response header returns the usage plan rate limits that were applied to the requested operation. Rate limits for some selling partners will vary from the default rate and burst shown in the table above. For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation.
32
+ * @param {string} purchaseOrderNumber Purchase order number of the shipment for which to return the invoice.
33
+ * @param {*} [options] Override http request option.
34
+ * @throws {RequiredError}
35
+ */
36
+ getCustomerInvoice: async (purchaseOrderNumber, options = {}) => {
37
+ // verify required parameter 'purchaseOrderNumber' is not null or undefined
38
+ (0, common_1.assertParamExists)('getCustomerInvoice', 'purchaseOrderNumber', purchaseOrderNumber);
39
+ const localVarPath = `/vendor/directFulfillment/shipping/v1/customerInvoices/{purchaseOrderNumber}`
40
+ .replace(`{${"purchaseOrderNumber"}}`, encodeURIComponent(String(purchaseOrderNumber)));
41
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
42
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
43
+ let baseOptions;
44
+ if (configuration) {
45
+ baseOptions = configuration.baseOptions;
46
+ }
47
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
48
+ const localVarHeaderParameter = {};
49
+ const localVarQueryParameter = {};
50
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter, options.query);
51
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
52
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
53
+ return {
54
+ url: (0, common_1.toPathString)(localVarUrlObj),
55
+ options: localVarRequestOptions,
56
+ };
57
+ },
58
+ /**
59
+ * Returns a list of customer invoices created during a time frame that you specify. You define the time frame using the createdAfter and createdBefore parameters. You must use both of these parameters. The date range to search must be no more than 7 days. **Usage Plans:** | Plan type | Rate (requests per second) | Burst | | ---- | ---- | ---- | |Default| 10 | 10 | |Selling partner specific| Variable | Variable | The x-amzn-RateLimit-Limit response header returns the usage plan rate limits that were applied to the requested operation. Rate limits for some selling partners will vary from the default rate and burst shown in the table above. For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation.
60
+ * @param {string} createdAfter Orders that became available after this date and time will be included in the result. Must be in ISO-8601 date/time format.
61
+ * @param {string} createdBefore Orders that became available before this date and time will be included in the result. Must be in ISO-8601 date/time format.
62
+ * @param {string} [shipFromPartyId] The vendor warehouseId for order fulfillment. If not specified, the result will contain orders for all warehouses.
63
+ * @param {number} [limit] The limit to the number of records returned
64
+ * @param {'ASC' | 'DESC'} [sortOrder] Sort ASC or DESC by order creation date.
65
+ * @param {string} [nextToken] Used for pagination when there are more orders than the specified result size limit. The token value is returned in the previous API call.
66
+ * @param {*} [options] Override http request option.
67
+ * @throws {RequiredError}
68
+ */
69
+ getCustomerInvoices: async (createdAfter, createdBefore, shipFromPartyId, limit, sortOrder, nextToken, options = {}) => {
70
+ // verify required parameter 'createdAfter' is not null or undefined
71
+ (0, common_1.assertParamExists)('getCustomerInvoices', 'createdAfter', createdAfter);
72
+ // verify required parameter 'createdBefore' is not null or undefined
73
+ (0, common_1.assertParamExists)('getCustomerInvoices', 'createdBefore', createdBefore);
74
+ const localVarPath = `/vendor/directFulfillment/shipping/v1/customerInvoices`;
75
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
76
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
77
+ let baseOptions;
78
+ if (configuration) {
79
+ baseOptions = configuration.baseOptions;
80
+ }
81
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
82
+ const localVarHeaderParameter = {};
83
+ const localVarQueryParameter = {};
84
+ if (shipFromPartyId !== undefined) {
85
+ localVarQueryParameter['shipFromPartyId'] = shipFromPartyId;
86
+ }
87
+ if (limit !== undefined) {
88
+ localVarQueryParameter['limit'] = limit;
89
+ }
90
+ if (createdAfter !== undefined) {
91
+ localVarQueryParameter['createdAfter'] = (createdAfter instanceof Date) ?
92
+ createdAfter.toISOString() :
93
+ createdAfter;
94
+ }
95
+ if (createdBefore !== undefined) {
96
+ localVarQueryParameter['createdBefore'] = (createdBefore instanceof Date) ?
97
+ createdBefore.toISOString() :
98
+ createdBefore;
99
+ }
100
+ if (sortOrder !== undefined) {
101
+ localVarQueryParameter['sortOrder'] = sortOrder;
102
+ }
103
+ if (nextToken !== undefined) {
104
+ localVarQueryParameter['nextToken'] = nextToken;
105
+ }
106
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter, options.query);
107
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
108
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
109
+ return {
110
+ url: (0, common_1.toPathString)(localVarUrlObj),
111
+ options: localVarRequestOptions,
112
+ };
113
+ },
30
114
  /**
31
115
  * Returns a packing slip based on the purchaseOrderNumber that you specify. **Usage Plans:** | Plan type | Rate (requests per second) | Burst | | ---- | ---- | ---- | |Default| 10 | 10 | |Selling partner specific| Variable | Variable | The x-amzn-RateLimit-Limit response header returns the usage plan rate limits that were applied to the requested operation. Rate limits for some selling partners will vary from the default rate and burst shown in the table above. For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation.
32
116
  * @param {string} purchaseOrderNumber The purchaseOrderNumber for the packing slip you want.
@@ -111,6 +195,90 @@ const VendorShippingApiAxiosParamCreator = function (configuration) {
111
195
  options: localVarRequestOptions,
112
196
  };
113
197
  },
198
+ /**
199
+ * Returns a shipping label for the purchaseOrderNumber that you specify. **Usage Plans:** | Plan type | Rate (requests per second) | Burst | | ---- | ---- | ---- | |Default| 10 | 10 | |Selling partner specific| Variable | Variable | The x-amzn-RateLimit-Limit response header returns the usage plan rate limits that were applied to the requested operation. Rate limits for some selling partners will vary from the default rate and burst shown in the table above. For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation.
200
+ * @param {string} purchaseOrderNumber The purchase order number for which you want to return the shipping label. It should be the same purchaseOrderNumber as received in the order.
201
+ * @param {*} [options] Override http request option.
202
+ * @throws {RequiredError}
203
+ */
204
+ getShippingLabel: async (purchaseOrderNumber, options = {}) => {
205
+ // verify required parameter 'purchaseOrderNumber' is not null or undefined
206
+ (0, common_1.assertParamExists)('getShippingLabel', 'purchaseOrderNumber', purchaseOrderNumber);
207
+ const localVarPath = `/vendor/directFulfillment/shipping/v1/shippingLabels/{purchaseOrderNumber}`
208
+ .replace(`{${"purchaseOrderNumber"}}`, encodeURIComponent(String(purchaseOrderNumber)));
209
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
210
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
211
+ let baseOptions;
212
+ if (configuration) {
213
+ baseOptions = configuration.baseOptions;
214
+ }
215
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
216
+ const localVarHeaderParameter = {};
217
+ const localVarQueryParameter = {};
218
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter, options.query);
219
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
220
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
221
+ return {
222
+ url: (0, common_1.toPathString)(localVarUrlObj),
223
+ options: localVarRequestOptions,
224
+ };
225
+ },
226
+ /**
227
+ * Returns a list of shipping labels created during the time frame that you specify. You define that time frame using the createdAfter and createdBefore parameters. You must use both of these parameters. The date range to search must not be more than 7 days. **Usage Plans:** | Plan type | Rate (requests per second) | Burst | | ---- | ---- | ---- | |Default| 10 | 10 | |Selling partner specific| Variable | Variable | The x-amzn-RateLimit-Limit response header returns the usage plan rate limits that were applied to the requested operation. Rate limits for some selling partners will vary from the default rate and burst shown in the table above. For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation.
228
+ * @param {string} createdAfter Shipping labels that became available after this date and time will be included in the result. Must be in ISO-8601 date/time format.
229
+ * @param {string} createdBefore Shipping labels that became available before this date and time will be included in the result. Must be in ISO-8601 date/time format.
230
+ * @param {string} [shipFromPartyId] The vendor warehouseId for order fulfillment. If not specified, the result will contain orders for all warehouses.
231
+ * @param {number} [limit] The limit to the number of records returned.
232
+ * @param {'ASC' | 'DESC'} [sortOrder] Sort ASC or DESC by order creation date.
233
+ * @param {string} [nextToken] Used for pagination when there are more ship labels than the specified result size limit. The token value is returned in the previous API call.
234
+ * @param {*} [options] Override http request option.
235
+ * @throws {RequiredError}
236
+ */
237
+ getShippingLabels: async (createdAfter, createdBefore, shipFromPartyId, limit, sortOrder, nextToken, options = {}) => {
238
+ // verify required parameter 'createdAfter' is not null or undefined
239
+ (0, common_1.assertParamExists)('getShippingLabels', 'createdAfter', createdAfter);
240
+ // verify required parameter 'createdBefore' is not null or undefined
241
+ (0, common_1.assertParamExists)('getShippingLabels', 'createdBefore', createdBefore);
242
+ const localVarPath = `/vendor/directFulfillment/shipping/v1/shippingLabels`;
243
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
244
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
245
+ let baseOptions;
246
+ if (configuration) {
247
+ baseOptions = configuration.baseOptions;
248
+ }
249
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
250
+ const localVarHeaderParameter = {};
251
+ const localVarQueryParameter = {};
252
+ if (shipFromPartyId !== undefined) {
253
+ localVarQueryParameter['shipFromPartyId'] = shipFromPartyId;
254
+ }
255
+ if (limit !== undefined) {
256
+ localVarQueryParameter['limit'] = limit;
257
+ }
258
+ if (createdAfter !== undefined) {
259
+ localVarQueryParameter['createdAfter'] = (createdAfter instanceof Date) ?
260
+ createdAfter.toISOString() :
261
+ createdAfter;
262
+ }
263
+ if (createdBefore !== undefined) {
264
+ localVarQueryParameter['createdBefore'] = (createdBefore instanceof Date) ?
265
+ createdBefore.toISOString() :
266
+ createdBefore;
267
+ }
268
+ if (sortOrder !== undefined) {
269
+ localVarQueryParameter['sortOrder'] = sortOrder;
270
+ }
271
+ if (nextToken !== undefined) {
272
+ localVarQueryParameter['nextToken'] = nextToken;
273
+ }
274
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter, options.query);
275
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
276
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
277
+ return {
278
+ url: (0, common_1.toPathString)(localVarUrlObj),
279
+ options: localVarRequestOptions,
280
+ };
281
+ },
114
282
  /**
115
283
  * Submits one or more shipment confirmations for vendor orders. **Usage Plans:** | Plan type | Rate (requests per second) | Burst | | ---- | ---- | ---- | |Default| 10 | 10 | |Selling partner specific| Variable | Variable | The x-amzn-RateLimit-Limit response header returns the usage plan rate limits that were applied to the requested operation. Rate limits for some selling partners will vary from the default rate and burst shown in the table above. For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation.
116
284
  * @param {SubmitShipmentConfirmationsRequest} body
@@ -169,6 +337,35 @@ const VendorShippingApiAxiosParamCreator = function (configuration) {
169
337
  options: localVarRequestOptions,
170
338
  };
171
339
  },
340
+ /**
341
+ * Creates a shipping label for a purchase order and returns a transactionId for reference. **Usage Plans:** | Plan type | Rate (requests per second) | Burst | | ---- | ---- | ---- | |Default| 10 | 10 | |Selling partner specific| Variable | Variable | The x-amzn-RateLimit-Limit response header returns the usage plan rate limits that were applied to the requested operation. Rate limits for some selling partners will vary from the default rate and burst shown in the table above. For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation.
342
+ * @param {SubmitShippingLabelsRequest} body
343
+ * @param {*} [options] Override http request option.
344
+ * @throws {RequiredError}
345
+ */
346
+ submitShippingLabelRequest: async (body, options = {}) => {
347
+ // verify required parameter 'body' is not null or undefined
348
+ (0, common_1.assertParamExists)('submitShippingLabelRequest', 'body', body);
349
+ const localVarPath = `/vendor/directFulfillment/shipping/v1/shippingLabels`;
350
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
351
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
352
+ let baseOptions;
353
+ if (configuration) {
354
+ baseOptions = configuration.baseOptions;
355
+ }
356
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options };
357
+ const localVarHeaderParameter = {};
358
+ const localVarQueryParameter = {};
359
+ localVarHeaderParameter['Content-Type'] = 'application/json';
360
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter, options.query);
361
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
362
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
363
+ localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(body, localVarRequestOptions, configuration);
364
+ return {
365
+ url: (0, common_1.toPathString)(localVarUrlObj),
366
+ options: localVarRequestOptions,
367
+ };
368
+ },
172
369
  };
173
370
  };
174
371
  exports.VendorShippingApiAxiosParamCreator = VendorShippingApiAxiosParamCreator;
@@ -179,6 +376,31 @@ exports.VendorShippingApiAxiosParamCreator = VendorShippingApiAxiosParamCreator;
179
376
  const VendorShippingApiFp = function (configuration) {
180
377
  const localVarAxiosParamCreator = (0, exports.VendorShippingApiAxiosParamCreator)(configuration);
181
378
  return {
379
+ /**
380
+ * Returns a customer invoice based on the purchaseOrderNumber that you specify. **Usage Plans:** | Plan type | Rate (requests per second) | Burst | | ---- | ---- | ---- | |Default| 10 | 10 | |Selling partner specific| Variable | Variable | The x-amzn-RateLimit-Limit response header returns the usage plan rate limits that were applied to the requested operation. Rate limits for some selling partners will vary from the default rate and burst shown in the table above. For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation.
381
+ * @param {string} purchaseOrderNumber Purchase order number of the shipment for which to return the invoice.
382
+ * @param {*} [options] Override http request option.
383
+ * @throws {RequiredError}
384
+ */
385
+ async getCustomerInvoice(purchaseOrderNumber, options) {
386
+ const localVarAxiosArgs = await localVarAxiosParamCreator.getCustomerInvoice(purchaseOrderNumber, options);
387
+ return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
388
+ },
389
+ /**
390
+ * Returns a list of customer invoices created during a time frame that you specify. You define the time frame using the createdAfter and createdBefore parameters. You must use both of these parameters. The date range to search must be no more than 7 days. **Usage Plans:** | Plan type | Rate (requests per second) | Burst | | ---- | ---- | ---- | |Default| 10 | 10 | |Selling partner specific| Variable | Variable | The x-amzn-RateLimit-Limit response header returns the usage plan rate limits that were applied to the requested operation. Rate limits for some selling partners will vary from the default rate and burst shown in the table above. For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation.
391
+ * @param {string} createdAfter Orders that became available after this date and time will be included in the result. Must be in ISO-8601 date/time format.
392
+ * @param {string} createdBefore Orders that became available before this date and time will be included in the result. Must be in ISO-8601 date/time format.
393
+ * @param {string} [shipFromPartyId] The vendor warehouseId for order fulfillment. If not specified, the result will contain orders for all warehouses.
394
+ * @param {number} [limit] The limit to the number of records returned
395
+ * @param {'ASC' | 'DESC'} [sortOrder] Sort ASC or DESC by order creation date.
396
+ * @param {string} [nextToken] Used for pagination when there are more orders than the specified result size limit. The token value is returned in the previous API call.
397
+ * @param {*} [options] Override http request option.
398
+ * @throws {RequiredError}
399
+ */
400
+ async getCustomerInvoices(createdAfter, createdBefore, shipFromPartyId, limit, sortOrder, nextToken, options) {
401
+ const localVarAxiosArgs = await localVarAxiosParamCreator.getCustomerInvoices(createdAfter, createdBefore, shipFromPartyId, limit, sortOrder, nextToken, options);
402
+ return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
403
+ },
182
404
  /**
183
405
  * Returns a packing slip based on the purchaseOrderNumber that you specify. **Usage Plans:** | Plan type | Rate (requests per second) | Burst | | ---- | ---- | ---- | |Default| 10 | 10 | |Selling partner specific| Variable | Variable | The x-amzn-RateLimit-Limit response header returns the usage plan rate limits that were applied to the requested operation. Rate limits for some selling partners will vary from the default rate and burst shown in the table above. For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation.
184
406
  * @param {string} purchaseOrderNumber The purchaseOrderNumber for the packing slip you want.
@@ -204,6 +426,31 @@ const VendorShippingApiFp = function (configuration) {
204
426
  const localVarAxiosArgs = await localVarAxiosParamCreator.getPackingSlips(createdAfter, createdBefore, shipFromPartyId, limit, sortOrder, nextToken, options);
205
427
  return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
206
428
  },
429
+ /**
430
+ * Returns a shipping label for the purchaseOrderNumber that you specify. **Usage Plans:** | Plan type | Rate (requests per second) | Burst | | ---- | ---- | ---- | |Default| 10 | 10 | |Selling partner specific| Variable | Variable | The x-amzn-RateLimit-Limit response header returns the usage plan rate limits that were applied to the requested operation. Rate limits for some selling partners will vary from the default rate and burst shown in the table above. For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation.
431
+ * @param {string} purchaseOrderNumber The purchase order number for which you want to return the shipping label. It should be the same purchaseOrderNumber as received in the order.
432
+ * @param {*} [options] Override http request option.
433
+ * @throws {RequiredError}
434
+ */
435
+ async getShippingLabel(purchaseOrderNumber, options) {
436
+ const localVarAxiosArgs = await localVarAxiosParamCreator.getShippingLabel(purchaseOrderNumber, options);
437
+ return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
438
+ },
439
+ /**
440
+ * Returns a list of shipping labels created during the time frame that you specify. You define that time frame using the createdAfter and createdBefore parameters. You must use both of these parameters. The date range to search must not be more than 7 days. **Usage Plans:** | Plan type | Rate (requests per second) | Burst | | ---- | ---- | ---- | |Default| 10 | 10 | |Selling partner specific| Variable | Variable | The x-amzn-RateLimit-Limit response header returns the usage plan rate limits that were applied to the requested operation. Rate limits for some selling partners will vary from the default rate and burst shown in the table above. For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation.
441
+ * @param {string} createdAfter Shipping labels that became available after this date and time will be included in the result. Must be in ISO-8601 date/time format.
442
+ * @param {string} createdBefore Shipping labels that became available before this date and time will be included in the result. Must be in ISO-8601 date/time format.
443
+ * @param {string} [shipFromPartyId] The vendor warehouseId for order fulfillment. If not specified, the result will contain orders for all warehouses.
444
+ * @param {number} [limit] The limit to the number of records returned.
445
+ * @param {'ASC' | 'DESC'} [sortOrder] Sort ASC or DESC by order creation date.
446
+ * @param {string} [nextToken] Used for pagination when there are more ship labels than the specified result size limit. The token value is returned in the previous API call.
447
+ * @param {*} [options] Override http request option.
448
+ * @throws {RequiredError}
449
+ */
450
+ async getShippingLabels(createdAfter, createdBefore, shipFromPartyId, limit, sortOrder, nextToken, options) {
451
+ const localVarAxiosArgs = await localVarAxiosParamCreator.getShippingLabels(createdAfter, createdBefore, shipFromPartyId, limit, sortOrder, nextToken, options);
452
+ return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
453
+ },
207
454
  /**
208
455
  * Submits one or more shipment confirmations for vendor orders. **Usage Plans:** | Plan type | Rate (requests per second) | Burst | | ---- | ---- | ---- | |Default| 10 | 10 | |Selling partner specific| Variable | Variable | The x-amzn-RateLimit-Limit response header returns the usage plan rate limits that were applied to the requested operation. Rate limits for some selling partners will vary from the default rate and burst shown in the table above. For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation.
209
456
  * @param {SubmitShipmentConfirmationsRequest} body
@@ -224,6 +471,16 @@ const VendorShippingApiFp = function (configuration) {
224
471
  const localVarAxiosArgs = await localVarAxiosParamCreator.submitShipmentStatusUpdates(body, options);
225
472
  return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
226
473
  },
474
+ /**
475
+ * Creates a shipping label for a purchase order and returns a transactionId for reference. **Usage Plans:** | Plan type | Rate (requests per second) | Burst | | ---- | ---- | ---- | |Default| 10 | 10 | |Selling partner specific| Variable | Variable | The x-amzn-RateLimit-Limit response header returns the usage plan rate limits that were applied to the requested operation. Rate limits for some selling partners will vary from the default rate and burst shown in the table above. For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation.
476
+ * @param {SubmitShippingLabelsRequest} body
477
+ * @param {*} [options] Override http request option.
478
+ * @throws {RequiredError}
479
+ */
480
+ async submitShippingLabelRequest(body, options) {
481
+ const localVarAxiosArgs = await localVarAxiosParamCreator.submitShippingLabelRequest(body, options);
482
+ return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
483
+ },
227
484
  };
228
485
  };
229
486
  exports.VendorShippingApiFp = VendorShippingApiFp;
@@ -234,6 +491,29 @@ exports.VendorShippingApiFp = VendorShippingApiFp;
234
491
  const VendorShippingApiFactory = function (configuration, basePath, axios) {
235
492
  const localVarFp = (0, exports.VendorShippingApiFp)(configuration);
236
493
  return {
494
+ /**
495
+ * Returns a customer invoice based on the purchaseOrderNumber that you specify. **Usage Plans:** | Plan type | Rate (requests per second) | Burst | | ---- | ---- | ---- | |Default| 10 | 10 | |Selling partner specific| Variable | Variable | The x-amzn-RateLimit-Limit response header returns the usage plan rate limits that were applied to the requested operation. Rate limits for some selling partners will vary from the default rate and burst shown in the table above. For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation.
496
+ * @param {string} purchaseOrderNumber Purchase order number of the shipment for which to return the invoice.
497
+ * @param {*} [options] Override http request option.
498
+ * @throws {RequiredError}
499
+ */
500
+ getCustomerInvoice(purchaseOrderNumber, options) {
501
+ return localVarFp.getCustomerInvoice(purchaseOrderNumber, options).then((request) => request(axios, basePath));
502
+ },
503
+ /**
504
+ * Returns a list of customer invoices created during a time frame that you specify. You define the time frame using the createdAfter and createdBefore parameters. You must use both of these parameters. The date range to search must be no more than 7 days. **Usage Plans:** | Plan type | Rate (requests per second) | Burst | | ---- | ---- | ---- | |Default| 10 | 10 | |Selling partner specific| Variable | Variable | The x-amzn-RateLimit-Limit response header returns the usage plan rate limits that were applied to the requested operation. Rate limits for some selling partners will vary from the default rate and burst shown in the table above. For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation.
505
+ * @param {string} createdAfter Orders that became available after this date and time will be included in the result. Must be in ISO-8601 date/time format.
506
+ * @param {string} createdBefore Orders that became available before this date and time will be included in the result. Must be in ISO-8601 date/time format.
507
+ * @param {string} [shipFromPartyId] The vendor warehouseId for order fulfillment. If not specified, the result will contain orders for all warehouses.
508
+ * @param {number} [limit] The limit to the number of records returned
509
+ * @param {'ASC' | 'DESC'} [sortOrder] Sort ASC or DESC by order creation date.
510
+ * @param {string} [nextToken] Used for pagination when there are more orders than the specified result size limit. The token value is returned in the previous API call.
511
+ * @param {*} [options] Override http request option.
512
+ * @throws {RequiredError}
513
+ */
514
+ getCustomerInvoices(createdAfter, createdBefore, shipFromPartyId, limit, sortOrder, nextToken, options) {
515
+ return localVarFp.getCustomerInvoices(createdAfter, createdBefore, shipFromPartyId, limit, sortOrder, nextToken, options).then((request) => request(axios, basePath));
516
+ },
237
517
  /**
238
518
  * Returns a packing slip based on the purchaseOrderNumber that you specify. **Usage Plans:** | Plan type | Rate (requests per second) | Burst | | ---- | ---- | ---- | |Default| 10 | 10 | |Selling partner specific| Variable | Variable | The x-amzn-RateLimit-Limit response header returns the usage plan rate limits that were applied to the requested operation. Rate limits for some selling partners will vary from the default rate and burst shown in the table above. For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation.
239
519
  * @param {string} purchaseOrderNumber The purchaseOrderNumber for the packing slip you want.
@@ -257,6 +537,29 @@ const VendorShippingApiFactory = function (configuration, basePath, axios) {
257
537
  getPackingSlips(createdAfter, createdBefore, shipFromPartyId, limit, sortOrder, nextToken, options) {
258
538
  return localVarFp.getPackingSlips(createdAfter, createdBefore, shipFromPartyId, limit, sortOrder, nextToken, options).then((request) => request(axios, basePath));
259
539
  },
540
+ /**
541
+ * Returns a shipping label for the purchaseOrderNumber that you specify. **Usage Plans:** | Plan type | Rate (requests per second) | Burst | | ---- | ---- | ---- | |Default| 10 | 10 | |Selling partner specific| Variable | Variable | The x-amzn-RateLimit-Limit response header returns the usage plan rate limits that were applied to the requested operation. Rate limits for some selling partners will vary from the default rate and burst shown in the table above. For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation.
542
+ * @param {string} purchaseOrderNumber The purchase order number for which you want to return the shipping label. It should be the same purchaseOrderNumber as received in the order.
543
+ * @param {*} [options] Override http request option.
544
+ * @throws {RequiredError}
545
+ */
546
+ getShippingLabel(purchaseOrderNumber, options) {
547
+ return localVarFp.getShippingLabel(purchaseOrderNumber, options).then((request) => request(axios, basePath));
548
+ },
549
+ /**
550
+ * Returns a list of shipping labels created during the time frame that you specify. You define that time frame using the createdAfter and createdBefore parameters. You must use both of these parameters. The date range to search must not be more than 7 days. **Usage Plans:** | Plan type | Rate (requests per second) | Burst | | ---- | ---- | ---- | |Default| 10 | 10 | |Selling partner specific| Variable | Variable | The x-amzn-RateLimit-Limit response header returns the usage plan rate limits that were applied to the requested operation. Rate limits for some selling partners will vary from the default rate and burst shown in the table above. For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation.
551
+ * @param {string} createdAfter Shipping labels that became available after this date and time will be included in the result. Must be in ISO-8601 date/time format.
552
+ * @param {string} createdBefore Shipping labels that became available before this date and time will be included in the result. Must be in ISO-8601 date/time format.
553
+ * @param {string} [shipFromPartyId] The vendor warehouseId for order fulfillment. If not specified, the result will contain orders for all warehouses.
554
+ * @param {number} [limit] The limit to the number of records returned.
555
+ * @param {'ASC' | 'DESC'} [sortOrder] Sort ASC or DESC by order creation date.
556
+ * @param {string} [nextToken] Used for pagination when there are more ship labels than the specified result size limit. The token value is returned in the previous API call.
557
+ * @param {*} [options] Override http request option.
558
+ * @throws {RequiredError}
559
+ */
560
+ getShippingLabels(createdAfter, createdBefore, shipFromPartyId, limit, sortOrder, nextToken, options) {
561
+ return localVarFp.getShippingLabels(createdAfter, createdBefore, shipFromPartyId, limit, sortOrder, nextToken, options).then((request) => request(axios, basePath));
562
+ },
260
563
  /**
261
564
  * Submits one or more shipment confirmations for vendor orders. **Usage Plans:** | Plan type | Rate (requests per second) | Burst | | ---- | ---- | ---- | |Default| 10 | 10 | |Selling partner specific| Variable | Variable | The x-amzn-RateLimit-Limit response header returns the usage plan rate limits that were applied to the requested operation. Rate limits for some selling partners will vary from the default rate and burst shown in the table above. For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation.
262
565
  * @param {SubmitShipmentConfirmationsRequest} body
@@ -275,6 +578,15 @@ const VendorShippingApiFactory = function (configuration, basePath, axios) {
275
578
  submitShipmentStatusUpdates(body, options) {
276
579
  return localVarFp.submitShipmentStatusUpdates(body, options).then((request) => request(axios, basePath));
277
580
  },
581
+ /**
582
+ * Creates a shipping label for a purchase order and returns a transactionId for reference. **Usage Plans:** | Plan type | Rate (requests per second) | Burst | | ---- | ---- | ---- | |Default| 10 | 10 | |Selling partner specific| Variable | Variable | The x-amzn-RateLimit-Limit response header returns the usage plan rate limits that were applied to the requested operation. Rate limits for some selling partners will vary from the default rate and burst shown in the table above. For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation.
583
+ * @param {SubmitShippingLabelsRequest} body
584
+ * @param {*} [options] Override http request option.
585
+ * @throws {RequiredError}
586
+ */
587
+ submitShippingLabelRequest(body, options) {
588
+ return localVarFp.submitShippingLabelRequest(body, options).then((request) => request(axios, basePath));
589
+ },
278
590
  };
279
591
  };
280
592
  exports.VendorShippingApiFactory = VendorShippingApiFactory;
@@ -285,6 +597,26 @@ exports.VendorShippingApiFactory = VendorShippingApiFactory;
285
597
  * @extends {BaseAPI}
286
598
  */
287
599
  class VendorShippingApi extends base_1.BaseAPI {
600
+ /**
601
+ * Returns a customer invoice based on the purchaseOrderNumber that you specify. **Usage Plans:** | Plan type | Rate (requests per second) | Burst | | ---- | ---- | ---- | |Default| 10 | 10 | |Selling partner specific| Variable | Variable | The x-amzn-RateLimit-Limit response header returns the usage plan rate limits that were applied to the requested operation. Rate limits for some selling partners will vary from the default rate and burst shown in the table above. For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation.
602
+ * @param {VendorShippingApiGetCustomerInvoiceRequest} requestParameters Request parameters.
603
+ * @param {*} [options] Override http request option.
604
+ * @throws {RequiredError}
605
+ * @memberof VendorShippingApi
606
+ */
607
+ getCustomerInvoice(requestParameters, options) {
608
+ return (0, exports.VendorShippingApiFp)(this.configuration).getCustomerInvoice(requestParameters.purchaseOrderNumber, options).then((request) => request(this.axios, this.basePath));
609
+ }
610
+ /**
611
+ * Returns a list of customer invoices created during a time frame that you specify. You define the time frame using the createdAfter and createdBefore parameters. You must use both of these parameters. The date range to search must be no more than 7 days. **Usage Plans:** | Plan type | Rate (requests per second) | Burst | | ---- | ---- | ---- | |Default| 10 | 10 | |Selling partner specific| Variable | Variable | The x-amzn-RateLimit-Limit response header returns the usage plan rate limits that were applied to the requested operation. Rate limits for some selling partners will vary from the default rate and burst shown in the table above. For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation.
612
+ * @param {VendorShippingApiGetCustomerInvoicesRequest} requestParameters Request parameters.
613
+ * @param {*} [options] Override http request option.
614
+ * @throws {RequiredError}
615
+ * @memberof VendorShippingApi
616
+ */
617
+ getCustomerInvoices(requestParameters, options) {
618
+ return (0, exports.VendorShippingApiFp)(this.configuration).getCustomerInvoices(requestParameters.createdAfter, requestParameters.createdBefore, requestParameters.shipFromPartyId, requestParameters.limit, requestParameters.sortOrder, requestParameters.nextToken, options).then((request) => request(this.axios, this.basePath));
619
+ }
288
620
  /**
289
621
  * Returns a packing slip based on the purchaseOrderNumber that you specify. **Usage Plans:** | Plan type | Rate (requests per second) | Burst | | ---- | ---- | ---- | |Default| 10 | 10 | |Selling partner specific| Variable | Variable | The x-amzn-RateLimit-Limit response header returns the usage plan rate limits that were applied to the requested operation. Rate limits for some selling partners will vary from the default rate and burst shown in the table above. For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation.
290
622
  * @param {VendorShippingApiGetPackingSlipRequest} requestParameters Request parameters.
@@ -305,6 +637,26 @@ class VendorShippingApi extends base_1.BaseAPI {
305
637
  getPackingSlips(requestParameters, options) {
306
638
  return (0, exports.VendorShippingApiFp)(this.configuration).getPackingSlips(requestParameters.createdAfter, requestParameters.createdBefore, requestParameters.shipFromPartyId, requestParameters.limit, requestParameters.sortOrder, requestParameters.nextToken, options).then((request) => request(this.axios, this.basePath));
307
639
  }
640
+ /**
641
+ * Returns a shipping label for the purchaseOrderNumber that you specify. **Usage Plans:** | Plan type | Rate (requests per second) | Burst | | ---- | ---- | ---- | |Default| 10 | 10 | |Selling partner specific| Variable | Variable | The x-amzn-RateLimit-Limit response header returns the usage plan rate limits that were applied to the requested operation. Rate limits for some selling partners will vary from the default rate and burst shown in the table above. For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation.
642
+ * @param {VendorShippingApiGetShippingLabelRequest} requestParameters Request parameters.
643
+ * @param {*} [options] Override http request option.
644
+ * @throws {RequiredError}
645
+ * @memberof VendorShippingApi
646
+ */
647
+ getShippingLabel(requestParameters, options) {
648
+ return (0, exports.VendorShippingApiFp)(this.configuration).getShippingLabel(requestParameters.purchaseOrderNumber, options).then((request) => request(this.axios, this.basePath));
649
+ }
650
+ /**
651
+ * Returns a list of shipping labels created during the time frame that you specify. You define that time frame using the createdAfter and createdBefore parameters. You must use both of these parameters. The date range to search must not be more than 7 days. **Usage Plans:** | Plan type | Rate (requests per second) | Burst | | ---- | ---- | ---- | |Default| 10 | 10 | |Selling partner specific| Variable | Variable | The x-amzn-RateLimit-Limit response header returns the usage plan rate limits that were applied to the requested operation. Rate limits for some selling partners will vary from the default rate and burst shown in the table above. For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation.
652
+ * @param {VendorShippingApiGetShippingLabelsRequest} requestParameters Request parameters.
653
+ * @param {*} [options] Override http request option.
654
+ * @throws {RequiredError}
655
+ * @memberof VendorShippingApi
656
+ */
657
+ getShippingLabels(requestParameters, options) {
658
+ return (0, exports.VendorShippingApiFp)(this.configuration).getShippingLabels(requestParameters.createdAfter, requestParameters.createdBefore, requestParameters.shipFromPartyId, requestParameters.limit, requestParameters.sortOrder, requestParameters.nextToken, options).then((request) => request(this.axios, this.basePath));
659
+ }
308
660
  /**
309
661
  * Submits one or more shipment confirmations for vendor orders. **Usage Plans:** | Plan type | Rate (requests per second) | Burst | | ---- | ---- | ---- | |Default| 10 | 10 | |Selling partner specific| Variable | Variable | The x-amzn-RateLimit-Limit response header returns the usage plan rate limits that were applied to the requested operation. Rate limits for some selling partners will vary from the default rate and burst shown in the table above. For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation.
310
662
  * @param {VendorShippingApiSubmitShipmentConfirmationsRequest} requestParameters Request parameters.
@@ -325,5 +677,15 @@ class VendorShippingApi extends base_1.BaseAPI {
325
677
  submitShipmentStatusUpdates(requestParameters, options) {
326
678
  return (0, exports.VendorShippingApiFp)(this.configuration).submitShipmentStatusUpdates(requestParameters.body, options).then((request) => request(this.axios, this.basePath));
327
679
  }
680
+ /**
681
+ * Creates a shipping label for a purchase order and returns a transactionId for reference. **Usage Plans:** | Plan type | Rate (requests per second) | Burst | | ---- | ---- | ---- | |Default| 10 | 10 | |Selling partner specific| Variable | Variable | The x-amzn-RateLimit-Limit response header returns the usage plan rate limits that were applied to the requested operation. Rate limits for some selling partners will vary from the default rate and burst shown in the table above. For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation.
682
+ * @param {VendorShippingApiSubmitShippingLabelRequestRequest} requestParameters Request parameters.
683
+ * @param {*} [options] Override http request option.
684
+ * @throws {RequiredError}
685
+ * @memberof VendorShippingApi
686
+ */
687
+ submitShippingLabelRequest(requestParameters, options) {
688
+ return (0, exports.VendorShippingApiFp)(this.configuration).submitShippingLabelRequest(requestParameters.body, options).then((request) => request(this.axios, this.basePath));
689
+ }
328
690
  }
329
691
  exports.VendorShippingApi = VendorShippingApi;
@@ -14,6 +14,4 @@
14
14
  */
15
15
  Object.defineProperty(exports, "__esModule", { value: true });
16
16
  const tslib_1 = require("tslib");
17
- tslib_1.__exportStar(require("./api/customer-invoices-api"), exports);
18
17
  tslib_1.__exportStar(require("./api/vendor-shipping-api"), exports);
19
- tslib_1.__exportStar(require("./api/vendor-shipping-labels-api"), exports);
@@ -1,86 +1,77 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VendorDirectFulfillmentShippingApiClient = exports.clientRateLimits = void 0;
4
- /* eslint-disable prefer-regex-literals */
5
4
  const common_1 = require("@sp-api-sdk/common");
6
5
  const api_model_1 = require("./api-model");
7
- const error_1 = require("./error");
8
6
  exports.clientRateLimits = [
9
7
  {
10
8
  method: 'get',
9
+ // eslint-disable-next-line prefer-regex-literals
11
10
  urlRegex: new RegExp('^/vendor/directFulfillment/shipping/v1/shippingLabels$'),
12
11
  rate: 10,
13
12
  burst: 10,
14
13
  },
15
14
  {
16
15
  method: 'post',
16
+ // eslint-disable-next-line prefer-regex-literals
17
17
  urlRegex: new RegExp('^/vendor/directFulfillment/shipping/v1/shippingLabels$'),
18
18
  rate: 10,
19
19
  burst: 10,
20
20
  },
21
21
  {
22
22
  method: 'get',
23
+ // eslint-disable-next-line prefer-regex-literals
23
24
  urlRegex: new RegExp('^/vendor/directFulfillment/shipping/v1/shippingLabels/[^/]*$'),
24
25
  rate: 10,
25
26
  burst: 10,
26
27
  },
27
28
  {
28
29
  method: 'post',
30
+ // eslint-disable-next-line prefer-regex-literals
29
31
  urlRegex: new RegExp('^/vendor/directFulfillment/shipping/v1/shipmentConfirmations$'),
30
32
  rate: 10,
31
33
  burst: 10,
32
34
  },
33
35
  {
34
36
  method: 'post',
37
+ // eslint-disable-next-line prefer-regex-literals
35
38
  urlRegex: new RegExp('^/vendor/directFulfillment/shipping/v1/shipmentStatusUpdates$'),
36
39
  rate: 10,
37
40
  burst: 10,
38
41
  },
39
42
  {
40
43
  method: 'get',
44
+ // eslint-disable-next-line prefer-regex-literals
41
45
  urlRegex: new RegExp('^/vendor/directFulfillment/shipping/v1/customerInvoices$'),
42
46
  rate: 10,
43
47
  burst: 10,
44
48
  },
45
49
  {
46
50
  method: 'get',
51
+ // eslint-disable-next-line prefer-regex-literals
47
52
  urlRegex: new RegExp('^/vendor/directFulfillment/shipping/v1/customerInvoices/[^/]*$'),
48
53
  rate: 10,
49
54
  burst: 10,
50
55
  },
51
56
  {
52
57
  method: 'get',
58
+ // eslint-disable-next-line prefer-regex-literals
53
59
  urlRegex: new RegExp('^/vendor/directFulfillment/shipping/v1/packingSlips$'),
54
60
  rate: 10,
55
61
  burst: 10,
56
62
  },
57
63
  {
58
64
  method: 'get',
65
+ // eslint-disable-next-line prefer-regex-literals
59
66
  urlRegex: new RegExp('^/vendor/directFulfillment/shipping/v1/packingSlips/[^/]*$'),
60
67
  rate: 10,
61
68
  burst: 10,
62
69
  },
63
70
  ];
64
- class VendorDirectFulfillmentShippingApiClient extends api_model_1.VendorShippingLabelsApi {
65
- constructor(parameters) {
66
- const config = common_1.sellingPartnerRegions[parameters.region];
67
- if (!config) {
68
- throw new error_1.VendorDirectFulfillmentShippingApiError(`Unknown region: ${parameters.region}`);
69
- }
70
- const { rateLimiting, ...clientParameters } = parameters;
71
- const axiosParameters = {
72
- ...clientParameters,
73
- region: config.awsRegion,
74
- };
75
- if (rateLimiting?.retry) {
76
- axiosParameters.rateLimits = exports.clientRateLimits;
77
- axiosParameters.onRetry = rateLimiting.onRetry;
78
- }
79
- const axiosInstance = (0, common_1.createAxiosInstance)(axiosParameters);
80
- const configuration = new api_model_1.Configuration();
81
- const environment = parameters.sandbox ? 'sandbox' : 'production';
82
- const endpoint = config.endpoints[environment];
83
- super(configuration, endpoint, axiosInstance);
71
+ class VendorDirectFulfillmentShippingApiClient extends api_model_1.VendorShippingApi {
72
+ constructor(configuration) {
73
+ const { axios, endpoint } = (0, common_1.createAxiosInstance)(configuration, exports.clientRateLimits);
74
+ super(new api_model_1.Configuration(), endpoint, axios);
84
75
  }
85
76
  }
86
77
  exports.VendorDirectFulfillmentShippingApiClient = VendorDirectFulfillmentShippingApiClient;
package/dist/es/index.js CHANGED
@@ -1,3 +1,2 @@
1
1
  export * from './src/client';
2
- export * from './src/error';
3
2
  export * from './src/api-model/models';