@unified-api/typescript-sdk 1.0.38 → 1.0.40

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 (41) hide show
  1. package/dist/sdk/accounting.d.ts +24 -0
  2. package/dist/sdk/accounting.js +402 -0
  3. package/dist/sdk/models/operations/createaccountingtransaction.d.ts +28 -0
  4. package/dist/sdk/models/operations/createaccountingtransaction.js +95 -0
  5. package/dist/sdk/models/operations/getaccountingtransaction.d.ts +35 -0
  6. package/dist/sdk/models/operations/getaccountingtransaction.js +99 -0
  7. package/dist/sdk/models/operations/index.d.ts +6 -0
  8. package/dist/sdk/models/operations/index.js +6 -0
  9. package/dist/sdk/models/operations/listaccountingtransactions.d.ts +44 -0
  10. package/dist/sdk/models/operations/listaccountingtransactions.js +123 -0
  11. package/dist/sdk/models/operations/listatsjobs.d.ts +1 -0
  12. package/dist/sdk/models/operations/listatsjobs.js +4 -0
  13. package/dist/sdk/models/operations/patchaccountingtransaction.d.ts +32 -0
  14. package/dist/sdk/models/operations/patchaccountingtransaction.js +99 -0
  15. package/dist/sdk/models/operations/removeaccountingtransaction.d.ts +30 -0
  16. package/dist/sdk/models/operations/removeaccountingtransaction.js +71 -0
  17. package/dist/sdk/models/operations/updateaccountingtransaction.d.ts +32 -0
  18. package/dist/sdk/models/operations/updateaccountingtransaction.js +99 -0
  19. package/dist/sdk/models/shared/accountingtransaction.d.ts +20 -0
  20. package/dist/sdk/models/shared/accountingtransaction.js +133 -0
  21. package/dist/sdk/models/shared/index.d.ts +1 -0
  22. package/dist/sdk/models/shared/index.js +1 -0
  23. package/dist/sdk/sdk.d.ts +2 -0
  24. package/dist/sdk/sdk.js +5 -3
  25. package/dist/sdk/transaction.d.ts +31 -0
  26. package/dist/sdk/transaction.js +505 -0
  27. package/docs/sdk/models/operations/createaccountingtransactionrequest.md +9 -0
  28. package/docs/sdk/models/operations/createaccountingtransactionresponse.md +11 -0
  29. package/docs/sdk/models/operations/getaccountingtransactionrequest.md +10 -0
  30. package/docs/sdk/models/operations/getaccountingtransactionresponse.md +11 -0
  31. package/docs/sdk/models/operations/listaccountingtransactionsrequest.md +16 -0
  32. package/docs/sdk/models/operations/listaccountingtransactionsresponse.md +11 -0
  33. package/docs/sdk/models/operations/listatsjobsrequest.md +2 -1
  34. package/docs/sdk/models/operations/patchaccountingtransactionrequest.md +10 -0
  35. package/docs/sdk/models/operations/patchaccountingtransactionresponse.md +11 -0
  36. package/docs/sdk/models/operations/removeaccountingtransactionrequest.md +9 -0
  37. package/docs/sdk/models/operations/removeaccountingtransactionresponse.md +11 -0
  38. package/docs/sdk/models/operations/updateaccountingtransactionrequest.md +10 -0
  39. package/docs/sdk/models/operations/updateaccountingtransactionresponse.md +11 -0
  40. package/docs/sdk/models/shared/accountingtransaction.md +24 -0
  41. package/package.json +1 -1
