@sp-api-sdk/catalog-items-api-2022-04-01 4.0.1 → 4.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/dist/cjs/api-model/api/catalog-items-api.js +8 -25
- package/dist/cjs/api-model/base.js +0 -19
- package/dist/cjs/api-model/common.js +0 -37
- package/dist/cjs/api-model/configuration.js +0 -17
- package/dist/cjs/client.js +4 -4
- package/dist/es/api-model/api/catalog-items-api.js +8 -25
- package/dist/es/api-model/base.js +0 -19
- package/dist/es/api-model/common.js +0 -37
- package/dist/es/api-model/configuration.js +0 -17
- package/dist/es/client.js +4 -4
- package/dist/types/api-model/api/catalog-items-api.d.ts +8 -61
- package/dist/types/api-model/base.d.ts +0 -24
- package/dist/types/api-model/common.d.ts +0 -37
- package/dist/types/api-model/configuration.d.ts +0 -17
- package/dist/types/api-model/models/brand-refinement.d.ts +0 -6
- package/dist/types/api-model/models/classification-refinement.d.ts +0 -8
- package/dist/types/api-model/models/dimension.d.ts +0 -6
- package/dist/types/api-model/models/dimensions.d.ts +0 -22
- package/dist/types/api-model/models/error-list.d.ts +0 -7
- package/dist/types/api-model/models/item-browse-classification.d.ts +0 -11
- package/dist/types/api-model/models/item-browse-classifications-by-marketplace.d.ts +0 -6
- package/dist/types/api-model/models/item-classification-sales-rank.d.ts +0 -10
- package/dist/types/api-model/models/item-contributor-role.d.ts +0 -6
- package/dist/types/api-model/models/item-contributor.d.ts +0 -9
- package/dist/types/api-model/models/item-dimensions-by-marketplace.d.ts +0 -14
- package/dist/types/api-model/models/item-display-group-sales-rank.d.ts +0 -10
- package/dist/types/api-model/models/item-identifier.d.ts +0 -6
- package/dist/types/api-model/models/item-identifiers-by-marketplace.d.ts +0 -6
- package/dist/types/api-model/models/item-image.d.ts +0 -10
- package/dist/types/api-model/models/item-images-by-marketplace.d.ts +0 -6
- package/dist/types/api-model/models/item-product-type-by-marketplace.d.ts +0 -6
- package/dist/types/api-model/models/item-relationship.d.ts +0 -13
- package/dist/types/api-model/models/item-relationships-by-marketplace.d.ts +0 -6
- package/dist/types/api-model/models/item-sales-ranks-by-marketplace.d.ts +0 -8
- package/dist/types/api-model/models/item-search-results.d.ts +0 -16
- package/dist/types/api-model/models/item-summary-by-marketplace.d.ts +0 -45
- package/dist/types/api-model/models/item-variation-theme.d.ts +0 -6
- package/dist/types/api-model/models/item-vendor-details-by-marketplace.d.ts +0 -24
- package/dist/types/api-model/models/item-vendor-details-category.d.ts +0 -6
- package/dist/types/api-model/models/item.d.ts +1 -25
- package/dist/types/api-model/models/model-error.d.ts +0 -8
- package/dist/types/api-model/models/pagination.d.ts +0 -6
- package/dist/types/api-model/models/refinements.d.ts +0 -6
- package/package.json +25 -4
|
@@ -25,12 +25,11 @@ const common_1 = require("../common");
|
|
|
25
25
|
const base_1 = require("../base");
|
|
26
26
|
/**
|
|
27
27
|
* CatalogItemsApi - axios parameter creator
|
|
28
|
-
* @export
|
|
29
28
|
*/
|
|
30
29
|
const CatalogItemsApiAxiosParamCreator = function (configuration) {
|
|
31
30
|
return {
|
|
32
31
|
/**
|
|
33
|
-
* Retrieves details for an item in the Amazon catalog. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | |
|
|
32
|
+
* Retrieves details for an item in the Amazon catalog. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 2 | The `x-amzn-RateLimit-Limit` response header contains the usage plan rate limits for the operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
|
|
34
33
|
* @param {string} asin The Amazon Standard Identification Number (ASIN) of the item.
|
|
35
34
|
* @param {Array<string>} marketplaceIds A comma-delimited list of Amazon marketplace identifiers. To find the ID for your marketplace, refer to [Marketplace IDs](https://developer-docs.amazon.com/sp-api/docs/marketplace-ids).
|
|
36
35
|
* @param {Array<GetCatalogItemIncludedDataEnum>} [includedData] A comma-delimited list of datasets to include in the response.
|
|
@@ -72,7 +71,7 @@ const CatalogItemsApiAxiosParamCreator = function (configuration) {
|
|
|
72
71
|
};
|
|
73
72
|
},
|
|
74
73
|
/**
|
|
75
|
-
* Search for a list of Amazon catalog items and item-related information. You can search by identifier or by keywords. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | |
|
|
74
|
+
* Search for a list of Amazon catalog items and item-related information. You can search by identifier or by keywords. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 2 | The `x-amzn-RateLimit-Limit` response header contains the usage plan rate limits for the operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
|
|
76
75
|
* @param {Array<string>} marketplaceIds A comma-delimited list of Amazon marketplace identifiers. To find the ID for your marketplace, refer to [Marketplace IDs](https://developer-docs.amazon.com/sp-api/docs/marketplace-ids).
|
|
77
76
|
* @param {Array<string>} [identifiers] A comma-delimited list of product identifiers that you can use to search the Amazon catalog. **Note:** You cannot include `identifiers` and `keywords` in the same request.
|
|
78
77
|
* @param {SearchCatalogItemsIdentifiersTypeEnum} [identifiersType] The type of product identifiers that you can use to search the Amazon catalog. **Note:** `identifiersType` is required when `identifiers` is in the request.
|
|
@@ -150,13 +149,12 @@ const CatalogItemsApiAxiosParamCreator = function (configuration) {
|
|
|
150
149
|
exports.CatalogItemsApiAxiosParamCreator = CatalogItemsApiAxiosParamCreator;
|
|
151
150
|
/**
|
|
152
151
|
* CatalogItemsApi - functional programming interface
|
|
153
|
-
* @export
|
|
154
152
|
*/
|
|
155
153
|
const CatalogItemsApiFp = function (configuration) {
|
|
156
154
|
const localVarAxiosParamCreator = (0, exports.CatalogItemsApiAxiosParamCreator)(configuration);
|
|
157
155
|
return {
|
|
158
156
|
/**
|
|
159
|
-
* Retrieves details for an item in the Amazon catalog. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | |
|
|
157
|
+
* Retrieves details for an item in the Amazon catalog. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 2 | The `x-amzn-RateLimit-Limit` response header contains the usage plan rate limits for the operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
|
|
160
158
|
* @param {string} asin The Amazon Standard Identification Number (ASIN) of the item.
|
|
161
159
|
* @param {Array<string>} marketplaceIds A comma-delimited list of Amazon marketplace identifiers. To find the ID for your marketplace, refer to [Marketplace IDs](https://developer-docs.amazon.com/sp-api/docs/marketplace-ids).
|
|
162
160
|
* @param {Array<GetCatalogItemIncludedDataEnum>} [includedData] A comma-delimited list of datasets to include in the response.
|
|
@@ -171,7 +169,7 @@ const CatalogItemsApiFp = function (configuration) {
|
|
|
171
169
|
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
172
170
|
},
|
|
173
171
|
/**
|
|
174
|
-
* Search for a list of Amazon catalog items and item-related information. You can search by identifier or by keywords. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | |
|
|
172
|
+
* Search for a list of Amazon catalog items and item-related information. You can search by identifier or by keywords. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 2 | The `x-amzn-RateLimit-Limit` response header contains the usage plan rate limits for the operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
|
|
175
173
|
* @param {Array<string>} marketplaceIds A comma-delimited list of Amazon marketplace identifiers. To find the ID for your marketplace, refer to [Marketplace IDs](https://developer-docs.amazon.com/sp-api/docs/marketplace-ids).
|
|
176
174
|
* @param {Array<string>} [identifiers] A comma-delimited list of product identifiers that you can use to search the Amazon catalog. **Note:** You cannot include `identifiers` and `keywords` in the same request.
|
|
177
175
|
* @param {SearchCatalogItemsIdentifiersTypeEnum} [identifiersType] The type of product identifiers that you can use to search the Amazon catalog. **Note:** `identifiersType` is required when `identifiers` is in the request.
|
|
@@ -198,13 +196,12 @@ const CatalogItemsApiFp = function (configuration) {
|
|
|
198
196
|
exports.CatalogItemsApiFp = CatalogItemsApiFp;
|
|
199
197
|
/**
|
|
200
198
|
* CatalogItemsApi - factory interface
|
|
201
|
-
* @export
|
|
202
199
|
*/
|
|
203
200
|
const CatalogItemsApiFactory = function (configuration, basePath, axios) {
|
|
204
201
|
const localVarFp = (0, exports.CatalogItemsApiFp)(configuration);
|
|
205
202
|
return {
|
|
206
203
|
/**
|
|
207
|
-
* Retrieves details for an item in the Amazon catalog. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | |
|
|
204
|
+
* Retrieves details for an item in the Amazon catalog. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 2 | The `x-amzn-RateLimit-Limit` response header contains the usage plan rate limits for the operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
|
|
208
205
|
* @param {CatalogItemsApiGetCatalogItemRequest} requestParameters Request parameters.
|
|
209
206
|
* @param {*} [options] Override http request option.
|
|
210
207
|
* @throws {RequiredError}
|
|
@@ -213,7 +210,7 @@ const CatalogItemsApiFactory = function (configuration, basePath, axios) {
|
|
|
213
210
|
return localVarFp.getCatalogItem(requestParameters.asin, requestParameters.marketplaceIds, requestParameters.includedData, requestParameters.locale, options).then((request) => request(axios, basePath));
|
|
214
211
|
},
|
|
215
212
|
/**
|
|
216
|
-
* Search for a list of Amazon catalog items and item-related information. You can search by identifier or by keywords. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | |
|
|
213
|
+
* Search for a list of Amazon catalog items and item-related information. You can search by identifier or by keywords. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 2 | The `x-amzn-RateLimit-Limit` response header contains the usage plan rate limits for the operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
|
|
217
214
|
* @param {CatalogItemsApiSearchCatalogItemsRequest} requestParameters Request parameters.
|
|
218
215
|
* @param {*} [options] Override http request option.
|
|
219
216
|
* @throws {RequiredError}
|
|
@@ -226,36 +223,28 @@ const CatalogItemsApiFactory = function (configuration, basePath, axios) {
|
|
|
226
223
|
exports.CatalogItemsApiFactory = CatalogItemsApiFactory;
|
|
227
224
|
/**
|
|
228
225
|
* CatalogItemsApi - object-oriented interface
|
|
229
|
-
* @export
|
|
230
|
-
* @class CatalogItemsApi
|
|
231
|
-
* @extends {BaseAPI}
|
|
232
226
|
*/
|
|
233
227
|
class CatalogItemsApi extends base_1.BaseAPI {
|
|
234
228
|
/**
|
|
235
|
-
* Retrieves details for an item in the Amazon catalog. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | |
|
|
229
|
+
* Retrieves details for an item in the Amazon catalog. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 2 | The `x-amzn-RateLimit-Limit` response header contains the usage plan rate limits for the operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
|
|
236
230
|
* @param {CatalogItemsApiGetCatalogItemRequest} requestParameters Request parameters.
|
|
237
231
|
* @param {*} [options] Override http request option.
|
|
238
232
|
* @throws {RequiredError}
|
|
239
|
-
* @memberof CatalogItemsApi
|
|
240
233
|
*/
|
|
241
234
|
getCatalogItem(requestParameters, options) {
|
|
242
235
|
return (0, exports.CatalogItemsApiFp)(this.configuration).getCatalogItem(requestParameters.asin, requestParameters.marketplaceIds, requestParameters.includedData, requestParameters.locale, options).then((request) => request(this.axios, this.basePath));
|
|
243
236
|
}
|
|
244
237
|
/**
|
|
245
|
-
* Search for a list of Amazon catalog items and item-related information. You can search by identifier or by keywords. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | |
|
|
238
|
+
* Search for a list of Amazon catalog items and item-related information. You can search by identifier or by keywords. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 2 | The `x-amzn-RateLimit-Limit` response header contains the usage plan rate limits for the operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
|
|
246
239
|
* @param {CatalogItemsApiSearchCatalogItemsRequest} requestParameters Request parameters.
|
|
247
240
|
* @param {*} [options] Override http request option.
|
|
248
241
|
* @throws {RequiredError}
|
|
249
|
-
* @memberof CatalogItemsApi
|
|
250
242
|
*/
|
|
251
243
|
searchCatalogItems(requestParameters, options) {
|
|
252
244
|
return (0, exports.CatalogItemsApiFp)(this.configuration).searchCatalogItems(requestParameters.marketplaceIds, requestParameters.identifiers, requestParameters.identifiersType, requestParameters.includedData, requestParameters.locale, requestParameters.sellerId, requestParameters.keywords, requestParameters.brandNames, requestParameters.classificationIds, requestParameters.pageSize, requestParameters.pageToken, requestParameters.keywordsLocale, options).then((request) => request(this.axios, this.basePath));
|
|
253
245
|
}
|
|
254
246
|
}
|
|
255
247
|
exports.CatalogItemsApi = CatalogItemsApi;
|
|
256
|
-
/**
|
|
257
|
-
* @export
|
|
258
|
-
*/
|
|
259
248
|
exports.GetCatalogItemIncludedDataEnum = {
|
|
260
249
|
Attributes: 'attributes',
|
|
261
250
|
Classifications: 'classifications',
|
|
@@ -268,9 +257,6 @@ exports.GetCatalogItemIncludedDataEnum = {
|
|
|
268
257
|
Summaries: 'summaries',
|
|
269
258
|
VendorDetails: 'vendorDetails'
|
|
270
259
|
};
|
|
271
|
-
/**
|
|
272
|
-
* @export
|
|
273
|
-
*/
|
|
274
260
|
exports.SearchCatalogItemsIdentifiersTypeEnum = {
|
|
275
261
|
Asin: 'ASIN',
|
|
276
262
|
Ean: 'EAN',
|
|
@@ -281,9 +267,6 @@ exports.SearchCatalogItemsIdentifiersTypeEnum = {
|
|
|
281
267
|
Sku: 'SKU',
|
|
282
268
|
Upc: 'UPC'
|
|
283
269
|
};
|
|
284
|
-
/**
|
|
285
|
-
* @export
|
|
286
|
-
*/
|
|
287
270
|
exports.SearchCatalogItemsIncludedDataEnum = {
|
|
288
271
|
Attributes: 'attributes',
|
|
289
272
|
Classifications: 'classifications',
|
|
@@ -19,21 +19,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
19
19
|
exports.operationServerMap = exports.RequiredError = exports.BaseAPI = exports.COLLECTION_FORMATS = exports.BASE_PATH = void 0;
|
|
20
20
|
const axios_1 = __importDefault(require("axios"));
|
|
21
21
|
exports.BASE_PATH = "https://sellingpartnerapi-na.amazon.com".replace(/\/+$/, "");
|
|
22
|
-
/**
|
|
23
|
-
*
|
|
24
|
-
* @export
|
|
25
|
-
*/
|
|
26
22
|
exports.COLLECTION_FORMATS = {
|
|
27
23
|
csv: ",",
|
|
28
24
|
ssv: " ",
|
|
29
25
|
tsv: "\t",
|
|
30
26
|
pipes: "|",
|
|
31
27
|
};
|
|
32
|
-
/**
|
|
33
|
-
*
|
|
34
|
-
* @export
|
|
35
|
-
* @class BaseAPI
|
|
36
|
-
*/
|
|
37
28
|
class BaseAPI {
|
|
38
29
|
basePath;
|
|
39
30
|
axios;
|
|
@@ -49,12 +40,6 @@ class BaseAPI {
|
|
|
49
40
|
}
|
|
50
41
|
exports.BaseAPI = BaseAPI;
|
|
51
42
|
;
|
|
52
|
-
/**
|
|
53
|
-
*
|
|
54
|
-
* @export
|
|
55
|
-
* @class RequiredError
|
|
56
|
-
* @extends {Error}
|
|
57
|
-
*/
|
|
58
43
|
class RequiredError extends Error {
|
|
59
44
|
field;
|
|
60
45
|
constructor(field, msg) {
|
|
@@ -64,8 +49,4 @@ class RequiredError extends Error {
|
|
|
64
49
|
}
|
|
65
50
|
}
|
|
66
51
|
exports.RequiredError = RequiredError;
|
|
67
|
-
/**
|
|
68
|
-
*
|
|
69
|
-
* @export
|
|
70
|
-
*/
|
|
71
52
|
exports.operationServerMap = {};
|
|
@@ -15,15 +15,10 @@
|
|
|
15
15
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
16
|
exports.createRequestFunction = exports.toPathString = exports.serializeDataIfNeeded = exports.setSearchParams = exports.setOAuthToObject = exports.setBearerAuthToObject = exports.setBasicAuthToObject = exports.setApiKeyToObject = exports.assertParamExists = exports.DUMMY_BASE_URL = void 0;
|
|
17
17
|
const base_1 = require("./base");
|
|
18
|
-
/**
|
|
19
|
-
*
|
|
20
|
-
* @export
|
|
21
|
-
*/
|
|
22
18
|
exports.DUMMY_BASE_URL = 'https://example.com';
|
|
23
19
|
/**
|
|
24
20
|
*
|
|
25
21
|
* @throws {RequiredError}
|
|
26
|
-
* @export
|
|
27
22
|
*/
|
|
28
23
|
const assertParamExists = function (functionName, paramName, paramValue) {
|
|
29
24
|
if (paramValue === null || paramValue === undefined) {
|
|
@@ -31,10 +26,6 @@ const assertParamExists = function (functionName, paramName, paramValue) {
|
|
|
31
26
|
}
|
|
32
27
|
};
|
|
33
28
|
exports.assertParamExists = assertParamExists;
|
|
34
|
-
/**
|
|
35
|
-
*
|
|
36
|
-
* @export
|
|
37
|
-
*/
|
|
38
29
|
const setApiKeyToObject = async function (object, keyParamName, configuration) {
|
|
39
30
|
if (configuration && configuration.apiKey) {
|
|
40
31
|
const localVarApiKeyValue = typeof configuration.apiKey === 'function'
|
|
@@ -44,20 +35,12 @@ const setApiKeyToObject = async function (object, keyParamName, configuration) {
|
|
|
44
35
|
}
|
|
45
36
|
};
|
|
46
37
|
exports.setApiKeyToObject = setApiKeyToObject;
|
|
47
|
-
/**
|
|
48
|
-
*
|
|
49
|
-
* @export
|
|
50
|
-
*/
|
|
51
38
|
const setBasicAuthToObject = function (object, configuration) {
|
|
52
39
|
if (configuration && (configuration.username || configuration.password)) {
|
|
53
40
|
object["auth"] = { username: configuration.username, password: configuration.password };
|
|
54
41
|
}
|
|
55
42
|
};
|
|
56
43
|
exports.setBasicAuthToObject = setBasicAuthToObject;
|
|
57
|
-
/**
|
|
58
|
-
*
|
|
59
|
-
* @export
|
|
60
|
-
*/
|
|
61
44
|
const setBearerAuthToObject = async function (object, configuration) {
|
|
62
45
|
if (configuration && configuration.accessToken) {
|
|
63
46
|
const accessToken = typeof configuration.accessToken === 'function'
|
|
@@ -67,10 +50,6 @@ const setBearerAuthToObject = async function (object, configuration) {
|
|
|
67
50
|
}
|
|
68
51
|
};
|
|
69
52
|
exports.setBearerAuthToObject = setBearerAuthToObject;
|
|
70
|
-
/**
|
|
71
|
-
*
|
|
72
|
-
* @export
|
|
73
|
-
*/
|
|
74
53
|
const setOAuthToObject = async function (object, name, scopes, configuration) {
|
|
75
54
|
if (configuration && configuration.accessToken) {
|
|
76
55
|
const localVarAccessTokenValue = typeof configuration.accessToken === 'function'
|
|
@@ -100,20 +79,12 @@ function setFlattenedQueryParams(urlSearchParams, parameter, key = "") {
|
|
|
100
79
|
}
|
|
101
80
|
}
|
|
102
81
|
}
|
|
103
|
-
/**
|
|
104
|
-
*
|
|
105
|
-
* @export
|
|
106
|
-
*/
|
|
107
82
|
const setSearchParams = function (url, ...objects) {
|
|
108
83
|
const searchParams = new URLSearchParams(url.search);
|
|
109
84
|
setFlattenedQueryParams(searchParams, objects);
|
|
110
85
|
url.search = searchParams.toString();
|
|
111
86
|
};
|
|
112
87
|
exports.setSearchParams = setSearchParams;
|
|
113
|
-
/**
|
|
114
|
-
*
|
|
115
|
-
* @export
|
|
116
|
-
*/
|
|
117
88
|
const serializeDataIfNeeded = function (value, requestOptions, configuration) {
|
|
118
89
|
const nonString = typeof value !== 'string';
|
|
119
90
|
const needsSerialization = nonString && configuration && configuration.isJsonMime
|
|
@@ -124,18 +95,10 @@ const serializeDataIfNeeded = function (value, requestOptions, configuration) {
|
|
|
124
95
|
: (value || "");
|
|
125
96
|
};
|
|
126
97
|
exports.serializeDataIfNeeded = serializeDataIfNeeded;
|
|
127
|
-
/**
|
|
128
|
-
*
|
|
129
|
-
* @export
|
|
130
|
-
*/
|
|
131
98
|
const toPathString = function (url) {
|
|
132
99
|
return url.pathname + url.search + url.hash;
|
|
133
100
|
};
|
|
134
101
|
exports.toPathString = toPathString;
|
|
135
|
-
/**
|
|
136
|
-
*
|
|
137
|
-
* @export
|
|
138
|
-
*/
|
|
139
102
|
const createRequestFunction = function (axiosArgs, globalAxios, BASE_PATH, configuration) {
|
|
140
103
|
return (axios = globalAxios, basePath = BASE_PATH) => {
|
|
141
104
|
const axiosRequestArgs = { ...axiosArgs.options, url: (axios.defaults.baseURL ? '' : configuration?.basePath ?? basePath) + axiosArgs.url };
|
|
@@ -18,49 +18,32 @@ class Configuration {
|
|
|
18
18
|
/**
|
|
19
19
|
* parameter for apiKey security
|
|
20
20
|
* @param name security name
|
|
21
|
-
* @memberof Configuration
|
|
22
21
|
*/
|
|
23
22
|
apiKey;
|
|
24
23
|
/**
|
|
25
24
|
* parameter for basic security
|
|
26
|
-
*
|
|
27
|
-
* @type {string}
|
|
28
|
-
* @memberof Configuration
|
|
29
25
|
*/
|
|
30
26
|
username;
|
|
31
27
|
/**
|
|
32
28
|
* parameter for basic security
|
|
33
|
-
*
|
|
34
|
-
* @type {string}
|
|
35
|
-
* @memberof Configuration
|
|
36
29
|
*/
|
|
37
30
|
password;
|
|
38
31
|
/**
|
|
39
32
|
* parameter for oauth2 security
|
|
40
33
|
* @param name security name
|
|
41
34
|
* @param scopes oauth2 scope
|
|
42
|
-
* @memberof Configuration
|
|
43
35
|
*/
|
|
44
36
|
accessToken;
|
|
45
37
|
/**
|
|
46
38
|
* override base path
|
|
47
|
-
*
|
|
48
|
-
* @type {string}
|
|
49
|
-
* @memberof Configuration
|
|
50
39
|
*/
|
|
51
40
|
basePath;
|
|
52
41
|
/**
|
|
53
42
|
* override server index
|
|
54
|
-
*
|
|
55
|
-
* @type {number}
|
|
56
|
-
* @memberof Configuration
|
|
57
43
|
*/
|
|
58
44
|
serverIndex;
|
|
59
45
|
/**
|
|
60
46
|
* base options for axios calls
|
|
61
|
-
*
|
|
62
|
-
* @type {any}
|
|
63
|
-
* @memberof Configuration
|
|
64
47
|
*/
|
|
65
48
|
baseOptions;
|
|
66
49
|
/**
|
package/dist/cjs/client.js
CHANGED
|
@@ -8,15 +8,15 @@ exports.clientRateLimits = [
|
|
|
8
8
|
method: 'get',
|
|
9
9
|
// eslint-disable-next-line prefer-regex-literals
|
|
10
10
|
urlRegex: new RegExp('^/catalog/2022-04-01/items$'),
|
|
11
|
-
rate:
|
|
12
|
-
burst:
|
|
11
|
+
rate: 2,
|
|
12
|
+
burst: 2,
|
|
13
13
|
},
|
|
14
14
|
{
|
|
15
15
|
method: 'get',
|
|
16
16
|
// eslint-disable-next-line prefer-regex-literals
|
|
17
17
|
urlRegex: new RegExp('^/catalog/2022-04-01/items/[^/]*$'),
|
|
18
|
-
rate:
|
|
19
|
-
burst:
|
|
18
|
+
rate: 2,
|
|
19
|
+
burst: 2,
|
|
20
20
|
},
|
|
21
21
|
];
|
|
22
22
|
class CatalogItemsApiClient extends api_model_1.CatalogItemsApi {
|
|
@@ -19,12 +19,11 @@ import { DUMMY_BASE_URL, assertParamExists, setSearchParams, toPathString, creat
|
|
|
19
19
|
import { BASE_PATH, COLLECTION_FORMATS, BaseAPI, operationServerMap } from '../base';
|
|
20
20
|
/**
|
|
21
21
|
* CatalogItemsApi - axios parameter creator
|
|
22
|
-
* @export
|
|
23
22
|
*/
|
|
24
23
|
export const CatalogItemsApiAxiosParamCreator = function (configuration) {
|
|
25
24
|
return {
|
|
26
25
|
/**
|
|
27
|
-
* Retrieves details for an item in the Amazon catalog. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | |
|
|
26
|
+
* Retrieves details for an item in the Amazon catalog. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 2 | The `x-amzn-RateLimit-Limit` response header contains the usage plan rate limits for the operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
|
|
28
27
|
* @param {string} asin The Amazon Standard Identification Number (ASIN) of the item.
|
|
29
28
|
* @param {Array<string>} marketplaceIds A comma-delimited list of Amazon marketplace identifiers. To find the ID for your marketplace, refer to [Marketplace IDs](https://developer-docs.amazon.com/sp-api/docs/marketplace-ids).
|
|
30
29
|
* @param {Array<GetCatalogItemIncludedDataEnum>} [includedData] A comma-delimited list of datasets to include in the response.
|
|
@@ -66,7 +65,7 @@ export const CatalogItemsApiAxiosParamCreator = function (configuration) {
|
|
|
66
65
|
};
|
|
67
66
|
},
|
|
68
67
|
/**
|
|
69
|
-
* Search for a list of Amazon catalog items and item-related information. You can search by identifier or by keywords. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | |
|
|
68
|
+
* Search for a list of Amazon catalog items and item-related information. You can search by identifier or by keywords. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 2 | The `x-amzn-RateLimit-Limit` response header contains the usage plan rate limits for the operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
|
|
70
69
|
* @param {Array<string>} marketplaceIds A comma-delimited list of Amazon marketplace identifiers. To find the ID for your marketplace, refer to [Marketplace IDs](https://developer-docs.amazon.com/sp-api/docs/marketplace-ids).
|
|
71
70
|
* @param {Array<string>} [identifiers] A comma-delimited list of product identifiers that you can use to search the Amazon catalog. **Note:** You cannot include `identifiers` and `keywords` in the same request.
|
|
72
71
|
* @param {SearchCatalogItemsIdentifiersTypeEnum} [identifiersType] The type of product identifiers that you can use to search the Amazon catalog. **Note:** `identifiersType` is required when `identifiers` is in the request.
|
|
@@ -143,13 +142,12 @@ export const CatalogItemsApiAxiosParamCreator = function (configuration) {
|
|
|
143
142
|
};
|
|
144
143
|
/**
|
|
145
144
|
* CatalogItemsApi - functional programming interface
|
|
146
|
-
* @export
|
|
147
145
|
*/
|
|
148
146
|
export const CatalogItemsApiFp = function (configuration) {
|
|
149
147
|
const localVarAxiosParamCreator = CatalogItemsApiAxiosParamCreator(configuration);
|
|
150
148
|
return {
|
|
151
149
|
/**
|
|
152
|
-
* Retrieves details for an item in the Amazon catalog. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | |
|
|
150
|
+
* Retrieves details for an item in the Amazon catalog. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 2 | The `x-amzn-RateLimit-Limit` response header contains the usage plan rate limits for the operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
|
|
153
151
|
* @param {string} asin The Amazon Standard Identification Number (ASIN) of the item.
|
|
154
152
|
* @param {Array<string>} marketplaceIds A comma-delimited list of Amazon marketplace identifiers. To find the ID for your marketplace, refer to [Marketplace IDs](https://developer-docs.amazon.com/sp-api/docs/marketplace-ids).
|
|
155
153
|
* @param {Array<GetCatalogItemIncludedDataEnum>} [includedData] A comma-delimited list of datasets to include in the response.
|
|
@@ -164,7 +162,7 @@ export const CatalogItemsApiFp = function (configuration) {
|
|
|
164
162
|
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
165
163
|
},
|
|
166
164
|
/**
|
|
167
|
-
* Search for a list of Amazon catalog items and item-related information. You can search by identifier or by keywords. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | |
|
|
165
|
+
* Search for a list of Amazon catalog items and item-related information. You can search by identifier or by keywords. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 2 | The `x-amzn-RateLimit-Limit` response header contains the usage plan rate limits for the operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
|
|
168
166
|
* @param {Array<string>} marketplaceIds A comma-delimited list of Amazon marketplace identifiers. To find the ID for your marketplace, refer to [Marketplace IDs](https://developer-docs.amazon.com/sp-api/docs/marketplace-ids).
|
|
169
167
|
* @param {Array<string>} [identifiers] A comma-delimited list of product identifiers that you can use to search the Amazon catalog. **Note:** You cannot include `identifiers` and `keywords` in the same request.
|
|
170
168
|
* @param {SearchCatalogItemsIdentifiersTypeEnum} [identifiersType] The type of product identifiers that you can use to search the Amazon catalog. **Note:** `identifiersType` is required when `identifiers` is in the request.
|
|
@@ -190,13 +188,12 @@ export const CatalogItemsApiFp = function (configuration) {
|
|
|
190
188
|
};
|
|
191
189
|
/**
|
|
192
190
|
* CatalogItemsApi - factory interface
|
|
193
|
-
* @export
|
|
194
191
|
*/
|
|
195
192
|
export const CatalogItemsApiFactory = function (configuration, basePath, axios) {
|
|
196
193
|
const localVarFp = CatalogItemsApiFp(configuration);
|
|
197
194
|
return {
|
|
198
195
|
/**
|
|
199
|
-
* Retrieves details for an item in the Amazon catalog. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | |
|
|
196
|
+
* Retrieves details for an item in the Amazon catalog. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 2 | The `x-amzn-RateLimit-Limit` response header contains the usage plan rate limits for the operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
|
|
200
197
|
* @param {CatalogItemsApiGetCatalogItemRequest} requestParameters Request parameters.
|
|
201
198
|
* @param {*} [options] Override http request option.
|
|
202
199
|
* @throws {RequiredError}
|
|
@@ -205,7 +202,7 @@ export const CatalogItemsApiFactory = function (configuration, basePath, axios)
|
|
|
205
202
|
return localVarFp.getCatalogItem(requestParameters.asin, requestParameters.marketplaceIds, requestParameters.includedData, requestParameters.locale, options).then((request) => request(axios, basePath));
|
|
206
203
|
},
|
|
207
204
|
/**
|
|
208
|
-
* Search for a list of Amazon catalog items and item-related information. You can search by identifier or by keywords. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | |
|
|
205
|
+
* Search for a list of Amazon catalog items and item-related information. You can search by identifier or by keywords. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 2 | The `x-amzn-RateLimit-Limit` response header contains the usage plan rate limits for the operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
|
|
209
206
|
* @param {CatalogItemsApiSearchCatalogItemsRequest} requestParameters Request parameters.
|
|
210
207
|
* @param {*} [options] Override http request option.
|
|
211
208
|
* @throws {RequiredError}
|
|
@@ -217,35 +214,27 @@ export const CatalogItemsApiFactory = function (configuration, basePath, axios)
|
|
|
217
214
|
};
|
|
218
215
|
/**
|
|
219
216
|
* CatalogItemsApi - object-oriented interface
|
|
220
|
-
* @export
|
|
221
|
-
* @class CatalogItemsApi
|
|
222
|
-
* @extends {BaseAPI}
|
|
223
217
|
*/
|
|
224
218
|
export class CatalogItemsApi extends BaseAPI {
|
|
225
219
|
/**
|
|
226
|
-
* Retrieves details for an item in the Amazon catalog. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | |
|
|
220
|
+
* Retrieves details for an item in the Amazon catalog. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 2 | The `x-amzn-RateLimit-Limit` response header contains the usage plan rate limits for the operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
|
|
227
221
|
* @param {CatalogItemsApiGetCatalogItemRequest} requestParameters Request parameters.
|
|
228
222
|
* @param {*} [options] Override http request option.
|
|
229
223
|
* @throws {RequiredError}
|
|
230
|
-
* @memberof CatalogItemsApi
|
|
231
224
|
*/
|
|
232
225
|
getCatalogItem(requestParameters, options) {
|
|
233
226
|
return CatalogItemsApiFp(this.configuration).getCatalogItem(requestParameters.asin, requestParameters.marketplaceIds, requestParameters.includedData, requestParameters.locale, options).then((request) => request(this.axios, this.basePath));
|
|
234
227
|
}
|
|
235
228
|
/**
|
|
236
|
-
* Search for a list of Amazon catalog items and item-related information. You can search by identifier or by keywords. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | |
|
|
229
|
+
* Search for a list of Amazon catalog items and item-related information. You can search by identifier or by keywords. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 2 | The `x-amzn-RateLimit-Limit` response header contains the usage plan rate limits for the operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
|
|
237
230
|
* @param {CatalogItemsApiSearchCatalogItemsRequest} requestParameters Request parameters.
|
|
238
231
|
* @param {*} [options] Override http request option.
|
|
239
232
|
* @throws {RequiredError}
|
|
240
|
-
* @memberof CatalogItemsApi
|
|
241
233
|
*/
|
|
242
234
|
searchCatalogItems(requestParameters, options) {
|
|
243
235
|
return CatalogItemsApiFp(this.configuration).searchCatalogItems(requestParameters.marketplaceIds, requestParameters.identifiers, requestParameters.identifiersType, requestParameters.includedData, requestParameters.locale, requestParameters.sellerId, requestParameters.keywords, requestParameters.brandNames, requestParameters.classificationIds, requestParameters.pageSize, requestParameters.pageToken, requestParameters.keywordsLocale, options).then((request) => request(this.axios, this.basePath));
|
|
244
236
|
}
|
|
245
237
|
}
|
|
246
|
-
/**
|
|
247
|
-
* @export
|
|
248
|
-
*/
|
|
249
238
|
export const GetCatalogItemIncludedDataEnum = {
|
|
250
239
|
Attributes: 'attributes',
|
|
251
240
|
Classifications: 'classifications',
|
|
@@ -258,9 +247,6 @@ export const GetCatalogItemIncludedDataEnum = {
|
|
|
258
247
|
Summaries: 'summaries',
|
|
259
248
|
VendorDetails: 'vendorDetails'
|
|
260
249
|
};
|
|
261
|
-
/**
|
|
262
|
-
* @export
|
|
263
|
-
*/
|
|
264
250
|
export const SearchCatalogItemsIdentifiersTypeEnum = {
|
|
265
251
|
Asin: 'ASIN',
|
|
266
252
|
Ean: 'EAN',
|
|
@@ -271,9 +257,6 @@ export const SearchCatalogItemsIdentifiersTypeEnum = {
|
|
|
271
257
|
Sku: 'SKU',
|
|
272
258
|
Upc: 'UPC'
|
|
273
259
|
};
|
|
274
|
-
/**
|
|
275
|
-
* @export
|
|
276
|
-
*/
|
|
277
260
|
export const SearchCatalogItemsIncludedDataEnum = {
|
|
278
261
|
Attributes: 'attributes',
|
|
279
262
|
Classifications: 'classifications',
|
|
@@ -13,21 +13,12 @@
|
|
|
13
13
|
*/
|
|
14
14
|
import globalAxios from 'axios';
|
|
15
15
|
export const BASE_PATH = "https://sellingpartnerapi-na.amazon.com".replace(/\/+$/, "");
|
|
16
|
-
/**
|
|
17
|
-
*
|
|
18
|
-
* @export
|
|
19
|
-
*/
|
|
20
16
|
export const COLLECTION_FORMATS = {
|
|
21
17
|
csv: ",",
|
|
22
18
|
ssv: " ",
|
|
23
19
|
tsv: "\t",
|
|
24
20
|
pipes: "|",
|
|
25
21
|
};
|
|
26
|
-
/**
|
|
27
|
-
*
|
|
28
|
-
* @export
|
|
29
|
-
* @class BaseAPI
|
|
30
|
-
*/
|
|
31
22
|
export class BaseAPI {
|
|
32
23
|
basePath;
|
|
33
24
|
axios;
|
|
@@ -42,12 +33,6 @@ export class BaseAPI {
|
|
|
42
33
|
}
|
|
43
34
|
}
|
|
44
35
|
;
|
|
45
|
-
/**
|
|
46
|
-
*
|
|
47
|
-
* @export
|
|
48
|
-
* @class RequiredError
|
|
49
|
-
* @extends {Error}
|
|
50
|
-
*/
|
|
51
36
|
export class RequiredError extends Error {
|
|
52
37
|
field;
|
|
53
38
|
constructor(field, msg) {
|
|
@@ -56,8 +41,4 @@ export class RequiredError extends Error {
|
|
|
56
41
|
this.name = "RequiredError";
|
|
57
42
|
}
|
|
58
43
|
}
|
|
59
|
-
/**
|
|
60
|
-
*
|
|
61
|
-
* @export
|
|
62
|
-
*/
|
|
63
44
|
export const operationServerMap = {};
|
|
@@ -12,25 +12,16 @@
|
|
|
12
12
|
* Do not edit the class manually.
|
|
13
13
|
*/
|
|
14
14
|
import { RequiredError } from "./base";
|
|
15
|
-
/**
|
|
16
|
-
*
|
|
17
|
-
* @export
|
|
18
|
-
*/
|
|
19
15
|
export const DUMMY_BASE_URL = 'https://example.com';
|
|
20
16
|
/**
|
|
21
17
|
*
|
|
22
18
|
* @throws {RequiredError}
|
|
23
|
-
* @export
|
|
24
19
|
*/
|
|
25
20
|
export const assertParamExists = function (functionName, paramName, paramValue) {
|
|
26
21
|
if (paramValue === null || paramValue === undefined) {
|
|
27
22
|
throw new RequiredError(paramName, `Required parameter ${paramName} was null or undefined when calling ${functionName}.`);
|
|
28
23
|
}
|
|
29
24
|
};
|
|
30
|
-
/**
|
|
31
|
-
*
|
|
32
|
-
* @export
|
|
33
|
-
*/
|
|
34
25
|
export const setApiKeyToObject = async function (object, keyParamName, configuration) {
|
|
35
26
|
if (configuration && configuration.apiKey) {
|
|
36
27
|
const localVarApiKeyValue = typeof configuration.apiKey === 'function'
|
|
@@ -39,19 +30,11 @@ export const setApiKeyToObject = async function (object, keyParamName, configura
|
|
|
39
30
|
object[keyParamName] = localVarApiKeyValue;
|
|
40
31
|
}
|
|
41
32
|
};
|
|
42
|
-
/**
|
|
43
|
-
*
|
|
44
|
-
* @export
|
|
45
|
-
*/
|
|
46
33
|
export const setBasicAuthToObject = function (object, configuration) {
|
|
47
34
|
if (configuration && (configuration.username || configuration.password)) {
|
|
48
35
|
object["auth"] = { username: configuration.username, password: configuration.password };
|
|
49
36
|
}
|
|
50
37
|
};
|
|
51
|
-
/**
|
|
52
|
-
*
|
|
53
|
-
* @export
|
|
54
|
-
*/
|
|
55
38
|
export const setBearerAuthToObject = async function (object, configuration) {
|
|
56
39
|
if (configuration && configuration.accessToken) {
|
|
57
40
|
const accessToken = typeof configuration.accessToken === 'function'
|
|
@@ -60,10 +43,6 @@ export const setBearerAuthToObject = async function (object, configuration) {
|
|
|
60
43
|
object["Authorization"] = "Bearer " + accessToken;
|
|
61
44
|
}
|
|
62
45
|
};
|
|
63
|
-
/**
|
|
64
|
-
*
|
|
65
|
-
* @export
|
|
66
|
-
*/
|
|
67
46
|
export const setOAuthToObject = async function (object, name, scopes, configuration) {
|
|
68
47
|
if (configuration && configuration.accessToken) {
|
|
69
48
|
const localVarAccessTokenValue = typeof configuration.accessToken === 'function'
|
|
@@ -92,19 +71,11 @@ function setFlattenedQueryParams(urlSearchParams, parameter, key = "") {
|
|
|
92
71
|
}
|
|
93
72
|
}
|
|
94
73
|
}
|
|
95
|
-
/**
|
|
96
|
-
*
|
|
97
|
-
* @export
|
|
98
|
-
*/
|
|
99
74
|
export const setSearchParams = function (url, ...objects) {
|
|
100
75
|
const searchParams = new URLSearchParams(url.search);
|
|
101
76
|
setFlattenedQueryParams(searchParams, objects);
|
|
102
77
|
url.search = searchParams.toString();
|
|
103
78
|
};
|
|
104
|
-
/**
|
|
105
|
-
*
|
|
106
|
-
* @export
|
|
107
|
-
*/
|
|
108
79
|
export const serializeDataIfNeeded = function (value, requestOptions, configuration) {
|
|
109
80
|
const nonString = typeof value !== 'string';
|
|
110
81
|
const needsSerialization = nonString && configuration && configuration.isJsonMime
|
|
@@ -114,17 +85,9 @@ export const serializeDataIfNeeded = function (value, requestOptions, configurat
|
|
|
114
85
|
? JSON.stringify(value !== undefined ? value : {})
|
|
115
86
|
: (value || "");
|
|
116
87
|
};
|
|
117
|
-
/**
|
|
118
|
-
*
|
|
119
|
-
* @export
|
|
120
|
-
*/
|
|
121
88
|
export const toPathString = function (url) {
|
|
122
89
|
return url.pathname + url.search + url.hash;
|
|
123
90
|
};
|
|
124
|
-
/**
|
|
125
|
-
*
|
|
126
|
-
* @export
|
|
127
|
-
*/
|
|
128
91
|
export const createRequestFunction = function (axiosArgs, globalAxios, BASE_PATH, configuration) {
|
|
129
92
|
return (axios = globalAxios, basePath = BASE_PATH) => {
|
|
130
93
|
const axiosRequestArgs = { ...axiosArgs.options, url: (axios.defaults.baseURL ? '' : configuration?.basePath ?? basePath) + axiosArgs.url };
|