@codat/lending 1.2.0 → 3.1.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 (122) hide show
  1. package/README.md +57 -59
  2. package/dist/sdk/accountspayable.d.ts +0 -34
  3. package/dist/sdk/accountspayable.js +1 -260
  4. package/dist/sdk/accountspayablebills.d.ts +28 -0
  5. package/dist/sdk/accountspayablebills.js +183 -1
  6. package/dist/sdk/models/shared/accountcategoriesupdatedwebhook.d.ts +40 -0
  7. package/dist/sdk/models/shared/accountcategoriesupdatedwebhook.js +90 -0
  8. package/dist/sdk/models/shared/accountcategoriesupdatedwebhookdata.d.ts +7 -0
  9. package/dist/sdk/models/shared/accountcategoriesupdatedwebhookdata.js +45 -0
  10. package/dist/sdk/models/shared/{addressesitems.d.ts → accountingaddress.d.ts} +1 -1
  11. package/dist/sdk/models/shared/{addressesitems.js → accountingaddress.js} +13 -13
  12. package/dist/sdk/models/shared/accountingbillcreditnote.d.ts +2 -2
  13. package/dist/sdk/models/shared/accountingbillcreditnote.js +3 -3
  14. package/dist/sdk/models/shared/accountingcompanyinfo.d.ts +6 -66
  15. package/dist/sdk/models/shared/accountingcompanyinfo.js +10 -100
  16. package/dist/sdk/models/shared/accountingcreditnote.d.ts +2 -2
  17. package/dist/sdk/models/shared/accountingcreditnote.js +3 -3
  18. package/dist/sdk/models/shared/accountingcustomer.d.ts +2 -2
  19. package/dist/sdk/models/shared/accountingcustomer.js +3 -3
  20. package/dist/sdk/models/shared/accountinginvoice.d.ts +2 -2
  21. package/dist/sdk/models/shared/accountinginvoice.js +3 -3
  22. package/dist/sdk/models/shared/accountingsupplier.d.ts +2 -2
  23. package/dist/sdk/models/shared/accountingsupplier.js +3 -3
  24. package/dist/sdk/models/shared/clientratelimitreachedwebhook.d.ts +32 -0
  25. package/dist/sdk/models/shared/clientratelimitreachedwebhook.js +80 -0
  26. package/dist/sdk/models/shared/clientratelimitreachedwebhookdata.d.ts +31 -0
  27. package/dist/sdk/models/shared/clientratelimitreachedwebhookdata.js +50 -0
  28. package/dist/sdk/models/shared/clientratelimitresetwebhook.d.ts +32 -0
  29. package/dist/sdk/models/shared/clientratelimitresetwebhook.js +80 -0
  30. package/dist/sdk/models/shared/clientratelimitresetwebhookdata.d.ts +39 -0
  31. package/dist/sdk/models/shared/clientratelimitresetwebhookdata.js +60 -0
  32. package/dist/sdk/models/shared/commercecompanyinfo.d.ts +4 -4
  33. package/dist/sdk/models/shared/commercecompanyinfo.js +6 -6
  34. package/dist/sdk/models/shared/contact.d.ts +4 -4
  35. package/dist/sdk/models/shared/contact.js +6 -6
  36. package/dist/sdk/models/shared/index.d.ts +9 -3
  37. package/dist/sdk/models/shared/index.js +9 -3
  38. package/dist/sdk/models/shared/items.d.ts +2 -9
  39. package/dist/sdk/models/shared/items.js +5 -6
  40. package/dist/sdk/models/shared/phonenumber.d.ts +12 -0
  41. package/dist/sdk/models/shared/{withholdingtaxitems.js → phonenumber.js} +12 -11
  42. package/dist/sdk/models/shared/{weblinksitems.d.ts → weblink.d.ts} +3 -3
  43. package/dist/sdk/models/shared/{weblinksitems.js → weblink.js} +14 -14
  44. package/dist/sdk/models/webhooks/accountcategoriesupdated.d.ts +7 -0
  45. package/dist/sdk/models/webhooks/accountcategoriesupdated.js +51 -0
  46. package/dist/sdk/models/webhooks/clientratelimitreached.d.ts +7 -0
  47. package/dist/sdk/models/webhooks/clientratelimitreached.js +51 -0
  48. package/dist/sdk/models/webhooks/clientratelimitreset.d.ts +7 -0
  49. package/dist/sdk/models/webhooks/clientratelimitreset.js +51 -0
  50. package/dist/sdk/models/webhooks/index.d.ts +3 -0
  51. package/dist/sdk/models/webhooks/index.js +22 -0
  52. package/dist/sdk/sdk.d.ts +1 -4
  53. package/dist/sdk/sdk.js +3 -3
  54. package/docs/models/shared/accountcategoriesupdatedwebhook.md +18 -0
  55. package/docs/models/shared/accountcategoriesupdatedwebhookdata.md +8 -0
  56. package/docs/models/shared/{addressesitems.md → accountingaddress.md} +1 -1
  57. package/docs/models/shared/accountingbillcreditnote.md +1 -1
  58. package/docs/models/shared/accountingcompanyinfo.md +3 -3
  59. package/docs/models/shared/accountingcreditnote.md +1 -1
  60. package/docs/models/shared/accountingcustomer.md +1 -1
  61. package/docs/models/shared/accountinginvoice.md +1 -1
  62. package/docs/models/shared/accountingsupplier.md +1 -1
  63. package/docs/models/shared/clientratelimitreachedwebhook.md +16 -0
  64. package/docs/models/shared/clientratelimitreachedwebhookdata.md +9 -0
  65. package/docs/models/shared/clientratelimitresetwebhook.md +16 -0
  66. package/docs/models/shared/clientratelimitresetwebhookdata.md +11 -0
  67. package/docs/models/shared/commercecompanyinfo.md +2 -2
  68. package/docs/models/shared/contact.md +2 -2
  69. package/docs/models/shared/items.md +4 -4
  70. package/docs/models/shared/{accountingcompanyinfophone.md → phonenumber.md} +1 -1
  71. package/docs/models/shared/weblink.md +11 -0
  72. package/docs/models/shared/{itemstype.md → weblinktype.md} +1 -1
  73. package/docs/models/webhooks/accountcategoriesupdatedresponse.md +10 -0
  74. package/docs/models/webhooks/clientratelimitreachedresponse.md +10 -0
  75. package/docs/models/webhooks/clientratelimitresetresponse.md +10 -0
  76. package/docs/sdks/accountingbankdata/README.md +1 -1
  77. package/docs/sdks/accountingbankdataaccounts/README.md +3 -3
  78. package/docs/sdks/accountspayable/README.md +1 -101
  79. package/docs/sdks/accountspayablebillcreditnotes/README.md +5 -5
  80. package/docs/sdks/accountspayablebillpayments/README.md +5 -5
  81. package/docs/sdks/accountspayablebills/README.md +103 -7
  82. package/docs/sdks/accountspayablesuppliers/README.md +11 -11
  83. package/docs/sdks/accountsreceivable/README.md +1 -1
  84. package/docs/sdks/accountsreceivablecreditnotes/README.md +3 -3
  85. package/docs/sdks/accountsreceivablecustomers/README.md +6 -6
  86. package/docs/sdks/accountsreceivabledirectincomes/README.md +6 -6
  87. package/docs/sdks/accountsreceivableinvoices/README.md +8 -8
  88. package/docs/sdks/accountsreceivablepayments/README.md +3 -3
  89. package/docs/sdks/accountsreceivablereports/README.md +5 -5
  90. package/docs/sdks/banking/README.md +1 -1
  91. package/docs/sdks/bankingaccountbalances/README.md +2 -2
  92. package/docs/sdks/bankingcategorizedstatement/README.md +2 -2
  93. package/docs/sdks/bankingtransactioncategories/README.md +3 -3
  94. package/docs/sdks/companies/README.md +2 -2
  95. package/docs/sdks/companyinfo/README.md +1 -1
  96. package/docs/sdks/connections/README.md +4 -4
  97. package/docs/sdks/dataintegrity/README.md +3 -3
  98. package/docs/sdks/excelreports/README.md +4 -4
  99. package/docs/sdks/fileupload/README.md +3 -3
  100. package/docs/sdks/financialstatements/README.md +1 -1
  101. package/docs/sdks/financialstatementsaccounts/README.md +3 -3
  102. package/docs/sdks/financialstatementsbalancesheet/README.md +3 -3
  103. package/docs/sdks/financialstatementscashflow/README.md +2 -2
  104. package/docs/sdks/financialstatementsprofitandloss/README.md +3 -3
  105. package/docs/sdks/liabilities/README.md +2 -2
  106. package/docs/sdks/managedata/README.md +1 -1
  107. package/docs/sdks/managedatapulloperations/README.md +3 -3
  108. package/docs/sdks/managedatarefresh/README.md +3 -3
  109. package/docs/sdks/sales/README.md +1 -1
  110. package/docs/sdks/salespaymentmethods/README.md +3 -3
  111. package/docs/sdks/salesproductcategories/README.md +3 -3
  112. package/docs/sdks/transactions/README.md +1 -1
  113. package/docs/sdks/transactionsaccounttransactions/README.md +3 -3
  114. package/docs/sdks/transactionsdirectcosts/README.md +6 -6
  115. package/docs/sdks/transactionsjournalentries/README.md +3 -3
  116. package/package.json +1 -1
  117. package/dist/sdk/models/shared/withholdingtaxitems.d.ts +0 -5
  118. package/docs/models/shared/accountingcompanyinfoaccountingaddress.md +0 -14
  119. package/docs/models/shared/accountingcompanyinfoweblink.md +0 -11
  120. package/docs/models/shared/accountingcompanyinfoweblinktype.md +0 -12
  121. package/docs/models/shared/weblinksitems.md +0 -11
  122. package/docs/models/shared/withholdingtaxitems.md +0 -9
