@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
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { AxiosInstance } from 'axios';
|
|
2
|
+
import { UUID, ISODateTime } from '../types';
|
|
3
|
+
export interface InternationalTransfer {
|
|
4
|
+
id: UUID;
|
|
5
|
+
beneficiary_id: UUID;
|
|
6
|
+
bank_account_id: UUID;
|
|
7
|
+
source_amount: {
|
|
8
|
+
currency: string;
|
|
9
|
+
value: string;
|
|
10
|
+
};
|
|
11
|
+
target_amount: {
|
|
12
|
+
currency: string;
|
|
13
|
+
value: string;
|
|
14
|
+
};
|
|
15
|
+
status: string;
|
|
16
|
+
created_at?: ISODateTime;
|
|
17
|
+
updated_at?: ISODateTime;
|
|
18
|
+
}
|
|
19
|
+
export interface Quote {
|
|
20
|
+
id: UUID;
|
|
21
|
+
status: string;
|
|
22
|
+
created_at: ISODateTime;
|
|
23
|
+
expired_at: ISODateTime;
|
|
24
|
+
source_amount: {
|
|
25
|
+
currency: string;
|
|
26
|
+
value: string;
|
|
27
|
+
};
|
|
28
|
+
target_amount: {
|
|
29
|
+
currency: string;
|
|
30
|
+
value: string;
|
|
31
|
+
};
|
|
32
|
+
rate: number;
|
|
33
|
+
fees: {
|
|
34
|
+
total_amount: {
|
|
35
|
+
currency: string;
|
|
36
|
+
value: string;
|
|
37
|
+
};
|
|
38
|
+
details: {
|
|
39
|
+
currency: string;
|
|
40
|
+
value: string;
|
|
41
|
+
}[];
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
export interface Currency {
|
|
45
|
+
currency_code: string;
|
|
46
|
+
country_code: string;
|
|
47
|
+
suggestion_priority: number;
|
|
48
|
+
}
|
|
49
|
+
export interface CreateInternationalTransferParams {
|
|
50
|
+
beneficiary_id: UUID;
|
|
51
|
+
quote_id?: UUID;
|
|
52
|
+
details?: {
|
|
53
|
+
reference?: string;
|
|
54
|
+
};
|
|
55
|
+
target_account_id?: string;
|
|
56
|
+
source_amount?: {
|
|
57
|
+
currency: string;
|
|
58
|
+
value: string;
|
|
59
|
+
};
|
|
60
|
+
target_amount?: {
|
|
61
|
+
currency: string;
|
|
62
|
+
value: string;
|
|
63
|
+
};
|
|
64
|
+
bank_account_id: UUID;
|
|
65
|
+
attachment_ids?: UUID[];
|
|
66
|
+
}
|
|
67
|
+
export interface CreateQuoteParams {
|
|
68
|
+
source_currency: string;
|
|
69
|
+
target_currency: string;
|
|
70
|
+
source_amount?: string;
|
|
71
|
+
target_amount?: string;
|
|
72
|
+
}
|
|
73
|
+
export declare class InternationalTransfersResource {
|
|
74
|
+
private readonly http;
|
|
75
|
+
constructor(http: AxiosInstance);
|
|
76
|
+
/**
|
|
77
|
+
* List international transfers
|
|
78
|
+
*/
|
|
79
|
+
list(params?: any): Promise<{
|
|
80
|
+
transfers: InternationalTransfer[];
|
|
81
|
+
}>;
|
|
82
|
+
/**
|
|
83
|
+
* Retrieve a specific international transfer
|
|
84
|
+
*/
|
|
85
|
+
retrieve(id: string): Promise<{
|
|
86
|
+
transfer: InternationalTransfer;
|
|
87
|
+
}>;
|
|
88
|
+
/**
|
|
89
|
+
* Create an international transfer
|
|
90
|
+
*/
|
|
91
|
+
create(data: CreateInternationalTransferParams): Promise<{
|
|
92
|
+
transfer: InternationalTransfer;
|
|
93
|
+
}>;
|
|
94
|
+
/**
|
|
95
|
+
* Cancel an international transfer
|
|
96
|
+
*/
|
|
97
|
+
cancel(id: string): Promise<any>;
|
|
98
|
+
/**
|
|
99
|
+
* Get available currencies for international transfers
|
|
100
|
+
*/
|
|
101
|
+
listCurrencies(params?: {
|
|
102
|
+
source?: string;
|
|
103
|
+
}): Promise<{
|
|
104
|
+
currencies: Currency[];
|
|
105
|
+
}>;
|
|
106
|
+
/**
|
|
107
|
+
* Create a new international transfer quote
|
|
108
|
+
*/
|
|
109
|
+
createQuote(data: CreateQuoteParams): Promise<{
|
|
110
|
+
quote: Quote;
|
|
111
|
+
}>;
|
|
112
|
+
/**
|
|
113
|
+
* Retrieve a quote (renamed from getQuote to map original class)
|
|
114
|
+
*/
|
|
115
|
+
getQuote(id: string, params?: any): Promise<{
|
|
116
|
+
quote: Quote;
|
|
117
|
+
}>;
|
|
118
|
+
/**
|
|
119
|
+
* Retrieve the details/purpose codes for a specific country/currency.
|
|
120
|
+
*/
|
|
121
|
+
getPurposeCodes(id: string, params?: any): Promise<any>;
|
|
122
|
+
/**
|
|
123
|
+
* Retrieve details
|
|
124
|
+
*/
|
|
125
|
+
retrieveDetails(params?: any): Promise<any>;
|
|
126
|
+
}
|
|
127
|
+
//# sourceMappingURL=internationalTransfers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"internationalTransfers.d.ts","sourceRoot":"","sources":["../../src/resources/internationalTransfers.ts"],"names":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;QAAE,UAAU,EAAE,QAAQ,EAAE,CAAA;KAAE,CAAC;IAKvF;;OAEG;IACG,WAAW,CAAC,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAAC;QAAE,KAAK,EAAE,KAAK,CAAA;KAAE,CAAC;IAKrE;;OAEG;IACG,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,GAAG,GAAG,OAAO,CAAC;QAAE,KAAK,EAAE,KAAK,CAAA;KAAE,CAAC;IAKnE;;OAEG;IACG,eAAe,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC;IAK7D;;OAEG;IACG,eAAe,CAAC,MAAM,CAAC,EAAE,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC;CAIlD"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.InternationalTransfersResource = void 0;
|
|
4
|
+
class InternationalTransfersResource {
|
|
5
|
+
constructor(http) {
|
|
6
|
+
this.http = http;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* List international transfers
|
|
10
|
+
*/
|
|
11
|
+
async list(params) {
|
|
12
|
+
const response = await this.http.get('/v2/international/transfers', { params });
|
|
13
|
+
return response.data;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Retrieve a specific international transfer
|
|
17
|
+
*/
|
|
18
|
+
async retrieve(id) {
|
|
19
|
+
const response = await this.http.get(`/v2/international/transfers/${id}`);
|
|
20
|
+
return response.data;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Create an international transfer
|
|
24
|
+
*/
|
|
25
|
+
async create(data) {
|
|
26
|
+
const response = await this.http.post('/v2/international/transfers', data);
|
|
27
|
+
return response.data;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Cancel an international transfer
|
|
31
|
+
*/
|
|
32
|
+
async cancel(id) {
|
|
33
|
+
const response = await this.http.post(`/v2/international/transfers/${id}/cancel`); // Typically cancellation is POST on Qonto API
|
|
34
|
+
return response.data;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Get available currencies for international transfers
|
|
38
|
+
*/
|
|
39
|
+
async listCurrencies(params) {
|
|
40
|
+
const response = await this.http.get('/v2/international/currencies', { params });
|
|
41
|
+
return response.data;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Create a new international transfer quote
|
|
45
|
+
*/
|
|
46
|
+
async createQuote(data) {
|
|
47
|
+
const response = await this.http.post('/v2/international/quotes', data);
|
|
48
|
+
return response.data;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Retrieve a quote (renamed from getQuote to map original class)
|
|
52
|
+
*/
|
|
53
|
+
async getQuote(id, params) {
|
|
54
|
+
const response = await this.http.get(`/v2/international/quotes/${id}`, { params });
|
|
55
|
+
return response.data;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Retrieve the details/purpose codes for a specific country/currency.
|
|
59
|
+
*/
|
|
60
|
+
async getPurposeCodes(id, params) {
|
|
61
|
+
const response = await this.http.get(`/v2/international/purpose_codes/${id}`, { params });
|
|
62
|
+
return response.data;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Retrieve details
|
|
66
|
+
*/
|
|
67
|
+
async retrieveDetails(params) {
|
|
68
|
+
const response = await this.http.get('/v2/international/details', { params });
|
|
69
|
+
return response.data;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
exports.InternationalTransfersResource = InternationalTransfersResource;
|
|
73
|
+
//# sourceMappingURL=internationalTransfers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"internationalTransfers.js","sourceRoot":"","sources":["../../src/resources/internationalTransfers.ts"],"names":[],"mappings":";;;AA8EA,MAAa,8BAA8B;IACzC,YAA6B,IAAmB;QAAnB,SAAI,GAAJ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,CAAC;IACvB,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,QAAQ,CAAC,EAAU,EAAE,MAAY;QACrC,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,4BAA4B,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;QACnF,OAAO,QAAQ,CAAC,IAAI,CAAC;IACvB,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,eAAe,CAAC,EAAU,EAAE,MAAY;QAC5C,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,mCAAmC,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;QAC1F,OAAO,QAAQ,CAAC,IAAI,CAAC;IACvB,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,eAAe,CAAC,MAAY;QAChC,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,2BAA2B,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;QAC9E,OAAO,QAAQ,CAAC,IAAI,CAAC;IACvB,CAAC;CACF;AA1ED,wEA0EC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { AxiosInstance } from 'axios';
|
|
2
|
+
import { UUID, PaginationMeta } from '../types';
|
|
3
|
+
export interface Label {
|
|
4
|
+
id: UUID;
|
|
5
|
+
name: string;
|
|
6
|
+
parent_id: UUID | null;
|
|
7
|
+
}
|
|
8
|
+
export interface ListLabelsParams {
|
|
9
|
+
page?: number;
|
|
10
|
+
per_page?: number;
|
|
11
|
+
}
|
|
12
|
+
export interface ListLabelsResponse {
|
|
13
|
+
labels: Label[];
|
|
14
|
+
meta: PaginationMeta;
|
|
15
|
+
}
|
|
16
|
+
export interface LabelResponse {
|
|
17
|
+
label: Label;
|
|
18
|
+
}
|
|
19
|
+
export interface CreateLabelParams {
|
|
20
|
+
name: string;
|
|
21
|
+
parent_id?: UUID;
|
|
22
|
+
}
|
|
23
|
+
export declare class LabelsResource {
|
|
24
|
+
private readonly http;
|
|
25
|
+
constructor(http: AxiosInstance);
|
|
26
|
+
/**
|
|
27
|
+
* Retrieves a list of all labels in your organization.
|
|
28
|
+
*/
|
|
29
|
+
list(params?: ListLabelsParams): Promise<ListLabelsResponse>;
|
|
30
|
+
/**
|
|
31
|
+
* Retrieves a specific label.
|
|
32
|
+
*/
|
|
33
|
+
retrieve(id: string): Promise<LabelResponse>;
|
|
34
|
+
/**
|
|
35
|
+
* Creates a new label.
|
|
36
|
+
* (Method mapping kept per standard operations)
|
|
37
|
+
*/
|
|
38
|
+
create(data: CreateLabelParams): Promise<LabelResponse>;
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=labels.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"labels.d.ts","sourceRoot":"","sources":["../../src/resources/labels.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAEhD,MAAM,WAAW,KAAK;IACpB,EAAE,EAAE,IAAI,CAAC;IACT,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,IAAI,GAAG,IAAI,CAAC;CACxB;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,KAAK,EAAE,CAAC;IAChB,IAAI,EAAE,cAAc,CAAC;CACtB;AAED,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,KAAK,CAAC;CACd;AAED,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,IAAI,CAAC;CAClB;AAED,qBAAa,cAAc;IACb,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAAJ,IAAI,EAAE,aAAa;IAEhD;;OAEG;IACG,IAAI,CAAC,MAAM,CAAC,EAAE,gBAAgB,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAKlE;;OAEG;IACG,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;IAKlD;;;OAGG;IACG,MAAM,CAAC,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAAC,aAAa,CAAC;CAI9D"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LabelsResource = void 0;
|
|
4
|
+
class LabelsResource {
|
|
5
|
+
constructor(http) {
|
|
6
|
+
this.http = http;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Retrieves a list of all labels in your organization.
|
|
10
|
+
*/
|
|
11
|
+
async list(params) {
|
|
12
|
+
const response = await this.http.get('/v2/labels', { params });
|
|
13
|
+
return response.data;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Retrieves a specific label.
|
|
17
|
+
*/
|
|
18
|
+
async retrieve(id) {
|
|
19
|
+
const response = await this.http.get(`/v2/labels/${id}`);
|
|
20
|
+
return response.data;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Creates a new label.
|
|
24
|
+
* (Method mapping kept per standard operations)
|
|
25
|
+
*/
|
|
26
|
+
async create(data) {
|
|
27
|
+
const response = await this.http.post('/v2/labels', data);
|
|
28
|
+
return response.data;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
exports.LabelsResource = LabelsResource;
|
|
32
|
+
//# sourceMappingURL=labels.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"labels.js","sourceRoot":"","sources":["../../src/resources/labels.ts"],"names":[],"mappings":";;;AA4BA,MAAa,cAAc;IACzB,YAA6B,IAAmB;QAAnB,SAAI,GAAJ,IAAI,CAAe;IAAG,CAAC;IAEpD;;OAEG;IACH,KAAK,CAAC,IAAI,CAAC,MAAyB;QAClC,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,YAAY,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;QAC/D,OAAO,QAAQ,CAAC,IAAI,CAAC;IACvB,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,QAAQ,CAAC,EAAU;QACvB,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,cAAc,EAAE,EAAE,CAAC,CAAC;QACzD,OAAO,QAAQ,CAAC,IAAI,CAAC;IACvB,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,MAAM,CAAC,IAAuB;QAClC,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC;QAC1D,OAAO,QAAQ,CAAC,IAAI,CAAC;IACvB,CAAC;CACF;AA3BD,wCA2BC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { AxiosInstance } from 'axios';
|
|
2
|
+
import { Membership, PaginationMeta, ListMembershipsParams, CreateMembershipBody } from '../types';
|
|
3
|
+
export declare class MembershipsResource {
|
|
4
|
+
private readonly http;
|
|
5
|
+
constructor(http: AxiosInstance);
|
|
6
|
+
/** GET /v2/memberships */
|
|
7
|
+
list(params?: ListMembershipsParams): Promise<{
|
|
8
|
+
memberships: Membership[];
|
|
9
|
+
meta: PaginationMeta;
|
|
10
|
+
}>;
|
|
11
|
+
/** GET /v2/membership */
|
|
12
|
+
getCurrent(): Promise<{
|
|
13
|
+
membership: Membership;
|
|
14
|
+
}>;
|
|
15
|
+
/** POST /v2/memberships/invite_employee_or_accountant */
|
|
16
|
+
create(body: CreateMembershipBody): Promise<{
|
|
17
|
+
membership: Membership;
|
|
18
|
+
}>;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=memberships.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"memberships.d.ts","sourceRoot":"","sources":["../../src/resources/memberships.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAEnG,qBAAa,mBAAmB;IAClB,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAAJ,IAAI,EAAE,aAAa;IAEhD,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,yBAAyB;IACnB,UAAU,IAAI,OAAO,CAAC;QAAE,UAAU,EAAE,UAAU,CAAA;KAAE,CAAC;IAKvD,yDAAyD;IACnD,MAAM,CAAC,IAAI,EAAE,oBAAoB,GAAG,OAAO,CAAC;QAAE,UAAU,EAAE,UAAU,CAAA;KAAE,CAAC;CAI9E"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MembershipsResource = void 0;
|
|
4
|
+
class MembershipsResource {
|
|
5
|
+
constructor(http) {
|
|
6
|
+
this.http = http;
|
|
7
|
+
}
|
|
8
|
+
/** GET /v2/memberships */
|
|
9
|
+
async list(params) {
|
|
10
|
+
const response = await this.http.get('/v2/memberships', { params });
|
|
11
|
+
return response.data;
|
|
12
|
+
}
|
|
13
|
+
/** GET /v2/membership */
|
|
14
|
+
async getCurrent() {
|
|
15
|
+
const response = await this.http.get('/v2/membership');
|
|
16
|
+
return response.data;
|
|
17
|
+
}
|
|
18
|
+
/** POST /v2/memberships/invite_employee_or_accountant */
|
|
19
|
+
async create(body) {
|
|
20
|
+
const response = await this.http.post('/v2/memberships/invite_employee_or_accountant', body);
|
|
21
|
+
return response.data;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
exports.MembershipsResource = MembershipsResource;
|
|
25
|
+
//# sourceMappingURL=memberships.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"memberships.js","sourceRoot":"","sources":["../../src/resources/memberships.ts"],"names":[],"mappings":";;;AAGA,MAAa,mBAAmB;IAC9B,YAA6B,IAAmB;QAAnB,SAAI,GAAJ,IAAI,CAAe;IAAG,CAAC;IAEpD,0BAA0B;IAC1B,KAAK,CAAC,IAAI,CAAC,MAA8B;QACvC,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,iBAAiB,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;QACpE,OAAO,QAAQ,CAAC,IAAI,CAAC;IACvB,CAAC;IAED,yBAAyB;IACzB,KAAK,CAAC,UAAU;QACd,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;QACvD,OAAO,QAAQ,CAAC,IAAI,CAAC;IACvB,CAAC;IAED,yDAAyD;IACzD,KAAK,CAAC,MAAM,CAAC,IAA0B;QACrC,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,+CAA+C,EAAE,IAAI,CAAC,CAAC;QAC7F,OAAO,QAAQ,CAAC,IAAI,CAAC;IACvB,CAAC;CACF;AApBD,kDAoBC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { AxiosInstance } from 'axios';
|
|
2
|
+
export interface TokenParams {
|
|
3
|
+
client_id: string;
|
|
4
|
+
client_secret?: string;
|
|
5
|
+
grant_type: string;
|
|
6
|
+
code?: string;
|
|
7
|
+
redirect_uri?: string;
|
|
8
|
+
refresh_token?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface TokenResponse {
|
|
11
|
+
access_token: string;
|
|
12
|
+
refresh_token?: string;
|
|
13
|
+
token_type: string;
|
|
14
|
+
expires_in: number;
|
|
15
|
+
}
|
|
16
|
+
export interface RevokeTokenParams {
|
|
17
|
+
client_id: string;
|
|
18
|
+
client_secret?: string;
|
|
19
|
+
token: string;
|
|
20
|
+
}
|
|
21
|
+
export interface AuthorizationUrlParams {
|
|
22
|
+
client_id: string;
|
|
23
|
+
redirect_uri: string;
|
|
24
|
+
response_type: string;
|
|
25
|
+
scope?: string;
|
|
26
|
+
state?: string;
|
|
27
|
+
}
|
|
28
|
+
export declare class OAuthResource {
|
|
29
|
+
private readonly http;
|
|
30
|
+
constructor(http: AxiosInstance);
|
|
31
|
+
/**
|
|
32
|
+
* Generates the authorization URL to redirect the user to.
|
|
33
|
+
* Note: This does not make an API call, but constructs the URL.
|
|
34
|
+
*/
|
|
35
|
+
getAuthorizationUrl(params: AuthorizationUrlParams): string;
|
|
36
|
+
/**
|
|
37
|
+
* Requests an access token (and optionally a refresh token) using an authorization code or refresh token.
|
|
38
|
+
* Qonto's OAuth endpoints are usually on oauth.qonto.com. You might need to configure the AxiosInstance
|
|
39
|
+
* specifically for this or use a separate client if your base URL is fixed to thirdparty.qonto.com/v2.
|
|
40
|
+
*/
|
|
41
|
+
getToken(data: TokenParams): Promise<TokenResponse>;
|
|
42
|
+
/**
|
|
43
|
+
* Revokes an existing access or refresh token.
|
|
44
|
+
*/
|
|
45
|
+
revokeToken(data: RevokeTokenParams): Promise<void>;
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=oauth.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oauth.d.ts","sourceRoot":"","sources":["../../src/resources/oauth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAEtC,MAAM,WAAW,WAAW;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,aAAa;IAC5B,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,iBAAiB;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,sBAAsB;IACrC,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,qBAAa,aAAa;IACZ,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAAJ,IAAI,EAAE,aAAa;IAEhD;;;OAGG;IACH,mBAAmB,CAAC,MAAM,EAAE,sBAAsB,GAAG,MAAM;IAU3D;;;;OAIG;IACG,QAAQ,CAAC,IAAI,EAAE,WAAW,GAAG,OAAO,CAAC,aAAa,CAAC;IAKzD;;OAEG;IACG,WAAW,CAAC,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;CAG1D"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OAuthResource = void 0;
|
|
4
|
+
class OAuthResource {
|
|
5
|
+
constructor(http) {
|
|
6
|
+
this.http = http;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Generates the authorization URL to redirect the user to.
|
|
10
|
+
* Note: This does not make an API call, but constructs the URL.
|
|
11
|
+
*/
|
|
12
|
+
getAuthorizationUrl(params) {
|
|
13
|
+
const url = new URL('https://oauth.qonto.com/oauth2/auth');
|
|
14
|
+
Object.entries(params).forEach(([key, value]) => {
|
|
15
|
+
if (value !== undefined) {
|
|
16
|
+
url.searchParams.append(key, value);
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
return url.toString();
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Requests an access token (and optionally a refresh token) using an authorization code or refresh token.
|
|
23
|
+
* Qonto's OAuth endpoints are usually on oauth.qonto.com. You might need to configure the AxiosInstance
|
|
24
|
+
* specifically for this or use a separate client if your base URL is fixed to thirdparty.qonto.com/v2.
|
|
25
|
+
*/
|
|
26
|
+
async getToken(data) {
|
|
27
|
+
const response = await this.http.post('https://oauth.qonto.com/oauth2/token', data);
|
|
28
|
+
return response.data;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Revokes an existing access or refresh token.
|
|
32
|
+
*/
|
|
33
|
+
async revokeToken(data) {
|
|
34
|
+
await this.http.post('https://oauth.qonto.com/oauth2/revoke', data);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
exports.OAuthResource = OAuthResource;
|
|
38
|
+
//# sourceMappingURL=oauth.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oauth.js","sourceRoot":"","sources":["../../src/resources/oauth.ts"],"names":[],"mappings":";;;AAgCA,MAAa,aAAa;IACxB,YAA6B,IAAmB;QAAnB,SAAI,GAAJ,IAAI,CAAe;IAAG,CAAC;IAEpD;;;OAGG;IACH,mBAAmB,CAAC,MAA8B;QAChD,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,qCAAqC,CAAC,CAAC;QAC3D,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE;YAC9C,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;gBACxB,GAAG,CAAC,YAAY,CAAC,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;YACtC,CAAC;QACH,CAAC,CAAC,CAAC;QACH,OAAO,GAAG,CAAC,QAAQ,EAAE,CAAC;IACxB,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,QAAQ,CAAC,IAAiB;QAC9B,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,sCAAsC,EAAE,IAAI,CAAC,CAAC;QACpF,OAAO,QAAQ,CAAC,IAAI,CAAC;IACvB,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,WAAW,CAAC,IAAuB;QACvC,MAAM,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,uCAAuC,EAAE,IAAI,CAAC,CAAC;IACtE,CAAC;CACF;AAjCD,sCAiCC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { AxiosInstance } from 'axios';
|
|
2
|
+
import { Organization, UUID } from '../types';
|
|
3
|
+
export interface GetOrganizationParams {
|
|
4
|
+
include_external_accounts?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export interface OrganizationResponse {
|
|
7
|
+
organization: Organization;
|
|
8
|
+
}
|
|
9
|
+
export declare class OrganizationsResource {
|
|
10
|
+
private readonly http;
|
|
11
|
+
constructor(http: AxiosInstance);
|
|
12
|
+
/**
|
|
13
|
+
* DEPRECATED: Retrieve a specific organization by its ID.
|
|
14
|
+
* Please use getCurrent (/v2/organization) instead.
|
|
15
|
+
* GET /v2/organizations/:id
|
|
16
|
+
*/
|
|
17
|
+
show(id: UUID): Promise<OrganizationResponse>;
|
|
18
|
+
/**
|
|
19
|
+
* Retrieve the current organization associated with the authenticated token.
|
|
20
|
+
* Also lists the bank accounts of the authenticated company.
|
|
21
|
+
* GET /v2/organization
|
|
22
|
+
*/
|
|
23
|
+
getCurrent(params?: GetOrganizationParams): Promise<OrganizationResponse>;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=organizations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"organizations.d.ts","sourceRoot":"","sources":["../../src/resources/organizations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAE9C,MAAM,WAAW,qBAAqB;IACpC,yBAAyB,CAAC,EAAE,OAAO,CAAC;CACrC;AAED,MAAM,WAAW,oBAAoB;IACnC,YAAY,EAAE,YAAY,CAAC;CAC5B;AAED,qBAAa,qBAAqB;IACpB,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAAJ,IAAI,EAAE,aAAa;IAEhD;;;;OAIG;IACG,IAAI,CAAC,EAAE,EAAE,IAAI,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAKnD;;;;OAIG;IACG,UAAU,CAAC,MAAM,CAAC,EAAE,qBAAqB,GAAG,OAAO,CAAC,oBAAoB,CAAC;CAIhF"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OrganizationsResource = void 0;
|
|
4
|
+
class OrganizationsResource {
|
|
5
|
+
constructor(http) {
|
|
6
|
+
this.http = http;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* DEPRECATED: Retrieve a specific organization by its ID.
|
|
10
|
+
* Please use getCurrent (/v2/organization) instead.
|
|
11
|
+
* GET /v2/organizations/:id
|
|
12
|
+
*/
|
|
13
|
+
async show(id) {
|
|
14
|
+
const response = await this.http.get(`/v2/organizations/${id}`);
|
|
15
|
+
return response.data;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Retrieve the current organization associated with the authenticated token.
|
|
19
|
+
* Also lists the bank accounts of the authenticated company.
|
|
20
|
+
* GET /v2/organization
|
|
21
|
+
*/
|
|
22
|
+
async getCurrent(params) {
|
|
23
|
+
const response = await this.http.get('/v2/organization', { params });
|
|
24
|
+
return response.data;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
exports.OrganizationsResource = OrganizationsResource;
|
|
28
|
+
//# sourceMappingURL=organizations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"organizations.js","sourceRoot":"","sources":["../../src/resources/organizations.ts"],"names":[],"mappings":";;;AAWA,MAAa,qBAAqB;IAChC,YAA6B,IAAmB;QAAnB,SAAI,GAAJ,IAAI,CAAe;IAAG,CAAC;IAEpD;;;;OAIG;IACH,KAAK,CAAC,IAAI,CAAC,EAAQ;QACjB,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,GAAG,CAAuB,qBAAqB,EAAE,EAAE,CAAC,CAAC;QACtF,OAAO,QAAQ,CAAC,IAAI,CAAC;IACvB,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,UAAU,CAAC,MAA8B;QAC7C,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,GAAG,CAAuB,kBAAkB,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;QAC3F,OAAO,QAAQ,CAAC,IAAI,CAAC;IACvB,CAAC;CACF;AAtBD,sDAsBC"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { AxiosInstance } from 'axios';
|
|
2
|
+
import { UUID, PaginationMeta } from '../types';
|
|
3
|
+
export interface PaymentLinkAmount {
|
|
4
|
+
currency: string;
|
|
5
|
+
value: string;
|
|
6
|
+
}
|
|
7
|
+
export interface PaymentLinkItem {
|
|
8
|
+
title: string;
|
|
9
|
+
quantity: number;
|
|
10
|
+
unit_price: PaymentLinkAmount;
|
|
11
|
+
vat_rate: string;
|
|
12
|
+
type?: string;
|
|
13
|
+
description?: string;
|
|
14
|
+
measure_unit?: string;
|
|
15
|
+
}
|
|
16
|
+
export interface PaymentLink {
|
|
17
|
+
id: UUID;
|
|
18
|
+
status: string;
|
|
19
|
+
expiration_date: string;
|
|
20
|
+
potential_payment_methods: string[];
|
|
21
|
+
amount: PaymentLinkAmount;
|
|
22
|
+
created_at: string;
|
|
23
|
+
url: string;
|
|
24
|
+
resource_type: string;
|
|
25
|
+
reusable?: boolean;
|
|
26
|
+
items?: PaymentLinkItem[];
|
|
27
|
+
invoice_id?: UUID;
|
|
28
|
+
invoice_number?: string;
|
|
29
|
+
debitor_name?: string;
|
|
30
|
+
}
|
|
31
|
+
export interface CreateBasketPaymentLinkParams {
|
|
32
|
+
items: PaymentLinkItem[];
|
|
33
|
+
reusable: boolean;
|
|
34
|
+
potential_payment_methods: string[];
|
|
35
|
+
}
|
|
36
|
+
export interface CreateInvoicePaymentLinkParams {
|
|
37
|
+
invoice_id: UUID;
|
|
38
|
+
invoice_number: string;
|
|
39
|
+
debitor_name: string;
|
|
40
|
+
amount: PaymentLinkAmount;
|
|
41
|
+
potential_payment_methods: string[];
|
|
42
|
+
}
|
|
43
|
+
export type CreatePaymentLinkParams = CreateBasketPaymentLinkParams | CreateInvoicePaymentLinkParams;
|
|
44
|
+
export interface ListPaymentLinksParams {
|
|
45
|
+
page?: number;
|
|
46
|
+
per_page?: number;
|
|
47
|
+
status?: string[];
|
|
48
|
+
sort_by?: string;
|
|
49
|
+
}
|
|
50
|
+
export interface ListPaymentLinksResponse {
|
|
51
|
+
payment_links: PaymentLink[];
|
|
52
|
+
meta: PaginationMeta;
|
|
53
|
+
}
|
|
54
|
+
export interface PaymentLinkResponse {
|
|
55
|
+
payment_link: PaymentLink;
|
|
56
|
+
}
|
|
57
|
+
export interface PaymentLinkPayment {
|
|
58
|
+
id: string;
|
|
59
|
+
status: string;
|
|
60
|
+
amount: PaymentLinkAmount;
|
|
61
|
+
created_at: string;
|
|
62
|
+
}
|
|
63
|
+
export interface ListPaymentsResponse {
|
|
64
|
+
payments: PaymentLinkPayment[];
|
|
65
|
+
meta: PaginationMeta;
|
|
66
|
+
}
|
|
67
|
+
export declare class PaymentLinksResource {
|
|
68
|
+
private readonly http;
|
|
69
|
+
constructor(http: AxiosInstance);
|
|
70
|
+
/**
|
|
71
|
+
* Retrieves a list of payment links.
|
|
72
|
+
* GET /v2/payment_links
|
|
73
|
+
*/
|
|
74
|
+
list(params?: ListPaymentLinksParams): Promise<ListPaymentLinksResponse>;
|
|
75
|
+
/**
|
|
76
|
+
* Retrieves a specific payment link.
|
|
77
|
+
* GET /v2/payment_links/:id
|
|
78
|
+
*/
|
|
79
|
+
retrieve(id: string): Promise<PaymentLinkResponse>;
|
|
80
|
+
/**
|
|
81
|
+
* Create a payment link.
|
|
82
|
+
* Supports either Basket (items, reusable) or Invoice (invoice_id, amount, debitor_name, invoice_number) configurations.
|
|
83
|
+
* POST /v2/payment_links
|
|
84
|
+
*/
|
|
85
|
+
create(data: CreatePaymentLinkParams): Promise<PaymentLinkResponse>;
|
|
86
|
+
/**
|
|
87
|
+
* Deactivate a payment link.
|
|
88
|
+
* PATCH /v2/payment_links/:id/deactivate
|
|
89
|
+
*/
|
|
90
|
+
deactivate(id: string): Promise<PaymentLinkResponse>;
|
|
91
|
+
/**
|
|
92
|
+
* List payments generated from a specific payment link.
|
|
93
|
+
* GET /v2/payment_links/:id/payments
|
|
94
|
+
*/
|
|
95
|
+
listPayments(id: string, params?: ListPaymentLinksParams): Promise<ListPaymentsResponse>;
|
|
96
|
+
}
|
|
97
|
+
//# sourceMappingURL=paymentLinks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paymentLinks.d.ts","sourceRoot":"","sources":["../../src/resources/paymentLinks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAEhD,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU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AAwB;IACvC,aAAa,EAAE,WAAW,EAAE,CAAC;IAC7B,IAAI,EAAE,cAAc,CAAC;CACtB;AAED,MAAM,WAAW,mBAAmB;IAClC,YAAY,EAAE,WAAW,CAAC;CAC3B;AAED,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MAAM,CAAC;IAEX,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,iBAAiB,CAAC;IAC1B,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,kBAAkB,EAAE,CAAC;IAC/B,IAAI,EAAE,cAAc,CAAC;CACtB;AAED,qBAAa,oBAAoB;IACnB,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAAJ,IAAI,EAAE,aAAa;IAEhD;;;OAGG;IACG,IAAI,CAAC,MAAM,CAAC,EAAE,sBAAsB,GAAG,OAAO,CAAC,wBAAwB,CAAC;IAK9E;;;OAGG;IACG,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAKxD;;;;OAIG;IACG,MAAM,CAAC,IAAI,EAAE,uBAAuB,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAKzE;;;OAGG;IACG,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAK1D;;;OAGG;IACG,YAAY,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,sBAAsB,GAAG,OAAO,CAAC,oBAAoB,CAAC;CAI/F"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PaymentLinksResource = void 0;
|
|
4
|
+
class PaymentLinksResource {
|
|
5
|
+
constructor(http) {
|
|
6
|
+
this.http = http;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Retrieves a list of payment links.
|
|
10
|
+
* GET /v2/payment_links
|
|
11
|
+
*/
|
|
12
|
+
async list(params) {
|
|
13
|
+
const response = await this.http.get('/v2/payment_links', { params });
|
|
14
|
+
return response.data;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Retrieves a specific payment link.
|
|
18
|
+
* GET /v2/payment_links/:id
|
|
19
|
+
*/
|
|
20
|
+
async retrieve(id) {
|
|
21
|
+
const response = await this.http.get(`/v2/payment_links/${id}`);
|
|
22
|
+
return response.data;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Create a payment link.
|
|
26
|
+
* Supports either Basket (items, reusable) or Invoice (invoice_id, amount, debitor_name, invoice_number) configurations.
|
|
27
|
+
* POST /v2/payment_links
|
|
28
|
+
*/
|
|
29
|
+
async create(data) {
|
|
30
|
+
const response = await this.http.post('/v2/payment_links', { payment_link: data });
|
|
31
|
+
return response.data;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Deactivate a payment link.
|
|
35
|
+
* PATCH /v2/payment_links/:id/deactivate
|
|
36
|
+
*/
|
|
37
|
+
async deactivate(id) {
|
|
38
|
+
const response = await this.http.patch(`/v2/payment_links/${id}/deactivate`);
|
|
39
|
+
return response.data;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* List payments generated from a specific payment link.
|
|
43
|
+
* GET /v2/payment_links/:id/payments
|
|
44
|
+
*/
|
|
45
|
+
async listPayments(id, params) {
|
|
46
|
+
const response = await this.http.get(`/v2/payment_links/${id}/payments`, { params });
|
|
47
|
+
return response.data;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
exports.PaymentLinksResource = PaymentLinksResource;
|
|
51
|
+
//# sourceMappingURL=paymentLinks.js.map
|