@@ -24,6 +24,10 @@ export declare class Accounting {
24
24
  * Create a taxrate
25
25
  */
26
26
  createAccountingTaxrate(req: operations.CreateAccountingTaxrateRequest, config?: AxiosRequestConfig): Promise<operations.CreateAccountingTaxrateResponse>;
27
+ /**
28
+ * Create a transaction
29
+ */
30
+ createAccountingTransaction(req: operations.CreateAccountingTransactionRequest, config?: AxiosRequestConfig): Promise<operations.CreateAccountingTransactionResponse>;
27
31
  /**
28
32
  * Retrieve an account
29
33
  */
@@ -48,6 +52,10 @@ export declare class Accounting {
48
52
  * Retrieve a taxrate
49
53
  */
50
54
  getAccountingTaxrate(req: operations.GetAccountingTaxrateRequest, config?: AxiosRequestConfig): Promise<operations.GetAccountingTaxrateResponse>;
55
+ /**
56
+ * Retrieve a transaction
57
+ */
58
+ getAccountingTransaction(req: operations.GetAccountingTransactionRequest, config?: AxiosRequestConfig): Promise<operations.GetAccountingTransactionResponse>;
51
59
  /**
52
60
  * List all accounts
53
61
  */
@@ -72,6 +80,10 @@ export declare class Accounting {
72
80
  * List all taxrates
73
81
  */
74
82
  listAccountingTaxrates(req: operations.ListAccountingTaxratesRequest, config?: AxiosRequestConfig): Promise<operations.ListAccountingTaxratesResponse>;
83
+ /**
84
+ * List all transactions
85
+ */
86
+ listAccountingTransactions(req: operations.ListAccountingTransactionsRequest, config?: AxiosRequestConfig): Promise<operations.ListAccountingTransactionsResponse>;
75
87
  /**
76
88
  * Update an account
77
89
  */
@@ -92,6 +104,10 @@ export declare class Accounting {
92
104
  * Update a taxrate
93
105
  */
94
106
  patchAccountingTaxrate(req: operations.PatchAccountingTaxrateRequest, config?: AxiosRequestConfig): Promise<operations.PatchAccountingTaxrateResponse>;
107
+ /**
108
+ * Update a transaction
109
+ */
110
+ patchAccountingTransaction(req: operations.PatchAccountingTransactionRequest, config?: AxiosRequestConfig): Promise<operations.PatchAccountingTransactionResponse>;
95
111
  /**
96
112
  * Remove an account
97
113
  */
@@ -112,6 +128,10 @@ export declare class Accounting {
112
128
  * Remove a taxrate
113
129
  */
114
130
  removeAccountingTaxrate(req: operations.RemoveAccountingTaxrateRequest, config?: AxiosRequestConfig): Promise<operations.RemoveAccountingTaxrateResponse>;
131
+ /**
132
+ * Remove a transaction
133
+ */
134
+ removeAccountingTransaction(req: operations.RemoveAccountingTransactionRequest, config?: AxiosRequestConfig): Promise<operations.RemoveAccountingTransactionResponse>;
115
135
  /**
116
136
  * Update an account
117
137
  */
@@ -132,4 +152,8 @@ export declare class Accounting {
132
152
  * Update a taxrate
133
153
  */
134
154
  updateAccountingTaxrate(req: operations.UpdateAccountingTaxrateRequest, config?: AxiosRequestConfig): Promise<operations.UpdateAccountingTaxrateResponse>;
155
+ /**
156
+ * Update a transaction
157
+ */
158
+ updateAccountingTransaction(req: operations.UpdateAccountingTransactionRequest, config?: AxiosRequestConfig): Promise<operations.UpdateAccountingTransactionResponse>;
135
159
  }
@@ -453,6 +453,77 @@ var Accounting = /** @class */ (function () {
453
453
  });
454
454
  });
455
455
  };
456
+ /**
457
+ * Create a transaction
458
+ */
459
+ Accounting.prototype.createAccountingTransaction = function (req, config) {
460
+ var _a, _b;
461
+ return __awaiter(this, void 0, void 0, function () {
462
+ var baseURL, operationUrl, _c, reqBodyHeaders, reqBody, client, globalSecurity, properties, headers, httpRes, responseContentType, res, decodedRes;
463
+ var _d;
464
+ return __generator(this, function (_e) {
465
+ switch (_e.label) {
466
+ case 0:
467
+ if (!(req instanceof utils.SpeakeasyBase)) {
468
+ req = new operations.CreateAccountingTransactionRequest(req);
469
+ }
470
+ baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
471
+ operationUrl = utils.generateURL(baseURL, "/accounting/{connection_id}/transaction", req);
472
+ _c = __read([{}, null], 2), reqBodyHeaders = _c[0], reqBody = _c[1];
473
+ try {
474
+ _d = __read(utils.serializeRequestBody(req, "accountingTransaction", "json"), 2), reqBodyHeaders = _d[0], reqBody = _d[1];
475
+ }
476
+ catch (e) {
477
+ if (e instanceof Error) {
478
+ throw new Error("Error serializing request body, cause: ".concat(e.message));
479
+ }
480
+ }
481
+ client = this.sdkConfiguration.defaultClient;
482
+ globalSecurity = this.sdkConfiguration.security;
483
+ if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
484
+ return [4 /*yield*/, globalSecurity()];
485
+ case 1:
486
+ globalSecurity = _e.sent();
487
+ _e.label = 2;
488
+ case 2:
489
+ if (!(globalSecurity instanceof utils.SpeakeasyBase)) {
490
+ globalSecurity = new shared.Security(globalSecurity);
491
+ }
492
+ properties = utils.parseSecurityProperties(globalSecurity);
493
+ headers = __assign(__assign(__assign({}, reqBodyHeaders), config === null || config === void 0 ? void 0 : config.headers), properties.headers);
494
+ headers["Accept"] = "application/json";
495
+ headers["user-agent"] = this.sdkConfiguration.userAgent;
496
+ return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: operationUrl, method: "post", headers: headers, responseType: "arraybuffer", data: reqBody }, config))];
497
+ case 3:
498
+ httpRes = _e.sent();
499
+ responseContentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
500
+ if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
501
+ throw new Error("status code not found in response: ".concat(httpRes));
502
+ }
503
+ res = new operations.CreateAccountingTransactionResponse({
504
+ statusCode: httpRes.status,
505
+ contentType: responseContentType,
506
+ rawResponse: httpRes,
507
+ });
508
+ decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
509
+ switch (true) {
510
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
511
+ if (utils.matchContentType(responseContentType, "application/json")) {
512
+ res.accountingTransaction = utils.objectToClass(JSON.parse(decodedRes), shared.AccountingTransaction);
513
+ }
514
+ else {
515
+ throw new errors.SDKError("unknown content-type received: " + responseContentType, httpRes.status, decodedRes, httpRes);
516
+ }
517
+ break;
518
+ case ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 400 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 500) ||
519
+ ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 500 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 600):
520
+ throw new errors.SDKError("API error occurred", httpRes.status, decodedRes, httpRes);
521
+ }
522
+ return [2 /*return*/, res];
523
+ }
524
+ });
525
+ });
526
+ };
456
527
  /**
457
528
  * Retrieve an account
458
529
  */
