@sp-api-sdk/finances-api-v0 4.2.7 → 5.0.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 (187) hide show
  1. package/README.md +4 -4
  2. package/dist/index.cjs +550 -0
  3. package/dist/index.cjs.map +1 -0
  4. package/dist/index.d.cts +2281 -0
  5. package/dist/index.d.ts +2281 -0
  6. package/dist/{types/api-model/api/finances-api.d.ts → index.js} +409 -158
  7. package/dist/index.js.map +1 -0
  8. package/package.json +23 -12
  9. package/dist/cjs/api-model/api/finances-api.js +0 -365
  10. package/dist/cjs/api-model/api.js +0 -30
  11. package/dist/cjs/api-model/base.js +0 -52
  12. package/dist/cjs/api-model/common.js +0 -123
  13. package/dist/cjs/api-model/configuration.js +0 -98
  14. package/dist/cjs/api-model/index.js +0 -32
  15. package/dist/cjs/api-model/models/adhoc-disbursement-event.js +0 -15
  16. package/dist/cjs/api-model/models/adjustment-event.js +0 -15
  17. package/dist/cjs/api-model/models/adjustment-item.js +0 -15
  18. package/dist/cjs/api-model/models/affordability-expense-event.js +0 -15
  19. package/dist/cjs/api-model/models/capacity-reservation-billing-event.js +0 -15
  20. package/dist/cjs/api-model/models/charge-component.js +0 -15
  21. package/dist/cjs/api-model/models/charge-instrument.js +0 -15
  22. package/dist/cjs/api-model/models/charge-refund-event.js +0 -15
  23. package/dist/cjs/api-model/models/charge-refund-transaction.js +0 -15
  24. package/dist/cjs/api-model/models/coupon-payment-event.js +0 -15
  25. package/dist/cjs/api-model/models/currency.js +0 -15
  26. package/dist/cjs/api-model/models/debt-recovery-event.js +0 -15
  27. package/dist/cjs/api-model/models/debt-recovery-item.js +0 -15
  28. package/dist/cjs/api-model/models/direct-payment.js +0 -15
  29. package/dist/cjs/api-model/models/ebtrefund-reimbursement-only-event.js +0 -15
  30. package/dist/cjs/api-model/models/failed-adhoc-disbursement-event.js +0 -15
  31. package/dist/cjs/api-model/models/fbaliquidation-event.js +0 -15
  32. package/dist/cjs/api-model/models/fee-component.js +0 -15
  33. package/dist/cjs/api-model/models/financial-event-group.js +0 -15
  34. package/dist/cjs/api-model/models/financial-events.js +0 -15
  35. package/dist/cjs/api-model/models/imaging-services-fee-event.js +0 -15
  36. package/dist/cjs/api-model/models/index.js +0 -67
  37. package/dist/cjs/api-model/models/list-financial-event-groups-payload.js +0 -15
  38. package/dist/cjs/api-model/models/list-financial-event-groups-response.js +0 -15
  39. package/dist/cjs/api-model/models/list-financial-events-payload.js +0 -15
  40. package/dist/cjs/api-model/models/list-financial-events-response.js +0 -15
  41. package/dist/cjs/api-model/models/loan-servicing-event.js +0 -15
  42. package/dist/cjs/api-model/models/model-error.js +0 -15
  43. package/dist/cjs/api-model/models/network-commingling-transaction-event.js +0 -15
  44. package/dist/cjs/api-model/models/pay-with-amazon-event.js +0 -15
  45. package/dist/cjs/api-model/models/product-ads-payment-event.js +0 -15
  46. package/dist/cjs/api-model/models/promotion.js +0 -15
  47. package/dist/cjs/api-model/models/removal-shipment-adjustment-event.js +0 -15
  48. package/dist/cjs/api-model/models/removal-shipment-event.js +0 -15
  49. package/dist/cjs/api-model/models/removal-shipment-item-adjustment.js +0 -15
  50. package/dist/cjs/api-model/models/removal-shipment-item.js +0 -15
  51. package/dist/cjs/api-model/models/rental-transaction-event.js +0 -15
  52. package/dist/cjs/api-model/models/retrocharge-event.js +0 -15
  53. package/dist/cjs/api-model/models/safetreimbursement-event.js +0 -15
  54. package/dist/cjs/api-model/models/safetreimbursement-item.js +0 -15
  55. package/dist/cjs/api-model/models/seller-deal-payment-event.js +0 -15
  56. package/dist/cjs/api-model/models/seller-review-enrollment-payment-event.js +0 -15
  57. package/dist/cjs/api-model/models/service-fee-event.js +0 -15
  58. package/dist/cjs/api-model/models/shipment-event.js +0 -15
  59. package/dist/cjs/api-model/models/shipment-item.js +0 -15
  60. package/dist/cjs/api-model/models/solution-provider-credit-event.js +0 -15
  61. package/dist/cjs/api-model/models/tax-withheld-component.js +0 -15
  62. package/dist/cjs/api-model/models/tax-withholding-event.js +0 -15
  63. package/dist/cjs/api-model/models/tax-withholding-period.js +0 -15
  64. package/dist/cjs/api-model/models/tdsreimbursement-event.js +0 -15
  65. package/dist/cjs/api-model/models/trial-shipment-event.js +0 -15
  66. package/dist/cjs/api-model/models/value-added-service-charge-event.js +0 -15
  67. package/dist/cjs/client.js +0 -42
  68. package/dist/cjs/index.js +0 -18
  69. package/dist/es/api-model/api/finances-api.js +0 -355
  70. package/dist/es/api-model/api.js +0 -14
  71. package/dist/es/api-model/base.js +0 -44
  72. package/dist/es/api-model/common.js +0 -110
  73. package/dist/es/api-model/configuration.js +0 -94
  74. package/dist/es/api-model/index.js +0 -16
  75. package/dist/es/api-model/models/adhoc-disbursement-event.js +0 -14
  76. package/dist/es/api-model/models/adjustment-event.js +0 -14
  77. package/dist/es/api-model/models/adjustment-item.js +0 -14
  78. package/dist/es/api-model/models/affordability-expense-event.js +0 -14
  79. package/dist/es/api-model/models/capacity-reservation-billing-event.js +0 -14
  80. package/dist/es/api-model/models/charge-component.js +0 -14
  81. package/dist/es/api-model/models/charge-instrument.js +0 -14
  82. package/dist/es/api-model/models/charge-refund-event.js +0 -14
  83. package/dist/es/api-model/models/charge-refund-transaction.js +0 -14
  84. package/dist/es/api-model/models/coupon-payment-event.js +0 -14
  85. package/dist/es/api-model/models/currency.js +0 -14
  86. package/dist/es/api-model/models/debt-recovery-event.js +0 -14
  87. package/dist/es/api-model/models/debt-recovery-item.js +0 -14
  88. package/dist/es/api-model/models/direct-payment.js +0 -14
  89. package/dist/es/api-model/models/ebtrefund-reimbursement-only-event.js +0 -14
  90. package/dist/es/api-model/models/failed-adhoc-disbursement-event.js +0 -14
  91. package/dist/es/api-model/models/fbaliquidation-event.js +0 -14
  92. package/dist/es/api-model/models/fee-component.js +0 -14
  93. package/dist/es/api-model/models/financial-event-group.js +0 -14
  94. package/dist/es/api-model/models/financial-events.js +0 -14
  95. package/dist/es/api-model/models/imaging-services-fee-event.js +0 -14
  96. package/dist/es/api-model/models/index.js +0 -51
  97. package/dist/es/api-model/models/list-financial-event-groups-payload.js +0 -14
  98. package/dist/es/api-model/models/list-financial-event-groups-response.js +0 -14
  99. package/dist/es/api-model/models/list-financial-events-payload.js +0 -14
  100. package/dist/es/api-model/models/list-financial-events-response.js +0 -14
  101. package/dist/es/api-model/models/loan-servicing-event.js +0 -14
  102. package/dist/es/api-model/models/model-error.js +0 -14
  103. package/dist/es/api-model/models/network-commingling-transaction-event.js +0 -14
  104. package/dist/es/api-model/models/pay-with-amazon-event.js +0 -14
  105. package/dist/es/api-model/models/product-ads-payment-event.js +0 -14
  106. package/dist/es/api-model/models/promotion.js +0 -14
  107. package/dist/es/api-model/models/removal-shipment-adjustment-event.js +0 -14
  108. package/dist/es/api-model/models/removal-shipment-event.js +0 -14
  109. package/dist/es/api-model/models/removal-shipment-item-adjustment.js +0 -14
  110. package/dist/es/api-model/models/removal-shipment-item.js +0 -14
  111. package/dist/es/api-model/models/rental-transaction-event.js +0 -14
  112. package/dist/es/api-model/models/retrocharge-event.js +0 -14
  113. package/dist/es/api-model/models/safetreimbursement-event.js +0 -14
  114. package/dist/es/api-model/models/safetreimbursement-item.js +0 -14
  115. package/dist/es/api-model/models/seller-deal-payment-event.js +0 -14
  116. package/dist/es/api-model/models/seller-review-enrollment-payment-event.js +0 -14
  117. package/dist/es/api-model/models/service-fee-event.js +0 -14
  118. package/dist/es/api-model/models/shipment-event.js +0 -14
  119. package/dist/es/api-model/models/shipment-item.js +0 -14
  120. package/dist/es/api-model/models/solution-provider-credit-event.js +0 -14
  121. package/dist/es/api-model/models/tax-withheld-component.js +0 -14
  122. package/dist/es/api-model/models/tax-withholding-event.js +0 -14
  123. package/dist/es/api-model/models/tax-withholding-period.js +0 -14
  124. package/dist/es/api-model/models/tdsreimbursement-event.js +0 -14
  125. package/dist/es/api-model/models/trial-shipment-event.js +0 -14
  126. package/dist/es/api-model/models/value-added-service-charge-event.js +0 -14
  127. package/dist/es/client.js +0 -38
  128. package/dist/es/index.js +0 -2
  129. package/dist/types/api-model/api.d.ts +0 -12
  130. package/dist/types/api-model/base.d.ts +0 -42
  131. package/dist/types/api-model/common.d.ts +0 -34
  132. package/dist/types/api-model/configuration.d.ts +0 -98
  133. package/dist/types/api-model/index.d.ts +0 -14
  134. package/dist/types/api-model/models/adhoc-disbursement-event.d.ts +0 -30
  135. package/dist/types/api-model/models/adjustment-event.d.ts +0 -35
  136. package/dist/types/api-model/models/adjustment-item.d.ts +0 -43
  137. package/dist/types/api-model/models/affordability-expense-event.d.ts +0 -38
  138. package/dist/types/api-model/models/capacity-reservation-billing-event.d.ts +0 -30
  139. package/dist/types/api-model/models/charge-component.d.ts +0 -22
  140. package/dist/types/api-model/models/charge-instrument.d.ts +0 -26
  141. package/dist/types/api-model/models/charge-refund-event.d.ts +0 -33
  142. package/dist/types/api-model/models/charge-refund-transaction.d.ts +0 -22
  143. package/dist/types/api-model/models/coupon-payment-event.d.ts +0 -42
  144. package/dist/types/api-model/models/currency.d.ts +0 -24
  145. package/dist/types/api-model/models/debt-recovery-event.d.ts +0 -33
  146. package/dist/types/api-model/models/debt-recovery-item.d.ts +0 -27
  147. package/dist/types/api-model/models/direct-payment.d.ts +0 -22
  148. package/dist/types/api-model/models/ebtrefund-reimbursement-only-event.d.ts +0 -26
  149. package/dist/types/api-model/models/failed-adhoc-disbursement-event.d.ts +0 -42
  150. package/dist/types/api-model/models/fbaliquidation-event.d.ts +0 -27
  151. package/dist/types/api-model/models/fee-component.d.ts +0 -22
  152. package/dist/types/api-model/models/financial-event-group.d.ts +0 -52
  153. package/dist/types/api-model/models/financial-events.d.ts +0 -181
  154. package/dist/types/api-model/models/imaging-services-fee-event.d.ts +0 -33
  155. package/dist/types/api-model/models/index.d.ts +0 -51
  156. package/dist/types/api-model/models/list-financial-event-groups-payload.d.ts +0 -25
  157. package/dist/types/api-model/models/list-financial-event-groups-response.d.ts +0 -22
  158. package/dist/types/api-model/models/list-financial-events-payload.d.ts +0 -22
  159. package/dist/types/api-model/models/list-financial-events-response.d.ts +0 -22
  160. package/dist/types/api-model/models/loan-servicing-event.d.ts +0 -22
  161. package/dist/types/api-model/models/model-error.d.ts +0 -28
  162. package/dist/types/api-model/models/network-commingling-transaction-event.d.ts +0 -43
  163. package/dist/types/api-model/models/pay-with-amazon-event.d.ts +0 -55
  164. package/dist/types/api-model/models/product-ads-payment-event.d.ts +0 -32
  165. package/dist/types/api-model/models/promotion.d.ts +0 -26
  166. package/dist/types/api-model/models/removal-shipment-adjustment-event.d.ts +0 -41
  167. package/dist/types/api-model/models/removal-shipment-event.d.ts +0 -41
  168. package/dist/types/api-model/models/removal-shipment-item-adjustment.d.ts +0 -36
  169. package/dist/types/api-model/models/removal-shipment-item.d.ts +0 -37
  170. package/dist/types/api-model/models/rental-transaction-event.d.ts +0 -54
  171. package/dist/types/api-model/models/retrocharge-event.d.ts +0 -40
  172. package/dist/types/api-model/models/safetreimbursement-event.d.ts +0 -35
  173. package/dist/types/api-model/models/safetreimbursement-item.d.ts +0 -29
  174. package/dist/types/api-model/models/seller-deal-payment-event.d.ts +0 -40
  175. package/dist/types/api-model/models/seller-review-enrollment-payment-event.d.ts +0 -34
  176. package/dist/types/api-model/models/service-fee-event.d.ts +0 -49
  177. package/dist/types/api-model/models/shipment-event.d.ts +0 -76
  178. package/dist/types/api-model/models/shipment-item.d.ts +0 -67
  179. package/dist/types/api-model/models/solution-provider-credit-event.d.ts +0 -54
  180. package/dist/types/api-model/models/tax-withheld-component.d.ts +0 -25
  181. package/dist/types/api-model/models/tax-withholding-event.d.ts +0 -25
  182. package/dist/types/api-model/models/tax-withholding-period.d.ts +0 -24
  183. package/dist/types/api-model/models/tdsreimbursement-event.d.ts +0 -26
  184. package/dist/types/api-model/models/trial-shipment-event.d.ts +0 -37
  185. package/dist/types/api-model/models/value-added-service-charge-event.d.ts +0 -30
  186. package/dist/types/client.d.ts +0 -6
  187. package/dist/types/index.d.ts +0 -3
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # `finances-api-v0`
1
+ # `@sp-api-sdk/finances-api-v0`
2
2
 
