@sp-api-sdk/merchant-fulfillment-api-v0 3.1.11 → 4.0.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.
Files changed (212) hide show
  1. package/README.md +4 -4
  2. package/dist/index.cjs +775 -0
  3. package/dist/index.cjs.map +1 -0
  4. package/dist/index.d.cts +2022 -0
  5. package/dist/index.d.ts +2022 -0
  6. package/dist/index.js +716 -0
  7. package/dist/index.js.map +1 -0
  8. package/package.json +23 -12
  9. package/dist/cjs/api-model/api/merchant-fulfillment-api.js +0 -355
  10. package/dist/cjs/api-model/api.js +0 -30
  11. package/dist/cjs/api-model/base.js +0 -52
  12. package/dist/cjs/api-model/common.js +0 -123
  13. package/dist/cjs/api-model/configuration.js +0 -98
  14. package/dist/cjs/api-model/index.js +0 -32
  15. package/dist/cjs/api-model/models/additional-inputs.js +0 -15
  16. package/dist/cjs/api-model/models/additional-seller-input.js +0 -15
  17. package/dist/cjs/api-model/models/additional-seller-inputs.js +0 -15
  18. package/dist/cjs/api-model/models/address.js +0 -15
  19. package/dist/cjs/api-model/models/available-carrier-will-pick-up-option.js +0 -15
  20. package/dist/cjs/api-model/models/available-delivery-experience-option.js +0 -15
  21. package/dist/cjs/api-model/models/available-shipping-service-options.js +0 -15
  22. package/dist/cjs/api-model/models/benefits.js +0 -15
  23. package/dist/cjs/api-model/models/cancel-shipment-response.js +0 -15
  24. package/dist/cjs/api-model/models/carrier-will-pick-up-option.js +0 -24
  25. package/dist/cjs/api-model/models/constraint.js +0 -15
  26. package/dist/cjs/api-model/models/create-shipment-request.js +0 -15
  27. package/dist/cjs/api-model/models/create-shipment-response.js +0 -15
  28. package/dist/cjs/api-model/models/currency-amount.js +0 -15
  29. package/dist/cjs/api-model/models/dangerous-goods-details.js +0 -36
  30. package/dist/cjs/api-model/models/delivery-experience-option.js +0 -26
  31. package/dist/cjs/api-model/models/delivery-experience-type.js +0 -25
  32. package/dist/cjs/api-model/models/excluded-benefit.js +0 -15
  33. package/dist/cjs/api-model/models/file-contents.js +0 -15
  34. package/dist/cjs/api-model/models/file-type.js +0 -24
  35. package/dist/cjs/api-model/models/get-additional-seller-inputs-request.js +0 -15
  36. package/dist/cjs/api-model/models/get-additional-seller-inputs-response.js +0 -15
  37. package/dist/cjs/api-model/models/get-additional-seller-inputs-result.js +0 -15
  38. package/dist/cjs/api-model/models/get-eligible-shipment-services-request.js +0 -15
  39. package/dist/cjs/api-model/models/get-eligible-shipment-services-response.js +0 -15
  40. package/dist/cjs/api-model/models/get-eligible-shipment-services-result.js +0 -15
  41. package/dist/cjs/api-model/models/get-shipment-response.js +0 -15
  42. package/dist/cjs/api-model/models/hazmat-type.js +0 -23
  43. package/dist/cjs/api-model/models/index.js +0 -75
  44. package/dist/cjs/api-model/models/input-target-type.js +0 -23
  45. package/dist/cjs/api-model/models/item-level-fields.js +0 -15
  46. package/dist/cjs/api-model/models/item.js +0 -15
  47. package/dist/cjs/api-model/models/label-customization.js +0 -15
  48. package/dist/cjs/api-model/models/label-dimensions.js +0 -15
  49. package/dist/cjs/api-model/models/label-format-option-request.js +0 -15
  50. package/dist/cjs/api-model/models/label-format-option.js +0 -15
  51. package/dist/cjs/api-model/models/label-format.js +0 -26
  52. package/dist/cjs/api-model/models/label.js +0 -15
  53. package/dist/cjs/api-model/models/length.js +0 -15
  54. package/dist/cjs/api-model/models/liquid-volume.js +0 -25
  55. package/dist/cjs/api-model/models/model-error.js +0 -15
  56. package/dist/cjs/api-model/models/package-dimensions.js +0 -15
  57. package/dist/cjs/api-model/models/predefined-package-dimensions.js +0 -71
  58. package/dist/cjs/api-model/models/rate-item-id.js +0 -22
  59. package/dist/cjs/api-model/models/rate-item-type.js +0 -22
  60. package/dist/cjs/api-model/models/rate-item.js +0 -15
  61. package/dist/cjs/api-model/models/rejected-shipping-service.js +0 -15
  62. package/dist/cjs/api-model/models/seller-input-definition.js +0 -15
  63. package/dist/cjs/api-model/models/shipment-request-details.js +0 -15
  64. package/dist/cjs/api-model/models/shipment-status.js +0 -25
  65. package/dist/cjs/api-model/models/shipment.js +0 -15
  66. package/dist/cjs/api-model/models/shipping-offering-filter.js +0 -15
  67. package/dist/cjs/api-model/models/shipping-service-options.js +0 -15
  68. package/dist/cjs/api-model/models/shipping-service.js +0 -15
  69. package/dist/cjs/api-model/models/standard-id-for-label.js +0 -22
  70. package/dist/cjs/api-model/models/temporarily-unavailable-carrier.js +0 -15
  71. package/dist/cjs/api-model/models/terms-and-conditions-not-accepted-carrier.js +0 -15
  72. package/dist/cjs/api-model/models/unit-of-length.js +0 -23
  73. package/dist/cjs/api-model/models/unit-of-weight.js +0 -23
  74. package/dist/cjs/api-model/models/weight.js +0 -15
  75. package/dist/cjs/client.js +0 -49
  76. package/dist/cjs/index.js +0 -19
  77. package/dist/es/api-model/api/merchant-fulfillment-api.js +0 -345
  78. package/dist/es/api-model/api.js +0 -14
  79. package/dist/es/api-model/base.js +0 -44
  80. package/dist/es/api-model/common.js +0 -110
  81. package/dist/es/api-model/configuration.js +0 -94
  82. package/dist/es/api-model/index.js +0 -16
  83. package/dist/es/api-model/models/additional-inputs.js +0 -14
  84. package/dist/es/api-model/models/additional-seller-input.js +0 -14
  85. package/dist/es/api-model/models/additional-seller-inputs.js +0 -14
  86. package/dist/es/api-model/models/address.js +0 -14
  87. package/dist/es/api-model/models/available-carrier-will-pick-up-option.js +0 -14
  88. package/dist/es/api-model/models/available-delivery-experience-option.js +0 -14
  89. package/dist/es/api-model/models/available-shipping-service-options.js +0 -14
  90. package/dist/es/api-model/models/benefits.js +0 -14
  91. package/dist/es/api-model/models/cancel-shipment-response.js +0 -14
  92. package/dist/es/api-model/models/carrier-will-pick-up-option.js +0 -21
  93. package/dist/es/api-model/models/constraint.js +0 -14
  94. package/dist/es/api-model/models/create-shipment-request.js +0 -14
  95. package/dist/es/api-model/models/create-shipment-response.js +0 -14
  96. package/dist/es/api-model/models/currency-amount.js +0 -14
  97. package/dist/es/api-model/models/dangerous-goods-details.js +0 -33
  98. package/dist/es/api-model/models/delivery-experience-option.js +0 -23
  99. package/dist/es/api-model/models/delivery-experience-type.js +0 -22
  100. package/dist/es/api-model/models/excluded-benefit.js +0 -14
  101. package/dist/es/api-model/models/file-contents.js +0 -14
  102. package/dist/es/api-model/models/file-type.js +0 -21
  103. package/dist/es/api-model/models/get-additional-seller-inputs-request.js +0 -14
  104. package/dist/es/api-model/models/get-additional-seller-inputs-response.js +0 -14
  105. package/dist/es/api-model/models/get-additional-seller-inputs-result.js +0 -14
  106. package/dist/es/api-model/models/get-eligible-shipment-services-request.js +0 -14
  107. package/dist/es/api-model/models/get-eligible-shipment-services-response.js +0 -14
  108. package/dist/es/api-model/models/get-eligible-shipment-services-result.js +0 -14
  109. package/dist/es/api-model/models/get-shipment-response.js +0 -14
  110. package/dist/es/api-model/models/hazmat-type.js +0 -20
  111. package/dist/es/api-model/models/index.js +0 -59
  112. package/dist/es/api-model/models/input-target-type.js +0 -20
  113. package/dist/es/api-model/models/item-level-fields.js +0 -14
  114. package/dist/es/api-model/models/item.js +0 -14
  115. package/dist/es/api-model/models/label-customization.js +0 -14
  116. package/dist/es/api-model/models/label-dimensions.js +0 -14
  117. package/dist/es/api-model/models/label-format-option-request.js +0 -14
  118. package/dist/es/api-model/models/label-format-option.js +0 -14
  119. package/dist/es/api-model/models/label-format.js +0 -23
  120. package/dist/es/api-model/models/label.js +0 -14
  121. package/dist/es/api-model/models/length.js +0 -14
  122. package/dist/es/api-model/models/liquid-volume.js +0 -22
  123. package/dist/es/api-model/models/model-error.js +0 -14
  124. package/dist/es/api-model/models/package-dimensions.js +0 -14
  125. package/dist/es/api-model/models/predefined-package-dimensions.js +0 -68
  126. package/dist/es/api-model/models/rate-item-id.js +0 -19
  127. package/dist/es/api-model/models/rate-item-type.js +0 -19
  128. package/dist/es/api-model/models/rate-item.js +0 -14
  129. package/dist/es/api-model/models/rejected-shipping-service.js +0 -14
  130. package/dist/es/api-model/models/seller-input-definition.js +0 -14
  131. package/dist/es/api-model/models/shipment-request-details.js +0 -14
  132. package/dist/es/api-model/models/shipment-status.js +0 -22
  133. package/dist/es/api-model/models/shipment.js +0 -14
  134. package/dist/es/api-model/models/shipping-offering-filter.js +0 -14
  135. package/dist/es/api-model/models/shipping-service-options.js +0 -14
  136. package/dist/es/api-model/models/shipping-service.js +0 -14
  137. package/dist/es/api-model/models/standard-id-for-label.js +0 -19
  138. package/dist/es/api-model/models/temporarily-unavailable-carrier.js +0 -14
  139. package/dist/es/api-model/models/terms-and-conditions-not-accepted-carrier.js +0 -14
  140. package/dist/es/api-model/models/unit-of-length.js +0 -20
  141. package/dist/es/api-model/models/unit-of-weight.js +0 -20
  142. package/dist/es/api-model/models/weight.js +0 -14
  143. package/dist/es/client.js +0 -45
  144. package/dist/es/index.js +0 -3
  145. package/dist/types/api-model/api/merchant-fulfillment-api.d.ts +0 -228
  146. package/dist/types/api-model/api.d.ts +0 -12
  147. package/dist/types/api-model/base.d.ts +0 -42
  148. package/dist/types/api-model/common.d.ts +0 -34
  149. package/dist/types/api-model/configuration.d.ts +0 -98
  150. package/dist/types/api-model/index.d.ts +0 -14
  151. package/dist/types/api-model/models/additional-inputs.d.ts +0 -22
  152. package/dist/types/api-model/models/additional-seller-input.d.ts +0 -44
  153. package/dist/types/api-model/models/additional-seller-inputs.d.ts +0 -22
  154. package/dist/types/api-model/models/address.d.ts +0 -60
  155. package/dist/types/api-model/models/available-carrier-will-pick-up-option.d.ts +0 -20
  156. package/dist/types/api-model/models/available-delivery-experience-option.d.ts +0 -20
  157. package/dist/types/api-model/models/available-shipping-service-options.d.ts +0 -26
  158. package/dist/types/api-model/models/benefits.d.ts +0 -25
  159. package/dist/types/api-model/models/cancel-shipment-response.d.ts +0 -22
  160. package/dist/types/api-model/models/carrier-will-pick-up-option.d.ts +0 -20
  161. package/dist/types/api-model/models/constraint.d.ts +0 -24
  162. package/dist/types/api-model/models/create-shipment-request.d.ts +0 -35
  163. package/dist/types/api-model/models/create-shipment-response.d.ts +0 -22
  164. package/dist/types/api-model/models/currency-amount.d.ts +0 -24
  165. package/dist/types/api-model/models/dangerous-goods-details.d.ts +0 -54
  166. package/dist/types/api-model/models/delivery-experience-option.d.ts +0 -22
  167. package/dist/types/api-model/models/delivery-experience-type.d.ts +0 -21
  168. package/dist/types/api-model/models/excluded-benefit.d.ts +0 -24
  169. package/dist/types/api-model/models/file-contents.d.ts +0 -26
  170. package/dist/types/api-model/models/file-type.d.ts +0 -20
  171. package/dist/types/api-model/models/get-additional-seller-inputs-request.d.ts +0 -26
  172. package/dist/types/api-model/models/get-additional-seller-inputs-response.d.ts +0 -22
  173. package/dist/types/api-model/models/get-additional-seller-inputs-result.d.ts +0 -26
  174. package/dist/types/api-model/models/get-eligible-shipment-services-request.d.ts +0 -20
  175. package/dist/types/api-model/models/get-eligible-shipment-services-response.d.ts +0 -22
  176. package/dist/types/api-model/models/get-eligible-shipment-services-result.d.ts +0 -36
  177. package/dist/types/api-model/models/get-shipment-response.d.ts +0 -22
  178. package/dist/types/api-model/models/hazmat-type.d.ts +0 -19
  179. package/dist/types/api-model/models/index.d.ts +0 -59
  180. package/dist/types/api-model/models/input-target-type.d.ts +0 -19
  181. package/dist/types/api-model/models/item-level-fields.d.ts +0 -25
  182. package/dist/types/api-model/models/item.d.ts +0 -47
  183. package/dist/types/api-model/models/label-customization.d.ts +0 -22
  184. package/dist/types/api-model/models/label-dimensions.d.ts +0 -26
  185. package/dist/types/api-model/models/label-format-option-request.d.ts +0 -20
  186. package/dist/types/api-model/models/label-format-option.d.ts +0 -22
  187. package/dist/types/api-model/models/label-format.d.ts +0 -22
  188. package/dist/types/api-model/models/label.d.ts +0 -28
  189. package/dist/types/api-model/models/length.d.ts +0 -22
  190. package/dist/types/api-model/models/liquid-volume.d.ts +0 -34
  191. package/dist/types/api-model/models/model-error.d.ts +0 -28
  192. package/dist/types/api-model/models/package-dimensions.d.ts +0 -32
  193. package/dist/types/api-model/models/predefined-package-dimensions.d.ts +0 -67
  194. package/dist/types/api-model/models/rate-item-id.d.ts +0 -18
  195. package/dist/types/api-model/models/rate-item-type.d.ts +0 -18
  196. package/dist/types/api-model/models/rate-item.d.ts +0 -26
  197. package/dist/types/api-model/models/rejected-shipping-service.d.ts +0 -36
  198. package/dist/types/api-model/models/seller-input-definition.d.ts +0 -41
  199. package/dist/types/api-model/models/shipment-request-details.d.ts +0 -47
  200. package/dist/types/api-model/models/shipment-status.d.ts +0 -21
  201. package/dist/types/api-model/models/shipment.d.ts +0 -60
  202. package/dist/types/api-model/models/shipping-offering-filter.d.ts +0 -28
  203. package/dist/types/api-model/models/shipping-service-options.d.ts +0 -28
  204. package/dist/types/api-model/models/shipping-service.d.ts +0 -72
  205. package/dist/types/api-model/models/standard-id-for-label.d.ts +0 -18
  206. package/dist/types/api-model/models/temporarily-unavailable-carrier.d.ts +0 -20
  207. package/dist/types/api-model/models/terms-and-conditions-not-accepted-carrier.d.ts +0 -20
  208. package/dist/types/api-model/models/unit-of-length.d.ts +0 -19
  209. package/dist/types/api-model/models/unit-of-weight.d.ts +0 -19
  210. package/dist/types/api-model/models/weight.d.ts +0 -22
  211. package/dist/types/client.d.ts +0 -6
  212. package/dist/types/index.d.ts +0 -3
