Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BREAKING CHANGE: - Removes authorization API client. Refer to the [SP-API Deprecations](https://developer-docs.amazon.com/sp-api/docs/sp-api-deprecations) table for more information. Adds support for: - Data Kiosk APi - Fulfillment Inbound API (`v20240320`) - Shipping API (`v2`) - Supply Sources API Closes #1021 Closes #1022 Closes #564 Co-authored-by: nguyentoanit <nguyentoanit@users.noreply.github.com>
- Loading branch information
1 parent
230e642
commit 3215b39
Showing
59 changed files
with
15,715 additions
and
1,407 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { ApplicationsApi, Configuration } from '../api-models/application-management-api-model' | ||
import { ApiClientHelpers } from '../helpers' | ||
import { DEFAULT_API_BASE_PATH } from '../types' | ||
import { APIConfigurationParameters } from '../types/api-clients/api-configuration-parameters' | ||
|
||
export class ApplicationManagementApiClient extends ApplicationsApi { | ||
constructor(parameters: APIConfigurationParameters) { | ||
const axios = ApiClientHelpers.getAxiosInstance(parameters) | ||
|
||
const configuration = new Configuration(parameters) | ||
|
||
super(configuration, DEFAULT_API_BASE_PATH, axios) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { Configuration, QueriesApi } from '../api-models/data-kiosk-api-model' | ||
import { ApiClientHelpers } from '../helpers' | ||
import { DEFAULT_API_BASE_PATH } from '../types' | ||
import { APIConfigurationParameters } from '../types/api-clients/api-configuration-parameters' | ||
|
||
export class DataKioskApiClient extends QueriesApi { | ||
constructor(parameters: APIConfigurationParameters) { | ||
const axios = ApiClientHelpers.getAxiosInstance(parameters) | ||
|
||
const configuration = new Configuration(parameters) | ||
|
||
super(configuration, DEFAULT_API_BASE_PATH, axios) | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
src/api-clients/fulfillment-inbound-api-client-v20240320.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { Configuration, FbaInboundApi } from '../api-models/fulfillment-inbound-api-model-v20240320' | ||
import { ApiClientHelpers } from '../helpers' | ||
import { DEFAULT_API_BASE_PATH } from '../types' | ||
import { APIConfigurationParameters } from '../types/api-clients/api-configuration-parameters' | ||
|
||
export class FulfillmentInboundApiClientV20240320 extends FbaInboundApi { | ||
constructor(parameters: APIConfigurationParameters) { | ||
const axios = ApiClientHelpers.getAxiosInstance(parameters) | ||
|
||
const configuration = new Configuration(parameters) | ||
|
||
super(configuration, DEFAULT_API_BASE_PATH, axios) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { Configuration, ShippingApi } from '../api-models/shipping-api-model-v2' | ||
import { ApiClientHelpers } from '../helpers' | ||
import { DEFAULT_API_BASE_PATH } from '../types' | ||
import { APIConfigurationParameters } from '../types/api-clients/api-configuration-parameters' | ||
|
||
export class ShippingApiClientV2 extends ShippingApi { | ||
constructor(parameters: APIConfigurationParameters) { | ||
const axios = ApiClientHelpers.getAxiosInstance(parameters) | ||
|
||
const configuration = new Configuration(parameters) | ||
|
||
super(configuration, DEFAULT_API_BASE_PATH, axios) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { Configuration, SupplySourcesApi } from '../api-models/supply-sources-api-model' | ||
import { ApiClientHelpers } from '../helpers' | ||
import { DEFAULT_API_BASE_PATH } from '../types' | ||
import { APIConfigurationParameters } from '../types/api-clients/api-configuration-parameters' | ||
|
||
export class SupplySourcesApiClient extends SupplySourcesApi { | ||
constructor(parameters: APIConfigurationParameters) { | ||
const axios = ApiClientHelpers.getAxiosInstance(parameters) | ||
|
||
const configuration = new Configuration(parameters) | ||
|
||
super(configuration, DEFAULT_API_BASE_PATH, axios) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,156 @@ | ||
/* tslint:disable */ | ||
/* eslint-disable */ | ||
/** | ||
* Selling Partner API for Application Management | ||
* The Selling Partner API for Application Management lets you programmatically update the client secret on registered applications. | ||
* | ||
* The version of the OpenAPI document: 2023-11-30 | ||
* | ||
* | ||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). | ||
* https://openapi-generator.tech | ||
* Do not edit the class manually. | ||
*/ | ||
|
||
|
||
import { Configuration } from './configuration'; | ||
import globalAxios, { AxiosPromise, AxiosInstance } from 'axios'; | ||
// Some imports not used depending on template conditions | ||
// @ts-ignore | ||
import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from './common'; | ||
// @ts-ignore | ||
import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from './base'; | ||
|
||
/** | ||
* A list of error responses returned when a request is unsuccessful. | ||
* @export | ||
* @interface ErrorList | ||
*/ | ||
export interface ErrorList { | ||
/** | ||
* array of errors | ||
* @type {Array<Error>} | ||
* @memberof ErrorList | ||
*/ | ||
errors: Array<Error>; | ||
} | ||
/** | ||
* Error response returned when the request is unsuccessful. | ||
* @export | ||
* @interface ModelError | ||
*/ | ||
export interface ModelError { | ||
/** | ||
* An error code that identifies the type of error that occurred. | ||
* @type {string} | ||
* @memberof ModelError | ||
*/ | ||
code: string; | ||
/** | ||
* A message that describes the error condition. | ||
* @type {string} | ||
* @memberof ModelError | ||
*/ | ||
message: string; | ||
/** | ||
* Additional details that can help the caller understand or fix the issue. | ||
* @type {string} | ||
* @memberof ModelError | ||
*/ | ||
details?: string; | ||
} | ||
|
||
/** | ||
* ApplicationsApi - axios parameter creator | ||
* @export | ||
*/ | ||
export const ApplicationsApiAxiosParamCreator = function (configuration?: Configuration) { | ||
return { | ||
/** | ||
* Rotates application client secrets for a developer application. Developers must register a destination queue in the developer console before calling this operation. When this operation is called a new client secret is generated and sent to the developer-registered queue. For more information, refer to [Rotate your application client secret](https://developer-docs.amazon.com/sp-api/v0/docs/application-management-api-v2023-11-30-use-case-guide#tutorial-rotate-your-applications-client-secret). **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.0167 | 1 | 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, refer to [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). | ||
* @param {*} [options] Override http request option. | ||
* @throws {RequiredError} | ||
*/ | ||
rotateApplicationClientSecret: async (options: any = {}): Promise<RequestArgs> => { | ||
const localVarPath = `/applications/2023-11-30/clientSecret`; | ||
// use dummy base URL string because the URL constructor only accepts absolute URLs. | ||
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); | ||
let baseOptions; | ||
if (configuration) { | ||
baseOptions = configuration.baseOptions; | ||
} | ||
|
||
const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; | ||
const localVarHeaderParameter = {} as any; | ||
const localVarQueryParameter = {} as any; | ||
|
||
|
||
|
||
setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); | ||
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; | ||
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; | ||
|
||
return { | ||
url: toPathString(localVarUrlObj), | ||
options: localVarRequestOptions, | ||
}; | ||
}, | ||
} | ||
}; | ||
|
||
/** | ||
* ApplicationsApi - functional programming interface | ||
* @export | ||
*/ | ||
export const ApplicationsApiFp = function(configuration?: Configuration) { | ||
const localVarAxiosParamCreator = ApplicationsApiAxiosParamCreator(configuration) | ||
return { | ||
/** | ||
* Rotates application client secrets for a developer application. Developers must register a destination queue in the developer console before calling this operation. When this operation is called a new client secret is generated and sent to the developer-registered queue. For more information, refer to [Rotate your application client secret](https://developer-docs.amazon.com/sp-api/v0/docs/application-management-api-v2023-11-30-use-case-guide#tutorial-rotate-your-applications-client-secret). **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.0167 | 1 | 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, refer to [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). | ||
* @param {*} [options] Override http request option. | ||
* @throws {RequiredError} | ||
*/ | ||
async rotateApplicationClientSecret(options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> { | ||
const localVarAxiosArgs = await localVarAxiosParamCreator.rotateApplicationClientSecret(options); | ||
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); | ||
}, | ||
} | ||
}; | ||
|
||
/** | ||
* ApplicationsApi - factory interface | ||
* @export | ||
*/ | ||
export const ApplicationsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { | ||
const localVarFp = ApplicationsApiFp(configuration) | ||
return { | ||
/** | ||
* Rotates application client secrets for a developer application. Developers must register a destination queue in the developer console before calling this operation. When this operation is called a new client secret is generated and sent to the developer-registered queue. For more information, refer to [Rotate your application client secret](https://developer-docs.amazon.com/sp-api/v0/docs/application-management-api-v2023-11-30-use-case-guide#tutorial-rotate-your-applications-client-secret). **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.0167 | 1 | 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, refer to [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). | ||
* @param {*} [options] Override http request option. | ||
* @throws {RequiredError} | ||
*/ | ||
rotateApplicationClientSecret(options?: any): AxiosPromise<void> { | ||
return localVarFp.rotateApplicationClientSecret(options).then((request) => request(axios, basePath)); | ||
}, | ||
}; | ||
}; | ||
|
||
/** | ||
* ApplicationsApi - object-oriented interface | ||
* @export | ||
* @class ApplicationsApi | ||
* @extends {BaseAPI} | ||
*/ | ||
export class ApplicationsApi extends BaseAPI { | ||
/** | ||
* Rotates application client secrets for a developer application. Developers must register a destination queue in the developer console before calling this operation. When this operation is called a new client secret is generated and sent to the developer-registered queue. For more information, refer to [Rotate your application client secret](https://developer-docs.amazon.com/sp-api/v0/docs/application-management-api-v2023-11-30-use-case-guide#tutorial-rotate-your-applications-client-secret). **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.0167 | 1 | 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, refer to [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). | ||
* @param {*} [options] Override http request option. | ||
* @throws {RequiredError} | ||
* @memberof ApplicationsApi | ||
*/ | ||
public rotateApplicationClientSecret(options?: any) { | ||
return ApplicationsApiFp(this.configuration).rotateApplicationClientSecret(options).then((request) => request(this.axios, this.basePath)); | ||
} | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
/* tslint:disable */ | ||
/* eslint-disable */ | ||
/** | ||
* Selling Partner API for Application Management | ||
* The Selling Partner API for Application Management lets you programmatically update the client secret on registered applications. | ||
* | ||
* The version of the OpenAPI document: 2023-11-30 | ||
* | ||
* | ||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). | ||
* https://openapi-generator.tech | ||
* Do not edit the class manually. | ||
*/ | ||
|
||
|
||
import { Configuration } from "./configuration"; | ||
// Some imports not used depending on template conditions | ||
// @ts-ignore | ||
import globalAxios, { AxiosPromise, AxiosInstance } from 'axios'; | ||
|
||
export const BASE_PATH = "https://sellingpartnerapi-na.amazon.com".replace(/\/+$/, ""); | ||
|
||
/** | ||
* | ||
* @export | ||
*/ | ||
export const COLLECTION_FORMATS = { | ||
csv: ",", | ||
ssv: " ", | ||
tsv: "\t", | ||
pipes: "|", | ||
}; | ||
|
||
/** | ||
* | ||
* @export | ||
* @interface RequestArgs | ||
*/ | ||
export interface RequestArgs { | ||
url: string; | ||
options: any; | ||
} | ||
|
||
/** | ||
* | ||
* @export | ||
* @class BaseAPI | ||
*/ | ||
export class BaseAPI { | ||
protected configuration: Configuration | undefined; | ||
|
||
constructor(configuration?: Configuration, protected basePath: string = BASE_PATH, protected axios: AxiosInstance = globalAxios) { | ||
if (configuration) { | ||
this.configuration = configuration; | ||
this.basePath = configuration.basePath || this.basePath; | ||
} | ||
} | ||
}; | ||
|
||
/** | ||
* | ||
* @export | ||
* @class RequiredError | ||
* @extends {Error} | ||
*/ | ||
export class RequiredError extends Error { | ||
name: "RequiredError" = "RequiredError"; | ||
constructor(public field: string, msg?: string) { | ||
super(msg); | ||
} | ||
} |
Oops, something went wrong.