@sp-api-sdk/supply-sources-api-2020-07-01 1.1.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 (141) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +97 -0
  3. package/dist/cjs/index.js +18 -0
  4. package/dist/cjs/src/api-model/api/supply-sources-api.js +419 -0
  5. package/dist/cjs/src/api-model/api.js +30 -0
  6. package/dist/cjs/src/api-model/base.js +66 -0
  7. package/dist/cjs/src/api-model/common.js +145 -0
  8. package/dist/cjs/src/api-model/configuration.js +91 -0
  9. package/dist/cjs/src/api-model/index.js +32 -0
  10. package/dist/cjs/src/api-model/models/address-with-contact.js +15 -0
  11. package/dist/cjs/src/api-model/models/address.js +15 -0
  12. package/dist/cjs/src/api-model/models/contact-details-primary.js +15 -0
  13. package/dist/cjs/src/api-model/models/contact-details.js +15 -0
  14. package/dist/cjs/src/api-model/models/create-supply-source-request.js +15 -0
  15. package/dist/cjs/src/api-model/models/create-supply-source-response.js +15 -0
  16. package/dist/cjs/src/api-model/models/curbside-pickup-configuration.js +15 -0
  17. package/dist/cjs/src/api-model/models/delivery-channel.js +15 -0
  18. package/dist/cjs/src/api-model/models/duration.js +15 -0
  19. package/dist/cjs/src/api-model/models/error-list.js +15 -0
  20. package/dist/cjs/src/api-model/models/get-supply-sources-response.js +15 -0
  21. package/dist/cjs/src/api-model/models/in-store-pickup-configuration.js +15 -0
  22. package/dist/cjs/src/api-model/models/index.js +53 -0
  23. package/dist/cjs/src/api-model/models/model-error.js +15 -0
  24. package/dist/cjs/src/api-model/models/operating-hour.js +15 -0
  25. package/dist/cjs/src/api-model/models/operating-hours-by-day.js +15 -0
  26. package/dist/cjs/src/api-model/models/operational-configuration.js +15 -0
  27. package/dist/cjs/src/api-model/models/outbound-capability.js +15 -0
  28. package/dist/cjs/src/api-model/models/parking-configuration.js +15 -0
  29. package/dist/cjs/src/api-model/models/parking-cost-type.js +25 -0
  30. package/dist/cjs/src/api-model/models/parking-spot-identification-type.js +25 -0
  31. package/dist/cjs/src/api-model/models/parking-with-address-configuration-all-of.js +15 -0
  32. package/dist/cjs/src/api-model/models/parking-with-address-configuration.js +15 -0
  33. package/dist/cjs/src/api-model/models/pickup-channel.js +15 -0
  34. package/dist/cjs/src/api-model/models/return-location.js +15 -0
  35. package/dist/cjs/src/api-model/models/services-capability.js +15 -0
  36. package/dist/cjs/src/api-model/models/supply-source-capabilities.js +15 -0
  37. package/dist/cjs/src/api-model/models/supply-source-configuration.js +15 -0
  38. package/dist/cjs/src/api-model/models/supply-source-list-inner.js +15 -0
  39. package/dist/cjs/src/api-model/models/supply-source-status-read-only.js +26 -0
  40. package/dist/cjs/src/api-model/models/supply-source-status.js +25 -0
  41. package/dist/cjs/src/api-model/models/supply-source.js +15 -0
  42. package/dist/cjs/src/api-model/models/throughput-cap.js +15 -0
  43. package/dist/cjs/src/api-model/models/throughput-config.js +15 -0
  44. package/dist/cjs/src/api-model/models/throughput-unit.js +24 -0
  45. package/dist/cjs/src/api-model/models/time-unit.js +26 -0
  46. package/dist/cjs/src/api-model/models/update-supply-source-request.js +15 -0
  47. package/dist/cjs/src/api-model/models/update-supply-source-status-request.js +15 -0
  48. package/dist/cjs/src/client.js +13 -0
  49. package/dist/es/index.js +2 -0
  50. package/dist/es/src/api-model/api/supply-sources-api.js +409 -0
  51. package/dist/es/src/api-model/api.js +14 -0
  52. package/dist/es/src/api-model/base.js +58 -0
  53. package/dist/es/src/api-model/common.js +133 -0
  54. package/dist/es/src/api-model/configuration.js +87 -0
  55. package/dist/es/src/api-model/index.js +16 -0
  56. package/dist/es/src/api-model/models/address-with-contact.js +14 -0
  57. package/dist/es/src/api-model/models/address.js +14 -0
  58. package/dist/es/src/api-model/models/contact-details-primary.js +14 -0
  59. package/dist/es/src/api-model/models/contact-details.js +14 -0
  60. package/dist/es/src/api-model/models/create-supply-source-request.js +14 -0
  61. package/dist/es/src/api-model/models/create-supply-source-response.js +14 -0
  62. package/dist/es/src/api-model/models/curbside-pickup-configuration.js +14 -0
  63. package/dist/es/src/api-model/models/delivery-channel.js +14 -0
  64. package/dist/es/src/api-model/models/duration.js +14 -0
  65. package/dist/es/src/api-model/models/error-list.js +14 -0
  66. package/dist/es/src/api-model/models/get-supply-sources-response.js +14 -0
  67. package/dist/es/src/api-model/models/in-store-pickup-configuration.js +14 -0
  68. package/dist/es/src/api-model/models/index.js +37 -0
  69. package/dist/es/src/api-model/models/model-error.js +14 -0
  70. package/dist/es/src/api-model/models/operating-hour.js +14 -0
  71. package/dist/es/src/api-model/models/operating-hours-by-day.js +14 -0
  72. package/dist/es/src/api-model/models/operational-configuration.js +14 -0
  73. package/dist/es/src/api-model/models/outbound-capability.js +14 -0
  74. package/dist/es/src/api-model/models/parking-configuration.js +14 -0
  75. package/dist/es/src/api-model/models/parking-cost-type.js +22 -0
  76. package/dist/es/src/api-model/models/parking-spot-identification-type.js +22 -0
  77. package/dist/es/src/api-model/models/parking-with-address-configuration-all-of.js +14 -0
  78. package/dist/es/src/api-model/models/parking-with-address-configuration.js +14 -0
  79. package/dist/es/src/api-model/models/pickup-channel.js +14 -0
  80. package/dist/es/src/api-model/models/return-location.js +14 -0
  81. package/dist/es/src/api-model/models/services-capability.js +14 -0
  82. package/dist/es/src/api-model/models/supply-source-capabilities.js +14 -0
  83. package/dist/es/src/api-model/models/supply-source-configuration.js +14 -0
  84. package/dist/es/src/api-model/models/supply-source-list-inner.js +14 -0
  85. package/dist/es/src/api-model/models/supply-source-status-read-only.js +23 -0
  86. package/dist/es/src/api-model/models/supply-source-status.js +22 -0
  87. package/dist/es/src/api-model/models/supply-source.js +14 -0
  88. package/dist/es/src/api-model/models/throughput-cap.js +14 -0
  89. package/dist/es/src/api-model/models/throughput-config.js +14 -0
  90. package/dist/es/src/api-model/models/throughput-unit.js +21 -0
  91. package/dist/es/src/api-model/models/time-unit.js +23 -0
  92. package/dist/es/src/api-model/models/update-supply-source-request.js +14 -0
  93. package/dist/es/src/api-model/models/update-supply-source-status-request.js +14 -0
  94. package/dist/es/src/client.js +9 -0
  95. package/dist/types/index.d.ts +2 -0
  96. package/dist/types/src/api-model/api/supply-sources-api.d.ts +323 -0
  97. package/dist/types/src/api-model/api.d.ts +12 -0
  98. package/dist/types/src/api-model/base.d.ts +54 -0
  99. package/dist/types/src/api-model/common.d.ts +66 -0
  100. package/dist/types/src/api-model/configuration.d.ts +83 -0
  101. package/dist/types/src/api-model/index.d.ts +14 -0
  102. package/dist/types/src/api-model/models/address-with-contact.d.ts +32 -0
  103. package/dist/types/src/api-model/models/address.d.ts +84 -0
  104. package/dist/types/src/api-model/models/contact-details-primary.d.ts +30 -0
  105. package/dist/types/src/api-model/models/contact-details.d.ts +25 -0
  106. package/dist/types/src/api-model/models/create-supply-source-request.d.ts +37 -0
  107. package/dist/types/src/api-model/models/create-supply-source-response.d.ts +30 -0
  108. package/dist/types/src/api-model/models/curbside-pickup-configuration.d.ts +38 -0
  109. package/dist/types/src/api-model/models/delivery-channel.d.ts +31 -0
  110. package/dist/types/src/api-model/models/duration.d.ts +31 -0
  111. package/dist/types/src/api-model/models/error-list.d.ts +24 -0
  112. package/dist/types/src/api-model/models/get-supply-sources-response.d.ts +31 -0
  113. package/dist/types/src/api-model/models/in-store-pickup-configuration.d.ts +31 -0
  114. package/dist/types/src/api-model/models/index.d.ts +37 -0
  115. package/dist/types/src/api-model/models/model-error.d.ts +36 -0
  116. package/dist/types/src/api-model/models/operating-hour.d.ts +30 -0
  117. package/dist/types/src/api-model/models/operating-hours-by-day.d.ts +61 -0
  118. package/dist/types/src/api-model/models/operational-configuration.d.ts +46 -0
  119. package/dist/types/src/api-model/models/outbound-capability.d.ts +52 -0
  120. package/dist/types/src/api-model/models/parking-configuration.d.ts +38 -0
  121. package/dist/types/src/api-model/models/parking-cost-type.d.ts +21 -0
  122. package/dist/types/src/api-model/models/parking-spot-identification-type.d.ts +21 -0
  123. package/dist/types/src/api-model/models/parking-with-address-configuration-all-of.d.ts +25 -0
  124. package/dist/types/src/api-model/models/parking-with-address-configuration.d.ts +19 -0
  125. package/dist/types/src/api-model/models/pickup-channel.d.ts +52 -0
  126. package/dist/types/src/api-model/models/return-location.d.ts +31 -0
  127. package/dist/types/src/api-model/models/services-capability.d.ts +31 -0
  128. package/dist/types/src/api-model/models/supply-source-capabilities.d.ts +32 -0
  129. package/dist/types/src/api-model/models/supply-source-configuration.d.ts +31 -0
  130. package/dist/types/src/api-model/models/supply-source-list-inner.d.ts +43 -0
  131. package/dist/types/src/api-model/models/supply-source-status-read-only.d.ts +22 -0
  132. package/dist/types/src/api-model/models/supply-source-status.d.ts +21 -0
  133. package/dist/types/src/api-model/models/supply-source.d.ts +76 -0
  134. package/dist/types/src/api-model/models/throughput-cap.d.ts +31 -0
  135. package/dist/types/src/api-model/models/throughput-config.d.ts +32 -0
  136. package/dist/types/src/api-model/models/throughput-unit.d.ts +20 -0
  137. package/dist/types/src/api-model/models/time-unit.d.ts +22 -0
  138. package/dist/types/src/api-model/models/update-supply-source-request.d.ts +38 -0
  139. package/dist/types/src/api-model/models/update-supply-source-status-request.d.ts +25 -0
  140. package/dist/types/src/client.d.ts +6 -0
  141. package/package.json +44 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2021 Bizon
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,97 @@
1
+ # `supply-sources-api-2020-07-01`
2
+
3
+ Manage configurations and capabilities of seller supply sources.
4
+
5
+ [![npm version](https://badgen.net/npm/v/@sp-api-sdk/supply-sources-api-2020-07-01)](https://www.npmjs.com/package/@sp-api-sdk/supply-sources-api-2020-07-01)
6
+ [![XO code style](https://badgen.net/badge/code%20style/XO/cyan)](https://github.com/xojs/xo)
7
+
8
+ ## Documentation
9
+
10
+ Learn more about this Selling Partner API by visiting the [official documentation](https://developer-docs.amazon.com/sp-api/docs).
11
+
12
+ Also, see the [generated documentation](https://bizon.github.io/selling-partner-api-sdk/modules/_sp_api_sdk_supply_sources_api_2020_07_01.html) for this API client.
13
+
14
+ ## Installing
15
+
16
+ ```sh
17
+ npm install @sp-api-sdk/supply-sources-api-2020-07-01
18
+ ```
19
+
20
+ ## Getting Started
21
+
22
+ ```javascript
23
+ import {SellingPartnerApiAuth} from '@sp-api-sdk/auth'
24
+ import {SupplySourcesApiClient} from '@sp-api-sdk/supply-sources-api-2020-07-01'
25
+
26
+ const auth = new SellingPartnerApiAuth({
27
+ clientId: process.env.LWA_CLIENT_ID,
28
+ clientSecret: process.env.LWA_CLIENT_SECRET,
29
+ refreshToken: 'Atzr|…',
30
+ })
31
+
32
+ const client = new SupplySourcesApiClient({
33
+ auth,
34
+ region: 'eu',
35
+ })
36
+ ```
37
+
38
+ ## Rate Limiting
39
+
40
+ In order to retry rate limited requests (HTTP 429), you can configure the API client as such:
41
+
42
+ ```javascript
43
+ const client = new SupplySourcesApiClient({
44
+ auth,
45
+ region: 'eu',
46
+ rateLimiting: {
47
+ retry: true,
48
+ // Optionally specify a callback that will be called on every retry.
49
+ onRetry: (retryInfo) => {
50
+ console.log(retryInfo)
51
+ },
52
+ },
53
+ })
54
+ ```
55
+
56
+ The rate limits used for each route are specified in the [API documentation](https://developer-docs.amazon.com/sp-api/docs).
57
+
58
+ ## Logging
59
+
60
+ You can enable logging for both SP-API requests and responses by configuring the `logging.request` and `logging.response` properties.
61
+
62
+ ```javascript
63
+ const client = new SupplySourcesApiClient({
64
+ auth,
65
+ region: 'eu',
66
+ logging: {
67
+ request: {
68
+ logger: console.debug
69
+ },
70
+ response: {
71
+ logger: console.debug
72
+ },
73
+ error: true,
74
+ },
75
+ })
76
+ ```
77
+
78
+ Specifying `true` will use the default options, specifying an object will allow you to override the default options.
79
+ This uses [axios-logger](https://github.com/hg-pyun/axios-logger) under the hood.
80
+ By default, if enabled, the `request` and `response` loggers will use `console.info` and the `error` logger will use `console.error`.
81
+
82
+
83
+ ## License
84
+
85
+ MIT
86
+
87
+ ## Miscellaneous
88
+
89
+ ```
90
+ ╚⊙ ⊙╝
91
+ ╚═(███)═╝
92
+ ╚═(███)═╝
93
+ ╚═(███)═╝
94
+ ╚═(███)═╝
95
+ ╚═(███)═╝
96
+ ╚═(███)═╝
97
+ ```
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./src/client"), exports);
18
+ __exportStar(require("./src/api-model/models"), exports);
@@ -0,0 +1,419 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * Selling Partner API for Supply Sources
6
+ * Manage configurations and capabilities of seller supply sources.
7
+ *
8
+ * The version of the OpenAPI document: 2020-07-01
9
+ *
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ var __importDefault = (this && this.__importDefault) || function (mod) {
16
+ return (mod && mod.__esModule) ? mod : { "default": mod };
17
+ };
18
+ Object.defineProperty(exports, "__esModule", { value: true });
19
+ exports.SupplySourcesApi = exports.SupplySourcesApiFactory = exports.SupplySourcesApiFp = exports.SupplySourcesApiAxiosParamCreator = void 0;
20
+ const axios_1 = __importDefault(require("axios"));
21
+ // Some imports not used depending on template conditions
22
+ // @ts-ignore
23
+ const common_1 = require("../common");
24
+ // @ts-ignore
25
+ const base_1 = require("../base");
26
+ /**
27
+ * SupplySourcesApi - axios parameter creator
28
+ * @export
29
+ */
30
+ const SupplySourcesApiAxiosParamCreator = function (configuration) {
31
+ return {
32
+ /**
33
+ * Archive a supply source, making it inactive. Cannot be undone.
34
+ * @param {string} supplySourceId The unique identifier of a supply source.
35
+ * @param {*} [options] Override http request option.
36
+ * @throws {RequiredError}
37
+ */
38
+ archiveSupplySource: async (supplySourceId, options = {}) => {
39
+ // verify required parameter 'supplySourceId' is not null or undefined
40
+ (0, common_1.assertParamExists)('archiveSupplySource', 'supplySourceId', supplySourceId);
41
+ const localVarPath = `/supplySources/2020-07-01/supplySources/{supplySourceId}`
42
+ .replace(`{${"supplySourceId"}}`, encodeURIComponent(String(supplySourceId)));
43
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
44
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
45
+ let baseOptions;
46
+ if (configuration) {
47
+ baseOptions = configuration.baseOptions;
48
+ }
49
+ const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options };
50
+ const localVarHeaderParameter = {};
51
+ const localVarQueryParameter = {};
52
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
53
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
54
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
55
+ return {
56
+ url: (0, common_1.toPathString)(localVarUrlObj),
57
+ options: localVarRequestOptions,
58
+ };
59
+ },
60
+ /**
61
+ * Create a new supply source.
62
+ * @param {CreateSupplySourceRequest} payload A request to create a supply source.
63
+ * @param {*} [options] Override http request option.
64
+ * @throws {RequiredError}
65
+ */
66
+ createSupplySource: async (payload, options = {}) => {
67
+ // verify required parameter 'payload' is not null or undefined
68
+ (0, common_1.assertParamExists)('createSupplySource', 'payload', payload);
69
+ const localVarPath = `/supplySources/2020-07-01/supplySources`;
70
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
71
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
72
+ let baseOptions;
73
+ if (configuration) {
74
+ baseOptions = configuration.baseOptions;
75
+ }
76
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options };
77
+ const localVarHeaderParameter = {};
78
+ const localVarQueryParameter = {};
79
+ localVarHeaderParameter['Content-Type'] = 'application/json';
80
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
81
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
82
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
83
+ localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(payload, localVarRequestOptions, configuration);
84
+ return {
85
+ url: (0, common_1.toPathString)(localVarUrlObj),
86
+ options: localVarRequestOptions,
87
+ };
88
+ },
89
+ /**
90
+ * Retrieve a supply source.
91
+ * @param {string} supplySourceId The unique identifier of a supply source.
92
+ * @param {*} [options] Override http request option.
93
+ * @throws {RequiredError}
94
+ */
95
+ getSupplySource: async (supplySourceId, options = {}) => {
96
+ // verify required parameter 'supplySourceId' is not null or undefined
97
+ (0, common_1.assertParamExists)('getSupplySource', 'supplySourceId', supplySourceId);
98
+ const localVarPath = `/supplySources/2020-07-01/supplySources/{supplySourceId}`
99
+ .replace(`{${"supplySourceId"}}`, encodeURIComponent(String(supplySourceId)));
100
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
101
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
102
+ let baseOptions;
103
+ if (configuration) {
104
+ baseOptions = configuration.baseOptions;
105
+ }
106
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
107
+ const localVarHeaderParameter = {};
108
+ const localVarQueryParameter = {};
109
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
110
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
111
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
112
+ return {
113
+ url: (0, common_1.toPathString)(localVarUrlObj),
114
+ options: localVarRequestOptions,
115
+ };
116
+ },
117
+ /**
118
+ * The path to retrieve paginated supply sources.
119
+ * @param {string} [nextPageToken] The pagination token to retrieve a specific page of results.
120
+ * @param {number} [pageSize] The number of supply sources to return per paginated request.
121
+ * @param {*} [options] Override http request option.
122
+ * @throws {RequiredError}
123
+ */
124
+ getSupplySources: async (nextPageToken, pageSize, options = {}) => {
125
+ const localVarPath = `/supplySources/2020-07-01/supplySources`;
126
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
127
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
128
+ let baseOptions;
129
+ if (configuration) {
130
+ baseOptions = configuration.baseOptions;
131
+ }
132
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
133
+ const localVarHeaderParameter = {};
134
+ const localVarQueryParameter = {};
135
+ if (nextPageToken !== undefined) {
136
+ localVarQueryParameter['nextPageToken'] = nextPageToken;
137
+ }
138
+ if (pageSize !== undefined) {
139
+ localVarQueryParameter['pageSize'] = pageSize;
140
+ }
141
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
142
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
143
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
144
+ return {
145
+ url: (0, common_1.toPathString)(localVarUrlObj),
146
+ options: localVarRequestOptions,
147
+ };
148
+ },
149
+ /**
150
+ * Update the configuration and capabilities of a supply source.
151
+ * @param {string} supplySourceId The unique identitier of a supply source.
152
+ * @param {UpdateSupplySourceRequest} [payload]
153
+ * @param {*} [options] Override http request option.
154
+ * @throws {RequiredError}
155
+ */
156
+ updateSupplySource: async (supplySourceId, payload, options = {}) => {
157
+ // verify required parameter 'supplySourceId' is not null or undefined
158
+ (0, common_1.assertParamExists)('updateSupplySource', 'supplySourceId', supplySourceId);
159
+ const localVarPath = `/supplySources/2020-07-01/supplySources/{supplySourceId}`
160
+ .replace(`{${"supplySourceId"}}`, encodeURIComponent(String(supplySourceId)));
161
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
162
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
163
+ let baseOptions;
164
+ if (configuration) {
165
+ baseOptions = configuration.baseOptions;
166
+ }
167
+ const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options };
168
+ const localVarHeaderParameter = {};
169
+ const localVarQueryParameter = {};
170
+ localVarHeaderParameter['Content-Type'] = 'application/json';
171
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
172
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
173
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
174
+ localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(payload, localVarRequestOptions, configuration);
175
+ return {
176
+ url: (0, common_1.toPathString)(localVarUrlObj),
177
+ options: localVarRequestOptions,
178
+ };
179
+ },
180
+ /**
181
+ * Update the status of a supply source.
182
+ * @param {string} supplySourceId The unique identifier of a supply source.
183
+ * @param {UpdateSupplySourceStatusRequest} [payload]
184
+ * @param {*} [options] Override http request option.
185
+ * @throws {RequiredError}
186
+ */
187
+ updateSupplySourceStatus: async (supplySourceId, payload, options = {}) => {
188
+ // verify required parameter 'supplySourceId' is not null or undefined
189
+ (0, common_1.assertParamExists)('updateSupplySourceStatus', 'supplySourceId', supplySourceId);
190
+ const localVarPath = `/supplySources/2020-07-01/supplySources/{supplySourceId}/status`
191
+ .replace(`{${"supplySourceId"}}`, encodeURIComponent(String(supplySourceId)));
192
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
193
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
194
+ let baseOptions;
195
+ if (configuration) {
196
+ baseOptions = configuration.baseOptions;
197
+ }
198
+ const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options };
199
+ const localVarHeaderParameter = {};
200
+ const localVarQueryParameter = {};
201
+ localVarHeaderParameter['Content-Type'] = 'application/json';
202
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
203
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
204
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
205
+ localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(payload, localVarRequestOptions, configuration);
206
+ return {
207
+ url: (0, common_1.toPathString)(localVarUrlObj),
208
+ options: localVarRequestOptions,
209
+ };
210
+ },
211
+ };
212
+ };
213
+ exports.SupplySourcesApiAxiosParamCreator = SupplySourcesApiAxiosParamCreator;
214
+ /**
215
+ * SupplySourcesApi - functional programming interface
216
+ * @export
217
+ */
218
+ const SupplySourcesApiFp = function (configuration) {
219
+ const localVarAxiosParamCreator = (0, exports.SupplySourcesApiAxiosParamCreator)(configuration);
220
+ return {
221
+ /**
222
+ * Archive a supply source, making it inactive. Cannot be undone.
223
+ * @param {string} supplySourceId The unique identifier of a supply source.
224
+ * @param {*} [options] Override http request option.
225
+ * @throws {RequiredError}
226
+ */
227
+ async archiveSupplySource(supplySourceId, options) {
228
+ const localVarAxiosArgs = await localVarAxiosParamCreator.archiveSupplySource(supplySourceId, options);
229
+ return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
230
+ },
231
+ /**
232
+ * Create a new supply source.
233
+ * @param {CreateSupplySourceRequest} payload A request to create a supply source.
234
+ * @param {*} [options] Override http request option.
235
+ * @throws {RequiredError}
236
+ */
237
+ async createSupplySource(payload, options) {
238
+ const localVarAxiosArgs = await localVarAxiosParamCreator.createSupplySource(payload, options);
239
+ return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
240
+ },
241
+ /**
242
+ * Retrieve a supply source.
243
+ * @param {string} supplySourceId The unique identifier of a supply source.
244
+ * @param {*} [options] Override http request option.
245
+ * @throws {RequiredError}
246
+ */
247
+ async getSupplySource(supplySourceId, options) {
248
+ const localVarAxiosArgs = await localVarAxiosParamCreator.getSupplySource(supplySourceId, options);
249
+ return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
250
+ },
251
+ /**
252
+ * The path to retrieve paginated supply sources.
253
+ * @param {string} [nextPageToken] The pagination token to retrieve a specific page of results.
254
+ * @param {number} [pageSize] The number of supply sources to return per paginated request.
255
+ * @param {*} [options] Override http request option.
256
+ * @throws {RequiredError}
257
+ */
258
+ async getSupplySources(nextPageToken, pageSize, options) {
259
+ const localVarAxiosArgs = await localVarAxiosParamCreator.getSupplySources(nextPageToken, pageSize, options);
260
+ return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
261
+ },
262
+ /**
263
+ * Update the configuration and capabilities of a supply source.
264
+ * @param {string} supplySourceId The unique identitier of a supply source.
265
+ * @param {UpdateSupplySourceRequest} [payload]
266
+ * @param {*} [options] Override http request option.
267
+ * @throws {RequiredError}
268
+ */
269
+ async updateSupplySource(supplySourceId, payload, options) {
270
+ const localVarAxiosArgs = await localVarAxiosParamCreator.updateSupplySource(supplySourceId, payload, options);
271
+ return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
272
+ },
273
+ /**
274
+ * Update the status of a supply source.
275
+ * @param {string} supplySourceId The unique identifier of a supply source.
276
+ * @param {UpdateSupplySourceStatusRequest} [payload]
277
+ * @param {*} [options] Override http request option.
278
+ * @throws {RequiredError}
279
+ */
280
+ async updateSupplySourceStatus(supplySourceId, payload, options) {
281
+ const localVarAxiosArgs = await localVarAxiosParamCreator.updateSupplySourceStatus(supplySourceId, payload, options);
282
+ return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
283
+ },
284
+ };
285
+ };
286
+ exports.SupplySourcesApiFp = SupplySourcesApiFp;
287
+ /**
288
+ * SupplySourcesApi - factory interface
289
+ * @export
290
+ */
291
+ const SupplySourcesApiFactory = function (configuration, basePath, axios) {
292
+ const localVarFp = (0, exports.SupplySourcesApiFp)(configuration);
293
+ return {
294
+ /**
295
+ * Archive a supply source, making it inactive. Cannot be undone.
296
+ * @param {SupplySourcesApiArchiveSupplySourceRequest} requestParameters Request parameters.
297
+ * @param {*} [options] Override http request option.
298
+ * @throws {RequiredError}
299
+ */
300
+ archiveSupplySource(requestParameters, options) {
301
+ return localVarFp.archiveSupplySource(requestParameters.supplySourceId, options).then((request) => request(axios, basePath));
302
+ },
303
+ /**
304
+ * Create a new supply source.
305
+ * @param {SupplySourcesApiCreateSupplySourceRequest} requestParameters Request parameters.
306
+ * @param {*} [options] Override http request option.
307
+ * @throws {RequiredError}
308
+ */
309
+ createSupplySource(requestParameters, options) {
310
+ return localVarFp.createSupplySource(requestParameters.payload, options).then((request) => request(axios, basePath));
311
+ },
312
+ /**
313
+ * Retrieve a supply source.
314
+ * @param {SupplySourcesApiGetSupplySourceRequest} requestParameters Request parameters.
315
+ * @param {*} [options] Override http request option.
316
+ * @throws {RequiredError}
317
+ */
318
+ getSupplySource(requestParameters, options) {
319
+ return localVarFp.getSupplySource(requestParameters.supplySourceId, options).then((request) => request(axios, basePath));
320
+ },
321
+ /**
322
+ * The path to retrieve paginated supply sources.
323
+ * @param {SupplySourcesApiGetSupplySourcesRequest} requestParameters Request parameters.
324
+ * @param {*} [options] Override http request option.
325
+ * @throws {RequiredError}
326
+ */
327
+ getSupplySources(requestParameters = {}, options) {
328
+ return localVarFp.getSupplySources(requestParameters.nextPageToken, requestParameters.pageSize, options).then((request) => request(axios, basePath));
329
+ },
330
+ /**
331
+ * Update the configuration and capabilities of a supply source.
332
+ * @param {SupplySourcesApiUpdateSupplySourceRequest} requestParameters Request parameters.
333
+ * @param {*} [options] Override http request option.
334
+ * @throws {RequiredError}
335
+ */
336
+ updateSupplySource(requestParameters, options) {
337
+ return localVarFp.updateSupplySource(requestParameters.supplySourceId, requestParameters.payload, options).then((request) => request(axios, basePath));
338
+ },
339
+ /**
340
+ * Update the status of a supply source.
341
+ * @param {SupplySourcesApiUpdateSupplySourceStatusRequest} requestParameters Request parameters.
342
+ * @param {*} [options] Override http request option.
343
+ * @throws {RequiredError}
344
+ */
345
+ updateSupplySourceStatus(requestParameters, options) {
346
+ return localVarFp.updateSupplySourceStatus(requestParameters.supplySourceId, requestParameters.payload, options).then((request) => request(axios, basePath));
347
+ },
348
+ };
349
+ };
350
+ exports.SupplySourcesApiFactory = SupplySourcesApiFactory;
351
+ /**
352
+ * SupplySourcesApi - object-oriented interface
353
+ * @export
354
+ * @class SupplySourcesApi
355
+ * @extends {BaseAPI}
356
+ */
357
+ class SupplySourcesApi extends base_1.BaseAPI {
358
+ /**
359
+ * Archive a supply source, making it inactive. Cannot be undone.
360
+ * @param {SupplySourcesApiArchiveSupplySourceRequest} requestParameters Request parameters.
361
+ * @param {*} [options] Override http request option.
362
+ * @throws {RequiredError}
363
+ * @memberof SupplySourcesApi
364
+ */
365
+ archiveSupplySource(requestParameters, options) {
366
+ return (0, exports.SupplySourcesApiFp)(this.configuration).archiveSupplySource(requestParameters.supplySourceId, options).then((request) => request(this.axios, this.basePath));
367
+ }
368
+ /**
369
+ * Create a new supply source.
370
+ * @param {SupplySourcesApiCreateSupplySourceRequest} requestParameters Request parameters.
371
+ * @param {*} [options] Override http request option.
372
+ * @throws {RequiredError}
373
+ * @memberof SupplySourcesApi
374
+ */
375
+ createSupplySource(requestParameters, options) {
376
+ return (0, exports.SupplySourcesApiFp)(this.configuration).createSupplySource(requestParameters.payload, options).then((request) => request(this.axios, this.basePath));
377
+ }
378
+ /**
379
+ * Retrieve a supply source.
380
+ * @param {SupplySourcesApiGetSupplySourceRequest} requestParameters Request parameters.
381
+ * @param {*} [options] Override http request option.
382
+ * @throws {RequiredError}
383
+ * @memberof SupplySourcesApi
384
+ */
385
+ getSupplySource(requestParameters, options) {
386
+ return (0, exports.SupplySourcesApiFp)(this.configuration).getSupplySource(requestParameters.supplySourceId, options).then((request) => request(this.axios, this.basePath));
387
+ }
388
+ /**
389
+ * The path to retrieve paginated supply sources.
390
+ * @param {SupplySourcesApiGetSupplySourcesRequest} requestParameters Request parameters.
391
+ * @param {*} [options] Override http request option.
392
+ * @throws {RequiredError}
393
+ * @memberof SupplySourcesApi
394
+ */
395
+ getSupplySources(requestParameters = {}, options) {
396
+ return (0, exports.SupplySourcesApiFp)(this.configuration).getSupplySources(requestParameters.nextPageToken, requestParameters.pageSize, options).then((request) => request(this.axios, this.basePath));
397
+ }
398
+ /**
399
+ * Update the configuration and capabilities of a supply source.
400
+ * @param {SupplySourcesApiUpdateSupplySourceRequest} requestParameters Request parameters.
401
+ * @param {*} [options] Override http request option.
402
+ * @throws {RequiredError}
403
+ * @memberof SupplySourcesApi
404
+ */
405
+ updateSupplySource(requestParameters, options) {
406
+ return (0, exports.SupplySourcesApiFp)(this.configuration).updateSupplySource(requestParameters.supplySourceId, requestParameters.payload, options).then((request) => request(this.axios, this.basePath));
407
+ }
408
+ /**
409
+ * Update the status of a supply source.
410
+ * @param {SupplySourcesApiUpdateSupplySourceStatusRequest} requestParameters Request parameters.
411
+ * @param {*} [options] Override http request option.
412
+ * @throws {RequiredError}
413
+ * @memberof SupplySourcesApi
414
+ */
415
+ updateSupplySourceStatus(requestParameters, options) {
416
+ return (0, exports.SupplySourcesApiFp)(this.configuration).updateSupplySourceStatus(requestParameters.supplySourceId, requestParameters.payload, options).then((request) => request(this.axios, this.basePath));
417
+ }
418
+ }
419
+ exports.SupplySourcesApi = SupplySourcesApi;
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * Selling Partner API for Supply Sources
6
+ * Manage configurations and capabilities of seller supply sources.
7
+ *
8
+ * The version of the OpenAPI document: 2020-07-01
9
+ *
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
16
+ if (k2 === undefined) k2 = k;
17
+ var desc = Object.getOwnPropertyDescriptor(m, k);
18
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
19
+ desc = { enumerable: true, get: function() { return m[k]; } };
20
+ }
21
+ Object.defineProperty(o, k2, desc);
22
+ }) : (function(o, m, k, k2) {
23
+ if (k2 === undefined) k2 = k;
24
+ o[k2] = m[k];
25
+ }));
26
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
27
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
28
+ };
29
+ Object.defineProperty(exports, "__esModule", { value: true });
30
+ __exportStar(require("./api/supply-sources-api"), exports);
@@ -0,0 +1,66 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * Selling Partner API for Supply Sources
6
+ * Manage configurations and capabilities of seller supply sources.
7
+ *
8
+ * The version of the OpenAPI document: 2020-07-01
9
+ *
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ var __importDefault = (this && this.__importDefault) || function (mod) {
16
+ return (mod && mod.__esModule) ? mod : { "default": mod };
17
+ };
18
+ Object.defineProperty(exports, "__esModule", { value: true });
19
+ exports.RequiredError = exports.BaseAPI = exports.COLLECTION_FORMATS = exports.BASE_PATH = void 0;
20
+ const axios_1 = __importDefault(require("axios"));
21
+ exports.BASE_PATH = "https://sellingpartnerapi-na.amazon.com".replace(/\/+$/, "");
22
+ /**
23
+ *
24
+ * @export
25
+ */
26
+ exports.COLLECTION_FORMATS = {
27
+ csv: ",",
28
+ ssv: " ",
29
+ tsv: "\t",
30
+ pipes: "|",
31
+ };
32
+ /**
33
+ *
34
+ * @export
35
+ * @class BaseAPI
36
+ */
37
+ class BaseAPI {
38
+ basePath;
39
+ axios;
40
+ configuration;
41
+ constructor(configuration, basePath = exports.BASE_PATH, axios = axios_1.default) {
42
+ this.basePath = basePath;
43
+ this.axios = axios;
44
+ if (configuration) {
45
+ this.configuration = configuration;
46
+ this.basePath = configuration.basePath || this.basePath;
47
+ }
48
+ }
49
+ }
50
+ exports.BaseAPI = BaseAPI;
51
+ ;
52
+ /**
53
+ *
54
+ * @export
55
+ * @class RequiredError
56
+ * @extends {Error}
57
+ */
58
+ class RequiredError extends Error {
59
+ field;
60
+ constructor(field, msg) {
61
+ super(msg);
62
+ this.field = field;
63
+ this.name = "RequiredError";
64
+ }
65
+ }
66
+ exports.RequiredError = RequiredError;