@@ -73,15 +73,111 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
73
73
  }
74
74
  };
75
75
  Object.defineProperty(exports, "__esModule", { value: true });
76
- exports.AccountsPayableBills = void 0;
76
+ exports.AccountsPayableBills = exports.DownloadAttachmentAcceptEnum = void 0;
77
77
  var utils = __importStar(require("../internal/utils"));
78
78
  var errors = __importStar(require("./models/errors"));
79
79
  var operations = __importStar(require("./models/operations"));
80
80
  var shared = __importStar(require("./models/shared"));
81
+ var DownloadAttachmentAcceptEnum;
82
+ (function (DownloadAttachmentAcceptEnum) {
83
+ DownloadAttachmentAcceptEnum["applicationJson"] = "application/json";
84
+ DownloadAttachmentAcceptEnum["applicationOctetStream"] = "application/octet-stream";
85
+ })(DownloadAttachmentAcceptEnum = exports.DownloadAttachmentAcceptEnum || (exports.DownloadAttachmentAcceptEnum = {}));
81
86
  var AccountsPayableBills = /** @class */ (function () {
82
87
  function AccountsPayableBills(sdkConfig) {
83
88
  this.sdkConfiguration = sdkConfig;
84
89
  }
90
+ /**
91
+ * Download bill attachment
92
+ *
93
+ * @remarks
94
+ * The *Download bill attachment* endpoint downloads a specific attachment for a given `billId` and `attachmentId`.
95
+ *
96
+ * [Bills](https://docs.codat.io/accounting-api#/schemas/Bill) are invoices that represent the SMB's financial obligations to their supplier for a purchase of goods or services.
97
+ *
98
+ * Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=bills) for integrations that support downloading a bill attachment.
99
+ *
100
+ */
101
+ AccountsPayableBills.prototype.downloadAttachment = function (req, retries, config, acceptHeaderOverride) {
102
+ var _a, _b;
103
+ return __awaiter(this, void 0, void 0, function () {
104
+ var baseURL, url, client, globalSecurity, properties, headers, globalRetryConfig, retryConfig, httpRes, contentType, res, decodedRes;
105
+ return __generator(this, function (_c) {
106
+ switch (_c.label) {
107
+ case 0:
108
+ if (!(req instanceof utils.SpeakeasyBase)) {
109
+ req = new operations.DownloadAccountingBillAttachmentRequest(req);
110
+ }
111
+ baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
112
+ url = utils.generateURL(baseURL, "/companies/{companyId}/connections/{connectionId}/data/bills/{billId}/attachments/{attachmentId}/download", req);
113
+ client = this.sdkConfiguration.defaultClient;
114
+ globalSecurity = this.sdkConfiguration.security;
115
+ if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
116
+ return [4 /*yield*/, globalSecurity()];
117
+ case 1:
118
+ globalSecurity = _c.sent();
119
+ _c.label = 2;
120
+ case 2:
121
+ if (!(globalSecurity instanceof utils.SpeakeasyBase)) {
122
+ globalSecurity = new shared.Security(globalSecurity);
123
+ }
124
+ properties = utils.parseSecurityProperties(globalSecurity);
125
+ headers = __assign(__assign({}, config === null || config === void 0 ? void 0 : config.headers), properties.headers);
126
+ if (acceptHeaderOverride !== undefined) {
127
+ headers["Accept"] = acceptHeaderOverride.toString();
128
+ }
129
+ else {
130
+ headers["Accept"] = "application/json;q=1, application/octet-stream;q=0";
131
+ }
132
+ headers["user-agent"] = "speakeasy-sdk/".concat(this.sdkConfiguration.language, " ").concat(this.sdkConfiguration.sdkVersion, " ").concat(this.sdkConfiguration.genVersion, " ").concat(this.sdkConfiguration.openapiDocVersion);
133
+ globalRetryConfig = this.sdkConfiguration.retryConfig;
134
+ retryConfig = retries;
135
+ if (!retryConfig) {
136
+ if (globalRetryConfig) {
137
+ retryConfig = globalRetryConfig;
138
+ }
139
+ else {
140
+ retryConfig = new utils.RetryConfig("backoff", new utils.BackoffStrategy(500, 60000, 1.5, 3600000), true);
141
+ }
142
+ }
143
+ return [4 /*yield*/, utils.Retry(function () {
144
+ return client.request(__assign({ validateStatus: function () { return true; }, url: url, method: "get", headers: headers, responseType: "arraybuffer" }, config));
145
+ }, new utils.Retries(retryConfig, ["408", "429", "5XX"]))];
146
+ case 3:
147
+ httpRes = _c.sent();
148
+ contentType = (_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 : "";
149
+ if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
150
+ throw new Error("status code not found in response: ".concat(httpRes));
151
+ }
152
+ res = new operations.DownloadAccountingBillAttachmentResponse({
153
+ statusCode: httpRes.status,
154
+ contentType: contentType,
155
+ rawResponse: httpRes,
156
+ });
157
+ decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
158
+ switch (true) {
159
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
160
+ if (utils.matchContentType(contentType, "application/octet-stream")) {
161
+ res.data = httpRes === null || httpRes === void 0 ? void 0 : httpRes.data;
162
+ }
163
+ else {
164
+ throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
165
+ }
166
+ break;
167
+ case [401, 404, 429].includes(httpRes === null || httpRes === void 0 ? void 0 : httpRes.status):
168
+ if (utils.matchContentType(contentType, "application/json")) {
169
+ res.errorMessage = utils.objectToClass(JSON.parse(decodedRes), shared.ErrorMessage);
170
+ }
171
+ else {
172
+ throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
173
+ }
174
+ break;
175
+ }
176
+ return [2 /*return*/, res];
177
+ }
178
+ });
179
+ });
180
+ };
85
181
  /**
86
182
  * Get bill
87
183
  *
@@ -170,6 +266,92 @@ var AccountsPayableBills = /** @class */ (function () {
170
266
  });
171
267
  });
