@sp-api-sdk/vehicles-api-2024-11-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 (63) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +99 -0
  3. package/dist/cjs/api-model/api/vehicles-api.js +148 -0
  4. package/dist/cjs/api-model/api.js +30 -0
  5. package/dist/cjs/api-model/base.js +71 -0
  6. package/dist/cjs/api-model/common.js +145 -0
  7. package/dist/cjs/api-model/configuration.js +104 -0
  8. package/dist/cjs/api-model/index.js +32 -0
  9. package/dist/cjs/api-model/models/engine-output-unit.js +25 -0
  10. package/dist/cjs/api-model/models/engine-output.js +15 -0
  11. package/dist/cjs/api-model/models/error-list.js +15 -0
  12. package/dist/cjs/api-model/models/index.js +27 -0
  13. package/dist/cjs/api-model/models/model-error.js +15 -0
  14. package/dist/cjs/api-model/models/month-and-year.js +15 -0
  15. package/dist/cjs/api-model/models/pagination.js +15 -0
  16. package/dist/cjs/api-model/models/vehicle-identifiers.js +15 -0
  17. package/dist/cjs/api-model/models/vehicle-standard.js +25 -0
  18. package/dist/cjs/api-model/models/vehicle-status-in-catalog.js +25 -0
  19. package/dist/cjs/api-model/models/vehicle.js +15 -0
  20. package/dist/cjs/api-model/models/vehicles-response.js +15 -0
  21. package/dist/cjs/client.js +13 -0
  22. package/dist/cjs/index.js +19 -0
  23. package/dist/es/api-model/api/vehicles-api.js +138 -0
  24. package/dist/es/api-model/api.js +14 -0
  25. package/dist/es/api-model/base.js +63 -0
  26. package/dist/es/api-model/common.js +133 -0
  27. package/dist/es/api-model/configuration.js +100 -0
  28. package/dist/es/api-model/index.js +16 -0
  29. package/dist/es/api-model/models/engine-output-unit.js +22 -0
  30. package/dist/es/api-model/models/engine-output.js +14 -0
  31. package/dist/es/api-model/models/error-list.js +14 -0
  32. package/dist/es/api-model/models/index.js +11 -0
  33. package/dist/es/api-model/models/model-error.js +14 -0
  34. package/dist/es/api-model/models/month-and-year.js +14 -0
  35. package/dist/es/api-model/models/pagination.js +14 -0
  36. package/dist/es/api-model/models/vehicle-identifiers.js +14 -0
  37. package/dist/es/api-model/models/vehicle-standard.js +22 -0
  38. package/dist/es/api-model/models/vehicle-status-in-catalog.js +22 -0
  39. package/dist/es/api-model/models/vehicle.js +14 -0
  40. package/dist/es/api-model/models/vehicles-response.js +14 -0
  41. package/dist/es/client.js +9 -0
  42. package/dist/es/index.js +3 -0
  43. package/dist/types/api-model/api/vehicles-api.d.ts +116 -0
  44. package/dist/types/api-model/api.d.ts +12 -0
  45. package/dist/types/api-model/base.d.ts +66 -0
  46. package/dist/types/api-model/common.d.ts +65 -0
  47. package/dist/types/api-model/configuration.d.ts +91 -0
  48. package/dist/types/api-model/index.d.ts +14 -0
  49. package/dist/types/api-model/models/engine-output-unit.d.ts +21 -0
  50. package/dist/types/api-model/models/engine-output.d.ts +31 -0
  51. package/dist/types/api-model/models/error-list.d.ts +24 -0
  52. package/dist/types/api-model/models/index.d.ts +11 -0
  53. package/dist/types/api-model/models/model-error.d.ts +36 -0
  54. package/dist/types/api-model/models/month-and-year.d.ts +30 -0
  55. package/dist/types/api-model/models/pagination.d.ts +30 -0
  56. package/dist/types/api-model/models/vehicle-identifiers.d.ts +31 -0
  57. package/dist/types/api-model/models/vehicle-standard.d.ts +21 -0
  58. package/dist/types/api-model/models/vehicle-status-in-catalog.d.ts +21 -0
  59. package/dist/types/api-model/models/vehicle.d.ts +94 -0
  60. package/dist/types/api-model/models/vehicles-response.d.ts +32 -0
  61. package/dist/types/client.d.ts +6 -0
  62. package/dist/types/index.d.ts +3 -0
  63. package/package.json +44 -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,99 @@
