@roadmate-io/qonto-client 0.1.6
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 +146 -0
- package/dist/client.d.ts +32 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +61 -0
- package/dist/client.js.map +1 -0
- package/dist/index.d.ts +74 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +119 -0
- package/dist/index.js.map +1 -0
- package/dist/resources/attachments.d.ts +29 -0
- package/dist/resources/attachments.d.ts.map +1 -0
- package/dist/resources/attachments.js +40 -0
- package/dist/resources/attachments.js.map +1 -0
- package/dist/resources/bankAccounts.d.ts +71 -0
- package/dist/resources/bankAccounts.d.ts.map +1 -0
- package/dist/resources/bankAccounts.js +51 -0
- package/dist/resources/bankAccounts.js.map +1 -0
- package/dist/resources/beneficiaries.d.ts +84 -0
- package/dist/resources/beneficiaries.d.ts.map +1 -0
- package/dist/resources/beneficiaries.js +58 -0
- package/dist/resources/beneficiaries.js.map +1 -0
- package/dist/resources/cards.d.ts +186 -0
- package/dist/resources/cards.d.ts.map +1 -0
- package/dist/resources/cards.js +120 -0
- package/dist/resources/cards.js.map +1 -0
- package/dist/resources/clientInvoices.d.ts +118 -0
- package/dist/resources/clientInvoices.d.ts.map +1 -0
- package/dist/resources/clientInvoices.js +101 -0
- package/dist/resources/clientInvoices.js.map +1 -0
- package/dist/resources/clients.d.ts +128 -0
- package/dist/resources/clients.d.ts.map +1 -0
- package/dist/resources/clients.js +44 -0
- package/dist/resources/clients.js.map +1 -0
- package/dist/resources/creditNotes.d.ts +53 -0
- package/dist/resources/creditNotes.d.ts.map +1 -0
- package/dist/resources/creditNotes.js +31 -0
- package/dist/resources/creditNotes.js.map +1 -0
- package/dist/resources/insuranceContracts.d.ts +75 -0
- package/dist/resources/insuranceContracts.d.ts.map +1 -0
- package/dist/resources/insuranceContracts.js +66 -0
- package/dist/resources/insuranceContracts.js.map +1 -0
- package/dist/resources/internalTransfers.d.ts +33 -0
- package/dist/resources/internalTransfers.d.ts.map +1 -0
- package/dist/resources/internalTransfers.js +17 -0
- package/dist/resources/internalTransfers.js.map +1 -0
- package/dist/resources/internationalTransfers.d.ts +127 -0
- package/dist/resources/internationalTransfers.d.ts.map +1 -0
- package/dist/resources/internationalTransfers.js +73 -0
- package/dist/resources/internationalTransfers.js.map +1 -0
- package/dist/resources/labels.d.ts +40 -0
- package/dist/resources/labels.d.ts.map +1 -0
- package/dist/resources/labels.js +32 -0
- package/dist/resources/labels.js.map +1 -0
- package/dist/resources/memberships.d.ts +20 -0
- package/dist/resources/memberships.d.ts.map +1 -0
- package/dist/resources/memberships.js +25 -0
- package/dist/resources/memberships.js.map +1 -0
- package/dist/resources/oauth.d.ts +47 -0
- package/dist/resources/oauth.d.ts.map +1 -0
- package/dist/resources/oauth.js +38 -0
- package/dist/resources/oauth.js.map +1 -0
- package/dist/resources/organizations.d.ts +25 -0
- package/dist/resources/organizations.d.ts.map +1 -0
- package/dist/resources/organizations.js +28 -0
- package/dist/resources/organizations.js.map +1 -0
- package/dist/resources/paymentLinks.d.ts +97 -0
- package/dist/resources/paymentLinks.d.ts.map +1 -0
- package/dist/resources/paymentLinks.js +51 -0
- package/dist/resources/paymentLinks.js.map +1 -0
- package/dist/resources/products.d.ts +73 -0
- package/dist/resources/products.d.ts.map +1 -0
- package/dist/resources/products.js +41 -0
- package/dist/resources/products.js.map +1 -0
- package/dist/resources/quotes.d.ts +126 -0
- package/dist/resources/quotes.d.ts.map +1 -0
- package/dist/resources/quotes.js +48 -0
- package/dist/resources/quotes.js.map +1 -0
- package/dist/resources/requests.d.ts +94 -0
- package/dist/resources/requests.d.ts.map +1 -0
- package/dist/resources/requests.js +64 -0
- package/dist/resources/requests.js.map +1 -0
- package/dist/resources/sepaDirectDebit.d.ts +119 -0
- package/dist/resources/sepaDirectDebit.d.ts.map +1 -0
- package/dist/resources/sepaDirectDebit.js +70 -0
- package/dist/resources/sepaDirectDebit.js.map +1 -0
- package/dist/resources/sepaTransfers.d.ts +83 -0
- package/dist/resources/sepaTransfers.d.ts.map +1 -0
- package/dist/resources/sepaTransfers.js +58 -0
- package/dist/resources/sepaTransfers.js.map +1 -0
- package/dist/resources/statements.d.ts +45 -0
- package/dist/resources/statements.d.ts.map +1 -0
- package/dist/resources/statements.js +26 -0
- package/dist/resources/statements.js.map +1 -0
- package/dist/resources/supplierInvoices.d.ts +96 -0
- package/dist/resources/supplierInvoices.d.ts.map +1 -0
- package/dist/resources/supplierInvoices.js +63 -0
- package/dist/resources/supplierInvoices.js.map +1 -0
- package/dist/resources/teams.d.ts +35 -0
- package/dist/resources/teams.d.ts.map +1 -0
- package/dist/resources/teams.js +26 -0
- package/dist/resources/teams.js.map +1 -0
- package/dist/resources/transactions.d.ts +29 -0
- package/dist/resources/transactions.d.ts.map +1 -0
- package/dist/resources/transactions.js +40 -0
- package/dist/resources/transactions.js.map +1 -0
- package/dist/resources/webhooks.d.ts +65 -0
- package/dist/resources/webhooks.d.ts.map +1 -0
- package/dist/resources/webhooks.js +49 -0
- package/dist/resources/webhooks.js.map +1 -0
- package/dist/types/index.d.ts +718 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +4 -0
- package/dist/types/index.js.map +1 -0
- package/package.json +45 -0
package/README.md
ADDED
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
# qonto-client 🚀
|
|
2
|
+
|
|
3
|
+
A modern, fully-typed TypeScript client library tailored for the [Qonto Business API](https://developers.qonto.com/).
|
|
4
|
+
|
|
5
|
+
This package provides a seamless and intuitive way to integrate Qonto's banking features directly into your Node.js applications, covering everything from fetching bank accounts, managing beneficiaries, interacting with transactions, virtual limits/cards rules, to generating invoices.
|
|
6
|
+
|
|
7
|
+
## Features ✨
|
|
8
|
+
|
|
9
|
+
* **Fully Typed:** Leverage extensive TypeScript definitions to benefit from excellent editor autocompletion and structural confidence.
|
|
10
|
+
* **Promise-based API:** Utilizes standard JavaScript `async/await` patterns driven by `axios`.
|
|
11
|
+
* **Comprehensive Coverage:** Supports nearly the full spectrum of endpoints available in the Qonto API V2 (Organizations, Transactions, Cards, Invoices, Beneficiaries, etc.).
|
|
12
|
+
* **Error Handling:** Bundled `QontoApiError` wrapper cleanly intercepts and details API rejection states.
|
|
13
|
+
|
|
14
|
+
## Installation 📦
|
|
15
|
+
|
|
16
|
+
Using npm:
|
|
17
|
+
```bash
|
|
18
|
+
npm install @roadmate-io/qonto-client
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Using yarn:
|
|
22
|
+
```bash
|
|
23
|
+
yarn add @roadmate-io/qonto-client
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Using pnpm:
|
|
27
|
+
```bash
|
|
28
|
+
pnpm add @roadmate-io/qonto-client
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
*Note: Environment strictly requires **Node.js >= 20.0.0**.*
|
|
32
|
+
|
|
33
|
+
## Getting Started 🛠️
|
|
34
|
+
|
|
35
|
+
To start interacting with Qonto, supply your credentials (login slug and secret key). You can generate these credentials through your Qonto web application in `Settings > Integrations > API`.
|
|
36
|
+
|
|
37
|
+
```typescript
|
|
38
|
+
import { QontoClient } from '@roadmate-io/qonto-client';
|
|
39
|
+
|
|
40
|
+
const client = new QontoClient({
|
|
41
|
+
login: 'your-organization-slug',
|
|
42
|
+
secretKey: 'your-secret-key'
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
// Fetch current organization details
|
|
46
|
+
async function getOrgInfo() {
|
|
47
|
+
try {
|
|
48
|
+
const { organization } = await client.organizations.getCurrent();
|
|
49
|
+
// Knowing your organization
|
|
50
|
+
console.log(`Connected to: ${organization.name}`);
|
|
51
|
+
} catch (error) {
|
|
52
|
+
console.error(error);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
getOrgInfo();
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Usage Examples 💡
|
|
60
|
+
|
|
61
|
+
**List Transactions for a Specific Account**
|
|
62
|
+
```typescript
|
|
63
|
+
const bank_account_id = organization.bank_accounts[0].id;
|
|
64
|
+
// You might want to have this bank_account_id in your environments var so you don't have to query organizations
|
|
65
|
+
const { transactions, meta } = await client.transactions.list({
|
|
66
|
+
bank_account_id,
|
|
67
|
+
// other filters go here
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
console.log(`Successfully fetched ${transactions.length} transactions!`);
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
**Creating a SEPA Beneficiary**
|
|
74
|
+
```typescript
|
|
75
|
+
const newBeneficiary = await client.beneficiaries.create({
|
|
76
|
+
beneficiary: {
|
|
77
|
+
name: 'John Doe',
|
|
78
|
+
iban: 'FR7612345678901234567890123',
|
|
79
|
+
bic: 'ABCDEF12'
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
console.log('Beneficiary created:', newBeneficiary);
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
**Locking a Physical/Virtual Card**
|
|
86
|
+
```typescript
|
|
87
|
+
const suspendedCard = await client.cards.lock('card_uuid_123');
|
|
88
|
+
console.log('Card is now temporarily locked.');
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## Available Resources 📚
|
|
92
|
+
|
|
93
|
+
The `QontoClient` exposes numerous specific instance resources directly modeled after the API docs.
|
|
94
|
+
|
|
95
|
+
| Resource | Accessed via | Purpose |
|
|
96
|
+
| :--- | :--- | :--- |
|
|
97
|
+
| **Organizations** | `client.organizations` | Organization profiles and details. |
|
|
98
|
+
| **Bank Accounts** | `client.bankAccounts` | Account retrieving and tracking balances. |
|
|
99
|
+
| **Transactions** | `client.transactions` | Fetch bank operations and transaction details. |
|
|
100
|
+
| **Cards** | `client.cards` | Modifying card limits, restrictions, names, pinning, blocking. |
|
|
101
|
+
| **Beneficiaries** | `client.beneficiaries`| Managing trusted payees. |
|
|
102
|
+
| **SEPA Transfers** | `client.sepaTransfers`| Instantiating outward transfers. |
|
|
103
|
+
| **Client Invoices** | `client.clientInvoices`| Generate, fetch, or mark invoices as paid. |
|
|
104
|
+
| **Webhooks** | `client.webhooks` | Handle API event notification configurations. |
|
|
105
|
+
| **Attachments** | `client.attachments` | Document attachment and invoice receipt linking. |
|
|
106
|
+
| ...and more! | _(statements, internalTransfers, etc)_ | Explore `QontoClient` intellisense. |
|
|
107
|
+
|
|
108
|
+
## Error Handling 🛡️
|
|
109
|
+
|
|
110
|
+
All non-200 responses are automatically caught and thrown as a `QontoApiError`.
|
|
111
|
+
|
|
112
|
+
```typescript
|
|
113
|
+
import { QontoApiError } from 'qonto-client';
|
|
114
|
+
|
|
115
|
+
try {
|
|
116
|
+
await client.bankAccounts.retrieve('invalid_id');
|
|
117
|
+
} catch (error) {
|
|
118
|
+
if (error instanceof QontoApiError) {
|
|
119
|
+
console.log(`Qonto Error [${error.statusCode}]:`, error.message);
|
|
120
|
+
// Log additional API failure specifics if provided:
|
|
121
|
+
console.log('Details:', error.details);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
## Contributing 🤝
|
|
127
|
+
|
|
128
|
+
Contributions, issues, and feature requests are highly welcome! Whether you're adding new API endpoints, fixing bugs, or improving documentation, we appreciate your help in making this library better for everyone.
|
|
129
|
+
|
|
130
|
+
If you'd like to contribute, please feel free to fork the repository, open an issue, or submit a Pull Request.
|
|
131
|
+
|
|
132
|
+
**Local Development Setup:**
|
|
133
|
+
1. Clone the repository.
|
|
134
|
+
2. Ensure you have the right Node version (using `nvm use`).
|
|
135
|
+
3. Install dependencies: `npm install`
|
|
136
|
+
4. Run tests powered by vitest: `npm run test`
|
|
137
|
+
5. Compile TS to JS: `npm run build`
|
|
138
|
+
|
|
139
|
+
## License
|
|
140
|
+
MIT License
|
|
141
|
+
|
|
142
|
+
## GitHub
|
|
143
|
+
You can browse [the code here](https://www.github.com/)
|
|
144
|
+
|
|
145
|
+
## Home Page
|
|
146
|
+
Visit our [RoadMate](https://roadmate.io) home page
|
package/dist/client.d.ts
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { AxiosInstance } from "axios";
|
|
2
|
+
/**
|
|
3
|
+
* Configuration options for the Qonto API client.
|
|
4
|
+
*/
|
|
5
|
+
export interface QontoClientConfig {
|
|
6
|
+
/** Your Qonto organisation login (slug). */
|
|
7
|
+
login: string;
|
|
8
|
+
/** Your Qonto secret API key. */
|
|
9
|
+
secretKey: string;
|
|
10
|
+
/**
|
|
11
|
+
* Override the default Qonto API base URL.
|
|
12
|
+
* Defaults to `https://thirdparty.qonto.com`.
|
|
13
|
+
*/
|
|
14
|
+
baseURL?: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Typed error thrown whenever the Qonto API returns a non-2xx response.
|
|
18
|
+
*/
|
|
19
|
+
export declare class QontoApiError extends Error {
|
|
20
|
+
readonly statusCode: number;
|
|
21
|
+
readonly details: any;
|
|
22
|
+
constructor(message: string, statusCode: number, details: any);
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Creates a pre-configured Axios instance for the Qonto Business API.
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* const http = createHttpClient("my-org-login", "my-secret-key");
|
|
29
|
+
* const { data } = await http.get("/v2/transactions");
|
|
30
|
+
*/
|
|
31
|
+
export declare function createHttpClient(login: string, secretKey: string, baseURL?: string): AxiosInstance;
|
|
32
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAEA,OAAc,EAAE,aAAa,EAAc,MAAM,OAAO,CAAC;AAEzD;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,4CAA4C;IAC5C,KAAK,EAAE,MAAM,CAAC;IACd,iCAAiC;IACjC,SAAS,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,qBAAa,aAAc,SAAQ,KAAK;IACtC,SAAgB,UAAU,EAAE,MAAM,CAAC;IACnC,SAAgB,OAAO,EAAE,GAAG,CAAC;gBAEjB,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG;CAe9D;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,MAAM,EACb,SAAS,EAAE,MAAM,EACjB,OAAO,SAAiC,GACvC,aAAa,CA+Bf"}
|
package/dist/client.js
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// src/client.ts
|
|
3
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
|
+
};
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.QontoApiError = void 0;
|
|
8
|
+
exports.createHttpClient = createHttpClient;
|
|
9
|
+
const axios_1 = __importDefault(require("axios"));
|
|
10
|
+
/**
|
|
11
|
+
* Typed error thrown whenever the Qonto API returns a non-2xx response.
|
|
12
|
+
*/
|
|
13
|
+
class QontoApiError extends Error {
|
|
14
|
+
constructor(message, statusCode, details) {
|
|
15
|
+
let enhancedMessage = message;
|
|
16
|
+
if (details?.errors && Array.isArray(details.errors)) {
|
|
17
|
+
const specificErrors = details.errors
|
|
18
|
+
.map((err) => `${err.parameter}: ${err.detail || err.code}`)
|
|
19
|
+
.join(', ');
|
|
20
|
+
enhancedMessage = `${message} (Details: ${specificErrors})`;
|
|
21
|
+
}
|
|
22
|
+
super(enhancedMessage);
|
|
23
|
+
this.name = "QontoApiError";
|
|
24
|
+
this.statusCode = statusCode;
|
|
25
|
+
this.details = details;
|
|
26
|
+
Object.setPrototypeOf(this, new.target.prototype);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
exports.QontoApiError = QontoApiError;
|
|
30
|
+
/**
|
|
31
|
+
* Creates a pre-configured Axios instance for the Qonto Business API.
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* const http = createHttpClient("my-org-login", "my-secret-key");
|
|
35
|
+
* const { data } = await http.get("/v2/transactions");
|
|
36
|
+
*/
|
|
37
|
+
function createHttpClient(login, secretKey, baseURL = "https://thirdparty.qonto.com") {
|
|
38
|
+
const instance = axios_1.default.create({
|
|
39
|
+
baseURL,
|
|
40
|
+
headers: {
|
|
41
|
+
Authorization: `${login}:${secretKey}`,
|
|
42
|
+
"Content-Type": "application/json",
|
|
43
|
+
Accept: "application/json",
|
|
44
|
+
},
|
|
45
|
+
});
|
|
46
|
+
instance.interceptors.response.use((response) => response, (error) => {
|
|
47
|
+
if (error.response) {
|
|
48
|
+
const statusCode = error.response.status;
|
|
49
|
+
const responseData = error.response.data;
|
|
50
|
+
// Qonto renvoie souvent les erreurs dans responseData.errors
|
|
51
|
+
// On essaie de trouver un message global, sinon on met un message générique
|
|
52
|
+
const message = responseData?.message ||
|
|
53
|
+
responseData?.error ||
|
|
54
|
+
(statusCode === 422 ? "Validation Error" : error.message);
|
|
55
|
+
return Promise.reject(new QontoApiError(message, statusCode, responseData ?? null));
|
|
56
|
+
}
|
|
57
|
+
return Promise.reject(new QontoApiError(error.message || "Network error", 0, null));
|
|
58
|
+
});
|
|
59
|
+
return instance;
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":";AAAA,gBAAgB;;;;;;AAkDhB,4CAmCC;AAnFD,kDAAyD;AAiBzD;;GAEG;AACH,MAAa,aAAc,SAAQ,KAAK;IAItC,YAAY,OAAe,EAAE,UAAkB,EAAE,OAAY;QAC3D,IAAI,eAAe,GAAG,OAAO,CAAC;QAC9B,IAAI,OAAO,EAAE,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,EA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rB,YAAY,EAAE,KAAK;gBACnB,CAAC,UAAU,KAAK,GAAG,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;YAE5D,OAAO,OAAO,CAAC,MAAM,CAAC,IAAI,aAAa,CAAC,OAAO,EAAE,UAAU,EAAE,YAAY,IAAI,IAAI,CAAC,CAAC,CAAC;QACtF,CAAC;QACD,OAAO,OAAO,CAAC,MAAM,CAAC,IAAI,aAAa,CAAC,KAAK,CAAC,OAAO,IAAI,eAAe,EAAE,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC;IACtF,CAAC,CACF,CAAC;IAEF,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file src/index.ts
|
|
3
|
+
* Main entry point for the Qonto TypeScript client library.
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* ```ts
|
|
7
|
+
* const client = new QontoClient({ login: 'your-login', secretKey: 'your-secret-key' });
|
|
8
|
+
* const { organization } = await client.organizations.getCurrent();
|
|
9
|
+
* const { transactions } = await client.transactions.list({ bank_account_id: '...' });
|
|
10
|
+
* ```
|
|
11
|
+
*/
|
|
12
|
+
import { QontoClientConfig } from './client';
|
|
13
|
+
import { OrganizationsResource } from './resources/organizations';
|
|
14
|
+
import { MembershipsResource } from './resources/memberships';
|
|
15
|
+
import { TransactionsResource } from './resources/transactions';
|
|
16
|
+
import { AttachmentsResource } from './resources/attachments';
|
|
17
|
+
import { StatementsResource } from './resources/statements';
|
|
18
|
+
import { BankAccountsResource } from './resources/bankAccounts';
|
|
19
|
+
import { CardsResource } from './resources/cards';
|
|
20
|
+
import { SepaTransfersResource } from './resources/sepaTransfers';
|
|
21
|
+
import { BeneficiariesResource } from './resources/beneficiaries';
|
|
22
|
+
import { SepaDirectDebitResource } from './resources/sepaDirectDebit';
|
|
23
|
+
import { InternalTransfersResource } from './resources/internalTransfers';
|
|
24
|
+
import { InternationalTransfersResource } from './resources/internationalTransfers';
|
|
25
|
+
import { PaymentLinksResource } from './resources/paymentLinks';
|
|
26
|
+
import { WebhooksResource } from './resources/webhooks';
|
|
27
|
+
import { ClientsResource } from './resources/clients';
|
|
28
|
+
import { ClientInvoicesResource } from './resources/clientInvoices';
|
|
29
|
+
import { SupplierInvoicesResource } from './resources/supplierInvoices';
|
|
30
|
+
import { CreditNotesResource } from './resources/creditNotes';
|
|
31
|
+
import { QuotesResource } from './resources/quotes';
|
|
32
|
+
import { ProductsResource } from './resources/products';
|
|
33
|
+
import { TeamsResource } from './resources/teams';
|
|
34
|
+
import { LabelsResource } from './resources/labels';
|
|
35
|
+
import { InsuranceContractsResource } from './resources/insuranceContracts';
|
|
36
|
+
import { RequestsResource } from './resources/requests';
|
|
37
|
+
import { OAuthResource } from './resources/oauth';
|
|
38
|
+
export * from './types';
|
|
39
|
+
export * from './client';
|
|
40
|
+
export { OrganizationsResource, MembershipsResource, TransactionsResource, AttachmentsResource, StatementsResource, BankAccountsResource, CardsResource, SepaTransfersResource, BeneficiariesResource, SepaDirectDebitResource, InternalTransfersResource, InternationalTransfersResource, PaymentLinksResource, WebhooksResource, ClientsResource, ClientInvoicesResource, SupplierInvoicesResource, CreditNotesResource, QuotesResource, ProductsResource, TeamsResource, LabelsResource, InsuranceContractsResource, RequestsResource, OAuthResource, };
|
|
41
|
+
/**
|
|
42
|
+
* The main Qonto API client.
|
|
43
|
+
* Instantiate once and reuse across your application.
|
|
44
|
+
*/
|
|
45
|
+
export declare class QontoClient {
|
|
46
|
+
readonly organizations: OrganizationsResource;
|
|
47
|
+
readonly memberships: MembershipsResource;
|
|
48
|
+
readonly transactions: TransactionsResource;
|
|
49
|
+
readonly attachments: AttachmentsResource;
|
|
50
|
+
readonly statements: StatementsResource;
|
|
51
|
+
readonly bankAccounts: BankAccountsResource;
|
|
52
|
+
readonly cards: CardsResource;
|
|
53
|
+
readonly sepaTransfers: SepaTransfersResource;
|
|
54
|
+
readonly beneficiaries: BeneficiariesResource;
|
|
55
|
+
readonly sepaDirectDebit: SepaDirectDebitResource;
|
|
56
|
+
readonly internalTransfers: InternalTransfersResource;
|
|
57
|
+
readonly internationalTransfers: InternationalTransfersResource;
|
|
58
|
+
readonly paymentLinks: PaymentLinksResource;
|
|
59
|
+
readonly webhooks: WebhooksResource;
|
|
60
|
+
readonly clients: ClientsResource;
|
|
61
|
+
readonly clientInvoices: ClientInvoicesResource;
|
|
62
|
+
readonly supplierInvoices: SupplierInvoicesResource;
|
|
63
|
+
readonly creditNotes: CreditNotesResource;
|
|
64
|
+
readonly quotes: QuotesResource;
|
|
65
|
+
readonly products: ProductsResource;
|
|
66
|
+
readonly teams: TeamsResource;
|
|
67
|
+
readonly labels: LabelsResource;
|
|
68
|
+
readonly insuranceContracts: InsuranceContractsResource;
|
|
69
|
+
readonly requests: RequestsResource;
|
|
70
|
+
readonly oauth: OAuthResource;
|
|
71
|
+
constructor(config: QontoClientConfig);
|
|
72
|
+
}
|
|
73
|
+
export default QontoClient;
|
|
74
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAoB,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAE/D,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM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,WAAW,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @file src/index.ts
|
|
4
|
+
* Main entry point for the Qonto TypeScript client library.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```ts
|
|
8
|
+
* const client = new QontoClient({ login: 'your-login', secretKey: 'your-secret-key' });
|
|
9
|
+
* const { organization } = await client.organizations.getCurrent();
|
|
10
|
+
* const { transactions } = await client.transactions.list({ bank_account_id: '...' });
|
|
11
|
+
* ```
|
|
12
|
+
*/
|
|
13
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
16
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
17
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
18
|
+
}
|
|
19
|
+
Object.defineProperty(o, k2, desc);
|
|
20
|
+
}) : (function(o, m, k, k2) {
|
|
21
|
+
if (k2 === undefined) k2 = k;
|
|
22
|
+
o[k2] = m[k];
|
|
23
|
+
}));
|
|
24
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
25
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
26
|
+
};
|
|
27
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
+
exports.QontoClient = exports.OAuthResource = exports.RequestsResource = exports.InsuranceContractsResource = exports.LabelsResource = exports.TeamsResource = exports.ProductsResource = exports.QuotesResource = exports.CreditNotesResource = exports.SupplierInvoicesResource = exports.ClientInvoicesResource = exports.ClientsResource = exports.WebhooksResource = exports.PaymentLinksResource = exports.InternationalTransfersResource = exports.InternalTransfersResource = exports.SepaDirectDebitResource = exports.BeneficiariesResource = exports.SepaTransfersResource = exports.CardsResource = exports.BankAccountsResource = exports.StatementsResource = exports.AttachmentsResource = exports.TransactionsResource = exports.MembershipsResource = exports.OrganizationsResource = void 0;
|
|
29
|
+
const client_1 = require("./client");
|
|
30
|
+
const organizations_1 = require("./resources/organizations");
|
|
31
|
+
Object.defineProperty(exports, "OrganizationsResource", { enumerable: true, get: function () { return organizations_1.OrganizationsResource; } });
|
|
32
|
+
const memberships_1 = require("./resources/memberships");
|
|
33
|
+
Object.defineProperty(exports, "MembershipsResource", { enumerable: true, get: function () { return memberships_1.MembershipsResource; } });
|
|
34
|
+
const transactions_1 = require("./resources/transactions");
|
|
35
|
+
Object.defineProperty(exports, "TransactionsResource", { enumerable: true, get: function () { return transactions_1.TransactionsResource; } });
|
|
36
|
+
const attachments_1 = require("./resources/attachments");
|
|
37
|
+
Object.defineProperty(exports, "AttachmentsResource", { enumerable: true, get: function () { return attachments_1.AttachmentsResource; } });
|
|
38
|
+
const statements_1 = require("./resources/statements");
|
|
39
|
+
Object.defineProperty(exports, "StatementsResource", { enumerable: true, get: function () { return statements_1.StatementsResource; } });
|
|
40
|
+
const bankAccounts_1 = require("./resources/bankAccounts");
|
|
41
|
+
Object.defineProperty(exports, "BankAccountsResource", { enumerable: true, get: function () { return bankAccounts_1.BankAccountsResource; } });
|
|
42
|
+
const cards_1 = require("./resources/cards");
|
|
43
|
+
Object.defineProperty(exports, "CardsResource", { enumerable: true, get: function () { return cards_1.CardsResource; } });
|
|
44
|
+
const sepaTransfers_1 = require("./resources/sepaTransfers");
|
|
45
|
+
Object.defineProperty(exports, "SepaTransfersResource", { enumerable: true, get: function () { return sepaTransfers_1.SepaTransfersResource; } });
|
|
46
|
+
const beneficiaries_1 = require("./resources/beneficiaries");
|
|
47
|
+
Object.defineProperty(exports, "BeneficiariesResource", { enumerable: true, get: function () { return beneficiaries_1.BeneficiariesResource; } });
|
|
48
|
+
const sepaDirectDebit_1 = require("./resources/sepaDirectDebit");
|
|
49
|
+
Object.defineProperty(exports, "SepaDirectDebitResource", { enumerable: true, get: function () { return sepaDirectDebit_1.SepaDirectDebitResource; } });
|
|
50
|
+
const internalTransfers_1 = require("./resources/internalTransfers");
|
|
51
|
+
Object.defineProperty(exports, "InternalTransfersResource", { enumerable: true, get: function () { return internalTransfers_1.InternalTransfersResource; } });
|
|
52
|
+
const internationalTransfers_1 = require("./resources/internationalTransfers");
|
|
53
|
+
Object.defineProperty(exports, "InternationalTransfersResource", { enumerable: true, get: function () { return internationalTransfers_1.InternationalTransfersResource; } });
|
|
54
|
+
const paymentLinks_1 = require("./resources/paymentLinks");
|
|
55
|
+
Object.defineProperty(exports, "PaymentLinksResource", { enumerable: true, get: function () { return paymentLinks_1.PaymentLinksResource; } });
|
|
56
|
+
const webhooks_1 = require("./resources/webhooks");
|
|
57
|
+
Object.defineProperty(exports, "WebhooksResource", { enumerable: true, get: function () { return webhooks_1.WebhooksResource; } });
|
|
58
|
+
const clients_1 = require("./resources/clients");
|
|
59
|
+
Object.defineProperty(exports, "ClientsResource", { enumerable: true, get: function () { return clients_1.ClientsResource; } });
|
|
60
|
+
const clientInvoices_1 = require("./resources/clientInvoices");
|
|
61
|
+
Object.defineProperty(exports, "ClientInvoicesResource", { enumerable: true, get: function () { return clientInvoices_1.ClientInvoicesResource; } });
|
|
62
|
+
const supplierInvoices_1 = require("./resources/supplierInvoices");
|
|
63
|
+
Object.defineProperty(exports, "SupplierInvoicesResource", { enumerable: true, get: function () { return supplierInvoices_1.SupplierInvoicesResource; } });
|
|
64
|
+
const creditNotes_1 = require("./resources/creditNotes");
|
|
65
|
+
Object.defineProperty(exports, "CreditNotesResource", { enumerable: true, get: function () { return creditNotes_1.CreditNotesResource; } });
|
|
66
|
+
const quotes_1 = require("./resources/quotes");
|
|
67
|
+
Object.defineProperty(exports, "QuotesResource", { enumerable: true, get: function () { return quotes_1.QuotesResource; } });
|
|
68
|
+
const products_1 = require("./resources/products");
|
|
69
|
+
Object.defineProperty(exports, "ProductsResource", { enumerable: true, get: function () { return products_1.ProductsResource; } });
|
|
70
|
+
const teams_1 = require("./resources/teams");
|
|
71
|
+
Object.defineProperty(exports, "TeamsResource", { enumerable: true, get: function () { return teams_1.TeamsResource; } });
|
|
72
|
+
const labels_1 = require("./resources/labels");
|
|
73
|
+
Object.defineProperty(exports, "LabelsResource", { enumerable: true, get: function () { return labels_1.LabelsResource; } });
|
|
74
|
+
const insuranceContracts_1 = require("./resources/insuranceContracts");
|
|
75
|
+
Object.defineProperty(exports, "InsuranceContractsResource", { enumerable: true, get: function () { return insuranceContracts_1.InsuranceContractsResource; } });
|
|
76
|
+
const requests_1 = require("./resources/requests");
|
|
77
|
+
Object.defineProperty(exports, "RequestsResource", { enumerable: true, get: function () { return requests_1.RequestsResource; } });
|
|
78
|
+
const oauth_1 = require("./resources/oauth");
|
|
79
|
+
Object.defineProperty(exports, "OAuthResource", { enumerable: true, get: function () { return oauth_1.OAuthResource; } });
|
|
80
|
+
// Re-export all types and utilities for single-import convenience
|
|
81
|
+
__exportStar(require("./types"), exports);
|
|
82
|
+
__exportStar(require("./client"), exports);
|
|
83
|
+
/**
|
|
84
|
+
* The main Qonto API client.
|
|
85
|
+
* Instantiate once and reuse across your application.
|
|
86
|
+
*/
|
|
87
|
+
class QontoClient {
|
|
88
|
+
constructor(config) {
|
|
89
|
+
const http = (0, client_1.createHttpClient)(config.login, config.secretKey, config.baseURL);
|
|
90
|
+
this.organizations = new organizations_1.OrganizationsResource(http);
|
|
91
|
+
this.memberships = new memberships_1.MembershipsResource(http);
|
|
92
|
+
this.transactions = new transactions_1.TransactionsResource(http);
|
|
93
|
+
this.attachments = new attachments_1.AttachmentsResource(http);
|
|
94
|
+
this.statements = new statements_1.StatementsResource(http);
|
|
95
|
+
this.bankAccounts = new bankAccounts_1.BankAccountsResource(http);
|
|
96
|
+
this.cards = new cards_1.CardsResource(http);
|
|
97
|
+
this.sepaTransfers = new sepaTransfers_1.SepaTransfersResource(http);
|
|
98
|
+
this.beneficiaries = new beneficiaries_1.BeneficiariesResource(http);
|
|
99
|
+
this.sepaDirectDebit = new sepaDirectDebit_1.SepaDirectDebitResource(http);
|
|
100
|
+
this.internalTransfers = new internalTransfers_1.InternalTransfersResource(http);
|
|
101
|
+
this.internationalTransfers = new internationalTransfers_1.InternationalTransfersResource(http);
|
|
102
|
+
this.paymentLinks = new paymentLinks_1.PaymentLinksResource(http);
|
|
103
|
+
this.webhooks = new webhooks_1.WebhooksResource(http);
|
|
104
|
+
this.clients = new clients_1.ClientsResource(http);
|
|
105
|
+
this.clientInvoices = new clientInvoices_1.ClientInvoicesResource(http);
|
|
106
|
+
this.supplierInvoices = new supplierInvoices_1.SupplierInvoicesResource(http);
|
|
107
|
+
this.creditNotes = new creditNotes_1.CreditNotesResource(http);
|
|
108
|
+
this.quotes = new quotes_1.QuotesResource(http);
|
|
109
|
+
this.products = new products_1.ProductsResource(http);
|
|
110
|
+
this.teams = new teams_1.TeamsResource(http);
|
|
111
|
+
this.labels = new labels_1.LabelsResource(http);
|
|
112
|
+
this.insuranceContracts = new insuranceContracts_1.InsuranceContractsResource(http);
|
|
113
|
+
this.requests = new requests_1.RequestsResource(http);
|
|
114
|
+
this.oauth = new oauth_1.OAuthResource(http);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
exports.QontoClient = QontoClient;
|
|
118
|
+
exports.default = QontoClient;
|
|
119
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;;;;;;;;;;;;;;;AAEH,qCAA+D;AAE/D,6DAAkE;AAgChE,sGAhCO,qCAAqB,OAgCP;AA/BvB,yDAA8D;AA+BrC,oGA/BhB,iCAAmB,OA+BgB;AA9B5C,2DAAgE;AA8BlB,qGA9BrC,mCAAoB,OA8BqC;AA7BlE,yDAA8D;AA8B5D,oGA9BO,iCAAmB,OA8BP;AA7BrB,uDAA4D;AA6BrC,mG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AmB,CAAC,IAAI,CAAC,CAAC;QAC1D,IAAI,CAAC,MAAM,GAAiB,IAAI,uBAAc,CAAC,IAAI,CAAC,CAAC;QACrD,IAAI,CAAC,QAAQ,GAAe,IAAI,2BAAgB,CAAC,IAAI,CAAC,CAAC;QACvD,IAAI,CAAC,KAAK,GAAkB,IAAI,qBAAa,CAAC,IAAI,CAAC,CAAC;QACpD,IAAI,CAAC,MAAM,GAAiB,IAAI,uBAAc,CAAC,IAAI,CAAC,CAAC;QACrD,IAAI,CAAC,kBAAkB,GAAK,IAAI,+CAA0B,CAAC,IAAI,CAAC,CAAC;QACjE,IAAI,CAAC,QAAQ,GAAe,IAAI,2BAAgB,CAAC,IAAI,CAAC,CAAC;QACvD,IAAI,CAAC,KAAK,GAAkB,IAAI,qBAAa,CAAC,IAAI,CAAC,CAAC;IACtD,CAAC;CACF;AAvDD,kCAuDC;AAED,kBAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { AxiosInstance } from 'axios';
|
|
2
|
+
import { Attachment, UUID, PaginationMeta, ListAttachmentsParams } from '../types';
|
|
3
|
+
export declare class AttachmentsResource {
|
|
4
|
+
private readonly http;
|
|
5
|
+
constructor(http: AxiosInstance);
|
|
6
|
+
/** GET /v2/transactions/:transactionId/attachments */
|
|
7
|
+
listForTransaction(transactionId: UUID, params?: ListAttachmentsParams): Promise<{
|
|
8
|
+
attachments: Attachment[];
|
|
9
|
+
meta: PaginationMeta;
|
|
10
|
+
}>;
|
|
11
|
+
/** DELETE /v2/transactions/:transactionId/attachments */
|
|
12
|
+
removeAllFromTransaction(transactionId: UUID): Promise<void>;
|
|
13
|
+
/** GET /v2/attachments */
|
|
14
|
+
list(params?: ListAttachmentsParams): Promise<{
|
|
15
|
+
attachments: Attachment[];
|
|
16
|
+
meta: PaginationMeta;
|
|
17
|
+
}>;
|
|
18
|
+
/** GET /v2/attachments/:id */
|
|
19
|
+
retrieve(id: UUID): Promise<{
|
|
20
|
+
attachment: Attachment;
|
|
21
|
+
}>;
|
|
22
|
+
/** POST /v2/attachments (multipart) */
|
|
23
|
+
create(body: FormData): Promise<{
|
|
24
|
+
attachment: Attachment;
|
|
25
|
+
}>;
|
|
26
|
+
/** DELETE /v2/attachments/:id */
|
|
27
|
+
remove(id: UUID): Promise<void>;
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=attachments.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attachments.d.ts","sourceRoot":"","sources":["../../src/resources/attachments.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAEnF,qBAAa,mBAAmB;IAClB,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAAJ,IAAI,EAAE,aAAa;IAEhD,sDAAsD;IAChD,kBAAkB,CAAC,aAAa,EAAE,IAAI,EAAE,MAAM,CAAC,EAAE,qBAAqB,GAAG,OAAO,CAAC;QAAE,WAAW,EAAE,UAAU,EAAE,CAAC;QAAC,IAAI,EAAE,cAAc,CAAA;KAAE,CAAC;IAK3I,yDAAyD;IACnD,wBAAwB,CAAC,aAAa,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;IAIlE,0BAA0B;IACpB,IAAI,CAAC,MAAM,CAAC,EAAE,qBAAqB,GAAG,OAAO,CAAC;QAAE,WAAW,EAAE,UAAU,EAAE,CAAC;QAAC,IAAI,EAAE,cAAc,CAAA;KAAE,CAAC;IAKxG,8BAA8B;IACxB,QAAQ,CAAC,EAAE,EAAE,IAAI,GAAG,OAAO,CAAC;QAAE,UAAU,EAAE,UAAU,CAAA;KAAE,CAAC;IAK7D,uCAAuC;IACjC,MAAM,CAAC,IAAI,EAAE,QAAQ,GAAG,OAAO,CAAC;QAAE,UAAU,EAAE,UAAU,CAAA;KAAE,CAAC;IAOjE,iCAAiC;IAC3B,MAAM,CAAC,EAAE,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;CAGtC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AttachmentsResource = void 0;
|
|
4
|
+
class AttachmentsResource {
|
|
5
|
+
constructor(http) {
|
|
6
|
+
this.http = http;
|
|
7
|
+
}
|
|
8
|
+
/** GET /v2/transactions/:transactionId/attachments */
|
|
9
|
+
async listForTransaction(transactionId, params) {
|
|
10
|
+
const response = await this.http.get(`/v2/transactions/${transactionId}/attachments`, { params });
|
|
11
|
+
return response.data;
|
|
12
|
+
}
|
|
13
|
+
/** DELETE /v2/transactions/:transactionId/attachments */
|
|
14
|
+
async removeAllFromTransaction(transactionId) {
|
|
15
|
+
await this.http.delete(`/v2/transactions/${transactionId}/attachments`);
|
|
16
|
+
}
|
|
17
|
+
/** GET /v2/attachments */
|
|
18
|
+
async list(params) {
|
|
19
|
+
const response = await this.http.get('/v2/attachments', { params });
|
|
20
|
+
return response.data;
|
|
21
|
+
}
|
|
22
|
+
/** GET /v2/attachments/:id */
|
|
23
|
+
async retrieve(id) {
|
|
24
|
+
const response = await this.http.get(`/v2/attachments/${id}`);
|
|
25
|
+
return response.data;
|
|
26
|
+
}
|
|
27
|
+
/** POST /v2/attachments (multipart) */
|
|
28
|
+
async create(body) {
|
|
29
|
+
const response = await this.http.post('/v2/attachments', body, {
|
|
30
|
+
headers: { 'Content-Type': 'multipart/form-data' },
|
|
31
|
+
});
|
|
32
|
+
return response.data;
|
|
33
|
+
}
|
|
34
|
+
/** DELETE /v2/attachments/:id */
|
|
35
|
+
async remove(id) {
|
|
36
|
+
await this.http.delete(`/v2/attachments/${id}`);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
exports.AttachmentsResource = AttachmentsResource;
|
|
40
|
+
//# sourceMappingURL=attachments.js.map
|
|
@@ -0,0 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IACvB,CAAC;IAED,iCAAiC;IACjC,KAAK,CAAC,MAAM,CAAC,EAAQ;QACnB,MAAM,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,mBAAmB,EAAE,EAAE,CAAC,CAAC;IAClD,CAAC;CACF;AAtCD,kDAsCC"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { AxiosInstance } from 'axios';
|
|
2
|
+
import { UUID, PaginationMeta, ISODateTime } from '../types';
|
|
3
|
+
export interface BankAccount {
|
|
4
|
+
id: UUID;
|
|
5
|
+
name: string;
|
|
6
|
+
organization_id: UUID;
|
|
7
|
+
status: 'active' | 'closed' | string;
|
|
8
|
+
main: boolean;
|
|
9
|
+
iban?: string;
|
|
10
|
+
bic?: string;
|
|
11
|
+
currency: string;
|
|
12
|
+
balance?: string;
|
|
13
|
+
balance_cents?: number;
|
|
14
|
+
authorized_balance?: string;
|
|
15
|
+
authorized_balance_cents?: number;
|
|
16
|
+
updated_at: ISODateTime;
|
|
17
|
+
is_external_account: boolean;
|
|
18
|
+
account_number?: string;
|
|
19
|
+
}
|
|
20
|
+
export interface ListBankAccountsParams {
|
|
21
|
+
/** Page number to fetch (starts at 1) */
|
|
22
|
+
page?: number;
|
|
23
|
+
/** Number of items per page (default 10) */
|
|
24
|
+
per_page?: number;
|
|
25
|
+
}
|
|
26
|
+
export interface BankAccountResponse {
|
|
27
|
+
bank_account: BankAccount;
|
|
28
|
+
}
|
|
29
|
+
export interface ListBankAccountsResponse {
|
|
30
|
+
bank_accounts: BankAccount[];
|
|
31
|
+
meta: PaginationMeta;
|
|
32
|
+
}
|
|
33
|
+
export interface CreateBankAccountParams {
|
|
34
|
+
bank_account: {
|
|
35
|
+
name: string;
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
export interface UpdateBankAccountParams {
|
|
39
|
+
bank_account: {
|
|
40
|
+
name: string;
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
export declare class BankAccountsResource {
|
|
44
|
+
private readonly http;
|
|
45
|
+
constructor(http: AxiosInstance);
|
|
46
|
+
/**
|
|
47
|
+
* Retrieves a list of all business accounts.
|
|
48
|
+
*/
|
|
49
|
+
list(params?: ListBankAccountsParams): Promise<ListBankAccountsResponse>;
|
|
50
|
+
/**
|
|
51
|
+
* Retrieves detailed information about a specific business account identified by its ID.
|
|
52
|
+
*/
|
|
53
|
+
retrieve(id: string): Promise<BankAccountResponse>;
|
|
54
|
+
/**
|
|
55
|
+
* Creates a new business account.
|
|
56
|
+
*/
|
|
57
|
+
create(data: CreateBankAccountParams): Promise<BankAccountResponse>;
|
|
58
|
+
/**
|
|
59
|
+
* Updates the details of a specific business account identified by its ID. Currently, it supports only updating the account name.
|
|
60
|
+
*/
|
|
61
|
+
update(id: string, data: UpdateBankAccountParams): Promise<BankAccountResponse>;
|
|
62
|
+
/**
|
|
63
|
+
* Closes a specific business account identified by its ID.
|
|
64
|
+
*/
|
|
65
|
+
close(id: string): Promise<void>;
|
|
66
|
+
/**
|
|
67
|
+
* Downloads the IBAN certificate for a specific business account identified by its ID.
|
|
68
|
+
*/
|
|
69
|
+
downloadIbanCertificate(id: string, locale?: string): Promise<any>;
|
|
70
|
+
}
|
|
71
|
+
//# sourceMappingURL=bankAccounts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bankAccounts.d.ts","sourceRoot":"","sources":["../../src/resources/bankAccounts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAE7D,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,IAAI,CAAC;IACT,IAAI,EAAE,MAAM,CAAC;IACb,eAAe,EAAE,IAAI,CAAC;IACtB,MAAM,EAAE,QAAQ,GAAG,QAAQ,GAAG,MAAM,CAAC;IACrC,IAAI,EAAE,OAAO,CAAC;IACd,IAAI,CAAC,EAAE,M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