@sp-api-sdk/sales-api-v1
Advanced tools
Comparing version 1.7.4 to 1.7.5
@@ -154,3 +154,3 @@ /** | ||
*/ | ||
getOrderMetrics(requestParameters: SalesApiGetOrderMetricsRequest, options?: any): Promise<import("axios").AxiosResponse<GetOrderMetricsResponse>>; | ||
getOrderMetrics(requestParameters: SalesApiGetOrderMetricsRequest, options?: any): Promise<import("axios").AxiosResponse<GetOrderMetricsResponse, any>>; | ||
} |
@@ -65,2 +65,2 @@ /** | ||
*/ | ||
export declare const createRequestFunction: (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration | undefined) => (axios?: AxiosInstance, basePath?: string) => Promise<import("axios").AxiosResponse<any>>; | ||
export declare const createRequestFunction: (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration | undefined) => (axios?: AxiosInstance, basePath?: string) => Promise<import("axios").AxiosResponse<any, any>>; |
@@ -1,3 +0,2 @@ | ||
import { onRetry } from '@sp-api-sdk/common'; | ||
import type { ClientConfiguration, RateLimit } from '@sp-api-sdk/common'; | ||
import type { ClientConfiguration, RateLimit, OnRetryHandler } from '@sp-api-sdk/common'; | ||
import { SalesApi } from './api-model'; | ||
@@ -8,3 +7,3 @@ export declare const RATE_LIMITS: RateLimit[]; | ||
retry: boolean; | ||
onRetry?: onRetry; | ||
onRetry?: OnRetryHandler; | ||
}; | ||
@@ -11,0 +10,0 @@ } |
@@ -5,3 +5,3 @@ { | ||
"description": "The Selling Partner API for Sales provides APIs related to sales performance.", | ||
"version": "1.7.4", | ||
"version": "1.7.5", | ||
"main": "dist/cjs/index.js", | ||
@@ -29,5 +29,5 @@ "module": "dist/es/index.js", | ||
"dependencies": { | ||
"@sp-api-sdk/auth": "^1.9.4", | ||
"@sp-api-sdk/common": "^1.7.6", | ||
"axios": "^0.21.1" | ||
"@sp-api-sdk/auth": "^1.9.5", | ||
"@sp-api-sdk/common": "^1.7.7", | ||
"axios": "^0.24.0" | ||
}, | ||
@@ -53,3 +53,3 @@ "repository": { | ||
], | ||
"gitHead": "5dbdf09e0f74182eaa9b6c5f9ef0c931b0aa3089" | ||
"gitHead": "e8c21d7d481263e8a6663ee11f6708d4dc6968b6" | ||
} |
@@ -5,2 +5,8 @@ # `sales-api-v1` | ||
## Documentation | ||
Learn more about this Selling Partner API by visiting the [official documentation](https://github.com/amzn/selling-partner-api-docs/tree/main/references/sales-api/sales.md). | ||
Also, see the [generated documentation](https://bizon.github.io/selling-partner-api-sdk/modules/_sp_api_sdk_sales_api_v1.html) for this API client. | ||
## Installing | ||
@@ -23,11 +29,10 @@ | ||
const auth = new SellingPartnerApiAuth({ | ||
clientId: '', | ||
clientSecret: '', | ||
refreshToken: '', | ||
clientId: process.env.LWA_CLIENT_ID, | ||
clientSecret: process.env.LWA_CLIENT_SECRET, | ||
refreshToken: 'Atzr|…', | ||
accessKeyId: '', | ||
secretAccessKey: '', | ||
accessKeyId: '', | ||
region: '', | ||
role: { | ||
arn: '', | ||
} | ||
arn: 'arn:aws:iam::…', | ||
}, | ||
}) | ||
@@ -37,9 +42,9 @@ | ||
auth, | ||
region: 'eu' // or 'eu-west-1' | ||
region: 'eu', | ||
}) | ||
``` | ||
## Handle Rate Limiting | ||
## Rate Limiting | ||
If you want to let the SDK retry after each 429 responses, instanciate the client like this: | ||
In order to retry rate limited requests (HTTP 429), you can configure the API client as such: | ||
@@ -52,11 +57,26 @@ ```javascript | ||
retry: true, | ||
onRetry: (retryInfo) => console.log(retryInfo) // Optional | ||
} | ||
// Optionally specify a callback that will be called on every retry. | ||
onRetry: (retryInfo) => { | ||
console.log(retryInfo) | ||
}, | ||
}, | ||
}) | ||
``` | ||
The SDK gets the rate limits for each routes from the API documentation | ||
The rate limits used for each route are specified in the [API documentation]((https://github.com/amzn/selling-partner-api-docs/tree/main/references/sales-api/sales.md)). | ||
## API documentation | ||
## License | ||
See [here](https://github.com/amzn/selling-partner-api-docs/tree/main/references/sales-api/sales.md) | ||
MIT | ||
## Miscellaneous | ||
``` | ||
╚⊙ ⊙╝ | ||
╚═(███)═╝ | ||
╚═(███)═╝ | ||
╚═(███)═╝ | ||
╚═(███)═╝ | ||
╚═(███)═╝ | ||
╚═(███)═╝ | ||
``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
94506
79
1704
+ Addedaxios@0.24.0(transitive)
- Removedaxios@0.21.4(transitive)
Updated@sp-api-sdk/auth@^1.9.5
Updated@sp-api-sdk/common@^1.7.7
Updatedaxios@^0.24.0