@@ -1,345 +0,0 @@
1
- /* tslint:disable */
2
- /* eslint-disable */
3
- /**
4
- * Selling Partner API for Merchant Fulfillment
5
- * With the Selling Partner API for Merchant Fulfillment, you can build applications that sellers can use to purchase shipping for non-Prime and Prime orders using Amazon\'s Buy Shipping Services.
6
- *
7
- * The version of the OpenAPI document: v0
8
- *
9
- *
10
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
- * https://openapi-generator.tech
12
- * Do not edit the class manually.
13
- */
14
- import globalAxios from 'axios';
15
- // Some imports not used depending on template conditions
16
- // @ts-ignore
17
- import { DUMMY_BASE_URL, assertParamExists, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common';
18
- // @ts-ignore
19
- import { BASE_PATH, BaseAPI, operationServerMap } from '../base';
20
- /**
21
- * MerchantFulfillmentApi - axios parameter creator
22
- */
23
- export const MerchantFulfillmentApiAxiosParamCreator = function (configuration) {
24
- return {
25
- /**
26
- * Cancel the shipment indicated by the specified shipment identifier. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 1 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that are applied to the requested operation when available. The preceding table indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the SP-API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
27
- * @param {string} shipmentId The Amazon-defined shipment identifier for the shipment to cancel.
28
- * @param {*} [options] Override http request option.
29
- * @throws {RequiredError}
30
- */
31
- cancelShipment: async (shipmentId, options = {}) => {
32
- // verify required parameter 'shipmentId' is not null or undefined
33
- assertParamExists('cancelShipment', 'shipmentId', shipmentId);
34
- const localVarPath = `/mfn/v0/shipments/{shipmentId}`
35
- .replace(`{${"shipmentId"}}`, encodeURIComponent(String(shipmentId)));
36
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
37
- const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
38
- let baseOptions;
39
- if (configuration) {
40
- baseOptions = configuration.baseOptions;
41
- }
42
- const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options };
43
- const localVarHeaderParameter = {};
44
- const localVarQueryParameter = {};
45
- localVarHeaderParameter['Accept'] = 'application/json';
46
- setSearchParams(localVarUrlObj, localVarQueryParameter);
47
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
48
- localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
49
- return {
50
- url: toPathString(localVarUrlObj),
51
- options: localVarRequestOptions,
52
- };
53
- },
54
- /**
55
- * Create a shipment with the information provided. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 2 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that are applied to the requested operation when available. The preceding table indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the SP-API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
56
- * @param {CreateShipmentRequest} body The request schema for the `CreateShipment` operation.
57
- * @param {*} [options] Override http request option.
58
- * @throws {RequiredError}
59
- */
60
- createShipment: async (body, options = {}) => {
61
- // verify required parameter 'body' is not null or undefined
62
- assertParamExists('createShipment', 'body', body);
63
- const localVarPath = `/mfn/v0/shipments`;
64
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
65
- const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
66
- let baseOptions;
67
- if (configuration) {
68
- baseOptions = configuration.baseOptions;
69
- }
70
- const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options };
71
- const localVarHeaderParameter = {};
72
- const localVarQueryParameter = {};
73
- localVarHeaderParameter['Content-Type'] = 'application/json';
74
- localVarHeaderParameter['Accept'] = 'application/json';
75
- setSearchParams(localVarUrlObj, localVarQueryParameter);
76
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
77
- localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
78
- localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration);
79
- return {
80
- url: toPathString(localVarUrlObj),
81
- options: localVarRequestOptions,
82
- };
83
- },
84
- /**
85
- * Gets a list of additional seller inputs required for a ship method. This is generally used for international shipping. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 1 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that are applied to the requested operation when available. The preceding table indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the SP-API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
86
- * @param {GetAdditionalSellerInputsRequest} body The request schema for the `GetAdditionalSellerInputs` operation.
87
- * @param {*} [options] Override http request option.
88
- * @throws {RequiredError}
89
- */
90
- getAdditionalSellerInputs: async (body, options = {}) => {
91
- // verify required parameter 'body' is not null or undefined
92
- assertParamExists('getAdditionalSellerInputs', 'body', body);
93
- const localVarPath = `/mfn/v0/additionalSellerInputs`;
94
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
95
- const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
96
- let baseOptions;
97
- if (configuration) {
98
- baseOptions = configuration.baseOptions;
99
- }
100
- const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options };
101
- const localVarHeaderParameter = {};
102
- const localVarQueryParameter = {};
103
- localVarHeaderParameter['Content-Type'] = 'application/json';
104
- localVarHeaderParameter['Accept'] = 'application/json';
105
- setSearchParams(localVarUrlObj, localVarQueryParameter);
106
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
107
- localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
108
- localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration);
109
- return {
110
- url: toPathString(localVarUrlObj),
111
- options: localVarRequestOptions,
112
- };
113
- },
114
- /**
115
- * Returns a list of shipping service offers that satisfy the specified shipment request details. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 6 | 12 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that are applied to the requested operation when available. The preceding table indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the SP-API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
116
- * @param {GetEligibleShipmentServicesRequest} body The request schema for the `GetEligibleShipmentServices` operation.
117
- * @param {*} [options] Override http request option.
118
- * @throws {RequiredError}
119
- */
120
- getEligibleShipmentServices: async (body, options = {}) => {
121
- // verify required parameter 'body' is not null or undefined
122
- assertParamExists('getEligibleShipmentServices', 'body', body);
123
- const localVarPath = `/mfn/v0/eligibleShippingServices`;
124
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
125
- const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
126
- let baseOptions;
127
- if (configuration) {
128
- baseOptions = configuration.baseOptions;
129
- }
130
- const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options };
131
- const localVarHeaderParameter = {};
132
- const localVarQueryParameter = {};
133
- localVarHeaderParameter['Content-Type'] = 'application/json';
134
- localVarHeaderParameter['Accept'] = 'application/json';
135
- setSearchParams(localVarUrlObj, localVarQueryParameter);
136
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
137
- localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
138
- localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration);
139
- return {
140
- url: toPathString(localVarUrlObj),
141
- options: localVarRequestOptions,
142
- };
143
- },
144
- /**
145
- * Returns the shipment information for an existing shipment. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 1 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that are applied to the requested operation when available. The preceding table indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the SP-API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
146
- * @param {string} shipmentId The Amazon-defined shipment identifier for the shipment.
147
- * @param {*} [options] Override http request option.
148
- * @throws {RequiredError}
149
- */
150
- getShipment: async (shipmentId, options = {}) => {
151
- // verify required parameter 'shipmentId' is not null or undefined
152
- assertParamExists('getShipment', 'shipmentId', shipmentId);
153
- const localVarPath = `/mfn/v0/shipments/{shipmentId}`
154
- .replace(`{${"shipmentId"}}`, encodeURIComponent(String(shipmentId)));
155
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
156
- const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
157
- let baseOptions;
158
- if (configuration) {
159
- baseOptions = configuration.baseOptions;
160
- }
161
- const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
162
- const localVarHeaderParameter = {};
163
- const localVarQueryParameter = {};
164
- localVarHeaderParameter['Accept'] = 'application/json';
165
- setSearchParams(localVarUrlObj, localVarQueryParameter);
166
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
167
- localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
168
- return {
169
- url: toPathString(localVarUrlObj),
170
- options: localVarRequestOptions,
171
- };
172
- },
173
- };
174
- };
175
- /**
176
- * MerchantFulfillmentApi - functional programming interface
177
- */
178
- export const MerchantFulfillmentApiFp = function (configuration) {
179
- const localVarAxiosParamCreator = MerchantFulfillmentApiAxiosParamCreator(configuration);
180
- return {
181
- /**
182
- * Cancel the shipment indicated by the specified shipment identifier. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 1 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that are applied to the requested operation when available. The preceding table indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the SP-API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
183
- * @param {string} shipmentId The Amazon-defined shipment identifier for the shipment to cancel.
184
- * @param {*} [options] Override http request option.
185
- * @throws {RequiredError}
186
- */
187
- async cancelShipment(shipmentId, options) {
188
- const localVarAxiosArgs = await localVarAxiosParamCreator.cancelShipment(shipmentId, options);
189
- const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
190
- const localVarOperationServerBasePath = operationServerMap['MerchantFulfillmentApi.cancelShipment']?.[localVarOperationServerIndex]?.url;
191
- return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
192
- },
193
- /**
194
- * Create a shipment with the information provided. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 2 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that are applied to the requested operation when available. The preceding table indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the SP-API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
195
- * @param {CreateShipmentRequest} body The request schema for the `CreateShipment` operation.
196
- * @param {*} [options] Override http request option.
197
- * @throws {RequiredError}
198
- */
199
- async createShipment(body, options) {
200
- const localVarAxiosArgs = await localVarAxiosParamCreator.createShipment(body, options);
201
- const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
202
- const localVarOperationServerBasePath = operationServerMap['MerchantFulfillmentApi.createShipment']?.[localVarOperationServerIndex]?.url;
203
- return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
204
- },
205
- /**
206
- * Gets a list of additional seller inputs required for a ship method. This is generally used for international shipping. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 1 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that are applied to the requested operation when available. The preceding table indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the SP-API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
207
- * @param {GetAdditionalSellerInputsRequest} body The request schema for the `GetAdditionalSellerInputs` operation.
208
- * @param {*} [options] Override http request option.
209
- * @throws {RequiredError}
210
- */
211
- async getAdditionalSellerInputs(body, options) {
212
- const localVarAxiosArgs = await localVarAxiosParamCreator.getAdditionalSellerInputs(body, options);
213
- const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
214
- const localVarOperationServerBasePath = operationServerMap['MerchantFulfillmentApi.getAdditionalSellerInputs']?.[localVarOperationServerIndex]?.url;
215
- return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
216
- },
217
- /**
218
- * Returns a list of shipping service offers that satisfy the specified shipment request details. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 6 | 12 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that are applied to the requested operation when available. The preceding table indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the SP-API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
219
- * @param {GetEligibleShipmentServicesRequest} body The request schema for the `GetEligibleShipmentServices` operation.
220
- * @param {*} [options] Override http request option.
221
- * @throws {RequiredError}
222
- */
223
- async getEligibleShipmentServices(body, options) {
224
- const localVarAxiosArgs = await localVarAxiosParamCreator.getEligibleShipmentServices(body, options);
225
- const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
226
- const localVarOperationServerBasePath = operationServerMap['MerchantFulfillmentApi.getEligibleShipmentServices']?.[localVarOperationServerIndex]?.url;
227
- return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
228
- },
229
- /**
230
- * Returns the shipment information for an existing shipment. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 1 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that are applied to the requested operation when available. The preceding table indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the SP-API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
231
- * @param {string} shipmentId The Amazon-defined shipment identifier for the shipment.
232
- * @param {*} [options] Override http request option.
233
- * @throws {RequiredError}
234
- */
235
- async getShipment(shipmentId, options) {
236
- const localVarAxiosArgs = await localVarAxiosParamCreator.getShipment(shipmentId, options);
237
- const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
238
- const localVarOperationServerBasePath = operationServerMap['MerchantFulfillmentApi.getShipment']?.[localVarOperationServerIndex]?.url;
239
- return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
240
- },
241
- };
242
- };
243
- /**
244
- * MerchantFulfillmentApi - factory interface
245
- */
246
- export const MerchantFulfillmentApiFactory = function (configuration, basePath, axios) {
247
- const localVarFp = MerchantFulfillmentApiFp(configuration);
248
- return {
249
- /**
250
- * Cancel the shipment indicated by the specified shipment identifier. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 1 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that are applied to the requested operation when available. The preceding table indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the SP-API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
251
- * @param {MerchantFulfillmentApiCancelShipmentRequest} requestParameters Request parameters.
252
- * @param {*} [options] Override http request option.
253
- * @throws {RequiredError}
254
- */
255
- cancelShipment(requestParameters, options) {
256
- return localVarFp.cancelShipment(requestParameters.shipmentId, options).then((request) => request(axios, basePath));
257
- },
258
- /**
259
- * Create a shipment with the information provided. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 2 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that are applied to the requested operation when available. The preceding table indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the SP-API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
260
- * @param {MerchantFulfillmentApiCreateShipmentRequest} requestParameters Request parameters.
261
- * @param {*} [options] Override http request option.
262
- * @throws {RequiredError}
263
- */
264
- createShipment(requestParameters, options) {
265
- return localVarFp.createShipment(requestParameters.body, options).then((request) => request(axios, basePath));
266
- },
267
- /**
268
- * Gets a list of additional seller inputs required for a ship method. This is generally used for international shipping. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 1 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that are applied to the requested operation when available. The preceding table indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the SP-API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
269
- * @param {MerchantFulfillmentApiGetAdditionalSellerInputsRequest} requestParameters Request parameters.
270
- * @param {*} [options] Override http request option.
271
- * @throws {RequiredError}
272
- */
273
- getAdditionalSellerInputs(requestParameters, options) {
274
- return localVarFp.getAdditionalSellerInputs(requestParameters.body, options).then((request) => request(axios, basePath));
275
- },
276
- /**
277
- * Returns a list of shipping service offers that satisfy the specified shipment request details. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 6 | 12 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that are applied to the requested operation when available. The preceding table indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the SP-API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
278
- * @param {MerchantFulfillmentApiGetEligibleShipmentServicesRequest} requestParameters Request parameters.
279
- * @param {*} [options] Override http request option.
280
- * @throws {RequiredError}
281
- */
282
- getEligibleShipmentServices(requestParameters, options) {
283
- return localVarFp.getEligibleShipmentServices(requestParameters.body, options).then((request) => request(axios, basePath));
284
- },
285
- /**
286
- * Returns the shipment information for an existing shipment. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 1 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that are applied to the requested operation when available. The preceding table indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the SP-API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
287
- * @param {MerchantFulfillmentApiGetShipmentRequest} requestParameters Request parameters.
288
- * @param {*} [options] Override http request option.
289
- * @throws {RequiredError}
290
- */
291
- getShipment(requestParameters, options) {
292
- return localVarFp.getShipment(requestParameters.shipmentId, options).then((request) => request(axios, basePath));
293
- },
294
- };
295
- };
296
- /**
297
- * MerchantFulfillmentApi - object-oriented interface
298
- */
299
- export class MerchantFulfillmentApi extends BaseAPI {
300
- /**
301
- * Cancel the shipment indicated by the specified shipment identifier. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 1 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that are applied to the requested operation when available. The preceding table indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the SP-API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
302
- * @param {MerchantFulfillmentApiCancelShipmentRequest} requestParameters Request parameters.
303
- * @param {*} [options] Override http request option.
304
- * @throws {RequiredError}
305
- */
306
- cancelShipment(requestParameters, options) {
307
- return MerchantFulfillmentApiFp(this.configuration).cancelShipment(requestParameters.shipmentId, options).then((request) => request(this.axios, this.basePath));
308
- }
309
- /**
310
- * Create a shipment with the information provided. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 2 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that are applied to the requested operation when available. The preceding table indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the SP-API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
311
- * @param {MerchantFulfillmentApiCreateShipmentRequest} requestParameters Request parameters.
312
- * @param {*} [options] Override http request option.
313
- * @throws {RequiredError}
314
- */
315
- createShipment(requestParameters, options) {
316
- return MerchantFulfillmentApiFp(this.configuration).createShipment(requestParameters.body, options).then((request) => request(this.axios, this.basePath));
317
- }
318
- /**
319
- * Gets a list of additional seller inputs required for a ship method. This is generally used for international shipping. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 1 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that are applied to the requested operation when available. The preceding table indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the SP-API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
320
- * @param {MerchantFulfillmentApiGetAdditionalSellerInputsRequest} requestParameters Request parameters.
321
- * @param {*} [options] Override http request option.
322
- * @throws {RequiredError}
323
- */
324
- getAdditionalSellerInputs(requestParameters, options) {
325
- return MerchantFulfillmentApiFp(this.configuration).getAdditionalSellerInputs(requestParameters.body, options).then((request) => request(this.axios, this.basePath));
326
- }
327
- /**
328
- * Returns a list of shipping service offers that satisfy the specified shipment request details. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 6 | 12 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that are applied to the requested operation when available. The preceding table indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the SP-API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
329
- * @param {MerchantFulfillmentApiGetEligibleShipmentServicesRequest} requestParameters Request parameters.
330
- * @param {*} [options] Override http request option.
331
- * @throws {RequiredError}
332
- */
333
- getEligibleShipmentServices(requestParameters, options) {
334
- return MerchantFulfillmentApiFp(this.configuration).getEligibleShipmentServices(requestParameters.body, options).then((request) => request(this.axios, this.basePath));
335
- }
336
- /**
337
- * Returns the shipment information for an existing shipment. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 1 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that are applied to the requested operation when available. The preceding table indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the SP-API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
338
- * @param {MerchantFulfillmentApiGetShipmentRequest} requestParameters Request parameters.
339
- * @param {*} [options] Override http request option.
340
- * @throws {RequiredError}
341
- */
342
- getShipment(requestParameters, options) {
343
- return MerchantFulfillmentApiFp(this.configuration).getShipment(requestParameters.shipmentId, options).then((request) => request(this.axios, this.basePath));
344
- }
345
- }
@@ -1,14 +0,0 @@
1
- /* tslint:disable */
2
- /* eslint-disable */
3
- /**
4
- * Selling Partner API for Merchant Fulfillment
5
- * With the Selling Partner API for Merchant Fulfillment, you can build applications that sellers can use to purchase shipping for non-Prime and Prime orders using Amazon\'s Buy Shipping Services.
6
- *
7
- * The version of the OpenAPI document: v0
8
- *
9
- *
10
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
- * https://openapi-generator.tech
12
- * Do not edit the class manually.
13
- */
14
- export * from './api/merchant-fulfillment-api';
@@ -1,44 +0,0 @@
1
- /* tslint:disable */
2
- /* eslint-disable */
3
- /**
4
- * Selling Partner API for Merchant Fulfillment
5
- * With the Selling Partner API for Merchant Fulfillment, you can build applications that sellers can use to purchase shipping for non-Prime and Prime orders using Amazon\'s Buy Shipping Services.
6
- *
7
- * The version of the OpenAPI document: v0
8
- *
9
- *
10
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
- * https://openapi-generator.tech
12
- * Do not edit the class manually.
13
- */
14
- import globalAxios from 'axios';
15
- export const BASE_PATH = "https://sellingpartnerapi-na.amazon.com".replace(/\/+$/, "");
16
- export const COLLECTION_FORMATS = {
17
- csv: ",",
18
- ssv: " ",
19
- tsv: "\t",
20
- pipes: "|",
21
- };
22
- export class BaseAPI {
23
- basePath;
24
- axios;
25
- configuration;
26
- constructor(configuration, basePath = BASE_PATH, axios = globalAxios) {
27
- this.basePath = basePath;
28
- this.axios = axios;
29
- if (configuration) {
30
- this.configuration = configuration;
31
- this.basePath = configuration.basePath ?? basePath;
32
- }
33
- }
34
- }
35
- ;
36
- export class RequiredError extends Error {
37
- field;
38
- constructor(field, msg) {
39
- super(msg);
40
- this.field = field;
41
- this.name = "RequiredError";
42
- }
43
- }
44
- export const operationServerMap = {};
@@ -1,110 +0,0 @@
1
- /* tslint:disable */
2
- /* eslint-disable */
3
- /**
4
- * Selling Partner API for Merchant Fulfillment
5
- * With the Selling Partner API for Merchant Fulfillment, you can build applications that sellers can use to purchase shipping for non-Prime and Prime orders using Amazon\'s Buy Shipping Services.
6
- *
7
- * The version of the OpenAPI document: v0
8
- *
9
- *
10
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
- * https://openapi-generator.tech
12
- * Do not edit the class manually.
13
- */
14
- import { RequiredError } from "./base";
15
- export const DUMMY_BASE_URL = 'https://example.com';
16
- /**
17
- *
18
- * @throws {RequiredError}
19
- */
20
- export const assertParamExists = function (functionName, paramName, paramValue) {
21
- if (paramValue === null || paramValue === undefined) {
22
- throw new RequiredError(paramName, `Required parameter ${paramName} was null or undefined when calling ${functionName}.`);
23
- }
24
- };
25
- export const setApiKeyToObject = async function (object, keyParamName, configuration) {
26
- if (configuration && configuration.apiKey) {
27
- const localVarApiKeyValue = typeof configuration.apiKey === 'function'
28
- ? await configuration.apiKey(keyParamName)
29
- : await configuration.apiKey;
30
- object[keyParamName] = localVarApiKeyValue;
31
- }
32
- };
33
- export const setBasicAuthToObject = function (object, configuration) {
34
- if (configuration && (configuration.username || configuration.password)) {
35
- object["auth"] = { username: configuration.username, password: configuration.password };
36
- }
37
- };
38
- export const setBearerAuthToObject = async function (object, configuration) {
39
- if (configuration && configuration.accessToken) {
40
- const accessToken = typeof configuration.accessToken === 'function'
41
- ? await configuration.accessToken()
42
- : await configuration.accessToken;
43
- object["Authorization"] = "Bearer " + accessToken;
44
- }
45
- };
46
- export const setOAuthToObject = async function (object, name, scopes, configuration) {
47
- if (configuration && configuration.accessToken) {
48
- const localVarAccessTokenValue = typeof configuration.accessToken === 'function'
49
- ? await configuration.accessToken(name, scopes)
50
- : await configuration.accessToken;
51
- object["Authorization"] = "Bearer " + localVarAccessTokenValue;
52
- }
53
- };
54
- function setFlattenedQueryParams(urlSearchParams, parameter, key = "") {
55
- if (parameter == null)
56
- return;
57
- if (typeof parameter === "object") {
58
- if (Array.isArray(parameter) || parameter instanceof Set) {
59
- parameter.forEach(item => setFlattenedQueryParams(urlSearchParams, item, key));
60
- }
61
- else {
62
- Object.keys(parameter).forEach(currentKey => setFlattenedQueryParams(urlSearchParams, parameter[currentKey], `${key}${key !== '' ? '.' : ''}${currentKey}`));
63
- }
64
- }
65
- else {
66
- if (urlSearchParams.has(key)) {
67
- urlSearchParams.append(key, parameter);
68
- }
69
- else {
70
- urlSearchParams.set(key, parameter);
71
- }
72
- }
73
- }
74
- export const setSearchParams = function (url, ...objects) {
75
- const searchParams = new URLSearchParams(url.search);
76
- setFlattenedQueryParams(searchParams, objects);
77
- url.search = searchParams.toString();
78
- };
79
- /**
80
- * JSON serialization helper function which replaces instances of unserializable types with serializable ones.
81
- * This function will run for every key-value pair encountered by JSON.stringify while traversing an object.
82
- * Converting a set to a string will return an empty object, so an intermediate conversion to an array is required.
83
- */
84
- // @ts-ignore
85
- export const replaceWithSerializableTypeIfNeeded = function (key, value) {
86
- if (value instanceof Set) {
87
- return Array.from(value);
88
- }
89
- else {
90
- return value;
91
- }
92
- };
93
- export const serializeDataIfNeeded = function (value, requestOptions, configuration) {
94
- const nonString = typeof value !== 'string';
95
- const needsSerialization = nonString && configuration && configuration.isJsonMime
96
- ? configuration.isJsonMime(requestOptions.headers['Content-Type'])
97
- : nonString;
98
- return needsSerialization
99
- ? JSON.stringify(value !== undefined ? value : {}, replaceWithSerializableTypeIfNeeded)
100
- : (value || "");
101
- };
102
- export const toPathString = function (url) {
103
- return url.pathname + url.search + url.hash;
104
- };
105
- export const createRequestFunction = function (axiosArgs, globalAxios, BASE_PATH, configuration) {
106
- return (axios = globalAxios, basePath = BASE_PATH) => {
107
- const axiosRequestArgs = { ...axiosArgs.options, url: (axios.defaults.baseURL ? '' : configuration?.basePath ?? basePath) + axiosArgs.url };
108
- return axios.request(axiosRequestArgs);
109
- };
110
- };
@@ -1,94 +0,0 @@
1
- /* tslint:disable */
2
- /**
3
- * Selling Partner API for Merchant Fulfillment
4
- * With the Selling Partner API for Merchant Fulfillment, you can build applications that sellers can use to purchase shipping for non-Prime and Prime orders using Amazon\'s Buy Shipping Services.
5
- *
6
- * The version of the OpenAPI document: v0
7
- *
8
- *
9
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
10
- * https://openapi-generator.tech
11
- * Do not edit the class manually.
12
- */
13
- export class Configuration {
14
- /**
15
- * parameter for apiKey security
16
- * @param name security name
17
- */
18
- apiKey;
19
- /**
20
- * parameter for basic security
21
- */
22
- username;
23
- /**
24
- * parameter for basic security
25
- */
26
- password;
27
- /**
28
- * parameter for oauth2 security
29
- * @param name security name
30
- * @param scopes oauth2 scope
31
- */
32
- accessToken;
33
- /**
34
- * parameter for aws4 signature security
35
- * @param {Object} AWS4Signature - AWS4 Signature security
36
- * @param {string} options.region - aws region
37
- * @param {string} options.service - name of the service.
38
- * @param {string} credentials.accessKeyId - aws access key id
39
- * @param {string} credentials.secretAccessKey - aws access key
40
- * @param {string} credentials.sessionToken - aws session token
41
- * @memberof Configuration
42
- */
43
- awsv4;
44
- /**
45
- * override base path
46
- */
47
- basePath;
48
- /**
49
- * override server index
50
- */
51
- serverIndex;
52
- /**
53
- * base options for axios calls
54
- */
55
- baseOptions;
56
- /**
57
- * The FormData constructor that will be used to create multipart form data
58
- * requests. You can inject this here so that execution environments that
59
- * do not support the FormData class can still run the generated client.
60
- *
61
- * @type {new () => FormData}
62
- */
63
- formDataCtor;
64
- constructor(param = {}) {
65
- this.apiKey = param.apiKey;
66
- this.username = param.username;
67
- this.password = param.password;
68
- this.accessToken = param.accessToken;
69
- this.awsv4 = param.awsv4;
70
- this.basePath = param.basePath;
71
- this.serverIndex = param.serverIndex;
72
- this.baseOptions = {
73
- ...param.baseOptions,
74
- headers: {
75
- ...param.baseOptions?.headers,
76
- },
77
- };
78
- this.formDataCtor = param.formDataCtor;
79
- }
80
- /**
81
- * Check if the given MIME is a JSON MIME.
82
- * JSON MIME examples:
83
- * application/json
84
- * application/json; charset=UTF8
85
- * APPLICATION/JSON
86
- * application/vnd.company+json
87
- * @param mime - MIME (Multipurpose Internet Mail Extensions)
88
- * @return True if the given MIME is JSON, false otherwise.
89
- */
90
- isJsonMime(mime) {
91
- const jsonMime = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i');
92
- return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json');
93
- }
94
- }
@@ -1,16 +0,0 @@
1
- /* tslint:disable */
2
- /* eslint-disable */
3
- /**
4
- * Selling Partner API for Merchant Fulfillment
5
- * With the Selling Partner API for Merchant Fulfillment, you can build applications that sellers can use to purchase shipping for non-Prime and Prime orders using Amazon\'s Buy Shipping Services.
6
- *
7
- * The version of the OpenAPI document: v0
8
- *
9
- *
10
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
- * https://openapi-generator.tech
12
- * Do not edit the class manually.
13
- */
14
- export * from "./api";
15
- export * from "./configuration";
16
- export * from "./models";
@@ -1,14 +0,0 @@
1
- /* tslint:disable */
2
- /* eslint-disable */
3
- /**
4
- * Selling Partner API for Merchant Fulfillment
5
- * With the Selling Partner API for Merchant Fulfillment, you can build applications that sellers can use to purchase shipping for non-Prime and Prime orders using Amazon\'s Buy Shipping Services.
6
- *
7
- * The version of the OpenAPI document: v0
8
- *
9
- *
10
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
- * https://openapi-generator.tech
12
- * Do not edit the class manually.
13
- */
14
- export {};