UNPKG

@scaleleap/selling-partner-api-sdk

Version:

📦 A fully typed TypeScript and Node.js SDK library for Amazon Selling Partner API

301 lines • 25.4 kB
"use strict"; /* tslint:disable */ /* eslint-disable */ /** * Selling Partner API for Catalog Items * The Selling Partner API for Catalog Items helps you programmatically retrieve item details for items in the catalog. * * The version of the OpenAPI document: v0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.CatalogApi = exports.CatalogApiFactory = exports.CatalogApiFp = exports.CatalogApiAxiosParamCreator = void 0; const axios_1 = __importDefault(require("axios")); // Some imports not used depending on template conditions // @ts-ignore const common_1 = require("./common"); // @ts-ignore const base_1 = require("./base"); /** * CatalogApi - axios parameter creator * @export */ const CatalogApiAxiosParamCreator = function (configuration) { return { /** * Effective September 30, 2022, the `getCatalogItem` operation will no longer be available in the Selling Partner API for Catalog Items v0. This operation is available in the latest version of the [Selling Partner API for Catalog Items v2022-04-01](doc:catalog-items-api-v2022-04-01-reference). Integrations that rely on this operation should migrate to the latest version to avoid service disruption. _Note:_ The [`listCatalogCategories`](#get-catalogv0categories) operation is not being deprecated and you can continue to make calls to it. * @param {string} marketplaceId A marketplace identifier. Specifies the marketplace for the item. * @param {string} asin The Amazon Standard Identification Number (ASIN) of the item. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getCatalogItem: async (marketplaceId, asin, options = {}) => { // verify required parameter 'marketplaceId' is not null or undefined (0, common_1.assertParamExists)('getCatalogItem', 'marketplaceId', marketplaceId); // verify required parameter 'asin' is not null or undefined (0, common_1.assertParamExists)('getCatalogItem', 'asin', asin); const localVarPath = `/catalog/v0/items/{asin}` .replace(`{${"asin"}}`, encodeURIComponent(String(asin))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options }; const localVarHeaderParameter = {}; const localVarQueryParameter = {}; if (marketplaceId !== undefined) { localVarQueryParameter['MarketplaceId'] = marketplaceId; } (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; return { url: (0, common_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Returns the parent categories to which an item belongs, based on the specified ASIN or SellerSKU. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 2 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api). * @param {string} marketplaceId A marketplace identifier. Specifies the marketplace for the item. * @param {string} [aSIN] The Amazon Standard Identification Number (ASIN) of the item. * @param {string} [sellerSKU] Used to identify items in the given marketplace. SellerSKU is qualified by the seller\'s SellerId, which is included with every operation that you submit. * @param {*} [options] Override http request option. * @throws {RequiredError} */ listCatalogCategories: async (marketplaceId, aSIN, sellerSKU, options = {}) => { // verify required parameter 'marketplaceId' is not null or undefined (0, common_1.assertParamExists)('listCatalogCategories', 'marketplaceId', marketplaceId); const localVarPath = `/catalog/v0/categories`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options }; const localVarHeaderParameter = {}; const localVarQueryParameter = {}; if (marketplaceId !== undefined) { localVarQueryParameter['MarketplaceId'] = marketplaceId; } if (aSIN !== undefined) { localVarQueryParameter['ASIN'] = aSIN; } if (sellerSKU !== undefined) { localVarQueryParameter['SellerSKU'] = sellerSKU; } (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; return { url: (0, common_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Effective September 30, 2022, the `listCatalogItems` operation will no longer be available in the Selling Partner API for Catalog Items v0. As an alternative, `searchCatalogItems` is available in the latest version of the [Selling Partner API for Catalog Items v2022-04-01](doc:catalog-items-api-v2022-04-01-reference). Integrations that rely on the `listCatalogItems` operation should migrate to the `searchCatalogItems`operation to avoid service disruption. _Note:_ The [`listCatalogCategories`](#get-catalogv0categories) operation is not being deprecated and you can continue to make calls to it. * @param {string} marketplaceId A marketplace identifier. Specifies the marketplace for which items are returned. * @param {string} [query] Keyword(s) to use to search for items in the catalog. Example: \'harry potter books\'. * @param {string} [queryContextId] An identifier for the context within which the given search will be performed. A marketplace might provide mechanisms for constraining a search to a subset of potential items. For example, the retail marketplace allows queries to be constrained to a specific category. The QueryContextId parameter specifies such a subset. If it is omitted, the search will be performed using the default context for the marketplace, which will typically contain the largest set of items. * @param {string} [sellerSKU] Used to identify an item in the given marketplace. SellerSKU is qualified by the seller\'s SellerId, which is included with every operation that you submit. * @param {string} [uPC] A 12-digit bar code used for retail packaging. * @param {string} [eAN] A European article number that uniquely identifies the catalog item, manufacturer, and its attributes. * @param {string} [iSBN] The unique commercial book identifier used to identify books internationally. * @param {string} [jAN] A Japanese article number that uniquely identifies the product, manufacturer, and its attributes. * @param {*} [options] Override http request option. * @throws {RequiredError} */ listCatalogItems: async (marketplaceId, query, queryContextId, sellerSKU, uPC, eAN, iSBN, jAN, options = {}) => { // verify required parameter 'marketplaceId' is not null or undefined (0, common_1.assertParamExists)('listCatalogItems', 'marketplaceId', marketplaceId); const localVarPath = `/catalog/v0/items`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options }; const localVarHeaderParameter = {}; const localVarQueryParameter = {}; if (marketplaceId !== undefined) { localVarQueryParameter['MarketplaceId'] = marketplaceId; } if (query !== undefined) { localVarQueryParameter['Query'] = query; } if (queryContextId !== undefined) { localVarQueryParameter['QueryContextId'] = queryContextId; } if (sellerSKU !== undefined) { localVarQueryParameter['SellerSKU'] = sellerSKU; } if (uPC !== undefined) { localVarQueryParameter['UPC'] = uPC; } if (eAN !== undefined) { localVarQueryParameter['EAN'] = eAN; } if (iSBN !== undefined) { localVarQueryParameter['ISBN'] = iSBN; } if (jAN !== undefined) { localVarQueryParameter['JAN'] = jAN; } (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; return { url: (0, common_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }, }; }; exports.CatalogApiAxiosParamCreator = CatalogApiAxiosParamCreator; /** * CatalogApi - functional programming interface * @export */ const CatalogApiFp = function (configuration) { const localVarAxiosParamCreator = (0, exports.CatalogApiAxiosParamCreator)(configuration); return { /** * Effective September 30, 2022, the `getCatalogItem` operation will no longer be available in the Selling Partner API for Catalog Items v0. This operation is available in the latest version of the [Selling Partner API for Catalog Items v2022-04-01](doc:catalog-items-api-v2022-04-01-reference). Integrations that rely on this operation should migrate to the latest version to avoid service disruption. _Note:_ The [`listCatalogCategories`](#get-catalogv0categories) operation is not being deprecated and you can continue to make calls to it. * @param {string} marketplaceId A marketplace identifier. Specifies the marketplace for the item. * @param {string} asin The Amazon Standard Identification Number (ASIN) of the item. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getCatalogItem(marketplaceId, asin, options) { const localVarAxiosArgs = await localVarAxiosParamCreator.getCatalogItem(marketplaceId, asin, options); return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration); }, /** * Returns the parent categories to which an item belongs, based on the specified ASIN or SellerSKU. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 2 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api). * @param {string} marketplaceId A marketplace identifier. Specifies the marketplace for the item. * @param {string} [aSIN] The Amazon Standard Identification Number (ASIN) of the item. * @param {string} [sellerSKU] Used to identify items in the given marketplace. SellerSKU is qualified by the seller\'s SellerId, which is included with every operation that you submit. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async listCatalogCategories(marketplaceId, aSIN, sellerSKU, options) { const localVarAxiosArgs = await localVarAxiosParamCreator.listCatalogCategories(marketplaceId, aSIN, sellerSKU, options); return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration); }, /** * Effective September 30, 2022, the `listCatalogItems` operation will no longer be available in the Selling Partner API for Catalog Items v0. As an alternative, `searchCatalogItems` is available in the latest version of the [Selling Partner API for Catalog Items v2022-04-01](doc:catalog-items-api-v2022-04-01-reference). Integrations that rely on the `listCatalogItems` operation should migrate to the `searchCatalogItems`operation to avoid service disruption. _Note:_ The [`listCatalogCategories`](#get-catalogv0categories) operation is not being deprecated and you can continue to make calls to it. * @param {string} marketplaceId A marketplace identifier. Specifies the marketplace for which items are returned. * @param {string} [query] Keyword(s) to use to search for items in the catalog. Example: \'harry potter books\'. * @param {string} [queryContextId] An identifier for the context within which the given search will be performed. A marketplace might provide mechanisms for constraining a search to a subset of potential items. For example, the retail marketplace allows queries to be constrained to a specific category. The QueryContextId parameter specifies such a subset. If it is omitted, the search will be performed using the default context for the marketplace, which will typically contain the largest set of items. * @param {string} [sellerSKU] Used to identify an item in the given marketplace. SellerSKU is qualified by the seller\'s SellerId, which is included with every operation that you submit. * @param {string} [uPC] A 12-digit bar code used for retail packaging. * @param {string} [eAN] A European article number that uniquely identifies the catalog item, manufacturer, and its attributes. * @param {string} [iSBN] The unique commercial book identifier used to identify books internationally. * @param {string} [jAN] A Japanese article number that uniquely identifies the product, manufacturer, and its attributes. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async listCatalogItems(marketplaceId, query, queryContextId, sellerSKU, uPC, eAN, iSBN, jAN, options) { const localVarAxiosArgs = await localVarAxiosParamCreator.listCatalogItems(marketplaceId, query, queryContextId, sellerSKU, uPC, eAN, iSBN, jAN, options); return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration); }, }; }; exports.CatalogApiFp = CatalogApiFp; /** * CatalogApi - factory interface * @export */ const CatalogApiFactory = function (configuration, basePath, axios) { const localVarFp = (0, exports.CatalogApiFp)(configuration); return { /** * Effective September 30, 2022, the `getCatalogItem` operation will no longer be available in the Selling Partner API for Catalog Items v0. This operation is available in the latest version of the [Selling Partner API for Catalog Items v2022-04-01](doc:catalog-items-api-v2022-04-01-reference). Integrations that rely on this operation should migrate to the latest version to avoid service disruption. _Note:_ The [`listCatalogCategories`](#get-catalogv0categories) operation is not being deprecated and you can continue to make calls to it. * @param {string} marketplaceId A marketplace identifier. Specifies the marketplace for the item. * @param {string} asin The Amazon Standard Identification Number (ASIN) of the item. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getCatalogItem(marketplaceId, asin, options) { return localVarFp.getCatalogItem(marketplaceId, asin, options).then((request) => request(axios, basePath)); }, /** * Returns the parent categories to which an item belongs, based on the specified ASIN or SellerSKU. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 2 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api). * @param {string} marketplaceId A marketplace identifier. Specifies the marketplace for the item. * @param {string} [aSIN] The Amazon Standard Identification Number (ASIN) of the item. * @param {string} [sellerSKU] Used to identify items in the given marketplace. SellerSKU is qualified by the seller\'s SellerId, which is included with every operation that you submit. * @param {*} [options] Override http request option. * @throws {RequiredError} */ listCatalogCategories(marketplaceId, aSIN, sellerSKU, options) { return localVarFp.listCatalogCategories(marketplaceId, aSIN, sellerSKU, options).then((request) => request(axios, basePath)); }, /** * Effective September 30, 2022, the `listCatalogItems` operation will no longer be available in the Selling Partner API for Catalog Items v0. As an alternative, `searchCatalogItems` is available in the latest version of the [Selling Partner API for Catalog Items v2022-04-01](doc:catalog-items-api-v2022-04-01-reference). Integrations that rely on the `listCatalogItems` operation should migrate to the `searchCatalogItems`operation to avoid service disruption. _Note:_ The [`listCatalogCategories`](#get-catalogv0categories) operation is not being deprecated and you can continue to make calls to it. * @param {string} marketplaceId A marketplace identifier. Specifies the marketplace for which items are returned. * @param {string} [query] Keyword(s) to use to search for items in the catalog. Example: \'harry potter books\'. * @param {string} [queryContextId] An identifier for the context within which the given search will be performed. A marketplace might provide mechanisms for constraining a search to a subset of potential items. For example, the retail marketplace allows queries to be constrained to a specific category. The QueryContextId parameter specifies such a subset. If it is omitted, the search will be performed using the default context for the marketplace, which will typically contain the largest set of items. * @param {string} [sellerSKU] Used to identify an item in the given marketplace. SellerSKU is qualified by the seller\'s SellerId, which is included with every operation that you submit. * @param {string} [uPC] A 12-digit bar code used for retail packaging. * @param {string} [eAN] A European article number that uniquely identifies the catalog item, manufacturer, and its attributes. * @param {string} [iSBN] The unique commercial book identifier used to identify books internationally. * @param {string} [jAN] A Japanese article number that uniquely identifies the product, manufacturer, and its attributes. * @param {*} [options] Override http request option. * @throws {RequiredError} */ listCatalogItems(marketplaceId, query, queryContextId, sellerSKU, uPC, eAN, iSBN, jAN, options) { return localVarFp.listCatalogItems(marketplaceId, query, queryContextId, sellerSKU, uPC, eAN, iSBN, jAN, options).then((request) => request(axios, basePath)); }, }; }; exports.CatalogApiFactory = CatalogApiFactory; /** * CatalogApi - object-oriented interface * @export * @class CatalogApi * @extends {BaseAPI} */ class CatalogApi extends base_1.BaseAPI { /** * Effective September 30, 2022, the `getCatalogItem` operation will no longer be available in the Selling Partner API for Catalog Items v0. This operation is available in the latest version of the [Selling Partner API for Catalog Items v2022-04-01](doc:catalog-items-api-v2022-04-01-reference). Integrations that rely on this operation should migrate to the latest version to avoid service disruption. _Note:_ The [`listCatalogCategories`](#get-catalogv0categories) operation is not being deprecated and you can continue to make calls to it. * @param {CatalogApiGetCatalogItemRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof CatalogApi */ getCatalogItem(requestParameters, options) { return (0, exports.CatalogApiFp)(this.configuration).getCatalogItem(requestParameters.marketplaceId, requestParameters.asin, options).then((request) => request(this.axios, this.basePath)); } /** * Returns the parent categories to which an item belongs, based on the specified ASIN or SellerSKU. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 2 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api). * @param {CatalogApiListCatalogCategoriesRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof CatalogApi */ listCatalogCategories(requestParameters, options) { return (0, exports.CatalogApiFp)(this.configuration).listCatalogCategories(requestParameters.marketplaceId, requestParameters.aSIN, requestParameters.sellerSKU, options).then((request) => request(this.axios, this.basePath)); } /** * Effective September 30, 2022, the `listCatalogItems` operation will no longer be available in the Selling Partner API for Catalog Items v0. As an alternative, `searchCatalogItems` is available in the latest version of the [Selling Partner API for Catalog Items v2022-04-01](doc:catalog-items-api-v2022-04-01-reference). Integrations that rely on the `listCatalogItems` operation should migrate to the `searchCatalogItems`operation to avoid service disruption. _Note:_ The [`listCatalogCategories`](#get-catalogv0categories) operation is not being deprecated and you can continue to make calls to it. * @param {CatalogApiListCatalogItemsRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof CatalogApi */ listCatalogItems(requestParameters, options) { return (0, exports.CatalogApiFp)(this.configuration).listCatalogItems(requestParameters.marketplaceId, requestParameters.query, requestParameters.queryContextId, requestParameters.sellerSKU, requestParameters.uPC, requestParameters.eAN, requestParameters.iSBN, requestParameters.jAN, options).then((request) => request(this.axios, this.basePath)); } } exports.CatalogApi = CatalogApi; //# sourceMappingURL=api.js.map