@astrada.co/ts-astrada-sdk 1.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 (200) hide show
  1. package/.editorconfig +10 -0
  2. package/.github/workflows/on-push.yml +65 -0
  3. package/.releaserc +21 -0
  4. package/CHANGELOG.md +13 -0
  5. package/README.md +1 -0
  6. package/dist/astrada.co-ts-astrada-sdk-1.0.0.tgz +0 -0
  7. package/lib/apis/CardApi.d.ts +57 -0
  8. package/lib/apis/CardApi.js +109 -0
  9. package/lib/apis/CardSubscriptionApi.d.ts +61 -0
  10. package/lib/apis/CardSubscriptionApi.js +133 -0
  11. package/lib/apis/CardholderApi.d.ts +31 -0
  12. package/lib/apis/CardholderApi.js +56 -0
  13. package/lib/apis/EnrollmentMethodsApi.d.ts +31 -0
  14. package/lib/apis/EnrollmentMethodsApi.js +57 -0
  15. package/lib/apis/NetworkBulkFeedsApi.d.ts +60 -0
  16. package/lib/apis/NetworkBulkFeedsApi.js +129 -0
  17. package/lib/apis/SubaccountsApi.d.ts +72 -0
  18. package/lib/apis/SubaccountsApi.js +157 -0
  19. package/lib/apis/TransactionMessagesApi.d.ts +31 -0
  20. package/lib/apis/TransactionMessagesApi.js +56 -0
  21. package/lib/apis/TransactionsApi.d.ts +56 -0
  22. package/lib/apis/TransactionsApi.js +106 -0
  23. package/lib/apis/WebhooksApi.d.ts +86 -0
  24. package/lib/apis/WebhooksApi.js +194 -0
  25. package/lib/apis/index.d.ts +9 -0
  26. package/lib/apis/index.js +27 -0
  27. package/lib/index.d.ts +3 -0
  28. package/lib/index.js +21 -0
  29. package/lib/models/Card.d.ts +112 -0
  30. package/lib/models/Card.js +109 -0
  31. package/lib/models/CardLinks.d.ts +39 -0
  32. package/lib/models/CardLinks.js +53 -0
  33. package/lib/models/CardSubscription.d.ts +118 -0
  34. package/lib/models/CardSubscription.js +109 -0
  35. package/lib/models/CardSubscriptionLinks.d.ts +45 -0
  36. package/lib/models/CardSubscriptionLinks.js +57 -0
  37. package/lib/models/Cardholder.d.ts +64 -0
  38. package/lib/models/Cardholder.js +68 -0
  39. package/lib/models/CardholderCorporate.d.ts +38 -0
  40. package/lib/models/CardholderCorporate.js +50 -0
  41. package/lib/models/CardholderLinks.d.ts +33 -0
  42. package/lib/models/CardholderLinks.js +51 -0
  43. package/lib/models/Conflict.d.ts +57 -0
  44. package/lib/models/Conflict.js +67 -0
  45. package/lib/models/CreateNetworkBulkFeedRequest.d.ts +52 -0
  46. package/lib/models/CreateNetworkBulkFeedRequest.js +66 -0
  47. package/lib/models/CreateSubaccountRequest.d.ts +39 -0
  48. package/lib/models/CreateSubaccountRequest.js +55 -0
  49. package/lib/models/CreateWebhook201Response.d.ts +98 -0
  50. package/lib/models/CreateWebhook201Response.js +96 -0
  51. package/lib/models/CreateWebhookRequest.d.ts +67 -0
  52. package/lib/models/CreateWebhookRequest.js +73 -0
  53. package/lib/models/EnrollmentMethods200Response.d.ts +40 -0
  54. package/lib/models/EnrollmentMethods200Response.js +58 -0
  55. package/lib/models/EnrollmentMethodsRequest.d.ts +32 -0
  56. package/lib/models/EnrollmentMethodsRequest.js +50 -0
  57. package/lib/models/GetSubaccounts200Response.d.ts +40 -0
  58. package/lib/models/GetSubaccounts200Response.js +56 -0
  59. package/lib/models/GetSubaccounts200ResponseEmbedded.d.ts +33 -0
  60. package/lib/models/GetSubaccounts200ResponseEmbedded.js +51 -0
  61. package/lib/models/GetSubaccounts200ResponseLinks.d.ts +39 -0
  62. package/lib/models/GetSubaccounts200ResponseLinks.js +53 -0
  63. package/lib/models/GetTransactions200Response.d.ts +40 -0
  64. package/lib/models/GetTransactions200Response.js +56 -0
  65. package/lib/models/GetTransactions200ResponseEmbedded.d.ts +33 -0
  66. package/lib/models/GetTransactions200ResponseEmbedded.js +51 -0
  67. package/lib/models/InlineObject.d.ts +52 -0
  68. package/lib/models/InlineObject.js +64 -0
  69. package/lib/models/InlineObject1.d.ts +45 -0
  70. package/lib/models/InlineObject1.js +61 -0
  71. package/lib/models/InlineObject2.d.ts +45 -0
  72. package/lib/models/InlineObject2.js +61 -0
  73. package/lib/models/InlineObject3.d.ts +45 -0
  74. package/lib/models/InlineObject3.js +61 -0
  75. package/lib/models/InlineObject4.d.ts +57 -0
  76. package/lib/models/InlineObject4.js +65 -0
  77. package/lib/models/InlineObject5.d.ts +45 -0
  78. package/lib/models/InlineObject5.js +61 -0
  79. package/lib/models/InlineObjectErrorsInner.d.ts +38 -0
  80. package/lib/models/InlineObjectErrorsInner.js +54 -0
  81. package/lib/models/Link.d.ts +74 -0
  82. package/lib/models/Link.js +64 -0
  83. package/lib/models/ListCardSubscriptions200Response.d.ts +46 -0
  84. package/lib/models/ListCardSubscriptions200Response.js +60 -0
  85. package/lib/models/ListCardSubscriptions200ResponseEmbedded.d.ts +33 -0
  86. package/lib/models/ListCardSubscriptions200ResponseEmbedded.js +51 -0
  87. package/lib/models/ListCardSubscriptions200ResponseLinks.d.ts +57 -0
  88. package/lib/models/ListCardSubscriptions200ResponseLinks.js +59 -0
  89. package/lib/models/ListCards200Response.d.ts +46 -0
  90. package/lib/models/ListCards200Response.js +60 -0
  91. package/lib/models/ListCards200ResponseEmbedded.d.ts +33 -0
  92. package/lib/models/ListCards200ResponseEmbedded.js +51 -0
  93. package/lib/models/ListNetworkBulkFeeds200Response.d.ts +46 -0
  94. package/lib/models/ListNetworkBulkFeeds200Response.js +60 -0
  95. package/lib/models/ListNetworkBulkFeeds200ResponseEmbedded.d.ts +33 -0
  96. package/lib/models/ListNetworkBulkFeeds200ResponseEmbedded.js +51 -0
  97. package/lib/models/ListWebhooks200Response.d.ts +40 -0
  98. package/lib/models/ListWebhooks200Response.js +56 -0
  99. package/lib/models/ListWebhooks200ResponseEmbedded.d.ts +33 -0
  100. package/lib/models/ListWebhooks200ResponseEmbedded.js +49 -0
  101. package/lib/models/ListWebhooks200ResponseLinks.d.ts +39 -0
  102. package/lib/models/ListWebhooks200ResponseLinks.js +51 -0
  103. package/lib/models/NetworkBulkFeeds.d.ts +81 -0
  104. package/lib/models/NetworkBulkFeeds.js +83 -0
  105. package/lib/models/Subaccount.d.ts +70 -0
  106. package/lib/models/Subaccount.js +76 -0
  107. package/lib/models/SubaccountConfiguration.d.ts +39 -0
  108. package/lib/models/SubaccountConfiguration.js +51 -0
  109. package/lib/models/SubaccountConfigurationVISA.d.ts +43 -0
  110. package/lib/models/SubaccountConfigurationVISA.js +61 -0
  111. package/lib/models/Transaction.d.ts +140 -0
  112. package/lib/models/Transaction.js +126 -0
  113. package/lib/models/TransactionAcceptor.d.ts +50 -0
  114. package/lib/models/TransactionAcceptor.js +62 -0
  115. package/lib/models/TransactionLinks.d.ts +51 -0
  116. package/lib/models/TransactionLinks.js +57 -0
  117. package/lib/models/TransactionMessage.d.ts +184 -0
  118. package/lib/models/TransactionMessage.js +159 -0
  119. package/lib/models/TransactionMessageAcceptor.d.ts +68 -0
  120. package/lib/models/TransactionMessageAcceptor.js +72 -0
  121. package/lib/models/UnprocessableEntity.d.ts +45 -0
  122. package/lib/models/UnprocessableEntity.js +61 -0
  123. package/lib/models/UpdateCardSubscriptionRequest.d.ts +39 -0
  124. package/lib/models/UpdateCardSubscriptionRequest.js +55 -0
  125. package/lib/models/UpdateSubaccountRequest.d.ts +39 -0
  126. package/lib/models/UpdateSubaccountRequest.js +51 -0
  127. package/lib/models/UpdateWebhookRequest.d.ts +61 -0
  128. package/lib/models/UpdateWebhookRequest.js +65 -0
  129. package/lib/models/Webhook.d.ts +92 -0
  130. package/lib/models/Webhook.js +92 -0
  131. package/lib/models/index.d.ts +51 -0
  132. package/lib/models/index.js +69 -0
  133. package/lib/runtime.d.ts +215 -0
  134. package/lib/runtime.js +394 -0
  135. package/package.json +21 -0
  136. package/src/apis/CardApi.ts +174 -0
  137. package/src/apis/CardSubscriptionApi.ts +223 -0
  138. package/src/apis/CardholderApi.ts +93 -0
  139. package/src/apis/EnrollmentMethodsApi.ts +98 -0
  140. package/src/apis/NetworkBulkFeedsApi.ts +211 -0
  141. package/src/apis/SubaccountsApi.ts +253 -0
  142. package/src/apis/TransactionMessagesApi.ts +93 -0
  143. package/src/apis/TransactionsApi.ts +169 -0
  144. package/src/apis/WebhooksApi.ts +315 -0
  145. package/src/apis/index.ts +11 -0
  146. package/src/index.ts +5 -0
  147. package/src/models/Card.ts +187 -0
  148. package/src/models/CardLinks.ts +82 -0
  149. package/src/models/CardSubscription.ts +194 -0
  150. package/src/models/CardSubscriptionLinks.ts +91 -0
  151. package/src/models/Cardholder.ts +124 -0
  152. package/src/models/CardholderCorporate.ts +73 -0
  153. package/src/models/CardholderLinks.ts +74 -0
  154. package/src/models/Conflict.ts +102 -0
  155. package/src/models/CreateNetworkBulkFeedRequest.ts +95 -0
  156. package/src/models/CreateSubaccountRequest.ts +83 -0
  157. package/src/models/CreateWebhook201Response.ts +168 -0
  158. package/src/models/CreateWebhookRequest.ts +114 -0
  159. package/src/models/EnrollmentMethods200Response.ts +77 -0
  160. package/src/models/EnrollmentMethodsRequest.ts +66 -0
  161. package/src/models/GetSubaccounts200Response.ts +90 -0
  162. package/src/models/GetSubaccounts200ResponseEmbedded.ts +74 -0
  163. package/src/models/GetSubaccounts200ResponseLinks.ts +82 -0
  164. package/src/models/GetTransactions200Response.ts +90 -0
  165. package/src/models/GetTransactions200ResponseEmbedded.ts +74 -0
  166. package/src/models/InlineObject.ts +101 -0
  167. package/src/models/InlineObject1.ts +85 -0
  168. package/src/models/InlineObject2.ts +85 -0
  169. package/src/models/InlineObject3.ts +85 -0
  170. package/src/models/InlineObject4.ts +101 -0
  171. package/src/models/InlineObject5.ts +85 -0
  172. package/src/models/InlineObjectErrorsInner.ts +75 -0
  173. package/src/models/Link.ts +122 -0
  174. package/src/models/ListCardSubscriptions200Response.ts +99 -0
  175. package/src/models/ListCardSubscriptions200ResponseEmbedded.ts +74 -0
  176. package/src/models/ListCardSubscriptions200ResponseLinks.ts +106 -0
  177. package/src/models/ListCards200Response.ts +99 -0
  178. package/src/models/ListCards200ResponseEmbedded.ts +74 -0
  179. package/src/models/ListNetworkBulkFeeds200Response.ts +99 -0
  180. package/src/models/ListNetworkBulkFeeds200ResponseEmbedded.ts +74 -0
  181. package/src/models/ListWebhooks200Response.ts +90 -0
  182. package/src/models/ListWebhooks200ResponseEmbedded.ts +73 -0
  183. package/src/models/ListWebhooks200ResponseLinks.ts +81 -0
  184. package/src/models/NetworkBulkFeeds.ts +143 -0
  185. package/src/models/Subaccount.ts +135 -0
  186. package/src/models/SubaccountConfiguration.ts +81 -0
  187. package/src/models/SubaccountConfigurationVISA.ts +80 -0
  188. package/src/models/Transaction.ts +238 -0
  189. package/src/models/TransactionAcceptor.ts +93 -0
  190. package/src/models/TransactionLinks.ts +98 -0
  191. package/src/models/TransactionMessage.ts +289 -0
  192. package/src/models/TransactionMessageAcceptor.ts +119 -0
  193. package/src/models/UnprocessableEntity.ts +85 -0
  194. package/src/models/UpdateCardSubscriptionRequest.ts +75 -0
  195. package/src/models/UpdateSubaccountRequest.ts +81 -0
  196. package/src/models/UpdateWebhookRequest.ts +103 -0
  197. package/src/models/Webhook.ts +159 -0
  198. package/src/models/index.ts +53 -0
  199. package/src/runtime.ts +524 -0
  200. package/tsconfig.json +13 -0
