@sp-api-sdk/finances-api-2024-06-19 4.0.0 → 4.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.
- package/README.md +3 -4
- package/dist/index.cjs +280 -322
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +421 -482
- package/dist/index.d.ts +421 -482
- package/dist/index.js +254 -283
- package/dist/index.js.map +1 -1
- package/package.json +7 -4
package/dist/index.js
CHANGED
|
@@ -1,304 +1,275 @@
|
|
|
1
|
-
// src/client.ts
|
|
2
1
|
import { createAxiosInstance } from "@sp-api-sdk/common";
|
|
3
|
-
|
|
4
|
-
// src/api-model/api/finances-api.ts
|
|
5
|
-
import globalAxios2 from "axios";
|
|
6
|
-
|
|
7
|
-
// src/api-model/base.ts
|
|
8
2
|
import globalAxios from "axios";
|
|
9
|
-
|
|
3
|
+
//#region src/api-model/base.ts
|
|
4
|
+
const BASE_PATH = "https://sellingpartnerapi-na.amazon.com".replace(/\/+$/, "");
|
|
10
5
|
var BaseAPI = class {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
6
|
+
basePath;
|
|
7
|
+
axios;
|
|
8
|
+
configuration;
|
|
9
|
+
constructor(configuration, basePath = BASE_PATH, axios = globalAxios) {
|
|
10
|
+
this.basePath = basePath;
|
|
11
|
+
this.axios = axios;
|
|
12
|
+
if (configuration) {
|
|
13
|
+
this.configuration = configuration;
|
|
14
|
+
this.basePath = configuration.basePath ?? basePath;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
22
17
|
};
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
18
|
+
const operationServerMap = {};
|
|
19
|
+
//#endregion
|
|
20
|
+
//#region src/api-model/common.ts
|
|
21
|
+
const DUMMY_BASE_URL = "https://example.com";
|
|
27
22
|
function setFlattenedQueryParams(urlSearchParams, parameter, key = "") {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
Object.keys(parameter).forEach(
|
|
34
|
-
(currentKey) => setFlattenedQueryParams(urlSearchParams, parameter[currentKey], `${key}${key !== "" ? "." : ""}${currentKey}`)
|
|
35
|
-
);
|
|
36
|
-
}
|
|
37
|
-
} else {
|
|
38
|
-
if (urlSearchParams.has(key)) {
|
|
39
|
-
urlSearchParams.append(key, parameter);
|
|
40
|
-
} else {
|
|
41
|
-
urlSearchParams.set(key, parameter);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
23
|
+
if (parameter == null) return;
|
|
24
|
+
if (typeof parameter === "object") if (Array.isArray(parameter) || parameter instanceof Set) parameter.forEach((item) => setFlattenedQueryParams(urlSearchParams, item, key));
|
|
25
|
+
else Object.keys(parameter).forEach((currentKey) => setFlattenedQueryParams(urlSearchParams, parameter[currentKey], `${key}${key !== "" ? "." : ""}${currentKey}`));
|
|
26
|
+
else if (urlSearchParams.has(key)) urlSearchParams.append(key, parameter);
|
|
27
|
+
else urlSearchParams.set(key, parameter);
|
|
44
28
|
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
29
|
+
const setSearchParams = function(url, ...objects) {
|
|
30
|
+
const searchParams = new URLSearchParams(url.search);
|
|
31
|
+
setFlattenedQueryParams(searchParams, objects);
|
|
32
|
+
url.search = searchParams.toString();
|
|
49
33
|
};
|
|
50
|
-
|
|
51
|
-
|
|
34
|
+
const toPathString = function(url) {
|
|
35
|
+
return url.pathname + url.search + url.hash;
|
|
52
36
|
};
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
37
|
+
const createRequestFunction = function(axiosArgs, globalAxios, BASE_PATH, configuration) {
|
|
38
|
+
return (axios = globalAxios, basePath = BASE_PATH) => {
|
|
39
|
+
const axiosRequestArgs = {
|
|
40
|
+
...axiosArgs.options,
|
|
41
|
+
url: (axios.defaults.baseURL ? "" : configuration?.basePath ?? basePath) + axiosArgs.url
|
|
42
|
+
};
|
|
43
|
+
return axios.request(axiosRequestArgs);
|
|
44
|
+
};
|
|
58
45
|
};
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
|
|
110
|
-
return {
|
|
111
|
-
url: toPathString(localVarUrlObj),
|
|
112
|
-
options: localVarRequestOptions
|
|
113
|
-
};
|
|
114
|
-
}
|
|
115
|
-
};
|
|
46
|
+
//#endregion
|
|
47
|
+
//#region src/api-model/api/finances-api.ts
|
|
48
|
+
/**
|
|
49
|
+
* FinancesApi - axios parameter creator
|
|
50
|
+
*/
|
|
51
|
+
const FinancesApiAxiosParamCreator = function(configuration) {
|
|
52
|
+
return {
|
|
53
|
+
/**
|
|
54
|
+
* Returns transactions for the given parameters. Financial events might not include orders from the last 48 hours. **Usage plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.5 | 10 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits).
|
|
55
|
+
* @param {string} [postedAfter] The response includes financial events posted on or after this date. This date must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date-time format. The date-time must be more than two minutes before the time of the request. This field is required if you do not specify a related identifier.
|
|
56
|
+
* @param {string} [postedBefore] The response includes financial events posted before (but not on) this date. This date must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date-time format. The date-time must be later than `PostedAfter` and more than two minutes before the request was submitted. If `PostedAfter` and `PostedBefore` are more than 180 days apart, the response is empty. **Default:** Two minutes before the time of the request.
|
|
57
|
+
* @param {string} [marketplaceId] The identifier of the marketplace from which you want to retrieve transactions. The marketplace ID is the globally unique identifier of a marketplace. To find the ID for your marketplace, refer to [Marketplace IDs](https://developer-docs.amazon.com/sp-api/docs/marketplace-ids).
|
|
58
|
+
* @param {string} [transactionStatus] The status of the transaction. **Possible values:** * `DEFERRED`: the transaction is currently deferred. * `RELEASED`: the transaction is currently released. * `DEFERRED_RELEASED`: the transaction was deferred in the past, but is now released. The status of a deferred transaction is updated to `DEFERRED_RELEASED` when the transaction is released.
|
|
59
|
+
* @param {string} [relatedIdentifierName] The name of the `relatedIdentifier`. **Possible values:** * `FINANCIAL_EVENT_GROUP_ID`: the financial event group ID associated with the transaction. * `ORDER_ID`: the order ID associated with the transaction. **Note:** FINANCIAL_EVENT_GROUP_ID and ORDER_ID are the only `relatedIdentifier` with filtering capabilities at the moment. While other `relatedIdentifier` values will be included in the response when available, they cannot be used for filtering purposes.
|
|
60
|
+
* @param {string} [relatedIdentifierValue] The value of the `relatedIdentifier`.
|
|
61
|
+
* @param {string} [nextToken] The response includes `nextToken` when the number of results exceeds the specified `pageSize` value. To get the next page of results, call the operation with this token and include the same arguments as the call that produced the token. To get a complete list, call this operation until `nextToken` is null. Note that this operation can return empty pages.
|
|
62
|
+
* @param {*} [options] Override http request option.
|
|
63
|
+
* @throws {RequiredError}
|
|
64
|
+
*/
|
|
65
|
+
listTransactions: async (postedAfter, postedBefore, marketplaceId, transactionStatus, relatedIdentifierName, relatedIdentifierValue, nextToken, options = {}) => {
|
|
66
|
+
const localVarUrlObj = new URL(`/finances/2024-06-19/transactions`, DUMMY_BASE_URL);
|
|
67
|
+
let baseOptions;
|
|
68
|
+
if (configuration) baseOptions = configuration.baseOptions;
|
|
69
|
+
const localVarRequestOptions = {
|
|
70
|
+
method: "GET",
|
|
71
|
+
...baseOptions,
|
|
72
|
+
...options
|
|
73
|
+
};
|
|
74
|
+
const localVarHeaderParameter = {};
|
|
75
|
+
const localVarQueryParameter = {};
|
|
76
|
+
if (postedAfter !== void 0) localVarQueryParameter["postedAfter"] = postedAfter instanceof Date ? postedAfter.toISOString() : postedAfter;
|
|
77
|
+
if (postedBefore !== void 0) localVarQueryParameter["postedBefore"] = postedBefore instanceof Date ? postedBefore.toISOString() : postedBefore;
|
|
78
|
+
if (marketplaceId !== void 0) localVarQueryParameter["marketplaceId"] = marketplaceId;
|
|
79
|
+
if (transactionStatus !== void 0) localVarQueryParameter["transactionStatus"] = transactionStatus;
|
|
80
|
+
if (relatedIdentifierName !== void 0) localVarQueryParameter["relatedIdentifierName"] = relatedIdentifierName;
|
|
81
|
+
if (relatedIdentifierValue !== void 0) localVarQueryParameter["relatedIdentifierValue"] = relatedIdentifierValue;
|
|
82
|
+
if (nextToken !== void 0) localVarQueryParameter["nextToken"] = nextToken;
|
|
83
|
+
localVarHeaderParameter["Accept"] = "application/json";
|
|
84
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
85
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
86
|
+
localVarRequestOptions.headers = {
|
|
87
|
+
...localVarHeaderParameter,
|
|
88
|
+
...headersFromBaseOptions,
|
|
89
|
+
...options.headers
|
|
90
|
+
};
|
|
91
|
+
return {
|
|
92
|
+
url: toPathString(localVarUrlObj),
|
|
93
|
+
options: localVarRequestOptions
|
|
94
|
+
};
|
|
95
|
+
} };
|
|
116
96
|
};
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
97
|
+
/**
|
|
98
|
+
* FinancesApi - functional programming interface
|
|
99
|
+
*/
|
|
100
|
+
const FinancesApiFp = function(configuration) {
|
|
101
|
+
const localVarAxiosParamCreator = FinancesApiAxiosParamCreator(configuration);
|
|
102
|
+
return {
|
|
103
|
+
/**
|
|
104
|
+
* Returns transactions for the given parameters. Financial events might not include orders from the last 48 hours. **Usage plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.5 | 10 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits).
|
|
105
|
+
* @param {string} [postedAfter] The response includes financial events posted on or after this date. This date must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date-time format. The date-time must be more than two minutes before the time of the request. This field is required if you do not specify a related identifier.
|
|
106
|
+
* @param {string} [postedBefore] The response includes financial events posted before (but not on) this date. This date must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date-time format. The date-time must be later than `PostedAfter` and more than two minutes before the request was submitted. If `PostedAfter` and `PostedBefore` are more than 180 days apart, the response is empty. **Default:** Two minutes before the time of the request.
|
|
107
|
+
* @param {string} [marketplaceId] The identifier of the marketplace from which you want to retrieve transactions. The marketplace ID is the globally unique identifier of a marketplace. To find the ID for your marketplace, refer to [Marketplace IDs](https://developer-docs.amazon.com/sp-api/docs/marketplace-ids).
|
|
108
|
+
* @param {string} [transactionStatus] The status of the transaction. **Possible values:** * `DEFERRED`: the transaction is currently deferred. * `RELEASED`: the transaction is currently released. * `DEFERRED_RELEASED`: the transaction was deferred in the past, but is now released. The status of a deferred transaction is updated to `DEFERRED_RELEASED` when the transaction is released.
|
|
109
|
+
* @param {string} [relatedIdentifierName] The name of the `relatedIdentifier`. **Possible values:** * `FINANCIAL_EVENT_GROUP_ID`: the financial event group ID associated with the transaction. * `ORDER_ID`: the order ID associated with the transaction. **Note:** FINANCIAL_EVENT_GROUP_ID and ORDER_ID are the only `relatedIdentifier` with filtering capabilities at the moment. While other `relatedIdentifier` values will be included in the response when available, they cannot be used for filtering purposes.
|
|
110
|
+
* @param {string} [relatedIdentifierValue] The value of the `relatedIdentifier`.
|
|
111
|
+
* @param {string} [nextToken] The response includes `nextToken` when the number of results exceeds the specified `pageSize` value. To get the next page of results, call the operation with this token and include the same arguments as the call that produced the token. To get a complete list, call this operation until `nextToken` is null. Note that this operation can return empty pages.
|
|
112
|
+
* @param {*} [options] Override http request option.
|
|
113
|
+
* @throws {RequiredError}
|
|
114
|
+
*/
|
|
115
|
+
async listTransactions(postedAfter, postedBefore, marketplaceId, transactionStatus, relatedIdentifierName, relatedIdentifierValue, nextToken, options) {
|
|
116
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.listTransactions(postedAfter, postedBefore, marketplaceId, transactionStatus, relatedIdentifierName, relatedIdentifierValue, nextToken, options);
|
|
117
|
+
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
118
|
+
const localVarOperationServerBasePath = operationServerMap["FinancesApi.listTransactions"]?.[localVarOperationServerIndex]?.url;
|
|
119
|
+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
120
|
+
} };
|
|
139
121
|
};
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
122
|
+
/**
|
|
123
|
+
* FinancesApi - factory interface
|
|
124
|
+
*/
|
|
125
|
+
const FinancesApiFactory = function(configuration, basePath, axios) {
|
|
126
|
+
const localVarFp = FinancesApiFp(configuration);
|
|
127
|
+
return {
|
|
128
|
+
/**
|
|
129
|
+
* Returns transactions for the given parameters. Financial events might not include orders from the last 48 hours. **Usage plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.5 | 10 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits).
|
|
130
|
+
* @param {FinancesApiListTransactionsRequest} requestParameters Request parameters.
|
|
131
|
+
* @param {*} [options] Override http request option.
|
|
132
|
+
* @throws {RequiredError}
|
|
133
|
+
*/
|
|
134
|
+
listTransactions(requestParameters = {}, options) {
|
|
135
|
+
return localVarFp.listTransactions(requestParameters.postedAfter, requestParameters.postedBefore, requestParameters.marketplaceId, requestParameters.transactionStatus, requestParameters.relatedIdentifierName, requestParameters.relatedIdentifierValue, requestParameters.nextToken, options).then((request) => request(axios, basePath));
|
|
136
|
+
} };
|
|
153
137
|
};
|
|
138
|
+
/**
|
|
139
|
+
* FinancesApi - object-oriented interface
|
|
140
|
+
*/
|
|
154
141
|
var FinancesApi = class extends BaseAPI {
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
142
|
+
/**
|
|
143
|
+
* Returns transactions for the given parameters. Financial events might not include orders from the last 48 hours. **Usage plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.5 | 10 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits).
|
|
144
|
+
* @param {FinancesApiListTransactionsRequest} requestParameters Request parameters.
|
|
145
|
+
* @param {*} [options] Override http request option.
|
|
146
|
+
* @throws {RequiredError}
|
|
147
|
+
*/
|
|
148
|
+
listTransactions(requestParameters = {}, options) {
|
|
149
|
+
return FinancesApiFp(this.configuration).listTransactions(requestParameters.postedAfter, requestParameters.postedBefore, requestParameters.marketplaceId, requestParameters.transactionStatus, requestParameters.relatedIdentifierName, requestParameters.relatedIdentifierValue, requestParameters.nextToken, options).then((request) => request(this.axios, this.basePath));
|
|
150
|
+
}
|
|
164
151
|
};
|
|
165
|
-
|
|
166
|
-
|
|
152
|
+
//#endregion
|
|
153
|
+
//#region src/api-model/configuration.ts
|
|
167
154
|
var Configuration = class {
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
const jsonMime = /^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$/i;
|
|
246
|
-
return mime !== null && jsonMime.test(mime);
|
|
247
|
-
}
|
|
248
|
-
};
|
|
249
|
-
|
|
250
|
-
// src/api-model/models/business-context.ts
|
|
251
|
-
var BusinessContextStoreNameEnum = {
|
|
252
|
-
AmazonHaul: "AMAZON_HAUL"
|
|
155
|
+
/**
|
|
156
|
+
* parameter for apiKey security
|
|
157
|
+
* @param name security name
|
|
158
|
+
*/
|
|
159
|
+
apiKey;
|
|
160
|
+
/**
|
|
161
|
+
* parameter for basic security
|
|
162
|
+
*/
|
|
163
|
+
username;
|
|
164
|
+
/**
|
|
165
|
+
* parameter for basic security
|
|
166
|
+
*/
|
|
167
|
+
password;
|
|
168
|
+
/**
|
|
169
|
+
* parameter for oauth2 security
|
|
170
|
+
* @param name security name
|
|
171
|
+
* @param scopes oauth2 scope
|
|
172
|
+
*/
|
|
173
|
+
accessToken;
|
|
174
|
+
/**
|
|
175
|
+
* parameter for aws4 signature security
|
|
176
|
+
* @param {Object} AWS4Signature - AWS4 Signature security
|
|
177
|
+
* @param {string} options.region - aws region
|
|
178
|
+
* @param {string} options.service - name of the service.
|
|
179
|
+
* @param {string} credentials.accessKeyId - aws access key id
|
|
180
|
+
* @param {string} credentials.secretAccessKey - aws access key
|
|
181
|
+
* @param {string} credentials.sessionToken - aws session token
|
|
182
|
+
* @memberof Configuration
|
|
183
|
+
*/
|
|
184
|
+
awsv4;
|
|
185
|
+
/**
|
|
186
|
+
* override base path
|
|
187
|
+
*/
|
|
188
|
+
basePath;
|
|
189
|
+
/**
|
|
190
|
+
* override server index
|
|
191
|
+
*/
|
|
192
|
+
serverIndex;
|
|
193
|
+
/**
|
|
194
|
+
* base options for axios calls
|
|
195
|
+
*/
|
|
196
|
+
baseOptions;
|
|
197
|
+
/**
|
|
198
|
+
* The FormData constructor that will be used to create multipart form data
|
|
199
|
+
* requests. You can inject this here so that execution environments that
|
|
200
|
+
* do not support the FormData class can still run the generated client.
|
|
201
|
+
*
|
|
202
|
+
* @type {new () => FormData}
|
|
203
|
+
*/
|
|
204
|
+
formDataCtor;
|
|
205
|
+
constructor(param = {}) {
|
|
206
|
+
this.apiKey = param.apiKey;
|
|
207
|
+
this.username = param.username;
|
|
208
|
+
this.password = param.password;
|
|
209
|
+
this.accessToken = param.accessToken;
|
|
210
|
+
this.awsv4 = param.awsv4;
|
|
211
|
+
this.basePath = param.basePath;
|
|
212
|
+
this.serverIndex = param.serverIndex;
|
|
213
|
+
this.baseOptions = {
|
|
214
|
+
...param.baseOptions,
|
|
215
|
+
headers: { ...param.baseOptions?.headers }
|
|
216
|
+
};
|
|
217
|
+
this.formDataCtor = param.formDataCtor;
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* Check if the given MIME is a JSON MIME.
|
|
221
|
+
* JSON MIME examples:
|
|
222
|
+
* application/json
|
|
223
|
+
* application/json; charset=UTF8
|
|
224
|
+
* APPLICATION/JSON
|
|
225
|
+
* application/vnd.company+json
|
|
226
|
+
* @param mime - MIME (Multipurpose Internet Mail Extensions)
|
|
227
|
+
* @return True if the given MIME is JSON, false otherwise.
|
|
228
|
+
*/
|
|
229
|
+
isJsonMime(mime) {
|
|
230
|
+
return mime !== null && /^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$/i.test(mime);
|
|
231
|
+
}
|
|
253
232
|
};
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
233
|
+
//#endregion
|
|
234
|
+
//#region src/api-model/models/business-context.ts
|
|
235
|
+
const BusinessContextStoreNameEnum = { AmazonHaul: "AMAZON_HAUL" };
|
|
236
|
+
//#endregion
|
|
237
|
+
//#region src/api-model/models/item-related-identifier.ts
|
|
238
|
+
const ItemRelatedIdentifierItemRelatedIdentifierNameEnum = {
|
|
239
|
+
OrderAdjustmentItemId: "ORDER_ADJUSTMENT_ITEM_ID",
|
|
240
|
+
CouponId: "COUPON_ID",
|
|
241
|
+
RemovalShipmentItemId: "REMOVAL_SHIPMENT_ITEM_ID",
|
|
242
|
+
TransactionId: "TRANSACTION_ID"
|
|
261
243
|
};
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
244
|
+
//#endregion
|
|
245
|
+
//#region src/api-model/models/related-identifier.ts
|
|
246
|
+
const RelatedIdentifierRelatedIdentifierNameEnum = {
|
|
247
|
+
OrderId: "ORDER_ID",
|
|
248
|
+
ShipmentId: "SHIPMENT_ID",
|
|
249
|
+
FinancialEventGroupId: "FINANCIAL_EVENT_GROUP_ID",
|
|
250
|
+
RefundId: "REFUND_ID",
|
|
251
|
+
InvoiceId: "INVOICE_ID",
|
|
252
|
+
DisbursementId: "DISBURSEMENT_ID",
|
|
253
|
+
TransferId: "TRANSFER_ID",
|
|
254
|
+
DeferredTransactionId: "DEFERRED_TRANSACTION_ID",
|
|
255
|
+
ReleaseTransactionId: "RELEASE_TRANSACTION_ID",
|
|
256
|
+
SettlementId: "SETTLEMENT_ID"
|
|
275
257
|
};
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
burst: 10
|
|
285
|
-
}
|
|
286
|
-
];
|
|
258
|
+
//#endregion
|
|
259
|
+
//#region src/client.ts
|
|
260
|
+
const clientRateLimits = [{
|
|
261
|
+
method: "get",
|
|
262
|
+
urlRegex: /^\/finances\/2024\u{2D}06\u{2D}19\/transactions$/v,
|
|
263
|
+
rate: .5,
|
|
264
|
+
burst: 10
|
|
265
|
+
}];
|
|
287
266
|
var FinancesApiClient = class extends FinancesApi {
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
};
|
|
293
|
-
export {
|
|
294
|
-
BusinessContextStoreNameEnum,
|
|
295
|
-
FinancesApi,
|
|
296
|
-
FinancesApiAxiosParamCreator,
|
|
297
|
-
FinancesApiClient,
|
|
298
|
-
FinancesApiFactory,
|
|
299
|
-
FinancesApiFp,
|
|
300
|
-
ItemRelatedIdentifierItemRelatedIdentifierNameEnum,
|
|
301
|
-
RelatedIdentifierRelatedIdentifierNameEnum,
|
|
302
|
-
clientRateLimits
|
|
267
|
+
constructor(configuration) {
|
|
268
|
+
const { axios, endpoint } = createAxiosInstance(configuration, clientRateLimits);
|
|
269
|
+
super(new Configuration(), endpoint, axios);
|
|
270
|
+
}
|
|
303
271
|
};
|
|
272
|
+
//#endregion
|
|
273
|
+
export { BusinessContextStoreNameEnum, FinancesApi, FinancesApiAxiosParamCreator, FinancesApiClient, FinancesApiFactory, FinancesApiFp, ItemRelatedIdentifierItemRelatedIdentifierNameEnum, RelatedIdentifierRelatedIdentifierNameEnum, clientRateLimits };
|
|
274
|
+
|
|
304
275
|
//# sourceMappingURL=index.js.map
|