@@ -825,6 +896,68 @@ var Accounting = /** @class */ (function () {
825
896
  });
826
897
  });
827
898
  };
899
+ /**
900
+ * Retrieve a transaction
901
+ */
902
+ Accounting.prototype.getAccountingTransaction = function (req, config) {
903
+ var _a, _b;
904
+ return __awaiter(this, void 0, void 0, function () {
905
+ var baseURL, operationUrl, client, globalSecurity, properties, headers, queryParams, httpRes, responseContentType, res, decodedRes;
906
+ return __generator(this, function (_c) {
907
+ switch (_c.label) {
908
+ case 0:
909
+ if (!(req instanceof utils.SpeakeasyBase)) {
910
+ req = new operations.GetAccountingTransactionRequest(req);
911
+ }
912
+ baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
913
+ operationUrl = utils.generateURL(baseURL, "/accounting/{connection_id}/transaction/{id}", req);
914
+ client = this.sdkConfiguration.defaultClient;
915
+ globalSecurity = this.sdkConfiguration.security;
916
+ if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
917
+ return [4 /*yield*/, globalSecurity()];
918
+ case 1:
919
+ globalSecurity = _c.sent();
920
+ _c.label = 2;
921
+ case 2:
922
+ if (!(globalSecurity instanceof utils.SpeakeasyBase)) {
923
+ globalSecurity = new shared.Security(globalSecurity);
924
+ }
925
+ properties = utils.parseSecurityProperties(globalSecurity);
926
+ headers = __assign(__assign({}, config === null || config === void 0 ? void 0 : config.headers), properties.headers);
927
+ queryParams = utils.serializeQueryParams(req);
928
+ headers["Accept"] = "application/json";
929
+ headers["user-agent"] = this.sdkConfiguration.userAgent;
930
+ return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: operationUrl + queryParams, method: "get", headers: headers, responseType: "arraybuffer" }, config))];
931
+ case 3:
932
+ httpRes = _c.sent();
933
+ responseContentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
934
+ if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
935
+ throw new Error("status code not found in response: ".concat(httpRes));
936
+ }
937
+ res = new operations.GetAccountingTransactionResponse({
938
+ statusCode: httpRes.status,
939
+ contentType: responseContentType,
940
+ rawResponse: httpRes,
941
+ });
942
+ decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
943
+ switch (true) {
944
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
945
+ if (utils.matchContentType(responseContentType, "application/json")) {
946
+ res.accountingTransaction = utils.objectToClass(JSON.parse(decodedRes), shared.AccountingTransaction);
947
+ }
948
+ else {
949
+ throw new errors.SDKError("unknown content-type received: " + responseContentType, httpRes.status, decodedRes, httpRes);
950
+ }
951
+ break;
952
+ case ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 400 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 500) ||
953
+ ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 500 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 600):
954
+ throw new errors.SDKError("API error occurred", httpRes.status, decodedRes, httpRes);
955
+ }
956
+ return [2 /*return*/, res];
957
+ }
958
+ });
959
+ });
960
+ };
828
961
  /**
829
962
  * List all accounts
830
963
  */