172
268
  };
269
+ /**
270
+ * Get bill attachment
271
+ *
272
+ * @remarks
273
+ * The *Get bill attachment* endpoint returns a specific attachment for a given `billId` and `attachmentId`.
274
+ *
275
+ * [Bills](https://docs.codat.io/accounting-api#/schemas/Bill) are invoices that represent the SMB's financial obligations to their supplier for a purchase of goods or services.
276
+ *
277
+ * Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=bills) for integrations that support getting a bill attachment.
278
+ *
279
+ */
280
+ AccountsPayableBills.prototype.getAttachment = function (req, retries, config) {
281
+ var _a, _b;
282
+ return __awaiter(this, void 0, void 0, function () {
283
+ var baseURL, url, client, globalSecurity, properties, headers, globalRetryConfig, retryConfig, httpRes, contentType, res, decodedRes;
284
+ return __generator(this, function (_c) {
285
+ switch (_c.label) {
286
+ case 0:
287
+ if (!(req instanceof utils.SpeakeasyBase)) {
288
+ req = new operations.GetAccountingBillAttachmentRequest(req);
289
+ }
290
+ baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
291
+ url = utils.generateURL(baseURL, "/companies/{companyId}/connections/{connectionId}/data/bills/{billId}/attachments/{attachmentId}", req);
292
+ client = this.sdkConfiguration.defaultClient;
293
+ globalSecurity = this.sdkConfiguration.security;
294
+ if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
295
+ return [4 /*yield*/, globalSecurity()];
296
+ case 1:
297
+ globalSecurity = _c.sent();
298
+ _c.label = 2;
299
+ case 2:
300
+ if (!(globalSecurity instanceof utils.SpeakeasyBase)) {
301
+ globalSecurity = new shared.Security(globalSecurity);
302
+ }
303
+ properties = utils.parseSecurityProperties(globalSecurity);
304
+ headers = __assign(__assign({}, config === null || config === void 0 ? void 0 : config.headers), properties.headers);
305
+ headers["Accept"] = "application/json";
306
+ headers["user-agent"] = "speakeasy-sdk/".concat(this.sdkConfiguration.language, " ").concat(this.sdkConfiguration.sdkVersion, " ").concat(this.sdkConfiguration.genVersion, " ").concat(this.sdkConfiguration.openapiDocVersion);
307
+ globalRetryConfig = this.sdkConfiguration.retryConfig;
308
+ retryConfig = retries;
309
+ if (!retryConfig) {
310
+ if (globalRetryConfig) {
311
+ retryConfig = globalRetryConfig;
312
+ }
313
+ else {
314
+ retryConfig = new utils.RetryConfig("backoff", new utils.BackoffStrategy(500, 60000, 1.5, 3600000), true);
315
+ }
316
+ }
317
+ return [4 /*yield*/, utils.Retry(function () {
318
+ return client.request(__assign({ validateStatus: function () { return true; }, url: url, method: "get", headers: headers, responseType: "arraybuffer" }, config));
319
+ }, new utils.Retries(retryConfig, ["408", "429", "5XX"]))];
320
+ case 3:
321
+ httpRes = _c.sent();
322
+ contentType = (_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 : "";
323
+ if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
324
+ throw new Error("status code not found in response: ".concat(httpRes));
325
+ }
326
+ res = new operations.GetAccountingBillAttachmentResponse({
327
+ statusCode: httpRes.status,
328
+ contentType: contentType,
329
+ rawResponse: httpRes,
330
+ });
331
+ decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
332
+ switch (true) {
333
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
334
+ if (utils.matchContentType(contentType, "application/json")) {
335
+ res.accountingAttachment = utils.objectToClass(JSON.parse(decodedRes), shared.AccountingAttachment);
336
+ }
337
+ else {
338
+ throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
339
+ }
340
+ break;
341
+ case [401, 404, 429].includes(httpRes === null || httpRes === void 0 ? void 0 : httpRes.status):
342
+ if (utils.matchContentType(contentType, "application/json")) {
343
+ res.errorMessage = utils.objectToClass(JSON.parse(decodedRes), shared.ErrorMessage);
344
+ }
345
+ else {
346
+ throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
347
+ }
348
+ break;
349
+ }
350
+ return [2 /*return*/, res];
351
+ }
352
+ });
353
+ });
354
+ };
173
355
  /**
174
356
  * List bills
175
357
  *
@@ -0,0 +1,40 @@
1
+ import { SpeakeasyBase } from "../../../internal/utils";
2
+ import { AccountCategoriesUpdatedWebhookData } from "./accountcategoriesupdatedwebhookdata";
3
+ /**
4
+ * Webhook request body for account categories updated.
5
+ */
6
+ export declare class AccountCategoriesUpdatedWebhook extends SpeakeasyBase {
7
+ /**
8
+ * Unique identifier of the webhook event.
9
+ */
10
+ alertId?: string;
11
+ /**
12
+ * Unique identifier for your client in Codat.
13
+ */
14
+ clientId?: string;
15
+ /**
16
+ * Name of your client in Codat.
17
+ */
18
+ clientName?: string;
19
+ /**
20
+ * Unique identifier for your SMB in Codat.
21
+ */
22
+ companyId?: string;
23
+ data?: AccountCategoriesUpdatedWebhookData;
24
+ /**
25
+ * Unique identifier for a company's data connection.
26
+ */
27
+ dataConnectionId?: string;
28
+ /**
29
+ * A human readable message about the webhook.
30
+ */
31
+ message?: string;
32
+ /**
33
+ * Unique identifier for the rule.
34
+ */
35
+ ruleId?: string;
36
+ /**
37
+ * The type of rule.
38
+ */
39
+ ruleType?: string;
40
+ }
@@ -0,0 +1,90 @@
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 __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
21
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
22
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
23
+ 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;
24
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
25
+ };
26
+ var __metadata = (this && this.__metadata) || function (k, v) {
27
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
28
+ };
29
+ Object.defineProperty(exports, "__esModule", { value: true });
30
+ exports.AccountCategoriesUpdatedWebhook = void 0;
31
+ var utils_1 = require("../../../internal/utils");
32
+ var accountcategoriesupdatedwebhookdata_1 = require("./accountcategoriesupdatedwebhookdata");
33
+ var class_transformer_1 = require("class-transformer");
34
+ /**
35
+ * Webhook request body for account categories updated.
36
+ */
37
+ var AccountCategoriesUpdatedWebhook = /** @class */ (function (_super) {
38
+ __extends(AccountCategoriesUpdatedWebhook, _super);
39
+ function AccountCategoriesUpdatedWebhook() {
40
+ return _super !== null && _super.apply(this, arguments) || this;
41
+ }
42
+ __decorate([
43
+ (0, utils_1.SpeakeasyMetadata)(),
44
+ (0, class_transformer_1.Expose)({ name: "AlertId" }),
45
+ __metadata("design:type", String)
46
+ ], AccountCategoriesUpdatedWebhook.prototype, "alertId", void 0);
47
+ __decorate([
48
+ (0, utils_1.SpeakeasyMetadata)(),
49
+ (0, class_transformer_1.Expose)({ name: "ClientId" }),
50
+ __metadata("design:type", String)
51
+ ], AccountCategoriesUpdatedWebhook.prototype, "clientId", void 0);
52
+ __decorate([
53
+ (0, utils_1.SpeakeasyMetadata)(),
54
+ (0, class_transformer_1.Expose)({ name: "ClientName" }),
55
+ __metadata("design:type", String)
56
+ ], AccountCategoriesUpdatedWebhook.prototype, "clientName", void 0);
57
+ __decorate([
58
+ (0, utils_1.SpeakeasyMetadata)(),
59
+ (0, class_transformer_1.Expose)({ name: "CompanyId" }),
60
+ __metadata("design:type", String)
61
+ ], AccountCategoriesUpdatedWebhook.prototype, "companyId", void 0);
62
+ __decorate([
63
+ (0, utils_1.SpeakeasyMetadata)(),
64
+ (0, class_transformer_1.Expose)({ name: "Data" }),
65
+ (0, class_transformer_1.Type)(function () { return accountcategoriesupdatedwebhookdata_1.AccountCategoriesUpdatedWebhookData; }),
66
+ __metadata("design:type", accountcategoriesupdatedwebhookdata_1.AccountCategoriesUpdatedWebhookData)
67
+ ], AccountCategoriesUpdatedWebhook.prototype, "data", void 0);
68
+ __decorate([
69
+ (0, utils_1.SpeakeasyMetadata)(),
70
+ (0, class_transformer_1.Expose)({ name: "DataConnectionId" }),
71
+ __metadata("design:type", String)
72
+ ], AccountCategoriesUpdatedWebhook.prototype, "dataConnectionId", void 0);
73
+ __decorate([
74
+ (0, utils_1.SpeakeasyMetadata)(),
75
+ (0, class_transformer_1.Expose)({ name: "Message" }),
76
+ __metadata("design:type", String)
77
+ ], AccountCategoriesUpdatedWebhook.prototype, "message", void 0);
78
+ __decorate([
79
+ (0, utils_1.SpeakeasyMetadata)(),
80
+ (0, class_transformer_1.Expose)({ name: "RuleId" }),
81
+ __metadata("design:type", String)
82
+ ], AccountCategoriesUpdatedWebhook.prototype, "ruleId", void 0);
83
+ __decorate([
84
+ (0, utils_1.SpeakeasyMetadata)(),
85
+ (0, class_transformer_1.Expose)({ name: "RuleType" }),
86
+ __metadata("design:type", String)
87
+ ], AccountCategoriesUpdatedWebhook.prototype, "ruleType", void 0);
88
+ return AccountCategoriesUpdatedWebhook;
89
+ }(utils_1.SpeakeasyBase));
90
+ exports.AccountCategoriesUpdatedWebhook = AccountCategoriesUpdatedWebhook;
@@ -0,0 +1,7 @@
1
+ import { SpeakeasyBase } from "../../../internal/utils";
2
+ export declare class AccountCategoriesUpdatedWebhookData extends SpeakeasyBase {
3
+ /**
4
+ * The date on which this account categories were last modified in Codat.
5
+ */
6
+ modifiedDate?: string;
7
+ }
@@ -0,0 +1,45 @@
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 __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
21
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
22
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
23
+ 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;
24
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
25
+ };
26
+ var __metadata = (this && this.__metadata) || function (k, v) {
27
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
28
+ };
29
+ Object.defineProperty(exports, "__esModule", { value: true });
30
+ exports.AccountCategoriesUpdatedWebhookData = void 0;
31
+ var utils_1 = require("../../../internal/utils");
32
+ var class_transformer_1 = require("class-transformer");
33
+ var AccountCategoriesUpdatedWebhookData = /** @class */ (function (_super) {
34
+ __extends(AccountCategoriesUpdatedWebhookData, _super);
35
+ function AccountCategoriesUpdatedWebhookData() {
36
+ return _super !== null && _super.apply(this, arguments) || this;
37
+ }
38
+ __decorate([
39
+ (0, utils_1.SpeakeasyMetadata)(),
40
+ (0, class_transformer_1.Expose)({ name: "modifiedDate" }),
41
+ __metadata("design:type", String)
42
+ ], AccountCategoriesUpdatedWebhookData.prototype, "modifiedDate", void 0);
43
+ return AccountCategoriesUpdatedWebhookData;
44
+ }(utils_1.SpeakeasyBase));
45
+ exports.AccountCategoriesUpdatedWebhookData = AccountCategoriesUpdatedWebhookData;
@@ -1,6 +1,6 @@
1
1
  import { SpeakeasyBase } from "../../../internal/utils";
