@sp-api-sdk/catalog-items-api-2022-04-01 4.2.11 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/dist/index.cjs +530 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +1280 -0
- package/dist/index.d.ts +1280 -0
- package/dist/index.js +481 -0
- package/dist/index.js.map +1 -0
- package/package.json +23 -12
- package/dist/cjs/api-model/api/catalog-items-api.js +0 -283
- 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/brand-refinement.js +0 -15
- package/dist/cjs/api-model/models/classification-refinement.js +0 -15
- package/dist/cjs/api-model/models/dimension.js +0 -15
- package/dist/cjs/api-model/models/dimensions.js +0 -15
- package/dist/cjs/api-model/models/error-list.js +0 -15
- package/dist/cjs/api-model/models/index.js +0 -45
- package/dist/cjs/api-model/models/item-browse-classification.js +0 -15
- package/dist/cjs/api-model/models/item-browse-classifications-by-marketplace.js +0 -15
- package/dist/cjs/api-model/models/item-classification-sales-rank.js +0 -15
- package/dist/cjs/api-model/models/item-contributor-role.js +0 -15
- package/dist/cjs/api-model/models/item-contributor.js +0 -15
- package/dist/cjs/api-model/models/item-dimensions-by-marketplace.js +0 -15
- package/dist/cjs/api-model/models/item-display-group-sales-rank.js +0 -15
- package/dist/cjs/api-model/models/item-identifier.js +0 -15
- package/dist/cjs/api-model/models/item-identifiers-by-marketplace.js +0 -15
- package/dist/cjs/api-model/models/item-image.js +0 -28
- package/dist/cjs/api-model/models/item-images-by-marketplace.js +0 -15
- package/dist/cjs/api-model/models/item-product-type-by-marketplace.js +0 -15
- package/dist/cjs/api-model/models/item-relationship.js +0 -20
- package/dist/cjs/api-model/models/item-relationships-by-marketplace.js +0 -15
- package/dist/cjs/api-model/models/item-sales-ranks-by-marketplace.js +0 -15
- package/dist/cjs/api-model/models/item-search-results.js +0 -15
- package/dist/cjs/api-model/models/item-summary-by-marketplace.js +0 -22
- package/dist/cjs/api-model/models/item-variation-theme.js +0 -15
- package/dist/cjs/api-model/models/item-vendor-details-by-marketplace.js +0 -28
- package/dist/cjs/api-model/models/item-vendor-details-category.js +0 -15
- package/dist/cjs/api-model/models/item.js +0 -15
- package/dist/cjs/api-model/models/model-error.js +0 -15
- package/dist/cjs/api-model/models/pagination.js +0 -15
- package/dist/cjs/api-model/models/refinements.js +0 -15
- package/dist/cjs/client.js +0 -28
- package/dist/cjs/index.js +0 -19
- package/dist/es/api-model/api/catalog-items-api.js +0 -273
- 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/brand-refinement.js +0 -14
- package/dist/es/api-model/models/classification-refinement.js +0 -14
- package/dist/es/api-model/models/dimension.js +0 -14
- package/dist/es/api-model/models/dimensions.js +0 -14
- package/dist/es/api-model/models/error-list.js +0 -14
- package/dist/es/api-model/models/index.js +0 -29
- package/dist/es/api-model/models/item-browse-classification.js +0 -14
- package/dist/es/api-model/models/item-browse-classifications-by-marketplace.js +0 -14
- package/dist/es/api-model/models/item-classification-sales-rank.js +0 -14
- package/dist/es/api-model/models/item-contributor-role.js +0 -14
- package/dist/es/api-model/models/item-contributor.js +0 -14
- package/dist/es/api-model/models/item-dimensions-by-marketplace.js +0 -14
- package/dist/es/api-model/models/item-display-group-sales-rank.js +0 -14
- package/dist/es/api-model/models/item-identifier.js +0 -14
- package/dist/es/api-model/models/item-identifiers-by-marketplace.js +0 -14
- package/dist/es/api-model/models/item-image.js +0 -25
- package/dist/es/api-model/models/item-images-by-marketplace.js +0 -14
- package/dist/es/api-model/models/item-product-type-by-marketplace.js +0 -14
- package/dist/es/api-model/models/item-relationship.js +0 -17
- package/dist/es/api-model/models/item-relationships-by-marketplace.js +0 -14
- package/dist/es/api-model/models/item-sales-ranks-by-marketplace.js +0 -14
- package/dist/es/api-model/models/item-search-results.js +0 -14
- package/dist/es/api-model/models/item-summary-by-marketplace.js +0 -19
- package/dist/es/api-model/models/item-variation-theme.js +0 -14
- package/dist/es/api-model/models/item-vendor-details-by-marketplace.js +0 -25
- package/dist/es/api-model/models/item-vendor-details-category.js +0 -14
- package/dist/es/api-model/models/item.js +0 -14
- package/dist/es/api-model/models/model-error.js +0 -14
- package/dist/es/api-model/models/pagination.js +0 -14
- package/dist/es/api-model/models/refinements.js +0 -14
- package/dist/es/client.js +0 -24
- package/dist/es/index.js +0 -3
- package/dist/types/api-model/api/catalog-items-api.d.ts +0 -232
- 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/brand-refinement.d.ts +0 -24
- package/dist/types/api-model/models/classification-refinement.d.ts +0 -28
- package/dist/types/api-model/models/dimension.d.ts +0 -24
- package/dist/types/api-model/models/dimensions.d.ts +0 -21
- package/dist/types/api-model/models/error-list.d.ts +0 -20
- package/dist/types/api-model/models/index.d.ts +0 -29
- package/dist/types/api-model/models/item-browse-classification.d.ts +0 -25
- package/dist/types/api-model/models/item-browse-classifications-by-marketplace.d.ts +0 -25
- package/dist/types/api-model/models/item-classification-sales-rank.d.ts +0 -32
- package/dist/types/api-model/models/item-contributor-role.d.ts +0 -24
- package/dist/types/api-model/models/item-contributor.d.ts +0 -22
- package/dist/types/api-model/models/item-dimensions-by-marketplace.d.ts +0 -23
- package/dist/types/api-model/models/item-display-group-sales-rank.d.ts +0 -32
- package/dist/types/api-model/models/item-identifier.d.ts +0 -24
- package/dist/types/api-model/models/item-identifiers-by-marketplace.d.ts +0 -25
- package/dist/types/api-model/models/item-image.d.ts +0 -45
- package/dist/types/api-model/models/item-images-by-marketplace.d.ts +0 -25
- package/dist/types/api-model/models/item-product-type-by-marketplace.d.ts +0 -24
- package/dist/types/api-model/models/item-relationship.d.ts +0 -35
- package/dist/types/api-model/models/item-relationships-by-marketplace.d.ts +0 -25
- package/dist/types/api-model/models/item-sales-ranks-by-marketplace.d.ts +0 -30
- package/dist/types/api-model/models/item-search-results.d.ts +0 -29
- package/dist/types/api-model/models/item-summary-by-marketplace.d.ts +0 -102
- package/dist/types/api-model/models/item-variation-theme.d.ts +0 -24
- package/dist/types/api-model/models/item-vendor-details-by-marketplace.d.ts +0 -56
- package/dist/types/api-model/models/item-vendor-details-category.d.ts +0 -24
- package/dist/types/api-model/models/item.d.ts +0 -71
- package/dist/types/api-model/models/model-error.d.ts +0 -28
- package/dist/types/api-model/models/pagination.d.ts +0 -24
- package/dist/types/api-model/models/refinements.d.ts +0 -26
- package/dist/types/client.d.ts +0 -6
- package/dist/types/index.d.ts +0 -3
package/package.json
CHANGED
|
@@ -2,24 +2,35 @@
|
|
|
2
2
|
"name": "@sp-api-sdk/catalog-items-api-2022-04-01",
|
|
3
3
|
"author": "Bertrand Marron <bertrand@bizon.solutions>",
|
|
4
4
|
"description": "Use the Selling Partner API for Catalog Items to retrieve information about items in the Amazon catalog. For more information, refer to the Catalog Items API Use Case Guide.",
|
|
5
|
-
"version": "
|
|
6
|
-
"main": "dist/cjs/index.js",
|
|
7
|
-
"module": "dist/es/index.js",
|
|
8
|
-
"types": "dist/types/index.d.ts",
|
|
5
|
+
"version": "5.0.0",
|
|
9
6
|
"license": "MIT",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"sideEffects": false,
|
|
9
|
+
"source": "./src/index.ts",
|
|
10
|
+
"main": "./dist/index.cjs",
|
|
11
|
+
"module": "./dist/index.js",
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
13
|
+
"exports": {
|
|
14
|
+
".": {
|
|
15
|
+
"import": {
|
|
16
|
+
"types": "./dist/index.d.ts",
|
|
17
|
+
"default": "./dist/index.js"
|
|
18
|
+
},
|
|
19
|
+
"require": {
|
|
20
|
+
"types": "./dist/index.d.cts",
|
|
21
|
+
"default": "./dist/index.cjs"
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
},
|
|
10
25
|
"publishConfig": {
|
|
11
26
|
"access": "public"
|
|
12
27
|
},
|
|
13
|
-
"directories": {
|
|
14
|
-
"lib": "dist"
|
|
15
|
-
},
|
|
16
28
|
"files": [
|
|
17
|
-
"dist
|
|
18
|
-
"dist/**/*.d.ts"
|
|
29
|
+
"dist"
|
|
19
30
|
],
|
|
20
31
|
"dependencies": {
|
|
21
|
-
"@sp-api-sdk/common": "
|
|
22
|
-
"axios": "^1.
|
|
32
|
+
"@sp-api-sdk/common": "3.0.0",
|
|
33
|
+
"axios": "^1.16.1"
|
|
23
34
|
},
|
|
24
35
|
"repository": {
|
|
25
36
|
"type": "git",
|
|
@@ -40,5 +51,5 @@
|
|
|
40
51
|
"sp sdk",
|
|
41
52
|
"catalog items api"
|
|
42
53
|
],
|
|
43
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "40177b741b5e9299d449d10c8e41a9a798aec593"
|
|
44
55
|
}
|
|
@@ -1,283 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/* tslint:disable */
|
|
3
|
-
/* eslint-disable */
|
|
4
|
-
/**
|
|
5
|
-
* Selling Partner API for Catalog Items
|
|
6
|
-
* Use the Selling Partner API for Catalog Items to retrieve information about items in the Amazon catalog. For more information, refer to the [Catalog Items API Use Case Guide](https://developer-docs.amazon.com/sp-api/docs/:catalog-items-api-v2022-04-01-use-case-guide).
|
|
7
|
-
*
|
|
8
|
-
* The version of the OpenAPI document: 2022-04-01
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
12
|
-
* https://openapi-generator.tech
|
|
13
|
-
* Do not edit the class manually.
|
|
14
|
-
*/
|
|
15
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
16
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
17
|
-
};
|
|
18
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
-
exports.SearchCatalogItemsIncludedDataEnum = exports.SearchCatalogItemsIdentifiersTypeEnum = exports.GetCatalogItemIncludedDataEnum = exports.CatalogItemsApi = exports.CatalogItemsApiFactory = exports.CatalogItemsApiFp = exports.CatalogItemsApiAxiosParamCreator = void 0;
|
|
20
|
-
const axios_1 = __importDefault(require("axios"));
|
|
21
|
-
// Some imports not used depending on template conditions
|
|
22
|
-
// @ts-ignore
|
|
23
|
-
const common_1 = require("../common");
|
|
24
|
-
// @ts-ignore
|
|
25
|
-
const base_1 = require("../base");
|
|
26
|
-
/**
|
|
27
|
-
* CatalogItemsApi - axios parameter creator
|
|
28
|
-
*/
|
|
29
|
-
const CatalogItemsApiAxiosParamCreator = function (configuration) {
|
|
30
|
-
return {
|
|
31
|
-
/**
|
|
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).
|
|
33
|
-
* @param {string} asin The Amazon Standard Identification Number (ASIN) of the item.
|
|
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).
|
|
35
|
-
* @param {Array<GetCatalogItemIncludedDataEnum>} [includedData] A comma-delimited list of datasets to include in the response.
|
|
36
|
-
* @param {string} [locale] The locale for which you want to retrieve localized summaries. Defaults to the primary locale of the marketplace.
|
|
37
|
-
* @param {*} [options] Override http request option.
|
|
38
|
-
* @throws {RequiredError}
|
|
39
|
-
*/
|
|
40
|
-
getCatalogItem: async (asin, marketplaceIds, includedData, locale, options = {}) => {
|
|
41
|
-
// verify required parameter 'asin' is not null or undefined
|
|
42
|
-
(0, common_1.assertParamExists)('getCatalogItem', 'asin', asin);
|
|
43
|
-
// verify required parameter 'marketplaceIds' is not null or undefined
|
|
44
|
-
(0, common_1.assertParamExists)('getCatalogItem', 'marketplaceIds', marketplaceIds);
|
|
45
|
-
const localVarPath = `/catalog/2022-04-01/items/{asin}`
|
|
46
|
-
.replace(`{${"asin"}}`, encodeURIComponent(String(asin)));
|
|
47
|
-
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
48
|
-
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
49
|
-
let baseOptions;
|
|
50
|
-
if (configuration) {
|
|
51
|
-
baseOptions = configuration.baseOptions;
|
|
52
|
-
}
|
|
53
|
-
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
|
|
54
|
-
const localVarHeaderParameter = {};
|
|
55
|
-
const localVarQueryParameter = {};
|
|
56
|
-
if (marketplaceIds) {
|
|
57
|
-
localVarQueryParameter['marketplaceIds'] = marketplaceIds.join(base_1.COLLECTION_FORMATS.csv);
|
|
58
|
-
}
|
|
59
|
-
if (includedData) {
|
|
60
|
-
localVarQueryParameter['includedData'] = includedData.join(base_1.COLLECTION_FORMATS.csv);
|
|
61
|
-
}
|
|
62
|
-
if (locale !== undefined) {
|
|
63
|
-
localVarQueryParameter['locale'] = locale;
|
|
64
|
-
}
|
|
65
|
-
localVarHeaderParameter['Accept'] = 'application/json';
|
|
66
|
-
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
67
|
-
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
68
|
-
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
|
|
69
|
-
return {
|
|
70
|
-
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
71
|
-
options: localVarRequestOptions,
|
|
72
|
-
};
|
|
73
|
-
},
|
|
74
|
-
/**
|
|
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 | | ---- | ---- | | 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
|
-
* @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
|
-
* @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
|
-
* @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.
|
|
79
|
-
* @param {Array<SearchCatalogItemsIncludedDataEnum>} [includedData] A comma-delimited list of datasets to include in the response.
|
|
80
|
-
* @param {string} [locale] The locale for which you want to retrieve localized summaries. Defaults to the primary locale of the marketplace.
|
|
81
|
-
* @param {string} [sellerId] A selling partner identifier, such as a seller account or vendor code. **Note:** Required when `identifiersType` is `SKU`.
|
|
82
|
-
* @param {Array<string>} [keywords] A comma-delimited list of keywords that you can use to search the Amazon catalog. **Note:** You cannot include `keywords` and `identifiers` in the same request.
|
|
83
|
-
* @param {Array<string>} [brandNames] A comma-delimited list of brand names that you can use to limit the search in queries based on `keywords`. **Note:** Cannot be used with `identifiers`.
|
|
84
|
-
* @param {Array<string>} [classificationIds] A comma-delimited list of classification identifiers that you can use to limit the search in queries based on `keywords`. **Note:** Cannot be used with `identifiers`.
|
|
85
|
-
* @param {number} [pageSize] The number of results to include on each page.
|
|
86
|
-
* @param {string} [pageToken] A token that you can use to fetch a specific page when there are multiple pages of results.
|
|
87
|
-
* @param {string} [keywordsLocale] The language of the keywords that are included in queries based on `keywords`. Defaults to the primary locale of the marketplace. **Note:** Cannot be used with `identifiers`.
|
|
88
|
-
* @param {*} [options] Override http request option.
|
|
89
|
-
* @throws {RequiredError}
|
|
90
|
-
*/
|
|
91
|
-
searchCatalogItems: async (marketplaceIds, identifiers, identifiersType, includedData, locale, sellerId, keywords, brandNames, classificationIds, pageSize, pageToken, keywordsLocale, options = {}) => {
|
|
92
|
-
// verify required parameter 'marketplaceIds' is not null or undefined
|
|
93
|
-
(0, common_1.assertParamExists)('searchCatalogItems', 'marketplaceIds', marketplaceIds);
|
|
94
|
-
const localVarPath = `/catalog/2022-04-01/items`;
|
|
95
|
-
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
96
|
-
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
97
|
-
let baseOptions;
|
|
98
|
-
if (configuration) {
|
|
99
|
-
baseOptions = configuration.baseOptions;
|
|
100
|
-
}
|
|
101
|
-
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
|
|
102
|
-
const localVarHeaderParameter = {};
|
|
103
|
-
const localVarQueryParameter = {};
|
|
104
|
-
if (identifiers) {
|
|
105
|
-
localVarQueryParameter['identifiers'] = identifiers.join(base_1.COLLECTION_FORMATS.csv);
|
|
106
|
-
}
|
|
107
|
-
if (identifiersType !== undefined) {
|
|
108
|
-
localVarQueryParameter['identifiersType'] = identifiersType;
|
|
109
|
-
}
|
|
110
|
-
if (marketplaceIds) {
|
|
111
|
-
localVarQueryParameter['marketplaceIds'] = marketplaceIds.join(base_1.COLLECTION_FORMATS.csv);
|
|
112
|
-
}
|
|
113
|
-
if (includedData) {
|
|
114
|
-
localVarQueryParameter['includedData'] = includedData.join(base_1.COLLECTION_FORMATS.csv);
|
|
115
|
-
}
|
|
116
|
-
if (locale !== undefined) {
|
|
117
|
-
localVarQueryParameter['locale'] = locale;
|
|
118
|
-
}
|
|
119
|
-
if (sellerId !== undefined) {
|
|
120
|
-
localVarQueryParameter['sellerId'] = sellerId;
|
|
121
|
-
}
|
|
122
|
-
if (keywords) {
|
|
123
|
-
localVarQueryParameter['keywords'] = keywords.join(base_1.COLLECTION_FORMATS.csv);
|
|
124
|
-
}
|
|
125
|
-
if (brandNames) {
|
|
126
|
-
localVarQueryParameter['brandNames'] = brandNames.join(base_1.COLLECTION_FORMATS.csv);
|
|
127
|
-
}
|
|
128
|
-
if (classificationIds) {
|
|
129
|
-
localVarQueryParameter['classificationIds'] = classificationIds.join(base_1.COLLECTION_FORMATS.csv);
|
|
130
|
-
}
|
|
131
|
-
if (pageSize !== undefined) {
|
|
132
|
-
localVarQueryParameter['pageSize'] = pageSize;
|
|
133
|
-
}
|
|
134
|
-
if (pageToken !== undefined) {
|
|
135
|
-
localVarQueryParameter['pageToken'] = pageToken;
|
|
136
|
-
}
|
|
137
|
-
if (keywordsLocale !== undefined) {
|
|
138
|
-
localVarQueryParameter['keywordsLocale'] = keywordsLocale;
|
|
139
|
-
}
|
|
140
|
-
localVarHeaderParameter['Accept'] = 'application/json';
|
|
141
|
-
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
142
|
-
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
143
|
-
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
|
|
144
|
-
return {
|
|
145
|
-
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
146
|
-
options: localVarRequestOptions,
|
|
147
|
-
};
|
|
148
|
-
},
|
|
149
|
-
};
|
|
150
|
-
};
|
|
151
|
-
exports.CatalogItemsApiAxiosParamCreator = CatalogItemsApiAxiosParamCreator;
|
|
152
|
-
/**
|
|
153
|
-
* CatalogItemsApi - functional programming interface
|
|
154
|
-
*/
|
|
155
|
-
const CatalogItemsApiFp = function (configuration) {
|
|
156
|
-
const localVarAxiosParamCreator = (0, exports.CatalogItemsApiAxiosParamCreator)(configuration);
|
|
157
|
-
return {
|
|
158
|
-
/**
|
|
159
|
-
* 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
|
-
* @param {string} asin The Amazon Standard Identification Number (ASIN) of the item.
|
|
161
|
-
* @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
|
-
* @param {Array<GetCatalogItemIncludedDataEnum>} [includedData] A comma-delimited list of datasets to include in the response.
|
|
163
|
-
* @param {string} [locale] The locale for which you want to retrieve localized summaries. Defaults to the primary locale of the marketplace.
|
|
164
|
-
* @param {*} [options] Override http request option.
|
|
165
|
-
* @throws {RequiredError}
|
|
166
|
-
*/
|
|
167
|
-
async getCatalogItem(asin, marketplaceIds, includedData, locale, options) {
|
|
168
|
-
const localVarAxiosArgs = await localVarAxiosParamCreator.getCatalogItem(asin, marketplaceIds, includedData, locale, options);
|
|
169
|
-
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
170
|
-
const localVarOperationServerBasePath = base_1.operationServerMap['CatalogItemsApi.getCatalogItem']?.[localVarOperationServerIndex]?.url;
|
|
171
|
-
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
172
|
-
},
|
|
173
|
-
/**
|
|
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 | | ---- | ---- | | 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
|
-
* @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
|
-
* @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
|
-
* @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.
|
|
178
|
-
* @param {Array<SearchCatalogItemsIncludedDataEnum>} [includedData] A comma-delimited list of datasets to include in the response.
|
|
179
|
-
* @param {string} [locale] The locale for which you want to retrieve localized summaries. Defaults to the primary locale of the marketplace.
|
|
180
|
-
* @param {string} [sellerId] A selling partner identifier, such as a seller account or vendor code. **Note:** Required when `identifiersType` is `SKU`.
|
|
181
|
-
* @param {Array<string>} [keywords] A comma-delimited list of keywords that you can use to search the Amazon catalog. **Note:** You cannot include `keywords` and `identifiers` in the same request.
|
|
182
|
-
* @param {Array<string>} [brandNames] A comma-delimited list of brand names that you can use to limit the search in queries based on `keywords`. **Note:** Cannot be used with `identifiers`.
|
|
183
|
-
* @param {Array<string>} [classificationIds] A comma-delimited list of classification identifiers that you can use to limit the search in queries based on `keywords`. **Note:** Cannot be used with `identifiers`.
|
|
184
|
-
* @param {number} [pageSize] The number of results to include on each page.
|
|
185
|
-
* @param {string} [pageToken] A token that you can use to fetch a specific page when there are multiple pages of results.
|
|
186
|
-
* @param {string} [keywordsLocale] The language of the keywords that are included in queries based on `keywords`. Defaults to the primary locale of the marketplace. **Note:** Cannot be used with `identifiers`.
|
|
187
|
-
* @param {*} [options] Override http request option.
|
|
188
|
-
* @throws {RequiredError}
|
|
189
|
-
*/
|
|
190
|
-
async searchCatalogItems(marketplaceIds, identifiers, identifiersType, includedData, locale, sellerId, keywords, brandNames, classificationIds, pageSize, pageToken, keywordsLocale, options) {
|
|
191
|
-
const localVarAxiosArgs = await localVarAxiosParamCreator.searchCatalogItems(marketplaceIds, identifiers, identifiersType, includedData, locale, sellerId, keywords, brandNames, classificationIds, pageSize, pageToken, keywordsLocale, options);
|
|
192
|
-
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
193
|
-
const localVarOperationServerBasePath = base_1.operationServerMap['CatalogItemsApi.searchCatalogItems']?.[localVarOperationServerIndex]?.url;
|
|
194
|
-
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
195
|
-
},
|
|
196
|
-
};
|
|
197
|
-
};
|
|
198
|
-
exports.CatalogItemsApiFp = CatalogItemsApiFp;
|
|
199
|
-
/**
|
|
200
|
-
* CatalogItemsApi - factory interface
|
|
201
|
-
*/
|
|
202
|
-
const CatalogItemsApiFactory = function (configuration, basePath, axios) {
|
|
203
|
-
const localVarFp = (0, exports.CatalogItemsApiFp)(configuration);
|
|
204
|
-
return {
|
|
205
|
-
/**
|
|
206
|
-
* 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).
|
|
207
|
-
* @param {CatalogItemsApiGetCatalogItemRequest} requestParameters Request parameters.
|
|
208
|
-
* @param {*} [options] Override http request option.
|
|
209
|
-
* @throws {RequiredError}
|
|
210
|
-
*/
|
|
211
|
-
getCatalogItem(requestParameters, options) {
|
|
212
|
-
return localVarFp.getCatalogItem(requestParameters.asin, requestParameters.marketplaceIds, requestParameters.includedData, requestParameters.locale, options).then((request) => request(axios, basePath));
|
|
213
|
-
},
|
|
214
|
-
/**
|
|
215
|
-
* 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).
|
|
216
|
-
* @param {CatalogItemsApiSearchCatalogItemsRequest} requestParameters Request parameters.
|
|
217
|
-
* @param {*} [options] Override http request option.
|
|
218
|
-
* @throws {RequiredError}
|
|
219
|
-
*/
|
|
220
|
-
searchCatalogItems(requestParameters, options) {
|
|
221
|
-
return localVarFp.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(axios, basePath));
|
|
222
|
-
},
|
|
223
|
-
};
|
|
224
|
-
};
|
|
225
|
-
exports.CatalogItemsApiFactory = CatalogItemsApiFactory;
|
|
226
|
-
/**
|
|
227
|
-
* CatalogItemsApi - object-oriented interface
|
|
228
|
-
*/
|
|
229
|
-
class CatalogItemsApi extends base_1.BaseAPI {
|
|
230
|
-
/**
|
|
231
|
-
* 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).
|
|
232
|
-
* @param {CatalogItemsApiGetCatalogItemRequest} requestParameters Request parameters.
|
|
233
|
-
* @param {*} [options] Override http request option.
|
|
234
|
-
* @throws {RequiredError}
|
|
235
|
-
*/
|
|
236
|
-
getCatalogItem(requestParameters, options) {
|
|
237
|
-
return (0, exports.CatalogItemsApiFp)(this.configuration).getCatalogItem(requestParameters.asin, requestParameters.marketplaceIds, requestParameters.includedData, requestParameters.locale, options).then((request) => request(this.axios, this.basePath));
|
|
238
|
-
}
|
|
239
|
-
/**
|
|
240
|
-
* 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).
|
|
241
|
-
* @param {CatalogItemsApiSearchCatalogItemsRequest} requestParameters Request parameters.
|
|
242
|
-
* @param {*} [options] Override http request option.
|
|
243
|
-
* @throws {RequiredError}
|
|
244
|
-
*/
|
|
245
|
-
searchCatalogItems(requestParameters, options) {
|
|
246
|
-
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));
|
|
247
|
-
}
|
|
248
|
-
}
|
|
249
|
-
exports.CatalogItemsApi = CatalogItemsApi;
|
|
250
|
-
exports.GetCatalogItemIncludedDataEnum = {
|
|
251
|
-
Attributes: 'attributes',
|
|
252
|
-
Classifications: 'classifications',
|
|
253
|
-
Dimensions: 'dimensions',
|
|
254
|
-
Identifiers: 'identifiers',
|
|
255
|
-
Images: 'images',
|
|
256
|
-
ProductTypes: 'productTypes',
|
|
257
|
-
Relationships: 'relationships',
|
|
258
|
-
SalesRanks: 'salesRanks',
|
|
259
|
-
Summaries: 'summaries',
|
|
260
|
-
VendorDetails: 'vendorDetails'
|
|
261
|
-
};
|
|
262
|
-
exports.SearchCatalogItemsIdentifiersTypeEnum = {
|
|
263
|
-
Asin: 'ASIN',
|
|
264
|
-
Ean: 'EAN',
|
|
265
|
-
Gtin: 'GTIN',
|
|
266
|
-
Isbn: 'ISBN',
|
|
267
|
-
Jan: 'JAN',
|
|
268
|
-
Minsan: 'MINSAN',
|
|
269
|
-
Sku: 'SKU',
|
|
270
|
-
Upc: 'UPC'
|
|
271
|
-
};
|
|
272
|
-
exports.SearchCatalogItemsIncludedDataEnum = {
|
|
273
|
-
Attributes: 'attributes',
|
|
274
|
-
Classifications: 'classifications',
|
|
275
|
-
Dimensions: 'dimensions',
|
|
276
|
-
Identifiers: 'identifiers',
|
|
277
|
-
Images: 'images',
|
|
278
|
-
ProductTypes: 'productTypes',
|
|
279
|
-
Relationships: 'relationships',
|
|
280
|
-
SalesRanks: 'salesRanks',
|
|
281
|
-
Summaries: 'summaries',
|
|
282
|
-
VendorDetails: 'vendorDetails'
|
|
283
|
-
};
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/* tslint:disable */
|
|
3
|
-
/* eslint-disable */
|
|
4
|
-
/**
|
|
5
|
-
* Selling Partner API for Catalog Items
|
|
6
|
-
* Use the Selling Partner API for Catalog Items to retrieve information about items in the Amazon catalog. For more information, refer to the [Catalog Items API Use Case Guide](https://developer-docs.amazon.com/sp-api/docs/:catalog-items-api-v2022-04-01-use-case-guide).
|
|
7
|
-
*
|
|
8
|
-
* The version of the OpenAPI document: 2022-04-01
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
12
|
-
* https://openapi-generator.tech
|
|
13
|
-
* Do not edit the class manually.
|
|
14
|
-
*/
|
|
15
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
16
|
-
if (k2 === undefined) k2 = k;
|
|
17
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
18
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
19
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
20
|
-
}
|
|
21
|
-
Object.defineProperty(o, k2, desc);
|
|
22
|
-
}) : (function(o, m, k, k2) {
|
|
23
|
-
if (k2 === undefined) k2 = k;
|
|
24
|
-
o[k2] = m[k];
|
|
25
|
-
}));
|
|
26
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
27
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
28
|
-
};
|
|
29
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
|
-
__exportStar(require("./api/catalog-items-api"), exports);
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/* tslint:disable */
|
|
3
|
-
/* eslint-disable */
|
|
4
|
-
/**
|
|
5
|
-
* Selling Partner API for Catalog Items
|
|
6
|
-
* Use the Selling Partner API for Catalog Items to retrieve information about items in the Amazon catalog. For more information, refer to the [Catalog Items API Use Case Guide](https://developer-docs.amazon.com/sp-api/docs/:catalog-items-api-v2022-04-01-use-case-guide).
|
|
7
|
-
*
|
|
8
|
-
* The version of the OpenAPI document: 2022-04-01
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
12
|
-
* https://openapi-generator.tech
|
|
13
|
-
* Do not edit the class manually.
|
|
14
|
-
*/
|
|
15
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
16
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
17
|
-
};
|
|
18
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
-
exports.operationServerMap = exports.RequiredError = exports.BaseAPI = exports.COLLECTION_FORMATS = exports.BASE_PATH = void 0;
|
|
20
|
-
const axios_1 = __importDefault(require("axios"));
|
|
21
|
-
exports.BASE_PATH = "https://sellingpartnerapi-na.amazon.com".replace(/\/+$/, "");
|
|
22
|
-
exports.COLLECTION_FORMATS = {
|
|
23
|
-
csv: ",",
|
|
24
|
-
ssv: " ",
|
|
25
|
-
tsv: "\t",
|
|
26
|
-
pipes: "|",
|
|
27
|
-
};
|
|
28
|
-
class BaseAPI {
|
|
29
|
-
basePath;
|
|
30
|
-
axios;
|
|
31
|
-
configuration;
|
|
32
|
-
constructor(configuration, basePath = exports.BASE_PATH, axios = axios_1.default) {
|
|
33
|
-
this.basePath = basePath;
|
|
34
|
-
this.axios = axios;
|
|
35
|
-
if (configuration) {
|
|
36
|
-
this.configuration = configuration;
|
|
37
|
-
this.basePath = configuration.basePath ?? basePath;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
exports.BaseAPI = BaseAPI;
|
|
42
|
-
;
|
|
43
|
-
class RequiredError extends Error {
|
|
44
|
-
field;
|
|
45
|
-
constructor(field, msg) {
|
|
46
|
-
super(msg);
|
|
47
|
-
this.field = field;
|
|
48
|
-
this.name = "RequiredError";
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
exports.RequiredError = RequiredError;
|
|
52
|
-
exports.operationServerMap = {};
|
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/* tslint:disable */
|
|
3
|
-
/* eslint-disable */
|
|
4
|
-
/**
|
|
5
|
-
* Selling Partner API for Catalog Items
|
|
6
|
-
* Use the Selling Partner API for Catalog Items to retrieve information about items in the Amazon catalog. For more information, refer to the [Catalog Items API Use Case Guide](https://developer-docs.amazon.com/sp-api/docs/:catalog-items-api-v2022-04-01-use-case-guide).
|
|
7
|
-
*
|
|
8
|
-
* The version of the OpenAPI document: 2022-04-01
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
12
|
-
* https://openapi-generator.tech
|
|
13
|
-
* Do not edit the class manually.
|
|
14
|
-
*/
|
|
15
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
-
exports.createRequestFunction = exports.toPathString = exports.serializeDataIfNeeded = exports.replaceWithSerializableTypeIfNeeded = exports.setSearchParams = exports.setOAuthToObject = exports.setBearerAuthToObject = exports.setBasicAuthToObject = exports.setApiKeyToObject = exports.assertParamExists = exports.DUMMY_BASE_URL = void 0;
|
|
17
|
-
const base_1 = require("./base");
|
|
18
|
-
exports.DUMMY_BASE_URL = 'https://example.com';
|
|
19
|
-
/**
|
|
20
|
-
*
|
|
21
|
-
* @throws {RequiredError}
|
|
22
|
-
*/
|
|
23
|
-
const assertParamExists = function (functionName, paramName, paramValue) {
|
|
24
|
-
if (paramValue === null || paramValue === undefined) {
|
|
25
|
-
throw new base_1.RequiredError(paramName, `Required parameter ${paramName} was null or undefined when calling ${functionName}.`);
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
exports.assertParamExists = assertParamExists;
|
|
29
|
-
const setApiKeyToObject = async function (object, keyParamName, configuration) {
|
|
30
|
-
if (configuration && configuration.apiKey) {
|
|
31
|
-
const localVarApiKeyValue = typeof configuration.apiKey === 'function'
|
|
32
|
-
? await configuration.apiKey(keyParamName)
|
|
33
|
-
: await configuration.apiKey;
|
|
34
|
-
object[keyParamName] = localVarApiKeyValue;
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
exports.setApiKeyToObject = setApiKeyToObject;
|
|
38
|
-
const setBasicAuthToObject = function (object, configuration) {
|
|
39
|
-
if (configuration && (configuration.username || configuration.password)) {
|
|
40
|
-
object["auth"] = { username: configuration.username, password: configuration.password };
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
exports.setBasicAuthToObject = setBasicAuthToObject;
|
|
44
|
-
const setBearerAuthToObject = async function (object, configuration) {
|
|
45
|
-
if (configuration && configuration.accessToken) {
|
|
46
|
-
const accessToken = typeof configuration.accessToken === 'function'
|
|
47
|
-
? await configuration.accessToken()
|
|
48
|
-
: await configuration.accessToken;
|
|
49
|
-
object["Authorization"] = "Bearer " + accessToken;
|
|
50
|
-
}
|
|
51
|
-
};
|
|
52
|
-
exports.setBearerAuthToObject = setBearerAuthToObject;
|
|
53
|
-
const setOAuthToObject = async function (object, name, scopes, configuration) {
|
|
54
|
-
if (configuration && configuration.accessToken) {
|
|
55
|
-
const localVarAccessTokenValue = typeof configuration.accessToken === 'function'
|
|
56
|
-
? await configuration.accessToken(name, scopes)
|
|
57
|
-
: await configuration.accessToken;
|
|
58
|
-
object["Authorization"] = "Bearer " + localVarAccessTokenValue;
|
|
59
|
-
}
|
|
60
|
-
};
|
|
61
|
-
exports.setOAuthToObject = setOAuthToObject;
|
|
62
|
-
function setFlattenedQueryParams(urlSearchParams, parameter, key = "") {
|
|
63
|
-
if (parameter == null)
|
|
64
|
-
return;
|
|
65
|
-
if (typeof parameter === "object") {
|
|
66
|
-
if (Array.isArray(parameter) || parameter instanceof Set) {
|
|
67
|
-
parameter.forEach(item => setFlattenedQueryParams(urlSearchParams, item, key));
|
|
68
|
-
}
|
|
69
|
-
else {
|
|
70
|
-
Object.keys(parameter).forEach(currentKey => setFlattenedQueryParams(urlSearchParams, parameter[currentKey], `${key}${key !== '' ? '.' : ''}${currentKey}`));
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
else {
|
|
74
|
-
if (urlSearchParams.has(key)) {
|
|
75
|
-
urlSearchParams.append(key, parameter);
|
|
76
|
-
}
|
|
77
|
-
else {
|
|
78
|
-
urlSearchParams.set(key, parameter);
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
const setSearchParams = function (url, ...objects) {
|
|
83
|
-
const searchParams = new URLSearchParams(url.search);
|
|
84
|
-
setFlattenedQueryParams(searchParams, objects);
|
|
85
|
-
url.search = searchParams.toString();
|
|
86
|
-
};
|
|
87
|
-
exports.setSearchParams = setSearchParams;
|
|
88
|
-
/**
|
|
89
|
-
* JSON serialization helper function which replaces instances of unserializable types with serializable ones.
|
|
90
|
-
* This function will run for every key-value pair encountered by JSON.stringify while traversing an object.
|
|
91
|
-
* Converting a set to a string will return an empty object, so an intermediate conversion to an array is required.
|
|
92
|
-
*/
|
|
93
|
-
// @ts-ignore
|
|
94
|
-
const replaceWithSerializableTypeIfNeeded = function (key, value) {
|
|
95
|
-
if (value instanceof Set) {
|
|
96
|
-
return Array.from(value);
|
|
97
|
-
}
|
|
98
|
-
else {
|
|
99
|
-
return value;
|
|
100
|
-
}
|
|
101
|
-
};
|
|
102
|
-
exports.replaceWithSerializableTypeIfNeeded = replaceWithSerializableTypeIfNeeded;
|
|
103
|
-
const serializeDataIfNeeded = function (value, requestOptions, configuration) {
|
|
104
|
-
const nonString = typeof value !== 'string';
|
|
105
|
-
const needsSerialization = nonString && configuration && configuration.isJsonMime
|
|
106
|
-
? configuration.isJsonMime(requestOptions.headers['Content-Type'])
|
|
107
|
-
: nonString;
|
|
108
|
-
return needsSerialization
|
|
109
|
-
? JSON.stringify(value !== undefined ? value : {}, exports.replaceWithSerializableTypeIfNeeded)
|
|
110
|
-
: (value || "");
|
|
111
|
-
};
|
|
112
|
-
exports.serializeDataIfNeeded = serializeDataIfNeeded;
|
|
113
|
-
const toPathString = function (url) {
|
|
114
|
-
return url.pathname + url.search + url.hash;
|
|
115
|
-
};
|
|
116
|
-
exports.toPathString = toPathString;
|
|
117
|
-
const createRequestFunction = function (axiosArgs, globalAxios, BASE_PATH, configuration) {
|
|
118
|
-
return (axios = globalAxios, basePath = BASE_PATH) => {
|
|
119
|
-
const axiosRequestArgs = { ...axiosArgs.options, url: (axios.defaults.baseURL ? '' : configuration?.basePath ?? basePath) + axiosArgs.url };
|
|
120
|
-
return axios.request(axiosRequestArgs);
|
|
121
|
-
};
|
|
122
|
-
};
|
|
123
|
-
exports.createRequestFunction = createRequestFunction;
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/* tslint:disable */
|
|
3
|
-
/**
|
|
4
|
-
* Selling Partner API for Catalog Items
|
|
5
|
-
* Use the Selling Partner API for Catalog Items to retrieve information about items in the Amazon catalog. For more information, refer to the [Catalog Items API Use Case Guide](https://developer-docs.amazon.com/sp-api/docs/:catalog-items-api-v2022-04-01-use-case-guide).
|
|
6
|
-
*
|
|
7
|
-
* The version of the OpenAPI document: 2022-04-01
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
-
* https://openapi-generator.tech
|
|
12
|
-
* Do not edit the class manually.
|
|
13
|
-
*/
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.Configuration = void 0;
|
|
16
|
-
class Configuration {
|
|
17
|
-
/**
|
|
18
|
-
* parameter for apiKey security
|
|
19
|
-
* @param name security name
|
|
20
|
-
*/
|
|
21
|
-
apiKey;
|
|
22
|
-
/**
|
|
23
|
-
* parameter for basic security
|
|
24
|
-
*/
|
|
25
|
-
username;
|
|
26
|
-
/**
|
|
27
|
-
* parameter for basic security
|
|
28
|
-
*/
|
|
29
|
-
password;
|
|
30
|
-
/**
|
|
31
|
-
* parameter for oauth2 security
|
|
32
|
-
* @param name security name
|
|
33
|
-
* @param scopes oauth2 scope
|
|
34
|
-
*/
|
|
35
|
-
accessToken;
|
|
36
|
-
/**
|
|
37
|
-
* parameter for aws4 signature security
|
|
38
|
-
* @param {Object} AWS4Signature - AWS4 Signature security
|
|
39
|
-
* @param {string} options.region - aws region
|
|
40
|
-
* @param {string} options.service - name of the service.
|
|
41
|
-
* @param {string} credentials.accessKeyId - aws access key id
|
|
42
|
-
* @param {string} credentials.secretAccessKey - aws access key
|
|
43
|
-
* @param {string} credentials.sessionToken - aws session token
|
|
44
|
-
* @memberof Configuration
|
|
45
|
-
*/
|
|
46
|
-
awsv4;
|
|
47
|
-
/**
|
|
48
|
-
* override base path
|
|
49
|
-
*/
|
|
50
|
-
basePath;
|
|
51
|
-
/**
|
|
52
|
-
* override server index
|
|
53
|
-
*/
|
|
54
|
-
serverIndex;
|
|
55
|
-
/**
|
|
56
|
-
* base options for axios calls
|
|
57
|
-
*/
|
|
58
|
-
baseOptions;
|
|
59
|
-
/**
|
|
60
|
-
* The FormData constructor that will be used to create multipart form data
|
|
61
|
-
* requests. You can inject this here so that execution environments that
|
|
62
|
-
* do not support the FormData class can still run the generated client.
|
|
63
|
-
*
|
|
64
|
-
* @type {new () => FormData}
|
|
65
|
-
*/
|
|
66
|
-
formDataCtor;
|
|
67
|
-
constructor(param = {}) {
|
|
68
|
-
this.apiKey = param.apiKey;
|
|
69
|
-
this.username = param.username;
|
|
70
|
-
this.password = param.password;
|
|
71
|
-
this.accessToken = param.accessToken;
|
|
72
|
-
this.awsv4 = param.awsv4;
|
|
73
|
-
this.basePath = param.basePath;
|
|
74
|
-
this.serverIndex = param.serverIndex;
|
|
75
|
-
this.baseOptions = {
|
|
76
|
-
...param.baseOptions,
|
|
77
|
-
headers: {
|
|
78
|
-
...param.baseOptions?.headers,
|
|
79
|
-
},
|
|
80
|
-
};
|
|
81
|
-
this.formDataCtor = param.formDataCtor;
|
|
82
|
-
}
|
|
83
|
-
/**
|
|
84
|
-
* Check if the given MIME is a JSON MIME.
|
|
85
|
-
* JSON MIME examples:
|
|
86
|
-
* application/json
|
|
87
|
-
* application/json; charset=UTF8
|
|
88
|
-
* APPLICATION/JSON
|
|
89
|
-
* application/vnd.company+json
|
|
90
|
-
* @param mime - MIME (Multipurpose Internet Mail Extensions)
|
|
91
|
-
* @return True if the given MIME is JSON, false otherwise.
|
|
92
|
-
*/
|
|
93
|
-
isJsonMime(mime) {
|
|
94
|
-
const jsonMime = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i');
|
|
95
|
-
return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json');
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
exports.Configuration = Configuration;
|