@@ -1209,6 +1342,70 @@ var Accounting = /** @class */ (function () {
1209
1342
  });
1210
1343
  });
1211
1344
  };
1345
+ /**
1346
+ * List all transactions
1347
+ */
1348
+ Accounting.prototype.listAccountingTransactions = function (req, config) {
1349
+ var _a, _b;
1350
+ return __awaiter(this, void 0, void 0, function () {
1351
+ var baseURL, operationUrl, client, globalSecurity, properties, headers, queryParams, httpRes, responseContentType, res, decodedRes, resFieldDepth;
1352
+ return __generator(this, function (_c) {
1353
+ switch (_c.label) {
1354
+ case 0:
1355
+ if (!(req instanceof utils.SpeakeasyBase)) {
1356
+ req = new operations.ListAccountingTransactionsRequest(req);
1357
+ }
1358
+ baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
1359
+ operationUrl = utils.generateURL(baseURL, "/accounting/{connection_id}/transaction", req);
1360
+ client = this.sdkConfiguration.defaultClient;
1361
+ globalSecurity = this.sdkConfiguration.security;
1362
+ if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
1363
+ return [4 /*yield*/, globalSecurity()];
1364
+ case 1:
1365
+ globalSecurity = _c.sent();
1366
+ _c.label = 2;
1367
+ case 2:
1368
+ if (!(globalSecurity instanceof utils.SpeakeasyBase)) {
1369
+ globalSecurity = new shared.Security(globalSecurity);
1370
+ }
1371
+ properties = utils.parseSecurityProperties(globalSecurity);
1372
+ headers = __assign(__assign({}, config === null || config === void 0 ? void 0 : config.headers), properties.headers);
1373
+ queryParams = utils.serializeQueryParams(req);
1374
+ headers["Accept"] = "application/json";
1375
+ headers["user-agent"] = this.sdkConfiguration.userAgent;
1376
+ return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: operationUrl + queryParams, method: "get", headers: headers, responseType: "arraybuffer" }, config))];
1377
+ case 3:
1378
+ httpRes = _c.sent();
1379
+ responseContentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
1380
+ if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
1381
+ throw new Error("status code not found in response: ".concat(httpRes));
1382
+ }
1383
+ res = new operations.ListAccountingTransactionsResponse({
1384
+ statusCode: httpRes.status,
1385
+ contentType: responseContentType,
1386
+ rawResponse: httpRes,
1387
+ });
1388
+ decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
1389
+ switch (true) {
1390
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
1391
+ if (utils.matchContentType(responseContentType, "application/json")) {
1392
+ res.accountingTransactions = [];
1393
+ resFieldDepth = utils.getResFieldDepth(res);
1394
+ res.accountingTransactions = utils.objectToClass(JSON.parse(decodedRes), shared.AccountingTransaction, resFieldDepth);
1395
+ }
1396
+ else {
1397
+ throw new errors.SDKError("unknown content-type received: " + responseContentType, httpRes.status, decodedRes, httpRes);
1398
+ }
1399
+ break;
1400
+ case ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 400 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 500) ||
1401
+ ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 500 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 600):
1402
+ throw new errors.SDKError("API error occurred", httpRes.status, decodedRes, httpRes);
1403
+ }
1404
+ return [2 /*return*/, res];
1405
+ }
1406
+ });
1407
+ });
1408
+ };
1212
1409
  /**
1213
1410
  * Update an account
1214
1411
  */
