@sp-api-sdk/catalog-items-api-2022-04-01 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (108) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +108 -0
  3. package/dist/cjs/index.js +5 -0
  4. package/dist/cjs/src/api-model/api/catalog-api.js +263 -0
  5. package/dist/cjs/src/api-model/api.js +17 -0
  6. package/dist/cjs/src/api-model/base.js +62 -0
  7. package/dist/cjs/src/api-model/common.js +137 -0
  8. package/dist/cjs/src/api-model/configuration.js +42 -0
  9. package/dist/cjs/src/api-model/index.js +19 -0
  10. package/dist/cjs/src/api-model/models/brand-refinement.js +15 -0
  11. package/dist/cjs/src/api-model/models/classification-refinement.js +15 -0
  12. package/dist/cjs/src/api-model/models/error-list.js +15 -0
  13. package/dist/cjs/src/api-model/models/index.js +29 -0
  14. package/dist/cjs/src/api-model/models/item-browse-classification.js +15 -0
  15. package/dist/cjs/src/api-model/models/item-classification-sales-rank.js +15 -0
  16. package/dist/cjs/src/api-model/models/item-dimension.js +15 -0
  17. package/dist/cjs/src/api-model/models/item-dimensions-by-marketplace.js +15 -0
  18. package/dist/cjs/src/api-model/models/item-dimensions.js +15 -0
  19. package/dist/cjs/src/api-model/models/item-display-group-sales-rank.js +15 -0
  20. package/dist/cjs/src/api-model/models/item-identifier.js +15 -0
  21. package/dist/cjs/src/api-model/models/item-identifiers-by-marketplace.js +15 -0
  22. package/dist/cjs/src/api-model/models/item-image.js +33 -0
  23. package/dist/cjs/src/api-model/models/item-images-by-marketplace.js +15 -0
  24. package/dist/cjs/src/api-model/models/item-product-type-by-marketplace.js +15 -0
  25. package/dist/cjs/src/api-model/models/item-relationship.js +25 -0
  26. package/dist/cjs/src/api-model/models/item-relationships-by-marketplace.js +15 -0
  27. package/dist/cjs/src/api-model/models/item-sales-ranks-by-marketplace.js +15 -0
  28. package/dist/cjs/src/api-model/models/item-search-results.js +15 -0
  29. package/dist/cjs/src/api-model/models/item-summary-by-marketplace.js +27 -0
  30. package/dist/cjs/src/api-model/models/item-variation-theme.js +15 -0
  31. package/dist/cjs/src/api-model/models/item-vendor-details-by-marketplace.js +33 -0
  32. package/dist/cjs/src/api-model/models/item-vendor-details-category.js +15 -0
  33. package/dist/cjs/src/api-model/models/item.js +15 -0
  34. package/dist/cjs/src/api-model/models/model-error.js +15 -0
  35. package/dist/cjs/src/api-model/models/pagination.js +15 -0
  36. package/dist/cjs/src/api-model/models/refinements.js +15 -0
  37. package/dist/cjs/src/client.js +28 -0
  38. package/dist/es/index.js +2 -0
  39. package/dist/es/src/api-model/api/catalog-api.js +255 -0
  40. package/dist/es/src/api-model/api.js +14 -0
  41. package/dist/es/src/api-model/base.js +56 -0
  42. package/dist/es/src/api-model/common.js +125 -0
  43. package/dist/es/src/api-model/configuration.js +38 -0
  44. package/dist/es/src/api-model/index.js +16 -0
  45. package/dist/es/src/api-model/models/brand-refinement.js +14 -0
  46. package/dist/es/src/api-model/models/classification-refinement.js +14 -0
  47. package/dist/es/src/api-model/models/error-list.js +14 -0
  48. package/dist/es/src/api-model/models/index.js +26 -0
  49. package/dist/es/src/api-model/models/item-browse-classification.js +14 -0
  50. package/dist/es/src/api-model/models/item-classification-sales-rank.js +14 -0
  51. package/dist/es/src/api-model/models/item-dimension.js +14 -0
  52. package/dist/es/src/api-model/models/item-dimensions-by-marketplace.js +14 -0
  53. package/dist/es/src/api-model/models/item-dimensions.js +14 -0
  54. package/dist/es/src/api-model/models/item-display-group-sales-rank.js +14 -0
  55. package/dist/es/src/api-model/models/item-identifier.js +14 -0
  56. package/dist/es/src/api-model/models/item-identifiers-by-marketplace.js +14 -0
  57. package/dist/es/src/api-model/models/item-image.js +30 -0
  58. package/dist/es/src/api-model/models/item-images-by-marketplace.js +14 -0
  59. package/dist/es/src/api-model/models/item-product-type-by-marketplace.js +14 -0
  60. package/dist/es/src/api-model/models/item-relationship.js +22 -0
  61. package/dist/es/src/api-model/models/item-relationships-by-marketplace.js +14 -0
  62. package/dist/es/src/api-model/models/item-sales-ranks-by-marketplace.js +14 -0
  63. package/dist/es/src/api-model/models/item-search-results.js +14 -0
  64. package/dist/es/src/api-model/models/item-summary-by-marketplace.js +24 -0
  65. package/dist/es/src/api-model/models/item-variation-theme.js +14 -0
  66. package/dist/es/src/api-model/models/item-vendor-details-by-marketplace.js +30 -0
  67. package/dist/es/src/api-model/models/item-vendor-details-category.js +14 -0
  68. package/dist/es/src/api-model/models/item.js +14 -0
  69. package/dist/es/src/api-model/models/model-error.js +14 -0
  70. package/dist/es/src/api-model/models/pagination.js +14 -0
  71. package/dist/es/src/api-model/models/refinements.js +14 -0
  72. package/dist/es/src/client.js +24 -0
  73. package/dist/types/index.d.ts +2 -0
  74. package/dist/types/src/api-model/api/catalog-api.d.ts +252 -0
  75. package/dist/types/src/api-model/api.d.ts +12 -0
  76. package/dist/types/src/api-model/base.d.ts +55 -0
  77. package/dist/types/src/api-model/common.d.ts +65 -0
  78. package/dist/types/src/api-model/configuration.d.ts +83 -0
  79. package/dist/types/src/api-model/index.d.ts +14 -0
  80. package/dist/types/src/api-model/models/brand-refinement.d.ts +30 -0
  81. package/dist/types/src/api-model/models/classification-refinement.d.ts +36 -0
  82. package/dist/types/src/api-model/models/error-list.d.ts +24 -0
  83. package/dist/types/src/api-model/models/index.d.ts +26 -0
  84. package/dist/types/src/api-model/models/item-browse-classification.d.ts +30 -0
  85. package/dist/types/src/api-model/models/item-classification-sales-rank.d.ts +42 -0
  86. package/dist/types/src/api-model/models/item-dimension.d.ts +30 -0
  87. package/dist/types/src/api-model/models/item-dimensions-by-marketplace.d.ts +37 -0
  88. package/dist/types/src/api-model/models/item-dimensions.d.ts +43 -0
  89. package/dist/types/src/api-model/models/item-display-group-sales-rank.d.ts +42 -0
  90. package/dist/types/src/api-model/models/item-identifier.d.ts +30 -0
  91. package/dist/types/src/api-model/models/item-identifiers-by-marketplace.d.ts +31 -0
  92. package/dist/types/src/api-model/models/item-image.d.ts +58 -0
  93. package/dist/types/src/api-model/models/item-images-by-marketplace.d.ts +31 -0
  94. package/dist/types/src/api-model/models/item-product-type-by-marketplace.d.ts +30 -0
  95. package/dist/types/src/api-model/models/item-relationship.d.ts +51 -0
  96. package/dist/types/src/api-model/models/item-relationships-by-marketplace.d.ts +31 -0
  97. package/dist/types/src/api-model/models/item-sales-ranks-by-marketplace.d.ts +38 -0
  98. package/dist/types/src/api-model/models/item-search-results.d.ts +45 -0
  99. package/dist/types/src/api-model/models/item-summary-by-marketplace.d.ts +107 -0
  100. package/dist/types/src/api-model/models/item-variation-theme.d.ts +30 -0
  101. package/dist/types/src/api-model/models/item-vendor-details-by-marketplace.d.ts +83 -0
  102. package/dist/types/src/api-model/models/item-vendor-details-category.d.ts +30 -0
  103. package/dist/types/src/api-model/models/item.d.ts +86 -0
  104. package/dist/types/src/api-model/models/model-error.d.ts +36 -0
  105. package/dist/types/src/api-model/models/pagination.d.ts +30 -0
  106. package/dist/types/src/api-model/models/refinements.d.ts +32 -0
  107. package/dist/types/src/client.d.ts +6 -0
  108. package/package.json +54 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2021 Bizon
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,108 @@
1
+ # `catalog-items-api-2022-04-01`
2
+
3
+ The Selling Partner API for Catalog Items provides programmatic access to information about items in the Amazon catalog.
4
+
5
+ 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
+ [![npm version](https://badgen.net/npm/v/@sp-api-sdk/catalog-items-api-2022-04-01)](https://www.npmjs.com/package/@sp-api-sdk/catalog-items-api-2022-04-01)
8
+ [![XO code style](https://badgen.net/badge/code%20style/XO/cyan)](https://github.com/xojs/xo)
9
+
10
+ ## Documentation
11
+
12
+ Learn more about this Selling Partner API by visiting the [official documentation](https://developer-docs.amazon.com/sp-api/docs).
13
+
14
+ Also, see the [generated documentation](https://bizon.github.io/selling-partner-api-sdk/modules/_sp_api_sdk_catalog_items_api_2022_04_01.html) for this API client.
15
+
16
+ ## Installing
17
+
18
+ ```sh
19
+ yarn add @sp-api-sdk/catalog-items-api-2022-04-01
20
+ ```
21
+
22
+ ```sh
23
+ npm install @sp-api-sdk/catalog-items-api-2022-04-01
24
+ ```
25
+
26
+ ## Getting Started
27
+
28
+ ```javascript
29
+ import {SellingPartnerApiAuth} from '@sp-api-sdk/auth'
30
+ import {CatalogItemsApiClient} from '@sp-api-sdk/catalog-items-api-2022-04-01'
31
+
32
+ const auth = new SellingPartnerApiAuth({
33
+ clientId: process.env.LWA_CLIENT_ID,
34
+ clientSecret: process.env.LWA_CLIENT_SECRET,
35
+ refreshToken: 'Atzr|…',
36
+ accessKeyId: '',
37
+ secretAccessKey: '',
38
+ role: {
39
+ arn: 'arn:aws:iam::…',
40
+ },
41
+ })
42
+
43
+ const client = new CatalogItemsApiClient({
44
+ auth,
45
+ region: 'eu',
46
+ })
47
+ ```
48
+
49
+ ## Rate Limiting
50
+
51
+ In order to retry rate limited requests (HTTP 429), you can configure the API client as such:
52
+
53
+ ```javascript
54
+ const client = new CatalogItemsApiClient({
55
+ auth,
56
+ region: 'eu',
57
+ rateLimiting: {
58
+ retry: true,
59
+ // Optionally specify a callback that will be called on every retry.
60
+ onRetry: (retryInfo) => {
61
+ console.log(retryInfo)
62
+ },
63
+ },
64
+ })
65
+ ```
66
+
67
+ The rate limits used for each route are specified in the [API documentation](https://developer-docs.amazon.com/sp-api/docs).
68
+
69
+ ## Logging
70
+
71
+ You can enable logging for both SP-API requests and responses by configuring the `logging.request` and `logging.response` properties.
72
+
73
+ ```javascript
74
+ const client = new CatalogItemsApiClient({
75
+ auth,
76
+ region: 'eu',
77
+ logging: {
78
+ request: {
79
+ logger: console.debug
80
+ },
81
+ response: {
82
+ logger: console.debug
83
+ },
84
+ error: true,
85
+ },
86
+ })
87
+ ```
88
+
89
+ Specifying `true` will use the default options, specifying an object will allow you to override the default options.
90
+ This uses [axios-logger](https://github.com/hg-pyun/axios-logger) under the hood.
91
+ By default, if enabled, the `request` and `response` loggers will use `console.info` and the `error` logger will use `console.error`.
92
+
93
+
94
+ ## License
95
+
96
+ MIT
97
+
98
+ ## Miscellaneous
99
+
100
+ ```
101
+ ╚⊙ ⊙╝
102
+ ╚═(███)═╝
103
+ ╚═(███)═╝
104
+ ╚═(███)═╝
105
+ ╚═(███)═╝
106
+ ╚═(███)═╝
107
+ ╚═(███)═╝
108
+ ```
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./src/client"), exports);
5
+ tslib_1.__exportStar(require("./src/api-model/models"), exports);
@@ -0,0 +1,263 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * Selling Partner API for Catalog Items
6
+ * The Selling Partner API for Catalog Items provides programmatic access to 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.CatalogApi = exports.CatalogApiFactory = exports.CatalogApiFp = exports.CatalogApiAxiosParamCreator = void 0;
17
+ const tslib_1 = require("tslib");
18
+ const axios_1 = tslib_1.__importDefault(require("axios"));
19
+ // Some imports not used depending on template conditions
20
+ // @ts-ignore
21
+ const common_1 = require("../common");
22
+ // @ts-ignore
23
+ const base_1 = require("../base");
24
+ /**
25
+ * CatalogApi - axios parameter creator
26
+ * @export
27
+ */
28
+ const CatalogApiAxiosParamCreator = function (configuration) {
29
+ return {
30
+ /**
31
+ * Retrieves details for an item in the Amazon catalog. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 5 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may observe higher rate and burst values than those shown here. For more information, refer to the [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
32
+ * @param {string} asin The Amazon Standard Identification Number (ASIN) of the item.
33
+ * @param {Array<string>} marketplaceIds A comma-delimited list of Amazon marketplace identifiers. Data sets in the response contain data only for the specified marketplaces.
34
+ * @param {Array<'attributes' | 'dimensions' | 'identifiers' | 'images' | 'productTypes' | 'relationships' | 'salesRanks' | 'summaries' | 'vendorDetails'>} [includedData] A comma-delimited list of data sets to include in the response. Default: &#x60;summaries&#x60;.
35
+ * @param {string} [locale] Locale for retrieving localized summaries. Defaults to the primary locale of the marketplace.
36
+ * @param {*} [options] Override http request option.
37
+ * @throws {RequiredError}
38
+ */
39
+ getCatalogItem: async (asin, marketplaceIds, includedData, locale, options = {}) => {
40
+ // verify required parameter 'asin' is not null or undefined
41
+ (0, common_1.assertParamExists)('getCatalogItem', 'asin', asin);
42
+ // verify required parameter 'marketplaceIds' is not null or undefined
43
+ (0, common_1.assertParamExists)('getCatalogItem', 'marketplaceIds', marketplaceIds);
44
+ const localVarPath = `/catalog/2022-04-01/items/{asin}`
45
+ .replace(`{${"asin"}}`, encodeURIComponent(String(asin)));
46
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
47
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
48
+ let baseOptions;
49
+ if (configuration) {
50
+ baseOptions = configuration.baseOptions;
51
+ }
52
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
53
+ const localVarHeaderParameter = {};
54
+ const localVarQueryParameter = {};
55
+ if (marketplaceIds) {
56
+ localVarQueryParameter['marketplaceIds'] = marketplaceIds.join(base_1.COLLECTION_FORMATS.csv);
57
+ }
58
+ if (includedData) {
59
+ localVarQueryParameter['includedData'] = includedData.join(base_1.COLLECTION_FORMATS.csv);
60
+ }
61
+ if (locale !== undefined) {
62
+ localVarQueryParameter['locale'] = locale;
63
+ }
64
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter, options.query);
65
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
66
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
67
+ return {
68
+ url: (0, common_1.toPathString)(localVarUrlObj),
69
+ options: localVarRequestOptions,
70
+ };
71
+ },
72
+ /**
73
+ * Search for and return a list of Amazon catalog items and associated information either by identifier or by keywords. **Usage Plans:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 5 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may observe higher rate and burst values than those shown here. For more information, refer to the [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
74
+ * @param {Array<string>} marketplaceIds A comma-delimited list of Amazon marketplace identifiers for the request.
75
+ * @param {Array<string>} [identifiers] A comma-delimited list of product identifiers to search the Amazon catalog for. **Note:** Cannot be used with &#x60;keywords&#x60;.
76
+ * @param {'ASIN' | 'EAN' | 'GTIN' | 'ISBN' | 'JAN' | 'MINSAN' | 'SKU' | 'UPC'} [identifiersType] Type of product identifiers to search the Amazon catalog for. **Note:** Required when &#x60;identifiers&#x60; are provided.
77
+ * @param {Array<'attributes' | 'dimensions' | 'identifiers' | 'images' | 'productTypes' | 'relationships' | 'salesRanks' | 'summaries' | 'vendorDetails'>} [includedData] A comma-delimited list of data sets to include in the response. Default: &#x60;summaries&#x60;.
78
+ * @param {string} [locale] Locale for retrieving localized summaries. Defaults to the primary locale of the marketplace.
79
+ * @param {string} [sellerId] A selling partner identifier, such as a seller account or vendor code. **Note:** Required when &#x60;identifiersType&#x60; is &#x60;SKU&#x60;.
80
+ * @param {Array<string>} [keywords] A comma-delimited list of words to search the Amazon catalog for. **Note:** Cannot be used with &#x60;identifiers&#x60;.
81
+ * @param {Array<string>} [brandNames] A comma-delimited list of brand names to limit the search for &#x60;keywords&#x60;-based queries. **Note:** Cannot be used with &#x60;identifiers&#x60;.
82
+ * @param {Array<string>} [classificationIds] A comma-delimited list of classification identifiers to limit the search for &#x60;keywords&#x60;-based queries. **Note:** Cannot be used with &#x60;identifiers&#x60;.
83
+ * @param {number} [pageSize] Number of results to be returned per page.
84
+ * @param {string} [pageToken] A token to fetch a certain page when there are multiple pages worth of results.
85
+ * @param {string} [keywordsLocale] The language of the keywords provided for &#x60;keywords&#x60;-based queries. Defaults to the primary locale of the marketplace. **Note:** Cannot be used with &#x60;identifiers&#x60;.
86
+ * @param {*} [options] Override http request option.
87
+ * @throws {RequiredError}
88
+ */
89
+ searchCatalogItems: async (marketplaceIds, identifiers, identifiersType, includedData, locale, sellerId, keywords, brandNames, classificationIds, pageSize, pageToken, keywordsLocale, options = {}) => {
90
+ // verify required parameter 'marketplaceIds' is not null or undefined
91
+ (0, common_1.assertParamExists)('searchCatalogItems', 'marketplaceIds', marketplaceIds);
92
+ const localVarPath = `/catalog/2022-04-01/items`;
93
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
94
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
95
+ let baseOptions;
96
+ if (configuration) {
97
+ baseOptions = configuration.baseOptions;
98
+ }
99
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
100
+ const localVarHeaderParameter = {};
101
+ const localVarQueryParameter = {};
102
+ if (identifiers) {
103
+ localVarQueryParameter['identifiers'] = identifiers.join(base_1.COLLECTION_FORMATS.csv);
104
+ }
105
+ if (identifiersType !== undefined) {
106
+ localVarQueryParameter['identifiersType'] = identifiersType;
107
+ }
108
+ if (marketplaceIds) {
109
+ localVarQueryParameter['marketplaceIds'] = marketplaceIds.join(base_1.COLLECTION_FORMATS.csv);
110
+ }
111
+ if (includedData) {
112
+ localVarQueryParameter['includedData'] = includedData.join(base_1.COLLECTION_FORMATS.csv);
113
+ }
114
+ if (locale !== undefined) {
115
+ localVarQueryParameter['locale'] = locale;
116
+ }
117
+ if (sellerId !== undefined) {
118
+ localVarQueryParameter['sellerId'] = sellerId;
119
+ }
120
+ if (keywords) {
121
+ localVarQueryParameter['keywords'] = keywords.join(base_1.COLLECTION_FORMATS.csv);
122
+ }
123
+ if (brandNames) {
124
+ localVarQueryParameter['brandNames'] = brandNames.join(base_1.COLLECTION_FORMATS.csv);
125
+ }
126
+ if (classificationIds) {
127
+ localVarQueryParameter['classificationIds'] = classificationIds.join(base_1.COLLECTION_FORMATS.csv);
128
+ }
129
+ if (pageSize !== undefined) {
130
+ localVarQueryParameter['pageSize'] = pageSize;
131
+ }
132
+ if (pageToken !== undefined) {
133
+ localVarQueryParameter['pageToken'] = pageToken;
134
+ }
135
+ if (keywordsLocale !== undefined) {
136
+ localVarQueryParameter['keywordsLocale'] = keywordsLocale;
137
+ }
138
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter, options.query);
139
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
140
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
141
+ return {
142
+ url: (0, common_1.toPathString)(localVarUrlObj),
143
+ options: localVarRequestOptions,
144
+ };
145
+ },
146
+ };
147
+ };
148
+ exports.CatalogApiAxiosParamCreator = CatalogApiAxiosParamCreator;
149
+ /**
150
+ * CatalogApi - functional programming interface
151
+ * @export
152
+ */
153
+ const CatalogApiFp = function (configuration) {
154
+ const localVarAxiosParamCreator = (0, exports.CatalogApiAxiosParamCreator)(configuration);
155
+ return {
156
+ /**
157
+ * Retrieves details for an item in the Amazon catalog. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 5 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may observe higher rate and burst values than those shown here. For more information, refer to the [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
158
+ * @param {string} asin The Amazon Standard Identification Number (ASIN) of the item.
159
+ * @param {Array<string>} marketplaceIds A comma-delimited list of Amazon marketplace identifiers. Data sets in the response contain data only for the specified marketplaces.
160
+ * @param {Array<'attributes' | 'dimensions' | 'identifiers' | 'images' | 'productTypes' | 'relationships' | 'salesRanks' | 'summaries' | 'vendorDetails'>} [includedData] A comma-delimited list of data sets to include in the response. Default: &#x60;summaries&#x60;.
161
+ * @param {string} [locale] Locale for retrieving localized summaries. Defaults to the primary locale of the marketplace.
162
+ * @param {*} [options] Override http request option.
163
+ * @throws {RequiredError}
164
+ */
165
+ async getCatalogItem(asin, marketplaceIds, includedData, locale, options) {
166
+ const localVarAxiosArgs = await localVarAxiosParamCreator.getCatalogItem(asin, marketplaceIds, includedData, locale, options);
167
+ return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
168
+ },
169
+ /**
170
+ * Search for and return a list of Amazon catalog items and associated information either by identifier or by keywords. **Usage Plans:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 5 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may observe higher rate and burst values than those shown here. For more information, refer to the [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
171
+ * @param {Array<string>} marketplaceIds A comma-delimited list of Amazon marketplace identifiers for the request.
172
+ * @param {Array<string>} [identifiers] A comma-delimited list of product identifiers to search the Amazon catalog for. **Note:** Cannot be used with &#x60;keywords&#x60;.
173
+ * @param {'ASIN' | 'EAN' | 'GTIN' | 'ISBN' | 'JAN' | 'MINSAN' | 'SKU' | 'UPC'} [identifiersType] Type of product identifiers to search the Amazon catalog for. **Note:** Required when &#x60;identifiers&#x60; are provided.
174
+ * @param {Array<'attributes' | 'dimensions' | 'identifiers' | 'images' | 'productTypes' | 'relationships' | 'salesRanks' | 'summaries' | 'vendorDetails'>} [includedData] A comma-delimited list of data sets to include in the response. Default: &#x60;summaries&#x60;.
175
+ * @param {string} [locale] Locale for retrieving localized summaries. Defaults to the primary locale of the marketplace.
176
+ * @param {string} [sellerId] A selling partner identifier, such as a seller account or vendor code. **Note:** Required when &#x60;identifiersType&#x60; is &#x60;SKU&#x60;.
177
+ * @param {Array<string>} [keywords] A comma-delimited list of words to search the Amazon catalog for. **Note:** Cannot be used with &#x60;identifiers&#x60;.
178
+ * @param {Array<string>} [brandNames] A comma-delimited list of brand names to limit the search for &#x60;keywords&#x60;-based queries. **Note:** Cannot be used with &#x60;identifiers&#x60;.
179
+ * @param {Array<string>} [classificationIds] A comma-delimited list of classification identifiers to limit the search for &#x60;keywords&#x60;-based queries. **Note:** Cannot be used with &#x60;identifiers&#x60;.
180
+ * @param {number} [pageSize] Number of results to be returned per page.
181
+ * @param {string} [pageToken] A token to fetch a certain page when there are multiple pages worth of results.
182
+ * @param {string} [keywordsLocale] The language of the keywords provided for &#x60;keywords&#x60;-based queries. Defaults to the primary locale of the marketplace. **Note:** Cannot be used with &#x60;identifiers&#x60;.
183
+ * @param {*} [options] Override http request option.
184
+ * @throws {RequiredError}
185
+ */
186
+ async searchCatalogItems(marketplaceIds, identifiers, identifiersType, includedData, locale, sellerId, keywords, brandNames, classificationIds, pageSize, pageToken, keywordsLocale, options) {
187
+ const localVarAxiosArgs = await localVarAxiosParamCreator.searchCatalogItems(marketplaceIds, identifiers, identifiersType, includedData, locale, sellerId, keywords, brandNames, classificationIds, pageSize, pageToken, keywordsLocale, options);
188
+ return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
189
+ },
190
+ };
191
+ };
192
+ exports.CatalogApiFp = CatalogApiFp;
193
+ /**
194
+ * CatalogApi - factory interface
195
+ * @export
196
+ */
197
+ const CatalogApiFactory = function (configuration, basePath, axios) {
198
+ const localVarFp = (0, exports.CatalogApiFp)(configuration);
199
+ return {
200
+ /**
201
+ * Retrieves details for an item in the Amazon catalog. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 5 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may observe higher rate and burst values than those shown here. For more information, refer to the [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
202
+ * @param {string} asin The Amazon Standard Identification Number (ASIN) of the item.
203
+ * @param {Array<string>} marketplaceIds A comma-delimited list of Amazon marketplace identifiers. Data sets in the response contain data only for the specified marketplaces.
204
+ * @param {Array<'attributes' | 'dimensions' | 'identifiers' | 'images' | 'productTypes' | 'relationships' | 'salesRanks' | 'summaries' | 'vendorDetails'>} [includedData] A comma-delimited list of data sets to include in the response. Default: &#x60;summaries&#x60;.
205
+ * @param {string} [locale] Locale for retrieving localized summaries. Defaults to the primary locale of the marketplace.
206
+ * @param {*} [options] Override http request option.
207
+ * @throws {RequiredError}
208
+ */
209
+ getCatalogItem(asin, marketplaceIds, includedData, locale, options) {
210
+ return localVarFp.getCatalogItem(asin, marketplaceIds, includedData, locale, options).then((request) => request(axios, basePath));
211
+ },
212
+ /**
213
+ * Search for and return a list of Amazon catalog items and associated information either by identifier or by keywords. **Usage Plans:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 5 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may observe higher rate and burst values than those shown here. For more information, refer to the [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
214
+ * @param {Array<string>} marketplaceIds A comma-delimited list of Amazon marketplace identifiers for the request.
215
+ * @param {Array<string>} [identifiers] A comma-delimited list of product identifiers to search the Amazon catalog for. **Note:** Cannot be used with &#x60;keywords&#x60;.
216
+ * @param {'ASIN' | 'EAN' | 'GTIN' | 'ISBN' | 'JAN' | 'MINSAN' | 'SKU' | 'UPC'} [identifiersType] Type of product identifiers to search the Amazon catalog for. **Note:** Required when &#x60;identifiers&#x60; are provided.
217
+ * @param {Array<'attributes' | 'dimensions' | 'identifiers' | 'images' | 'productTypes' | 'relationships' | 'salesRanks' | 'summaries' | 'vendorDetails'>} [includedData] A comma-delimited list of data sets to include in the response. Default: &#x60;summaries&#x60;.
218
+ * @param {string} [locale] Locale for retrieving localized summaries. Defaults to the primary locale of the marketplace.
219
+ * @param {string} [sellerId] A selling partner identifier, such as a seller account or vendor code. **Note:** Required when &#x60;identifiersType&#x60; is &#x60;SKU&#x60;.
220
+ * @param {Array<string>} [keywords] A comma-delimited list of words to search the Amazon catalog for. **Note:** Cannot be used with &#x60;identifiers&#x60;.
221
+ * @param {Array<string>} [brandNames] A comma-delimited list of brand names to limit the search for &#x60;keywords&#x60;-based queries. **Note:** Cannot be used with &#x60;identifiers&#x60;.
222
+ * @param {Array<string>} [classificationIds] A comma-delimited list of classification identifiers to limit the search for &#x60;keywords&#x60;-based queries. **Note:** Cannot be used with &#x60;identifiers&#x60;.
223
+ * @param {number} [pageSize] Number of results to be returned per page.
224
+ * @param {string} [pageToken] A token to fetch a certain page when there are multiple pages worth of results.
225
+ * @param {string} [keywordsLocale] The language of the keywords provided for &#x60;keywords&#x60;-based queries. Defaults to the primary locale of the marketplace. **Note:** Cannot be used with &#x60;identifiers&#x60;.
226
+ * @param {*} [options] Override http request option.
227
+ * @throws {RequiredError}
228
+ */
229
+ searchCatalogItems(marketplaceIds, identifiers, identifiersType, includedData, locale, sellerId, keywords, brandNames, classificationIds, pageSize, pageToken, keywordsLocale, options) {
230
+ return localVarFp.searchCatalogItems(marketplaceIds, identifiers, identifiersType, includedData, locale, sellerId, keywords, brandNames, classificationIds, pageSize, pageToken, keywordsLocale, options).then((request) => request(axios, basePath));
231
+ },
232
+ };
233
+ };
234
+ exports.CatalogApiFactory = CatalogApiFactory;
235
+ /**
236
+ * CatalogApi - object-oriented interface
237
+ * @export
238
+ * @class CatalogApi
239
+ * @extends {BaseAPI}
240
+ */
241
+ class CatalogApi extends base_1.BaseAPI {
242
+ /**
243
+ * Retrieves details for an item in the Amazon catalog. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 5 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may observe higher rate and burst values than those shown here. For more information, refer to the [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
244
+ * @param {CatalogApiGetCatalogItemRequest} requestParameters Request parameters.
245
+ * @param {*} [options] Override http request option.
246
+ * @throws {RequiredError}
247
+ * @memberof CatalogApi
248
+ */
249
+ getCatalogItem(requestParameters, options) {
250
+ return (0, exports.CatalogApiFp)(this.configuration).getCatalogItem(requestParameters.asin, requestParameters.marketplaceIds, requestParameters.includedData, requestParameters.locale, options).then((request) => request(this.axios, this.basePath));
251
+ }
252
+ /**
253
+ * Search for and return a list of Amazon catalog items and associated information either by identifier or by keywords. **Usage Plans:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 5 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may observe higher rate and burst values than those shown here. For more information, refer to the [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
254
+ * @param {CatalogApiSearchCatalogItemsRequest} requestParameters Request parameters.
255
+ * @param {*} [options] Override http request option.
256
+ * @throws {RequiredError}
257
+ * @memberof CatalogApi
258
+ */
259
+ searchCatalogItems(requestParameters, options) {
260
+ return (0, exports.CatalogApiFp)(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));
261
+ }
262
+ }
263
+ exports.CatalogApi = CatalogApi;
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * Selling Partner API for Catalog Items
6
+ * The Selling Partner API for Catalog Items provides programmatic access to 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
+ const tslib_1 = require("tslib");
17
+ tslib_1.__exportStar(require("./api/catalog-api"), exports);
@@ -0,0 +1,62 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * Selling Partner API for Catalog Items
6
+ * The Selling Partner API for Catalog Items provides programmatic access to 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.RequiredError = exports.BaseAPI = exports.COLLECTION_FORMATS = exports.BASE_PATH = void 0;
17
+ const tslib_1 = require("tslib");
18
+ // Some imports not used depending on template conditions
19
+ // @ts-ignore
20
+ const axios_1 = tslib_1.__importDefault(require("axios"));
21
+ exports.BASE_PATH = "https://sellingpartnerapi-na.amazon.com".replace(/\/+$/, "");
22
+ /**
23
+ *
24
+ * @export
25
+ */
26
+ exports.COLLECTION_FORMATS = {
27
+ csv: ",",
28
+ ssv: " ",
29
+ tsv: "\t",
30
+ pipes: "|",
31
+ };
32
+ /**
33
+ *
34
+ * @export
35
+ * @class BaseAPI
36
+ */
37
+ class BaseAPI {
38
+ constructor(configuration, basePath = exports.BASE_PATH, axios = axios_1.default) {
39
+ this.basePath = basePath;
40
+ this.axios = axios;
41
+ if (configuration) {
42
+ this.configuration = configuration;
43
+ this.basePath = configuration.basePath || this.basePath;
44
+ }
45
+ }
46
+ }
47
+ exports.BaseAPI = BaseAPI;
48
+ ;
49
+ /**
50
+ *
51
+ * @export
52
+ * @class RequiredError
53
+ * @extends {Error}
54
+ */
55
+ class RequiredError extends Error {
56
+ constructor(field, msg) {
57
+ super(msg);
58
+ this.field = field;
59
+ this.name = "RequiredError";
60
+ }
61
+ }
62
+ exports.RequiredError = RequiredError;
@@ -0,0 +1,137 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * Selling Partner API for Catalog Items
6
+ * The Selling Partner API for Catalog Items provides programmatic access to 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.setSearchParams = exports.setOAuthToObject = exports.setBearerAuthToObject = exports.setBasicAuthToObject = exports.setApiKeyToObject = exports.assertParamExists = exports.DUMMY_BASE_URL = void 0;
17
+ const base_1 = require("./base");
18
+ /**
19
+ *
20
+ * @export
21
+ */
22
+ exports.DUMMY_BASE_URL = 'https://example.com';
23
+ /**
24
+ *
25
+ * @throws {RequiredError}
26
+ * @export
27
+ */
28
+ const assertParamExists = function (functionName, paramName, paramValue) {
29
+ if (paramValue === null || paramValue === undefined) {
30
+ throw new base_1.RequiredError(paramName, `Required parameter ${paramName} was null or undefined when calling ${functionName}.`);
31
+ }
32
+ };
33
+ exports.assertParamExists = assertParamExists;
34
+ /**
35
+ *
36
+ * @export
37
+ */
38
+ const setApiKeyToObject = async function (object, keyParamName, configuration) {
39
+ if (configuration && configuration.apiKey) {
40
+ const localVarApiKeyValue = typeof configuration.apiKey === 'function'
41
+ ? await configuration.apiKey(keyParamName)
42
+ : await configuration.apiKey;
43
+ object[keyParamName] = localVarApiKeyValue;
44
+ }
45
+ };
46
+ exports.setApiKeyToObject = setApiKeyToObject;
47
+ /**
48
+ *
49
+ * @export
50
+ */
51
+ const setBasicAuthToObject = function (object, configuration) {
52
+ if (configuration && (configuration.username || configuration.password)) {
53
+ object["auth"] = { username: configuration.username, password: configuration.password };
54
+ }
55
+ };
56
+ exports.setBasicAuthToObject = setBasicAuthToObject;
57
+ /**
58
+ *
59
+ * @export
60
+ */
61
+ const setBearerAuthToObject = async function (object, configuration) {
62
+ if (configuration && configuration.accessToken) {
63
+ const accessToken = typeof configuration.accessToken === 'function'
64
+ ? await configuration.accessToken()
65
+ : await configuration.accessToken;
66
+ object["Authorization"] = "Bearer " + accessToken;
67
+ }
68
+ };
69
+ exports.setBearerAuthToObject = setBearerAuthToObject;
70
+ /**
71
+ *
72
+ * @export
73
+ */
74
+ const setOAuthToObject = async function (object, name, scopes, configuration) {
75
+ if (configuration && configuration.accessToken) {
76
+ const localVarAccessTokenValue = typeof configuration.accessToken === 'function'
77
+ ? await configuration.accessToken(name, scopes)
78
+ : await configuration.accessToken;
79
+ object["Authorization"] = "Bearer " + localVarAccessTokenValue;
80
+ }
81
+ };
82
+ exports.setOAuthToObject = setOAuthToObject;
83
+ /**
84
+ *
85
+ * @export
86
+ */
87
+ const setSearchParams = function (url, ...objects) {
88
+ const searchParams = new URLSearchParams(url.search);
89
+ for (const object of objects) {
90
+ for (const key in object) {
91
+ if (Array.isArray(object[key])) {
92
+ searchParams.delete(key);
93
+ for (const item of object[key]) {
94
+ searchParams.append(key, item);
95
+ }
96
+ }
97
+ else {
98
+ searchParams.set(key, object[key]);
99
+ }
100
+ }
101
+ }
102
+ url.search = searchParams.toString();
103
+ };
104
+ exports.setSearchParams = setSearchParams;
105
+ /**
106
+ *
107
+ * @export
108
+ */
109
+ const serializeDataIfNeeded = function (value, requestOptions, configuration) {
110
+ const nonString = typeof value !== 'string';
111
+ const needsSerialization = nonString && configuration && configuration.isJsonMime
112
+ ? configuration.isJsonMime(requestOptions.headers['Content-Type'])
113
+ : nonString;
114
+ return needsSerialization
115
+ ? JSON.stringify(value !== undefined ? value : {})
116
+ : (value || "");
117
+ };
118
+ exports.serializeDataIfNeeded = serializeDataIfNeeded;
119
+ /**
120
+ *
121
+ * @export
122
+ */
123
+ const toPathString = function (url) {
124
+ return url.pathname + url.search + url.hash;
125
+ };
126
+ exports.toPathString = toPathString;
127
+ /**
128
+ *
129
+ * @export
130
+ */
131
+ const createRequestFunction = function (axiosArgs, globalAxios, BASE_PATH, configuration) {
132
+ return (axios = globalAxios, basePath = BASE_PATH) => {
133
+ const axiosRequestArgs = { ...axiosArgs.options, url: (configuration?.basePath || basePath) + axiosArgs.url };
134
+ return axios.request(axiosRequestArgs);
135
+ };
136
+ };
137
+ exports.createRequestFunction = createRequestFunction;