@codat/lending 1.2.0 → 2.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.
package/README.md CHANGED
@@ -61,35 +61,6 @@ sdk.accountingBankData.listTransactions({
61
61
  * [get](docs/sdks/accountingbankdataaccounts/README.md#get) - Get bank account
62
62
  * [list](docs/sdks/accountingbankdataaccounts/README.md#list) - List bank accounts
63
63
 
64
- ### [accountsPayable](docs/sdks/accountspayable/README.md)
65
-
66
- * [downloadBillAttachment](docs/sdks/accountspayable/README.md#downloadbillattachment) - Download bill attachment
67
- * [getBillAttachment](docs/sdks/accountspayable/README.md#getbillattachment) - Get bill attachment
68
-
69
- ### [accountsPayableBillCreditNotes](docs/sdks/accountspayablebillcreditnotes/README.md)
70
-
71
- * [get](docs/sdks/accountspayablebillcreditnotes/README.md#get) - Get bill credit note
72
- * [list](docs/sdks/accountspayablebillcreditnotes/README.md#list) - List bill credit notes
73
-
74
- ### [accountsPayableBillPayments](docs/sdks/accountspayablebillpayments/README.md)
75
-
76
- * [get](docs/sdks/accountspayablebillpayments/README.md#get) - Get bill payment
77
- * [list](docs/sdks/accountspayablebillpayments/README.md#list) - List bill payments
78
-
79
- ### [accountsPayableBills](docs/sdks/accountspayablebills/README.md)
80
-
81
- * [get](docs/sdks/accountspayablebills/README.md#get) - Get bill
82
- * [list](docs/sdks/accountspayablebills/README.md#list) - List bills
83
- * [listAttachments](docs/sdks/accountspayablebills/README.md#listattachments) - List bill attachments
84
-
85
- ### [accountsPayableSuppliers](docs/sdks/accountspayablesuppliers/README.md)
86
-
87
- * [downloadAttachment](docs/sdks/accountspayablesuppliers/README.md#downloadattachment) - Download supplier attachment
88
- * [get](docs/sdks/accountspayablesuppliers/README.md#get) - Get supplier
89
- * [getAttachment](docs/sdks/accountspayablesuppliers/README.md#getattachment) - Get supplier attachment
90
- * [list](docs/sdks/accountspayablesuppliers/README.md#list) - List suppliers
91
- * [listAttachments](docs/sdks/accountspayablesuppliers/README.md#listattachments) - List supplier attachments
92
-
93
64
  ### [companies](docs/sdks/companies/README.md)
94
65
 
95
66
  * [create](docs/sdks/companies/README.md#create) - Create company
@@ -135,6 +106,33 @@ sdk.accountingBankData.listTransactions({
135
106
  * [listLoanTransactions](docs/sdks/liabilities/README.md#listloantransactions) - List loan transactions
136
107
 
137
108
 
109
+ ### [accountsPayableBillCreditNotes](docs/sdks/accountspayablebillcreditnotes/README.md)
110
+
111
+ * [get](docs/sdks/accountspayablebillcreditnotes/README.md#get) - Get bill credit note
112
+ * [list](docs/sdks/accountspayablebillcreditnotes/README.md#list) - List bill credit notes
113
+
114
+ ### [accountsPayableBillPayments](docs/sdks/accountspayablebillpayments/README.md)
115
+
116
+ * [get](docs/sdks/accountspayablebillpayments/README.md#get) - Get bill payment
117
+ * [list](docs/sdks/accountspayablebillpayments/README.md#list) - List bill payments
118
+
119
+ ### [accountsPayableBills](docs/sdks/accountspayablebills/README.md)
120
+
121
+ * [downloadAttachment](docs/sdks/accountspayablebills/README.md#downloadattachment) - Download bill attachment
122
+ * [get](docs/sdks/accountspayablebills/README.md#get) - Get bill
123
+ * [getAttachment](docs/sdks/accountspayablebills/README.md#getattachment) - Get bill attachment
124
+ * [list](docs/sdks/accountspayablebills/README.md#list) - List bills
125
+ * [listAttachments](docs/sdks/accountspayablebills/README.md#listattachments) - List bill attachments
126
+
127
+ ### [accountsPayableSuppliers](docs/sdks/accountspayablesuppliers/README.md)
128
+
129
+ * [downloadAttachment](docs/sdks/accountspayablesuppliers/README.md#downloadattachment) - Download supplier attachment
130
+ * [get](docs/sdks/accountspayablesuppliers/README.md#get) - Get supplier
131
+ * [getAttachment](docs/sdks/accountspayablesuppliers/README.md#getattachment) - Get supplier attachment
132
+ * [list](docs/sdks/accountspayablesuppliers/README.md#list) - List suppliers
133
+ * [listAttachments](docs/sdks/accountspayablesuppliers/README.md#listattachments) - List supplier attachments
134
+
135
+
138
136
  ### [accountsReceivableCreditNotes](docs/sdks/accountsreceivablecreditnotes/README.md)
139
137
 
140
138
  * [get](docs/sdks/accountsreceivablecreditnotes/README.md#get) - Get credit note
@@ -1,18 +1,8 @@
1
- import * as utils from "../internal/utils";
2
1
  import { AccountsPayableBillCreditNotes } from "./accountspayablebillcreditnotes";
3
2
  import { AccountsPayableBillPayments } from "./accountspayablebillpayments";
4
3
  import { AccountsPayableBills } from "./accountspayablebills";
5
4
  import { AccountsPayableSuppliers } from "./accountspayablesuppliers";
6
- import * as operations from "./models/operations";
7
5
  import { SDKConfiguration } from "./sdk";
8
- import { AxiosRequestConfig } from "axios";
9
- /**
10
- * Data from a linked accounting platform representing money the business owes money to its suppliers.
11
- */
12
- export declare enum DownloadBillAttachmentAcceptEnum {
13
- applicationJson = "application/json",
14
- applicationOctetStream = "application/octet-stream"
15
- }
16
6
  export declare class AccountsPayable {
17
7
  billCreditNotes: AccountsPayableBillCreditNotes;
18
8
  billPayments: AccountsPayableBillPayments;
@@ -20,28 +10,4 @@ export declare class AccountsPayable {
20
10
  suppliers: AccountsPayableSuppliers;
21
11
  private sdkConfiguration;
22
12
  constructor(sdkConfig: SDKConfiguration);
23
- /**
24
- * Download bill attachment
25
- *
26
- * @remarks
27
- * The *Download bill attachment* endpoint downloads a specific attachment for a given `billId` and `attachmentId`.
28
- *
29
- * [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.
30
- *
31
- * 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.
32
- *
33
- */
34
- downloadBillAttachment(req: operations.DownloadAccountingBillAttachmentRequest, retries?: utils.RetryConfig, config?: AxiosRequestConfig, acceptHeaderOverride?: DownloadBillAttachmentAcceptEnum): Promise<operations.DownloadAccountingBillAttachmentResponse>;
35
- /**
36
- * Get bill attachment
37
- *
38
- * @remarks
39
- * The *Get bill attachment* endpoint returns a specific attachment for a given `billId` and `attachmentId`.
40
- *
41
- * [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.
42
- *
43
- * 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.
44
- *
45
- */
46
- getBillAttachment(req: operations.GetAccountingBillAttachmentRequest, retries?: utils.RetryConfig, config?: AxiosRequestConfig): Promise<operations.GetAccountingBillAttachmentResponse>;
47
13
  }
@@ -2,94 +2,12 @@
2
2
  /*
3
3
  * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
4
4
  */
5
- var __assign = (this && this.__assign) || function () {
6
- __assign = Object.assign || function(t) {
7
- for (var s, i = 1, n = arguments.length; i < n; i++) {
8
- s = arguments[i];
9
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
10
- t[p] = s[p];
11
- }
12
- return t;
13
- };
14
- return __assign.apply(this, arguments);
15
- };
16
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
17
- if (k2 === undefined) k2 = k;
18
- var desc = Object.getOwnPropertyDescriptor(m, k);
19
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
20
- desc = { enumerable: true, get: function() { return m[k]; } };
21
- }
22
- Object.defineProperty(o, k2, desc);
23
- }) : (function(o, m, k, k2) {
24
- if (k2 === undefined) k2 = k;
25
- o[k2] = m[k];
26
- }));
27
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
28
- Object.defineProperty(o, "default", { enumerable: true, value: v });
29
- }) : function(o, v) {
30
- o["default"] = v;
31
- });
32
- var __importStar = (this && this.__importStar) || function (mod) {
33
- if (mod && mod.__esModule) return mod;
34
- var result = {};
35
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
36
- __setModuleDefault(result, mod);
37
- return result;
38
- };
39
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
40
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
41
- return new (P || (P = Promise))(function (resolve, reject) {
42
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
43
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
44
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
45
- step((generator = generator.apply(thisArg, _arguments || [])).next());
46
- });
47
- };
48
- var __generator = (this && this.__generator) || function (thisArg, body) {
49
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
50
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
51
- function verb(n) { return function (v) { return step([n, v]); }; }
52
- function step(op) {
53
- if (f) throw new TypeError("Generator is already executing.");
54
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
55
- 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;
56
- if (y = 0, t) op = [op[0] & 2, t.value];
57
- switch (op[0]) {
58
- case 0: case 1: t = op; break;
59
- case 4: _.label++; return { value: op[1], done: false };
60
- case 5: _.label++; y = op[1]; op = [0]; continue;
61
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
62
- default:
63
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
64
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
65
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
66
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
67
- if (t[2]) _.ops.pop();
68
- _.trys.pop(); continue;
69
- }
70
- op = body.call(thisArg, _);
71
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
72
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
73
- }
74
- };
75
5
  Object.defineProperty(exports, "__esModule", { value: true });
76
- exports.AccountsPayable = exports.DownloadBillAttachmentAcceptEnum = void 0;
77
- var utils = __importStar(require("../internal/utils"));
6
+ exports.AccountsPayable = void 0;
78
7
  var accountspayablebillcreditnotes_1 = require("./accountspayablebillcreditnotes");
79
8
  var accountspayablebillpayments_1 = require("./accountspayablebillpayments");
80
9
  var accountspayablebills_1 = require("./accountspayablebills");
81
10
  var accountspayablesuppliers_1 = require("./accountspayablesuppliers");
82
- var errors = __importStar(require("./models/errors"));
83
- var operations = __importStar(require("./models/operations"));
84
- var shared = __importStar(require("./models/shared"));
85
- /**
86
- * Data from a linked accounting platform representing money the business owes money to its suppliers.
87
- */
88
- var DownloadBillAttachmentAcceptEnum;
89
- (function (DownloadBillAttachmentAcceptEnum) {
90
- DownloadBillAttachmentAcceptEnum["applicationJson"] = "application/json";
91
- DownloadBillAttachmentAcceptEnum["applicationOctetStream"] = "application/octet-stream";
92
- })(DownloadBillAttachmentAcceptEnum = exports.DownloadBillAttachmentAcceptEnum || (exports.DownloadBillAttachmentAcceptEnum = {}));
93
11
  var AccountsPayable = /** @class */ (function () {
94
12
  function AccountsPayable(sdkConfig) {
95
13
  this.sdkConfiguration = sdkConfig;
@@ -98,183 +16,6 @@ var AccountsPayable = /** @class */ (function () {
98
16
  this.bills = new accountspayablebills_1.AccountsPayableBills(this.sdkConfiguration);
99
17
  this.suppliers = new accountspayablesuppliers_1.AccountsPayableSuppliers(this.sdkConfiguration);
100
18
  }
101
- /**
102
- * Download bill attachment
103
- *
104
- * @remarks
105
- * The *Download bill attachment* endpoint downloads a specific attachment for a given `billId` and `attachmentId`.
106
- *
107
- * [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.
108
- *
109
- * 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.
110
- *
111
- */
112
- AccountsPayable.prototype.downloadBillAttachment = function (req, retries, config, acceptHeaderOverride) {
113
- var _a, _b;
114
- return __awaiter(this, void 0, void 0, function () {
115
- var baseURL, url, client, globalSecurity, properties, headers, globalRetryConfig, retryConfig, httpRes, contentType, res, decodedRes;
116
- return __generator(this, function (_c) {
117
- switch (_c.label) {
118
- case 0:
119
- if (!(req instanceof utils.SpeakeasyBase)) {
120
- req = new operations.DownloadAccountingBillAttachmentRequest(req);
121
- }
122
- baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
123
- url = utils.generateURL(baseURL, "/companies/{companyId}/connections/{connectionId}/data/bills/{billId}/attachments/{attachmentId}/download", req);
124
- client = this.sdkConfiguration.defaultClient;
125
- globalSecurity = this.sdkConfiguration.security;
126
- if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
127
- return [4 /*yield*/, globalSecurity()];
128
- case 1:
129
- globalSecurity = _c.sent();
130
- _c.label = 2;
131
- case 2:
132
- if (!(globalSecurity instanceof utils.SpeakeasyBase)) {
133
- globalSecurity = new shared.Security(globalSecurity);
134
- }
135
- properties = utils.parseSecurityProperties(globalSecurity);
136
- headers = __assign(__assign({}, config === null || config === void 0 ? void 0 : config.headers), properties.headers);
137
- if (acceptHeaderOverride !== undefined) {
138
- headers["Accept"] = acceptHeaderOverride.toString();
139
- }
140
- else {
141
- headers["Accept"] = "application/json;q=1, application/octet-stream;q=0";
142
- }
143
- headers["user-agent"] = "speakeasy-sdk/".concat(this.sdkConfiguration.language, " ").concat(this.sdkConfiguration.sdkVersion, " ").concat(this.sdkConfiguration.genVersion, " ").concat(this.sdkConfiguration.openapiDocVersion);
144
- globalRetryConfig = this.sdkConfiguration.retryConfig;
145
- retryConfig = retries;
146
- if (!retryConfig) {
147
- if (globalRetryConfig) {
148
- retryConfig = globalRetryConfig;
149
- }
150
- else {
151
- retryConfig = new utils.RetryConfig("backoff", new utils.BackoffStrategy(500, 60000, 1.5, 3600000), true);
152
- }
153
- }
154
- return [4 /*yield*/, utils.Retry(function () {
155
- return client.request(__assign({ validateStatus: function () { return true; }, url: url, method: "get", headers: headers, responseType: "arraybuffer" }, config));
156
- }, new utils.Retries(retryConfig, ["408", "429", "5XX"]))];
157
- case 3:
158
- httpRes = _c.sent();
159
- 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 : "";
160
- if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
161
- throw new Error("status code not found in response: ".concat(httpRes));
162
- }
163
- res = new operations.DownloadAccountingBillAttachmentResponse({
164
- statusCode: httpRes.status,
165
- contentType: contentType,
166
- rawResponse: httpRes,
167
- });
168
- decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
169
- switch (true) {
170
- case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
171
- if (utils.matchContentType(contentType, "application/octet-stream")) {
172
- res.data = httpRes === null || httpRes === void 0 ? void 0 : httpRes.data;
173
- }
174
- else {
175
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
176
- }
177
- break;
178
- case [401, 404, 429].includes(httpRes === null || httpRes === void 0 ? void 0 : httpRes.status):
179
- if (utils.matchContentType(contentType, "application/json")) {
180
- res.errorMessage = utils.objectToClass(JSON.parse(decodedRes), shared.ErrorMessage);
181
- }
182
- else {
183
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
184
- }
185
- break;
186
- }
187
- return [2 /*return*/, res];
188
- }
189
- });
190
- });
191
- };
192
- /**
193
- * Get bill attachment
194
- *
195
- * @remarks
196
- * The *Get bill attachment* endpoint returns a specific attachment for a given `billId` and `attachmentId`.
197
- *
198
- * [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.
199
- *
200
- * 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.
201
- *
202
- */
203
- AccountsPayable.prototype.getBillAttachment = function (req, retries, config) {
204
- var _a, _b;
205
- return __awaiter(this, void 0, void 0, function () {
206
- var baseURL, url, client, globalSecurity, properties, headers, globalRetryConfig, retryConfig, httpRes, contentType, res, decodedRes;
207
- return __generator(this, function (_c) {
208
- switch (_c.label) {
209
- case 0:
210
- if (!(req instanceof utils.SpeakeasyBase)) {
211
- req = new operations.GetAccountingBillAttachmentRequest(req);
212
- }
213
- baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
214
- url = utils.generateURL(baseURL, "/companies/{companyId}/connections/{connectionId}/data/bills/{billId}/attachments/{attachmentId}", req);
215
- client = this.sdkConfiguration.defaultClient;
216
- globalSecurity = this.sdkConfiguration.security;
217
- if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
218
- return [4 /*yield*/, globalSecurity()];
219
- case 1:
220
- globalSecurity = _c.sent();
221
- _c.label = 2;
222
- case 2:
223
- if (!(globalSecurity instanceof utils.SpeakeasyBase)) {
224
- globalSecurity = new shared.Security(globalSecurity);
225
- }
226
- properties = utils.parseSecurityProperties(globalSecurity);
227
- headers = __assign(__assign({}, config === null || config === void 0 ? void 0 : config.headers), properties.headers);
228
- headers["Accept"] = "application/json";
229
- headers["user-agent"] = "speakeasy-sdk/".concat(this.sdkConfiguration.language, " ").concat(this.sdkConfiguration.sdkVersion, " ").concat(this.sdkConfiguration.genVersion, " ").concat(this.sdkConfiguration.openapiDocVersion);
230
- globalRetryConfig = this.sdkConfiguration.retryConfig;
231
- retryConfig = retries;
232
- if (!retryConfig) {
233
- if (globalRetryConfig) {
234
- retryConfig = globalRetryConfig;
235
- }
236
- else {
237
- retryConfig = new utils.RetryConfig("backoff", new utils.BackoffStrategy(500, 60000, 1.5, 3600000), true);
238
- }
239
- }
240
- return [4 /*yield*/, utils.Retry(function () {
241
- return client.request(__assign({ validateStatus: function () { return true; }, url: url, method: "get", headers: headers, responseType: "arraybuffer" }, config));
242
- }, new utils.Retries(retryConfig, ["408", "429", "5XX"]))];
243
- case 3:
244
- httpRes = _c.sent();
245
- 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 : "";
246
- if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
247
- throw new Error("status code not found in response: ".concat(httpRes));
248
- }
249
- res = new operations.GetAccountingBillAttachmentResponse({
250
- statusCode: httpRes.status,
251
- contentType: contentType,
252
- rawResponse: httpRes,
253
- });
254
- decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
255
- switch (true) {
256
- case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
257
- if (utils.matchContentType(contentType, "application/json")) {
258
- res.accountingAttachment = utils.objectToClass(JSON.parse(decodedRes), shared.AccountingAttachment);
259
- }
260
- else {
261
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
262
- }
263
- break;
264
- case [401, 404, 429].includes(httpRes === null || httpRes === void 0 ? void 0 : httpRes.status):
265
- if (utils.matchContentType(contentType, "application/json")) {
266
- res.errorMessage = utils.objectToClass(JSON.parse(decodedRes), shared.ErrorMessage);
267
- }
268
- else {
269
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
270
- }
271
- break;
272
- }
273
- return [2 /*return*/, res];
274
- }
275
- });
276
- });
277
- };
278
19
  return AccountsPayable;
279
20
  }());
280
21
  exports.AccountsPayable = AccountsPayable;
@@ -2,9 +2,25 @@ import * as utils from "../internal/utils";
2
2
  import * as operations from "./models/operations";
3
3
  import { SDKConfiguration } from "./sdk";
4
4
  import { AxiosRequestConfig } from "axios";
5
+ export declare enum DownloadAttachmentAcceptEnum {
6
+ applicationJson = "application/json",
7
+ applicationOctetStream = "application/octet-stream"
8
+ }
5
9
  export declare class AccountsPayableBills {
6
10
  private sdkConfiguration;
7
11
  constructor(sdkConfig: SDKConfiguration);
12
+ /**
13
+ * Download bill attachment
14
+ *
15
+ * @remarks
16
+ * The *Download bill attachment* endpoint downloads a specific attachment for a given `billId` and `attachmentId`.
17
+ *
18
+ * [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.
19
+ *
20
+ * 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.
21
+ *
22
+ */
23
+ downloadAttachment(req: operations.DownloadAccountingBillAttachmentRequest, retries?: utils.RetryConfig, config?: AxiosRequestConfig, acceptHeaderOverride?: DownloadAttachmentAcceptEnum): Promise<operations.DownloadAccountingBillAttachmentResponse>;
8
24
  /**
9
25
  * Get bill
10
26
  *
@@ -19,6 +35,18 @@ export declare class AccountsPayableBills {
19
35
  *
20
36
  */
21
37
  get(req: operations.GetAccountingBillRequest, retries?: utils.RetryConfig, config?: AxiosRequestConfig): Promise<operations.GetAccountingBillResponse>;
38
+ /**
39
+ * Get bill attachment
40
+ *
41
+ * @remarks
42
+ * The *Get bill attachment* endpoint returns a specific attachment for a given `billId` and `attachmentId`.
43
+ *
44
+ * [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.
45
+ *
46
+ * 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.
47
+ *
48
+ */
49
+ getAttachment(req: operations.GetAccountingBillAttachmentRequest, retries?: utils.RetryConfig, config?: AxiosRequestConfig): Promise<operations.GetAccountingBillAttachmentResponse>;
22
50
  /**
23
51
  * List bills
24
52
  *
@@ -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
  *
package/dist/sdk/sdk.d.ts CHANGED
@@ -93,10 +93,6 @@ export declare class CodatLending {
93
93
  * Access bank transactions from an accounting platform.
94
94
  */
95
95
  accountingBankData: AccountingBankData;
96
- /**
97
- * Data from a linked accounting platform representing money the business owes money to its suppliers.
98
- */
99
- accountsPayable: AccountsPayable;
100
96
  /**
101
97
  * Create and manage your Codat companies.
102
98
  */
@@ -125,6 +121,7 @@ export declare class CodatLending {
125
121
  * Debt and other liabilities.
126
122
  */
127
123
  liabilities: Liabilities;
124
+ accountsPayable: AccountsPayable;
128
125
  accountsReceivable: AccountsReceivable;
129
126
  banking: Banking;
130
127
  financialStatements: FinancialStatements;
package/dist/sdk/sdk.js CHANGED
@@ -36,7 +36,7 @@ var SDKConfiguration = /** @class */ (function () {
36
36
  function SDKConfiguration(init) {
37
37
  this.language = "typescript";
38
38
  this.openapiDocVersion = "3.0.0";
39
- this.sdkVersion = "1.2.0";
39
+ this.sdkVersion = "2.1.0";
40
40
  this.genVersion = "2.109.3";
41
41
  Object.assign(this, init);
42
42
  }
@@ -90,7 +90,6 @@ var CodatLending = /** @class */ (function () {
90
90
  retryConfig: props === null || props === void 0 ? void 0 : props.retryConfig,
91
91
  });
92
92
  this.accountingBankData = new accountingbankdata_1.AccountingBankData(this.sdkConfiguration);
93
- this.accountsPayable = new accountspayable_1.AccountsPayable(this.sdkConfiguration);
94
93
  this.companies = new companies_1.Companies(this.sdkConfiguration);
95
94
  this.companyInfo = new companyinfo_1.CompanyInfo(this.sdkConfiguration);
96
95
  this.connections = new connections_1.Connections(this.sdkConfiguration);
@@ -98,6 +97,7 @@ var CodatLending = /** @class */ (function () {
98
97
  this.excelReports = new excelreports_1.ExcelReports(this.sdkConfiguration);
99
98
  this.fileUpload = new fileupload_1.FileUpload(this.sdkConfiguration);
100
99
  this.liabilities = new liabilities_1.Liabilities(this.sdkConfiguration);
100
+ this.accountsPayable = new accountspayable_1.AccountsPayable(this.sdkConfiguration);
101
101
  this.accountsReceivable = new accountsreceivable_1.AccountsReceivable(this.sdkConfiguration);
102
102
  this.banking = new banking_1.Banking(this.sdkConfiguration);
103
103
  this.financialStatements = new financialstatements_1.FinancialStatements(this.sdkConfiguration);
@@ -1,104 +1,4 @@
1
1
  # accountsPayable
2
2
 
3
- ## Overview
4
-
5
- Data from a linked accounting platform representing money the business owes money to its suppliers.
6
-
7
3
  ### Available Operations
8
4
 
9
- * [downloadBillAttachment](#downloadbillattachment) - Download bill attachment
10
- * [getBillAttachment](#getbillattachment) - Get bill attachment
11
-
12
- ## downloadBillAttachment
13
-
14
- The *Download bill attachment* endpoint downloads a specific attachment for a given `billId` and `attachmentId`.
15
-
16
- [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.
17
-
18
- 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.
19
-
20
-
21
- ### Example Usage
22
-
23
- ```typescript
24
- import { CodatLending } from "@codat/lending";
25
- import { DownloadAccountingBillAttachmentResponse } from "@codat/lending/dist/sdk/models/operations";
26
-
27
- const sdk = new CodatLending({
28
- security: {
29
- authHeader: "Basic BASE_64_ENCODED(API_KEY)",
30
- },
31
- });
32
-
33
- sdk.accountsPayable.downloadBillAttachment({
34
- attachmentId: "8a210b68-6988-11ed-a1eb-0242ac120002",
35
- billId: "corrupti",
36
- companyId: "8a210b68-6988-11ed-a1eb-0242ac120002",
37
- connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171",
38
- }).then((res: DownloadAccountingBillAttachmentResponse) => {
39
- if (res.statusCode == 200) {
40
- // handle response
41
- }
42
- });
43
- ```
44
-
45
- ### Parameters
46
-
47
- | Parameter | Type | Required | Description |
48
- | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ |
49
- | `request` | [operations.DownloadAccountingBillAttachmentRequest](../../models/operations/downloadaccountingbillattachmentrequest.md) | :heavy_check_mark: | The request object to use for the request. |
50
- | `retries` | [utils.RetryConfig](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
51
- | `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. |
52
-
53
-
54
- ### Response
55
-
56
- **Promise<[operations.DownloadAccountingBillAttachmentResponse](../../models/operations/downloadaccountingbillattachmentresponse.md)>**
57
-
58
-
59
- ## getBillAttachment
60
-
61
- The *Get bill attachment* endpoint returns a specific attachment for a given `billId` and `attachmentId`.
62
-
63
- [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.
64
-
65
- 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.
66
-
67
-
68
- ### Example Usage
69
-
70
- ```typescript
71
- import { CodatLending } from "@codat/lending";
72
- import { GetAccountingBillAttachmentResponse } from "@codat/lending/dist/sdk/models/operations";
73
-
74
- const sdk = new CodatLending({
75
- security: {
76
- authHeader: "Basic BASE_64_ENCODED(API_KEY)",
77
- },
78
- });
79
-
80
- sdk.accountsPayable.getBillAttachment({
81
- attachmentId: "8a210b68-6988-11ed-a1eb-0242ac120002",
82
- billId: "illum",
83
- companyId: "8a210b68-6988-11ed-a1eb-0242ac120002",
84
- connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171",
85
- }).then((res: GetAccountingBillAttachmentResponse) => {
86
- if (res.statusCode == 200) {
87
- // handle response
88
- }
89
- });
90
- ```
91
-
92
- ### Parameters
93
-
94
- | Parameter | Type | Required | Description |
95
- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- |
96
- | `request` | [operations.GetAccountingBillAttachmentRequest](../../models/operations/getaccountingbillattachmentrequest.md) | :heavy_check_mark: | The request object to use for the request. |
97
- | `retries` | [utils.RetryConfig](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
98
- | `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. |
99
-
100
-
101
- ### Response
102
-
103
- **Promise<[operations.GetAccountingBillAttachmentResponse](../../models/operations/getaccountingbillattachmentresponse.md)>**
104
-
@@ -29,7 +29,7 @@ const sdk = new CodatLending({
29
29
  });
30
30
 
31
31
  sdk.accountsPayableBillCreditNotes.get({
32
- billCreditNoteId: "vel",
32
+ billCreditNoteId: "molestiae",
33
33
  companyId: "8a210b68-6988-11ed-a1eb-0242ac120002",
34
34
  }).then((res: GetAccountingBillCreditNoteResponse) => {
35
35
  if (res.statusCode == 200) {
@@ -78,7 +78,7 @@ sdk.accountsPayableBillCreditNotes.list({
78
78
  orderBy: "-modifiedDate",
79
79
  page: 1,
80
80
  pageSize: 100,
81
- query: "error",
81
+ query: "minus",
82
82
  }).then((res: ListAccountingBillCreditNotesResponse) => {
83
83
  if (res.statusCode == 200) {
84
84
  // handle response
@@ -29,7 +29,7 @@ const sdk = new CodatLending({
29
29
  });
30
30
 
31
31
  sdk.accountsPayableBillPayments.get({
32
- billPaymentId: "deserunt",
32
+ billPaymentId: "placeat",
33
33
  companyId: "8a210b68-6988-11ed-a1eb-0242ac120002",
34
34
  }).then((res: GetAccountingBillPaymentResponse) => {
35
35
  if (res.statusCode == 200) {
@@ -78,7 +78,7 @@ sdk.accountsPayableBillPayments.list({
78
78
  orderBy: "-modifiedDate",
79
79
  page: 1,
80
80
  pageSize: 100,
81
- query: "suscipit",
81
+ query: "voluptatum",
82
82
  }).then((res: ListAccountingBillPaymentsResponse) => {
83
83
  if (res.statusCode == 200) {
84
84
  // handle response
@@ -2,10 +2,59 @@
2
2
 
3
3
  ### Available Operations
4
4
 
5
+ * [downloadAttachment](#downloadattachment) - Download bill attachment
5
6
  * [get](#get) - Get bill
7
+ * [getAttachment](#getattachment) - Get bill attachment
6
8
  * [list](#list) - List bills
7
9
  * [listAttachments](#listattachments) - List bill attachments
8
10
 
11
+ ## downloadAttachment
12
+
13
+ The *Download bill attachment* endpoint downloads a specific attachment for a given `billId` and `attachmentId`.
14
+
15
+ [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.
16
+
17
+ 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.
18
+
19
+
20
+ ### Example Usage
21
+
22
+ ```typescript
23
+ import { CodatLending } from "@codat/lending";
24
+ import { DownloadAccountingBillAttachmentResponse } from "@codat/lending/dist/sdk/models/operations";
25
+
26
+ const sdk = new CodatLending({
27
+ security: {
28
+ authHeader: "Basic BASE_64_ENCODED(API_KEY)",
29
+ },
30
+ });
31
+
32
+ sdk.accountsPayableBills.downloadAttachment({
33
+ attachmentId: "8a210b68-6988-11ed-a1eb-0242ac120002",
34
+ billId: "iusto",
35
+ companyId: "8a210b68-6988-11ed-a1eb-0242ac120002",
36
+ connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171",
37
+ }).then((res: DownloadAccountingBillAttachmentResponse) => {
38
+ if (res.statusCode == 200) {
39
+ // handle response
40
+ }
41
+ });
42
+ ```
43
+
44
+ ### Parameters
45
+
46
+ | Parameter | Type | Required | Description |
47
+ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ |
48
+ | `request` | [operations.DownloadAccountingBillAttachmentRequest](../../models/operations/downloadaccountingbillattachmentrequest.md) | :heavy_check_mark: | The request object to use for the request. |
49
+ | `retries` | [utils.RetryConfig](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
50
+ | `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. |
51
+
52
+
53
+ ### Response
54
+
55
+ **Promise<[operations.DownloadAccountingBillAttachmentResponse](../../models/operations/downloadaccountingbillattachmentresponse.md)>**
56
+
57
+
9
58
  ## get
10
59
 
11
60
  The *Get bill* endpoint returns a single bill for a given billId.
@@ -30,7 +79,7 @@ const sdk = new CodatLending({
30
79
  });
31
80
 
32
81
  sdk.accountsPayableBills.get({
33
- billId: "iure",
82
+ billId: "excepturi",
34
83
  companyId: "8a210b68-6988-11ed-a1eb-0242ac120002",
35
84
  }).then((res: GetAccountingBillResponse) => {
36
85
  if (res.statusCode == 200) {
@@ -53,6 +102,53 @@ sdk.accountsPayableBills.get({
53
102
  **Promise<[operations.GetAccountingBillResponse](../../models/operations/getaccountingbillresponse.md)>**
54
103
 
55
104
 
105
+ ## getAttachment
106
+
107
+ The *Get bill attachment* endpoint returns a specific attachment for a given `billId` and `attachmentId`.
108
+
109
+ [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.
110
+
111
+ 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.
112
+
113
+
114
+ ### Example Usage
115
+
116
+ ```typescript
117
+ import { CodatLending } from "@codat/lending";
118
+ import { GetAccountingBillAttachmentResponse } from "@codat/lending/dist/sdk/models/operations";
119
+
120
+ const sdk = new CodatLending({
121
+ security: {
122
+ authHeader: "Basic BASE_64_ENCODED(API_KEY)",
123
+ },
124
+ });
125
+
126
+ sdk.accountsPayableBills.getAttachment({
127
+ attachmentId: "8a210b68-6988-11ed-a1eb-0242ac120002",
128
+ billId: "nisi",
129
+ companyId: "8a210b68-6988-11ed-a1eb-0242ac120002",
130
+ connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171",
131
+ }).then((res: GetAccountingBillAttachmentResponse) => {
132
+ if (res.statusCode == 200) {
133
+ // handle response
134
+ }
135
+ });
136
+ ```
137
+
138
+ ### Parameters
139
+
140
+ | Parameter | Type | Required | Description |
141
+ | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- |
142
+ | `request` | [operations.GetAccountingBillAttachmentRequest](../../models/operations/getaccountingbillattachmentrequest.md) | :heavy_check_mark: | The request object to use for the request. |
143
+ | `retries` | [utils.RetryConfig](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
144
+ | `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. |
145
+
146
+
147
+ ### Response
148
+
149
+ **Promise<[operations.GetAccountingBillAttachmentResponse](../../models/operations/getaccountingbillattachmentresponse.md)>**
150
+
151
+
56
152
  ## list
57
153
 
58
154
  The *List bills* endpoint returns a list of [bills](https://docs.codat.io/accounting-api#/schemas/Bill) for a given company's connection.
@@ -79,7 +175,7 @@ sdk.accountsPayableBills.list({
79
175
  orderBy: "-modifiedDate",
80
176
  page: 1,
81
177
  pageSize: 100,
82
- query: "magnam",
178
+ query: "recusandae",
83
179
  }).then((res: ListAccountingBillsResponse) => {
84
180
  if (res.statusCode == 200) {
85
181
  // handle response
@@ -123,7 +219,7 @@ const sdk = new CodatLending({
123
219
  });
124
220
 
125
221
  sdk.accountsPayableBills.listAttachments({
126
- billId: "debitis",
222
+ billId: "temporibus",
127
223
  companyId: "8a210b68-6988-11ed-a1eb-0242ac120002",
128
224
  connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171",
129
225
  }).then((res: ListAccountingBillAttachmentsResponse) => {
@@ -33,7 +33,7 @@ sdk.accountsPayableSuppliers.downloadAttachment({
33
33
  attachmentId: "8a210b68-6988-11ed-a1eb-0242ac120002",
34
34
  companyId: "8a210b68-6988-11ed-a1eb-0242ac120002",
35
35
  connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171",
36
- supplierId: "ipsa",
36
+ supplierId: "ab",
37
37
  }).then((res: DownloadAccountingSupplierAttachmentResponse) => {
38
38
  if (res.statusCode == 200) {
39
39
  // handle response
@@ -80,7 +80,7 @@ const sdk = new CodatLending({
80
80
 
81
81
  sdk.accountsPayableSuppliers.get({
82
82
  companyId: "8a210b68-6988-11ed-a1eb-0242ac120002",
83
- supplierId: "delectus",
83
+ supplierId: "quis",
84
84
  }).then((res: GetAccountingSupplierResponse) => {
85
85
  if (res.statusCode == 200) {
86
86
  // handle response
@@ -127,7 +127,7 @@ sdk.accountsPayableSuppliers.getAttachment({
127
127
  attachmentId: "8a210b68-6988-11ed-a1eb-0242ac120002",
128
128
  companyId: "8a210b68-6988-11ed-a1eb-0242ac120002",
129
129
  connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171",
130
- supplierId: "tempora",
130
+ supplierId: "veritatis",
131
131
  }).then((res: GetAccountingSupplierAttachmentResponse) => {
132
132
  if (res.statusCode == 200) {
133
133
  // handle response
@@ -175,7 +175,7 @@ sdk.accountsPayableSuppliers.list({
175
175
  orderBy: "-modifiedDate",
176
176
  page: 1,
177
177
  pageSize: 100,
178
- query: "suscipit",
178
+ query: "deserunt",
179
179
  }).then((res: ListAccountingSuppliersResponse) => {
180
180
  if (res.statusCode == 200) {
181
181
  // handle response
@@ -221,7 +221,7 @@ const sdk = new CodatLending({
221
221
  sdk.accountsPayableSuppliers.listAttachments({
222
222
  companyId: "8a210b68-6988-11ed-a1eb-0242ac120002",
223
223
  connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171",
224
- supplierId: "molestiae",
224
+ supplierId: "perferendis",
225
225
  }).then((res: ListAccountingSupplierAttachmentsResponse) => {
226
226
  if (res.statusCode == 200) {
227
227
  // handle response
@@ -155,7 +155,7 @@ sdk.companies.list({
155
155
  orderBy: "-modifiedDate",
156
156
  page: 1,
157
157
  pageSize: 100,
158
- query: "minus",
158
+ query: "corrupti",
159
159
  }).then((res: ListCompaniesResponse) => {
160
160
  if (res.statusCode == 200) {
161
161
  // handle response
@@ -32,7 +32,7 @@ const sdk = new CodatLending({
32
32
 
33
33
  sdk.connections.create({
34
34
  requestBody: {
35
- platformKey: "placeat",
35
+ platformKey: "illum",
36
36
  },
37
37
  companyId: "8a210b68-6988-11ed-a1eb-0242ac120002",
38
38
  }).then((res: CreateConnectionResponse) => {
@@ -158,7 +158,7 @@ sdk.connections.list({
158
158
  orderBy: "-modifiedDate",
159
159
  page: 1,
160
160
  pageSize: 100,
161
- query: "voluptatum",
161
+ query: "vel",
162
162
  }).then((res: ListConnectionsResponse) => {
163
163
  if (res.statusCode == 200) {
164
164
  // handle response
@@ -199,7 +199,7 @@ const sdk = new CodatLending({
199
199
 
200
200
  sdk.connections.unlink({
201
201
  requestBody: {
202
- status: DataConnectionStatus.Linked,
202
+ status: DataConnectionStatus.Unlinked,
203
203
  },
204
204
  companyId: "8a210b68-6988-11ed-a1eb-0242ac120002",
205
205
  connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171",
@@ -35,7 +35,7 @@ sdk.dataIntegrity.details({
35
35
  orderBy: "-modifiedDate",
36
36
  page: 1,
37
37
  pageSize: 100,
38
- query: "excepturi",
38
+ query: "deserunt",
39
39
  }).then((res: ListDataIntegrityDetailsResponse) => {
40
40
  if (res.statusCode == 200) {
41
41
  // handle response
@@ -129,7 +129,7 @@ const sdk = new CodatLending({
129
129
  sdk.dataIntegrity.summaries({
130
130
  companyId: "8a210b68-6988-11ed-a1eb-0242ac120002",
131
131
  dataType: DataIntegrityDataType.BankingAccounts,
132
- query: "nisi",
132
+ query: "suscipit",
133
133
  }).then((res: GetDataIntegritySummariesResponse) => {
134
134
  if (res.statusCode == 200) {
135
135
  // handle response
@@ -33,7 +33,7 @@ const sdk = new CodatLending({
33
33
 
34
34
  sdk.excelReports.download({
35
35
  companyId: "8a210b68-6988-11ed-a1eb-0242ac120002",
36
- reportType: ExcelReportTypes.EnhancedCashFlow,
36
+ reportType: ExcelReportTypes.EnhancedFinancials,
37
37
  }).then((res: DownloadExcelReportResponse) => {
38
38
  if (res.statusCode == 200) {
39
39
  // handle response
@@ -90,7 +90,7 @@ const sdk = new CodatLending({
90
90
 
91
91
  sdk.excelReports.generate({
92
92
  companyId: "8a210b68-6988-11ed-a1eb-0242ac120002",
93
- reportType: ExcelReportTypes.EnhancedCashFlow,
93
+ reportType: ExcelReportTypes.EnhancedFinancials,
94
94
  }).then((res: GenerateExcelReportResponse) => {
95
95
  if (res.statusCode == 200) {
96
96
  // handle response
@@ -135,7 +135,7 @@ const sdk = new CodatLending({
135
135
 
136
136
  sdk.excelReports.getStatus({
137
137
  companyId: "8a210b68-6988-11ed-a1eb-0242ac120002",
138
- reportType: ExcelReportTypes.Audit,
138
+ reportType: ExcelReportTypes.EnhancedCashFlow,
139
139
  }).then((res: GetExcelReportGenerationStatusResponse) => {
140
140
  if (res.statusCode == 200) {
141
141
  // handle response
@@ -113,8 +113,8 @@ const sdk = new CodatLending({
113
113
 
114
114
  sdk.fileUpload.upload({
115
115
  requestBody: {
116
- content: "veritatis".encode(),
117
- requestBody: "deserunt",
116
+ content: "delectus".encode(),
117
+ requestBody: "tempora",
118
118
  },
119
119
  companyId: "8a210b68-6988-11ed-a1eb-0242ac120002",
120
120
  connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171",
@@ -76,7 +76,7 @@ const sdk = new CodatLending({
76
76
 
77
77
  sdk.liabilities.listLoanTransactions({
78
78
  companyId: "8a210b68-6988-11ed-a1eb-0242ac120002",
79
- sourceType: ListLoanTransactionsSourceType.Banking,
79
+ sourceType: ListLoanTransactionsSourceType.Commerce,
80
80
  }).then((res: ListLoanTransactionsResponse) => {
81
81
  if (res.statusCode == 200) {
82
82
  // handle response
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codat/lending",
3
- "version": "1.2.0",
3
+ "version": "2.1.0",
4
4
  "author": "Codat",
5
5
  "scripts": {
6
6
  "prepare": "tsc --build"