@@ -1564,6 +1761,77 @@ var Accounting = /** @class */ (function () {
1564
1761
  });
1565
1762
  });
1566
1763
  };
1764
+ /**
1765
+ * Update a transaction
1766
+ */
1767
+ Accounting.prototype.patchAccountingTransaction = function (req, config) {
1768
+ var _a, _b;
1769
+ return __awaiter(this, void 0, void 0, function () {
1770
+ var baseURL, operationUrl, _c, reqBodyHeaders, reqBody, client, globalSecurity, properties, headers, httpRes, responseContentType, res, decodedRes;
1771
+ var _d;
1772
+ return __generator(this, function (_e) {
1773
+ switch (_e.label) {
1774
+ case 0:
1775
+ if (!(req instanceof utils.SpeakeasyBase)) {
1776
+ req = new operations.PatchAccountingTransactionRequest(req);
1777
+ }
1778
+ baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
1779
+ operationUrl = utils.generateURL(baseURL, "/accounting/{connection_id}/transaction/{id}", req);
1780
+ _c = __read([{}, null], 2), reqBodyHeaders = _c[0], reqBody = _c[1];
1781
+ try {
1782
+ _d = __read(utils.serializeRequestBody(req, "accountingTransaction", "json"), 2), reqBodyHeaders = _d[0], reqBody = _d[1];
1783
+ }
1784
+ catch (e) {
1785
+ if (e instanceof Error) {
1786
+ throw new Error("Error serializing request body, cause: ".concat(e.message));
1787
+ }
1788
+ }
1789
+ client = this.sdkConfiguration.defaultClient;
1790
+ globalSecurity = this.sdkConfiguration.security;
1791
+ if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
1792
+ return [4 /*yield*/, globalSecurity()];
1793
+ case 1:
1794
+ globalSecurity = _e.sent();
1795
+ _e.label = 2;
1796
+ case 2:
1797
+ if (!(globalSecurity instanceof utils.SpeakeasyBase)) {
1798
+ globalSecurity = new shared.Security(globalSecurity);
1799
+ }
1800
+ properties = utils.parseSecurityProperties(globalSecurity);
1801
+ headers = __assign(__assign(__assign({}, reqBodyHeaders), config === null || config === void 0 ? void 0 : config.headers), properties.headers);
1802
+ headers["Accept"] = "application/json";
1803
+ headers["user-agent"] = this.sdkConfiguration.userAgent;
1804
+ return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: operationUrl, method: "patch", headers: headers, responseType: "arraybuffer", data: reqBody }, config))];
1805
+ case 3:
1806
+ httpRes = _e.sent();
1807
+ responseContentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
1808
+ if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
1809
+ throw new Error("status code not found in response: ".concat(httpRes));
1810
+ }
1811
+ res = new operations.PatchAccountingTransactionResponse({
1812
+ statusCode: httpRes.status,
1813
+ contentType: responseContentType,
1814
+ rawResponse: httpRes,
1815
+ });
1816
+ decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
1817
+ switch (true) {
1818
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
1819
+ if (utils.matchContentType(responseContentType, "application/json")) {
1820
+ res.accountingTransaction = utils.objectToClass(JSON.parse(decodedRes), shared.AccountingTransaction);
1821
+ }
1822
+ else {
1823
+ throw new errors.SDKError("unknown content-type received: " + responseContentType, httpRes.status, decodedRes, httpRes);
1824
+ }
1825
+ break;
1826
+ case ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 400 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 500) ||
1827
+ ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 500 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 600):
1828
+ throw new errors.SDKError("API error occurred", httpRes.status, decodedRes, httpRes);
1829
+ }
1830
+ return [2 /*return*/, res];
1831
+ }
1832
+ });
1833
+ });
1834
+ };
1567
1835
  /**
1568
1836
  * Remove an account
1569
1837
  */
