@astrada.co/ts-astrada-sdk 1.1.0 → 1.3.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 (251) hide show
  1. package/.github/workflows/api-sdk-release.yml +33 -20
  2. package/CHANGELOG.md +2 -2
  3. package/LICENSE +21 -0
  4. package/README.md +0 -2
  5. package/dist/apis/CardApi.js +218 -0
  6. package/dist/apis/CardSubscriptionApi.js +268 -0
  7. package/dist/apis/CardholderApi.js +138 -0
  8. package/dist/apis/EnrollmentMethodsApi.js +139 -0
  9. package/dist/apis/NetworkBulkFeedsApi.js +264 -0
  10. package/dist/apis/SubaccountsApi.js +319 -0
  11. package/dist/apis/TransactionMessagesApi.js +138 -0
  12. package/dist/apis/TransactionsApi.js +215 -0
  13. package/dist/apis/WebhooksApi.js +380 -0
  14. package/{lib → dist}/models/Card.js +5 -4
  15. package/{lib → dist}/models/CardLinks.js +3 -2
  16. package/{lib → dist}/models/CardSubscription.js +7 -6
  17. package/{lib → dist}/models/CardSubscriptionLinks.js +3 -2
  18. package/{lib → dist}/models/Cardholder.js +6 -5
  19. package/{lib → dist}/models/CardholderCorporate.js +2 -1
  20. package/{lib → dist}/models/CardholderLinks.js +3 -2
  21. package/{lib → dist}/models/Conflict.js +2 -1
  22. package/{lib → dist}/models/CreateNetworkBulkFeedRequest.js +2 -1
  23. package/{lib → dist}/models/CreateSubaccountRequest.js +3 -2
  24. package/{lib → dist}/models/CreateWebhook201Response.d.ts +2 -0
  25. package/{lib → dist}/models/CreateWebhook201Response.js +8 -5
  26. package/{lib → dist}/models/CreateWebhookRequest.d.ts +2 -0
  27. package/{lib → dist}/models/CreateWebhookRequest.js +5 -2
  28. package/{lib → dist}/models/EnrollmentMethods200Response.js +2 -1
  29. package/dist/models/EnrollmentMethods413Response.d.ts +45 -0
  30. package/dist/models/EnrollmentMethods413Response.js +62 -0
  31. package/{lib → dist}/models/EnrollmentMethodsRequest.js +2 -1
  32. package/dist/models/GetCardSubscription404Response.d.ts +57 -0
  33. package/dist/models/GetCardSubscription404Response.js +66 -0
  34. package/{lib → dist}/models/GetSubaccounts200Response.js +4 -3
  35. package/{lib → dist}/models/GetSubaccounts200ResponseEmbedded.js +3 -2
  36. package/{lib → dist}/models/GetSubaccounts200ResponseLinks.js +3 -2
  37. package/{lib → dist}/models/GetTransactions200Response.js +4 -3
  38. package/{lib → dist}/models/GetTransactions200ResponseEmbedded.js +3 -2
  39. package/{lib → dist}/models/InlineObject.js +3 -2
  40. package/{lib → dist}/models/InlineObject1.js +2 -1
  41. package/{lib → dist}/models/InlineObject2.js +2 -1
  42. package/{lib → dist}/models/InlineObject3.js +2 -1
  43. package/{lib → dist}/models/InlineObject4.js +2 -1
  44. package/{lib → dist}/models/InlineObject5.js +2 -1
  45. package/{lib → dist}/models/InlineObjectErrorsInner.js +2 -1
  46. package/{lib → dist}/models/Link.js +2 -1
  47. package/{lib → dist}/models/ListCardSubscriptions200Response.js +4 -3
  48. package/{lib → dist}/models/ListCardSubscriptions200ResponseEmbedded.js +3 -2
  49. package/{lib → dist}/models/ListCardSubscriptions200ResponseLinks.js +3 -2
  50. package/dist/models/ListCardSubscriptions400Response.d.ts +52 -0
  51. package/dist/models/ListCardSubscriptions400Response.js +65 -0
  52. package/dist/models/ListCardSubscriptions400ResponseErrorsInner.d.ts +38 -0
  53. package/dist/models/ListCardSubscriptions400ResponseErrorsInner.js +55 -0
  54. package/dist/models/ListCardSubscriptions401Response.d.ts +45 -0
  55. package/dist/models/ListCardSubscriptions401Response.js +62 -0
  56. package/dist/models/ListCardSubscriptions403Response.d.ts +45 -0
  57. package/dist/models/ListCardSubscriptions403Response.js +62 -0
  58. package/dist/models/ListCardSubscriptions500Response.d.ts +45 -0
  59. package/dist/models/ListCardSubscriptions500Response.js +62 -0
  60. package/{lib → dist}/models/ListCards200Response.js +4 -3
  61. package/{lib → dist}/models/ListCards200ResponseEmbedded.js +3 -2
  62. package/{lib → dist}/models/ListNetworkBulkFeeds200Response.js +4 -3
  63. package/{lib → dist}/models/ListNetworkBulkFeeds200ResponseEmbedded.js +3 -2
  64. package/{lib → dist}/models/ListWebhooks200Response.js +4 -3
  65. package/{lib → dist}/models/ListWebhooks200ResponseEmbedded.js +3 -2
  66. package/{lib → dist}/models/ListWebhooks200ResponseLinks.js +3 -2
  67. package/{lib → dist}/models/NetworkBulkFeeds.d.ts +16 -1
  68. package/{lib → dist}/models/NetworkBulkFeeds.js +18 -5
  69. package/{lib → dist}/models/Subaccount.js +6 -5
  70. package/{lib → dist}/models/SubaccountConfiguration.js +3 -2
  71. package/{lib → dist}/models/SubaccountConfigurationVISA.js +2 -1
  72. package/{lib → dist}/models/Transaction.js +7 -6
  73. package/{lib → dist}/models/TransactionAcceptor.js +2 -1
  74. package/{lib → dist}/models/TransactionLinks.js +3 -2
  75. package/{lib → dist}/models/TransactionMessage.js +7 -6
  76. package/{lib → dist}/models/TransactionMessageAcceptor.js +2 -1
  77. package/{lib → dist}/models/UnprocessableEntity.js +2 -1
  78. package/{lib → dist}/models/UpdateCardSubscriptionRequest.js +2 -1
  79. package/{lib → dist}/models/UpdateSubaccountRequest.js +3 -2
  80. package/{lib → dist}/models/UpdateWebhookRequest.d.ts +2 -0
  81. package/{lib → dist}/models/UpdateWebhookRequest.js +5 -2
  82. package/{lib → dist}/models/Webhook.d.ts +2 -0
  83. package/{lib → dist}/models/Webhook.js +8 -5
  84. package/{lib → dist}/models/index.d.ts +7 -7
  85. package/{lib → dist}/models/index.js +7 -7
  86. package/dist/runtime.js +638 -0
  87. package/docs/Card.md +54 -0
  88. package/docs/CardApi.md +176 -0
  89. package/docs/CardLinks.md +36 -0
  90. package/docs/CardSubscription.md +56 -0
  91. package/docs/CardSubscriptionApi.md +252 -0
  92. package/docs/CardSubscriptionLinks.md +38 -0
  93. package/docs/Cardholder.md +44 -0
  94. package/docs/CardholderApi.md +85 -0
  95. package/docs/CardholderCorporate.md +37 -0
  96. package/docs/CardholderLinks.md +34 -0
  97. package/docs/Conflict.md +40 -0
  98. package/docs/CreateNetworkBulkFeedRequest.md +38 -0
  99. package/docs/CreateSubaccountRequest.md +36 -0
  100. package/docs/CreateWebhook201Response.md +52 -0
  101. package/docs/CreateWebhookRequest.md +42 -0
  102. package/docs/EnrollmentMethods200Response.md +34 -0
  103. package/docs/EnrollmentMethods413Response.md +36 -0
  104. package/docs/EnrollmentMethodsApi.md +85 -0
  105. package/docs/EnrollmentMethodsRequest.md +34 -0
  106. package/docs/GetCardSubscription404Response.md +40 -0
  107. package/docs/GetSubaccounts200Response.md +36 -0
  108. package/docs/GetSubaccounts200ResponseEmbedded.md +34 -0
  109. package/docs/GetSubaccounts200ResponseLinks.md +36 -0
  110. package/docs/GetTransactions200Response.md +36 -0
  111. package/docs/GetTransactions200ResponseEmbedded.md +34 -0
  112. package/docs/Link.md +48 -0
  113. package/docs/ListCardSubscriptions200Response.md +38 -0
  114. package/docs/ListCardSubscriptions200ResponseEmbedded.md +34 -0
  115. package/docs/ListCardSubscriptions200ResponseLinks.md +42 -0
  116. package/docs/ListCardSubscriptions400Response.md +38 -0
  117. package/docs/ListCardSubscriptions400ResponseErrorsInner.md +36 -0
  118. package/docs/ListCardSubscriptions401Response.md +36 -0
  119. package/docs/ListCardSubscriptions403Response.md +36 -0
  120. package/docs/ListCardSubscriptions500Response.md +36 -0
  121. package/docs/ListCards200Response.md +38 -0
  122. package/docs/ListCards200ResponseEmbedded.md +34 -0
  123. package/docs/ListNetworkBulkFeeds200Response.md +38 -0
  124. package/docs/ListNetworkBulkFeeds200ResponseEmbedded.md +34 -0
  125. package/docs/ListWebhooks200Response.md +37 -0
  126. package/docs/ListWebhooks200ResponseEmbedded.md +34 -0
  127. package/docs/ListWebhooks200ResponseLinks.md +36 -0
  128. package/docs/NetworkBulkFeeds.md +48 -0
  129. package/docs/NetworkBulkFeedsApi.md +247 -0
  130. package/docs/Subaccount.md +46 -0
  131. package/docs/SubaccountConfiguration.md +37 -0
  132. package/docs/SubaccountConfigurationVISA.md +34 -0
  133. package/docs/SubaccountsApi.md +321 -0
  134. package/docs/Transaction.md +66 -0
  135. package/docs/TransactionAcceptor.md +41 -0
  136. package/docs/TransactionLinks.md +40 -0
  137. package/docs/TransactionMessage.md +70 -0
  138. package/docs/TransactionMessageAcceptor.md +47 -0
  139. package/docs/TransactionMessagesApi.md +85 -0
  140. package/docs/TransactionsApi.md +174 -0
  141. package/docs/UnprocessableEntity.md +36 -0
  142. package/docs/UpdateCardSubscriptionRequest.md +34 -0
  143. package/docs/UpdateSubaccountRequest.md +36 -0
  144. package/docs/UpdateWebhookRequest.md +40 -0
  145. package/docs/Webhook.md +51 -0
  146. package/docs/WebhooksApi.md +401 -0
  147. package/openapitools.json +7 -0
  148. package/package.json +11 -11
  149. package/src/apis/CardApi.ts +15 -15
  150. package/src/apis/CardSubscriptionApi.ts +15 -15
  151. package/src/apis/CardholderApi.ts +15 -15
  152. package/src/apis/EnrollmentMethodsApi.ts +15 -15
  153. package/src/apis/NetworkBulkFeedsApi.ts +15 -15
  154. package/src/apis/SubaccountsApi.ts +15 -15
  155. package/src/apis/TransactionMessagesApi.ts +15 -15
  156. package/src/apis/TransactionsApi.ts +15 -15
  157. package/src/apis/WebhooksApi.ts +15 -15
  158. package/src/models/Card.ts +2 -2
  159. package/src/models/CardSubscription.ts +4 -4
  160. package/src/models/Cardholder.ts +2 -2
  161. package/src/models/CreateWebhook201Response.ts +5 -3
  162. package/src/models/CreateWebhookRequest.ts +3 -1
  163. package/src/models/EnrollmentMethods413Response.ts +85 -0
  164. package/src/models/GetCardSubscription404Response.ts +101 -0
  165. package/src/models/ListCardSubscriptions400Response.ts +101 -0
  166. package/src/models/ListCardSubscriptions400ResponseErrorsInner.ts +75 -0
  167. package/src/models/ListCardSubscriptions401Response.ts +85 -0
  168. package/src/models/ListCardSubscriptions403Response.ts +85 -0
  169. package/src/models/ListCardSubscriptions500Response.ts +85 -0
  170. package/src/models/NetworkBulkFeeds.ts +22 -3
  171. package/src/models/Subaccount.ts +2 -2
  172. package/src/models/Transaction.ts +3 -3
  173. package/src/models/TransactionMessage.ts +3 -3
  174. package/src/models/UpdateWebhookRequest.ts +3 -1
  175. package/src/models/Webhook.ts +5 -3
  176. package/src/models/index.ts +7 -7
  177. package/src/runtime.ts +0 -1
  178. package/tsconfig.json +14 -7
  179. package/dist/astrada.co-ts-astrada-sdk-1.1.0.tgz +0 -0
  180. package/lib/apis/CardApi.js +0 -109
  181. package/lib/apis/CardSubscriptionApi.js +0 -133
  182. package/lib/apis/CardholderApi.js +0 -56
  183. package/lib/apis/EnrollmentMethodsApi.js +0 -57
  184. package/lib/apis/NetworkBulkFeedsApi.js +0 -129
  185. package/lib/apis/SubaccountsApi.js +0 -157
  186. package/lib/apis/TransactionMessagesApi.js +0 -56
  187. package/lib/apis/TransactionsApi.js +0 -106
  188. package/lib/apis/WebhooksApi.js +0 -194
  189. package/lib/runtime.js +0 -394
  190. package/openapi-generator/templates/README.mustache +0 -274
  191. package/openapi-generator/templates/runtime.mustache +0 -515
  192. /package/{lib → dist}/apis/CardApi.d.ts +0 -0
  193. /package/{lib → dist}/apis/CardSubscriptionApi.d.ts +0 -0
  194. /package/{lib → dist}/apis/CardholderApi.d.ts +0 -0
  195. /package/{lib → dist}/apis/EnrollmentMethodsApi.d.ts +0 -0
  196. /package/{lib → dist}/apis/NetworkBulkFeedsApi.d.ts +0 -0
  197. /package/{lib → dist}/apis/SubaccountsApi.d.ts +0 -0
  198. /package/{lib → dist}/apis/TransactionMessagesApi.d.ts +0 -0
  199. /package/{lib → dist}/apis/TransactionsApi.d.ts +0 -0
  200. /package/{lib → dist}/apis/WebhooksApi.d.ts +0 -0
  201. /package/{lib → dist}/apis/index.d.ts +0 -0
  202. /package/{lib → dist}/apis/index.js +0 -0
  203. /package/{lib → dist}/index.d.ts +0 -0
  204. /package/{lib → dist}/index.js +0 -0
  205. /package/{lib → dist}/models/Card.d.ts +0 -0
  206. /package/{lib → dist}/models/CardLinks.d.ts +0 -0
  207. /package/{lib → dist}/models/CardSubscription.d.ts +0 -0
  208. /package/{lib → dist}/models/CardSubscriptionLinks.d.ts +0 -0
  209. /package/{lib → dist}/models/Cardholder.d.ts +0 -0
  210. /package/{lib → dist}/models/CardholderCorporate.d.ts +0 -0
  211. /package/{lib → dist}/models/CardholderLinks.d.ts +0 -0
  212. /package/{lib → dist}/models/Conflict.d.ts +0 -0
  213. /package/{lib → dist}/models/CreateNetworkBulkFeedRequest.d.ts +0 -0
  214. /package/{lib → dist}/models/CreateSubaccountRequest.d.ts +0 -0
  215. /package/{lib → dist}/models/EnrollmentMethods200Response.d.ts +0 -0
  216. /package/{lib → dist}/models/EnrollmentMethodsRequest.d.ts +0 -0
  217. /package/{lib → dist}/models/GetSubaccounts200Response.d.ts +0 -0
  218. /package/{lib → dist}/models/GetSubaccounts200ResponseEmbedded.d.ts +0 -0
  219. /package/{lib → dist}/models/GetSubaccounts200ResponseLinks.d.ts +0 -0
  220. /package/{lib → dist}/models/GetTransactions200Response.d.ts +0 -0
  221. /package/{lib → dist}/models/GetTransactions200ResponseEmbedded.d.ts +0 -0
  222. /package/{lib → dist}/models/InlineObject.d.ts +0 -0
  223. /package/{lib → dist}/models/InlineObject1.d.ts +0 -0
  224. /package/{lib → dist}/models/InlineObject2.d.ts +0 -0
  225. /package/{lib → dist}/models/InlineObject3.d.ts +0 -0
  226. /package/{lib → dist}/models/InlineObject4.d.ts +0 -0
  227. /package/{lib → dist}/models/InlineObject5.d.ts +0 -0
  228. /package/{lib → dist}/models/InlineObjectErrorsInner.d.ts +0 -0
  229. /package/{lib → dist}/models/Link.d.ts +0 -0
  230. /package/{lib → dist}/models/ListCardSubscriptions200Response.d.ts +0 -0
  231. /package/{lib → dist}/models/ListCardSubscriptions200ResponseEmbedded.d.ts +0 -0
  232. /package/{lib → dist}/models/ListCardSubscriptions200ResponseLinks.d.ts +0 -0
  233. /package/{lib → dist}/models/ListCards200Response.d.ts +0 -0
  234. /package/{lib → dist}/models/ListCards200ResponseEmbedded.d.ts +0 -0
  235. /package/{lib → dist}/models/ListNetworkBulkFeeds200Response.d.ts +0 -0
  236. /package/{lib → dist}/models/ListNetworkBulkFeeds200ResponseEmbedded.d.ts +0 -0
  237. /package/{lib → dist}/models/ListWebhooks200Response.d.ts +0 -0
  238. /package/{lib → dist}/models/ListWebhooks200ResponseEmbedded.d.ts +0 -0
  239. /package/{lib → dist}/models/ListWebhooks200ResponseLinks.d.ts +0 -0
  240. /package/{lib → dist}/models/Subaccount.d.ts +0 -0
  241. /package/{lib → dist}/models/SubaccountConfiguration.d.ts +0 -0
  242. /package/{lib → dist}/models/SubaccountConfigurationVISA.d.ts +0 -0
  243. /package/{lib → dist}/models/Transaction.d.ts +0 -0
  244. /package/{lib → dist}/models/TransactionAcceptor.d.ts +0 -0
  245. /package/{lib → dist}/models/TransactionLinks.d.ts +0 -0
  246. /package/{lib → dist}/models/TransactionMessage.d.ts +0 -0
  247. /package/{lib → dist}/models/TransactionMessageAcceptor.d.ts +0 -0
  248. /package/{lib → dist}/models/UnprocessableEntity.d.ts +0 -0
  249. /package/{lib → dist}/models/UpdateCardSubscriptionRequest.d.ts +0 -0
  250. /package/{lib → dist}/models/UpdateSubaccountRequest.d.ts +0 -0
  251. /package/{lib → dist}/runtime.d.ts +0 -0