3
3
  [![npm version](https://img.shields.io/npm/v/@sp-api-sdk/finances-api-v0)](https://www.npmjs.com/package/@sp-api-sdk/finances-api-v0)
4
4
  [![XO code style](https://img.shields.io/badge/code_style-xo-cyan)](https://github.com/xojs/xo)
@@ -25,10 +25,10 @@ npm install @sp-api-sdk/finances-api-v0
25
25
  import {SellingPartnerApiAuth} from '@sp-api-sdk/auth'
26
26
  import {FinancesApiClient} from '@sp-api-sdk/finances-api-v0'
27
27
 
28
+ // `clientId` and `clientSecret` default to the `LWA_CLIENT_ID` and
29
+ // `LWA_CLIENT_SECRET` environment variables.
28
30
  const auth = new SellingPartnerApiAuth({
29
- clientId: process.env.LWA_CLIENT_ID,
30
- clientSecret: process.env.LWA_CLIENT_SECRET,
31
- refreshToken: 'Atzr|…',
31
+ refreshToken: await getRefreshTokenForSeller(sellerId),
32
32
  })
33
33
 
34
34
  const client = new FinancesApiClient({
package/dist/index.cjs ADDED
@@ -0,0 +1,550 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // src/index.ts
31
+ var index_exports = {};
32
+ __export(index_exports, {
33
+ FinancesApi: () => FinancesApi,
34
+ FinancesApiAxiosParamCreator: () => FinancesApiAxiosParamCreator,
35
+ FinancesApiClient: () => FinancesApiClient,
36
+ FinancesApiFactory: () => FinancesApiFactory,
37
+ FinancesApiFp: () => FinancesApiFp,
38
+ clientRateLimits: () => clientRateLimits
39
+ });
40
+ module.exports = __toCommonJS(index_exports);
41
+
42
+ // src/client.ts
43
+ var import_common2 = require("@sp-api-sdk/common");
44
+
45
+ // src/api-model/api/finances-api.ts
46
+ var import_axios2 = __toESM(require("axios"), 1);
47
+
48
+ // src/api-model/base.ts
49
+ var import_axios = __toESM(require("axios"), 1);
50
+ var BASE_PATH = "https://sellingpartnerapi-na.amazon.com".replace(/\/+$/, "");
51
+ var BaseAPI = class {
52
+ constructor(configuration, basePath = BASE_PATH, axios = import_axios.default) {
53
+ this.basePath = basePath;
54
+ this.axios = axios;
55
+ if (configuration) {
56
+ this.configuration = configuration;
57
+ this.basePath = configuration.basePath ?? basePath;
58
+ }
59
+ }
60
+ basePath;
61
+ axios;
62
+ configuration;
63
+ };
64
+ var RequiredError = class extends Error {
65
+ constructor(field, msg) {
66
+ super(msg);
67
+ this.field = field;
68
+ this.name = "RequiredError";
69
+ }
70
+ field;
71
+ };
72
+ var operationServerMap = {};
73
+
74
+ // src/api-model/common.ts
75
+ var DUMMY_BASE_URL = "https://example.com";
76
+ var assertParamExists = function(functionName, paramName, paramValue) {
77
+ if (paramValue === null || paramValue === void 0) {
78
+ throw new RequiredError(paramName, `Required parameter ${paramName} was null or undefined when calling ${functionName}.`);
79
+ }
80
+ };
81
+ function setFlattenedQueryParams(urlSearchParams, parameter, key = "") {
82
+ if (parameter == null) return;
83
+ if (typeof parameter === "object") {
84
+ if (Array.isArray(parameter) || parameter instanceof Set) {
85
+ parameter.forEach((item) => setFlattenedQueryParams(urlSearchParams, item, key));
86
+ } else {
87
+ Object.keys(parameter).forEach(
88
+ (currentKey) => setFlattenedQueryParams(urlSearchParams, parameter[currentKey], `${key}${key !== "" ? "." : ""}${currentKey}`)
89
+ );
90
+ }
91
+ } else {
92
+ if (urlSearchParams.has(key)) {
93
+ urlSearchParams.append(key, parameter);
94
+ } else {
95
+ urlSearchParams.set(key, parameter);
96
+ }
97
+ }
98
+ }
99
+ var setSearchParams = function(url, ...objects) {
100
+ const searchParams = new URLSearchParams(url.search);
101
+ setFlattenedQueryParams(searchParams, objects);
102
+ url.search = searchParams.toString();
103
+ };
104
+ var toPathString = function(url) {
105
+ return url.pathname + url.search + url.hash;
106
+ };
107
+ var createRequestFunction = function(axiosArgs, globalAxios3, BASE_PATH2, configuration) {
108
+ return (axios = globalAxios3, basePath = BASE_PATH2) => {
109
+ const axiosRequestArgs = { ...axiosArgs.options, url: (axios.defaults.baseURL ? "" : configuration?.basePath ?? basePath) + axiosArgs.url };
110
+ return axios.request(axiosRequestArgs);
111
+ };
112
+ };
113
+
114
+ // src/api-model/api/finances-api.ts
115
+ var FinancesApiAxiosParamCreator = function(configuration) {
116
+ return {
117
+ /**
118
+ * Returns financial event groups for a given date range. Orders from the last 48 hours might not be included in financial events. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.5 | 30 | 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 can 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).
119
+ * @param {number} [maxResultsPerPage] The maximum number of results per page. If the response exceeds the maximum number of transactions or 10 MB, the response is `InvalidInput`.
120
+ * @param {string} [financialEventGroupStartedBefore] A date that selects financial event groups that opened before (but not at) a specified date and time, in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format. The date-time must be after `FinancialEventGroupStartedAfter` and more than two minutes before the time of request. If `FinancialEventGroupStartedAfter` and `FinancialEventGroupStartedBefore` are more than 180 days apart, no financial event groups are returned.
121
+ * @param {string} [financialEventGroupStartedAfter] A date that selects financial event groups that opened after (or at) a specified date and time, in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format. The date-time must be more than two minutes before you submit the request.
122
+ * @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.
123
+ * @param {*} [options] Override http request option.
124
+ * @throws {RequiredError}
125
+ */
126
+ listFinancialEventGroups: async (maxResultsPerPage, financialEventGroupStartedBefore, financialEventGroupStartedAfter, nextToken, options = {}) => {
127
+ const localVarPath = `/finances/v0/financialEventGroups`;
128
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
129
+ let baseOptions;
130
+ if (configuration) {
131
+ baseOptions = configuration.baseOptions;
132
+ }
133
+ const localVarRequestOptions = { method: "GET", ...baseOptions, ...options };
134
+ const localVarHeaderParameter = {};
135
+ const localVarQueryParameter = {};
136
+ if (maxResultsPerPage !== void 0) {
137
+ localVarQueryParameter["MaxResultsPerPage"] = maxResultsPerPage;
138
+ }
139
+ if (financialEventGroupStartedBefore !== void 0) {
140
+ localVarQueryParameter["FinancialEventGroupStartedBefore"] = financialEventGroupStartedBefore instanceof Date ? financialEventGroupStartedBefore.toISOString() : financialEventGroupStartedBefore;
141
+ }
142
+ if (financialEventGroupStartedAfter !== void 0) {
143
+ localVarQueryParameter["FinancialEventGroupStartedAfter"] = financialEventGroupStartedAfter instanceof Date ? financialEventGroupStartedAfter.toISOString() : financialEventGroupStartedAfter;
144
+ }
145
+ if (nextToken !== void 0) {
146
+ localVarQueryParameter["NextToken"] = nextToken;
147
+ }
148
+ localVarHeaderParameter["Accept"] = "application/json";
149
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
150
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
151
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
152
+ return {
153
+ url: toPathString(localVarUrlObj),
154
+ options: localVarRequestOptions
155
+ };
156
+ },
157
+ /**
158
+ * Returns financial events for the specified data range. Orders from the last 48 hours might not be included in financial events. **Note:** in `ListFinancialEvents`, deferred events don\'t show up in responses until they are released. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.5 | 30 | 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 can 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).
159
+ * @param {number} [maxResultsPerPage] The maximum number of results to return per page. If the response exceeds the maximum number of transactions or 10 MB, the response is `InvalidInput`.
160
+ * @param {string} [postedAfter] The response includes financial events posted after (or 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 more than two minutes before the time of the request.
161
+ * @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. If you include the `PostedBefore` parameter in your request, you must also specify the `PostedAfter` parameter. **Default:** Two minutes before the time of the request.
162
+ * @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.
163
+ * @param {*} [options] Override http request option.
164
+ * @throws {RequiredError}
165
+ */
166
+ listFinancialEvents: async (maxResultsPerPage, postedAfter, postedBefore, nextToken, options = {}) => {
167
+ const localVarPath = `/finances/v0/financialEvents`;
168
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
169
+ let baseOptions;
170
+ if (configuration) {
171
+ baseOptions = configuration.baseOptions;
172
+ }
173
+ const localVarRequestOptions = { method: "GET", ...baseOptions, ...options };
174
+ const localVarHeaderParameter = {};
175
+ const localVarQueryParameter = {};
176
+ if (maxResultsPerPage !== void 0) {
177
+ localVarQueryParameter["MaxResultsPerPage"] = maxResultsPerPage;
178
+ }
179
+ if (postedAfter !== void 0) {
180
+ localVarQueryParameter["PostedAfter"] = postedAfter instanceof Date ? postedAfter.toISOString() : postedAfter;
181
+ }
182
+ if (postedBefore !== void 0) {
183
+ localVarQueryParameter["PostedBefore"] = postedBefore instanceof Date ? postedBefore.toISOString() : postedBefore;
184
+ }
185
+ if (nextToken !== void 0) {
186
+ localVarQueryParameter["NextToken"] = nextToken;
187
+ }
188
+ localVarHeaderParameter["Accept"] = "application/json";
189
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
190
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
191
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
192
+ return {
193
+ url: toPathString(localVarUrlObj),
194
+ options: localVarRequestOptions
195
+ };
196
+ },
197
+ /**
198
+ * Returns all financial events for the specified financial event group. Orders from the last 48 hours might not be included in financial events. **Note:** This operation only retrieves a group\'s data for the past two years. A request for data spanning more than two years produces an empty response. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.5 | 30 | 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 can 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).
199
+ * @param {string} eventGroupId The identifier of the financial event group to which the events belong.
200
+ * @param {number} [maxResultsPerPage] The maximum number of results to return per page. If the response exceeds the maximum number of transactions or 10 MB, the response is `InvalidInput`.
201
+ * @param {string} [postedAfter] The response includes financial events posted after (or 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 more than two minutes before the time of the request.
202
+ * @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. If you include the `PostedBefore` parameter in your request, you must also specify the `PostedAfter` parameter. **Default:** Two minutes before the time of the request.
203
+ * @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.
204
+ * @param {*} [options] Override http request option.
205
+ * @throws {RequiredError}
206
+ */
207
+ listFinancialEventsByGroupId: async (eventGroupId, maxResultsPerPage, postedAfter, postedBefore, nextToken, options = {}) => {
208
+ assertParamExists("listFinancialEventsByGroupId", "eventGroupId", eventGroupId);
209
+ const localVarPath = `/finances/v0/financialEventGroups/{eventGroupId}/financialEvents`.replace("{eventGroupId}", encodeURIComponent(String(eventGroupId)));
210
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
211
+ let baseOptions;
212
+ if (configuration) {
213
+ baseOptions = configuration.baseOptions;
214
+ }
215
+ const localVarRequestOptions = { method: "GET", ...baseOptions, ...options };
216
+ const localVarHeaderParameter = {};
217
+ const localVarQueryParameter = {};
218
+ if (maxResultsPerPage !== void 0) {
219
+ localVarQueryParameter["MaxResultsPerPage"] = maxResultsPerPage;
220
+ }
221
+ if (postedAfter !== void 0) {
222
+ localVarQueryParameter["PostedAfter"] = postedAfter instanceof Date ? postedAfter.toISOString() : postedAfter;
223
+ }
224
+ if (postedBefore !== void 0) {
225
+ localVarQueryParameter["PostedBefore"] = postedBefore instanceof Date ? postedBefore.toISOString() : postedBefore;
226
+ }
227
+ if (nextToken !== void 0) {
228
+ localVarQueryParameter["NextToken"] = nextToken;
229
+ }
230
+ localVarHeaderParameter["Accept"] = "application/json";
231
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
232
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
233
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
234
+ return {
235
+ url: toPathString(localVarUrlObj),
236
+ options: localVarRequestOptions
237
+ };
238
+ },
239
+ /**
240
+ * Returns all financial events for the specified order. Orders from the last 48 hours might not be included in financial events. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.5 | 30 | 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 can 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).
241
+ * @param {string} orderId An Amazon-defined order identifier, in 3-7-7 format.
242
+ * @param {number} [maxResultsPerPage] The maximum number of results to return per page. If the response exceeds the maximum number of transactions or 10 MB, the response is `InvalidInput`.
243
+ * @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.
244
+ * @param {*} [options] Override http request option.
245
+ * @throws {RequiredError}
246
+ */
247
+ listFinancialEventsByOrderId: async (orderId, maxResultsPerPage, nextToken, options = {}) => {
248
+ assertParamExists("listFinancialEventsByOrderId", "orderId", orderId);
249
+ const localVarPath = `/finances/v0/orders/{orderId}/financialEvents`.replace("{orderId}", encodeURIComponent(String(orderId)));
250
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
251
+ let baseOptions;
252
+ if (configuration) {
253
+ baseOptions = configuration.baseOptions;
254
+ }
255
+ const localVarRequestOptions = { method: "GET", ...baseOptions, ...options };
256
+ const localVarHeaderParameter = {};
257
+ const localVarQueryParameter = {};
258
+ if (maxResultsPerPage !== void 0) {
259
+ localVarQueryParameter["MaxResultsPerPage"] = maxResultsPerPage;
260
+ }
261
+ if (nextToken !== void 0) {
262
+ localVarQueryParameter["NextToken"] = nextToken;
263
+ }
264
+ localVarHeaderParameter["Accept"] = "application/json";
265
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
266
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
267
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
268
+ return {
269
+ url: toPathString(localVarUrlObj),
270
+ options: localVarRequestOptions
271
+ };
272
+ }
273
+ };
274
+ };
275
+ var FinancesApiFp = function(configuration) {
276
+ const localVarAxiosParamCreator = FinancesApiAxiosParamCreator(configuration);
277
+ return {
278
+ /**
279
+ * Returns financial event groups for a given date range. Orders from the last 48 hours might not be included in financial events. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.5 | 30 | 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 can 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).
280
+ * @param {number} [maxResultsPerPage] The maximum number of results per page. If the response exceeds the maximum number of transactions or 10 MB, the response is `InvalidInput`.
281
+ * @param {string} [financialEventGroupStartedBefore] A date that selects financial event groups that opened before (but not at) a specified date and time, in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format. The date-time must be after `FinancialEventGroupStartedAfter` and more than two minutes before the time of request. If `FinancialEventGroupStartedAfter` and `FinancialEventGroupStartedBefore` are more than 180 days apart, no financial event groups are returned.
282
+ * @param {string} [financialEventGroupStartedAfter] A date that selects financial event groups that opened after (or at) a specified date and time, in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format. The date-time must be more than two minutes before you submit the request.
283
+ * @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.
284
+ * @param {*} [options] Override http request option.
285
+ * @throws {RequiredError}
286
+ */
287
+ async listFinancialEventGroups(maxResultsPerPage, financialEventGroupStartedBefore, financialEventGroupStartedAfter, nextToken, options) {
288
+ const localVarAxiosArgs = await localVarAxiosParamCreator.listFinancialEventGroups(maxResultsPerPage, financialEventGroupStartedBefore, financialEventGroupStartedAfter, nextToken, options);
289
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
290
+ const localVarOperationServerBasePath = operationServerMap["FinancesApi.listFinancialEventGroups"]?.[localVarOperationServerIndex]?.url;
291
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, import_axios2.default, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
292
+ },
293
+ /**
294
+ * Returns financial events for the specified data range. Orders from the last 48 hours might not be included in financial events. **Note:** in `ListFinancialEvents`, deferred events don\'t show up in responses until they are released. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.5 | 30 | 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 can 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).
295
+ * @param {number} [maxResultsPerPage] The maximum number of results to return per page. If the response exceeds the maximum number of transactions or 10 MB, the response is `InvalidInput`.
296
+ * @param {string} [postedAfter] The response includes financial events posted after (or 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 more than two minutes before the time of the request.
297
+ * @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. If you include the `PostedBefore` parameter in your request, you must also specify the `PostedAfter` parameter. **Default:** Two minutes before the time of the request.
298
+ * @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.
299
+ * @param {*} [options] Override http request option.
300
+ * @throws {RequiredError}
301
+ */
302
+ async listFinancialEvents(maxResultsPerPage, postedAfter, postedBefore, nextToken, options) {
303
+ const localVarAxiosArgs = await localVarAxiosParamCreator.listFinancialEvents(maxResultsPerPage, postedAfter, postedBefore, nextToken, options);
304
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
305
+ const localVarOperationServerBasePath = operationServerMap["FinancesApi.listFinancialEvents"]?.[localVarOperationServerIndex]?.url;
306
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, import_axios2.default, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
307
+ },
308
+ /**
309
+ * Returns all financial events for the specified financial event group. Orders from the last 48 hours might not be included in financial events. **Note:** This operation only retrieves a group\'s data for the past two years. A request for data spanning more than two years produces an empty response. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.5 | 30 | 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 can 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).
310
+ * @param {string} eventGroupId The identifier of the financial event group to which the events belong.
311
+ * @param {number} [maxResultsPerPage] The maximum number of results to return per page. If the response exceeds the maximum number of transactions or 10 MB, the response is `InvalidInput`.
312
+ * @param {string} [postedAfter] The response includes financial events posted after (or 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 more than two minutes before the time of the request.
313
+ * @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. If you include the `PostedBefore` parameter in your request, you must also specify the `PostedAfter` parameter. **Default:** Two minutes before the time of the request.
314
+ * @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.
315
+ * @param {*} [options] Override http request option.
316
+ * @throws {RequiredError}
317
+ */
318
+ async listFinancialEventsByGroupId(eventGroupId, maxResultsPerPage, postedAfter, postedBefore, nextToken, options) {
319
+ const localVarAxiosArgs = await localVarAxiosParamCreator.listFinancialEventsByGroupId(eventGroupId, maxResultsPerPage, postedAfter, postedBefore, nextToken, options);
320
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
321
+ const localVarOperationServerBasePath = operationServerMap["FinancesApi.listFinancialEventsByGroupId"]?.[localVarOperationServerIndex]?.url;
322
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, import_axios2.default, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
323
+ },
324
+ /**
325
+ * Returns all financial events for the specified order. Orders from the last 48 hours might not be included in financial events. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.5 | 30 | 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 can 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).
326
+ * @param {string} orderId An Amazon-defined order identifier, in 3-7-7 format.
327
+ * @param {number} [maxResultsPerPage] The maximum number of results to return per page. If the response exceeds the maximum number of transactions or 10 MB, the response is `InvalidInput`.
328
+ * @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.
329
+ * @param {*} [options] Override http request option.
330
+ * @throws {RequiredError}
331
+ */
332
+ async listFinancialEventsByOrderId(orderId, maxResultsPerPage, nextToken, options) {
333
+ const localVarAxiosArgs = await localVarAxiosParamCreator.listFinancialEventsByOrderId(orderId, maxResultsPerPage, nextToken, options);
334
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
335
+ const localVarOperationServerBasePath = operationServerMap["FinancesApi.listFinancialEventsByOrderId"]?.[localVarOperationServerIndex]?.url;
336
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, import_axios2.default, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
337
+ }
338
+ };
339
+ };
340
+ var FinancesApiFactory = function(configuration, basePath, axios) {
341
+ const localVarFp = FinancesApiFp(configuration);
342
+ return {
343
+ /**
344
+ * Returns financial event groups for a given date range. Orders from the last 48 hours might not be included in financial events. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.5 | 30 | 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 can 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).
345
+ * @param {FinancesApiListFinancialEventGroupsRequest} requestParameters Request parameters.
346
+ * @param {*} [options] Override http request option.
347
+ * @throws {RequiredError}
348
+ */
349
+ listFinancialEventGroups(requestParameters = {}, options) {
350
+ return localVarFp.listFinancialEventGroups(requestParameters.maxResultsPerPage, requestParameters.financialEventGroupStartedBefore, requestParameters.financialEventGroupStartedAfter, requestParameters.nextToken, options).then((request) => request(axios, basePath));
351
+ },
352
+ /**
353
+ * Returns financial events for the specified data range. Orders from the last 48 hours might not be included in financial events. **Note:** in `ListFinancialEvents`, deferred events don\'t show up in responses until they are released. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.5 | 30 | 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 can 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).
354
+ * @param {FinancesApiListFinancialEventsRequest} requestParameters Request parameters.
355
+ * @param {*} [options] Override http request option.
356
+ * @throws {RequiredError}
357
+ */
358
+ listFinancialEvents(requestParameters = {}, options) {
359
+ return localVarFp.listFinancialEvents(requestParameters.maxResultsPerPage, requestParameters.postedAfter, requestParameters.postedBefore, requestParameters.nextToken, options).then((request) => request(axios, basePath));
360
+ },
361
+ /**
362
+ * Returns all financial events for the specified financial event group. Orders from the last 48 hours might not be included in financial events. **Note:** This operation only retrieves a group\'s data for the past two years. A request for data spanning more than two years produces an empty response. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.5 | 30 | 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 can 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).
363
+ * @param {FinancesApiListFinancialEventsByGroupIdRequest} requestParameters Request parameters.
364
+ * @param {*} [options] Override http request option.
365
+ * @throws {RequiredError}
366
+ */
367
+ listFinancialEventsByGroupId(requestParameters, options) {
368
+ return localVarFp.listFinancialEventsByGroupId(requestParameters.eventGroupId, requestParameters.maxResultsPerPage, requestParameters.postedAfter, requestParameters.postedBefore, requestParameters.nextToken, options).then((request) => request(axios, basePath));
369
+ },
370
+ /**
371
+ * Returns all financial events for the specified order. Orders from the last 48 hours might not be included in financial events. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.5 | 30 | 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 can 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).
372
+ * @param {FinancesApiListFinancialEventsByOrderIdRequest} requestParameters Request parameters.
373
+ * @param {*} [options] Override http request option.
374
+ * @throws {RequiredError}
375
+ */
376
+ listFinancialEventsByOrderId(requestParameters, options) {
377
+ return localVarFp.listFinancialEventsByOrderId(requestParameters.orderId, requestParameters.maxResultsPerPage, requestParameters.nextToken, options).then((request) => request(axios, basePath));
378
+ }
379
+ };
380
+ };
381
+ var FinancesApi = class extends BaseAPI {
382
+ /**
383
+ * Returns financial event groups for a given date range. Orders from the last 48 hours might not be included in financial events. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.5 | 30 | 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 can 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).
384
+ * @param {FinancesApiListFinancialEventGroupsRequest} requestParameters Request parameters.
385
+ * @param {*} [options] Override http request option.
386
+ * @throws {RequiredError}
387
+ */
388
+ listFinancialEventGroups(requestParameters = {}, options) {
389
+ return FinancesApiFp(this.configuration).listFinancialEventGroups(requestParameters.maxResultsPerPage, requestParameters.financialEventGroupStartedBefore, requestParameters.financialEventGroupStartedAfter, requestParameters.nextToken, options).then((request) => request(this.axios, this.basePath));
390
+ }
391
+ /**
392
+ * Returns financial events for the specified data range. Orders from the last 48 hours might not be included in financial events. **Note:** in `ListFinancialEvents`, deferred events don\'t show up in responses until they are released. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.5 | 30 | 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 can 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).
393
+ * @param {FinancesApiListFinancialEventsRequest} requestParameters Request parameters.
394
+ * @param {*} [options] Override http request option.
395
+ * @throws {RequiredError}
396
+ */
397
+ listFinancialEvents(requestParameters = {}, options) {
398
+ return FinancesApiFp(this.configuration).listFinancialEvents(requestParameters.maxResultsPerPage, requestParameters.postedAfter, requestParameters.postedBefore, requestParameters.nextToken, options).then((request) => request(this.axios, this.basePath));
399
+ }
400
+ /**
401
+ * Returns all financial events for the specified financial event group. Orders from the last 48 hours might not be included in financial events. **Note:** This operation only retrieves a group\'s data for the past two years. A request for data spanning more than two years produces an empty response. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.5 | 30 | 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 can 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).
402
+ * @param {FinancesApiListFinancialEventsByGroupIdRequest} requestParameters Request parameters.
403
+ * @param {*} [options] Override http request option.
404
+ * @throws {RequiredError}
405
+ */
406
+ listFinancialEventsByGroupId(requestParameters, options) {
407
+ return FinancesApiFp(this.configuration).listFinancialEventsByGroupId(requestParameters.eventGroupId, requestParameters.maxResultsPerPage, requestParameters.postedAfter, requestParameters.postedBefore, requestParameters.nextToken, options).then((request) => request(this.axios, this.basePath));
408
+ }
409
+ /**
410
+ * Returns all financial events for the specified order. Orders from the last 48 hours might not be included in financial events. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.5 | 30 | 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 can 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).
411
+ * @param {FinancesApiListFinancialEventsByOrderIdRequest} requestParameters Request parameters.
412
+ * @param {*} [options] Override http request option.
413
+ * @throws {RequiredError}
414
+ */
415
+ listFinancialEventsByOrderId(requestParameters, options) {
416
+ return FinancesApiFp(this.configuration).listFinancialEventsByOrderId(requestParameters.orderId, requestParameters.maxResultsPerPage, requestParameters.nextToken, options).then((request) => request(this.axios, this.basePath));
417
+ }
418
+ };
419
+
420
+ // src/api-model/configuration.ts
421
+ var Configuration = class {
422
+ /**
423
+ * parameter for apiKey security
424
+ * @param name security name
425
+ */
426
+ apiKey;
427
+ /**
428
+ * parameter for basic security
429
+ */
430
+ username;
431
+ /**
432
+ * parameter for basic security
433
+ */
434
+ password;
435
+ /**
436
+ * parameter for oauth2 security
437
+ * @param name security name
438
+ * @param scopes oauth2 scope
439
+ */
440
+ accessToken;
441
+ /**
442
+ * parameter for aws4 signature security
443
+ * @param {Object} AWS4Signature - AWS4 Signature security
444
+ * @param {string} options.region - aws region
445
+ * @param {string} options.service - name of the service.
446
+ * @param {string} credentials.accessKeyId - aws access key id
447
+ * @param {string} credentials.secretAccessKey - aws access key
448
+ * @param {string} credentials.sessionToken - aws session token
449
+ * @memberof Configuration
450
+ */
451
+ awsv4;
452
+ /**
453
+ * override base path
454
+ */
455
+ basePath;
456
+ /**
457
+ * override server index
458
+ */
459
+ serverIndex;
460
+ /**
461
+ * base options for axios calls
462
+ */
463
+ baseOptions;
464
+ /**
465
+ * The FormData constructor that will be used to create multipart form data
466
+ * requests. You can inject this here so that execution environments that
467
+ * do not support the FormData class can still run the generated client.
468
+ *
469
+ * @type {new () => FormData}
470
+ */
471
+ formDataCtor;
472
+ constructor(param = {}) {
473
+ this.apiKey = param.apiKey;
474
+ this.username = param.username;
475
+ this.password = param.password;
476
+ this.accessToken = param.accessToken;
477
+ this.awsv4 = param.awsv4;
478
+ this.basePath = param.basePath;
479
+ this.serverIndex = param.serverIndex;
480
+ this.baseOptions = {
481
+ ...param.baseOptions,
482
+ headers: {
483
+ ...param.baseOptions?.headers
484
+ }
485
+ };
486
+ this.formDataCtor = param.formDataCtor;
487
+ }
488
+ /**
489
+ * Check if the given MIME is a JSON MIME.
490
+ * JSON MIME examples:
491
+ * application/json
492
+ * application/json; charset=UTF8
493
+ * APPLICATION/JSON
494
+ * application/vnd.company+json
495
+ * @param mime - MIME (Multipurpose Internet Mail Extensions)
496
+ * @return True if the given MIME is JSON, false otherwise.
497
+ */
498
+ isJsonMime(mime) {
499
+ const jsonMime = /^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$/i;
500
+ return mime !== null && jsonMime.test(mime);
501
+ }
502
+ };
503
+
504
+ // src/client.ts
505
+ var clientRateLimits = [
506
+ {
507
+ method: "get",
508
+ // eslint-disable-next-line prefer-regex-literals
509
+ urlRegex: new RegExp("^/finances/v0/financialEventGroups$"),
510
+ rate: 0.5,
511
+ burst: 30
512
+ },
513
+ {
514
+ method: "get",
515
+ // eslint-disable-next-line prefer-regex-literals
516
+ urlRegex: new RegExp("^/finances/v0/financialEventGroups/[^/]*/financialEvents$"),
517
+ rate: 0.5,
518
+ burst: 30
519
+ },
520
+ {
521
+ method: "get",
522
+ // eslint-disable-next-line prefer-regex-literals
523
+ urlRegex: new RegExp("^/finances/v0/orders/[^/]*/financialEvents$"),
524
+ rate: 0.5,
525
+ burst: 30
526
+ },
527
+ {
528
+ method: "get",
529
+ // eslint-disable-next-line prefer-regex-literals
530
+ urlRegex: new RegExp("^/finances/v0/financialEvents$"),
531
+ rate: 0.5,
532
+ burst: 30
533
+ }
534
+ ];
535
+ var FinancesApiClient = class extends FinancesApi {
536
+ constructor(configuration) {
537
+ const { axios, endpoint } = (0, import_common2.createAxiosInstance)(configuration, clientRateLimits);
538
+ super(new Configuration(), endpoint, axios);
539
+ }
540
+ };
541
+ // Annotate the CommonJS export names for ESM import in node:
542
+ 0 && (module.exports = {
543
+ FinancesApi,
544
+ FinancesApiAxiosParamCreator,
545
+ FinancesApiClient,
546
+ FinancesApiFactory,
547
+ FinancesApiFp,
548
+ clientRateLimits
549
+ });
550
+ //# sourceMappingURL=index.cjs.map