@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.
- package/.github/workflows/api-sdk-release.yml +33 -20
- package/CHANGELOG.md +2 -2
- package/LICENSE +21 -0
- package/README.md +0 -2
- package/dist/apis/CardApi.js +218 -0
- package/dist/apis/CardSubscriptionApi.js +268 -0
- package/dist/apis/CardholderApi.js +138 -0
- package/dist/apis/EnrollmentMethodsApi.js +139 -0
- package/dist/apis/NetworkBulkFeedsApi.js +264 -0
- package/dist/apis/SubaccountsApi.js +319 -0
- package/dist/apis/TransactionMessagesApi.js +138 -0
- package/dist/apis/TransactionsApi.js +215 -0
- package/dist/apis/WebhooksApi.js +380 -0
- package/{lib → dist}/models/Card.js +5 -4
- package/{lib → dist}/models/CardLinks.js +3 -2
- package/{lib → dist}/models/CardSubscription.js +7 -6
- package/{lib → dist}/models/CardSubscriptionLinks.js +3 -2
- package/{lib → dist}/models/Cardholder.js +6 -5
- package/{lib → dist}/models/CardholderCorporate.js +2 -1
- package/{lib → dist}/models/CardholderLinks.js +3 -2
- package/{lib → dist}/models/Conflict.js +2 -1
- package/{lib → dist}/models/CreateNetworkBulkFeedRequest.js +2 -1
- package/{lib → dist}/models/CreateSubaccountRequest.js +3 -2
- package/{lib → dist}/models/CreateWebhook201Response.d.ts +2 -0
- package/{lib → dist}/models/CreateWebhook201Response.js +8 -5
- package/{lib → dist}/models/CreateWebhookRequest.d.ts +2 -0
- package/{lib → dist}/models/CreateWebhookRequest.js +5 -2
- package/{lib → dist}/models/EnrollmentMethods200Response.js +2 -1
- package/dist/models/EnrollmentMethods413Response.d.ts +45 -0
- package/dist/models/EnrollmentMethods413Response.js +62 -0
- package/{lib → dist}/models/EnrollmentMethodsRequest.js +2 -1
- package/dist/models/GetCardSubscription404Response.d.ts +57 -0
- package/dist/models/GetCardSubscription404Response.js +66 -0
- package/{lib → dist}/models/GetSubaccounts200Response.js +4 -3
- package/{lib → dist}/models/GetSubaccounts200ResponseEmbedded.js +3 -2
- package/{lib → dist}/models/GetSubaccounts200ResponseLinks.js +3 -2
- package/{lib → dist}/models/GetTransactions200Response.js +4 -3
- package/{lib → dist}/models/GetTransactions200ResponseEmbedded.js +3 -2
- package/{lib → dist}/models/InlineObject.js +3 -2
- package/{lib → dist}/models/InlineObject1.js +2 -1
- package/{lib → dist}/models/InlineObject2.js +2 -1
- package/{lib → dist}/models/InlineObject3.js +2 -1
- package/{lib → dist}/models/InlineObject4.js +2 -1
- package/{lib → dist}/models/InlineObject5.js +2 -1
- package/{lib → dist}/models/InlineObjectErrorsInner.js +2 -1
- package/{lib → dist}/models/Link.js +2 -1
- package/{lib → dist}/models/ListCardSubscriptions200Response.js +4 -3
- package/{lib → dist}/models/ListCardSubscriptions200ResponseEmbedded.js +3 -2
- package/{lib → dist}/models/ListCardSubscriptions200ResponseLinks.js +3 -2
- package/dist/models/ListCardSubscriptions400Response.d.ts +52 -0
- package/dist/models/ListCardSubscriptions400Response.js +65 -0
- package/dist/models/ListCardSubscriptions400ResponseErrorsInner.d.ts +38 -0
- package/dist/models/ListCardSubscriptions400ResponseErrorsInner.js +55 -0
- package/dist/models/ListCardSubscriptions401Response.d.ts +45 -0
- package/dist/models/ListCardSubscriptions401Response.js +62 -0
- package/dist/models/ListCardSubscriptions403Response.d.ts +45 -0
- package/dist/models/ListCardSubscriptions403Response.js +62 -0
- package/dist/models/ListCardSubscriptions500Response.d.ts +45 -0
- package/dist/models/ListCardSubscriptions500Response.js +62 -0
- package/{lib → dist}/models/ListCards200Response.js +4 -3
- package/{lib → dist}/models/ListCards200ResponseEmbedded.js +3 -2
- package/{lib → dist}/models/ListNetworkBulkFeeds200Response.js +4 -3
- package/{lib → dist}/models/ListNetworkBulkFeeds200ResponseEmbedded.js +3 -2
- package/{lib → dist}/models/ListWebhooks200Response.js +4 -3
- package/{lib → dist}/models/ListWebhooks200ResponseEmbedded.js +3 -2
- package/{lib → dist}/models/ListWebhooks200ResponseLinks.js +3 -2
- package/{lib → dist}/models/NetworkBulkFeeds.d.ts +16 -1
- package/{lib → dist}/models/NetworkBulkFeeds.js +18 -5
- package/{lib → dist}/models/Subaccount.js +6 -5
- package/{lib → dist}/models/SubaccountConfiguration.js +3 -2
- package/{lib → dist}/models/SubaccountConfigurationVISA.js +2 -1
- package/{lib → dist}/models/Transaction.js +7 -6
- package/{lib → dist}/models/TransactionAcceptor.js +2 -1
- package/{lib → dist}/models/TransactionLinks.js +3 -2
- package/{lib → dist}/models/TransactionMessage.js +7 -6
- package/{lib → dist}/models/TransactionMessageAcceptor.js +2 -1
- package/{lib → dist}/models/UnprocessableEntity.js +2 -1
- package/{lib → dist}/models/UpdateCardSubscriptionRequest.js +2 -1
- package/{lib → dist}/models/UpdateSubaccountRequest.js +3 -2
- package/{lib → dist}/models/UpdateWebhookRequest.d.ts +2 -0
- package/{lib → dist}/models/UpdateWebhookRequest.js +5 -2
- package/{lib → dist}/models/Webhook.d.ts +2 -0
- package/{lib → dist}/models/Webhook.js +8 -5
- package/{lib → dist}/models/index.d.ts +7 -7
- package/{lib → dist}/models/index.js +7 -7
- package/dist/runtime.js +638 -0
- package/docs/Card.md +54 -0
- package/docs/CardApi.md +176 -0
- package/docs/CardLinks.md +36 -0
- package/docs/CardSubscription.md +56 -0
- package/docs/CardSubscriptionApi.md +252 -0
- package/docs/CardSubscriptionLinks.md +38 -0
- package/docs/Cardholder.md +44 -0
- package/docs/CardholderApi.md +85 -0
- package/docs/CardholderCorporate.md +37 -0
- package/docs/CardholderLinks.md +34 -0
- package/docs/Conflict.md +40 -0
- package/docs/CreateNetworkBulkFeedRequest.md +38 -0
- package/docs/CreateSubaccountRequest.md +36 -0
- package/docs/CreateWebhook201Response.md +52 -0
- package/docs/CreateWebhookRequest.md +42 -0
- package/docs/EnrollmentMethods200Response.md +34 -0
- package/docs/EnrollmentMethods413Response.md +36 -0
- package/docs/EnrollmentMethodsApi.md +85 -0
- package/docs/EnrollmentMethodsRequest.md +34 -0
- package/docs/GetCardSubscription404Response.md +40 -0
- package/docs/GetSubaccounts200Response.md +36 -0
- package/docs/GetSubaccounts200ResponseEmbedded.md +34 -0
- package/docs/GetSubaccounts200ResponseLinks.md +36 -0
- package/docs/GetTransactions200Response.md +36 -0
- package/docs/GetTransactions200ResponseEmbedded.md +34 -0
- package/docs/Link.md +48 -0
- package/docs/ListCardSubscriptions200Response.md +38 -0
- package/docs/ListCardSubscriptions200ResponseEmbedded.md +34 -0
- package/docs/ListCardSubscriptions200ResponseLinks.md +42 -0
- package/docs/ListCardSubscriptions400Response.md +38 -0
- package/docs/ListCardSubscriptions400ResponseErrorsInner.md +36 -0
- package/docs/ListCardSubscriptions401Response.md +36 -0
- package/docs/ListCardSubscriptions403Response.md +36 -0
- package/docs/ListCardSubscriptions500Response.md +36 -0
- package/docs/ListCards200Response.md +38 -0
- package/docs/ListCards200ResponseEmbedded.md +34 -0
- package/docs/ListNetworkBulkFeeds200Response.md +38 -0
- package/docs/ListNetworkBulkFeeds200ResponseEmbedded.md +34 -0
- package/docs/ListWebhooks200Response.md +37 -0
- package/docs/ListWebhooks200ResponseEmbedded.md +34 -0
- package/docs/ListWebhooks200ResponseLinks.md +36 -0
- package/docs/NetworkBulkFeeds.md +48 -0
- package/docs/NetworkBulkFeedsApi.md +247 -0
- package/docs/Subaccount.md +46 -0
- package/docs/SubaccountConfiguration.md +37 -0
- package/docs/SubaccountConfigurationVISA.md +34 -0
- package/docs/SubaccountsApi.md +321 -0
- package/docs/Transaction.md +66 -0
- package/docs/TransactionAcceptor.md +41 -0
- package/docs/TransactionLinks.md +40 -0
- package/docs/TransactionMessage.md +70 -0
- package/docs/TransactionMessageAcceptor.md +47 -0
- package/docs/TransactionMessagesApi.md +85 -0
- package/docs/TransactionsApi.md +174 -0
- package/docs/UnprocessableEntity.md +36 -0
- package/docs/UpdateCardSubscriptionRequest.md +34 -0
- package/docs/UpdateSubaccountRequest.md +36 -0
- package/docs/UpdateWebhookRequest.md +40 -0
- package/docs/Webhook.md +51 -0
- package/docs/WebhooksApi.md +401 -0
- package/openapitools.json +7 -0
- package/package.json +11 -11
- package/src/apis/CardApi.ts +15 -15
- package/src/apis/CardSubscriptionApi.ts +15 -15
- package/src/apis/CardholderApi.ts +15 -15
- package/src/apis/EnrollmentMethodsApi.ts +15 -15
- package/src/apis/NetworkBulkFeedsApi.ts +15 -15
- package/src/apis/SubaccountsApi.ts +15 -15
- package/src/apis/TransactionMessagesApi.ts +15 -15
- package/src/apis/TransactionsApi.ts +15 -15
- package/src/apis/WebhooksApi.ts +15 -15
- package/src/models/Card.ts +2 -2
- package/src/models/CardSubscription.ts +4 -4
- package/src/models/Cardholder.ts +2 -2
- package/src/models/CreateWebhook201Response.ts +5 -3
- package/src/models/CreateWebhookRequest.ts +3 -1
- package/src/models/EnrollmentMethods413Response.ts +85 -0
- package/src/models/GetCardSubscription404Response.ts +101 -0
- package/src/models/ListCardSubscriptions400Response.ts +101 -0
- package/src/models/ListCardSubscriptions400ResponseErrorsInner.ts +75 -0
- package/src/models/ListCardSubscriptions401Response.ts +85 -0
- package/src/models/ListCardSubscriptions403Response.ts +85 -0
- package/src/models/ListCardSubscriptions500Response.ts +85 -0
- package/src/models/NetworkBulkFeeds.ts +22 -3
- package/src/models/Subaccount.ts +2 -2
- package/src/models/Transaction.ts +3 -3
- package/src/models/TransactionMessage.ts +3 -3
- package/src/models/UpdateWebhookRequest.ts +3 -1
- package/src/models/Webhook.ts +5 -3
- package/src/models/index.ts +7 -7
- package/src/runtime.ts +0 -1
- package/tsconfig.json +14 -7
- package/dist/astrada.co-ts-astrada-sdk-1.1.0.tgz +0 -0
- package/lib/apis/CardApi.js +0 -109
- package/lib/apis/CardSubscriptionApi.js +0 -133
- package/lib/apis/CardholderApi.js +0 -56
- package/lib/apis/EnrollmentMethodsApi.js +0 -57
- package/lib/apis/NetworkBulkFeedsApi.js +0 -129
- package/lib/apis/SubaccountsApi.js +0 -157
- package/lib/apis/TransactionMessagesApi.js +0 -56
- package/lib/apis/TransactionsApi.js +0 -106
- package/lib/apis/WebhooksApi.js +0 -194
- package/lib/runtime.js +0 -394
- package/openapi-generator/templates/README.mustache +0 -274
- package/openapi-generator/templates/runtime.mustache +0 -515
- /package/{lib → dist}/apis/CardApi.d.ts +0 -0
- /package/{lib → dist}/apis/CardSubscriptionApi.d.ts +0 -0
- /package/{lib → dist}/apis/CardholderApi.d.ts +0 -0
- /package/{lib → dist}/apis/EnrollmentMethodsApi.d.ts +0 -0
- /package/{lib → dist}/apis/NetworkBulkFeedsApi.d.ts +0 -0
- /package/{lib → dist}/apis/SubaccountsApi.d.ts +0 -0
- /package/{lib → dist}/apis/TransactionMessagesApi.d.ts +0 -0
- /package/{lib → dist}/apis/TransactionsApi.d.ts +0 -0
- /package/{lib → dist}/apis/WebhooksApi.d.ts +0 -0
- /package/{lib → dist}/apis/index.d.ts +0 -0
- /package/{lib → dist}/apis/index.js +0 -0
- /package/{lib → dist}/index.d.ts +0 -0
- /package/{lib → dist}/index.js +0 -0
- /package/{lib → dist}/models/Card.d.ts +0 -0
- /package/{lib → dist}/models/CardLinks.d.ts +0 -0
- /package/{lib → dist}/models/CardSubscription.d.ts +0 -0
- /package/{lib → dist}/models/CardSubscriptionLinks.d.ts +0 -0
- /package/{lib → dist}/models/Cardholder.d.ts +0 -0
- /package/{lib → dist}/models/CardholderCorporate.d.ts +0 -0
- /package/{lib → dist}/models/CardholderLinks.d.ts +0 -0
- /package/{lib → dist}/models/Conflict.d.ts +0 -0
- /package/{lib → dist}/models/CreateNetworkBulkFeedRequest.d.ts +0 -0
- /package/{lib → dist}/models/CreateSubaccountRequest.d.ts +0 -0
- /package/{lib → dist}/models/EnrollmentMethods200Response.d.ts +0 -0
- /package/{lib → dist}/models/EnrollmentMethodsRequest.d.ts +0 -0
- /package/{lib → dist}/models/GetSubaccounts200Response.d.ts +0 -0
- /package/{lib → dist}/models/GetSubaccounts200ResponseEmbedded.d.ts +0 -0
- /package/{lib → dist}/models/GetSubaccounts200ResponseLinks.d.ts +0 -0
- /package/{lib → dist}/models/GetTransactions200Response.d.ts +0 -0
- /package/{lib → dist}/models/GetTransactions200ResponseEmbedded.d.ts +0 -0
- /package/{lib → dist}/models/InlineObject.d.ts +0 -0
- /package/{lib → dist}/models/InlineObject1.d.ts +0 -0
- /package/{lib → dist}/models/InlineObject2.d.ts +0 -0
- /package/{lib → dist}/models/InlineObject3.d.ts +0 -0
- /package/{lib → dist}/models/InlineObject4.d.ts +0 -0
- /package/{lib → dist}/models/InlineObject5.d.ts +0 -0
- /package/{lib → dist}/models/InlineObjectErrorsInner.d.ts +0 -0
- /package/{lib → dist}/models/Link.d.ts +0 -0
- /package/{lib → dist}/models/ListCardSubscriptions200Response.d.ts +0 -0
- /package/{lib → dist}/models/ListCardSubscriptions200ResponseEmbedded.d.ts +0 -0
- /package/{lib → dist}/models/ListCardSubscriptions200ResponseLinks.d.ts +0 -0
- /package/{lib → dist}/models/ListCards200Response.d.ts +0 -0
- /package/{lib → dist}/models/ListCards200ResponseEmbedded.d.ts +0 -0
- /package/{lib → dist}/models/ListNetworkBulkFeeds200Response.d.ts +0 -0
- /package/{lib → dist}/models/ListNetworkBulkFeeds200ResponseEmbedded.d.ts +0 -0
- /package/{lib → dist}/models/ListWebhooks200Response.d.ts +0 -0
- /package/{lib → dist}/models/ListWebhooks200ResponseEmbedded.d.ts +0 -0
- /package/{lib → dist}/models/ListWebhooks200ResponseLinks.d.ts +0 -0
- /package/{lib → dist}/models/Subaccount.d.ts +0 -0
- /package/{lib → dist}/models/SubaccountConfiguration.d.ts +0 -0
- /package/{lib → dist}/models/SubaccountConfigurationVISA.d.ts +0 -0
- /package/{lib → dist}/models/Transaction.d.ts +0 -0
- /package/{lib → dist}/models/TransactionAcceptor.d.ts +0 -0
- /package/{lib → dist}/models/TransactionLinks.d.ts +0 -0
- /package/{lib → dist}/models/TransactionMessage.d.ts +0 -0
- /package/{lib → dist}/models/TransactionMessageAcceptor.d.ts +0 -0
- /package/{lib → dist}/models/UnprocessableEntity.d.ts +0 -0
- /package/{lib → dist}/models/UpdateCardSubscriptionRequest.d.ts +0 -0
- /package/{lib → dist}/models/UpdateSubaccountRequest.d.ts +0 -0
- /package/{lib → dist}/runtime.d.ts +0 -0
|
@@ -0,0 +1,215 @@
|
|
|
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.GetTransactionsOrderEnum = exports.TransactionsApi = void 0;
|
|
68
|
+
var runtime = require("../runtime");
|
|
69
|
+
var index_1 = require("../models/index");
|
|
70
|
+
/**
|
|
71
|
+
*
|
|
72
|
+
*/
|
|
73
|
+
var TransactionsApi = /** @class */ (function (_super) {
|
|
74
|
+
__extends(TransactionsApi, _super);
|
|
75
|
+
function TransactionsApi() {
|
|
76
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Returns a transaction by its unique identifier, including details about the transaction\'s state and relevant transactional data.
|
|
80
|
+
* Retrieve transaction
|
|
81
|
+
*/
|
|
82
|
+
TransactionsApi.prototype.getTransactionByIdRaw = 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['transactionId'] == null) {
|
|
89
|
+
throw new runtime.RequiredError('transactionId', 'Required parameter "transactionId" was null or undefined when calling getTransactionById().');
|
|
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", ["transactions:read"])];
|
|
98
|
+
case 1:
|
|
99
|
+
// oauth required
|
|
100
|
+
_a[_b] = _c.sent();
|
|
101
|
+
_c.label = 2;
|
|
102
|
+
case 2:
|
|
103
|
+
urlPath = "/transactions/{transactionId}";
|
|
104
|
+
urlPath = urlPath.replace("{".concat("transactionId", "}"), encodeURIComponent(String(requestParameters['transactionId'])));
|
|
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.TransactionFromJSON)(jsonValue); })];
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
});
|
|
117
|
+
};
|
|
118
|
+
/**
|
|
119
|
+
* Returns a transaction by its unique identifier, including details about the transaction\'s state and relevant transactional data.
|
|
120
|
+
* Retrieve transaction
|
|
121
|
+
*/
|
|
122
|
+
TransactionsApi.prototype.getTransactionById = 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.getTransactionByIdRaw(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
|
+
/**
|
|
137
|
+
* 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).
|
|
138
|
+
* List transactions
|
|
139
|
+
*/
|
|
140
|
+
TransactionsApi.prototype.getTransactionsRaw = function (requestParameters, initOverrides) {
|
|
141
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
142
|
+
var queryParameters, headerParameters, _a, _b, urlPath, response;
|
|
143
|
+
return __generator(this, function (_c) {
|
|
144
|
+
switch (_c.label) {
|
|
145
|
+
case 0:
|
|
146
|
+
queryParameters = {};
|
|
147
|
+
if (requestParameters['transactionMessageId'] != null) {
|
|
148
|
+
queryParameters['transactionMessageId'] = requestParameters['transactionMessageId'];
|
|
149
|
+
}
|
|
150
|
+
if (requestParameters['cursor'] != null) {
|
|
151
|
+
queryParameters['cursor'] = requestParameters['cursor'];
|
|
152
|
+
}
|
|
153
|
+
if (requestParameters['cardId'] != null) {
|
|
154
|
+
queryParameters['cardId'] = requestParameters['cardId'];
|
|
155
|
+
}
|
|
156
|
+
if (requestParameters['limit'] != null) {
|
|
157
|
+
queryParameters['limit'] = requestParameters['limit'];
|
|
158
|
+
}
|
|
159
|
+
if (requestParameters['order'] != null) {
|
|
160
|
+
queryParameters['order'] = requestParameters['order'];
|
|
161
|
+
}
|
|
162
|
+
headerParameters = {};
|
|
163
|
+
if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 2];
|
|
164
|
+
// oauth required
|
|
165
|
+
_a = headerParameters;
|
|
166
|
+
_b = "Authorization";
|
|
167
|
+
return [4 /*yield*/, this.configuration.accessToken("main-auth", ["transactions:read"])];
|
|
168
|
+
case 1:
|
|
169
|
+
// oauth required
|
|
170
|
+
_a[_b] = _c.sent();
|
|
171
|
+
_c.label = 2;
|
|
172
|
+
case 2:
|
|
173
|
+
urlPath = "/transactions";
|
|
174
|
+
return [4 /*yield*/, this.request({
|
|
175
|
+
path: urlPath,
|
|
176
|
+
method: 'GET',
|
|
177
|
+
headers: headerParameters,
|
|
178
|
+
query: queryParameters,
|
|
179
|
+
}, initOverrides)];
|
|
180
|
+
case 3:
|
|
181
|
+
response = _c.sent();
|
|
182
|
+
return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.GetTransactions200ResponseFromJSON)(jsonValue); })];
|
|
183
|
+
}
|
|
184
|
+
});
|
|
185
|
+
});
|
|
186
|
+
};
|
|
187
|
+
/**
|
|
188
|
+
* 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).
|
|
189
|
+
* List transactions
|
|
190
|
+
*/
|
|
191
|
+
TransactionsApi.prototype.getTransactions = function () {
|
|
192
|
+
return __awaiter(this, arguments, void 0, function (requestParameters, initOverrides) {
|
|
193
|
+
var response;
|
|
194
|
+
if (requestParameters === void 0) { requestParameters = {}; }
|
|
195
|
+
return __generator(this, function (_a) {
|
|
196
|
+
switch (_a.label) {
|
|
197
|
+
case 0: return [4 /*yield*/, this.getTransactionsRaw(requestParameters, initOverrides)];
|
|
198
|
+
case 1:
|
|
199
|
+
response = _a.sent();
|
|
200
|
+
return [4 /*yield*/, response.value()];
|
|
201
|
+
case 2: return [2 /*return*/, _a.sent()];
|
|
202
|
+
}
|
|
203
|
+
});
|
|
204
|
+
});
|
|
205
|
+
};
|
|
206
|
+
return TransactionsApi;
|
|
207
|
+
}(runtime.BaseAPI));
|
|
208
|
+
exports.TransactionsApi = TransactionsApi;
|
|
209
|
+
/**
|
|
210
|
+
* @export
|
|
211
|
+
*/
|
|
212
|
+
exports.GetTransactionsOrderEnum = {
|
|
213
|
+
Asc: 'asc',
|
|
214
|
+
Desc: 'desc'
|
|
215
|
+
};
|
|
@@ -0,0 +1,380 @@
|
|
|
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.WebhooksApi = void 0;
|
|
68
|
+
var runtime = require("../runtime");
|
|
69
|
+
var index_1 = require("../models/index");
|
|
70
|
+
/**
|
|
71
|
+
*
|
|
72
|
+
*/
|
|
73
|
+
var WebhooksApi = /** @class */ (function (_super) {
|
|
74
|
+
__extends(WebhooksApi, _super);
|
|
75
|
+
function WebhooksApi() {
|
|
76
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Registers a new webhook for capturing event notifications.
|
|
80
|
+
* Create webhook
|
|
81
|
+
*/
|
|
82
|
+
WebhooksApi.prototype.createWebhookRaw = 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['createWebhookRequest'] == null) {
|
|
89
|
+
throw new runtime.RequiredError('createWebhookRequest', 'Required parameter "createWebhookRequest" was null or undefined when calling createWebhook().');
|
|
90
|
+
}
|
|
91
|
+
queryParameters = {};
|
|
92
|
+
headerParameters = {};
|
|
93
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
94
|
+
if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 2];
|
|
95
|
+
// oauth required
|
|
96
|
+
_a = headerParameters;
|
|
97
|
+
_b = "Authorization";
|
|
98
|
+
return [4 /*yield*/, this.configuration.accessToken("main-auth", ["webhooks:write"])];
|
|
99
|
+
case 1:
|
|
100
|
+
// oauth required
|
|
101
|
+
_a[_b] = _c.sent();
|
|
102
|
+
_c.label = 2;
|
|
103
|
+
case 2:
|
|
104
|
+
urlPath = "/webhooks";
|
|
105
|
+
return [4 /*yield*/, this.request({
|
|
106
|
+
path: urlPath,
|
|
107
|
+
method: 'POST',
|
|
108
|
+
headers: headerParameters,
|
|
109
|
+
query: queryParameters,
|
|
110
|
+
body: (0, index_1.CreateWebhookRequestToJSON)(requestParameters['createWebhookRequest']),
|
|
111
|
+
}, initOverrides)];
|
|
112
|
+
case 3:
|
|
113
|
+
response = _c.sent();
|
|
114
|
+
return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.CreateWebhook201ResponseFromJSON)(jsonValue); })];
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
});
|
|
118
|
+
};
|
|
119
|
+
/**
|
|
120
|
+
* Registers a new webhook for capturing event notifications.
|
|
121
|
+
* Create webhook
|
|
122
|
+
*/
|
|
123
|
+
WebhooksApi.prototype.createWebhook = function (requestParameters, initOverrides) {
|
|
124
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
125
|
+
var response;
|
|
126
|
+
return __generator(this, function (_a) {
|
|
127
|
+
switch (_a.label) {
|
|
128
|
+
case 0: return [4 /*yield*/, this.createWebhookRaw(requestParameters, initOverrides)];
|
|
129
|
+
case 1:
|
|
130
|
+
response = _a.sent();
|
|
131
|
+
return [4 /*yield*/, response.value()];
|
|
132
|
+
case 2: return [2 /*return*/, _a.sent()];
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
});
|
|
136
|
+
};
|
|
137
|
+
/**
|
|
138
|
+
* Remove a configured webhook by its identifier. Results in the resource being deleted and no longer available.
|
|
139
|
+
* Delete webhook
|
|
140
|
+
*/
|
|
141
|
+
WebhooksApi.prototype.deleteWebhookRaw = function (requestParameters, initOverrides) {
|
|
142
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
143
|
+
var queryParameters, headerParameters, _a, _b, urlPath, response;
|
|
144
|
+
return __generator(this, function (_c) {
|
|
145
|
+
switch (_c.label) {
|
|
146
|
+
case 0:
|
|
147
|
+
if (requestParameters['webhookId'] == null) {
|
|
148
|
+
throw new runtime.RequiredError('webhookId', 'Required parameter "webhookId" was null or undefined when calling deleteWebhook().');
|
|
149
|
+
}
|
|
150
|
+
queryParameters = {};
|
|
151
|
+
headerParameters = {};
|
|
152
|
+
if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 2];
|
|
153
|
+
// oauth required
|
|
154
|
+
_a = headerParameters;
|
|
155
|
+
_b = "Authorization";
|
|
156
|
+
return [4 /*yield*/, this.configuration.accessToken("main-auth", ["webhooks:write"])];
|
|
157
|
+
case 1:
|
|
158
|
+
// oauth required
|
|
159
|
+
_a[_b] = _c.sent();
|
|
160
|
+
_c.label = 2;
|
|
161
|
+
case 2:
|
|
162
|
+
urlPath = "/webhooks/{webhookId}";
|
|
163
|
+
urlPath = urlPath.replace("{".concat("webhookId", "}"), encodeURIComponent(String(requestParameters['webhookId'])));
|
|
164
|
+
return [4 /*yield*/, this.request({
|
|
165
|
+
path: urlPath,
|
|
166
|
+
method: 'DELETE',
|
|
167
|
+
headers: headerParameters,
|
|
168
|
+
query: queryParameters,
|
|
169
|
+
}, initOverrides)];
|
|
170
|
+
case 3:
|
|
171
|
+
response = _c.sent();
|
|
172
|
+
return [2 /*return*/, new runtime.VoidApiResponse(response)];
|
|
173
|
+
}
|
|
174
|
+
});
|
|
175
|
+
});
|
|
176
|
+
};
|
|
177
|
+
/**
|
|
178
|
+
* Remove a configured webhook by its identifier. Results in the resource being deleted and no longer available.
|
|
179
|
+
* Delete webhook
|
|
180
|
+
*/
|
|
181
|
+
WebhooksApi.prototype.deleteWebhook = function (requestParameters, initOverrides) {
|
|
182
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
183
|
+
return __generator(this, function (_a) {
|
|
184
|
+
switch (_a.label) {
|
|
185
|
+
case 0: return [4 /*yield*/, this.deleteWebhookRaw(requestParameters, initOverrides)];
|
|
186
|
+
case 1:
|
|
187
|
+
_a.sent();
|
|
188
|
+
return [2 /*return*/];
|
|
189
|
+
}
|
|
190
|
+
});
|
|
191
|
+
});
|
|
192
|
+
};
|
|
193
|
+
/**
|
|
194
|
+
* Returns detailed information about a specific webhook by its identifier, including its configuration and event subscription details.
|
|
195
|
+
* Retrieve webhook
|
|
196
|
+
*/
|
|
197
|
+
WebhooksApi.prototype.getWebhookRaw = 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
|
+
if (requestParameters['webhookId'] == null) {
|
|
204
|
+
throw new runtime.RequiredError('webhookId', 'Required parameter "webhookId" was null or undefined when calling getWebhook().');
|
|
205
|
+
}
|
|
206
|
+
queryParameters = {};
|
|
207
|
+
headerParameters = {};
|
|
208
|
+
if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 2];
|
|
209
|
+
// oauth required
|
|
210
|
+
_a = headerParameters;
|
|
211
|
+
_b = "Authorization";
|
|
212
|
+
return [4 /*yield*/, this.configuration.accessToken("main-auth", ["webhooks:read"])];
|
|
213
|
+
case 1:
|
|
214
|
+
// oauth required
|
|
215
|
+
_a[_b] = _c.sent();
|
|
216
|
+
_c.label = 2;
|
|
217
|
+
case 2:
|
|
218
|
+
urlPath = "/webhooks/{webhookId}";
|
|
219
|
+
urlPath = urlPath.replace("{".concat("webhookId", "}"), encodeURIComponent(String(requestParameters['webhookId'])));
|
|
220
|
+
return [4 /*yield*/, this.request({
|
|
221
|
+
path: urlPath,
|
|
222
|
+
method: 'GET',
|
|
223
|
+
headers: headerParameters,
|
|
224
|
+
query: queryParameters,
|
|
225
|
+
}, initOverrides)];
|
|
226
|
+
case 3:
|
|
227
|
+
response = _c.sent();
|
|
228
|
+
return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.WebhookFromJSON)(jsonValue); })];
|
|
229
|
+
}
|
|
230
|
+
});
|
|
231
|
+
});
|
|
232
|
+
};
|
|
233
|
+
/**
|
|
234
|
+
* Returns detailed information about a specific webhook by its identifier, including its configuration and event subscription details.
|
|
235
|
+
* Retrieve webhook
|
|
236
|
+
*/
|
|
237
|
+
WebhooksApi.prototype.getWebhook = function (requestParameters, initOverrides) {
|
|
238
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
239
|
+
var response;
|
|
240
|
+
return __generator(this, function (_a) {
|
|
241
|
+
switch (_a.label) {
|
|
242
|
+
case 0: return [4 /*yield*/, this.getWebhookRaw(requestParameters, initOverrides)];
|
|
243
|
+
case 1:
|
|
244
|
+
response = _a.sent();
|
|
245
|
+
return [4 /*yield*/, response.value()];
|
|
246
|
+
case 2: return [2 /*return*/, _a.sent()];
|
|
247
|
+
}
|
|
248
|
+
});
|
|
249
|
+
});
|
|
250
|
+
};
|
|
251
|
+
/**
|
|
252
|
+
* 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).
|
|
253
|
+
* List webhooks
|
|
254
|
+
*/
|
|
255
|
+
WebhooksApi.prototype.listWebhooksRaw = function (requestParameters, initOverrides) {
|
|
256
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
257
|
+
var queryParameters, headerParameters, _a, _b, urlPath, response;
|
|
258
|
+
return __generator(this, function (_c) {
|
|
259
|
+
switch (_c.label) {
|
|
260
|
+
case 0:
|
|
261
|
+
queryParameters = {};
|
|
262
|
+
if (requestParameters['subaccountId'] != null) {
|
|
263
|
+
queryParameters['subaccountId'] = requestParameters['subaccountId'];
|
|
264
|
+
}
|
|
265
|
+
if (requestParameters['limit'] != null) {
|
|
266
|
+
queryParameters['limit'] = requestParameters['limit'];
|
|
267
|
+
}
|
|
268
|
+
if (requestParameters['cursor'] != null) {
|
|
269
|
+
queryParameters['cursor'] = requestParameters['cursor'];
|
|
270
|
+
}
|
|
271
|
+
headerParameters = {};
|
|
272
|
+
if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 2];
|
|
273
|
+
// oauth required
|
|
274
|
+
_a = headerParameters;
|
|
275
|
+
_b = "Authorization";
|
|
276
|
+
return [4 /*yield*/, this.configuration.accessToken("main-auth", ["webhooks:read"])];
|
|
277
|
+
case 1:
|
|
278
|
+
// oauth required
|
|
279
|
+
_a[_b] = _c.sent();
|
|
280
|
+
_c.label = 2;
|
|
281
|
+
case 2:
|
|
282
|
+
urlPath = "/webhooks";
|
|
283
|
+
return [4 /*yield*/, this.request({
|
|
284
|
+
path: urlPath,
|
|
285
|
+
method: 'GET',
|
|
286
|
+
headers: headerParameters,
|
|
287
|
+
query: queryParameters,
|
|
288
|
+
}, initOverrides)];
|
|
289
|
+
case 3:
|
|
290
|
+
response = _c.sent();
|
|
291
|
+
return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.ListWebhooks200ResponseFromJSON)(jsonValue); })];
|
|
292
|
+
}
|
|
293
|
+
});
|
|
294
|
+
});
|
|
295
|
+
};
|
|
296
|
+
/**
|
|
297
|
+
* 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).
|
|
298
|
+
* List webhooks
|
|
299
|
+
*/
|
|
300
|
+
WebhooksApi.prototype.listWebhooks = function () {
|
|
301
|
+
return __awaiter(this, arguments, void 0, function (requestParameters, initOverrides) {
|
|
302
|
+
var response;
|
|
303
|
+
if (requestParameters === void 0) { requestParameters = {}; }
|
|
304
|
+
return __generator(this, function (_a) {
|
|
305
|
+
switch (_a.label) {
|
|
306
|
+
case 0: return [4 /*yield*/, this.listWebhooksRaw(requestParameters, initOverrides)];
|
|
307
|
+
case 1:
|
|
308
|
+
response = _a.sent();
|
|
309
|
+
return [4 /*yield*/, response.value()];
|
|
310
|
+
case 2: return [2 /*return*/, _a.sent()];
|
|
311
|
+
}
|
|
312
|
+
});
|
|
313
|
+
});
|
|
314
|
+
};
|
|
315
|
+
/**
|
|
316
|
+
* Updates the configuration of an existing webhook, allowing changes to the event subscriptions or notification URL.
|
|
317
|
+
* Update webhook
|
|
318
|
+
*/
|
|
319
|
+
WebhooksApi.prototype.updateWebhookRaw = function (requestParameters, initOverrides) {
|
|
320
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
321
|
+
var queryParameters, headerParameters, _a, _b, urlPath, response;
|
|
322
|
+
return __generator(this, function (_c) {
|
|
323
|
+
switch (_c.label) {
|
|
324
|
+
case 0:
|
|
325
|
+
if (requestParameters['webhookId'] == null) {
|
|
326
|
+
throw new runtime.RequiredError('webhookId', 'Required parameter "webhookId" was null or undefined when calling updateWebhook().');
|
|
327
|
+
}
|
|
328
|
+
if (requestParameters['updateWebhookRequest'] == null) {
|
|
329
|
+
throw new runtime.RequiredError('updateWebhookRequest', 'Required parameter "updateWebhookRequest" was null or undefined when calling updateWebhook().');
|
|
330
|
+
}
|
|
331
|
+
queryParameters = {};
|
|
332
|
+
headerParameters = {};
|
|
333
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
334
|
+
if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 2];
|
|
335
|
+
// oauth required
|
|
336
|
+
_a = headerParameters;
|
|
337
|
+
_b = "Authorization";
|
|
338
|
+
return [4 /*yield*/, this.configuration.accessToken("main-auth", ["webhooks:write"])];
|
|
339
|
+
case 1:
|
|
340
|
+
// oauth required
|
|
341
|
+
_a[_b] = _c.sent();
|
|
342
|
+
_c.label = 2;
|
|
343
|
+
case 2:
|
|
344
|
+
urlPath = "/webhooks/{webhookId}";
|
|
345
|
+
urlPath = urlPath.replace("{".concat("webhookId", "}"), encodeURIComponent(String(requestParameters['webhookId'])));
|
|
346
|
+
return [4 /*yield*/, this.request({
|
|
347
|
+
path: urlPath,
|
|
348
|
+
method: 'PATCH',
|
|
349
|
+
headers: headerParameters,
|
|
350
|
+
query: queryParameters,
|
|
351
|
+
body: (0, index_1.UpdateWebhookRequestToJSON)(requestParameters['updateWebhookRequest']),
|
|
352
|
+
}, initOverrides)];
|
|
353
|
+
case 3:
|
|
354
|
+
response = _c.sent();
|
|
355
|
+
return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.WebhookFromJSON)(jsonValue); })];
|
|
356
|
+
}
|
|
357
|
+
});
|
|
358
|
+
});
|
|
359
|
+
};
|
|
360
|
+
/**
|
|
361
|
+
* Updates the configuration of an existing webhook, allowing changes to the event subscriptions or notification URL.
|
|
362
|
+
* Update webhook
|
|
363
|
+
*/
|
|
364
|
+
WebhooksApi.prototype.updateWebhook = function (requestParameters, initOverrides) {
|
|
365
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
366
|
+
var response;
|
|
367
|
+
return __generator(this, function (_a) {
|
|
368
|
+
switch (_a.label) {
|
|
369
|
+
case 0: return [4 /*yield*/, this.updateWebhookRaw(requestParameters, initOverrides)];
|
|
370
|
+
case 1:
|
|
371
|
+
response = _a.sent();
|
|
372
|
+
return [4 /*yield*/, response.value()];
|
|
373
|
+
case 2: return [2 /*return*/, _a.sent()];
|
|
374
|
+
}
|
|
375
|
+
});
|
|
376
|
+
});
|
|
377
|
+
};
|
|
378
|
+
return WebhooksApi;
|
|
379
|
+
}(runtime.BaseAPI));
|
|
380
|
+
exports.WebhooksApi = WebhooksApi;
|
|
@@ -19,7 +19,7 @@ exports.CardFromJSON = CardFromJSON;
|
|
|
19
19
|
exports.CardFromJSONTyped = CardFromJSONTyped;
|
|
20
20
|
exports.CardToJSON = CardToJSON;
|
|
21
21
|
exports.CardToJSONTyped = CardToJSONTyped;
|
|
22
|
-
|
|
22
|
+
var CardLinks_1 = require("./CardLinks");
|
|
23
23
|
/**
|
|
24
24
|
* @export
|
|
25
25
|
*/
|
|
@@ -89,7 +89,8 @@ function CardFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
89
89
|
function CardToJSON(json) {
|
|
90
90
|
return CardToJSONTyped(json, false);
|
|
91
91
|
}
|
|
92
|
-
function CardToJSONTyped(value, ignoreDiscriminator
|
|
92
|
+
function CardToJSONTyped(value, ignoreDiscriminator) {
|
|
93
|
+
if (ignoreDiscriminator === void 0) { ignoreDiscriminator = false; }
|
|
93
94
|
if (value == null) {
|
|
94
95
|
return value;
|
|
95
96
|
}
|
|
@@ -103,7 +104,7 @@ function CardToJSONTyped(value, ignoreDiscriminator = false) {
|
|
|
103
104
|
'last4digits': value['last4digits'],
|
|
104
105
|
'network': value['network'],
|
|
105
106
|
'country': value['country'],
|
|
106
|
-
'createdAt':
|
|
107
|
-
'updatedAt':
|
|
107
|
+
'createdAt': value['createdAt'].toISOString(),
|
|
108
|
+
'updatedAt': value['updatedAt'].toISOString(),
|
|
108
109
|
};
|
|
109
110
|
}
|
|
@@ -18,7 +18,7 @@ exports.CardLinksFromJSON = CardLinksFromJSON;
|
|
|
18
18
|
exports.CardLinksFromJSONTyped = CardLinksFromJSONTyped;
|
|
19
19
|
exports.CardLinksToJSON = CardLinksToJSON;
|
|
20
20
|
exports.CardLinksToJSONTyped = CardLinksToJSONTyped;
|
|
21
|
-
|
|
21
|
+
var Link_1 = require("./Link");
|
|
22
22
|
/**
|
|
23
23
|
* Check if a given object implements the CardLinks interface.
|
|
24
24
|
*/
|
|
@@ -42,7 +42,8 @@ function CardLinksFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
42
42
|
function CardLinksToJSON(json) {
|
|
43
43
|
return CardLinksToJSONTyped(json, false);
|
|
44
44
|
}
|
|
45
|
-
function CardLinksToJSONTyped(value, ignoreDiscriminator
|
|
45
|
+
function CardLinksToJSONTyped(value, ignoreDiscriminator) {
|
|
46
|
+
if (ignoreDiscriminator === void 0) { ignoreDiscriminator = false; }
|
|
46
47
|
if (value == null) {
|
|
47
48
|
return value;
|
|
48
49
|
}
|