n8n-nodes-qonto-api 1.0.7 → 1.0.8
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/dist/credentials/QontoApi.credentials.js +1 -1
- package/dist/credentials/QontoApi.credentials.js.map +1 -1
- package/dist/credentials/QontoOAuth2Api.credentials.js +1 -1
- package/dist/credentials/QontoOAuth2Api.credentials.js.map +1 -1
- package/dist/nodes/Qonto/Qonto.node.js +486 -27
- package/dist/nodes/Qonto/Qonto.node.js.map +1 -1
- package/dist/nodes/Qonto/descriptions/AttachmentDescriptions.js +5 -15
- package/dist/nodes/Qonto/descriptions/AttachmentDescriptions.js.map +1 -1
- package/dist/nodes/Qonto/descriptions/AttachmentsInATransactionDescriptions.js +11 -33
- package/dist/nodes/Qonto/descriptions/AttachmentsInATransactionDescriptions.js.map +1 -1
- package/dist/nodes/Qonto/descriptions/BankAccountsDescriptions.d.ts +2 -0
- package/dist/nodes/Qonto/descriptions/BankAccountsDescriptions.js +88 -0
- package/dist/nodes/Qonto/descriptions/BankAccountsDescriptions.js.map +1 -0
- package/dist/nodes/Qonto/descriptions/BeneficiariesDescriptions.js +24 -72
- package/dist/nodes/Qonto/descriptions/BeneficiariesDescriptions.js.map +1 -1
- package/dist/nodes/Qonto/descriptions/CardsDescriptions.js +114 -110
- package/dist/nodes/Qonto/descriptions/CardsDescriptions.js.map +1 -1
- package/dist/nodes/Qonto/descriptions/ClientsDescriptions.js +30 -93
- package/dist/nodes/Qonto/descriptions/ClientsDescriptions.js.map +1 -1
- package/dist/nodes/Qonto/descriptions/ClientsInvoicesDescriptions.js +509 -94
- package/dist/nodes/Qonto/descriptions/ClientsInvoicesDescriptions.js.map +1 -1
- package/dist/nodes/Qonto/descriptions/CreditNotesDescriptions.js +10 -30
- package/dist/nodes/Qonto/descriptions/CreditNotesDescriptions.js.map +1 -1
- package/dist/nodes/Qonto/descriptions/EinvoicingDescriptions.d.ts +2 -0
- package/dist/nodes/Qonto/descriptions/EinvoicingDescriptions.js +25 -0
- package/dist/nodes/Qonto/descriptions/EinvoicingDescriptions.js.map +1 -0
- package/dist/nodes/Qonto/descriptions/ExternalTransfersDescriptions.js +50 -150
- package/dist/nodes/Qonto/descriptions/ExternalTransfersDescriptions.js.map +1 -1
- package/dist/nodes/Qonto/descriptions/InsuranceContractsDescriptions.js +29 -87
- package/dist/nodes/Qonto/descriptions/InsuranceContractsDescriptions.js.map +1 -1
- package/dist/nodes/Qonto/descriptions/InternalTransactionsDescriptions.js +13 -39
- package/dist/nodes/Qonto/descriptions/InternalTransactionsDescriptions.js.map +1 -1
- package/dist/nodes/Qonto/descriptions/InternationalTransfersDescriptions.d.ts +2 -0
- package/dist/nodes/Qonto/descriptions/InternationalTransfersDescriptions.js +154 -0
- package/dist/nodes/Qonto/descriptions/InternationalTransfersDescriptions.js.map +1 -0
- package/dist/nodes/Qonto/descriptions/LabelsDescriptions.js +8 -24
- package/dist/nodes/Qonto/descriptions/LabelsDescriptions.js.map +1 -1
- package/dist/nodes/Qonto/descriptions/MembershipsDescriptions.js +17 -67
- package/dist/nodes/Qonto/descriptions/MembershipsDescriptions.js.map +1 -1
- package/dist/nodes/Qonto/descriptions/OrganizationsDescriptions.js +3 -9
- package/dist/nodes/Qonto/descriptions/OrganizationsDescriptions.js.map +1 -1
- package/dist/nodes/Qonto/descriptions/PaymentLinksDescriptions.d.ts +2 -0
- package/dist/nodes/Qonto/descriptions/PaymentLinksDescriptions.js +112 -0
- package/dist/nodes/Qonto/descriptions/PaymentLinksDescriptions.js.map +1 -0
- package/dist/nodes/Qonto/descriptions/QuotesDescriptions.d.ts +2 -0
- package/dist/nodes/Qonto/descriptions/QuotesDescriptions.js +94 -0
- package/dist/nodes/Qonto/descriptions/QuotesDescriptions.js.map +1 -0
- package/dist/nodes/Qonto/descriptions/RequestsDescriptions.js +160 -56
- package/dist/nodes/Qonto/descriptions/RequestsDescriptions.js.map +1 -1
- package/dist/nodes/Qonto/descriptions/SepaTransfersDescriptions.d.ts +2 -0
- package/dist/nodes/Qonto/descriptions/SepaTransfersDescriptions.js +233 -0
- package/dist/nodes/Qonto/descriptions/SepaTransfersDescriptions.js.map +1 -0
- package/dist/nodes/Qonto/descriptions/StatementsDescriptions.js +10 -30
- package/dist/nodes/Qonto/descriptions/StatementsDescriptions.js.map +1 -1
- package/dist/nodes/Qonto/descriptions/SupplierInvoicesDescriptions.js +31 -36
- package/dist/nodes/Qonto/descriptions/SupplierInvoicesDescriptions.js.map +1 -1
- package/dist/nodes/Qonto/descriptions/TeamsDescriptions.js +8 -24
- package/dist/nodes/Qonto/descriptions/TeamsDescriptions.js.map +1 -1
- package/dist/nodes/Qonto/descriptions/TransactionsDescriptions.js +12 -36
- package/dist/nodes/Qonto/descriptions/TransactionsDescriptions.js.map +1 -1
- package/dist/nodes/Qonto/descriptions/WebhookSubscriptionsDescriptions.d.ts +2 -0
- package/dist/nodes/Qonto/descriptions/WebhookSubscriptionsDescriptions.js +100 -0
- package/dist/nodes/Qonto/descriptions/WebhookSubscriptionsDescriptions.js.map +1 -0
- package/dist/nodes/Qonto/descriptions/index.d.ts +7 -0
- package/dist/nodes/Qonto/descriptions/index.js +7 -0
- package/dist/nodes/Qonto/descriptions/index.js.map +1 -1
- package/dist/nodes/Qonto/helpers.js.map +1 -1
- package/dist/package.json +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -4,16 +4,32 @@ exports.Qonto = void 0;
|
|
|
4
4
|
const helpers_1 = require("./helpers");
|
|
5
5
|
const descriptions_1 = require("./descriptions");
|
|
6
6
|
function isEmpty(value) {
|
|
7
|
-
return value === null ||
|
|
8
|
-
|
|
7
|
+
return (value === null ||
|
|
8
|
+
value === undefined ||
|
|
9
|
+
(typeof value === 'object' && Object.keys(value).length === 0));
|
|
9
10
|
}
|
|
10
11
|
function uuid() {
|
|
11
12
|
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) => {
|
|
12
|
-
const r = Math.random() * 16 | 0;
|
|
13
|
-
const v = c === 'x' ? r : (r & 0x3 | 0x8
|
|
13
|
+
const r = (Math.random() * 16) | 0;
|
|
14
|
+
const v = c === 'x' ? r : (r & 0x3) | 0x8;
|
|
14
15
|
return v.toString(16);
|
|
15
16
|
});
|
|
16
17
|
}
|
|
18
|
+
function parseJsonParameter(value) {
|
|
19
|
+
if (typeof value === 'string') {
|
|
20
|
+
try {
|
|
21
|
+
const parsed = JSON.parse(value);
|
|
22
|
+
return parsed && typeof parsed === 'object' ? parsed : {};
|
|
23
|
+
}
|
|
24
|
+
catch {
|
|
25
|
+
return {};
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
if (value && typeof value === 'object') {
|
|
29
|
+
return value;
|
|
30
|
+
}
|
|
31
|
+
return {};
|
|
32
|
+
}
|
|
17
33
|
class Qonto {
|
|
18
34
|
constructor() {
|
|
19
35
|
this.description = {
|
|
@@ -76,21 +92,28 @@ class Qonto {
|
|
|
76
92
|
{ name: 'Attachment', value: 'attachment' },
|
|
77
93
|
{ name: 'Attachments in a Transaction', value: 'attachmentsInATransaction' },
|
|
78
94
|
{ name: 'Beneficiary', value: 'beneficiaries' },
|
|
95
|
+
{ name: 'Business Account', value: 'bankAccounts' },
|
|
79
96
|
{ name: 'Card', value: 'cards' },
|
|
80
97
|
{ name: 'Client', value: 'clients' },
|
|
81
98
|
{ name: 'Client Invoice', value: 'clientsInvoices' },
|
|
82
99
|
{ name: 'Credit Note', value: 'creditNotes' },
|
|
100
|
+
{ name: 'E-Invoicing', value: 'einvoicing' },
|
|
83
101
|
{ name: 'External Transfer', value: 'externalTransfers' },
|
|
84
102
|
{ name: 'Insurance Contract', value: 'insuranceContracts' },
|
|
85
103
|
{ name: 'Internal Transaction', value: 'internalTransactions' },
|
|
104
|
+
{ name: 'International Transfer', value: 'internationalTransfers' },
|
|
86
105
|
{ name: 'Label', value: 'labels' },
|
|
87
106
|
{ name: 'Membership', value: 'memberships' },
|
|
88
107
|
{ name: 'Organization', value: 'organizations' },
|
|
108
|
+
{ name: 'Payment Link', value: 'paymentLinks' },
|
|
109
|
+
{ name: 'Quote', value: 'quotes' },
|
|
89
110
|
{ name: 'Request', value: 'requests' },
|
|
111
|
+
{ name: 'SEPA Transfer', value: 'sepaTransfers' },
|
|
90
112
|
{ name: 'Statement', value: 'statements' },
|
|
91
113
|
{ name: 'Supplier Invoice', value: 'supplierInvoices' },
|
|
92
114
|
{ name: 'Team', value: 'teams' },
|
|
93
115
|
{ name: 'Transaction', value: 'transactions' },
|
|
116
|
+
{ name: 'Webhook Subscription', value: 'webhookSubscriptions' },
|
|
94
117
|
],
|
|
95
118
|
default: 'organizations',
|
|
96
119
|
required: true,
|
|
@@ -102,16 +125,23 @@ class Qonto {
|
|
|
102
125
|
...descriptions_1.membershipsOperations,
|
|
103
126
|
...descriptions_1.organizationsOperations,
|
|
104
127
|
...descriptions_1.attachmentsInATransactionOperations,
|
|
128
|
+
...descriptions_1.bankAccountsOperations,
|
|
105
129
|
...descriptions_1.transactionsOperations,
|
|
106
130
|
...descriptions_1.internalTransactionsOperations,
|
|
107
131
|
...descriptions_1.requestsOperations,
|
|
132
|
+
...descriptions_1.sepaTransfersOperations,
|
|
108
133
|
...descriptions_1.supplierInvoicesOperations,
|
|
109
134
|
...descriptions_1.clientsInvoicesOperations,
|
|
110
135
|
...descriptions_1.creditNotesOperations,
|
|
136
|
+
...descriptions_1.einvoicingOperations,
|
|
111
137
|
...descriptions_1.clientsOperations,
|
|
112
138
|
...descriptions_1.teamsOperations,
|
|
113
139
|
...descriptions_1.statementsOperations,
|
|
114
140
|
...descriptions_1.insuranceContractsOperations,
|
|
141
|
+
...descriptions_1.internationalTransfersOperations,
|
|
142
|
+
...descriptions_1.webhookSubscriptionsOperations,
|
|
143
|
+
...descriptions_1.paymentLinksOperations,
|
|
144
|
+
...descriptions_1.quotesOperations,
|
|
115
145
|
...descriptions_1.cardsOperations,
|
|
116
146
|
],
|
|
117
147
|
};
|
|
@@ -202,11 +232,13 @@ class Qonto {
|
|
|
202
232
|
query['beneficiary_ids[]'] = filters.beneficiary_ids;
|
|
203
233
|
}
|
|
204
234
|
if (filters.ids) {
|
|
205
|
-
const ids = filters.ids.split(',').map(id => id.trim());
|
|
235
|
+
const ids = filters.ids.split(',').map((id) => id.trim());
|
|
206
236
|
query['ids[]'] = ids;
|
|
207
237
|
}
|
|
208
238
|
if (filters.recurring_transfer_ids) {
|
|
209
|
-
const rIds = filters.recurring_transfer_ids
|
|
239
|
+
const rIds = filters.recurring_transfer_ids
|
|
240
|
+
.split(',')
|
|
241
|
+
.map((id) => id.trim());
|
|
210
242
|
query['recurring_transfer_ids[]'] = rIds;
|
|
211
243
|
}
|
|
212
244
|
if (filters.sort_by) {
|
|
@@ -216,9 +248,148 @@ class Qonto {
|
|
|
216
248
|
responseData = await helpers_1.handleListing.call(this, headers, 'GET', endpoint, {}, query, i);
|
|
217
249
|
}
|
|
218
250
|
}
|
|
251
|
+
if (resource === 'sepaTransfers') {
|
|
252
|
+
if (operation === 'listSepaTransfers') {
|
|
253
|
+
const endpoint = 'sepa/transfers';
|
|
254
|
+
const queryParams = parseJsonParameter(this.getNodeParameter('query', i, {}));
|
|
255
|
+
responseData = await helpers_1.handleListing.call(this, headers, 'GET', endpoint, {}, queryParams, i);
|
|
256
|
+
}
|
|
257
|
+
if (operation === 'showSepaTransfer') {
|
|
258
|
+
const transferId = this.getNodeParameter('transferId', i);
|
|
259
|
+
const endpoint = `sepa/transfers/${transferId}`;
|
|
260
|
+
responseData = await helpers_1.qontoApiRequest.call(this, headers, 'GET', endpoint, {}, {});
|
|
261
|
+
}
|
|
262
|
+
if (operation === 'createSepaTransfer') {
|
|
263
|
+
const endpoint = 'sepa/transfers';
|
|
264
|
+
const body = parseJsonParameter(this.getNodeParameter('transferPayload', i));
|
|
265
|
+
responseData = await helpers_1.qontoApiRequest.call(this, headers, 'POST', endpoint, body, {});
|
|
266
|
+
}
|
|
267
|
+
if (operation === 'cancelSepaTransfer') {
|
|
268
|
+
const transferId = this.getNodeParameter('transferId', i);
|
|
269
|
+
const endpoint = `sepa/transfers/${transferId}/cancel`;
|
|
270
|
+
responseData = await helpers_1.qontoApiRequest.call(this, headers, 'POST', endpoint, {}, {});
|
|
271
|
+
}
|
|
272
|
+
if (operation === 'downloadSepaTransferProof') {
|
|
273
|
+
const transferId = this.getNodeParameter('transferId', i);
|
|
274
|
+
const endpoint = `sepa/transfers/${transferId}/download_proof`;
|
|
275
|
+
responseData = await helpers_1.qontoApiRequest.call(this, headers, 'POST', endpoint, {}, {});
|
|
276
|
+
}
|
|
277
|
+
if (operation === 'listSepaBulkTransfers') {
|
|
278
|
+
const endpoint = 'sepa/bulk_transfers';
|
|
279
|
+
const queryParams = parseJsonParameter(this.getNodeParameter('query', i, {}));
|
|
280
|
+
responseData = await helpers_1.handleListing.call(this, headers, 'GET', endpoint, {}, queryParams, i);
|
|
281
|
+
}
|
|
282
|
+
if (operation === 'showSepaBulkTransfer') {
|
|
283
|
+
const bulkTransferId = this.getNodeParameter('bulkTransferId', i);
|
|
284
|
+
const endpoint = `sepa/bulk_transfers/${bulkTransferId}`;
|
|
285
|
+
responseData = await helpers_1.qontoApiRequest.call(this, headers, 'GET', endpoint, {}, {});
|
|
286
|
+
}
|
|
287
|
+
if (operation === 'createSepaBulkTransfer') {
|
|
288
|
+
const endpoint = 'sepa/bulk_transfers';
|
|
289
|
+
const body = parseJsonParameter(this.getNodeParameter('bulkTransferPayload', i));
|
|
290
|
+
responseData = await helpers_1.qontoApiRequest.call(this, headers, 'POST', endpoint, body, {});
|
|
291
|
+
}
|
|
292
|
+
if (operation === 'listSepaRecurringTransfers') {
|
|
293
|
+
const endpoint = 'sepa/recurring_transfers';
|
|
294
|
+
const queryParams = parseJsonParameter(this.getNodeParameter('query', i, {}));
|
|
295
|
+
responseData = await helpers_1.handleListing.call(this, headers, 'GET', endpoint, {}, queryParams, i);
|
|
296
|
+
}
|
|
297
|
+
if (operation === 'showSepaRecurringTransfer') {
|
|
298
|
+
const recurringTransferId = this.getNodeParameter('recurringTransferId', i);
|
|
299
|
+
const endpoint = `sepa/recurring_transfers/${recurringTransferId}`;
|
|
300
|
+
responseData = await helpers_1.qontoApiRequest.call(this, headers, 'GET', endpoint, {}, {});
|
|
301
|
+
}
|
|
302
|
+
if (operation === 'createSepaRecurringTransfer') {
|
|
303
|
+
const endpoint = 'sepa/recurring_transfers';
|
|
304
|
+
const body = parseJsonParameter(this.getNodeParameter('recurringTransferPayload', i));
|
|
305
|
+
responseData = await helpers_1.qontoApiRequest.call(this, headers, 'POST', endpoint, body, {});
|
|
306
|
+
}
|
|
307
|
+
if (operation === 'cancelSepaRecurringTransfer') {
|
|
308
|
+
const recurringTransferId = this.getNodeParameter('recurringTransferId', i);
|
|
309
|
+
const endpoint = `sepa/recurring_transfers/${recurringTransferId}/cancel`;
|
|
310
|
+
responseData = await helpers_1.qontoApiRequest.call(this, headers, 'POST', endpoint, {}, {});
|
|
311
|
+
}
|
|
312
|
+
if (operation === 'verifySepaPayee') {
|
|
313
|
+
const endpoint = 'sepa/verify_payee';
|
|
314
|
+
const body = parseJsonParameter(this.getNodeParameter('verifyPayeePayload', i));
|
|
315
|
+
responseData = await helpers_1.qontoApiRequest.call(this, headers, 'POST', endpoint, body, {});
|
|
316
|
+
}
|
|
317
|
+
if (operation === 'bulkVerifySepaPayee') {
|
|
318
|
+
const endpoint = 'sepa/bulk_verify_payee';
|
|
319
|
+
const body = parseJsonParameter(this.getNodeParameter('bulkVerifyPayeePayload', i));
|
|
320
|
+
responseData = await helpers_1.qontoApiRequest.call(this, headers, 'POST', endpoint, body, {});
|
|
321
|
+
}
|
|
322
|
+
if (operation === 'skipVerifySepaPayee') {
|
|
323
|
+
const endpoint = 'sepa/skip_verify_payee';
|
|
324
|
+
const body = parseJsonParameter(this.getNodeParameter('skipVerifyPayeePayload', i));
|
|
325
|
+
responseData = await helpers_1.qontoApiRequest.call(this, headers, 'POST', endpoint, body, {});
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
if (resource === 'internationalTransfers') {
|
|
329
|
+
if (operation === 'checkInternationalEligibility') {
|
|
330
|
+
const endpoint = 'international/eligibility';
|
|
331
|
+
responseData = await helpers_1.qontoApiRequest.call(this, headers, 'GET', endpoint, {}, {});
|
|
332
|
+
}
|
|
333
|
+
if (operation === 'getInternationalCurrencies') {
|
|
334
|
+
const source = this.getNodeParameter('source', i, '');
|
|
335
|
+
const q = {};
|
|
336
|
+
if (source) {
|
|
337
|
+
q.source = source;
|
|
338
|
+
}
|
|
339
|
+
const endpoint = 'international/currencies';
|
|
340
|
+
responseData = await helpers_1.qontoApiRequest.call(this, headers, 'GET', endpoint, {}, q);
|
|
341
|
+
}
|
|
342
|
+
if (operation === 'createInternationalQuote') {
|
|
343
|
+
const endpoint = 'international/quotes';
|
|
344
|
+
const body = parseJsonParameter(this.getNodeParameter('payload', i));
|
|
345
|
+
responseData = await helpers_1.qontoApiRequest.call(this, headers, 'POST', endpoint, body, {});
|
|
346
|
+
}
|
|
347
|
+
if (operation === 'listInternationalBeneficiaryRequirements') {
|
|
348
|
+
const endpoint = 'international/beneficiaries/requirements';
|
|
349
|
+
const body = parseJsonParameter(this.getNodeParameter('payload', i));
|
|
350
|
+
responseData = await helpers_1.qontoApiRequest.call(this, headers, 'POST', endpoint, body, {});
|
|
351
|
+
}
|
|
352
|
+
if (operation === 'listInternationalBeneficiaries') {
|
|
353
|
+
const endpoint = 'international/beneficiaries';
|
|
354
|
+
const q = parseJsonParameter(this.getNodeParameter('query', i, {}));
|
|
355
|
+
responseData = await helpers_1.handleListing.call(this, headers, 'GET', endpoint, {}, q, i);
|
|
356
|
+
}
|
|
357
|
+
if (operation === 'createInternationalBeneficiary') {
|
|
358
|
+
const endpoint = 'international/beneficiaries';
|
|
359
|
+
const body = parseJsonParameter(this.getNodeParameter('payload', i));
|
|
360
|
+
responseData = await helpers_1.qontoApiRequest.call(this, headers, 'POST', endpoint, body, {});
|
|
361
|
+
}
|
|
362
|
+
if (operation === 'updateInternationalBeneficiary') {
|
|
363
|
+
const beneficiaryId = this.getNodeParameter('beneficiaryId', i);
|
|
364
|
+
const endpoint = `international/beneficiaries/${beneficiaryId}`;
|
|
365
|
+
const body = parseJsonParameter(this.getNodeParameter('payload', i));
|
|
366
|
+
responseData = await helpers_1.qontoApiRequest.call(this, headers, 'PUT', endpoint, body, {});
|
|
367
|
+
}
|
|
368
|
+
if (operation === 'deleteInternationalBeneficiary') {
|
|
369
|
+
const beneficiaryId = this.getNodeParameter('beneficiaryId', i);
|
|
370
|
+
const endpoint = `international/beneficiaries/${beneficiaryId}`;
|
|
371
|
+
responseData = await helpers_1.qontoApiRequest.call(this, headers, 'DELETE', endpoint, {}, {});
|
|
372
|
+
}
|
|
373
|
+
if (operation === 'createInternationalTransfer') {
|
|
374
|
+
const endpoint = 'international/transfers';
|
|
375
|
+
const body = parseJsonParameter(this.getNodeParameter('payload', i));
|
|
376
|
+
responseData = await helpers_1.qontoApiRequest.call(this, headers, 'POST', endpoint, body, {});
|
|
377
|
+
}
|
|
378
|
+
if (operation === 'listInternationalTransferRequirements') {
|
|
379
|
+
const endpoint = 'international/transfers/requirements';
|
|
380
|
+
const body = parseJsonParameter(this.getNodeParameter('payload', i));
|
|
381
|
+
responseData = await helpers_1.qontoApiRequest.call(this, headers, 'POST', endpoint, body, {});
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
if (resource === 'einvoicing') {
|
|
385
|
+
if (operation === 'getEinvoicingSettings') {
|
|
386
|
+
const endpoint = 'einvoicing/settings';
|
|
387
|
+
responseData = await helpers_1.qontoApiRequest.call(this, headers, 'GET', endpoint, {}, {});
|
|
388
|
+
}
|
|
389
|
+
}
|
|
219
390
|
if (resource === 'beneficiaries') {
|
|
220
391
|
if (operation === 'listBeneficiaries') {
|
|
221
|
-
const endpoint = 'beneficiaries';
|
|
392
|
+
const endpoint = 'sepa/beneficiaries';
|
|
222
393
|
const filters = this.getNodeParameter('filters', i);
|
|
223
394
|
if (!isEmpty(filters)) {
|
|
224
395
|
if (filters.iban) {
|
|
@@ -244,7 +415,7 @@ class Qonto {
|
|
|
244
415
|
}
|
|
245
416
|
if (operation === 'showBeneficiary') {
|
|
246
417
|
const id = this.getNodeParameter('id', i);
|
|
247
|
-
const endpoint = `beneficiaries/${id}`;
|
|
418
|
+
const endpoint = `sepa/beneficiaries/${id}`;
|
|
248
419
|
responseData = await helpers_1.qontoApiRequest.call(this, headers, 'GET', endpoint, {}, {});
|
|
249
420
|
}
|
|
250
421
|
if (operation === 'untrustBeneficiaries') {
|
|
@@ -362,9 +533,8 @@ class Qonto {
|
|
|
362
533
|
responseData = await helpers_1.handleListing.call(this, headers, 'GET', endpoint, {}, {}, i);
|
|
363
534
|
}
|
|
364
535
|
if (operation === 'getMembership') {
|
|
365
|
-
const
|
|
366
|
-
|
|
367
|
-
responseData = await helpers_1.handleListing.call(this, headers, 'GET', endpoint, {}, {}, i);
|
|
536
|
+
const endpoint = 'membership';
|
|
537
|
+
responseData = await helpers_1.qontoApiRequest.call(this, headers, 'GET', endpoint, {}, {});
|
|
368
538
|
}
|
|
369
539
|
if (operation === 'createMembership') {
|
|
370
540
|
const endpoint = 'memberships/invite_employee_or_accountant';
|
|
@@ -398,6 +568,43 @@ class Qonto {
|
|
|
398
568
|
responseData = await helpers_1.qontoApiRequest.call(this, headers, 'GET', endpoint, {}, query);
|
|
399
569
|
}
|
|
400
570
|
}
|
|
571
|
+
if (resource === 'bankAccounts') {
|
|
572
|
+
if (operation === 'listBankAccounts') {
|
|
573
|
+
const endpoint = 'bank_accounts';
|
|
574
|
+
responseData = await helpers_1.handleListing.call(this, headers, 'GET', endpoint, {}, {}, i);
|
|
575
|
+
}
|
|
576
|
+
if (operation === 'createBankAccount') {
|
|
577
|
+
const endpoint = 'bank_accounts';
|
|
578
|
+
const accountName = this.getNodeParameter('accountName', i);
|
|
579
|
+
const body = {
|
|
580
|
+
bank_account: {
|
|
581
|
+
name: accountName,
|
|
582
|
+
},
|
|
583
|
+
};
|
|
584
|
+
responseData = await helpers_1.qontoApiRequest.call(this, headers, 'POST', endpoint, body, {});
|
|
585
|
+
}
|
|
586
|
+
if (operation === 'showBankAccount') {
|
|
587
|
+
const accountId = this.getNodeParameter('accountId', i);
|
|
588
|
+
const endpoint = `bank_accounts/${accountId}`;
|
|
589
|
+
responseData = await helpers_1.qontoApiRequest.call(this, headers, 'GET', endpoint, {}, {});
|
|
590
|
+
}
|
|
591
|
+
if (operation === 'updateBankAccount') {
|
|
592
|
+
const accountId = this.getNodeParameter('accountId', i);
|
|
593
|
+
const accountName = this.getNodeParameter('accountName', i);
|
|
594
|
+
const endpoint = `bank_accounts/${accountId}`;
|
|
595
|
+
const body = {
|
|
596
|
+
bank_account: {
|
|
597
|
+
name: accountName,
|
|
598
|
+
},
|
|
599
|
+
};
|
|
600
|
+
responseData = await helpers_1.qontoApiRequest.call(this, headers, 'PATCH', endpoint, body, {});
|
|
601
|
+
}
|
|
602
|
+
if (operation === 'closeBankAccount') {
|
|
603
|
+
const accountId = this.getNodeParameter('accountId', i);
|
|
604
|
+
const endpoint = `bank_accounts/${accountId}/close`;
|
|
605
|
+
responseData = await helpers_1.qontoApiRequest.call(this, headers, 'POST', endpoint, {}, {});
|
|
606
|
+
}
|
|
607
|
+
}
|
|
401
608
|
if (resource === 'attachmentsInATransaction') {
|
|
402
609
|
if (operation === 'uploadAttachmentToATransaction') {
|
|
403
610
|
const transactionId = this.getNodeParameter('transaction_id', i);
|
|
@@ -420,12 +627,13 @@ class Qonto {
|
|
|
420
627
|
},
|
|
421
628
|
};
|
|
422
629
|
responseData = await helpers_1.qontoApiRequest.call(this, headers, 'POST', endpoint, formData, {}, true);
|
|
423
|
-
if (!responseData ||
|
|
630
|
+
if (!responseData ||
|
|
631
|
+
(typeof responseData === 'object' && Object.keys(responseData).length === 0)) {
|
|
424
632
|
responseData = {
|
|
425
633
|
success: true,
|
|
426
634
|
message: 'Attachment uploaded successfully to transaction',
|
|
427
635
|
transaction_id: transactionId,
|
|
428
|
-
uploaded_at: new Date().toISOString()
|
|
636
|
+
uploaded_at: new Date().toISOString(),
|
|
429
637
|
};
|
|
430
638
|
}
|
|
431
639
|
}
|
|
@@ -534,6 +742,82 @@ class Qonto {
|
|
|
534
742
|
responseData = await helpers_1.qontoApiRequest.call(this, headers, 'POST', endpoint, body, {});
|
|
535
743
|
}
|
|
536
744
|
}
|
|
745
|
+
if (resource === 'paymentLinks') {
|
|
746
|
+
if (operation === 'connectPaymentLinksProvider') {
|
|
747
|
+
const endpoint = 'payment_links/connections';
|
|
748
|
+
const body = parseJsonParameter(this.getNodeParameter('payload', i));
|
|
749
|
+
responseData = await helpers_1.qontoApiRequest.call(this, headers, 'POST', endpoint, body, {});
|
|
750
|
+
}
|
|
751
|
+
if (operation === 'getPaymentLinksConnectionStatus') {
|
|
752
|
+
const endpoint = 'payment_links/connections';
|
|
753
|
+
responseData = await helpers_1.qontoApiRequest.call(this, headers, 'GET', endpoint, {}, {});
|
|
754
|
+
}
|
|
755
|
+
if (operation === 'createPaymentLink') {
|
|
756
|
+
const endpoint = 'payment_links';
|
|
757
|
+
const body = parseJsonParameter(this.getNodeParameter('payload', i));
|
|
758
|
+
responseData = await helpers_1.qontoApiRequest.call(this, headers, 'POST', endpoint, body, {});
|
|
759
|
+
}
|
|
760
|
+
if (operation === 'listPaymentLinks') {
|
|
761
|
+
const endpoint = 'payment_links';
|
|
762
|
+
const q = parseJsonParameter(this.getNodeParameter('query', i, {}));
|
|
763
|
+
responseData = await helpers_1.handleListing.call(this, headers, 'GET', endpoint, {}, q, i);
|
|
764
|
+
}
|
|
765
|
+
if (operation === 'showPaymentLink') {
|
|
766
|
+
const paymentLinkId = this.getNodeParameter('paymentLinkId', i);
|
|
767
|
+
const endpoint = `payment_links/${paymentLinkId}`;
|
|
768
|
+
responseData = await helpers_1.qontoApiRequest.call(this, headers, 'GET', endpoint, {}, {});
|
|
769
|
+
}
|
|
770
|
+
if (operation === 'deactivatePaymentLink') {
|
|
771
|
+
const paymentLinkId = this.getNodeParameter('paymentLinkId', i);
|
|
772
|
+
const endpoint = `payment_links/${paymentLinkId}/deactivate`;
|
|
773
|
+
responseData = await helpers_1.qontoApiRequest.call(this, headers, 'PATCH', endpoint, {}, {});
|
|
774
|
+
}
|
|
775
|
+
if (operation === 'listPaymentLinkPayments') {
|
|
776
|
+
const paymentLinkId = this.getNodeParameter('paymentLinkId', i);
|
|
777
|
+
const endpoint = `payment_links/${paymentLinkId}/payments`;
|
|
778
|
+
const q = parseJsonParameter(this.getNodeParameter('query', i, {}));
|
|
779
|
+
responseData = await helpers_1.handleListing.call(this, headers, 'GET', endpoint, {}, q, i);
|
|
780
|
+
}
|
|
781
|
+
if (operation === 'listPaymentLinkMethods') {
|
|
782
|
+
const endpoint = 'payment_links/payment_methods';
|
|
783
|
+
const q = parseJsonParameter(this.getNodeParameter('query', i, {}));
|
|
784
|
+
responseData = await helpers_1.qontoApiRequest.call(this, headers, 'GET', endpoint, {}, q);
|
|
785
|
+
}
|
|
786
|
+
}
|
|
787
|
+
if (resource === 'quotes') {
|
|
788
|
+
if (operation === 'listQuotes') {
|
|
789
|
+
const endpoint = 'quotes';
|
|
790
|
+
const q = parseJsonParameter(this.getNodeParameter('query', i, {}));
|
|
791
|
+
responseData = await helpers_1.handleListing.call(this, headers, 'GET', endpoint, {}, q, i);
|
|
792
|
+
}
|
|
793
|
+
if (operation === 'createQuote') {
|
|
794
|
+
const endpoint = 'quotes';
|
|
795
|
+
const body = parseJsonParameter(this.getNodeParameter('payload', i));
|
|
796
|
+
responseData = await helpers_1.qontoApiRequest.call(this, headers, 'POST', endpoint, body, {});
|
|
797
|
+
}
|
|
798
|
+
if (operation === 'sendQuote') {
|
|
799
|
+
const quoteId = this.getNodeParameter('quoteId', i);
|
|
800
|
+
const endpoint = `quotes/${quoteId}/send`;
|
|
801
|
+
const body = parseJsonParameter(this.getNodeParameter('payload', i));
|
|
802
|
+
responseData = await helpers_1.qontoApiRequest.call(this, headers, 'POST', endpoint, body, {});
|
|
803
|
+
}
|
|
804
|
+
if (operation === 'showQuote') {
|
|
805
|
+
const quoteId = this.getNodeParameter('quoteId', i);
|
|
806
|
+
const endpoint = `quotes/${quoteId}`;
|
|
807
|
+
responseData = await helpers_1.qontoApiRequest.call(this, headers, 'GET', endpoint, {}, {});
|
|
808
|
+
}
|
|
809
|
+
if (operation === 'updateQuote') {
|
|
810
|
+
const quoteId = this.getNodeParameter('quoteId', i);
|
|
811
|
+
const endpoint = `quotes/${quoteId}`;
|
|
812
|
+
const body = parseJsonParameter(this.getNodeParameter('payload', i));
|
|
813
|
+
responseData = await helpers_1.qontoApiRequest.call(this, headers, 'PATCH', endpoint, body, {});
|
|
814
|
+
}
|
|
815
|
+
if (operation === 'deleteQuote') {
|
|
816
|
+
const quoteId = this.getNodeParameter('quoteId', i);
|
|
817
|
+
const endpoint = `quotes/${quoteId}`;
|
|
818
|
+
responseData = await helpers_1.qontoApiRequest.call(this, headers, 'DELETE', endpoint, {}, {});
|
|
819
|
+
}
|
|
820
|
+
}
|
|
537
821
|
if (resource === 'requests') {
|
|
538
822
|
if (operation === 'listRequests') {
|
|
539
823
|
const endpoint = 'requests';
|
|
@@ -554,6 +838,40 @@ class Qonto {
|
|
|
554
838
|
}
|
|
555
839
|
responseData = await helpers_1.qontoApiRequest.call(this, {}, 'GET', endpoint, {}, query);
|
|
556
840
|
}
|
|
841
|
+
if (operation === 'createFlashCardRequest') {
|
|
842
|
+
const endpoint = 'requests/flash_cards';
|
|
843
|
+
const body = {
|
|
844
|
+
request_flash_card: {
|
|
845
|
+
note: this.getNodeParameter('note', i, ''),
|
|
846
|
+
payment_lifespan_limit: this.getNodeParameter('payment_lifespan_limit', i),
|
|
847
|
+
pre_expires_at: (0, helpers_1.formatDateTime)(this.getNodeParameter('pre_expires_at', i)),
|
|
848
|
+
},
|
|
849
|
+
};
|
|
850
|
+
responseData = await helpers_1.qontoApiRequest.call(this, headers, 'POST', endpoint, body, {});
|
|
851
|
+
}
|
|
852
|
+
if (operation === 'createVirtualCardRequest') {
|
|
853
|
+
const endpoint = 'requests/virtual_cards';
|
|
854
|
+
const body = {
|
|
855
|
+
request_virtual_card: {
|
|
856
|
+
note: this.getNodeParameter('note', i, ''),
|
|
857
|
+
payment_monthly_limit: this.getNodeParameter('payment_monthly_limit', i),
|
|
858
|
+
},
|
|
859
|
+
};
|
|
860
|
+
responseData = await helpers_1.qontoApiRequest.call(this, headers, 'POST', endpoint, body, {});
|
|
861
|
+
}
|
|
862
|
+
if (operation === 'createMultiTransferRequest') {
|
|
863
|
+
const endpoint = 'requests/multi_transfers';
|
|
864
|
+
const transfers = this.getNodeParameter('transfers', i);
|
|
865
|
+
const body = {
|
|
866
|
+
request_multi_transfer: {
|
|
867
|
+
note: this.getNodeParameter('note', i, ''),
|
|
868
|
+
debit_iban: this.getNodeParameter('debit_iban', i),
|
|
869
|
+
scheduled_date: (0, helpers_1.formatDate)(this.getNodeParameter('scheduled_date', i)),
|
|
870
|
+
transfers,
|
|
871
|
+
},
|
|
872
|
+
};
|
|
873
|
+
responseData = await helpers_1.qontoApiRequest.call(this, headers, 'POST', endpoint, body, {});
|
|
874
|
+
}
|
|
557
875
|
if (operation === 'approveARequest') {
|
|
558
876
|
const requestId = this.getNodeParameter('id', i);
|
|
559
877
|
const requestType = this.getNodeParameter('request_type', i);
|
|
@@ -604,6 +922,11 @@ class Qonto {
|
|
|
604
922
|
}
|
|
605
923
|
responseData = await helpers_1.handleListing.call(this, headers, 'GET', endpoint, {}, query, i);
|
|
606
924
|
}
|
|
925
|
+
if (operation === 'showSupplierInvoice') {
|
|
926
|
+
const supplierInvoiceId = this.getNodeParameter('supplierInvoiceId', i);
|
|
927
|
+
const endpoint = `supplier_invoices/${supplierInvoiceId}`;
|
|
928
|
+
responseData = await helpers_1.qontoApiRequest.call(this, headers, 'GET', endpoint, {}, {});
|
|
929
|
+
}
|
|
607
930
|
if (operation === 'createSupplierInvoices') {
|
|
608
931
|
const endpoint = 'supplier_invoices/bulk';
|
|
609
932
|
const invoices = this.getNodeParameter('supplierInvoices', i);
|
|
@@ -767,6 +1090,54 @@ class Qonto {
|
|
|
767
1090
|
const endpoint = `client_invoices/${invoiceId}`;
|
|
768
1091
|
responseData = await helpers_1.qontoApiRequest.call(this, headers, 'GET', endpoint, {}, {});
|
|
769
1092
|
}
|
|
1093
|
+
if (operation === 'deleteClientInvoice') {
|
|
1094
|
+
const invoiceId = this.getNodeParameter('invoiceId', i);
|
|
1095
|
+
const endpoint = `client_invoices/${invoiceId}`;
|
|
1096
|
+
responseData = await helpers_1.qontoApiRequest.call(this, headers, 'DELETE', endpoint, {}, {});
|
|
1097
|
+
}
|
|
1098
|
+
if (operation === 'finalizeClientInvoice') {
|
|
1099
|
+
const invoiceId = this.getNodeParameter('invoiceId', i);
|
|
1100
|
+
const endpoint = `client_invoices/${invoiceId}/finalize`;
|
|
1101
|
+
responseData = await helpers_1.qontoApiRequest.call(this, headers, 'POST', endpoint, {}, {});
|
|
1102
|
+
}
|
|
1103
|
+
if (operation === 'cancelClientInvoice') {
|
|
1104
|
+
const invoiceId = this.getNodeParameter('invoiceId', i);
|
|
1105
|
+
const endpoint = `client_invoices/${invoiceId}/mark_as_canceled`;
|
|
1106
|
+
responseData = await helpers_1.qontoApiRequest.call(this, headers, 'POST', endpoint, {}, {});
|
|
1107
|
+
}
|
|
1108
|
+
if (operation === 'unmarkClientInvoiceAsPaid') {
|
|
1109
|
+
const invoiceId = this.getNodeParameter('invoiceId', i);
|
|
1110
|
+
const endpoint = `client_invoices/${invoiceId}/unmark_as_paid`;
|
|
1111
|
+
responseData = await helpers_1.qontoApiRequest.call(this, headers, 'POST', endpoint, {}, {});
|
|
1112
|
+
}
|
|
1113
|
+
if (operation === 'markClientInvoiceAsPaid') {
|
|
1114
|
+
const invoiceId = this.getNodeParameter('invoiceId', i);
|
|
1115
|
+
const endpoint = `client_invoices/${invoiceId}/mark_as_paid`;
|
|
1116
|
+
const paidAt = this.getNodeParameter('paidAt', i);
|
|
1117
|
+
responseData = await helpers_1.qontoApiRequest.call(this, headers, 'POST', endpoint, { paid_at: (0, helpers_1.formatDate)(paidAt) }, {});
|
|
1118
|
+
}
|
|
1119
|
+
if (operation === 'sendClientInvoice') {
|
|
1120
|
+
const invoiceId = this.getNodeParameter('invoiceId', i);
|
|
1121
|
+
const endpoint = `client_invoices/${invoiceId}/send`;
|
|
1122
|
+
const sendToRaw = this.getNodeParameter('sendTo', i);
|
|
1123
|
+
const send_to = sendToRaw
|
|
1124
|
+
.split(',')
|
|
1125
|
+
.map((email) => email.trim())
|
|
1126
|
+
.filter(Boolean);
|
|
1127
|
+
const body = {
|
|
1128
|
+
send_to,
|
|
1129
|
+
copy_to_self: this.getNodeParameter('copyToSelf', i),
|
|
1130
|
+
};
|
|
1131
|
+
const emailTitle = this.getNodeParameter('emailTitle', i, '');
|
|
1132
|
+
const emailBody = this.getNodeParameter('emailBody', i, '');
|
|
1133
|
+
if (emailTitle) {
|
|
1134
|
+
body.email_title = emailTitle;
|
|
1135
|
+
}
|
|
1136
|
+
if (emailBody) {
|
|
1137
|
+
body.email_body = emailBody;
|
|
1138
|
+
}
|
|
1139
|
+
responseData = await helpers_1.qontoApiRequest.call(this, headers, 'POST', endpoint, body, {});
|
|
1140
|
+
}
|
|
770
1141
|
}
|
|
771
1142
|
if (resource === 'creditNotes') {
|
|
772
1143
|
if (operation === 'getListCreditNotes') {
|
|
@@ -864,12 +1235,18 @@ class Qonto {
|
|
|
864
1235
|
};
|
|
865
1236
|
}
|
|
866
1237
|
if (additionalOptions.extraEmails) {
|
|
867
|
-
body.extra_emails = additionalOptions.extraEmails
|
|
868
|
-
|
|
869
|
-
|
|
1238
|
+
body.extra_emails = additionalOptions.extraEmails
|
|
1239
|
+
.split(',')
|
|
1240
|
+
.map((e) => e.trim());
|
|
1241
|
+
}
|
|
1242
|
+
if (additionalOptions.billingStreetAddress ||
|
|
1243
|
+
additionalOptions.billingCity ||
|
|
1244
|
+
additionalOptions.billingZipCode ||
|
|
1245
|
+
additionalOptions.billingCountryCode) {
|
|
870
1246
|
body.billing_address = {};
|
|
871
1247
|
if (additionalOptions.billingStreetAddress) {
|
|
872
|
-
body.billing_address.street_address =
|
|
1248
|
+
body.billing_address.street_address =
|
|
1249
|
+
additionalOptions.billingStreetAddress;
|
|
873
1250
|
}
|
|
874
1251
|
if (additionalOptions.billingCity) {
|
|
875
1252
|
body.billing_address.city = additionalOptions.billingCity;
|
|
@@ -878,10 +1255,12 @@ class Qonto {
|
|
|
878
1255
|
body.billing_address.zip_code = additionalOptions.billingZipCode;
|
|
879
1256
|
}
|
|
880
1257
|
if (additionalOptions.billingProvinceCode) {
|
|
881
|
-
body.billing_address.province_code =
|
|
1258
|
+
body.billing_address.province_code =
|
|
1259
|
+
additionalOptions.billingProvinceCode;
|
|
882
1260
|
}
|
|
883
1261
|
if (additionalOptions.billingCountryCode) {
|
|
884
|
-
body.billing_address.country_code =
|
|
1262
|
+
body.billing_address.country_code =
|
|
1263
|
+
additionalOptions.billingCountryCode;
|
|
885
1264
|
}
|
|
886
1265
|
}
|
|
887
1266
|
headers = {
|
|
@@ -931,10 +1310,14 @@ class Qonto {
|
|
|
931
1310
|
number: updateFields.phoneNumber || '',
|
|
932
1311
|
};
|
|
933
1312
|
}
|
|
934
|
-
if (updateFields.billingStreetAddress ||
|
|
1313
|
+
if (updateFields.billingStreetAddress ||
|
|
1314
|
+
updateFields.billingCity ||
|
|
1315
|
+
updateFields.billingZipCode ||
|
|
1316
|
+
updateFields.billingCountryCode) {
|
|
935
1317
|
body.billing_address = {};
|
|
936
1318
|
if (updateFields.billingStreetAddress) {
|
|
937
|
-
body.billing_address.street_address =
|
|
1319
|
+
body.billing_address.street_address =
|
|
1320
|
+
updateFields.billingStreetAddress;
|
|
938
1321
|
}
|
|
939
1322
|
if (updateFields.billingCity) {
|
|
940
1323
|
body.billing_address.city = updateFields.billingCity;
|
|
@@ -943,10 +1326,12 @@ class Qonto {
|
|
|
943
1326
|
body.billing_address.zip_code = updateFields.billingZipCode;
|
|
944
1327
|
}
|
|
945
1328
|
if (updateFields.billingProvinceCode) {
|
|
946
|
-
body.billing_address.province_code =
|
|
1329
|
+
body.billing_address.province_code =
|
|
1330
|
+
updateFields.billingProvinceCode;
|
|
947
1331
|
}
|
|
948
1332
|
if (updateFields.billingCountryCode) {
|
|
949
|
-
body.billing_address.country_code =
|
|
1333
|
+
body.billing_address.country_code =
|
|
1334
|
+
updateFields.billingCountryCode;
|
|
950
1335
|
}
|
|
951
1336
|
}
|
|
952
1337
|
headers = {
|
|
@@ -955,6 +1340,11 @@ class Qonto {
|
|
|
955
1340
|
};
|
|
956
1341
|
responseData = await helpers_1.qontoApiRequest.call(this, headers, 'PATCH', endpoint, body, {});
|
|
957
1342
|
}
|
|
1343
|
+
if (operation === 'deleteClient') {
|
|
1344
|
+
const clientId = this.getNodeParameter('clientId', i);
|
|
1345
|
+
const endpoint = `clients/${clientId}`;
|
|
1346
|
+
responseData = await helpers_1.qontoApiRequest.call(this, headers, 'DELETE', endpoint, {}, {});
|
|
1347
|
+
}
|
|
958
1348
|
}
|
|
959
1349
|
if (resource === 'teams') {
|
|
960
1350
|
if (operation === 'listTeams') {
|
|
@@ -979,11 +1369,11 @@ class Qonto {
|
|
|
979
1369
|
const filters = this.getNodeParameter('filters', i);
|
|
980
1370
|
if (!isEmpty(filters)) {
|
|
981
1371
|
if (filters.bank_account_ids) {
|
|
982
|
-
const ids = filters.bank_account_ids.split(',').map(id => id.trim());
|
|
1372
|
+
const ids = filters.bank_account_ids.split(',').map((id) => id.trim());
|
|
983
1373
|
query['bank_account_ids[]'] = ids;
|
|
984
1374
|
}
|
|
985
1375
|
if (filters.ibans) {
|
|
986
|
-
const ibans = filters.ibans.split(',').map(iban => iban.trim());
|
|
1376
|
+
const ibans = filters.ibans.split(',').map((iban) => iban.trim());
|
|
987
1377
|
query['ibans[]'] = ibans;
|
|
988
1378
|
}
|
|
989
1379
|
if (filters.period_from) {
|
|
@@ -1134,6 +1524,33 @@ class Qonto {
|
|
|
1134
1524
|
responseData = await helpers_1.qontoApiRequest.call(this, headers, 'DELETE', endpoint, {}, {});
|
|
1135
1525
|
}
|
|
1136
1526
|
}
|
|
1527
|
+
if (resource === 'webhookSubscriptions') {
|
|
1528
|
+
if (operation === 'listWebhookSubscriptions') {
|
|
1529
|
+
const endpoint = 'webhook_subscriptions';
|
|
1530
|
+
responseData = await helpers_1.handleListing.call(this, headers, 'GET', endpoint, {}, {}, i);
|
|
1531
|
+
}
|
|
1532
|
+
if (operation === 'createWebhookSubscription') {
|
|
1533
|
+
const endpoint = 'webhook_subscriptions';
|
|
1534
|
+
const body = parseJsonParameter(this.getNodeParameter('payload', i));
|
|
1535
|
+
responseData = await helpers_1.qontoApiRequest.call(this, headers, 'POST', endpoint, body, {});
|
|
1536
|
+
}
|
|
1537
|
+
if (operation === 'showWebhookSubscription') {
|
|
1538
|
+
const subscriptionId = this.getNodeParameter('subscriptionId', i);
|
|
1539
|
+
const endpoint = `webhook_subscriptions/${subscriptionId}`;
|
|
1540
|
+
responseData = await helpers_1.qontoApiRequest.call(this, headers, 'GET', endpoint, {}, {});
|
|
1541
|
+
}
|
|
1542
|
+
if (operation === 'updateWebhookSubscription') {
|
|
1543
|
+
const subscriptionId = this.getNodeParameter('subscriptionId', i);
|
|
1544
|
+
const endpoint = `webhook_subscriptions/${subscriptionId}`;
|
|
1545
|
+
const body = parseJsonParameter(this.getNodeParameter('payload', i));
|
|
1546
|
+
responseData = await helpers_1.qontoApiRequest.call(this, headers, 'PUT', endpoint, body, {});
|
|
1547
|
+
}
|
|
1548
|
+
if (operation === 'deleteWebhookSubscription') {
|
|
1549
|
+
const subscriptionId = this.getNodeParameter('subscriptionId', i);
|
|
1550
|
+
const endpoint = `webhook_subscriptions/${subscriptionId}`;
|
|
1551
|
+
responseData = await helpers_1.qontoApiRequest.call(this, headers, 'DELETE', endpoint, {}, {});
|
|
1552
|
+
}
|
|
1553
|
+
}
|
|
1137
1554
|
if (resource === 'cards') {
|
|
1138
1555
|
if (operation === 'listCards') {
|
|
1139
1556
|
const endpoint = 'cards';
|
|
@@ -1191,7 +1608,8 @@ class Qonto {
|
|
|
1191
1608
|
cardData.payment_daily_limit = additionalOptions.paymentDailyLimit;
|
|
1192
1609
|
}
|
|
1193
1610
|
if (additionalOptions.paymentTransactionLimitOption !== undefined) {
|
|
1194
|
-
cardData.payment_transaction_limit_option =
|
|
1611
|
+
cardData.payment_transaction_limit_option =
|
|
1612
|
+
additionalOptions.paymentTransactionLimitOption;
|
|
1195
1613
|
}
|
|
1196
1614
|
if (additionalOptions.paymentTransactionLimit) {
|
|
1197
1615
|
cardData.payment_transaction_limit = additionalOptions.paymentTransactionLimit;
|
|
@@ -1211,6 +1629,14 @@ class Qonto {
|
|
|
1211
1629
|
};
|
|
1212
1630
|
responseData = await helpers_1.qontoApiRequest.call(this, headers, 'POST', endpoint, body, {});
|
|
1213
1631
|
}
|
|
1632
|
+
if (operation === 'createCardsBulk') {
|
|
1633
|
+
const endpoint = 'cards/bulk';
|
|
1634
|
+
const cards = this.getNodeParameter('cardsPayload', i);
|
|
1635
|
+
const body = {
|
|
1636
|
+
cards,
|
|
1637
|
+
};
|
|
1638
|
+
responseData = await helpers_1.qontoApiRequest.call(this, headers, 'POST', endpoint, body, {});
|
|
1639
|
+
}
|
|
1214
1640
|
if (operation === 'retrieveCard') {
|
|
1215
1641
|
const cardId = this.getNodeParameter('cardId', i);
|
|
1216
1642
|
const endpoint = `cards/${cardId}/data_view`;
|
|
@@ -1240,7 +1666,8 @@ class Qonto {
|
|
|
1240
1666
|
cardData.payment_daily_limit = updateLimits.paymentDailyLimit;
|
|
1241
1667
|
}
|
|
1242
1668
|
if (updateLimits.paymentTransactionLimitOption !== undefined) {
|
|
1243
|
-
cardData.payment_transaction_limit_option =
|
|
1669
|
+
cardData.payment_transaction_limit_option =
|
|
1670
|
+
updateLimits.paymentTransactionLimitOption;
|
|
1244
1671
|
}
|
|
1245
1672
|
if (updateLimits.paymentTransactionLimit !== undefined) {
|
|
1246
1673
|
cardData.payment_transaction_limit = updateLimits.paymentTransactionLimit;
|
|
@@ -1290,6 +1717,38 @@ class Qonto {
|
|
|
1290
1717
|
const endpoint = `cards/${cardId}/unlock`;
|
|
1291
1718
|
responseData = await helpers_1.qontoApiRequest.call(this, headers, 'PUT', endpoint, {}, {});
|
|
1292
1719
|
}
|
|
1720
|
+
if (operation === 'reportCardLost') {
|
|
1721
|
+
const cardId = this.getNodeParameter('cardId', i);
|
|
1722
|
+
const endpoint = `cards/${cardId}/lost`;
|
|
1723
|
+
responseData = await helpers_1.qontoApiRequest.call(this, headers, 'PUT', endpoint, {}, {});
|
|
1724
|
+
}
|
|
1725
|
+
if (operation === 'reportCardStolen') {
|
|
1726
|
+
const cardId = this.getNodeParameter('cardId', i);
|
|
1727
|
+
const endpoint = `cards/${cardId}/stolen`;
|
|
1728
|
+
responseData = await helpers_1.qontoApiRequest.call(this, headers, 'PUT', endpoint, {}, {});
|
|
1729
|
+
}
|
|
1730
|
+
if (operation === 'discardVirtualCard') {
|
|
1731
|
+
const cardId = this.getNodeParameter('cardId', i);
|
|
1732
|
+
const endpoint = `cards/${cardId}/discard`;
|
|
1733
|
+
responseData = await helpers_1.qontoApiRequest.call(this, headers, 'PUT', endpoint, {}, {});
|
|
1734
|
+
}
|
|
1735
|
+
if (operation === 'updateCardRestrictions') {
|
|
1736
|
+
const cardId = this.getNodeParameter('cardId', i);
|
|
1737
|
+
const endpoint = `cards/${cardId}/restrictions`;
|
|
1738
|
+
const body = this.getNodeParameter('restrictionsPayload', i);
|
|
1739
|
+
responseData = await helpers_1.qontoApiRequest.call(this, headers, 'PATCH', endpoint, body, {});
|
|
1740
|
+
}
|
|
1741
|
+
if (operation === 'updateCardNickname') {
|
|
1742
|
+
const cardId = this.getNodeParameter('cardId', i);
|
|
1743
|
+
const endpoint = `cards/${cardId}/nickname`;
|
|
1744
|
+
const nickname = this.getNodeParameter('nickname', i);
|
|
1745
|
+
const body = {
|
|
1746
|
+
card: {
|
|
1747
|
+
nickname,
|
|
1748
|
+
},
|
|
1749
|
+
};
|
|
1750
|
+
responseData = await helpers_1.qontoApiRequest.call(this, headers, 'PATCH', endpoint, body, {});
|
|
1751
|
+
}
|
|
1293
1752
|
}
|
|
1294
1753
|
}
|
|
1295
1754
|
catch (error) {
|