@sp-api-sdk/catalog-items-api-v0 4.0.17 → 5.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.
- package/README.md +7 -8
- package/dist/index.cjs +283 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +258 -0
- package/dist/index.d.ts +258 -0
- package/dist/index.js +254 -0
- package/dist/index.js.map +1 -0
- package/package.json +26 -12
- package/dist/cjs/api-model/api/catalog-items-api.js +0 -128
- package/dist/cjs/api-model/api.js +0 -30
- package/dist/cjs/api-model/base.js +0 -52
- package/dist/cjs/api-model/common.js +0 -123
- package/dist/cjs/api-model/configuration.js +0 -98
- package/dist/cjs/api-model/index.js +0 -32
- package/dist/cjs/api-model/models/categories.js +0 -15
- package/dist/cjs/api-model/models/index.js +0 -19
- package/dist/cjs/api-model/models/list-catalog-categories-response.js +0 -15
- package/dist/cjs/api-model/models/model-error.js +0 -15
- package/dist/cjs/client.js +0 -21
- package/dist/cjs/index.js +0 -18
- package/dist/es/api-model/api/catalog-items-api.js +0 -118
- package/dist/es/api-model/api.js +0 -14
- package/dist/es/api-model/base.js +0 -44
- package/dist/es/api-model/common.js +0 -110
- package/dist/es/api-model/configuration.js +0 -94
- package/dist/es/api-model/index.js +0 -16
- package/dist/es/api-model/models/categories.js +0 -14
- package/dist/es/api-model/models/index.js +0 -3
- package/dist/es/api-model/models/list-catalog-categories-response.js +0 -14
- package/dist/es/api-model/models/model-error.js +0 -14
- package/dist/es/client.js +0 -17
- package/dist/es/index.js +0 -2
- package/dist/types/api-model/api/catalog-items-api.d.ts +0 -85
- package/dist/types/api-model/api.d.ts +0 -12
- package/dist/types/api-model/base.d.ts +0 -42
- package/dist/types/api-model/common.d.ts +0 -34
- package/dist/types/api-model/configuration.d.ts +0 -98
- package/dist/types/api-model/index.d.ts +0 -14
- package/dist/types/api-model/models/categories.d.ts +0 -25
- package/dist/types/api-model/models/index.d.ts +0 -3
- package/dist/types/api-model/models/list-catalog-categories-response.d.ts +0 -19
- package/dist/types/api-model/models/model-error.d.ts +0 -28
- package/dist/types/client.d.ts +0 -6
- package/dist/types/index.d.ts +0 -3
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#
|
|
1
|
+
# `@sp-api-sdk/catalog-items-api-v0`
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/@sp-api-sdk/catalog-items-api-v0)
|
|
4
4
|
[](https://github.com/xojs/xo)
|
|
@@ -25,10 +25,10 @@ npm install @sp-api-sdk/catalog-items-api-v0
|
|
|
25
25
|
import {SellingPartnerApiAuth} from '@sp-api-sdk/auth'
|
|
26
26
|
import {CatalogItemsApiClient} from '@sp-api-sdk/catalog-items-api-v0'
|
|
27
27
|
|
|
28
|
+
// `clientId` and `clientSecret` default to the `LWA_CLIENT_ID` and
|
|
29
|
+
// `LWA_CLIENT_SECRET` environment variables.
|
|
28
30
|
const auth = new SellingPartnerApiAuth({
|
|
29
|
-
|
|
30
|
-
clientSecret: process.env.LWA_CLIENT_SECRET,
|
|
31
|
-
refreshToken: 'Atzr|…',
|
|
31
|
+
refreshToken: await getRefreshTokenForSeller(sellerId),
|
|
32
32
|
})
|
|
33
33
|
|
|
34
34
|
const client = new CatalogItemsApiClient({
|
|
@@ -67,10 +67,10 @@ const client = new CatalogItemsApiClient({
|
|
|
67
67
|
region: 'eu',
|
|
68
68
|
logging: {
|
|
69
69
|
request: {
|
|
70
|
-
logger: console.debug
|
|
70
|
+
logger: console.debug,
|
|
71
71
|
},
|
|
72
72
|
response: {
|
|
73
|
-
logger: console.debug
|
|
73
|
+
logger: console.debug,
|
|
74
74
|
},
|
|
75
75
|
error: true,
|
|
76
76
|
},
|
|
@@ -81,14 +81,13 @@ Specifying `true` will use the default options, specifying an object will allow
|
|
|
81
81
|
This uses [axios-logger](https://github.com/hg-pyun/axios-logger) under the hood.
|
|
82
82
|
By default, if enabled, the `request` and `response` loggers will use `console.info` and the `error` logger will use `console.error`.
|
|
83
83
|
|
|
84
|
-
|
|
85
84
|
## License
|
|
86
85
|
|
|
87
86
|
MIT
|
|
88
87
|
|
|
89
88
|
## Miscellaneous
|
|
90
89
|
|
|
91
|
-
```
|
|
90
|
+
```text
|
|
92
91
|
╚⊙ ⊙╝
|
|
93
92
|
╚═(███)═╝
|
|
94
93
|
╚═(███)═╝
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,283 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
//#region \0rolldown/runtime.js
|
|
3
|
+
var __create = Object.create;
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
11
|
+
key = keys[i];
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
13
|
+
get: ((k) => from[k]).bind(null, key),
|
|
14
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
20
|
+
value: mod,
|
|
21
|
+
enumerable: true
|
|
22
|
+
}) : target, mod));
|
|
23
|
+
//#endregion
|
|
24
|
+
let _sp_api_sdk_common = require("@sp-api-sdk/common");
|
|
25
|
+
let axios = require("axios");
|
|
26
|
+
axios = __toESM(axios, 1);
|
|
27
|
+
//#region src/api-model/base.ts
|
|
28
|
+
const BASE_PATH = "https://sellingpartnerapi-na.amazon.com".replace(/\/+$/, "");
|
|
29
|
+
var BaseAPI = class {
|
|
30
|
+
basePath;
|
|
31
|
+
axios;
|
|
32
|
+
configuration;
|
|
33
|
+
constructor(configuration, basePath = BASE_PATH, axios$3 = axios.default) {
|
|
34
|
+
this.basePath = basePath;
|
|
35
|
+
this.axios = axios$3;
|
|
36
|
+
if (configuration) {
|
|
37
|
+
this.configuration = configuration;
|
|
38
|
+
this.basePath = configuration.basePath ?? basePath;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
var RequiredError = class extends Error {
|
|
43
|
+
field;
|
|
44
|
+
constructor(field, msg) {
|
|
45
|
+
super(msg);
|
|
46
|
+
this.field = field;
|
|
47
|
+
this.name = "RequiredError";
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
const operationServerMap = {};
|
|
51
|
+
//#endregion
|
|
52
|
+
//#region src/api-model/common.ts
|
|
53
|
+
const DUMMY_BASE_URL = "https://example.com";
|
|
54
|
+
/**
|
|
55
|
+
*
|
|
56
|
+
* @throws {RequiredError}
|
|
57
|
+
*/
|
|
58
|
+
const assertParamExists = function(functionName, paramName, paramValue) {
|
|
59
|
+
if (paramValue === null || paramValue === void 0) throw new RequiredError(paramName, `Required parameter ${paramName} was null or undefined when calling ${functionName}.`);
|
|
60
|
+
};
|
|
61
|
+
function setFlattenedQueryParams(urlSearchParams, parameter, key = "") {
|
|
62
|
+
if (parameter == null) return;
|
|
63
|
+
if (typeof parameter === "object") if (Array.isArray(parameter) || parameter instanceof Set) parameter.forEach((item) => setFlattenedQueryParams(urlSearchParams, item, key));
|
|
64
|
+
else Object.keys(parameter).forEach((currentKey) => setFlattenedQueryParams(urlSearchParams, parameter[currentKey], `${key}${key !== "" ? "." : ""}${currentKey}`));
|
|
65
|
+
else if (urlSearchParams.has(key)) urlSearchParams.append(key, parameter);
|
|
66
|
+
else urlSearchParams.set(key, parameter);
|
|
67
|
+
}
|
|
68
|
+
const setSearchParams = function(url, ...objects) {
|
|
69
|
+
const searchParams = new URLSearchParams(url.search);
|
|
70
|
+
setFlattenedQueryParams(searchParams, objects);
|
|
71
|
+
url.search = searchParams.toString();
|
|
72
|
+
};
|
|
73
|
+
const toPathString = function(url) {
|
|
74
|
+
return url.pathname + url.search + url.hash;
|
|
75
|
+
};
|
|
76
|
+
const createRequestFunction = function(axiosArgs, globalAxios, BASE_PATH, configuration) {
|
|
77
|
+
return (axios = globalAxios, basePath = BASE_PATH) => {
|
|
78
|
+
const axiosRequestArgs = {
|
|
79
|
+
...axiosArgs.options,
|
|
80
|
+
url: (axios.defaults.baseURL ? "" : configuration?.basePath ?? basePath) + axiosArgs.url
|
|
81
|
+
};
|
|
82
|
+
return axios.request(axiosRequestArgs);
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
//#endregion
|
|
86
|
+
//#region src/api-model/api/catalog-items-api.ts
|
|
87
|
+
/**
|
|
88
|
+
* CatalogItemsApi - axios parameter creator
|
|
89
|
+
*/
|
|
90
|
+
const CatalogItemsApiAxiosParamCreator = function(configuration) {
|
|
91
|
+
return {
|
|
92
|
+
/**
|
|
93
|
+
* Returns the parent categories to which an item belongs, based on the specified ASIN or SellerSKU. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 2 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
|
|
94
|
+
* @param {string} marketplaceId A marketplace identifier. Specifies the marketplace for the item.
|
|
95
|
+
* @param {string} [aSIN] The Amazon Standard Identification Number (ASIN) of the item.
|
|
96
|
+
* @param {string} [sellerSKU] Used to identify items in the given marketplace. SellerSKU is qualified by the seller\'s SellerId, which is included with every operation that you submit.
|
|
97
|
+
* @param {*} [options] Override http request option.
|
|
98
|
+
* @throws {RequiredError}
|
|
99
|
+
*/
|
|
100
|
+
listCatalogCategories: async (marketplaceId, aSIN, sellerSKU, options = {}) => {
|
|
101
|
+
assertParamExists("listCatalogCategories", "marketplaceId", marketplaceId);
|
|
102
|
+
const localVarUrlObj = new URL(`/catalog/v0/categories`, DUMMY_BASE_URL);
|
|
103
|
+
let baseOptions;
|
|
104
|
+
if (configuration) baseOptions = configuration.baseOptions;
|
|
105
|
+
const localVarRequestOptions = {
|
|
106
|
+
method: "GET",
|
|
107
|
+
...baseOptions,
|
|
108
|
+
...options
|
|
109
|
+
};
|
|
110
|
+
const localVarHeaderParameter = {};
|
|
111
|
+
const localVarQueryParameter = {};
|
|
112
|
+
if (marketplaceId !== void 0) localVarQueryParameter["MarketplaceId"] = marketplaceId;
|
|
113
|
+
if (aSIN !== void 0) localVarQueryParameter["ASIN"] = aSIN;
|
|
114
|
+
if (sellerSKU !== void 0) localVarQueryParameter["SellerSKU"] = sellerSKU;
|
|
115
|
+
localVarHeaderParameter["Accept"] = "application/json";
|
|
116
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
117
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
118
|
+
localVarRequestOptions.headers = {
|
|
119
|
+
...localVarHeaderParameter,
|
|
120
|
+
...headersFromBaseOptions,
|
|
121
|
+
...options.headers
|
|
122
|
+
};
|
|
123
|
+
return {
|
|
124
|
+
url: toPathString(localVarUrlObj),
|
|
125
|
+
options: localVarRequestOptions
|
|
126
|
+
};
|
|
127
|
+
} };
|
|
128
|
+
};
|
|
129
|
+
/**
|
|
130
|
+
* CatalogItemsApi - functional programming interface
|
|
131
|
+
*/
|
|
132
|
+
const CatalogItemsApiFp = function(configuration) {
|
|
133
|
+
const localVarAxiosParamCreator = CatalogItemsApiAxiosParamCreator(configuration);
|
|
134
|
+
return {
|
|
135
|
+
/**
|
|
136
|
+
* Returns the parent categories to which an item belongs, based on the specified ASIN or SellerSKU. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 2 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
|
|
137
|
+
* @param {string} marketplaceId A marketplace identifier. Specifies the marketplace for the item.
|
|
138
|
+
* @param {string} [aSIN] The Amazon Standard Identification Number (ASIN) of the item.
|
|
139
|
+
* @param {string} [sellerSKU] Used to identify items in the given marketplace. SellerSKU is qualified by the seller\'s SellerId, which is included with every operation that you submit.
|
|
140
|
+
* @param {*} [options] Override http request option.
|
|
141
|
+
* @throws {RequiredError}
|
|
142
|
+
*/
|
|
143
|
+
async listCatalogCategories(marketplaceId, aSIN, sellerSKU, options) {
|
|
144
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.listCatalogCategories(marketplaceId, aSIN, sellerSKU, options);
|
|
145
|
+
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
146
|
+
const localVarOperationServerBasePath = operationServerMap["CatalogItemsApi.listCatalogCategories"]?.[localVarOperationServerIndex]?.url;
|
|
147
|
+
return (axios$1, basePath) => createRequestFunction(localVarAxiosArgs, axios.default, BASE_PATH, configuration)(axios$1, localVarOperationServerBasePath || basePath);
|
|
148
|
+
} };
|
|
149
|
+
};
|
|
150
|
+
/**
|
|
151
|
+
* CatalogItemsApi - factory interface
|
|
152
|
+
*/
|
|
153
|
+
const CatalogItemsApiFactory = function(configuration, basePath, axios$2) {
|
|
154
|
+
const localVarFp = CatalogItemsApiFp(configuration);
|
|
155
|
+
return {
|
|
156
|
+
/**
|
|
157
|
+
* Returns the parent categories to which an item belongs, based on the specified ASIN or SellerSKU. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 2 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
|
|
158
|
+
* @param {CatalogItemsApiListCatalogCategoriesRequest} requestParameters Request parameters.
|
|
159
|
+
* @param {*} [options] Override http request option.
|
|
160
|
+
* @throws {RequiredError}
|
|
161
|
+
*/
|
|
162
|
+
listCatalogCategories(requestParameters, options) {
|
|
163
|
+
return localVarFp.listCatalogCategories(requestParameters.marketplaceId, requestParameters.aSIN, requestParameters.sellerSKU, options).then((request) => request(axios$2, basePath));
|
|
164
|
+
} };
|
|
165
|
+
};
|
|
166
|
+
/**
|
|
167
|
+
* CatalogItemsApi - object-oriented interface
|
|
168
|
+
*/
|
|
169
|
+
var CatalogItemsApi = class extends BaseAPI {
|
|
170
|
+
/**
|
|
171
|
+
* Returns the parent categories to which an item belongs, based on the specified ASIN or SellerSKU. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 2 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
|
|
172
|
+
* @param {CatalogItemsApiListCatalogCategoriesRequest} requestParameters Request parameters.
|
|
173
|
+
* @param {*} [options] Override http request option.
|
|
174
|
+
* @throws {RequiredError}
|
|
175
|
+
*/
|
|
176
|
+
listCatalogCategories(requestParameters, options) {
|
|
177
|
+
return CatalogItemsApiFp(this.configuration).listCatalogCategories(requestParameters.marketplaceId, requestParameters.aSIN, requestParameters.sellerSKU, options).then((request) => request(this.axios, this.basePath));
|
|
178
|
+
}
|
|
179
|
+
};
|
|
180
|
+
//#endregion
|
|
181
|
+
//#region src/api-model/configuration.ts
|
|
182
|
+
var Configuration = class {
|
|
183
|
+
/**
|
|
184
|
+
* parameter for apiKey security
|
|
185
|
+
* @param name security name
|
|
186
|
+
*/
|
|
187
|
+
apiKey;
|
|
188
|
+
/**
|
|
189
|
+
* parameter for basic security
|
|
190
|
+
*/
|
|
191
|
+
username;
|
|
192
|
+
/**
|
|
193
|
+
* parameter for basic security
|
|
194
|
+
*/
|
|
195
|
+
password;
|
|
196
|
+
/**
|
|
197
|
+
* parameter for oauth2 security
|
|
198
|
+
* @param name security name
|
|
199
|
+
* @param scopes oauth2 scope
|
|
200
|
+
*/
|
|
201
|
+
accessToken;
|
|
202
|
+
/**
|
|
203
|
+
* parameter for aws4 signature security
|
|
204
|
+
* @param {Object} AWS4Signature - AWS4 Signature security
|
|
205
|
+
* @param {string} options.region - aws region
|
|
206
|
+
* @param {string} options.service - name of the service.
|
|
207
|
+
* @param {string} credentials.accessKeyId - aws access key id
|
|
208
|
+
* @param {string} credentials.secretAccessKey - aws access key
|
|
209
|
+
* @param {string} credentials.sessionToken - aws session token
|
|
210
|
+
* @memberof Configuration
|
|
211
|
+
*/
|
|
212
|
+
awsv4;
|
|
213
|
+
/**
|
|
214
|
+
* override base path
|
|
215
|
+
*/
|
|
216
|
+
basePath;
|
|
217
|
+
/**
|
|
218
|
+
* override server index
|
|
219
|
+
*/
|
|
220
|
+
serverIndex;
|
|
221
|
+
/**
|
|
222
|
+
* base options for axios calls
|
|
223
|
+
*/
|
|
224
|
+
baseOptions;
|
|
225
|
+
/**
|
|
226
|
+
* The FormData constructor that will be used to create multipart form data
|
|
227
|
+
* requests. You can inject this here so that execution environments that
|
|
228
|
+
* do not support the FormData class can still run the generated client.
|
|
229
|
+
*
|
|
230
|
+
* @type {new () => FormData}
|
|
231
|
+
*/
|
|
232
|
+
formDataCtor;
|
|
233
|
+
constructor(param = {}) {
|
|
234
|
+
this.apiKey = param.apiKey;
|
|
235
|
+
this.username = param.username;
|
|
236
|
+
this.password = param.password;
|
|
237
|
+
this.accessToken = param.accessToken;
|
|
238
|
+
this.awsv4 = param.awsv4;
|
|
239
|
+
this.basePath = param.basePath;
|
|
240
|
+
this.serverIndex = param.serverIndex;
|
|
241
|
+
this.baseOptions = {
|
|
242
|
+
...param.baseOptions,
|
|
243
|
+
headers: { ...param.baseOptions?.headers }
|
|
244
|
+
};
|
|
245
|
+
this.formDataCtor = param.formDataCtor;
|
|
246
|
+
}
|
|
247
|
+
/**
|
|
248
|
+
* Check if the given MIME is a JSON MIME.
|
|
249
|
+
* JSON MIME examples:
|
|
250
|
+
* application/json
|
|
251
|
+
* application/json; charset=UTF8
|
|
252
|
+
* APPLICATION/JSON
|
|
253
|
+
* application/vnd.company+json
|
|
254
|
+
* @param mime - MIME (Multipurpose Internet Mail Extensions)
|
|
255
|
+
* @return True if the given MIME is JSON, false otherwise.
|
|
256
|
+
*/
|
|
257
|
+
isJsonMime(mime) {
|
|
258
|
+
return mime !== null && /^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$/i.test(mime);
|
|
259
|
+
}
|
|
260
|
+
};
|
|
261
|
+
//#endregion
|
|
262
|
+
//#region src/client.ts
|
|
263
|
+
const clientRateLimits = [{
|
|
264
|
+
method: "get",
|
|
265
|
+
urlRegex: /^\/catalog\/v0\/categories$/v,
|
|
266
|
+
rate: 1,
|
|
267
|
+
burst: 2
|
|
268
|
+
}];
|
|
269
|
+
var CatalogItemsApiClient = class extends CatalogItemsApi {
|
|
270
|
+
constructor(configuration) {
|
|
271
|
+
const { axios, endpoint } = (0, _sp_api_sdk_common.createAxiosInstance)(configuration, clientRateLimits);
|
|
272
|
+
super(new Configuration(), endpoint, axios);
|
|
273
|
+
}
|
|
274
|
+
};
|
|
275
|
+
//#endregion
|
|
276
|
+
exports.CatalogItemsApi = CatalogItemsApi;
|
|
277
|
+
exports.CatalogItemsApiAxiosParamCreator = CatalogItemsApiAxiosParamCreator;
|
|
278
|
+
exports.CatalogItemsApiClient = CatalogItemsApiClient;
|
|
279
|
+
exports.CatalogItemsApiFactory = CatalogItemsApiFactory;
|
|
280
|
+
exports.CatalogItemsApiFp = CatalogItemsApiFp;
|
|
281
|
+
exports.clientRateLimits = clientRateLimits;
|
|
282
|
+
|
|
283
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["axios","globalAxios","globalAxios","axios"],"sources":["../src/api-model/base.ts","../src/api-model/common.ts","../src/api-model/api/catalog-items-api.ts","../src/api-model/configuration.ts","../src/client.ts"],"sourcesContent":["/* tslint:disable */\n/* eslint-disable */\n/**\n * Selling Partner API for Catalog Items\n * The Selling Partner API for Catalog Items helps you programmatically retrieve item details for items in the catalog.\n *\n * The version of the OpenAPI document: v0\n * \n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\n\n\nimport type { Configuration } from './configuration.js';\n// Some imports not used depending on template conditions\n// @ts-ignore\nimport type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios';\nimport globalAxios from 'axios';\n\nexport const BASE_PATH = \"https://sellingpartnerapi-na.amazon.com\".replace(/\\/+$/, \"\");\n\nexport const COLLECTION_FORMATS = {\n csv: \",\",\n ssv: \" \",\n tsv: \"\\t\",\n pipes: \"|\",\n};\n\nexport interface RequestArgs {\n url: string;\n options: RawAxiosRequestConfig;\n}\n\nexport class BaseAPI {\n protected configuration: Configuration | undefined;\n\n constructor(configuration?: Configuration, protected basePath: string = BASE_PATH, protected axios: AxiosInstance = globalAxios) {\n if (configuration) {\n this.configuration = configuration;\n this.basePath = configuration.basePath ?? basePath;\n }\n }\n};\n\nexport class RequiredError extends Error {\n constructor(public field: string, msg?: string) {\n super(msg);\n this.name = \"RequiredError\"\n }\n}\n\ninterface ServerMap {\n [key: string]: {\n url: string,\n description: string,\n }[];\n}\n\nexport const operationServerMap: ServerMap = {\n}\n","/* tslint:disable */\n/* eslint-disable */\n/**\n * Selling Partner API for Catalog Items\n * The Selling Partner API for Catalog Items helps you programmatically retrieve item details for items in the catalog.\n *\n * The version of the OpenAPI document: v0\n * \n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\n\nimport type { Configuration } from \"./configuration.js\";\nimport type { RequestArgs } from \"./base.js\";\nimport type { AxiosInstance, AxiosResponse } from 'axios';\nimport { RequiredError } from \"./base.js\";\n\nexport const DUMMY_BASE_URL = 'https://example.com'\n\n/**\n *\n * @throws {RequiredError}\n */\nexport const assertParamExists = function (functionName: string, paramName: string, paramValue: unknown) {\n if (paramValue === null || paramValue === undefined) {\n throw new RequiredError(paramName, `Required parameter ${paramName} was null or undefined when calling ${functionName}.`);\n }\n}\n\nexport const setApiKeyToObject = async function (object: any, keyParamName: string, configuration?: Configuration) {\n if (configuration && configuration.apiKey) {\n const localVarApiKeyValue = typeof configuration.apiKey === 'function'\n ? await configuration.apiKey(keyParamName)\n : await configuration.apiKey;\n object[keyParamName] = localVarApiKeyValue;\n }\n}\n\nexport const setBasicAuthToObject = function (object: any, configuration?: Configuration) {\n if (configuration && (configuration.username || configuration.password)) {\n object[\"auth\"] = { username: configuration.username, password: configuration.password };\n }\n}\n\nexport const setBearerAuthToObject = async function (object: any, configuration?: Configuration) {\n if (configuration && configuration.accessToken) {\n const accessToken = typeof configuration.accessToken === 'function'\n ? await configuration.accessToken()\n : await configuration.accessToken;\n object[\"Authorization\"] = \"Bearer \" + accessToken;\n }\n}\n\nexport const setOAuthToObject = async function (object: any, name: string, scopes: string[], configuration?: Configuration) {\n if (configuration && configuration.accessToken) {\n const localVarAccessTokenValue = typeof configuration.accessToken === 'function'\n ? await configuration.accessToken(name, scopes)\n : await configuration.accessToken;\n object[\"Authorization\"] = \"Bearer \" + localVarAccessTokenValue;\n }\n}\n\n\nfunction setFlattenedQueryParams(urlSearchParams: URLSearchParams, parameter: any, key: string = \"\"): void {\n if (parameter == null) return;\n if (typeof parameter === \"object\") {\n if (Array.isArray(parameter) || parameter instanceof Set) {\n (parameter as any[]).forEach(item => setFlattenedQueryParams(urlSearchParams, item, key));\n }\n else {\n Object.keys(parameter).forEach(currentKey =>\n setFlattenedQueryParams(urlSearchParams, parameter[currentKey], `${key}${key !== '' ? '.' : ''}${currentKey}`)\n );\n }\n }\n else {\n if (urlSearchParams.has(key)) {\n urlSearchParams.append(key, parameter);\n }\n else {\n urlSearchParams.set(key, parameter);\n }\n }\n}\n\nexport const setSearchParams = function (url: URL, ...objects: any[]) {\n const searchParams = new URLSearchParams(url.search);\n setFlattenedQueryParams(searchParams, objects);\n url.search = searchParams.toString();\n}\n\n/**\n * JSON serialization helper function which replaces instances of unserializable types with serializable ones.\n * This function will run for every key-value pair encountered by JSON.stringify while traversing an object.\n * Converting a set to a string will return an empty object, so an intermediate conversion to an array is required.\n */\n// @ts-ignore\nexport const replaceWithSerializableTypeIfNeeded = function(key: string, value: any) {\n if (value instanceof Set) {\n return Array.from(value);\n } else {\n return value;\n }\n}\n\nexport const serializeDataIfNeeded = function (value: any, requestOptions: any, configuration?: Configuration) {\n const nonString = typeof value !== 'string';\n const needsSerialization = nonString && configuration && configuration.isJsonMime\n ? configuration.isJsonMime(requestOptions.headers['Content-Type'])\n : nonString;\n return needsSerialization\n ? JSON.stringify(value !== undefined ? value : {}, replaceWithSerializableTypeIfNeeded)\n : (value || \"\");\n}\n\nexport const toPathString = function (url: URL) {\n return url.pathname + url.search + url.hash\n}\n\nexport const createRequestFunction = function (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) {\n return <T = unknown, R = AxiosResponse<T>>(axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {\n const axiosRequestArgs = {...axiosArgs.options, url: (axios.defaults.baseURL ? '' : configuration?.basePath ?? basePath) + axiosArgs.url};\n return axios.request<T, R>(axiosRequestArgs);\n };\n}\n","/* tslint:disable */\n/* eslint-disable */\n/**\n * Selling Partner API for Catalog Items\n * The Selling Partner API for Catalog Items helps you programmatically retrieve item details for items in the catalog.\n *\n * The version of the OpenAPI document: v0\n * \n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\n\n\nimport type { Configuration } from '../configuration.js';\nimport type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios';\nimport globalAxios from 'axios';\n// Some imports not used depending on template conditions\n// @ts-ignore\nimport { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction, replaceWithSerializableTypeIfNeeded } from '../common.js';\n// @ts-ignore\nimport { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base.js';\n// @ts-ignore\nimport type { ListCatalogCategoriesResponse } from '../models/index.js';\n/**\n * CatalogItemsApi - axios parameter creator\n */\nexport const CatalogItemsApiAxiosParamCreator = function (configuration?: Configuration) {\n return {\n /**\n * Returns the parent categories to which an item belongs, based on the specified ASIN or SellerSKU. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 2 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).\n * @param {string} marketplaceId A marketplace identifier. Specifies the marketplace for the item.\n * @param {string} [aSIN] The Amazon Standard Identification Number (ASIN) of the item.\n * @param {string} [sellerSKU] Used to identify items in the given marketplace. SellerSKU is qualified by the seller\\'s SellerId, which is included with every operation that you submit.\n * @param {*} [options] Override http request option.\n * @throws {RequiredError}\n */\n listCatalogCategories: async (marketplaceId: string, aSIN?: string, sellerSKU?: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {\n // verify required parameter 'marketplaceId' is not null or undefined\n assertParamExists('listCatalogCategories', 'marketplaceId', marketplaceId)\n const localVarPath = `/catalog/v0/categories`;\n // use dummy base URL string because the URL constructor only accepts absolute URLs.\n const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);\n let baseOptions;\n if (configuration) {\n baseOptions = configuration.baseOptions;\n }\n\n const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};\n const localVarHeaderParameter = {} as any;\n const localVarQueryParameter = {} as any;\n\n if (marketplaceId !== undefined) {\n localVarQueryParameter['MarketplaceId'] = marketplaceId;\n }\n\n if (aSIN !== undefined) {\n localVarQueryParameter['ASIN'] = aSIN;\n }\n\n if (sellerSKU !== undefined) {\n localVarQueryParameter['SellerSKU'] = sellerSKU;\n }\n\n localVarHeaderParameter['Accept'] = 'application/json';\n\n setSearchParams(localVarUrlObj, localVarQueryParameter);\n let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};\n localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};\n\n return {\n url: toPathString(localVarUrlObj),\n options: localVarRequestOptions,\n };\n },\n }\n};\n\n/**\n * CatalogItemsApi - functional programming interface\n */\nexport const CatalogItemsApiFp = function(configuration?: Configuration) {\n const localVarAxiosParamCreator = CatalogItemsApiAxiosParamCreator(configuration)\n return {\n /**\n * Returns the parent categories to which an item belongs, based on the specified ASIN or SellerSKU. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 2 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).\n * @param {string} marketplaceId A marketplace identifier. Specifies the marketplace for the item.\n * @param {string} [aSIN] The Amazon Standard Identification Number (ASIN) of the item.\n * @param {string} [sellerSKU] Used to identify items in the given marketplace. SellerSKU is qualified by the seller\\'s SellerId, which is included with every operation that you submit.\n * @param {*} [options] Override http request option.\n * @throws {RequiredError}\n */\n async listCatalogCategories(marketplaceId: string, aSIN?: string, sellerSKU?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ListCatalogCategoriesResponse>> {\n const localVarAxiosArgs = await localVarAxiosParamCreator.listCatalogCategories(marketplaceId, aSIN, sellerSKU, options);\n const localVarOperationServerIndex = configuration?.serverIndex ?? 0;\n const localVarOperationServerBasePath = operationServerMap['CatalogItemsApi.listCatalogCategories']?.[localVarOperationServerIndex]?.url;\n return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);\n },\n }\n};\n\n/**\n * CatalogItemsApi - factory interface\n */\nexport const CatalogItemsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {\n const localVarFp = CatalogItemsApiFp(configuration)\n return {\n /**\n * Returns the parent categories to which an item belongs, based on the specified ASIN or SellerSKU. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 2 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).\n * @param {CatalogItemsApiListCatalogCategoriesRequest} requestParameters Request parameters.\n * @param {*} [options] Override http request option.\n * @throws {RequiredError}\n */\n listCatalogCategories(requestParameters: CatalogItemsApiListCatalogCategoriesRequest, options?: RawAxiosRequestConfig): AxiosPromise<ListCatalogCategoriesResponse> {\n return localVarFp.listCatalogCategories(requestParameters.marketplaceId, requestParameters.aSIN, requestParameters.sellerSKU, options).then((request) => request(axios, basePath));\n },\n };\n};\n\n/**\n * Request parameters for listCatalogCategories operation in CatalogItemsApi.\n */\nexport interface CatalogItemsApiListCatalogCategoriesRequest {\n /**\n * A marketplace identifier. Specifies the marketplace for the item.\n */\n readonly marketplaceId: string\n\n /**\n * The Amazon Standard Identification Number (ASIN) of the item.\n */\n readonly aSIN?: string\n\n /**\n * Used to identify items in the given marketplace. SellerSKU is qualified by the seller\\'s SellerId, which is included with every operation that you submit.\n */\n readonly sellerSKU?: string\n}\n\n/**\n * CatalogItemsApi - object-oriented interface\n */\nexport class CatalogItemsApi extends BaseAPI {\n /**\n * Returns the parent categories to which an item belongs, based on the specified ASIN or SellerSKU. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 2 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).\n * @param {CatalogItemsApiListCatalogCategoriesRequest} requestParameters Request parameters.\n * @param {*} [options] Override http request option.\n * @throws {RequiredError}\n */\n public listCatalogCategories(requestParameters: CatalogItemsApiListCatalogCategoriesRequest, options?: RawAxiosRequestConfig) {\n return CatalogItemsApiFp(this.configuration).listCatalogCategories(requestParameters.marketplaceId, requestParameters.aSIN, requestParameters.sellerSKU, options).then((request) => request(this.axios, this.basePath));\n }\n}\n\n","/* tslint:disable */\n/**\n * Selling Partner API for Catalog Items\n * The Selling Partner API for Catalog Items helps you programmatically retrieve item details for items in the catalog.\n *\n * The version of the OpenAPI document: v0\n * \n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\n\ninterface AWSv4Configuration {\n options?: {\n region?: string\n service?: string\n }\n credentials?: {\n accessKeyId?: string\n secretAccessKey?: string,\n sessionToken?: string\n }\n}\n\nexport interface ConfigurationParameters {\n apiKey?: string | Promise<string> | ((name: string) => string) | ((name: string) => Promise<string>);\n username?: string;\n password?: string;\n accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise<string>);\n awsv4?: AWSv4Configuration;\n basePath?: string;\n serverIndex?: number;\n baseOptions?: any;\n formDataCtor?: new () => any;\n}\n\nexport class Configuration {\n /**\n * parameter for apiKey security\n * @param name security name\n */\n apiKey?: string | Promise<string> | ((name: string) => string) | ((name: string) => Promise<string>);\n /**\n * parameter for basic security\n */\n username?: string;\n /**\n * parameter for basic security\n */\n password?: string;\n /**\n * parameter for oauth2 security\n * @param name security name\n * @param scopes oauth2 scope\n */\n accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise<string>);\n /**\n * parameter for aws4 signature security\n * @param {Object} AWS4Signature - AWS4 Signature security\n * @param {string} options.region - aws region\n * @param {string} options.service - name of the service.\n * @param {string} credentials.accessKeyId - aws access key id\n * @param {string} credentials.secretAccessKey - aws access key\n * @param {string} credentials.sessionToken - aws session token\n * @memberof Configuration\n */\n awsv4?: AWSv4Configuration;\n /**\n * override base path\n */\n basePath?: string;\n /**\n * override server index\n */\n serverIndex?: number;\n /**\n * base options for axios calls\n */\n baseOptions?: any;\n /**\n * The FormData constructor that will be used to create multipart form data\n * requests. You can inject this here so that execution environments that\n * do not support the FormData class can still run the generated client.\n *\n * @type {new () => FormData}\n */\n formDataCtor?: new () => any;\n\n constructor(param: ConfigurationParameters = {}) {\n this.apiKey = param.apiKey;\n this.username = param.username;\n this.password = param.password;\n this.accessToken = param.accessToken;\n this.awsv4 = param.awsv4;\n this.basePath = param.basePath;\n this.serverIndex = param.serverIndex;\n this.baseOptions = {\n ...param.baseOptions,\n headers: {\n ...param.baseOptions?.headers,\n },\n };\n this.formDataCtor = param.formDataCtor;\n }\n\n /**\n * Check if the given MIME is a JSON MIME.\n * JSON MIME examples:\n * application/json\n * application/json; charset=UTF8\n * APPLICATION/JSON\n * application/vnd.company+json\n * @param mime - MIME (Multipurpose Internet Mail Extensions)\n * @return True if the given MIME is JSON, false otherwise.\n */\n public isJsonMime(mime: string): boolean {\n const jsonMime: RegExp = /^(application\\/json|[^;/ \\t]+\\/[^;/ \\t]+[+]json)[ \\t]*(;.*)?$/i;\n return mime !== null && jsonMime.test(mime);\n }\n}\n","import {type ClientConfiguration, createAxiosInstance, type RateLimit} from '@sp-api-sdk/common'\n\nimport {CatalogItemsApi, Configuration} from './api-model/index.js'\n\nexport const clientRateLimits: RateLimit[] = [\n {\n method: 'get',\n urlRegex: /^\\/catalog\\/v0\\/categories$/v,\n rate: 1,\n burst: 2,\n },\n]\n\nexport class CatalogItemsApiClient extends CatalogItemsApi {\n constructor(configuration: ClientConfiguration) {\n const {axios, endpoint} = createAxiosInstance(configuration, clientRateLimits)\n\n super(new Configuration(), endpoint, axios)\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAqBA,MAAa,YAAY,0CAA0C,QAAQ,QAAQ,EAAE;AAcrF,IAAa,UAAb,MAAqB;CAGoC;CAAwC;CAF7F;CAEA,YAAY,eAA+B,WAA6B,WAAW,UAAiCC,MAAAA,SAAa;EAA5E,KAAA,WAAA;EAAwC,KAAA,QAAA;EACzF,IAAI,eAAe;GACf,KAAK,gBAAgB;GACrB,KAAK,WAAW,cAAc,YAAY;EAC9C;CACJ;AACJ;AAEA,IAAa,gBAAb,cAAmC,MAAM;CAClB;CAAnB,YAAY,OAAsB,KAAc;EAC5C,MAAM,GAAG;EADM,KAAA,QAAA;EAEf,KAAK,OAAO;CAChB;AACJ;AASA,MAAa,qBAAgC,CAC7C;;;AC1CA,MAAa,iBAAiB;;;;;AAM9B,MAAa,oBAAoB,SAAU,cA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Instance, AxiosPromise, RawAxiosRequestConfig } from "axios";
|
|
3
|
+
//#region src/api-model/configuration.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Selling Partner API for Catalog Items
|
|
6
|
+
* The Selling Partner API for Catalog Items helps you programmatically retrieve item details for items in the catalog.
|
|
7
|
+
*
|
|
8
|
+
* The version of the OpenAPI document: v0
|
|
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
|
+
interface AWSv4Configuration {
|
|
16
|
+
options?: {
|
|
17
|
+
region?: string;
|
|
18
|
+
service?: string;
|
|
19
|
+
};
|
|
20
|
+
credentials?: {
|
|
21
|
+
accessKeyId?: string;
|
|
22
|
+
secretAccessKey?: string;
|
|
23
|
+
sessionToken?: string;
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
interface ConfigurationParameters {
|
|
27
|
+
apiKey?: string | Promise<string> | ((name: string) => string) | ((name: string) => Promise<string>);
|
|
28
|
+
username?: string;
|
|
29
|
+
password?: string;
|
|
30
|
+
accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise<string>);
|
|
31
|
+
awsv4?: AWSv4Configuration;
|
|
32
|
+
basePath?: string;
|
|
33
|
+
serverIndex?: number;
|
|
34
|
+
baseOptions?: any;
|
|
35
|
+
formDataCtor?: new () => any;
|
|
36
|
+
}
|
|
37
|
+
declare class Configuration {
|
|
38
|
+
/**
|
|
39
|
+
* parameter for apiKey security
|
|
40
|
+
* @param name security name
|
|
41
|
+
*/
|
|
42
|
+
apiKey?: string | Promise<string> | ((name: string) => string) | ((name: string) => Promise<string>);
|
|
43
|
+
/**
|
|
44
|
+
* parameter for basic security
|
|
45
|
+
*/
|
|
46
|
+
username?: string;
|
|
47
|
+
/**
|
|
48
|
+
* parameter for basic security
|
|
49
|
+
*/
|
|
50
|
+
password?: string;
|
|
51
|
+
/**
|
|
52
|
+
* parameter for oauth2 security
|
|
53
|
+
* @param name security name
|
|
54
|
+
* @param scopes oauth2 scope
|
|
55
|
+
*/
|
|
56
|
+
accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise<string>);
|
|
57
|
+
/**
|
|
58
|
+
* parameter for aws4 signature security
|
|
59
|
+
* @param {Object} AWS4Signature - AWS4 Signature security
|
|
60
|
+
* @param {string} options.region - aws region
|
|
61
|
+
* @param {string} options.service - name of the service.
|
|
62
|
+
* @param {string} credentials.accessKeyId - aws access key id
|
|
63
|
+
* @param {string} credentials.secretAccessKey - aws access key
|
|
64
|
+
* @param {string} credentials.sessionToken - aws session token
|
|
65
|
+
* @memberof Configuration
|
|
66
|
+
*/
|
|
67
|
+
awsv4?: AWSv4Configuration;
|
|
68
|
+
/**
|
|
69
|
+
* override base path
|
|
70
|
+
*/
|
|
71
|
+
basePath?: string;
|
|
72
|
+
/**
|
|
73
|
+
* override server index
|
|
74
|
+
*/
|
|
75
|
+
serverIndex?: number;
|
|
76
|
+
/**
|
|
77
|
+
* base options for axios calls
|
|
78
|
+
*/
|
|
79
|
+
baseOptions?: any;
|
|
80
|
+
/**
|
|
81
|
+
* The FormData constructor that will be used to create multipart form data
|
|
82
|
+
* requests. You can inject this here so that execution environments that
|
|
83
|
+
* do not support the FormData class can still run the generated client.
|
|
84
|
+
*
|
|
85
|
+
* @type {new () => FormData}
|
|
86
|
+
*/
|
|
87
|
+
formDataCtor?: new () => any;
|
|
88
|
+
constructor(param?: ConfigurationParameters);
|
|
89
|
+
/**
|
|
90
|
+
* Check if the given MIME is a JSON MIME.
|
|
91
|
+
* JSON MIME examples:
|
|
92
|
+
* application/json
|
|
93
|
+
* application/json; charset=UTF8
|
|
94
|
+
* APPLICATION/JSON
|
|
95
|
+
* application/vnd.company+json
|
|
96
|
+
* @param mime - MIME (Multipurpose Internet Mail Extensions)
|
|
97
|
+
* @return True if the given MIME is JSON, false otherwise.
|
|
98
|
+
*/
|
|
99
|
+
isJsonMime(mime: string): boolean;
|
|
100
|
+
}
|
|
101
|
+
//#endregion
|
|
102
|
+
//#region src/api-model/base.d.ts
|
|
103
|
+
interface RequestArgs {
|
|
104
|
+
url: string;
|
|
105
|
+
options: RawAxiosRequestConfig;
|
|
106
|
+
}
|
|
107
|
+
declare class BaseAPI {
|
|
108
|
+
protected basePath: string;
|
|
109
|
+
protected axios: AxiosInstance;
|
|
110
|
+
protected configuration: Configuration | undefined;
|
|
111
|
+
constructor(configuration?: Configuration, basePath?: string, axios?: AxiosInstance);
|
|
112
|
+
}
|
|
113
|
+
//#endregion
|
|
114
|
+
//#region src/api-model/models/categories.d.ts
|
|
115
|
+
/**
|
|
116
|
+
* Selling Partner API for Catalog Items
|
|
117
|
+
* The Selling Partner API for Catalog Items helps you programmatically retrieve item details for items in the catalog.
|
|
118
|
+
*
|
|
119
|
+
* The version of the OpenAPI document: v0
|
|
120
|
+
*
|
|
121
|
+
*
|
|
122
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
123
|
+
* https://openapi-generator.tech
|
|
124
|
+
* Do not edit the class manually.
|
|
125
|
+
*/
|
|
126
|
+
interface Categories {
|
|
127
|
+
/**
|
|
128
|
+
* The identifier for the product category (or browse node).
|
|
129
|
+
*/
|
|
130
|
+
'ProductCategoryId'?: string;
|
|
131
|
+
/**
|
|
132
|
+
* The name of the product category (or browse node).
|
|
133
|
+
*/
|
|
134
|
+
'ProductCategoryName'?: string;
|
|
135
|
+
/**
|
|
136
|
+
* The parent product category.
|
|
137
|
+
*/
|
|
138
|
+
'parent'?: object;
|
|
139
|
+
}
|
|
140
|
+
//#endregion
|
|
141
|
+
//#region src/api-model/models/list-catalog-categories-response.d.ts
|
|
142
|
+
interface ListCatalogCategoriesResponse {
|
|
143
|
+
'payload'?: Array<Categories>;
|
|
144
|
+
/**
|
|
145
|
+
* A list of error responses returned when a request is unsuccessful.
|
|
146
|
+
*/
|
|
147
|
+
'errors'?: Array<Error>;
|
|
148
|
+
}
|
|
149
|
+
//#endregion
|
|
150
|
+
//#region src/api-model/models/model-error.d.ts
|
|
151
|
+
/**
|
|
152
|
+
* Selling Partner API for Catalog Items
|
|
153
|
+
* The Selling Partner API for Catalog Items helps you programmatically retrieve item details for items in the catalog.
|
|
154
|
+
*
|
|
155
|
+
* The version of the OpenAPI document: v0
|
|
156
|
+
*
|
|
157
|
+
*
|
|
158
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
159
|
+
* https://openapi-generator.tech
|
|
160
|
+
* Do not edit the class manually.
|
|
161
|
+
*/
|
|
162
|
+
/**
|
|
163
|
+
* Error response returned when the request is unsuccessful.
|
|
164
|
+
*/
|
|
165
|
+
interface ModelError {
|
|
166
|
+
/**
|
|
167
|
+
* An error code that identifies the type of error that occurred.
|
|
168
|
+
*/
|
|
169
|
+
'code': string;
|
|
170
|
+
/**
|
|
171
|
+
* A message that describes the error condition in a human-readable form.
|
|
172
|
+
*/
|
|
173
|
+
'message': string;
|
|
174
|
+
/**
|
|
175
|
+
* Additional information that can help the caller understand or fix the issue.
|
|
176
|
+
*/
|
|
177
|
+
'details'?: string;
|
|
178
|
+
}
|
|
179
|
+
//#endregion
|
|
180
|
+
//#region src/api-model/api/catalog-items-api.d.ts
|
|
181
|
+
/**
|
|
182
|
+
* CatalogItemsApi - axios parameter creator
|
|
183
|
+
*/
|
|
184
|
+
declare const CatalogItemsApiAxiosParamCreator: (configuration?: Configuration) => {
|
|
185
|
+
/**
|
|
186
|
+
* Returns the parent categories to which an item belongs, based on the specified ASIN or SellerSKU. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 2 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
|
|
187
|
+
* @param {string} marketplaceId A marketplace identifier. Specifies the marketplace for the item.
|
|
188
|
+
* @param {string} [aSIN] The Amazon Standard Identification Number (ASIN) of the item.
|
|
189
|
+
* @param {string} [sellerSKU] Used to identify items in the given marketplace. SellerSKU is qualified by the seller\'s SellerId, which is included with every operation that you submit.
|
|
190
|
+
* @param {*} [options] Override http request option.
|
|
191
|
+
* @throws {RequiredError}
|
|
192
|
+
*/
|
|
193
|
+
listCatalogCategories: (marketplaceId: string, aSIN?: string, sellerSKU?: string, options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
|
|
194
|
+
};
|
|
195
|
+
/**
|
|
196
|
+
* CatalogItemsApi - functional programming interface
|
|
197
|
+
*/
|
|
198
|
+
declare const CatalogItemsApiFp: (configuration?: Configuration) => {
|
|
199
|
+
/**
|
|
200
|
+
* Returns the parent categories to which an item belongs, based on the specified ASIN or SellerSKU. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 2 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
|
|
201
|
+
* @param {string} marketplaceId A marketplace identifier. Specifies the marketplace for the item.
|
|
202
|
+
* @param {string} [aSIN] The Amazon Standard Identification Number (ASIN) of the item.
|
|
203
|
+
* @param {string} [sellerSKU] Used to identify items in the given marketplace. SellerSKU is qualified by the seller\'s SellerId, which is included with every operation that you submit.
|
|
204
|
+
* @param {*} [options] Override http request option.
|
|
205
|
+
* @throws {RequiredError}
|
|
206
|
+
*/
|
|
207
|
+
listCatalogCategories(marketplaceId: string, aSIN?: string, sellerSKU?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ListCatalogCategoriesResponse>>;
|
|
208
|
+
};
|
|
209
|
+
/**
|
|
210
|
+
* CatalogItemsApi - factory interface
|
|
211
|
+
*/
|
|
212
|
+
declare const CatalogItemsApiFactory: (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) => {
|
|
213
|
+
/**
|
|
214
|
+
* Returns the parent categories to which an item belongs, based on the specified ASIN or SellerSKU. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 2 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
|
|
215
|
+
* @param {CatalogItemsApiListCatalogCategoriesRequest} requestParameters Request parameters.
|
|
216
|
+
* @param {*} [options] Override http request option.
|
|
217
|
+
* @throws {RequiredError}
|
|
218
|
+
*/
|
|
219
|
+
listCatalogCategories(requestParameters: CatalogItemsApiListCatalogCategoriesRequest, options?: RawAxiosRequestConfig): AxiosPromise<ListCatalogCategoriesResponse>;
|
|
220
|
+
};
|
|
221
|
+
/**
|
|
222
|
+
* Request parameters for listCatalogCategories operation in CatalogItemsApi.
|
|
223
|
+
*/
|
|
224
|
+
interface CatalogItemsApiListCatalogCategoriesRequest {
|
|
225
|
+
/**
|
|
226
|
+
* A marketplace identifier. Specifies the marketplace for the item.
|
|
227
|
+
*/
|
|
228
|
+
readonly marketplaceId: string;
|
|
229
|
+
/**
|
|
230
|
+
* The Amazon Standard Identification Number (ASIN) of the item.
|
|
231
|
+
*/
|
|
232
|
+
readonly aSIN?: string;
|
|
233
|
+
/**
|
|
234
|
+
* Used to identify items in the given marketplace. SellerSKU is qualified by the seller\'s SellerId, which is included with every operation that you submit.
|
|
235
|
+
*/
|
|
236
|
+
readonly sellerSKU?: string;
|
|
237
|
+
}
|
|
238
|
+
/**
|
|
239
|
+
* CatalogItemsApi - object-oriented interface
|
|
240
|
+
*/
|
|
241
|
+
declare class CatalogItemsApi extends BaseAPI {
|
|
242
|
+
/**
|
|
243
|
+
* Returns the parent categories to which an item belongs, based on the specified ASIN or SellerSKU. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 2 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
|
|
244
|
+
* @param {CatalogItemsApiListCatalogCategoriesRequest} requestParameters Request parameters.
|
|
245
|
+
* @param {*} [options] Override http request option.
|
|
246
|
+
* @throws {RequiredError}
|
|
247
|
+
*/
|
|
248
|
+
listCatalogCategories(requestParameters: CatalogItemsApiListCatalogCategoriesRequest, options?: RawAxiosRequestConfig): Promise<import("axios").AxiosResponse<ListCatalogCategoriesResponse, any, {}>>;
|
|
249
|
+
}
|
|
250
|
+
//#endregion
|
|
251
|
+
//#region src/client.d.ts
|
|
252
|
+
declare const clientRateLimits: RateLimit[];
|
|
253
|
+
declare class CatalogItemsApiClient extends CatalogItemsApi {
|
|
254
|
+
constructor(configuration: ClientConfiguration);
|
|
255
|
+
}
|
|
256
|
+
//#endregion
|
|
257
|
+
export { CatalogItemsApi, CatalogItemsApiAxiosParamCreator, CatalogItemsApiClient, CatalogItemsApiFactory, CatalogItemsApiFp, CatalogItemsApiListCatalogCategoriesRequest, type Categories, type ListCatalogCategoriesResponse, type ModelError, clientRateLimits };
|
|
258
|
+
//# sourceMappingURL=index.d.cts.map
|