@@ -0,0 +1,319 @@
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
+ var __extends = (this && this.__extends) || (function () {
16
+ var extendStatics = function (d, b) {
17
+ extendStatics = Object.setPrototypeOf ||
18
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
19
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
20
+ return extendStatics(d, b);
21
+ };
22
+ return function (d, b) {
23
+ if (typeof b !== "function" && b !== null)
24
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
25
+ extendStatics(d, b);
26
+ function __() { this.constructor = d; }
27
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
28
+ };
29
+ })();
30
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
31
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
32
+ return new (P || (P = Promise))(function (resolve, reject) {
33
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
34
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
35
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
36
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
37
+ });
38
+ };
39
+ var __generator = (this && this.__generator) || function (thisArg, body) {
40
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
41
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
42
+ function verb(n) { return function (v) { return step([n, v]); }; }
43
+ function step(op) {
44
+ if (f) throw new TypeError("Generator is already executing.");
45
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
46
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
47
+ if (y = 0, t) op = [op[0] & 2, t.value];
48
+ switch (op[0]) {
49
+ case 0: case 1: t = op; break;
50
+ case 4: _.label++; return { value: op[1], done: false };
51
+ case 5: _.label++; y = op[1]; op = [0]; continue;
52
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
53
+ default:
54
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
55
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
56
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
57
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
58
+ if (t[2]) _.ops.pop();
59
+ _.trys.pop(); continue;
60
+ }
61
+ op = body.call(thisArg, _);
62
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
63
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
64
+ }
65
+ };
66
+ Object.defineProperty(exports, "__esModule", { value: true });
67
+ exports.SubaccountsApi = void 0;
68
+ var runtime = require("../runtime");
69
+ var index_1 = require("../models/index");
70
+ /**
71
+ *
72
+ */
73
+ var SubaccountsApi = /** @class */ (function (_super) {
74
+ __extends(SubaccountsApi, _super);
75
+ function SubaccountsApi() {
76
+ return _super !== null && _super.apply(this, arguments) || this;
77
+ }
78
+ /**
79
+ * Creates a new subaccount, allowing you to set network and regional configurations.
80
+ * Create subaccount
81
+ */
82
+ SubaccountsApi.prototype.createSubaccountRaw = function (requestParameters, initOverrides) {
83
+ return __awaiter(this, void 0, void 0, function () {
84
+ var queryParameters, headerParameters, _a, _b, urlPath, response;
85
+ return __generator(this, function (_c) {
86
+ switch (_c.label) {
87
+ case 0:
88
+ queryParameters = {};
89
+ headerParameters = {};
90
+ headerParameters['Content-Type'] = 'application/json';
91
+ if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 2];
92
+ // oauth required
93
+ _a = headerParameters;
94
+ _b = "Authorization";
95
+ return [4 /*yield*/, this.configuration.accessToken("main-auth", ["subaccounts:write"])];
96
+ case 1:
97
+ // oauth required
98
+ _a[_b] = _c.sent();
99
+ _c.label = 2;
100
+ case 2:
101
+ urlPath = "/subaccounts";
102
+ return [4 /*yield*/, this.request({
103
+ path: urlPath,
104
+ method: 'POST',
105
+ headers: headerParameters,
106
+ query: queryParameters,
107
+ body: (0, index_1.CreateSubaccountRequestToJSON)(requestParameters['createSubaccountRequest']),
108
+ }, initOverrides)];
109
+ case 3:
110
+ response = _c.sent();
111
+ return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.SubaccountFromJSON)(jsonValue); })];
112
+ }
113
+ });
114
+ });
115
+ };
116
+ /**
117
+ * Creates a new subaccount, allowing you to set network and regional configurations.
118
+ * Create subaccount
119
+ */
120
+ SubaccountsApi.prototype.createSubaccount = function () {
121
+ return __awaiter(this, arguments, void 0, function (requestParameters, initOverrides) {
122
+ var response;
123
+ if (requestParameters === void 0) { requestParameters = {}; }
124
+ return __generator(this, function (_a) {
125
+ switch (_a.label) {
126
+ case 0: return [4 /*yield*/, this.createSubaccountRaw(requestParameters, initOverrides)];
127
+ case 1:
128
+ response = _a.sent();
129
+ return [4 /*yield*/, response.value()];
130
+ case 2: return [2 /*return*/, _a.sent()];
131
+ }
132
+ });
133
+ });
134
+ };
135
+ /**
136
+ * Returns detailed information about a specific subaccount by its identifier, including configuration details and associated data.
137
+ * Retrieve subaccount
138
+ */
139
+ SubaccountsApi.prototype.getSubaccountRaw = function (requestParameters, initOverrides) {
140
+ return __awaiter(this, void 0, void 0, function () {
141
+ var queryParameters, headerParameters, _a, _b, urlPath, response;
142
+ return __generator(this, function (_c) {
143
+ switch (_c.label) {
144
+ case 0:
145
+ if (requestParameters['subaccountId'] == null) {
146
+ throw new runtime.RequiredError('subaccountId', 'Required parameter "subaccountId" was null or undefined when calling getSubaccount().');
147
+ }
148
+ queryParameters = {};
149
+ headerParameters = {};
150
+ if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 2];
151
+ // oauth required
152
+ _a = headerParameters;
153
+ _b = "Authorization";
154
+ return [4 /*yield*/, this.configuration.accessToken("main-auth", ["subaccounts:read"])];
155
+ case 1:
156
+ // oauth required
157
+ _a[_b] = _c.sent();
158
+ _c.label = 2;
159
+ case 2:
160
+ urlPath = "/subaccounts/{subaccountId}";
161
+ urlPath = urlPath.replace("{".concat("subaccountId", "}"), encodeURIComponent(String(requestParameters['subaccountId'])));
162
+ return [4 /*yield*/, this.request({
163
+ path: urlPath,
164
+ method: 'GET',
165
+ headers: headerParameters,
166
+ query: queryParameters,
167
+ }, initOverrides)];
168
+ case 3:
169
+ response = _c.sent();
170
+ return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.SubaccountFromJSON)(jsonValue); })];
171
+ }
172
+ });
173
+ });
174
+ };
175
+ /**
176
+ * Returns detailed information about a specific subaccount by its identifier, including configuration details and associated data.
177
+ * Retrieve subaccount
178
+ */
179
+ SubaccountsApi.prototype.getSubaccount = function (requestParameters, initOverrides) {
180
+ return __awaiter(this, void 0, void 0, function () {
181
+ var response;
182
+ return __generator(this, function (_a) {
183
+ switch (_a.label) {
184
+ case 0: return [4 /*yield*/, this.getSubaccountRaw(requestParameters, initOverrides)];
185
+ case 1:
186
+ response = _a.sent();
187
+ return [4 /*yield*/, response.value()];
188
+ case 2: return [2 /*return*/, _a.sent()];
189
+ }
190
+ });
191
+ });
192
+ };
193
+ /**
194
+ * Returns a list of all subaccounts associated with the account. This endpoint supports [cursor-based pagination](https://docs.astrada.co/reference/pagination).
195
+ * List subaccounts
196
+ */
197
+ SubaccountsApi.prototype.getSubaccountsRaw = function (requestParameters, initOverrides) {
198
+ return __awaiter(this, void 0, void 0, function () {
199
+ var queryParameters, headerParameters, _a, _b, urlPath, response;
200
+ return __generator(this, function (_c) {
201
+ switch (_c.label) {
202
+ case 0:
203
+ queryParameters = {};
204
+ if (requestParameters['cursor'] != null) {
205
+ queryParameters['cursor'] = requestParameters['cursor'];
206
+ }
207
+ if (requestParameters['limit'] != null) {
208
+ queryParameters['limit'] = requestParameters['limit'];
209
+ }
210
+ headerParameters = {};
211
+ if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 2];
212
+ // oauth required
213
+ _a = headerParameters;
214
+ _b = "Authorization";
215
+ return [4 /*yield*/, this.configuration.accessToken("main-auth", ["subaccounts:read"])];
216
+ case 1:
217
+ // oauth required
218
+ _a[_b] = _c.sent();
219
+ _c.label = 2;
220
+ case 2:
221
+ urlPath = "/subaccounts";
222
+ return [4 /*yield*/, this.request({
223
+ path: urlPath,
224
+ method: 'GET',
225
+ headers: headerParameters,
226
+ query: queryParameters,
227
+ }, initOverrides)];
228
+ case 3:
229
+ response = _c.sent();
230
+ return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.GetSubaccounts200ResponseFromJSON)(jsonValue); })];
231
+ }
232
+ });
233
+ });
234
+ };
235
+ /**
236
+ * Returns a list of all subaccounts associated with the account. This endpoint supports [cursor-based pagination](https://docs.astrada.co/reference/pagination).
237
+ * List subaccounts
238
+ */
239
+ SubaccountsApi.prototype.getSubaccounts = function () {
240
+ return __awaiter(this, arguments, void 0, function (requestParameters, initOverrides) {
241
+ var response;
242
+ if (requestParameters === void 0) { requestParameters = {}; }
243
+ return __generator(this, function (_a) {
244
+ switch (_a.label) {
245
+ case 0: return [4 /*yield*/, this.getSubaccountsRaw(requestParameters, initOverrides)];
246
+ case 1:
247
+ response = _a.sent();
248
+ return [4 /*yield*/, response.value()];
249
+ case 2: return [2 /*return*/, _a.sent()];
250
+ }
251
+ });
252
+ });
253
+ };
254
+ /**
255
+ * 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.
256
+ * Update subaccount configurations
257
+ */
258
+ SubaccountsApi.prototype.updateSubaccountRaw = function (requestParameters, initOverrides) {
259
+ return __awaiter(this, void 0, void 0, function () {
260
+ var queryParameters, headerParameters, _a, _b, urlPath, response;
261
+ return __generator(this, function (_c) {
262
+ switch (_c.label) {
263
+ case 0:
264
+ if (requestParameters['subaccountId'] == null) {
265
+ throw new runtime.RequiredError('subaccountId', 'Required parameter "subaccountId" was null or undefined when calling updateSubaccount().');
266
+ }
267
+ if (requestParameters['updateSubaccountRequest'] == null) {
268
+ throw new runtime.RequiredError('updateSubaccountRequest', 'Required parameter "updateSubaccountRequest" was null or undefined when calling updateSubaccount().');
269
+ }
270
+ queryParameters = {};
271
+ headerParameters = {};
272
+ headerParameters['Content-Type'] = 'application/json';
273
+ if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 2];
274
+ // oauth required
275
+ _a = headerParameters;
276
+ _b = "Authorization";
277
+ return [4 /*yield*/, this.configuration.accessToken("main-auth", ["subaccounts:write"])];
278
+ case 1:
279
+ // oauth required
280
+ _a[_b] = _c.sent();
281
+ _c.label = 2;
282
+ case 2:
283
+ urlPath = "/subaccounts/{subaccountId}";
284
+ urlPath = urlPath.replace("{".concat("subaccountId", "}"), encodeURIComponent(String(requestParameters['subaccountId'])));
285
+ return [4 /*yield*/, this.request({
286
+ path: urlPath,
287
+ method: 'PATCH',
288
+ headers: headerParameters,
289
+ query: queryParameters,
290
+ body: (0, index_1.UpdateSubaccountRequestToJSON)(requestParameters['updateSubaccountRequest']),
291
+ }, initOverrides)];
292
+ case 3:
293
+ response = _c.sent();
294
+ return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.SubaccountFromJSON)(jsonValue); })];
295
+ }
296
+ });
297
+ });
298
+ };
299
+ /**
300
+ * 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.
301
+ * Update subaccount configurations
302
+ */
303
+ SubaccountsApi.prototype.updateSubaccount = function (requestParameters, initOverrides) {
304
+ return __awaiter(this, void 0, void 0, function () {
305
+ var response;
306
+ return __generator(this, function (_a) {
307
+ switch (_a.label) {
308
+ case 0: return [4 /*yield*/, this.updateSubaccountRaw(requestParameters, initOverrides)];
309
+ case 1:
310
+ response = _a.sent();
311
+ return [4 /*yield*/, response.value()];
312
+ case 2: return [2 /*return*/, _a.sent()];
313
+ }
314
+ });
315
+ });
316
+ };
317
+ return SubaccountsApi;
318
+ }(runtime.BaseAPI));
319
+ exports.SubaccountsApi = SubaccountsApi;
@@ -0,0 +1,138 @@
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
+ var __extends = (this && this.__extends) || (function () {
16
+ var extendStatics = function (d, b) {
17
+ extendStatics = Object.setPrototypeOf ||
18
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
19
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
20
+ return extendStatics(d, b);
21
+ };
22
+ return function (d, b) {
23
+ if (typeof b !== "function" && b !== null)
24
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
25
+ extendStatics(d, b);
26
+ function __() { this.constructor = d; }
27
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
28
+ };
29
+ })();
30
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
31
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
32
+ return new (P || (P = Promise))(function (resolve, reject) {
33
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
34
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
35
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
36
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
37
+ });
38
+ };
39
+ var __generator = (this && this.__generator) || function (thisArg, body) {
40
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
41
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
42
+ function verb(n) { return function (v) { return step([n, v]); }; }
43
+ function step(op) {
44
+ if (f) throw new TypeError("Generator is already executing.");
45
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
46
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
47
+ if (y = 0, t) op = [op[0] & 2, t.value];
48
+ switch (op[0]) {
49
+ case 0: case 1: t = op; break;
50
+ case 4: _.label++; return { value: op[1], done: false };
51
+ case 5: _.label++; y = op[1]; op = [0]; continue;
52
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
53
+ default:
54
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
55
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
56
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
57
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
58
+ if (t[2]) _.ops.pop();
59
+ _.trys.pop(); continue;
60
+ }
61
+ op = body.call(thisArg, _);
62
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
63
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
64
+ }
65
+ };
66
+ Object.defineProperty(exports, "__esModule", { value: true });
67
+ exports.TransactionMessagesApi = void 0;
68
+ var runtime = require("../runtime");
69
+ var index_1 = require("../models/index");
70
+ /**
71
+ *
72
+ */
73
+ var TransactionMessagesApi = /** @class */ (function (_super) {
74
+ __extends(TransactionMessagesApi, _super);
75
+ function TransactionMessagesApi() {
76
+ return _super !== null && _super.apply(this, arguments) || this;
77
+ }
78
+ /**
79
+ * Return a transaction message by its unique identifier, including details about the transaction\'s type and relevant transactional data.
80
+ * Retrieve transaction message
81
+ */
82
+ TransactionMessagesApi.prototype.getTransactionMessageByIdRaw = function (requestParameters, initOverrides) {
83
+ return __awaiter(this, void 0, void 0, function () {
84
+ var queryParameters, headerParameters, _a, _b, urlPath, response;
85
+ return __generator(this, function (_c) {
86
+ switch (_c.label) {
87
+ case 0:
88
+ if (requestParameters['transactionMessageId'] == null) {
89
+ throw new runtime.RequiredError('transactionMessageId', 'Required parameter "transactionMessageId" was null or undefined when calling getTransactionMessageById().');
90
+ }
91
+ queryParameters = {};
92
+ headerParameters = {};
93
+ if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 2];
94
+ // oauth required
95
+ _a = headerParameters;
96
+ _b = "Authorization";
97
+ return [4 /*yield*/, this.configuration.accessToken("main-auth", ["transaction-messages:read"])];
98
+ case 1:
99
+ // oauth required
100
+ _a[_b] = _c.sent();
101
+ _c.label = 2;
102
+ case 2:
103
+ urlPath = "/transaction-messages/{transactionMessageId}";
104
+ urlPath = urlPath.replace("{".concat("transactionMessageId", "}"), encodeURIComponent(String(requestParameters['transactionMessageId'])));
105
+ return [4 /*yield*/, this.request({
106
+ path: urlPath,
107
+ method: 'GET',
108
+ headers: headerParameters,
109
+ query: queryParameters,
110
+ }, initOverrides)];
111
+ case 3:
112
+ response = _c.sent();
113
+ return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.TransactionMessageFromJSON)(jsonValue); })];
114
+ }
115
+ });
116
+ });
117
+ };
118
+ /**
119
+ * Return a transaction message by its unique identifier, including details about the transaction\'s type and relevant transactional data.
120
+ * Retrieve transaction message
121
+ */
122
+ TransactionMessagesApi.prototype.getTransactionMessageById = function (requestParameters, initOverrides) {
123
+ return __awaiter(this, void 0, void 0, function () {
124
+ var response;
125
+ return __generator(this, function (_a) {
126
+ switch (_a.label) {
127
+ case 0: return [4 /*yield*/, this.getTransactionMessageByIdRaw(requestParameters, initOverrides)];
128
+ case 1:
129
+ response = _a.sent();
130
+ return [4 /*yield*/, response.value()];
131
+ case 2: return [2 /*return*/, _a.sent()];
132
+ }
133
+ });
134
+ });
135
+ };
136
+ return TransactionMessagesApi;
137
+ }(runtime.BaseAPI));
138
+ exports.TransactionMessagesApi = TransactionMessagesApi;