2
2
  import { AccountingAddressType } from "./accountingaddresstype";
3
- export declare class Addressesitems extends SpeakeasyBase {
3
+ export declare class AccountingAddress extends SpeakeasyBase {
4
4
  /**
5
5
  * City of the customer address.
6
6
  */
@@ -27,50 +27,50 @@ var __metadata = (this && this.__metadata) || function (k, v) {
27
27
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
28
28
  };
29
29
  Object.defineProperty(exports, "__esModule", { value: true });
30
- exports.Addressesitems = void 0;
30
+ exports.AccountingAddress = void 0;
31
31
  var utils_1 = require("../../../internal/utils");
32
32
  var accountingaddresstype_1 = require("./accountingaddresstype");
33
33
  var class_transformer_1 = require("class-transformer");
34
- var Addressesitems = /** @class */ (function (_super) {
35
- __extends(Addressesitems, _super);
36
- function Addressesitems() {
34
+ var AccountingAddress = /** @class */ (function (_super) {
35
+ __extends(AccountingAddress, _super);
36
+ function AccountingAddress() {
37
37
  return _super !== null && _super.apply(this, arguments) || this;
38
38
  }
39
39
  __decorate([
40
40
  (0, utils_1.SpeakeasyMetadata)(),
41
41
  (0, class_transformer_1.Expose)({ name: "city" }),
42
42
  __metadata("design:type", String)
43
- ], Addressesitems.prototype, "city", void 0);
43
+ ], AccountingAddress.prototype, "city", void 0);
44
44
  __decorate([
45
45
  (0, utils_1.SpeakeasyMetadata)(),
46
46
  (0, class_transformer_1.Expose)({ name: "country" }),
47
47
  __metadata("design:type", String)
48
- ], Addressesitems.prototype, "country", void 0);
48
+ ], AccountingAddress.prototype, "country", void 0);
49
49
  __decorate([
50
50
  (0, utils_1.SpeakeasyMetadata)(),
51
51
  (0, class_transformer_1.Expose)({ name: "line1" }),
52
52
  __metadata("design:type", String)
53
- ], Addressesitems.prototype, "line1", void 0);
53
+ ], AccountingAddress.prototype, "line1", void 0);
54
54
  __decorate([
55
55
  (0, utils_1.SpeakeasyMetadata)(),
56
56
  (0, class_transformer_1.Expose)({ name: "line2" }),
57
57
  __metadata("design:type", String)
58
- ], Addressesitems.prototype, "line2", void 0);
58
+ ], AccountingAddress.prototype, "line2", void 0);
59
59
  __decorate([
60
60
  (0, utils_1.SpeakeasyMetadata)(),
61
61
  (0, class_transformer_1.Expose)({ name: "postalCode" }),
62
62
  __metadata("design:type", String)
63
- ], Addressesitems.prototype, "postalCode", void 0);
63
+ ], AccountingAddress.prototype, "postalCode", void 0);
64
64
  __decorate([
65
65
  (0, utils_1.SpeakeasyMetadata)(),
66
66
  (0, class_transformer_1.Expose)({ name: "region" }),
67
67
  __metadata("design:type", String)
68
- ], Addressesitems.prototype, "region", void 0);
68
+ ], AccountingAddress.prototype, "region", void 0);
69
69
  __decorate([
70
70
  (0, utils_1.SpeakeasyMetadata)(),
71
71
  (0, class_transformer_1.Expose)({ name: "type" }),
72
72
  __metadata("design:type", String)
73
- ], Addressesitems.prototype, "type", void 0);
74
- return Addressesitems;
73
+ ], AccountingAddress.prototype, "type", void 0);
74
+ return AccountingAddress;
75
75
  }(utils_1.SpeakeasyBase));