@@ -1879,6 +2147,69 @@ var Accounting = /** @class */ (function () {
1879
2147
  });
1880
2148
  });
1881
2149
  };
2150
+ /**
2151
+ * Remove a transaction
2152
+ */
2153
+ Accounting.prototype.removeAccountingTransaction = function (req, config) {
2154
+ var _a, _b;
2155
+ return __awaiter(this, void 0, void 0, function () {
2156
+ var baseURL, operationUrl, client, globalSecurity, properties, headers, httpRes, responseContentType, res, decodedRes;
2157
+ return __generator(this, function (_c) {
2158
+ switch (_c.label) {
2159
+ case 0:
2160
+ if (!(req instanceof utils.SpeakeasyBase)) {
2161
+ req = new operations.RemoveAccountingTransactionRequest(req);
2162
+ }
2163
+ baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
2164
+ operationUrl = utils.generateURL(baseURL, "/accounting/{connection_id}/transaction/{id}", req);
2165
+ client = this.sdkConfiguration.defaultClient;
2166
+ globalSecurity = this.sdkConfiguration.security;
2167
+ if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
2168
+ return [4 /*yield*/, globalSecurity()];
2169
+ case 1:
2170
+ globalSecurity = _c.sent();
2171
+ _c.label = 2;
2172
+ case 2:
2173
+ if (!(globalSecurity instanceof utils.SpeakeasyBase)) {
2174
+ globalSecurity = new shared.Security(globalSecurity);
2175
+ }
2176
+ properties = utils.parseSecurityProperties(globalSecurity);
2177
+ headers = __assign(__assign({}, config === null || config === void 0 ? void 0 : config.headers), properties.headers);
2178
+ headers["Accept"] = "application/json";
2179
+ headers["user-agent"] = this.sdkConfiguration.userAgent;
2180
+ return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: operationUrl, method: "delete", headers: headers, responseType: "arraybuffer" }, config))];
2181
+ case 3:
2182
+ httpRes = _c.sent();
2183
+ responseContentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
2184
+ if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
2185
+ throw new Error("status code not found in response: ".concat(httpRes));
2186
+ }
2187
+ res = new operations.RemoveAccountingTransactionResponse({
2188
+ statusCode: httpRes.status,
2189
+ contentType: responseContentType,
2190
+ rawResponse: httpRes,
2191
+ });
2192
+ decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
2193
+ switch (true) {
2194
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 200 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 300:
2195
+ break;
2196
+ case ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 400 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 500) ||
2197
+ ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 500 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 600):
2198
+ throw new errors.SDKError("API error occurred", httpRes.status, decodedRes, httpRes);
2199
+ default:
2200
+ if (utils.matchContentType(responseContentType, "application/json")) {
2201
+ res.string = JSON.parse(decodedRes);
2202
+ }
2203
+ else {
2204
+ throw new errors.SDKError("unknown content-type received: " + responseContentType, httpRes.status, decodedRes, httpRes);
2205
+ }
2206
+ break;
2207
+ }
2208
+ return [2 /*return*/, res];
2209
+ }
2210
+ });
2211
+ });
2212
+ };
1882
2213
  /**
1883
2214
  * Update an account
1884
2215
  */
@@ -2234,6 +2565,77 @@ var Accounting = /** @class */ (function () {
2234
2565
  });
2235
2566
  });
2236
2567
  };
