@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,86 @@
1
+ /**
2
+ * Astrada API
3
+ * Welcome to our API Reference. 👋
4
+ *
5
+ * The version of the OpenAPI document: 2024-02-28
6
+ * Contact: developer@astrada.co
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ import * as runtime from '../runtime';
13
+ import type { CreateWebhook201Response, CreateWebhookRequest, ListWebhooks200Response, UpdateWebhookRequest, Webhook } from '../models/index';
14
+ export interface CreateWebhookOperationRequest {
15
+ createWebhookRequest: CreateWebhookRequest;
16
+ }
17
+ export interface DeleteWebhookRequest {
18
+ webhookId: string;
19
+ }
20
+ export interface GetWebhookRequest {
21
+ webhookId: string;
22
+ }
23
+ export interface ListWebhooksRequest {
24
+ subaccountId?: string;
25
+ limit?: number;
26
+ cursor?: string;
27
+ }
28
+ export interface UpdateWebhookOperationRequest {
29
+ webhookId: string;
30
+ updateWebhookRequest: UpdateWebhookRequest;
31
+ }
32
+ /**
33
+ *
34
+ */
35
+ export declare class WebhooksApi extends runtime.BaseAPI {
36
+ /**
37
+ * Registers a new webhook for capturing event notifications.
38
+ * Create webhook
39
+ */
40
+ createWebhookRaw(requestParameters: CreateWebhookOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CreateWebhook201Response>>;
41
+ /**
42
+ * Registers a new webhook for capturing event notifications.
43
+ * Create webhook
44
+ */
45
+ createWebhook(requestParameters: CreateWebhookOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CreateWebhook201Response>;
46
+ /**
47
+ * Remove a configured webhook by its identifier. Results in the resource being deleted and no longer available.
48
+ * Delete webhook
49
+ */
50
+ deleteWebhookRaw(requestParameters: DeleteWebhookRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
51
+ /**
52
+ * Remove a configured webhook by its identifier. Results in the resource being deleted and no longer available.
53
+ * Delete webhook
54
+ */
55
+ deleteWebhook(requestParameters: DeleteWebhookRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
56
+ /**
57
+ * Returns detailed information about a specific webhook by its identifier, including its configuration and event subscription details.
58
+ * Retrieve webhook
59
+ */
60
+ getWebhookRaw(requestParameters: GetWebhookRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Webhook>>;
61
+ /**
62
+ * Returns detailed information about a specific webhook by its identifier, including its configuration and event subscription details.
63
+ * Retrieve webhook
64
+ */
65
+ getWebhook(requestParameters: GetWebhookRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Webhook>;
66
+ /**
67
+ * Returns all webhooks configured under the account, optionally filtered by subaccount, including details on the events each webhook is subscribed to. This endpoint supports [cursor-based pagination](https://docs.astrada.co/reference/pagination).
68
+ * List webhooks
69
+ */
70
+ listWebhooksRaw(requestParameters: ListWebhooksRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ListWebhooks200Response>>;
71
+ /**
72
+ * Returns all webhooks configured under the account, optionally filtered by subaccount, including details on the events each webhook is subscribed to. This endpoint supports [cursor-based pagination](https://docs.astrada.co/reference/pagination).
73
+ * List webhooks
74
+ */
75
+ listWebhooks(requestParameters?: ListWebhooksRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ListWebhooks200Response>;
76
+ /**
77
+ * Updates the configuration of an existing webhook, allowing changes to the event subscriptions or notification URL.
78
+ * Update webhook
79
+ */
80
+ updateWebhookRaw(requestParameters: UpdateWebhookOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Webhook>>;
81
+ /**
82
+ * Updates the configuration of an existing webhook, allowing changes to the event subscriptions or notification URL.
83
+ * Update webhook
84
+ */
85
+ updateWebhook(requestParameters: UpdateWebhookOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Webhook>;
86
+ }
@@ -0,0 +1,194 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * Astrada API
6
+ * Welcome to our API Reference. 👋
7
+ *
8
+ * The version of the OpenAPI document: 2024-02-28
9
+ * Contact: developer@astrada.co
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.WebhooksApi = void 0;
17
+ const runtime = require("../runtime");
18
+ const index_1 = require("../models/index");
19
+ /**
20
+ *
21
+ */
22
+ class WebhooksApi extends runtime.BaseAPI {
23
+ /**
24
+ * Registers a new webhook for capturing event notifications.
25
+ * Create webhook
26
+ */
27
+ async createWebhookRaw(requestParameters, initOverrides) {
28
+ if (requestParameters['createWebhookRequest'] == null) {
29
+ throw new runtime.RequiredError('createWebhookRequest', 'Required parameter "createWebhookRequest" was null or undefined when calling createWebhook().');
30
+ }
31
+ const queryParameters = {};
32
+ const headerParameters = {};
33
+ headerParameters['Content-Type'] = 'application/json';
34
+ if (this.configuration && this.configuration.accessToken) {
35
+ // oauth required
36
+ headerParameters["Authorization"] = await this.configuration.accessToken("main-auth", ["webhooks:write"]);
37
+ }
38
+ let urlPath = `/webhooks`;
39
+ const response = await this.request({
40
+ path: urlPath,
41
+ method: 'POST',
42
+ headers: headerParameters,
43
+ query: queryParameters,
44
+ body: (0, index_1.CreateWebhookRequestToJSON)(requestParameters['createWebhookRequest']),
45
+ }, initOverrides);
46
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.CreateWebhook201ResponseFromJSON)(jsonValue));
47
+ }
48
+ /**
49
+ * Registers a new webhook for capturing event notifications.
50
+ * Create webhook
51
+ */
52
+ async createWebhook(requestParameters, initOverrides) {
53
+ const response = await this.createWebhookRaw(requestParameters, initOverrides);
54
+ return await response.value();
55
+ }
56
+ /**
57
+ * Remove a configured webhook by its identifier. Results in the resource being deleted and no longer available.
58
+ * Delete webhook
59
+ */
60
+ async deleteWebhookRaw(requestParameters, initOverrides) {
61
+ if (requestParameters['webhookId'] == null) {
62
+ throw new runtime.RequiredError('webhookId', 'Required parameter "webhookId" was null or undefined when calling deleteWebhook().');
63
+ }
64
+ const queryParameters = {};
65
+ const headerParameters = {};
66
+ if (this.configuration && this.configuration.accessToken) {
67
+ // oauth required
68
+ headerParameters["Authorization"] = await this.configuration.accessToken("main-auth", ["webhooks:write"]);
69
+ }
70
+ let urlPath = `/webhooks/{webhookId}`;
71
+ urlPath = urlPath.replace(`{${"webhookId"}}`, encodeURIComponent(String(requestParameters['webhookId'])));
72
+ const response = await this.request({
73
+ path: urlPath,
74
+ method: 'DELETE',
75
+ headers: headerParameters,
76
+ query: queryParameters,
77
+ }, initOverrides);
78
+ return new runtime.VoidApiResponse(response);
79
+ }
80
+ /**
81
+ * Remove a configured webhook by its identifier. Results in the resource being deleted and no longer available.
82
+ * Delete webhook
83
+ */
84
+ async deleteWebhook(requestParameters, initOverrides) {
85
+ await this.deleteWebhookRaw(requestParameters, initOverrides);
86
+ }
87
+ /**
88
+ * Returns detailed information about a specific webhook by its identifier, including its configuration and event subscription details.
89
+ * Retrieve webhook
90
+ */
91
+ async getWebhookRaw(requestParameters, initOverrides) {
92
+ if (requestParameters['webhookId'] == null) {
93
+ throw new runtime.RequiredError('webhookId', 'Required parameter "webhookId" was null or undefined when calling getWebhook().');
94
+ }
95
+ const queryParameters = {};
96
+ const headerParameters = {};
97
+ if (this.configuration && this.configuration.accessToken) {
98
+ // oauth required
99
+ headerParameters["Authorization"] = await this.configuration.accessToken("main-auth", ["webhooks:read"]);
100
+ }
101
+ let urlPath = `/webhooks/{webhookId}`;
102
+ urlPath = urlPath.replace(`{${"webhookId"}}`, encodeURIComponent(String(requestParameters['webhookId'])));
103
+ const response = await this.request({
104
+ path: urlPath,
105
+ method: 'GET',
106
+ headers: headerParameters,
107
+ query: queryParameters,
108
+ }, initOverrides);
109
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.WebhookFromJSON)(jsonValue));
110
+ }
111
+ /**
112
+ * Returns detailed information about a specific webhook by its identifier, including its configuration and event subscription details.
113
+ * Retrieve webhook
114
+ */
115
+ async getWebhook(requestParameters, initOverrides) {
116
+ const response = await this.getWebhookRaw(requestParameters, initOverrides);
117
+ return await response.value();
118
+ }
119
+ /**
120
+ * Returns all webhooks configured under the account, optionally filtered by subaccount, including details on the events each webhook is subscribed to. This endpoint supports [cursor-based pagination](https://docs.astrada.co/reference/pagination).
121
+ * List webhooks
122
+ */
123
+ async listWebhooksRaw(requestParameters, initOverrides) {
124
+ const queryParameters = {};
125
+ if (requestParameters['subaccountId'] != null) {
126
+ queryParameters['subaccountId'] = requestParameters['subaccountId'];
127
+ }
128
+ if (requestParameters['limit'] != null) {
129
+ queryParameters['limit'] = requestParameters['limit'];
130
+ }
131
+ if (requestParameters['cursor'] != null) {
132
+ queryParameters['cursor'] = requestParameters['cursor'];
133
+ }
134
+ const headerParameters = {};
135
+ if (this.configuration && this.configuration.accessToken) {
136
+ // oauth required
137
+ headerParameters["Authorization"] = await this.configuration.accessToken("main-auth", ["webhooks:read"]);
138
+ }
139
+ let urlPath = `/webhooks`;
140
+ const response = await this.request({
141
+ path: urlPath,
142
+ method: 'GET',
143
+ headers: headerParameters,
144
+ query: queryParameters,
145
+ }, initOverrides);
146
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.ListWebhooks200ResponseFromJSON)(jsonValue));
147
+ }
148
+ /**
149
+ * Returns all webhooks configured under the account, optionally filtered by subaccount, including details on the events each webhook is subscribed to. This endpoint supports [cursor-based pagination](https://docs.astrada.co/reference/pagination).
150
+ * List webhooks
151
+ */
152
+ async listWebhooks(requestParameters = {}, initOverrides) {
153
+ const response = await this.listWebhooksRaw(requestParameters, initOverrides);
154
+ return await response.value();
155
+ }
156
+ /**
157
+ * Updates the configuration of an existing webhook, allowing changes to the event subscriptions or notification URL.
158
+ * Update webhook
159
+ */
160
+ async updateWebhookRaw(requestParameters, initOverrides) {
161
+ if (requestParameters['webhookId'] == null) {
162
+ throw new runtime.RequiredError('webhookId', 'Required parameter "webhookId" was null or undefined when calling updateWebhook().');
163
+ }
164
+ if (requestParameters['updateWebhookRequest'] == null) {
165
+ throw new runtime.RequiredError('updateWebhookRequest', 'Required parameter "updateWebhookRequest" was null or undefined when calling updateWebhook().');
166
+ }
167
+ const queryParameters = {};
168
+ const headerParameters = {};
169
+ headerParameters['Content-Type'] = 'application/json';
170
+ if (this.configuration && this.configuration.accessToken) {
171
+ // oauth required
172
+ headerParameters["Authorization"] = await this.configuration.accessToken("main-auth", ["webhooks:write"]);
173
+ }
174
+ let urlPath = `/webhooks/{webhookId}`;
175
+ urlPath = urlPath.replace(`{${"webhookId"}}`, encodeURIComponent(String(requestParameters['webhookId'])));
176
+ const response = await this.request({
177
+ path: urlPath,
178
+ method: 'PATCH',
179
+ headers: headerParameters,
180
+ query: queryParameters,
181
+ body: (0, index_1.UpdateWebhookRequestToJSON)(requestParameters['updateWebhookRequest']),
182
+ }, initOverrides);
183
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.WebhookFromJSON)(jsonValue));
184
+ }
185
+ /**
186
+ * Updates the configuration of an existing webhook, allowing changes to the event subscriptions or notification URL.
187
+ * Update webhook
188
+ */
189
+ async updateWebhook(requestParameters, initOverrides) {
190
+ const response = await this.updateWebhookRaw(requestParameters, initOverrides);
191
+ return await response.value();
192
+ }
193
+ }
194
+ exports.WebhooksApi = WebhooksApi;
@@ -0,0 +1,9 @@
1
+ export * from './CardApi';
2
+ export * from './CardSubscriptionApi';
3
+ export * from './CardholderApi';
4
+ export * from './EnrollmentMethodsApi';
5
+ export * from './NetworkBulkFeedsApi';
6
+ export * from './SubaccountsApi';
7
+ export * from './TransactionMessagesApi';
8
+ export * from './TransactionsApi';
9
+ export * from './WebhooksApi';
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ /* tslint:disable */
18
+ /* eslint-disable */
19
+ __exportStar(require("./CardApi"), exports);
20
+ __exportStar(require("./CardSubscriptionApi"), exports);
21
+ __exportStar(require("./CardholderApi"), exports);
22
+ __exportStar(require("./EnrollmentMethodsApi"), exports);
23
+ __exportStar(require("./NetworkBulkFeedsApi"), exports);
24
+ __exportStar(require("./SubaccountsApi"), exports);
25
+ __exportStar(require("./TransactionMessagesApi"), exports);
26
+ __exportStar(require("./TransactionsApi"), exports);
27
+ __exportStar(require("./WebhooksApi"), exports);
package/lib/index.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ export * from './runtime';
2
+ export * from './apis/index';
3
+ export * from './models/index';
package/lib/index.js ADDED
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ /* tslint:disable */
18
+ /* eslint-disable */
19
+ __exportStar(require("./runtime"), exports);
20
+ __exportStar(require("./apis/index"), exports);
21
+ __exportStar(require("./models/index"), exports);
@@ -0,0 +1,112 @@
1
+ /**
2
+ * Astrada API
3
+ * Welcome to our API Reference. 👋
4
+ *
5
+ * The version of the OpenAPI document: 2024-02-28
6
+ * Contact: developer@astrada.co
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ import type { CardLinks } from './CardLinks';
13
+ /**
14
+ *
15
+ * @export
16
+ * @interface Card
17
+ */
18
+ export interface Card {
19
+ /**
20
+ *
21
+ * @type {CardLinks}
22
+ * @memberof Card
23
+ */
24
+ _links: CardLinks;
25
+ /**
26
+ * The unique identifier of this card entity.
27
+ * @type {string}
28
+ * @memberof Card
29
+ */
30
+ id: string;
31
+ /**
32
+ * The unique identifier of the subaccount related to this entity.
33
+ * @type {string}
34
+ * @memberof Card
35
+ */
36
+ subaccountId: string;
37
+ /**
38
+ * The month that the card will expire in MM format.
39
+ * @type {number}
40
+ * @memberof Card
41
+ */
42
+ expiryMonth: number;
43
+ /**
44
+ * The year that the card will expire in YYYY format.
45
+ * @type {number}
46
+ * @memberof Card
47
+ */
48
+ expiryYear: number;
49
+ /**
50
+ * The first 6 digits of the card number (PAN).
51
+ * @type {number}
52
+ * @memberof Card
53
+ */
54
+ first6digits: number;
55
+ /**
56
+ * The last 4 digits of the card number (PAN).
57
+ * @type {number}
58
+ * @memberof Card
59
+ */
60
+ last4digits: number;
61
+ /**
62
+ * The card network that processes payments for this card.
63
+ * @type {string}
64
+ * @memberof Card
65
+ */
66
+ network: CardNetworkEnum;
67
+ /**
68
+ * The country of issuance for this card following ISO 3166 alpha-3.
69
+ * @type {string}
70
+ * @memberof Card
71
+ */
72
+ country: CardCountryEnum;
73
+ /**
74
+ * Date and Time when this entity was created following ISO 8601 format.
75
+ * @type {Date}
76
+ * @memberof Card
77
+ */
78
+ createdAt: Date;
79
+ /**
80
+ * Date and Time when this entity was last updated following ISO 8601 format.
81
+ * @type {Date}
82
+ * @memberof Card
83
+ */
84
+ updatedAt: Date;
85
+ }
86
+ /**
87
+ * @export
88
+ */
89
+ export declare const CardNetworkEnum: {
90
+ readonly Visa: "visa";
91
+ readonly Mastercard: "mastercard";
92
+ };
93
+ export type CardNetworkEnum = typeof CardNetworkEnum[keyof typeof CardNetworkEnum];
94
+ /**
95
+ * @export
96
+ */
97
+ export declare const CardCountryEnum: {
98
+ readonly Usa: "USA";
99
+ readonly Can: "CAN";
100
+ readonly Gbr: "GBR";
101
+ readonly Swe: "SWE";
102
+ readonly Ita: "ITA";
103
+ };
104
+ export type CardCountryEnum = typeof CardCountryEnum[keyof typeof CardCountryEnum];
105
+ /**
106
+ * Check if a given object implements the Card interface.
107
+ */
108
+ export declare function instanceOfCard(value: object): value is Card;
109
+ export declare function CardFromJSON(json: any): Card;
110
+ export declare function CardFromJSONTyped(json: any, ignoreDiscriminator: boolean): Card;
111
+ export declare function CardToJSON(json: any): Card;
112
+ export declare function CardToJSONTyped(value?: Card | null, ignoreDiscriminator?: boolean): any;
@@ -0,0 +1,109 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * Astrada API
6
+ * Welcome to our API Reference. 👋
7
+ *
8
+ * The version of the OpenAPI document: 2024-02-28
9
+ * Contact: developer@astrada.co
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.CardCountryEnum = exports.CardNetworkEnum = void 0;
17
+ exports.instanceOfCard = instanceOfCard;
18
+ exports.CardFromJSON = CardFromJSON;
19
+ exports.CardFromJSONTyped = CardFromJSONTyped;
20
+ exports.CardToJSON = CardToJSON;
21
+ exports.CardToJSONTyped = CardToJSONTyped;
22
+ const CardLinks_1 = require("./CardLinks");
23
+ /**
24
+ * @export
25
+ */
26
+ exports.CardNetworkEnum = {
27
+ Visa: 'visa',
28
+ Mastercard: 'mastercard'
29
+ };
30
+ /**
31
+ * @export
32
+ */
33
+ exports.CardCountryEnum = {
34
+ Usa: 'USA',
35
+ Can: 'CAN',
36
+ Gbr: 'GBR',
37
+ Swe: 'SWE',
38
+ Ita: 'ITA'
39
+ };
40
+ /**
41
+ * Check if a given object implements the Card interface.
42
+ */
43
+ function instanceOfCard(value) {
44
+ if (!('_links' in value) || value['_links'] === undefined)
45
+ return false;
46
+ if (!('id' in value) || value['id'] === undefined)
47
+ return false;
48
+ if (!('subaccountId' in value) || value['subaccountId'] === undefined)
49
+ return false;
50
+ if (!('expiryMonth' in value) || value['expiryMonth'] === undefined)
51
+ return false;
52
+ if (!('expiryYear' in value) || value['expiryYear'] === undefined)
53
+ return false;
54
+ if (!('first6digits' in value) || value['first6digits'] === undefined)
55
+ return false;
56
+ if (!('last4digits' in value) || value['last4digits'] === undefined)
57
+ return false;
58
+ if (!('network' in value) || value['network'] === undefined)
59
+ return false;
60
+ if (!('country' in value) || value['country'] === undefined)
61
+ return false;
62
+ if (!('createdAt' in value) || value['createdAt'] === undefined)
63
+ return false;
64
+ if (!('updatedAt' in value) || value['updatedAt'] === undefined)
65
+ return false;
66
+ return true;
67
+ }
68
+ function CardFromJSON(json) {
69
+ return CardFromJSONTyped(json, false);
70
+ }
71
+ function CardFromJSONTyped(json, ignoreDiscriminator) {
72
+ if (json == null) {
73
+ return json;
74
+ }
75
+ return {
76
+ '_links': (0, CardLinks_1.CardLinksFromJSON)(json['_links']),
77
+ 'id': json['id'],
78
+ 'subaccountId': json['subaccountId'],
79
+ 'expiryMonth': json['expiryMonth'],
80
+ 'expiryYear': json['expiryYear'],
81
+ 'first6digits': json['first6digits'],
82
+ 'last4digits': json['last4digits'],
83
+ 'network': json['network'],
84
+ 'country': json['country'],
85
+ 'createdAt': (new Date(json['createdAt'])),
86
+ 'updatedAt': (new Date(json['updatedAt'])),
87
+ };
88
+ }
89
+ function CardToJSON(json) {
90
+ return CardToJSONTyped(json, false);
91
+ }
92
+ function CardToJSONTyped(value, ignoreDiscriminator = false) {
93
+ if (value == null) {
94
+ return value;
95
+ }
96
+ return {
97
+ '_links': (0, CardLinks_1.CardLinksToJSON)(value['_links']),
98
+ 'id': value['id'],
99
+ 'subaccountId': value['subaccountId'],
100
+ 'expiryMonth': value['expiryMonth'],
101
+ 'expiryYear': value['expiryYear'],
102
+ 'first6digits': value['first6digits'],
103
+ 'last4digits': value['last4digits'],
104
+ 'network': value['network'],
105
+ 'country': value['country'],
106
+ 'createdAt': ((value['createdAt']).toISOString()),
107
+ 'updatedAt': ((value['updatedAt']).toISOString()),
108
+ };
109
+ }
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Astrada API
3
+ * Welcome to our API Reference. 👋
4
+ *
5
+ * The version of the OpenAPI document: 2024-02-28
6
+ * Contact: developer@astrada.co
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ import type { Link } from './Link';
13
+ /**
14
+ *
15
+ * @export
16
+ * @interface CardLinks
17
+ */
18
+ export interface CardLinks {
19
+ /**
20
+ *
21
+ * @type {Link}
22
+ * @memberof CardLinks
23
+ */
24
+ self: Link;
25
+ /**
26
+ *
27
+ * @type {Link}
28
+ * @memberof CardLinks
29
+ */
30
+ cardholder?: Link;
31
+ }
32
+ /**
33
+ * Check if a given object implements the CardLinks interface.
34
+ */
35
+ export declare function instanceOfCardLinks(value: object): value is CardLinks;
36
+ export declare function CardLinksFromJSON(json: any): CardLinks;
37
+ export declare function CardLinksFromJSONTyped(json: any, ignoreDiscriminator: boolean): CardLinks;
38
+ export declare function CardLinksToJSON(json: any): CardLinks;
39
+ export declare function CardLinksToJSONTyped(value?: CardLinks | null, ignoreDiscriminator?: boolean): any;
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * Astrada API
6
+ * Welcome to our API Reference. 👋
7
+ *
8
+ * The version of the OpenAPI document: 2024-02-28
9
+ * Contact: developer@astrada.co
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.instanceOfCardLinks = instanceOfCardLinks;
17
+ exports.CardLinksFromJSON = CardLinksFromJSON;
18
+ exports.CardLinksFromJSONTyped = CardLinksFromJSONTyped;
19
+ exports.CardLinksToJSON = CardLinksToJSON;
20
+ exports.CardLinksToJSONTyped = CardLinksToJSONTyped;
21
+ const Link_1 = require("./Link");
22
+ /**
23
+ * Check if a given object implements the CardLinks interface.
24
+ */
25
+ function instanceOfCardLinks(value) {
26
+ if (!('self' in value) || value['self'] === undefined)
27
+ return false;
28
+ return true;
29
+ }
30
+ function CardLinksFromJSON(json) {
31
+ return CardLinksFromJSONTyped(json, false);
32
+ }
33
+ function CardLinksFromJSONTyped(json, ignoreDiscriminator) {
34
+ if (json == null) {
35
+ return json;
36
+ }
37
+ return {
38
+ 'self': (0, Link_1.LinkFromJSON)(json['self']),
39
+ 'cardholder': json['cardholder'] == null ? undefined : (0, Link_1.LinkFromJSON)(json['cardholder']),
40
+ };
41
+ }
42
+ function CardLinksToJSON(json) {
43
+ return CardLinksToJSONTyped(json, false);
44
+ }
45
+ function CardLinksToJSONTyped(value, ignoreDiscriminator = false) {
46
+ if (value == null) {
47
+ return value;
48
+ }
49
+ return {
50
+ 'self': (0, Link_1.LinkToJSON)(value['self']),
51
+ 'cardholder': (0, Link_1.LinkToJSON)(value['cardholder']),
52
+ };
53
+ }