@sp-api-sdk/product-type-definitions-api-2020-09-01 1.7.9 → 1.7.10
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
CHANGED
|
@@ -4,6 +4,12 @@ The Selling Partner API for Product Type Definitions provides programmatic acces
|
|
|
4
4
|
|
|
5
5
|
For more information, see the [Product Type Definitions API Use Case Guide](https://github.com/amzn/selling-partner-api-docs/blob/main/guides/en-US/use-case-guides/product-type-definitions-api-use-case-guide/definitions-product-types-api-use-case-guide_2020-09-01.md).
|
|
6
6
|
|
|
7
|
+
## Documentation
|
|
8
|
+
|
|
9
|
+
Learn more about this Selling Partner API by visiting the [official documentation](https://github.com/amzn/selling-partner-api-docs/tree/main/references/product-type-definitions-api/definitionsProductTypes_2020-09-01.md).
|
|
10
|
+
|
|
11
|
+
Also, see the [generated documentation](https://bizon.github.io/selling-partner-api-sdk/modules/_sp_api_sdk_product_type_definitions_api_2020_09_01.html) for this API client.
|
|
12
|
+
|
|
7
13
|
## Installing
|
|
8
14
|
|
|
9
15
|
```sh
|
|
@@ -21,26 +27,25 @@ import {SellingPartnerApiAuth} from '@sp-api-sdk/auth'
|
|
|
21
27
|
import {ProductTypeDefinitionsApiClient} from '@sp-api-sdk/product-type-definitions-api-2020-09-01'
|
|
22
28
|
|
|
23
29
|
const auth = new SellingPartnerApiAuth({
|
|
24
|
-
clientId:
|
|
25
|
-
clientSecret:
|
|
26
|
-
refreshToken: '',
|
|
27
|
-
secretAccessKey: '',
|
|
30
|
+
clientId: process.env.LWA_CLIENT_ID,
|
|
31
|
+
clientSecret: process.env.LWA_CLIENT_SECRET,
|
|
32
|
+
refreshToken: 'Atzr|…',
|
|
28
33
|
accessKeyId: '',
|
|
29
|
-
|
|
34
|
+
secretAccessKey: '',
|
|
30
35
|
role: {
|
|
31
|
-
arn: '',
|
|
32
|
-
}
|
|
36
|
+
arn: 'arn:aws:iam::…',
|
|
37
|
+
},
|
|
33
38
|
})
|
|
34
39
|
|
|
35
40
|
const client = new ProductTypeDefinitionsApiClient({
|
|
36
41
|
auth,
|
|
37
|
-
region: 'eu'
|
|
42
|
+
region: 'eu',
|
|
38
43
|
})
|
|
39
44
|
```
|
|
40
45
|
|
|
41
|
-
##
|
|
46
|
+
## Rate Limiting
|
|
42
47
|
|
|
43
|
-
|
|
48
|
+
In order to retry rate limited requests (HTTP 429), you can configure the API client as such:
|
|
44
49
|
|
|
45
50
|
```javascript
|
|
46
51
|
const client = new ProductTypeDefinitionsApiClient({
|
|
@@ -48,13 +53,28 @@ const client = new ProductTypeDefinitionsApiClient({
|
|
|
48
53
|
region: 'eu',
|
|
49
54
|
rateLimiting: {
|
|
50
55
|
retry: true,
|
|
51
|
-
|
|
52
|
-
|
|
56
|
+
// Optionally specify a callback that will be called on every retry.
|
|
57
|
+
onRetry: (retryInfo) => {
|
|
58
|
+
console.log(retryInfo)
|
|
59
|
+
},
|
|
60
|
+
},
|
|
53
61
|
})
|
|
54
62
|
```
|
|
55
63
|
|
|
56
|
-
The
|
|
64
|
+
The rate limits used for each route are specified in the [API documentation]((https://github.com/amzn/selling-partner-api-docs/tree/main/references/product-type-definitions-api/definitionsProductTypes_2020-09-01.md)).
|
|
65
|
+
|
|
66
|
+
## License
|
|
67
|
+
|
|
68
|
+
MIT
|
|
57
69
|
|
|
58
|
-
##
|
|
70
|
+
## Miscellaneous
|
|
59
71
|
|
|
60
|
-
|
|
72
|
+
```
|
|
73
|
+
╚⊙ ⊙╝
|
|
74
|
+
╚═(███)═╝
|
|
75
|
+
╚═(███)═╝
|
|
76
|
+
╚═(███)═╝
|
|
77
|
+
╚═(███)═╝
|
|
78
|
+
╚═(███)═╝
|
|
79
|
+
╚═(███)═╝
|
|
80
|
+
```
|
|
@@ -177,7 +177,7 @@ export declare class DefinitionsApi extends BaseAPI {
|
|
|
177
177
|
* @throws {RequiredError}
|
|
178
178
|
* @memberof DefinitionsApi
|
|
179
179
|
*/
|
|
180
|
-
getDefinitionsProductType(requestParameters: DefinitionsApiGetDefinitionsProductTypeRequest, options?: any): Promise<import("axios").AxiosResponse<ProductTypeDefinition>>;
|
|
180
|
+
getDefinitionsProductType(requestParameters: DefinitionsApiGetDefinitionsProductTypeRequest, options?: any): Promise<import("axios").AxiosResponse<ProductTypeDefinition, any>>;
|
|
181
181
|
/**
|
|
182
182
|
* Search for and return a list of Amazon product types that have definitions available. **Usage Plans:** | Plan type | Rate (requests per second) | Burst | | ---- | ---- | ---- | |Default| 5 | 10 | |Selling partner specific| Variable | Variable | The x-amzn-RateLimit-Limit response header returns the usage plan rate limits that were applied to the requested operation. Rate limits for some selling partners will vary from the default rate and burst shown in the table above. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://github.com/amzn/selling-partner-api-docs/blob/main/guides/en-US/usage-plans-rate-limits/Usage-Plans-and-Rate-Limits.md).
|
|
183
183
|
* @param {DefinitionsApiSearchDefinitionsProductTypesRequest} requestParameters Request parameters.
|
|
@@ -185,5 +185,5 @@ export declare class DefinitionsApi extends BaseAPI {
|
|
|
185
185
|
* @throws {RequiredError}
|
|
186
186
|
* @memberof DefinitionsApi
|
|
187
187
|
*/
|
|
188
|
-
searchDefinitionsProductTypes(requestParameters: DefinitionsApiSearchDefinitionsProductTypesRequest, options?: any): Promise<import("axios").AxiosResponse<ProductTypeList>>;
|
|
188
|
+
searchDefinitionsProductTypes(requestParameters: DefinitionsApiSearchDefinitionsProductTypesRequest, options?: any): Promise<import("axios").AxiosResponse<ProductTypeList, any>>;
|
|
189
189
|
}
|
|
@@ -62,4 +62,4 @@ export declare const toPathString: (url: URL) => string;
|
|
|
62
62
|
*
|
|
63
63
|
* @export
|
|
64
64
|
*/
|
|
65
|
-
export declare const createRequestFunction: (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration | undefined) => (axios?: AxiosInstance, basePath?: string) => Promise<import("axios").AxiosResponse<any>>;
|
|
65
|
+
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,11 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type { ClientConfiguration, RateLimit } from '@sp-api-sdk/common';
|
|
1
|
+
import type { ClientConfiguration, RateLimit, OnRetryHandler } from '@sp-api-sdk/common';
|
|
3
2
|
import { DefinitionsApi } from './api-model';
|
|
4
3
|
export declare const RATE_LIMITS: RateLimit[];
|
|
5
4
|
export interface ClientParameters extends Omit<ClientConfiguration, 'rateLimits' | 'onRetry'> {
|
|
6
5
|
rateLimiting?: {
|
|
7
6
|
retry: boolean;
|
|
8
|
-
onRetry?:
|
|
7
|
+
onRetry?: OnRetryHandler;
|
|
9
8
|
};
|
|
10
9
|
}
|
|
11
10
|
export declare class ProductTypeDefinitionsApiClient extends DefinitionsApi {
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@sp-api-sdk/product-type-definitions-api-2020-09-01",
|
|
3
3
|
"author": "Vincent Mesquita <vincent.mesquita@bizon.solutions>",
|
|
4
4
|
"description": "The Selling Partner API for Product Type Definitions provides programmatic access to attribute and data requirements for product types in the Amazon catalog. Use this API to return the JSON Schema for a product type that you can then use with other Selling Partner APIs, such as the Selling Partner API for Listings Items, the Selling Partner API for Catalog Items, and the Selling Partner API for Feeds (for JSON-based listing feeds). For more information, see the Product Type Definitions API Use Case Guide.",
|
|
5
|
-
"version": "1.7.
|
|
5
|
+
"version": "1.7.10",
|
|
6
6
|
"main": "dist/cjs/index.js",
|
|
7
7
|
"module": "dist/es/index.js",
|
|
8
8
|
"types": "dist/types/index.d.ts",
|
|
@@ -25,9 +25,9 @@
|
|
|
25
25
|
"test": "NODE_ENV='test' yarn jest"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@sp-api-sdk/auth": "^1.9.
|
|
29
|
-
"@sp-api-sdk/common": "^1.7.
|
|
30
|
-
"axios": "^0.
|
|
28
|
+
"@sp-api-sdk/auth": "^1.9.5",
|
|
29
|
+
"@sp-api-sdk/common": "^1.7.7",
|
|
30
|
+
"axios": "^0.24.0"
|
|
31
31
|
},
|
|
32
32
|
"repository": {
|
|
33
33
|
"type": "git",
|
|
@@ -48,5 +48,5 @@
|
|
|
48
48
|
"sp sdk",
|
|
49
49
|
"product type definitions api"
|
|
50
50
|
],
|
|
51
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "e8c21d7d481263e8a6663ee11f6708d4dc6968b6"
|
|
52
52
|
}
|