76
- exports.Addressesitems = Addressesitems;
76
+ exports.AccountingAddress = AccountingAddress;
@@ -2,10 +2,10 @@ import { SpeakeasyBase } from "../../../internal/utils";
2
2
  import { AccountingPaymentAllocation } from "./accountingpaymentallocation";
3
3
  import { BillCreditNoteLineItem } from "./billcreditnotelineitem";
4
4
  import { BillCreditNoteStatus } from "./billcreditnotestatus";
5
+ import { Items } from "./items";
5
6
  import { Metadata } from "./metadata";
6
7
  import { SupplementalData } from "./supplementaldata";
7
8
  import { SupplierRef } from "./supplierref";
8
- import { WithholdingTaxitems } from "./withholdingtaxitems";
9
9
  /**
10
10
  * > **Bill credit notes or credit notes?**
11
11
  *
@@ -180,5 +180,5 @@ export declare class AccountingBillCreditNote extends SpeakeasyBase {
180
180
  * Amount of tax included in the bill credit note.
181
181
  */
182
182
  totalTaxAmount: number;
183
- withholdingTax?: WithholdingTaxitems[];
183
+ withholdingTax?: Items[];
184
184
  }
@@ -32,10 +32,10 @@ var utils_1 = require("../../../internal/utils");
32
32
  var accountingpaymentallocation_1 = require("./accountingpaymentallocation");