2568
+ /**
2569
+ * Update a transaction
2570
+ */
2571
+ Accounting.prototype.updateAccountingTransaction = function (req, config) {
2572
+ var _a, _b;
2573
+ return __awaiter(this, void 0, void 0, function () {
2574
+ var baseURL, operationUrl, _c, reqBodyHeaders, reqBody, client, globalSecurity, properties, headers, httpRes, responseContentType, res, decodedRes;
2575
+ var _d;
2576
+ return __generator(this, function (_e) {
2577
+ switch (_e.label) {
2578
+ case 0:
2579
+ if (!(req instanceof utils.SpeakeasyBase)) {
2580
+ req = new operations.UpdateAccountingTransactionRequest(req);
2581
+ }
2582
+ baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
2583
+ operationUrl = utils.generateURL(baseURL, "/accounting/{connection_id}/transaction/{id}", req);
2584
+ _c = __read([{}, null], 2), reqBodyHeaders = _c[0], reqBody = _c[1];
2585
+ try {
2586
+ _d = __read(utils.serializeRequestBody(req, "accountingTransaction", "json"), 2), reqBodyHeaders = _d[0], reqBody = _d[1];
2587
+ }
2588
+ catch (e) {
2589
+ if (e instanceof Error) {
2590
+ throw new Error("Error serializing request body, cause: ".concat(e.message));
2591
+ }
2592
+ }
2593
+ client = this.sdkConfiguration.defaultClient;
2594
+ globalSecurity = this.sdkConfiguration.security;
2595
+ if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
2596
+ return [4 /*yield*/, globalSecurity()];
2597
+ case 1:
2598
+ globalSecurity = _e.sent();
2599
+ _e.label = 2;
2600
+ case 2:
2601
+ if (!(globalSecurity instanceof utils.SpeakeasyBase)) {
2602
+ globalSecurity = new shared.Security(globalSecurity);
2603
+ }
2604
+ properties = utils.parseSecurityProperties(globalSecurity);
2605
+ headers = __assign(__assign(__assign({}, reqBodyHeaders), config === null || config === void 0 ? void 0 : config.headers), properties.headers);
2606
+ headers["Accept"] = "application/json";
2607
+ headers["user-agent"] = this.sdkConfiguration.userAgent;
2608
+ return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: operationUrl, method: "put", headers: headers, responseType: "arraybuffer", data: reqBody }, config))];
2609
+ case 3:
2610
+ httpRes = _e.sent();
2611
+ responseContentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
2612
+ if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
2613
+ throw new Error("status code not found in response: ".concat(httpRes));
2614
+ }
2615
+ res = new operations.UpdateAccountingTransactionResponse({
2616
+ statusCode: httpRes.status,
2617
+ contentType: responseContentType,
2618
+ rawResponse: httpRes,
2619
+ });
2620
+ decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
2621
+ switch (true) {
2622
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
2623
+ if (utils.matchContentType(responseContentType, "application/json")) {
2624
+ res.accountingTransaction = utils.objectToClass(JSON.parse(decodedRes), shared.AccountingTransaction);
2625
+ }
2626
+ else {
2627
+ throw new errors.SDKError("unknown content-type received: " + responseContentType, httpRes.status, decodedRes, httpRes);
2628
+ }
2629
+ break;
2630
+ case ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 400 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 500) ||
2631
+ ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 500 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 600):
2632
+ throw new errors.SDKError("API error occurred", httpRes.status, decodedRes, httpRes);
2633
+ }
2634
+ return [2 /*return*/, res];
2635
+ }
2636
+ });
2637
+ });
2638
+ };
2237
2639
  return Accounting;
2238
2640
  }());
2239
2641
  exports.Accounting = Accounting;