1
+ # `vehicles-api-2024-11-01`
2
+
3
+ The Selling Partner API for Automotive provides programmatic access to information needed by selling partners to provide compatibility information about their listed products.
4
+
5
+ [![npm version](https://img.shields.io/npm/v/@sp-api-sdk/vehicles-api-2024-11-01)](https://www.npmjs.com/package/@sp-api-sdk/vehicles-api-2024-11-01)
6
+ [![XO code style](https://img.shields.io/badge/code_style-xo-cyan)](https://github.com/xojs/xo)
7
+
8
+ [<img src="https://files.bizon.solutions/images/logo/bizon-horizontal.png" alt="Bizon" width="250"/>](https://www.bizon.solutions?utm_source=github&utm_medium=readme&utm_campaign=selling-partner-api-sdk)
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_vehicles-api-2024-11-01.html) for this API client.
15
+
16
+ ## Installing
17
+
18
+ ```sh
19
+ npm install @sp-api-sdk/vehicles-api-2024-11-01
20
+ ```
21
+
22
+ ## Getting Started
23
+
24
+ ```javascript
25
+ import {SellingPartnerApiAuth} from '@sp-api-sdk/auth'
26
+ import {VehiclesApiClient} from '@sp-api-sdk/vehicles-api-2024-11-01'
27
+
28
+ const auth = new SellingPartnerApiAuth({
29
+ clientId: process.env.LWA_CLIENT_ID,
30
+ clientSecret: process.env.LWA_CLIENT_SECRET,
31
+ refreshToken: 'Atzr|…',
32
+ })
33
+
34
+ const client = new VehiclesApiClient({
35
+ auth,
36
+ region: 'eu',
37
+ })
38
+ ```
39
+
40
+ ## Rate Limiting
41
+
42
+ In order to retry rate limited requests (HTTP 429), you can configure the API client as such:
43
+
44
+ ```javascript
45
+ const client = new VehiclesApiClient({
46
+ auth,
47
+ region: 'eu',
48
+ rateLimiting: {
49
+ retry: true,
50
+ // Optionally specify a callback that will be called on every retry.
51
+ onRetry: (retryInfo) => {
52
+ console.log(retryInfo)
53
+ },
54
+ },
55
+ })
56
+ ```
57
+
58
+ The rate limits used for each route are specified in the [API documentation](https://developer-docs.amazon.com/sp-api/docs).
59
+
60
+ ## Logging
61
+
62
+ You can enable logging for both SP-API requests and responses by configuring the `logging.request` and `logging.response` properties.
63
+
64
+ ```javascript
65
+ const client = new VehiclesApiClient({
66
+ auth,
67
+ region: 'eu',
68
+ logging: {
69
+ request: {
70
+ logger: console.debug
71
+ },
72
+ response: {
73
+ logger: console.debug
74
+ },
75
+ error: true,
76
+ },
77
+ })
78
+ ```
79
+
80
+ Specifying `true` will use the default options, specifying an object will allow you to override the default options.
81
+ This uses [axios-logger](https://github.com/hg-pyun/axios-logger) under the hood.
82
+ By default, if enabled, the `request` and `response` loggers will use `console.info` and the `error` logger will use `console.error`.
83
+
84
+
85
+ ## License
86
+
87
+ MIT
88
+
89
+ ## Miscellaneous
90
+
91
+ ```
92
+ ╚⊙ ⊙╝
93
+ ╚═(███)═╝
94
+ ╚═(███)═╝
95
+ ╚═(███)═╝
96
+ ╚═(███)═╝
97
+ ╚═(███)═╝
98
+ ╚═(███)═╝
99
+ ```
@@ -0,0 +1,148 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * The Selling Partner API for Automotive.
6
+ * The Selling Partner API for Automotive provides programmatic access to information needed by selling partners to provide compatibility information about their listed products.
7
+ *
8
+ * The version of the OpenAPI document: 2024-11-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
+ var __importDefault = (this && this.__importDefault) || function (mod) {
16
+ return (mod && mod.__esModule) ? mod : { "default": mod };
17
+ };
18
+ Object.defineProperty(exports, "__esModule", { value: true });
19
+ exports.GetVehiclesVehicleTypeEnum = exports.VehiclesApi = exports.VehiclesApiFactory = exports.VehiclesApiFp = exports.VehiclesApiAxiosParamCreator = void 0;
20
+ const axios_1 = __importDefault(require("axios"));
21
+ // Some imports not used depending on template conditions
22
+ // @ts-ignore
23
+ const common_1 = require("../common");
24
+ // @ts-ignore
25
+ const base_1 = require("../base");
26
+ /**
27
+ * VehiclesApi - axios parameter creator
28
+ * @export
29
+ */
30
+ const VehiclesApiAxiosParamCreator = function (configuration) {
31
+ return {
32
+ /**
33
+ * Get the latest collection of vehicles
34
+ * @param {string} marketplaceId An identifier for the marketplace in which the resource operates.
35
+ * @param {GetVehiclesVehicleTypeEnum} vehicleType An identifier for vehicle type.
36
+ * @param {string} [pageToken] A token to fetch a certain page when there are multiple pages worth of results.
37
+ * @param {string} [updatedAfter] Date in ISO 8601 format, if provided only vehicles which are modified/added to Amazon\&#39;s catalog after this date will be returned.
38
+ * @param {*} [options] Override http request option.
39
+ * @throws {RequiredError}
40
+ */
41
+ getVehicles: async (marketplaceId, vehicleType, pageToken, updatedAfter, options = {}) => {
42
+ // verify required parameter 'marketplaceId' is not null or undefined
43
+ (0, common_1.assertParamExists)('getVehicles', 'marketplaceId', marketplaceId);
44
+ // verify required parameter 'vehicleType' is not null or undefined
45
+ (0, common_1.assertParamExists)('getVehicles', 'vehicleType', vehicleType);
46
+ const localVarPath = `/catalog/2024-11-01/automotive/vehicles`;
47
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
48
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
49
+ let baseOptions;
50
+ if (configuration) {
51
+ baseOptions = configuration.baseOptions;
52
+ }
53
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
54
+ const localVarHeaderParameter = {};
55
+ const localVarQueryParameter = {};
56
+ if (pageToken !== undefined) {
57
+ localVarQueryParameter['pageToken'] = pageToken;
58
+ }
59
+ if (marketplaceId !== undefined) {
60
+ localVarQueryParameter['marketplaceId'] = marketplaceId;
61
+ }
62
+ if (vehicleType !== undefined) {
63
+ localVarQueryParameter['vehicleType'] = vehicleType;
64
+ }
65
+ if (updatedAfter !== undefined) {
66
+ localVarQueryParameter['updatedAfter'] = updatedAfter;
67
+ }
68
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
69
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
70
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
71
+ return {
72
+ url: (0, common_1.toPathString)(localVarUrlObj),
73
+ options: localVarRequestOptions,
74
+ };
75
+ },
76
+ };
77
+ };
78
+ exports.VehiclesApiAxiosParamCreator = VehiclesApiAxiosParamCreator;
79
+ /**
80
+ * VehiclesApi - functional programming interface
81
+ * @export
82
+ */
83
+ const VehiclesApiFp = function (configuration) {
84
+ const localVarAxiosParamCreator = (0, exports.VehiclesApiAxiosParamCreator)(configuration);
85
+ return {
86
+ /**
87
+ * Get the latest collection of vehicles
88
+ * @param {string} marketplaceId An identifier for the marketplace in which the resource operates.
89
+ * @param {GetVehiclesVehicleTypeEnum} vehicleType An identifier for vehicle type.
90
+ * @param {string} [pageToken] A token to fetch a certain page when there are multiple pages worth of results.
91
+ * @param {string} [updatedAfter] Date in ISO 8601 format, if provided only vehicles which are modified/added to Amazon\&#39;s catalog after this date will be returned.
92
+ * @param {*} [options] Override http request option.
93
+ * @throws {RequiredError}
94
+ */
95
+ async getVehicles(marketplaceId, vehicleType, pageToken, updatedAfter, options) {
96
+ const localVarAxiosArgs = await localVarAxiosParamCreator.getVehicles(marketplaceId, vehicleType, pageToken, updatedAfter, options);
97
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
98
+ const localVarOperationServerBasePath = base_1.operationServerMap['VehiclesApi.getVehicles']?.[localVarOperationServerIndex]?.url;
99
+ return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
100
+ },
101
+ };
102
+ };
103
+ exports.VehiclesApiFp = VehiclesApiFp;
104
+ /**
105
+ * VehiclesApi - factory interface
106
+ * @export
107
+ */
108
+ const VehiclesApiFactory = function (configuration, basePath, axios) {
109
+ const localVarFp = (0, exports.VehiclesApiFp)(configuration);
110
+ return {
111
+ /**
112
+ * Get the latest collection of vehicles
113
+ * @param {VehiclesApiGetVehiclesRequest} requestParameters Request parameters.
114
+ * @param {*} [options] Override http request option.
115
+ * @throws {RequiredError}
116
+ */
117
+ getVehicles(requestParameters, options) {
118
+ return localVarFp.getVehicles(requestParameters.marketplaceId, requestParameters.vehicleType, requestParameters.pageToken, requestParameters.updatedAfter, options).then((request) => request(axios, basePath));
119
+ },
120
+ };
121
+ };
122
+ exports.VehiclesApiFactory = VehiclesApiFactory;
123
+ /**
124
+ * VehiclesApi - object-oriented interface
125
+ * @export
126
+ * @class VehiclesApi
127
+ * @extends {BaseAPI}
128
+ */
129
+ class VehiclesApi extends base_1.BaseAPI {
130
+ /**
131
+ * Get the latest collection of vehicles
132
+ * @param {VehiclesApiGetVehiclesRequest} requestParameters Request parameters.
133
+ * @param {*} [options] Override http request option.
134
+ * @throws {RequiredError}
135
+ * @memberof VehiclesApi
136
+ */
137
+ getVehicles(requestParameters, options) {
138
+ return (0, exports.VehiclesApiFp)(this.configuration).getVehicles(requestParameters.marketplaceId, requestParameters.vehicleType, requestParameters.pageToken, requestParameters.updatedAfter, options).then((request) => request(this.axios, this.basePath));
139
+ }
140
+ }
141
+ exports.VehiclesApi = VehiclesApi;
142
+ /**
143
+ * @export
144
+ */
145
+ exports.GetVehiclesVehicleTypeEnum = {
146
+ Car: 'CAR',
147
+ Motorbike: 'MOTORBIKE'
148
+ };
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * The Selling Partner API for Automotive.
6
+ * The Selling Partner API for Automotive provides programmatic access to information needed by selling partners to provide compatibility information about their listed products.
7
+ *
8
+ * The version of the OpenAPI document: 2024-11-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
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
16
+ if (k2 === undefined) k2 = k;
17
+ var desc = Object.getOwnPropertyDescriptor(m, k);
18
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
19
+ desc = { enumerable: true, get: function() { return m[k]; } };
20
+ }
21
+ Object.defineProperty(o, k2, desc);
22
+ }) : (function(o, m, k, k2) {
23
+ if (k2 === undefined) k2 = k;
24
+ o[k2] = m[k];
25
+ }));
26
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
27
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
28
+ };
29
+ Object.defineProperty(exports, "__esModule", { value: true });
30
+ __exportStar(require("./api/vehicles-api"), exports);
@@ -0,0 +1,71 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * The Selling Partner API for Automotive.
6
+ * The Selling Partner API for Automotive provides programmatic access to information needed by selling partners to provide compatibility information about their listed products.
7
+ *
8
+ * The version of the OpenAPI document: 2024-11-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
+ var __importDefault = (this && this.__importDefault) || function (mod) {
16
+ return (mod && mod.__esModule) ? mod : { "default": mod };
17
+ };
18
+ Object.defineProperty(exports, "__esModule", { value: true });
19
+ exports.operationServerMap = exports.RequiredError = exports.BaseAPI = exports.COLLECTION_FORMATS = exports.BASE_PATH = void 0;
20
+ const axios_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
+ basePath;
39
+ axios;
40
+ configuration;
41
+ constructor(configuration, basePath = exports.BASE_PATH, axios = axios_1.default) {
42
+ this.basePath = basePath;
43
+ this.axios = axios;
44
+ if (configuration) {
45
+ this.configuration = configuration;
46
+ this.basePath = configuration.basePath ?? basePath;
47
+ }
48
+ }
49
+ }
50
+ exports.BaseAPI = BaseAPI;
51
+ ;
52
+ /**
53
+ *
54
+ * @export
55
+ * @class RequiredError
56
+ * @extends {Error}
57
+ */
58
+ class RequiredError extends Error {
59
+ field;
60
+ constructor(field, msg) {
61
+ super(msg);
62
+ this.field = field;
63
+ this.name = "RequiredError";
64
+ }
65
+ }
66
+ exports.RequiredError = RequiredError;
67
+ /**
68
+ *
69
+ * @export
70
+ */
71
+ exports.operationServerMap = {};
@@ -0,0 +1,145 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * The Selling Partner API for Automotive.
6
+ * The Selling Partner API for Automotive provides programmatic access to information needed by selling partners to provide compatibility information about their listed products.
7
+ *
8
+ * The version of the OpenAPI document: 2024-11-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
+ function setFlattenedQueryParams(urlSearchParams, parameter, key = "") {
84
+ if (parameter == null)
85
+ return;
86
+ if (typeof parameter === "object") {
87
+ if (Array.isArray(parameter)) {
88
+ parameter.forEach(item => setFlattenedQueryParams(urlSearchParams, item, key));
89
+ }
90
+ else {
91
+ Object.keys(parameter).forEach(currentKey => setFlattenedQueryParams(urlSearchParams, parameter[currentKey], `${key}${key !== '' ? '.' : ''}${currentKey}`));
92
+ }
93
+ }
94
+ else {
95
+ if (urlSearchParams.has(key)) {
96
+ urlSearchParams.append(key, parameter);
97
+ }
98
+ else {
99
+ urlSearchParams.set(key, parameter);
100
+ }
101
+ }
102
+ }
103
+ /**
104
+ *
105
+ * @export
106
+ */
107
+ const setSearchParams = function (url, ...objects) {
108
+ const searchParams = new URLSearchParams(url.search);
109
+ setFlattenedQueryParams(searchParams, objects);
110
+ url.search = searchParams.toString();
111
+ };
112
+ exports.setSearchParams = setSearchParams;
113
+ /**
114
+ *
115
+ * @export
116
+ */
117
+ const serializeDataIfNeeded = function (value, requestOptions, configuration) {
118
+ const nonString = typeof value !== 'string';
119
+ const needsSerialization = nonString && configuration && configuration.isJsonMime
120
+ ? configuration.isJsonMime(requestOptions.headers['Content-Type'])
121
+ : nonString;
122
+ return needsSerialization
123
+ ? JSON.stringify(value !== undefined ? value : {})
124
+ : (value || "");
125
+ };
126
+ exports.serializeDataIfNeeded = serializeDataIfNeeded;
127
+ /**
128
+ *
129
+ * @export
130
+ */
131
+ const toPathString = function (url) {
132
+ return url.pathname + url.search + url.hash;
133
+ };
134
+ exports.toPathString = toPathString;
135
+ /**
136
+ *
137
+ * @export
138
+ */
139
+ const createRequestFunction = function (axiosArgs, globalAxios, BASE_PATH, configuration) {
140
+ return (axios = globalAxios, basePath = BASE_PATH) => {
141
+ const axiosRequestArgs = { ...axiosArgs.options, url: (axios.defaults.baseURL ? '' : configuration?.basePath ?? basePath) + axiosArgs.url };
142
+ return axios.request(axiosRequestArgs);
143
+ };
144
+ };
145
+ exports.createRequestFunction = createRequestFunction;
@@ -0,0 +1,104 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * The Selling Partner API for Automotive.
6
+ * The Selling Partner API for Automotive provides programmatic access to information needed by selling partners to provide compatibility information about their listed products.
7
+ *
8
+ * The version of the OpenAPI document: 2024-11-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.Configuration = void 0;
17
+ class Configuration {
18
+ /**
19
+ * parameter for apiKey security
20
+ * @param name security name
21
+ * @memberof Configuration
22
+ */
23
+ apiKey;
24
+ /**
25
+ * parameter for basic security
26
+ *
27
+ * @type {string}
28
+ * @memberof Configuration
29
+ */
30
+ username;
31
+ /**
32
+ * parameter for basic security
33
+ *
34
+ * @type {string}
35
+ * @memberof Configuration
36
+ */
37
+ password;
38
+ /**
39
+ * parameter for oauth2 security
40
+ * @param name security name
41
+ * @param scopes oauth2 scope
42
+ * @memberof Configuration
43
+ */
44
+ accessToken;
45
+ /**
46
+ * override base path
47
+ *
48
+ * @type {string}
49
+ * @memberof Configuration
50
+ */
51
+ basePath;
52
+ /**
53
+ * override server index
54
+ *
55
+ * @type {number}
56
+ * @memberof Configuration
57
+ */
58
+ serverIndex;
59
+ /**
60
+ * base options for axios calls
61
+ *
62
+ * @type {any}
63
+ * @memberof Configuration
64
+ */
65
+ baseOptions;
66
+ /**
67
+ * The FormData constructor that will be used to create multipart form data
68
+ * requests. You can inject this here so that execution environments that
69
+ * do not support the FormData class can still run the generated client.
70
+ *
71
+ * @type {new () => FormData}
72
+ */
73
+ formDataCtor;
74
+ constructor(param = {}) {
75
+ this.apiKey = param.apiKey;
76
+ this.username = param.username;
77
+ this.password = param.password;
78
+ this.accessToken = param.accessToken;
79
+ this.basePath = param.basePath;
80
+ this.serverIndex = param.serverIndex;
81
+ this.baseOptions = {
82
+ ...param.baseOptions,
83
+ headers: {
84
+ ...param.baseOptions?.headers,
85
+ },
86
+ };
87
+ this.formDataCtor = param.formDataCtor;
88
+ }
89
+ /**
90
+ * Check if the given MIME is a JSON MIME.
91
+ * JSON MIME examples:
92
+ * application/json
93
+ * application/json; charset=UTF8
94
+ * APPLICATION/JSON
95
+ * application/vnd.company+json
96
+ * @param mime - MIME (Multipurpose Internet Mail Extensions)
97
+ * @return True if the given MIME is JSON, false otherwise.
98
+ */
99
+ isJsonMime(mime) {
100
+ const jsonMime = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i');
101
+ return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json');
102
+ }
103
+ }
104
+ exports.Configuration = Configuration;
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * The Selling Partner API for Automotive.
6
+ * The Selling Partner API for Automotive provides programmatic access to information needed by selling partners to provide compatibility information about their listed products.
7
+ *
8
+ * The version of the OpenAPI document: 2024-11-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
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
16
+ if (k2 === undefined) k2 = k;
17
+ var desc = Object.getOwnPropertyDescriptor(m, k);
18
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
19
+ desc = { enumerable: true, get: function() { return m[k]; } };
20
+ }
21
+ Object.defineProperty(o, k2, desc);
22
+ }) : (function(o, m, k, k2) {
23
+ if (k2 === undefined) k2 = k;
24
+ o[k2] = m[k];
25
+ }));
26
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
27
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
28
+ };
29
+ Object.defineProperty(exports, "__esModule", { value: true });
30
+ __exportStar(require("./api"), exports);
31
+ __exportStar(require("./configuration"), exports);
32
+ __exportStar(require("./models"), exports);
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * The Selling Partner API for Automotive.
6
+ * The Selling Partner API for Automotive provides programmatic access to information needed by selling partners to provide compatibility information about their listed products.
7
+ *
8
+ * The version of the OpenAPI document: 2024-11-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.EngineOutputUnit = void 0;
17
+ /**
18
+ * Unit for measuring engine power.
19
+ * @export
20
+ * @enum {string}
21
+ */
22
+ exports.EngineOutputUnit = {
23
+ Kilowatt: 'KILOWATT',
24
+ Horsepower: 'HORSEPOWER'
25
+ };