33
33
  var billcreditnotelineitem_1 = require("./billcreditnotelineitem");
34
34
  var billcreditnotestatus_1 = require("./billcreditnotestatus");
35
+ var items_1 = require("./items");
35
36
  var metadata_1 = require("./metadata");
36
37
  var supplementaldata_1 = require("./supplementaldata");
37
38
  var supplierref_1 = require("./supplierref");
38
- var withholdingtaxitems_1 = require("./withholdingtaxitems");
39
39
  var class_transformer_1 = require("class-transformer");
40
40
  /**
41
41
  * > **Bill credit notes or credit notes?**
@@ -173,9 +173,9 @@ var AccountingBillCreditNote = /** @class */ (function (_super) {
173
173
  __metadata("design:type", Number)
174
174
  ], AccountingBillCreditNote.prototype, "totalTaxAmount", void 0);
175
175
  __decorate([
176
- (0, utils_1.SpeakeasyMetadata)({ elemType: withholdingtaxitems_1.WithholdingTaxitems }),
176
+ (0, utils_1.SpeakeasyMetadata)({ elemType: items_1.Items }),
177
177
  (0, class_transformer_1.Expose)({ name: "withholdingTax" }),
178
- (0, class_transformer_1.Type)(function () { return withholdingtaxitems_1.WithholdingTaxitems; }),
178
+ (0, class_transformer_1.Type)(function () { return items_1.Items; }),
179
179
  __metadata("design:type", Array)
180
180
  ], AccountingBillCreditNote.prototype, "withholdingTax", void 0);