@@ -0,0 +1,253 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Astrada API
5
+ * Welcome to our API Reference. 👋
6
+ *
7
+ * The version of the OpenAPI document: 2024-02-28
8
+ * Contact: developer@astrada.co
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+
16
+ import * as runtime from '../runtime';
17
+ import type {
18
+ CreateSubaccountRequest,
19
+ GetSubaccounts200Response,
20
+ InlineObject,
21
+ InlineObject1,
22
+ InlineObject2,
23
+ InlineObject3,
24
+ InlineObject4,
25
+ Subaccount,
26
+ UpdateSubaccountRequest,
27
+ } from '../models/index';
28
+ import {
29
+ CreateSubaccountRequestFromJSON,
30
+ CreateSubaccountRequestToJSON,
31
+ GetSubaccounts200ResponseFromJSON,
32
+ GetSubaccounts200ResponseToJSON,
33
+ InlineObjectFromJSON,
34
+ InlineObjectToJSON,
35
+ InlineObject1FromJSON,
36
+ InlineObject1ToJSON,
37
+ InlineObject2FromJSON,
38
+ InlineObject2ToJSON,
39
+ InlineObject3FromJSON,
40
+ InlineObject3ToJSON,
41
+ InlineObject4FromJSON,
42
+ InlineObject4ToJSON,
43
+ SubaccountFromJSON,
44
+ SubaccountToJSON,
45
+ UpdateSubaccountRequestFromJSON,
46
+ UpdateSubaccountRequestToJSON,
47
+ } from '../models/index';
48
+
49
+ export interface CreateSubaccountOperationRequest {
50
+ createSubaccountRequest?: CreateSubaccountRequest;
51
+ }
52
+
53
+ export interface GetSubaccountRequest {
54
+ subaccountId: string;
55
+ }
56
+
57
+ export interface GetSubaccountsRequest {
58
+ cursor?: string;
59
+ limit?: number;
60
+ }
61
+
62
+ export interface UpdateSubaccountOperationRequest {
63
+ subaccountId: string;
64
+ updateSubaccountRequest: UpdateSubaccountRequest;
65
+ }
66
+
67
+ /**
68
+ *
69
+ */
70
+ export class SubaccountsApi extends runtime.BaseAPI {
71
+
72
+ /**
73
+ * Creates a new subaccount, allowing you to set network and regional configurations.
74
+ * Create subaccount
75
+ */
76
+ async createSubaccountRaw(requestParameters: CreateSubaccountOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Subaccount>> {
77
+ const queryParameters: any = {};
78
+
79
+ const headerParameters: runtime.HTTPHeaders = {};
80
+
81
+ headerParameters['Content-Type'] = 'application/json';
82
+
83
+ if (this.configuration && this.configuration.accessToken) {
84
+ // oauth required
85
+ headerParameters["Authorization"] = await this.configuration.accessToken("main-auth", ["subaccounts:write"]);
86
+ }
87
+
88
+
89
+ let urlPath = `/subaccounts`;
90
+
91
+ const response = await this.request({
92
+ path: urlPath,
93
+ method: 'POST',
94
+ headers: headerParameters,
95
+ query: queryParameters,
96
+ body: CreateSubaccountRequestToJSON(requestParameters['createSubaccountRequest']),
97
+ }, initOverrides);
98
+
99
+ return new runtime.JSONApiResponse(response, (jsonValue) => SubaccountFromJSON(jsonValue));
100
+ }
101
+
102
+ /**
103
+ * Creates a new subaccount, allowing you to set network and regional configurations.
104
+ * Create subaccount
105
+ */
106
+ async createSubaccount(requestParameters: CreateSubaccountOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Subaccount> {
107
+ const response = await this.createSubaccountRaw(requestParameters, initOverrides);
108
+ return await response.value();
109
+ }
110
+
111
+ /**
112
+ * Returns detailed information about a specific subaccount by its identifier, including configuration details and associated data.
113
+ * Retrieve subaccount
114
+ */
115
+ async getSubaccountRaw(requestParameters: GetSubaccountRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Subaccount>> {
116
+ if (requestParameters['subaccountId'] == null) {
117
+ throw new runtime.RequiredError(
118
+ 'subaccountId',
119
+ 'Required parameter "subaccountId" was null or undefined when calling getSubaccount().'
120
+ );
121
+ }
122
+
123
+ const queryParameters: any = {};
124
+
125
+ const headerParameters: runtime.HTTPHeaders = {};
126
+
127
+ if (this.configuration && this.configuration.accessToken) {
128
+ // oauth required
129
+ headerParameters["Authorization"] = await this.configuration.accessToken("main-auth", ["subaccounts:read"]);
130
+ }
131
+
132
+
133
+ let urlPath = `/subaccounts/{subaccountId}`;
134
+ urlPath = urlPath.replace(`{${"subaccountId"}}`, encodeURIComponent(String(requestParameters['subaccountId'])));
135
+
136
+ const response = await this.request({
137
+ path: urlPath,
138
+ method: 'GET',
139
+ headers: headerParameters,
140
+ query: queryParameters,
141
+ }, initOverrides);
142
+
143
+ return new runtime.JSONApiResponse(response, (jsonValue) => SubaccountFromJSON(jsonValue));
144
+ }
145
+
146
+ /**
147
+ * Returns detailed information about a specific subaccount by its identifier, including configuration details and associated data.
148
+ * Retrieve subaccount
149
+ */
150
+ async getSubaccount(requestParameters: GetSubaccountRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Subaccount> {
151
+ const response = await this.getSubaccountRaw(requestParameters, initOverrides);
152
+ return await response.value();
153
+ }
154
+
155
+ /**
156
+ * Returns a list of all subaccounts associated with the account. This endpoint supports [cursor-based pagination](https://docs.astrada.co/reference/pagination).
157
+ * List subaccounts
158
+ */
159
+ async getSubaccountsRaw(requestParameters: GetSubaccountsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GetSubaccounts200Response>> {
160
+ const queryParameters: any = {};
161
+
162
+ if (requestParameters['cursor'] != null) {
163
+ queryParameters['cursor'] = requestParameters['cursor'];
164
+ }
165
+
166
+ if (requestParameters['limit'] != null) {
167
+ queryParameters['limit'] = requestParameters['limit'];
168
+ }
169
+
170
+ const headerParameters: runtime.HTTPHeaders = {};
171
+
172
+ if (this.configuration && this.configuration.accessToken) {
173
+ // oauth required
174
+ headerParameters["Authorization"] = await this.configuration.accessToken("main-auth", ["subaccounts:read"]);
175
+ }
176
+
177
+
178
+ let urlPath = `/subaccounts`;
179
+
180
+ const response = await this.request({
181
+ path: urlPath,
182
+ method: 'GET',
183
+ headers: headerParameters,
184
+ query: queryParameters,
185
+ }, initOverrides);
186
+
187
+ return new runtime.JSONApiResponse(response, (jsonValue) => GetSubaccounts200ResponseFromJSON(jsonValue));
188
+ }
189
+
190
+ /**
191
+ * Returns a list of all subaccounts associated with the account. This endpoint supports [cursor-based pagination](https://docs.astrada.co/reference/pagination).
192
+ * List subaccounts
193
+ */
194
+ async getSubaccounts(requestParameters: GetSubaccountsRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetSubaccounts200Response> {
195
+ const response = await this.getSubaccountsRaw(requestParameters, initOverrides);
196
+ return await response.value();
197
+ }
198
+
199
+ /**
200
+ * Update a subaccount name and configurations. All updated configurations are validated against the capabilities of the main account to ensure compliance. It is possible to add new networks and/or regions but it is not possible to remove any configurations that were previously set.
201
+ * Update subaccount configurations
202
+ */
203
+ async updateSubaccountRaw(requestParameters: UpdateSubaccountOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Subaccount>> {
204
+ if (requestParameters['subaccountId'] == null) {
205
+ throw new runtime.RequiredError(
206
+ 'subaccountId',
207
+ 'Required parameter "subaccountId" was null or undefined when calling updateSubaccount().'
208
+ );
209
+ }
210
+
211
+ if (requestParameters['updateSubaccountRequest'] == null) {
212
+ throw new runtime.RequiredError(
213
+ 'updateSubaccountRequest',
214
+ 'Required parameter "updateSubaccountRequest" was null or undefined when calling updateSubaccount().'
215
+ );
216
+ }
217
+
218
+ const queryParameters: any = {};
219
+
220
+ const headerParameters: runtime.HTTPHeaders = {};
221
+
222
+ headerParameters['Content-Type'] = 'application/json';
223
+
224
+ if (this.configuration && this.configuration.accessToken) {
225
+ // oauth required
226
+ headerParameters["Authorization"] = await this.configuration.accessToken("main-auth", ["subaccounts:write"]);
227
+ }
228
+
229
+
230
+ let urlPath = `/subaccounts/{subaccountId}`;
231
+ urlPath = urlPath.replace(`{${"subaccountId"}}`, encodeURIComponent(String(requestParameters['subaccountId'])));
232
+
233
+ const response = await this.request({
234
+ path: urlPath,
235
+ method: 'PATCH',
236
+ headers: headerParameters,
237
+ query: queryParameters,
238
+ body: UpdateSubaccountRequestToJSON(requestParameters['updateSubaccountRequest']),
239
+ }, initOverrides);
240
+
241
+ return new runtime.JSONApiResponse(response, (jsonValue) => SubaccountFromJSON(jsonValue));
242
+ }
243
+
244
+ /**
245
+ * Update a subaccount name and configurations. All updated configurations are validated against the capabilities of the main account to ensure compliance. It is possible to add new networks and/or regions but it is not possible to remove any configurations that were previously set.
246
+ * Update subaccount configurations
247
+ */
248
+ async updateSubaccount(requestParameters: UpdateSubaccountOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Subaccount> {
249
+ const response = await this.updateSubaccountRaw(requestParameters, initOverrides);
250
+ return await response.value();
251
+ }
252
+
253
+ }
@@ -0,0 +1,93 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Astrada API
5
+ * Welcome to our API Reference. 👋
6
+ *
7
+ * The version of the OpenAPI document: 2024-02-28
8
+ * Contact: developer@astrada.co
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+
16
+ import * as runtime from '../runtime';
17
+ import type {
18
+ InlineObject,
19
+ InlineObject1,
20
+ InlineObject2,
21
+ InlineObject3,
22
+ InlineObject4,
23
+ TransactionMessage,
24
+ } from '../models/index';
25
+ import {
26
+ InlineObjectFromJSON,
27
+ InlineObjectToJSON,
28
+ InlineObject1FromJSON,
29
+ InlineObject1ToJSON,
30
+ InlineObject2FromJSON,
31
+ InlineObject2ToJSON,
32
+ InlineObject3FromJSON,
33
+ InlineObject3ToJSON,
34
+ InlineObject4FromJSON,
35
+ InlineObject4ToJSON,
36
+ TransactionMessageFromJSON,
37
+ TransactionMessageToJSON,
38
+ } from '../models/index';
39
+
40
+ export interface GetTransactionMessageByIdRequest {
41
+ transactionMessageId: string;
42
+ }
43
+
44
+ /**
45
+ *
46
+ */
47
+ export class TransactionMessagesApi extends runtime.BaseAPI {
48
+
49
+ /**
50
+ * Return a transaction message by its unique identifier, including details about the transaction\'s type and relevant transactional data.
51
+ * Retrieve transaction message
52
+ */
53
+ async getTransactionMessageByIdRaw(requestParameters: GetTransactionMessageByIdRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<TransactionMessage>> {
54
+ if (requestParameters['transactionMessageId'] == null) {
55
+ throw new runtime.RequiredError(
56
+ 'transactionMessageId',
57
+ 'Required parameter "transactionMessageId" was null or undefined when calling getTransactionMessageById().'
58
+ );
59
+ }
60
+
61
+ const queryParameters: any = {};
62
+
63
+ const headerParameters: runtime.HTTPHeaders = {};
64
+
65
+ if (this.configuration && this.configuration.accessToken) {
66
+ // oauth required
67
+ headerParameters["Authorization"] = await this.configuration.accessToken("main-auth", ["transaction-messages:read"]);
68
+ }
69
+
70
+
71
+ let urlPath = `/transaction-messages/{transactionMessageId}`;
72
+ urlPath = urlPath.replace(`{${"transactionMessageId"}}`, encodeURIComponent(String(requestParameters['transactionMessageId'])));
73
+
74
+ const response = await this.request({
75
+ path: urlPath,
76
+ method: 'GET',
77
+ headers: headerParameters,
78
+ query: queryParameters,
79
+ }, initOverrides);
80
+
81
+ return new runtime.JSONApiResponse(response, (jsonValue) => TransactionMessageFromJSON(jsonValue));
82
+ }
83
+
84
+ /**
85
+ * Return a transaction message by its unique identifier, including details about the transaction\'s type and relevant transactional data.
86
+ * Retrieve transaction message
87
+ */
88
+ async getTransactionMessageById(requestParameters: GetTransactionMessageByIdRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<TransactionMessage> {
89
+ const response = await this.getTransactionMessageByIdRaw(requestParameters, initOverrides);
90
+ return await response.value();
91
+ }
92
+
93
+ }
@@ -0,0 +1,169 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Astrada API
5
+ * Welcome to our API Reference. 👋
6
+ *
7
+ * The version of the OpenAPI document: 2024-02-28
8
+ * Contact: developer@astrada.co
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+
16
+ import * as runtime from '../runtime';
17
+ import type {
18
+ GetTransactions200Response,
19
+ InlineObject,
20
+ InlineObject1,
21
+ InlineObject2,
22
+ InlineObject3,
23
+ InlineObject4,
24
+ Transaction,
25
+ } from '../models/index';
26
+ import {
27
+ GetTransactions200ResponseFromJSON,
28
+ GetTransactions200ResponseToJSON,
29
+ InlineObjectFromJSON,
30
+ InlineObjectToJSON,
31
+ InlineObject1FromJSON,
32
+ InlineObject1ToJSON,
33
+ InlineObject2FromJSON,
34
+ InlineObject2ToJSON,
35
+ InlineObject3FromJSON,
36
+ InlineObject3ToJSON,
37
+ InlineObject4FromJSON,
38
+ InlineObject4ToJSON,
39
+ TransactionFromJSON,
40
+ TransactionToJSON,
41
+ } from '../models/index';
42
+
43
+ export interface GetTransactionByIdRequest {
44
+ transactionId: string;
45
+ }
46
+
47
+ export interface GetTransactionsRequest {
48
+ transactionMessageId?: string;
49
+ cursor?: string;
50
+ cardId?: string;
51
+ limit?: number;
52
+ order?: GetTransactionsOrderEnum;
53
+ }
54
+
55
+ /**
56
+ *
57
+ */
58
+ export class TransactionsApi extends runtime.BaseAPI {
59
+
60
+ /**
61
+ * Returns a transaction by its unique identifier, including details about the transaction\'s state and relevant transactional data.
62
+ * Retrieve transaction
63
+ */
64
+ async getTransactionByIdRaw(requestParameters: GetTransactionByIdRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Transaction>> {
65
+ if (requestParameters['transactionId'] == null) {
66
+ throw new runtime.RequiredError(
67
+ 'transactionId',
68
+ 'Required parameter "transactionId" was null or undefined when calling getTransactionById().'
69
+ );
70
+ }
71
+
72
+ const queryParameters: any = {};
73
+
74
+ const headerParameters: runtime.HTTPHeaders = {};
75
+
76
+ if (this.configuration && this.configuration.accessToken) {
77
+ // oauth required
78
+ headerParameters["Authorization"] = await this.configuration.accessToken("main-auth", ["transactions:read"]);
79
+ }
80
+
81
+
82
+ let urlPath = `/transactions/{transactionId}`;
83
+ urlPath = urlPath.replace(`{${"transactionId"}}`, encodeURIComponent(String(requestParameters['transactionId'])));
84
+
85
+ const response = await this.request({
86
+ path: urlPath,
87
+ method: 'GET',
88
+ headers: headerParameters,
89
+ query: queryParameters,
90
+ }, initOverrides);
91
+
92
+ return new runtime.JSONApiResponse(response, (jsonValue) => TransactionFromJSON(jsonValue));
93
+ }
94
+
95
+ /**
96
+ * Returns a transaction by its unique identifier, including details about the transaction\'s state and relevant transactional data.
97
+ * Retrieve transaction
98
+ */
99
+ async getTransactionById(requestParameters: GetTransactionByIdRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Transaction> {
100
+ const response = await this.getTransactionByIdRaw(requestParameters, initOverrides);
101
+ return await response.value();
102
+ }
103
+
104
+ /**
105
+ * Returns a list of all transactions under the account. By default, `GET /transactions` returns transactions ordered by the latest `createdAt`. You can combine the different filters as documented. This endpoint supports [cursor-based pagination](https://docs.astrada.co/reference/pagination).
106
+ * List transactions
107
+ */
108
+ async getTransactionsRaw(requestParameters: GetTransactionsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GetTransactions200Response>> {
109
+ const queryParameters: any = {};
110
+
111
+ if (requestParameters['transactionMessageId'] != null) {
112
+ queryParameters['transactionMessageId'] = requestParameters['transactionMessageId'];
113
+ }
114
+
115
+ if (requestParameters['cursor'] != null) {
116
+ queryParameters['cursor'] = requestParameters['cursor'];
117
+ }
118
+
119
+ if (requestParameters['cardId'] != null) {
120
+ queryParameters['cardId'] = requestParameters['cardId'];
121
+ }
122
+
123
+ if (requestParameters['limit'] != null) {
124
+ queryParameters['limit'] = requestParameters['limit'];
125
+ }
126
+
127
+ if (requestParameters['order'] != null) {
128
+ queryParameters['order'] = requestParameters['order'];
129
+ }
130
+
131
+ const headerParameters: runtime.HTTPHeaders = {};
132
+
133
+ if (this.configuration && this.configuration.accessToken) {
134
+ // oauth required
135
+ headerParameters["Authorization"] = await this.configuration.accessToken("main-auth", ["transactions:read"]);
136
+ }
137
+
138
+
139
+ let urlPath = `/transactions`;
140
+
141
+ const response = await this.request({
142
+ path: urlPath,
143
+ method: 'GET',
144
+ headers: headerParameters,
145
+ query: queryParameters,
146
+ }, initOverrides);
147
+
148
+ return new runtime.JSONApiResponse(response, (jsonValue) => GetTransactions200ResponseFromJSON(jsonValue));
149
+ }
150
+
151
+ /**
152
+ * Returns a list of all transactions under the account. By default, `GET /transactions` returns transactions ordered by the latest `createdAt`. You can combine the different filters as documented. This endpoint supports [cursor-based pagination](https://docs.astrada.co/reference/pagination).
153
+ * List transactions
154
+ */
155
+ async getTransactions(requestParameters: GetTransactionsRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetTransactions200Response> {
156
+ const response = await this.getTransactionsRaw(requestParameters, initOverrides);
157
+ return await response.value();
158
+ }
159
+
160
+ }
161
+
162
+ /**
163
+ * @export
164
+ */
165
+ export const GetTransactionsOrderEnum = {
166
+ Asc: 'asc',
167
+ Desc: 'desc'
168
+ } as const;
169
+ export type GetTransactionsOrderEnum = typeof GetTransactionsOrderEnum[keyof typeof GetTransactionsOrderEnum];