@@ -0,0 +1,28 @@
1
+ import { SpeakeasyBase } from "../../../internal/utils";
2
+ import * as shared from "../../../sdk/models/shared";
3
+ import { AxiosResponse } from "axios";
4
+ export declare class CreateAccountingTransactionRequest extends SpeakeasyBase {
5
+ accountingTransaction?: shared.AccountingTransaction;
6
+ /**
7
+ * ID of the connection
8
+ */
9
+ connectionId: string;
10
+ }
11
+ export declare class CreateAccountingTransactionResponse extends SpeakeasyBase {
12
+ /**
13
+ * Successful
14
+ */
15
+ accountingTransaction?: shared.AccountingTransaction;
16
+ /**
17
+ * HTTP response content type for this operation
18
+ */
19
+ contentType: string;
20
+ /**
21
+ * HTTP response status code for this operation
22
+ */
23
+ statusCode: number;
24
+ /**
25
+ * Raw HTTP response; suitable for custom response parsing
26
+ */
27
+ rawResponse: AxiosResponse;
28
+ }
@@ -0,0 +1,95 @@
1
+ "use strict";
2
+ /*
3
+ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
4
+ */
5
+ var __extends = (this && this.__extends) || (function () {
6
+ var extendStatics = function (d, b) {
7
+ extendStatics = Object.setPrototypeOf ||
8
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
9
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
10
+ return extendStatics(d, b);
11
+ };
12
+ return function (d, b) {
13
+ if (typeof b !== "function" && b !== null)
14
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
15
+ extendStatics(d, b);
16
+ function __() { this.constructor = d; }
17
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
18
+ };
19
+ })();
20
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
21
+ if (k2 === undefined) k2 = k;
22
+ var desc = Object.getOwnPropertyDescriptor(m, k);
23
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
24
+ desc = { enumerable: true, get: function() { return m[k]; } };
25
+ }
26
+ Object.defineProperty(o, k2, desc);
27
+ }) : (function(o, m, k, k2) {
28
+ if (k2 === undefined) k2 = k;
29
+ o[k2] = m[k];
30
+ }));
31
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
32
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
33
+ }) : function(o, v) {
34
+ o["default"] = v;
35
+ });
36
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
37
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
38
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
39
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
40
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
41
+ };
42
+ var __importStar = (this && this.__importStar) || function (mod) {
43
+ if (mod && mod.__esModule) return mod;
44
+ var result = {};
45
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
46
+ __setModuleDefault(result, mod);
47
+ return result;
48
+ };
49
+ var __metadata = (this && this.__metadata) || function (k, v) {
50
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
51
+ };
52
+ Object.defineProperty(exports, "__esModule", { value: true });
53
+ exports.CreateAccountingTransactionResponse = exports.CreateAccountingTransactionRequest = void 0;
54
+ var utils_1 = require("../../../internal/utils");
55
+ var shared = __importStar(require("../../../sdk/models/shared"));
56
+ var CreateAccountingTransactionRequest = /** @class */ (function (_super) {
57
+ __extends(CreateAccountingTransactionRequest, _super);
58
+ function CreateAccountingTransactionRequest() {
59
+ return _super !== null && _super.apply(this, arguments) || this;
60
+ }
61
+ __decorate([
62
+ (0, utils_1.SpeakeasyMetadata)({ data: "request, media_type=application/json" }),
63
+ __metadata("design:type", shared.AccountingTransaction)
64
+ ], CreateAccountingTransactionRequest.prototype, "accountingTransaction", void 0);
65
+ __decorate([
66
+ (0, utils_1.SpeakeasyMetadata)({ data: "pathParam, style=simple;explode=false;name=connection_id" }),
67
+ __metadata("design:type", String)
68
+ ], CreateAccountingTransactionRequest.prototype, "connectionId", void 0);
69
+ return CreateAccountingTransactionRequest;
70
+ }(utils_1.SpeakeasyBase));
71
+ exports.CreateAccountingTransactionRequest = CreateAccountingTransactionRequest;
72
+ var CreateAccountingTransactionResponse = /** @class */ (function (_super) {
73
+ __extends(CreateAccountingTransactionResponse, _super);
74
+ function CreateAccountingTransactionResponse() {
75
+ return _super !== null && _super.apply(this, arguments) || this;
76
+ }
77
+ __decorate([
78
+ (0, utils_1.SpeakeasyMetadata)(),
79
+ __metadata("design:type", shared.AccountingTransaction)
80
+ ], CreateAccountingTransactionResponse.prototype, "accountingTransaction", void 0);
81
+ __decorate([
82
+ (0, utils_1.SpeakeasyMetadata)(),
83
+ __metadata("design:type", String)
84
+ ], CreateAccountingTransactionResponse.prototype, "contentType", void 0);
85
+ __decorate([
86
+ (0, utils_1.SpeakeasyMetadata)(),
87
+ __metadata("design:type", Number)
88
+ ], CreateAccountingTransactionResponse.prototype, "statusCode", void 0);
89
+ __decorate([
90
+ (0, utils_1.SpeakeasyMetadata)(),
91
+ __metadata("design:type", Object)
92
+ ], CreateAccountingTransactionResponse.prototype, "rawResponse", void 0);
93
+ return CreateAccountingTransactionResponse;
94
+ }(utils_1.SpeakeasyBase));
95
+ exports.CreateAccountingTransactionResponse = CreateAccountingTransactionResponse;