181
181
  return AccountingBillCreditNote;
@@ -1,67 +1,7 @@
1
1
  import { SpeakeasyBase } from "../../../internal/utils";
2
- import { AccountingAddressType } from "./accountingaddresstype";
3
- import { PhoneNumberType } from "./phonenumbertype";
4
- export declare class AccountingCompanyInfoAccountingAddress extends SpeakeasyBase {
5
- /**
6
- * City of the customer address.
7
- */
8
- city?: string;
9
- /**
10
- * Country of the customer address.
11
- */
12
- country?: string;
13
- /**
14
- * Line 1 of the customer address.
15
- */
16
- line1?: string;
17
- /**
18
- * Line 2 of the customer address.
19
- */
20
- line2?: string;
21
- /**
22
- * Postal code or zip code.
23
- */
24
- postalCode?: string;
25
- /**
26
- * Region of the customer address.
27
- */
28
- region?: string;
29
- /**
30
- * The type of the address
31
- */
32
- type: AccountingAddressType;
33
- }
34
- export declare class AccountingCompanyInfoPhone extends SpeakeasyBase {
35
- /**
36
- * A phone number.
37
- */
38
- number: string;
39
- /**
40
- * The type of phone number
41
- */
42
- type: PhoneNumberType;
43
- }
44
- /**
45
- * The type of the weblink.
46
- */
47
- export declare enum AccountingCompanyInfoWeblinkType {
48
- Website = "Website",
49
- Social = "Social",
50
- Unknown = "Unknown"
51
- }
52
- /**
53
- * Weblink associated with the company.
54
- */
55
- export declare class AccountingCompanyInfoWeblink extends SpeakeasyBase {
56
- /**
57
- * The type of the weblink.
58
- */
59
- type?: AccountingCompanyInfoWeblinkType;
60
- /**
61
- * The full URL for the weblink.
62
- */
63
- url?: string;
64
- }
2
+ import { AccountingAddress } from "./accountingaddress";
3
+ import { PhoneNumber } from "./phonenumber";
4
+ import { WebLink } from "./weblink";
65
5
  /**
66
6
  * > View the coverage for company info in the <a className="external" href="https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=cashFlowStatement" target="_blank">Data coverage explorer</a>.
67
7
  *
@@ -81,7 +21,7 @@ export declare class AccountingCompanyInfo extends SpeakeasyBase {
81
21
  /**
82
22
  * An array of Addresses.
83
23
  */
84
- addresses?: AccountingCompanyInfoAccountingAddress[];
24
+ addresses?: AccountingAddress[];
85
25
  /**
86
26
  * Currency set in the accounting platform of the linked company. Used by the currency rate.
87
27
  */
@@ -169,7 +109,7 @@ export declare class AccountingCompanyInfo extends SpeakeasyBase {
169
109
  /**
170
110
  * An array of phone numbers.
171
111
  */
172
- phoneNumbers?: AccountingCompanyInfoPhone[];
112
+ phoneNumbers?: PhoneNumber[];
173
113
  /**
174
114
  * Registration number given to the linked company by the companies authority in the country of origin. In the UK this is Companies House.
175
115
  */
@@ -189,5 +129,5 @@ export declare class AccountingCompanyInfo extends SpeakeasyBase {
189
129
  /**
190
130
  * An array of weblinks.
191
131
  */
192
- webLinks?: AccountingCompanyInfoWeblink[];
132
+ webLinks?: WebLink[];
193
133
  }