@morabr/mora-sdk 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +32 -0
- package/dist/cjs/api/api.js +491 -0
- package/dist/cjs/index.js +21 -0
- package/dist/cjs/interfaces.js +2 -0
- package/dist/cjs/sdk.js +353 -0
- package/dist/esm/api/api.js +485 -0
- package/dist/esm/index.js +3 -0
- package/dist/esm/interfaces.js +1 -0
- package/dist/esm/sdk.js +324 -0
- package/dist/types/api/api.d.ts +925 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/interfaces.d.ts +22 -0
- package/dist/types/sdk.d.ts +45 -0
- package/dist/umd/index.ts +28464 -0
- package/package.json +106 -0
|
@@ -0,0 +1,925 @@
|
|
|
1
|
+
export interface AddWithdrawalAccountDto {
|
|
2
|
+
/** @example {"key":"00000000000"} */
|
|
3
|
+
accountInfo: object;
|
|
4
|
+
/**
|
|
5
|
+
* @default "pix"
|
|
6
|
+
* @example "pix"
|
|
7
|
+
*/
|
|
8
|
+
type: WithdrawalAccountTypeEnum;
|
|
9
|
+
}
|
|
10
|
+
export interface AddressDto {
|
|
11
|
+
city: string;
|
|
12
|
+
complement?: string | null;
|
|
13
|
+
number?: string | null;
|
|
14
|
+
postalCode: string;
|
|
15
|
+
province: string;
|
|
16
|
+
state: string;
|
|
17
|
+
street: string;
|
|
18
|
+
}
|
|
19
|
+
export interface ChargeItemEntityDto {
|
|
20
|
+
/** @example 99.99 */
|
|
21
|
+
amount: number;
|
|
22
|
+
/** @format uuid */
|
|
23
|
+
chargeId: string;
|
|
24
|
+
/** @format date-time */
|
|
25
|
+
createdAt: string;
|
|
26
|
+
/** @example null */
|
|
27
|
+
description: string | null;
|
|
28
|
+
/** @format uuid */
|
|
29
|
+
id: string;
|
|
30
|
+
/** @example "Charge of contract #00001" */
|
|
31
|
+
name: string;
|
|
32
|
+
/** @format uuid */
|
|
33
|
+
tenantId: string;
|
|
34
|
+
/** @format date-time */
|
|
35
|
+
updatedAt: string;
|
|
36
|
+
}
|
|
37
|
+
export declare enum ChargeStatusEnum {
|
|
38
|
+
Pending = "pending",
|
|
39
|
+
Processing = "processing",
|
|
40
|
+
Paid = "paid"
|
|
41
|
+
}
|
|
42
|
+
export interface CreditCardDto {
|
|
43
|
+
/** @example 1 */
|
|
44
|
+
expiryMonth: number;
|
|
45
|
+
/** @example 1 */
|
|
46
|
+
expiryYear: number;
|
|
47
|
+
holderName: string;
|
|
48
|
+
/** @example 1 */
|
|
49
|
+
installments?: number;
|
|
50
|
+
number: string;
|
|
51
|
+
securityCode: string;
|
|
52
|
+
}
|
|
53
|
+
export interface HttpExceptionDto {
|
|
54
|
+
/** @example null */
|
|
55
|
+
data?: object;
|
|
56
|
+
/** @example "Something went wrong" */
|
|
57
|
+
errorCode?: string;
|
|
58
|
+
errors: string[];
|
|
59
|
+
/** @example "Something went wrong" */
|
|
60
|
+
message: object;
|
|
61
|
+
/** @example "/api/foo/bar" */
|
|
62
|
+
path: string;
|
|
63
|
+
/** @example 500 */
|
|
64
|
+
statusCode: number;
|
|
65
|
+
/** @example "2022-07-25T17:24:07.042Z" */
|
|
66
|
+
timestamp: string;
|
|
67
|
+
}
|
|
68
|
+
export type Map = object;
|
|
69
|
+
export declare enum OrderByEnum {
|
|
70
|
+
ASC = "ASC",
|
|
71
|
+
DESC = "DESC"
|
|
72
|
+
}
|
|
73
|
+
export interface PaginationLinksDto {
|
|
74
|
+
/** @example "http://example.com?page=1" */
|
|
75
|
+
first?: string;
|
|
76
|
+
/** @example "http://example.com?page=3" */
|
|
77
|
+
last?: string;
|
|
78
|
+
/** @example "http://example.com?page=2" */
|
|
79
|
+
next?: string;
|
|
80
|
+
/** @example "http://example.com?page=1" */
|
|
81
|
+
prev?: string;
|
|
82
|
+
}
|
|
83
|
+
export interface PaginationMetaDto {
|
|
84
|
+
/** @example 1 */
|
|
85
|
+
currentPage: number;
|
|
86
|
+
/** @example 1 */
|
|
87
|
+
itemCount: number;
|
|
88
|
+
/** @example 1 */
|
|
89
|
+
itemsPerPage: number;
|
|
90
|
+
/** @example 1 */
|
|
91
|
+
totalItems?: number;
|
|
92
|
+
/** @example 1 */
|
|
93
|
+
totalPages?: number;
|
|
94
|
+
}
|
|
95
|
+
export interface PayChargeDto {
|
|
96
|
+
creditCard?: CreditCardDto | null;
|
|
97
|
+
/** @example "pix" */
|
|
98
|
+
paymentMethod: PaymentMethodEnum;
|
|
99
|
+
}
|
|
100
|
+
export declare enum PaymentMethodEnum {
|
|
101
|
+
Pix = "pix",
|
|
102
|
+
CreditCard = "credit_card"
|
|
103
|
+
}
|
|
104
|
+
export interface PublicChargeEntityDto {
|
|
105
|
+
/** @example 99.99 */
|
|
106
|
+
amount: number;
|
|
107
|
+
/** @example "Charge of contract #00001" */
|
|
108
|
+
description: string;
|
|
109
|
+
/** @format date-time */
|
|
110
|
+
dueDate: string;
|
|
111
|
+
/** @format uuid */
|
|
112
|
+
id: string;
|
|
113
|
+
/** @example false */
|
|
114
|
+
isProtested: boolean;
|
|
115
|
+
/** @format date-time */
|
|
116
|
+
paymentDate?: string | null;
|
|
117
|
+
/** @example "paid" */
|
|
118
|
+
status: ChargeStatusEnum;
|
|
119
|
+
}
|
|
120
|
+
export interface PublicChargeEntityPaginatedDto {
|
|
121
|
+
items: PublicChargeEntityDto[];
|
|
122
|
+
links?: PaginationLinksDto;
|
|
123
|
+
meta: PaginationMetaDto;
|
|
124
|
+
}
|
|
125
|
+
export interface PublicChargeItemEntityDto {
|
|
126
|
+
/** @example 99.99 */
|
|
127
|
+
amount: number;
|
|
128
|
+
/** @example null */
|
|
129
|
+
description: string | null;
|
|
130
|
+
/** @example "Charge of contract #00001" */
|
|
131
|
+
name: string;
|
|
132
|
+
}
|
|
133
|
+
export interface PublicFullChargeEntityDto {
|
|
134
|
+
/** @example 99.99 */
|
|
135
|
+
amount: number;
|
|
136
|
+
/** @example "Charge of contract #00001" */
|
|
137
|
+
description: string;
|
|
138
|
+
/** @format date-time */
|
|
139
|
+
dueDate: string;
|
|
140
|
+
/** @format uuid */
|
|
141
|
+
id: string;
|
|
142
|
+
/** @example false */
|
|
143
|
+
isProtested: boolean;
|
|
144
|
+
items: PublicChargeItemEntityDto[];
|
|
145
|
+
/** @format date-time */
|
|
146
|
+
paymentDate?: string | null;
|
|
147
|
+
/** @example "paid" */
|
|
148
|
+
status: ChargeStatusEnum;
|
|
149
|
+
tenant: PublicTenantInfoDto;
|
|
150
|
+
}
|
|
151
|
+
export interface PublicTenantInfoDto {
|
|
152
|
+
/** @example "Company A" */
|
|
153
|
+
name: string;
|
|
154
|
+
}
|
|
155
|
+
export interface RequestPasswordResetDto {
|
|
156
|
+
email: string;
|
|
157
|
+
/** @format uuid */
|
|
158
|
+
tenantId: string;
|
|
159
|
+
}
|
|
160
|
+
export interface ResetPasswordDto {
|
|
161
|
+
/** @example "user@example.com" */
|
|
162
|
+
email: string;
|
|
163
|
+
/**
|
|
164
|
+
* Password should include lowercase, uppercase and digits and have between 8 and 32 digits
|
|
165
|
+
* @example "P@ssw0rd"
|
|
166
|
+
*/
|
|
167
|
+
password: string;
|
|
168
|
+
/** @example "P@ssw0rd" */
|
|
169
|
+
passwordConfirmation: string;
|
|
170
|
+
/** @format uuid */
|
|
171
|
+
tenantId: string;
|
|
172
|
+
token: string;
|
|
173
|
+
}
|
|
174
|
+
export interface SigninDto {
|
|
175
|
+
/** @example "user@example.com" */
|
|
176
|
+
email: string;
|
|
177
|
+
/** @example "P@ssw0rd" */
|
|
178
|
+
password: string;
|
|
179
|
+
/** @format uuid */
|
|
180
|
+
tenantId: string;
|
|
181
|
+
}
|
|
182
|
+
export interface SigninResponseDto {
|
|
183
|
+
token: string;
|
|
184
|
+
user: UserEntityDto;
|
|
185
|
+
}
|
|
186
|
+
export declare enum TenantRoleEnum {
|
|
187
|
+
Operator = "operator",
|
|
188
|
+
Admin = "admin",
|
|
189
|
+
Owner = "owner",
|
|
190
|
+
Receiver = "receiver"
|
|
191
|
+
}
|
|
192
|
+
export declare enum TenantUserStatusEnum {
|
|
193
|
+
Enabled = "enabled",
|
|
194
|
+
Blocked = "blocked"
|
|
195
|
+
}
|
|
196
|
+
export interface UserEntityDto {
|
|
197
|
+
address: AddressDto;
|
|
198
|
+
/** @format date-time */
|
|
199
|
+
birthDate?: string | null;
|
|
200
|
+
/** @format date-time */
|
|
201
|
+
createdAt: string;
|
|
202
|
+
documentNumber: string;
|
|
203
|
+
email: string;
|
|
204
|
+
/** @format uuid */
|
|
205
|
+
id: string;
|
|
206
|
+
name: string | null;
|
|
207
|
+
phone: string;
|
|
208
|
+
roles: TenantRoleEnum[];
|
|
209
|
+
/** @example "enabled" */
|
|
210
|
+
status: TenantUserStatusEnum;
|
|
211
|
+
/** @format uuid */
|
|
212
|
+
tenantId: string;
|
|
213
|
+
/** @format date-time */
|
|
214
|
+
updatedAt: string;
|
|
215
|
+
}
|
|
216
|
+
export interface UserEntityPaginatedDto {
|
|
217
|
+
items: UserEntityDto[];
|
|
218
|
+
links?: PaginationLinksDto;
|
|
219
|
+
meta: PaginationMetaDto;
|
|
220
|
+
}
|
|
221
|
+
export interface WithdrawalAccountEntityDto {
|
|
222
|
+
/** @example {"key":"00000000000"} */
|
|
223
|
+
accountInfo?: object;
|
|
224
|
+
/** @format date-time */
|
|
225
|
+
createdAt?: string;
|
|
226
|
+
/** @format uuid */
|
|
227
|
+
id: string;
|
|
228
|
+
/** @format uuid */
|
|
229
|
+
tenantId: string;
|
|
230
|
+
/** @example "pix" */
|
|
231
|
+
type: WithdrawalAccountTypeEnum;
|
|
232
|
+
/** @format date-time */
|
|
233
|
+
updatedAt?: string;
|
|
234
|
+
/** @format uuid */
|
|
235
|
+
userId: string;
|
|
236
|
+
}
|
|
237
|
+
export interface WithdrawalAccountEntityPaginatedDto {
|
|
238
|
+
items: WithdrawalAccountEntityDto[];
|
|
239
|
+
links?: PaginationLinksDto;
|
|
240
|
+
meta: PaginationMetaDto;
|
|
241
|
+
}
|
|
242
|
+
export declare enum WithdrawalAccountTypeEnum {
|
|
243
|
+
Pix = "pix"
|
|
244
|
+
}
|
|
245
|
+
export declare namespace Webhooks {
|
|
246
|
+
/**
|
|
247
|
+
* @description Receives ASAAS events webhooks to validate and sync states
|
|
248
|
+
* @tags Integration Webhooks
|
|
249
|
+
* @name ReceiveAsaasEventWebhook
|
|
250
|
+
* @request POST:/webhooks/asaas/events
|
|
251
|
+
* @secure
|
|
252
|
+
* @response `200` `void`
|
|
253
|
+
* @response `403` `void` Invalid ASAAS access token
|
|
254
|
+
*/
|
|
255
|
+
namespace ReceiveAsaasEventWebhook {
|
|
256
|
+
type RequestParams = {};
|
|
257
|
+
type RequestQuery = {};
|
|
258
|
+
type RequestBody = Map;
|
|
259
|
+
type RequestHeaders = {
|
|
260
|
+
/** ASAAS webhook configured accessToken */
|
|
261
|
+
"asaas-access-token": string;
|
|
262
|
+
};
|
|
263
|
+
type ResponseBody = void;
|
|
264
|
+
}
|
|
265
|
+
/**
|
|
266
|
+
* @description Receives ASAAS webhooks to validate withdraws on receiver account
|
|
267
|
+
* @tags Integration Webhooks
|
|
268
|
+
* @name ReceiveAsaasWithdrawValidationWebhook
|
|
269
|
+
* @request POST:/webhooks/asaas/withdraw-validation
|
|
270
|
+
* @secure
|
|
271
|
+
* @response `200` `void`
|
|
272
|
+
* @response `403` `void` Invalid ASAAS access token
|
|
273
|
+
*/
|
|
274
|
+
namespace ReceiveAsaasWithdrawValidationWebhook {
|
|
275
|
+
type RequestParams = {};
|
|
276
|
+
type RequestQuery = {};
|
|
277
|
+
type RequestBody = Map;
|
|
278
|
+
type RequestHeaders = {
|
|
279
|
+
/** ASAAS webhook configured accessToken */
|
|
280
|
+
"asaas-access-token": string;
|
|
281
|
+
};
|
|
282
|
+
type ResponseBody = void;
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
export declare namespace Tenants {
|
|
286
|
+
/**
|
|
287
|
+
* No description
|
|
288
|
+
* @tags Users Withdrawal Accounts
|
|
289
|
+
* @name AddUserWithdrawalAccount
|
|
290
|
+
* @request POST:/tenants/{tenantId}/users/{userId}/withdrawal-accounts
|
|
291
|
+
* @secure
|
|
292
|
+
* @response `201` `WithdrawalAccountEntityDto`
|
|
293
|
+
* @response `403` `HttpExceptionDto` You're not enabled to make this operation.
|
|
294
|
+
*/
|
|
295
|
+
namespace AddUserWithdrawalAccount {
|
|
296
|
+
type RequestParams = {
|
|
297
|
+
tenantId: string;
|
|
298
|
+
userId: string;
|
|
299
|
+
};
|
|
300
|
+
type RequestQuery = {};
|
|
301
|
+
type RequestBody = AddWithdrawalAccountDto;
|
|
302
|
+
type RequestHeaders = {};
|
|
303
|
+
type ResponseBody = WithdrawalAccountEntityDto;
|
|
304
|
+
}
|
|
305
|
+
/**
|
|
306
|
+
* No description
|
|
307
|
+
* @tags Users Withdrawal Accounts
|
|
308
|
+
* @name DeleteUserWithdrawalAccount
|
|
309
|
+
* @request DELETE:/tenants/{tenantId}/users/{userId}/withdrawal-accounts/{accountId}
|
|
310
|
+
* @secure
|
|
311
|
+
* @response `204` `void`
|
|
312
|
+
* @response `403` `HttpExceptionDto` You're not enabled to make this operation.
|
|
313
|
+
*/
|
|
314
|
+
namespace DeleteUserWithdrawalAccount {
|
|
315
|
+
type RequestParams = {
|
|
316
|
+
accountId: string;
|
|
317
|
+
tenantId: string;
|
|
318
|
+
userId: string;
|
|
319
|
+
};
|
|
320
|
+
type RequestQuery = {};
|
|
321
|
+
type RequestBody = never;
|
|
322
|
+
type RequestHeaders = {};
|
|
323
|
+
type ResponseBody = void;
|
|
324
|
+
}
|
|
325
|
+
/**
|
|
326
|
+
* No description
|
|
327
|
+
* @tags Tenant Users
|
|
328
|
+
* @name DisableTenantUser
|
|
329
|
+
* @request PATCH:/tenants/{tenantId}/users/{userId}/disable
|
|
330
|
+
* @secure
|
|
331
|
+
* @response `204` `void`
|
|
332
|
+
* @response `403` `HttpExceptionDto` Need user with one of these roles: owner
|
|
333
|
+
*/
|
|
334
|
+
namespace DisableTenantUser {
|
|
335
|
+
type RequestParams = {
|
|
336
|
+
tenantId: string;
|
|
337
|
+
userId: string;
|
|
338
|
+
};
|
|
339
|
+
type RequestQuery = {};
|
|
340
|
+
type RequestBody = never;
|
|
341
|
+
type RequestHeaders = {};
|
|
342
|
+
type ResponseBody = void;
|
|
343
|
+
}
|
|
344
|
+
/**
|
|
345
|
+
* No description
|
|
346
|
+
* @tags Tenant Users
|
|
347
|
+
* @name EnableTenantUser
|
|
348
|
+
* @request PATCH:/tenants/{tenantId}/users/{userId}/enable
|
|
349
|
+
* @secure
|
|
350
|
+
* @response `204` `void`
|
|
351
|
+
* @response `403` `HttpExceptionDto` Need user with one of these roles: owner
|
|
352
|
+
*/
|
|
353
|
+
namespace EnableTenantUser {
|
|
354
|
+
type RequestParams = {
|
|
355
|
+
tenantId: string;
|
|
356
|
+
userId: string;
|
|
357
|
+
};
|
|
358
|
+
type RequestQuery = {};
|
|
359
|
+
type RequestBody = never;
|
|
360
|
+
type RequestHeaders = {};
|
|
361
|
+
type ResponseBody = void;
|
|
362
|
+
}
|
|
363
|
+
/**
|
|
364
|
+
* No description
|
|
365
|
+
* @tags Tenant Users
|
|
366
|
+
* @name GetTenantUser
|
|
367
|
+
* @request GET:/tenants/{tenantId}/users/{userId}
|
|
368
|
+
* @secure
|
|
369
|
+
* @response `200` `UserEntityDto`
|
|
370
|
+
* @response `403` `HttpExceptionDto` You're not enabled to make this operation.
|
|
371
|
+
*/
|
|
372
|
+
namespace GetTenantUser {
|
|
373
|
+
type RequestParams = {
|
|
374
|
+
tenantId: string;
|
|
375
|
+
userId: string;
|
|
376
|
+
};
|
|
377
|
+
type RequestQuery = {};
|
|
378
|
+
type RequestBody = never;
|
|
379
|
+
type RequestHeaders = {};
|
|
380
|
+
type ResponseBody = UserEntityDto;
|
|
381
|
+
}
|
|
382
|
+
/**
|
|
383
|
+
* No description
|
|
384
|
+
* @tags Users Withdrawal Accounts
|
|
385
|
+
* @name GetUserWithdrawalAccountById
|
|
386
|
+
* @request GET:/tenants/{tenantId}/users/{userId}/withdrawal-accounts/{accountId}
|
|
387
|
+
* @secure
|
|
388
|
+
* @response `200` `WithdrawalAccountEntityDto`
|
|
389
|
+
* @response `403` `HttpExceptionDto` You're not enabled to make this operation.
|
|
390
|
+
*/
|
|
391
|
+
namespace GetUserWithdrawalAccountById {
|
|
392
|
+
type RequestParams = {
|
|
393
|
+
accountId: string;
|
|
394
|
+
tenantId: string;
|
|
395
|
+
userId: string;
|
|
396
|
+
};
|
|
397
|
+
type RequestQuery = {};
|
|
398
|
+
type RequestBody = never;
|
|
399
|
+
type RequestHeaders = {};
|
|
400
|
+
type ResponseBody = WithdrawalAccountEntityDto;
|
|
401
|
+
}
|
|
402
|
+
/**
|
|
403
|
+
* No description
|
|
404
|
+
* @tags Tenant Users
|
|
405
|
+
* @name ListTenantUsers
|
|
406
|
+
* @request GET:/tenants/{tenantId}/users
|
|
407
|
+
* @secure
|
|
408
|
+
* @response `200` `UserEntityPaginatedDto`
|
|
409
|
+
* @response `403` `HttpExceptionDto` Need user with one of these roles: owner, admin, operator
|
|
410
|
+
*/
|
|
411
|
+
namespace ListTenantUsers {
|
|
412
|
+
type RequestParams = {
|
|
413
|
+
tenantId: string;
|
|
414
|
+
};
|
|
415
|
+
type RequestQuery = {
|
|
416
|
+
createdAt?: string;
|
|
417
|
+
/**
|
|
418
|
+
* @default 10
|
|
419
|
+
* @example 10
|
|
420
|
+
*/
|
|
421
|
+
limit?: number;
|
|
422
|
+
orderBy?: OrderByEnum;
|
|
423
|
+
/**
|
|
424
|
+
* @default 1
|
|
425
|
+
* @example 1
|
|
426
|
+
*/
|
|
427
|
+
page?: number;
|
|
428
|
+
roles?: TenantRoleEnum[];
|
|
429
|
+
search?: string;
|
|
430
|
+
sortBy?: string[];
|
|
431
|
+
status?: TenantUserStatusEnum[];
|
|
432
|
+
};
|
|
433
|
+
type RequestBody = never;
|
|
434
|
+
type RequestHeaders = {};
|
|
435
|
+
type ResponseBody = UserEntityPaginatedDto;
|
|
436
|
+
}
|
|
437
|
+
/**
|
|
438
|
+
* No description
|
|
439
|
+
* @tags Users Withdrawal Accounts
|
|
440
|
+
* @name ListUserWithdrawalAccounts
|
|
441
|
+
* @request GET:/tenants/{tenantId}/users/{userId}/withdrawal-accounts
|
|
442
|
+
* @secure
|
|
443
|
+
* @response `200` `WithdrawalAccountEntityPaginatedDto`
|
|
444
|
+
* @response `403` `HttpExceptionDto` You're not enabled to make this operation.
|
|
445
|
+
*/
|
|
446
|
+
namespace ListUserWithdrawalAccounts {
|
|
447
|
+
type RequestParams = {
|
|
448
|
+
tenantId: string;
|
|
449
|
+
userId: string;
|
|
450
|
+
};
|
|
451
|
+
type RequestQuery = {
|
|
452
|
+
createdAt?: string;
|
|
453
|
+
/**
|
|
454
|
+
* @default 10
|
|
455
|
+
* @example 10
|
|
456
|
+
*/
|
|
457
|
+
limit?: number;
|
|
458
|
+
orderBy?: OrderByEnum;
|
|
459
|
+
/**
|
|
460
|
+
* @default 1
|
|
461
|
+
* @example 1
|
|
462
|
+
*/
|
|
463
|
+
page?: number;
|
|
464
|
+
search?: string;
|
|
465
|
+
sortBy?: string[];
|
|
466
|
+
};
|
|
467
|
+
type RequestBody = never;
|
|
468
|
+
type RequestHeaders = {};
|
|
469
|
+
type ResponseBody = WithdrawalAccountEntityPaginatedDto;
|
|
470
|
+
}
|
|
471
|
+
/**
|
|
472
|
+
* No description
|
|
473
|
+
* @tags Integration Webhooks
|
|
474
|
+
* @name ReceiveStatusCallback
|
|
475
|
+
* @request POST:/tenants/{tenantId}/webhooks/twilio/message-status
|
|
476
|
+
* @secure
|
|
477
|
+
* @response `200` `void`
|
|
478
|
+
*/
|
|
479
|
+
namespace ReceiveStatusCallback {
|
|
480
|
+
type RequestParams = {
|
|
481
|
+
tenantId: string;
|
|
482
|
+
};
|
|
483
|
+
type RequestQuery = {};
|
|
484
|
+
type RequestBody = Map;
|
|
485
|
+
type RequestHeaders = {};
|
|
486
|
+
type ResponseBody = void;
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
export declare namespace Public {
|
|
490
|
+
/**
|
|
491
|
+
* No description
|
|
492
|
+
* @tags [Public] Tenant Charges
|
|
493
|
+
* @name GetPublicChargeById
|
|
494
|
+
* @request GET:/public/tenants/{tenantId}/charges/{document}/{chargeId}
|
|
495
|
+
* @secure
|
|
496
|
+
* @response `200` `PublicFullChargeEntityDto`
|
|
497
|
+
*/
|
|
498
|
+
namespace GetPublicChargeById {
|
|
499
|
+
type RequestParams = {
|
|
500
|
+
chargeId: string;
|
|
501
|
+
document: string;
|
|
502
|
+
tenantId: string;
|
|
503
|
+
};
|
|
504
|
+
type RequestQuery = {};
|
|
505
|
+
type RequestBody = never;
|
|
506
|
+
type RequestHeaders = {};
|
|
507
|
+
type ResponseBody = PublicFullChargeEntityDto;
|
|
508
|
+
}
|
|
509
|
+
/**
|
|
510
|
+
* No description
|
|
511
|
+
* @tags [Public] Tenant Charges
|
|
512
|
+
* @name ListPublicChargesByDocument
|
|
513
|
+
* @request GET:/public/tenants/{tenantId}/charges/{document}
|
|
514
|
+
* @secure
|
|
515
|
+
* @response `200` `PublicChargeEntityPaginatedDto`
|
|
516
|
+
*/
|
|
517
|
+
namespace ListPublicChargesByDocument {
|
|
518
|
+
type RequestParams = {
|
|
519
|
+
document: string;
|
|
520
|
+
tenantId: string;
|
|
521
|
+
};
|
|
522
|
+
type RequestQuery = {
|
|
523
|
+
createdAt?: string;
|
|
524
|
+
/**
|
|
525
|
+
* @default 10
|
|
526
|
+
* @example 10
|
|
527
|
+
*/
|
|
528
|
+
limit?: number;
|
|
529
|
+
orderBy?: OrderByEnum;
|
|
530
|
+
/**
|
|
531
|
+
* @default 1
|
|
532
|
+
* @example 1
|
|
533
|
+
*/
|
|
534
|
+
page?: number;
|
|
535
|
+
sortBy?: string[];
|
|
536
|
+
};
|
|
537
|
+
type RequestBody = never;
|
|
538
|
+
type RequestHeaders = {};
|
|
539
|
+
type ResponseBody = PublicChargeEntityPaginatedDto;
|
|
540
|
+
}
|
|
541
|
+
/**
|
|
542
|
+
* No description
|
|
543
|
+
* @tags [Public] Tenant Charges
|
|
544
|
+
* @name PayCharge
|
|
545
|
+
* @request POST:/public/tenants/{tenantId}/charges/{document}/{chargeId}/pay
|
|
546
|
+
* @secure
|
|
547
|
+
* @response `200` `PublicFullChargeEntityDto`
|
|
548
|
+
*/
|
|
549
|
+
namespace PayCharge {
|
|
550
|
+
type RequestParams = {
|
|
551
|
+
chargeId: string;
|
|
552
|
+
document: string;
|
|
553
|
+
tenantId: string;
|
|
554
|
+
};
|
|
555
|
+
type RequestQuery = {};
|
|
556
|
+
type RequestBody = PayChargeDto;
|
|
557
|
+
type RequestHeaders = {};
|
|
558
|
+
type ResponseBody = PublicFullChargeEntityDto;
|
|
559
|
+
}
|
|
560
|
+
}
|
|
561
|
+
export declare namespace Auth {
|
|
562
|
+
/**
|
|
563
|
+
* No description
|
|
564
|
+
* @tags Authentication
|
|
565
|
+
* @name Logout
|
|
566
|
+
* @request POST:/auth/logout
|
|
567
|
+
* @secure
|
|
568
|
+
* @response `204` `void`
|
|
569
|
+
*/
|
|
570
|
+
namespace Logout {
|
|
571
|
+
type RequestParams = {};
|
|
572
|
+
type RequestQuery = {};
|
|
573
|
+
type RequestBody = never;
|
|
574
|
+
type RequestHeaders = {};
|
|
575
|
+
type ResponseBody = void;
|
|
576
|
+
}
|
|
577
|
+
/**
|
|
578
|
+
* No description
|
|
579
|
+
* @tags Authentication
|
|
580
|
+
* @name RequestPasswordReset
|
|
581
|
+
* @request POST:/auth/request-password-reset
|
|
582
|
+
* @secure
|
|
583
|
+
* @response `204` `void`
|
|
584
|
+
*/
|
|
585
|
+
namespace RequestPasswordReset {
|
|
586
|
+
type RequestParams = {};
|
|
587
|
+
type RequestQuery = {};
|
|
588
|
+
type RequestBody = RequestPasswordResetDto;
|
|
589
|
+
type RequestHeaders = {};
|
|
590
|
+
type ResponseBody = void;
|
|
591
|
+
}
|
|
592
|
+
/**
|
|
593
|
+
* No description
|
|
594
|
+
* @tags Authentication
|
|
595
|
+
* @name ResetPassword
|
|
596
|
+
* @request PATCH:/auth/reset-password
|
|
597
|
+
* @secure
|
|
598
|
+
* @response `200` `SigninResponseDto`
|
|
599
|
+
*/
|
|
600
|
+
namespace ResetPassword {
|
|
601
|
+
type RequestParams = {};
|
|
602
|
+
type RequestQuery = {};
|
|
603
|
+
type RequestBody = ResetPasswordDto;
|
|
604
|
+
type RequestHeaders = {};
|
|
605
|
+
type ResponseBody = SigninResponseDto;
|
|
606
|
+
}
|
|
607
|
+
/**
|
|
608
|
+
* No description
|
|
609
|
+
* @tags Authentication
|
|
610
|
+
* @name SignIn
|
|
611
|
+
* @request POST:/auth/signin
|
|
612
|
+
* @secure
|
|
613
|
+
* @response `200` `SigninResponseDto`
|
|
614
|
+
*/
|
|
615
|
+
namespace SignIn {
|
|
616
|
+
type RequestParams = {};
|
|
617
|
+
type RequestQuery = {};
|
|
618
|
+
type RequestBody = SigninDto;
|
|
619
|
+
type RequestHeaders = {};
|
|
620
|
+
type ResponseBody = SigninResponseDto;
|
|
621
|
+
}
|
|
622
|
+
}
|
|
623
|
+
import type { AxiosInstance, AxiosRequestConfig, ResponseType } from "axios";
|
|
624
|
+
export type QueryParamsType = Record<string | number, any>;
|
|
625
|
+
export interface FullRequestParams extends Omit<AxiosRequestConfig, "data" | "params" | "url" | "responseType"> {
|
|
626
|
+
/** set parameter to `true` for call `securityWorker` for this request */
|
|
627
|
+
secure?: boolean;
|
|
628
|
+
/** request path */
|
|
629
|
+
path: string;
|
|
630
|
+
/** content type of request body */
|
|
631
|
+
type?: ContentType;
|
|
632
|
+
/** query params */
|
|
633
|
+
query?: QueryParamsType;
|
|
634
|
+
/** format of response (i.e. response.json() -> format: "json") */
|
|
635
|
+
format?: ResponseType;
|
|
636
|
+
/** request body */
|
|
637
|
+
body?: unknown;
|
|
638
|
+
}
|
|
639
|
+
export type RequestParams = Omit<FullRequestParams, "body" | "method" | "query" | "path">;
|
|
640
|
+
export interface ApiConfig<SecurityDataType = unknown> extends Omit<AxiosRequestConfig, "data" | "cancelToken"> {
|
|
641
|
+
securityWorker?: (securityData: SecurityDataType | null) => Promise<AxiosRequestConfig | void> | AxiosRequestConfig | void;
|
|
642
|
+
secure?: boolean;
|
|
643
|
+
format?: ResponseType;
|
|
644
|
+
}
|
|
645
|
+
export declare enum ContentType {
|
|
646
|
+
Json = "application/json",
|
|
647
|
+
JsonApi = "application/vnd.api+json",
|
|
648
|
+
FormData = "multipart/form-data",
|
|
649
|
+
UrlEncoded = "application/x-www-form-urlencoded",
|
|
650
|
+
Text = "text/plain"
|
|
651
|
+
}
|
|
652
|
+
export declare class HttpClient<SecurityDataType = unknown> {
|
|
653
|
+
instance: AxiosInstance;
|
|
654
|
+
private securityData;
|
|
655
|
+
private securityWorker?;
|
|
656
|
+
private secure?;
|
|
657
|
+
private format?;
|
|
658
|
+
constructor({ securityWorker, secure, format, ...axiosConfig }?: ApiConfig<SecurityDataType>);
|
|
659
|
+
setSecurityData: (data: SecurityDataType | null) => void;
|
|
660
|
+
protected mergeRequestParams(params1: AxiosRequestConfig, params2?: AxiosRequestConfig): AxiosRequestConfig;
|
|
661
|
+
protected stringifyFormItem(formItem: unknown): string;
|
|
662
|
+
protected createFormData(input: Record<string, unknown>): FormData;
|
|
663
|
+
request: <T = any, _E = any>({ secure, path, type, query, format, body, ...params }: FullRequestParams) => Promise<T>;
|
|
664
|
+
}
|
|
665
|
+
/**
|
|
666
|
+
* @title mora-backend
|
|
667
|
+
* @version 0.0.1
|
|
668
|
+
* @baseUrl http://localhost:3000
|
|
669
|
+
* @contact
|
|
670
|
+
*/
|
|
671
|
+
export declare class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDataType> {
|
|
672
|
+
/**
|
|
673
|
+
* No description
|
|
674
|
+
*
|
|
675
|
+
* @tags App
|
|
676
|
+
* @name Index
|
|
677
|
+
* @request GET:/
|
|
678
|
+
* @response `200` `void`
|
|
679
|
+
*/
|
|
680
|
+
index: (params?: RequestParams) => Promise<void>;
|
|
681
|
+
webhooks: {
|
|
682
|
+
/**
|
|
683
|
+
* @description Receives ASAAS events webhooks to validate and sync states
|
|
684
|
+
*
|
|
685
|
+
* @tags Integration Webhooks
|
|
686
|
+
* @name ReceiveAsaasEventWebhook
|
|
687
|
+
* @request POST:/webhooks/asaas/events
|
|
688
|
+
* @secure
|
|
689
|
+
* @response `200` `void`
|
|
690
|
+
* @response `403` `void` Invalid ASAAS access token
|
|
691
|
+
*/
|
|
692
|
+
receiveAsaasEventWebhook: (data: Map, params?: RequestParams) => Promise<void>;
|
|
693
|
+
/**
|
|
694
|
+
* @description Receives ASAAS webhooks to validate withdraws on receiver account
|
|
695
|
+
*
|
|
696
|
+
* @tags Integration Webhooks
|
|
697
|
+
* @name ReceiveAsaasWithdrawValidationWebhook
|
|
698
|
+
* @request POST:/webhooks/asaas/withdraw-validation
|
|
699
|
+
* @secure
|
|
700
|
+
* @response `200` `void`
|
|
701
|
+
* @response `403` `void` Invalid ASAAS access token
|
|
702
|
+
*/
|
|
703
|
+
receiveAsaasWithdrawValidationWebhook: (data: Map, params?: RequestParams) => Promise<void>;
|
|
704
|
+
};
|
|
705
|
+
tenants: {
|
|
706
|
+
/**
|
|
707
|
+
* No description
|
|
708
|
+
*
|
|
709
|
+
* @tags Users Withdrawal Accounts
|
|
710
|
+
* @name AddUserWithdrawalAccount
|
|
711
|
+
* @request POST:/tenants/{tenantId}/users/{userId}/withdrawal-accounts
|
|
712
|
+
* @secure
|
|
713
|
+
* @response `201` `WithdrawalAccountEntityDto`
|
|
714
|
+
* @response `403` `HttpExceptionDto` You're not enabled to make this operation.
|
|
715
|
+
*/
|
|
716
|
+
addUserWithdrawalAccount: (tenantId: string, userId: string, data: AddWithdrawalAccountDto, params?: RequestParams) => Promise<WithdrawalAccountEntityDto>;
|
|
717
|
+
/**
|
|
718
|
+
* No description
|
|
719
|
+
*
|
|
720
|
+
* @tags Users Withdrawal Accounts
|
|
721
|
+
* @name DeleteUserWithdrawalAccount
|
|
722
|
+
* @request DELETE:/tenants/{tenantId}/users/{userId}/withdrawal-accounts/{accountId}
|
|
723
|
+
* @secure
|
|
724
|
+
* @response `204` `void`
|
|
725
|
+
* @response `403` `HttpExceptionDto` You're not enabled to make this operation.
|
|
726
|
+
*/
|
|
727
|
+
deleteUserWithdrawalAccount: (tenantId: string, userId: string, accountId: string, params?: RequestParams) => Promise<void>;
|
|
728
|
+
/**
|
|
729
|
+
* No description
|
|
730
|
+
*
|
|
731
|
+
* @tags Tenant Users
|
|
732
|
+
* @name DisableTenantUser
|
|
733
|
+
* @request PATCH:/tenants/{tenantId}/users/{userId}/disable
|
|
734
|
+
* @secure
|
|
735
|
+
* @response `204` `void`
|
|
736
|
+
* @response `403` `HttpExceptionDto` Need user with one of these roles: owner
|
|
737
|
+
*/
|
|
738
|
+
disableTenantUser: (tenantId: string, userId: string, params?: RequestParams) => Promise<void>;
|
|
739
|
+
/**
|
|
740
|
+
* No description
|
|
741
|
+
*
|
|
742
|
+
* @tags Tenant Users
|
|
743
|
+
* @name EnableTenantUser
|
|
744
|
+
* @request PATCH:/tenants/{tenantId}/users/{userId}/enable
|
|
745
|
+
* @secure
|
|
746
|
+
* @response `204` `void`
|
|
747
|
+
* @response `403` `HttpExceptionDto` Need user with one of these roles: owner
|
|
748
|
+
*/
|
|
749
|
+
enableTenantUser: (tenantId: string, userId: string, params?: RequestParams) => Promise<void>;
|
|
750
|
+
/**
|
|
751
|
+
* No description
|
|
752
|
+
*
|
|
753
|
+
* @tags Tenant Users
|
|
754
|
+
* @name GetTenantUser
|
|
755
|
+
* @request GET:/tenants/{tenantId}/users/{userId}
|
|
756
|
+
* @secure
|
|
757
|
+
* @response `200` `UserEntityDto`
|
|
758
|
+
* @response `403` `HttpExceptionDto` You're not enabled to make this operation.
|
|
759
|
+
*/
|
|
760
|
+
getTenantUser: (tenantId: string, userId: string, params?: RequestParams) => Promise<UserEntityDto>;
|
|
761
|
+
/**
|
|
762
|
+
* No description
|
|
763
|
+
*
|
|
764
|
+
* @tags Users Withdrawal Accounts
|
|
765
|
+
* @name GetUserWithdrawalAccountById
|
|
766
|
+
* @request GET:/tenants/{tenantId}/users/{userId}/withdrawal-accounts/{accountId}
|
|
767
|
+
* @secure
|
|
768
|
+
* @response `200` `WithdrawalAccountEntityDto`
|
|
769
|
+
* @response `403` `HttpExceptionDto` You're not enabled to make this operation.
|
|
770
|
+
*/
|
|
771
|
+
getUserWithdrawalAccountById: (tenantId: string, userId: string, accountId: string, params?: RequestParams) => Promise<WithdrawalAccountEntityDto>;
|
|
772
|
+
/**
|
|
773
|
+
* No description
|
|
774
|
+
*
|
|
775
|
+
* @tags Tenant Users
|
|
776
|
+
* @name ListTenantUsers
|
|
777
|
+
* @request GET:/tenants/{tenantId}/users
|
|
778
|
+
* @secure
|
|
779
|
+
* @response `200` `UserEntityPaginatedDto`
|
|
780
|
+
* @response `403` `HttpExceptionDto` Need user with one of these roles: owner, admin, operator
|
|
781
|
+
*/
|
|
782
|
+
listTenantUsers: (tenantId: string, query?: {
|
|
783
|
+
createdAt?: string;
|
|
784
|
+
/**
|
|
785
|
+
* @default 10
|
|
786
|
+
* @example 10
|
|
787
|
+
*/
|
|
788
|
+
limit?: number;
|
|
789
|
+
orderBy?: OrderByEnum;
|
|
790
|
+
/**
|
|
791
|
+
* @default 1
|
|
792
|
+
* @example 1
|
|
793
|
+
*/
|
|
794
|
+
page?: number;
|
|
795
|
+
roles?: TenantRoleEnum[];
|
|
796
|
+
search?: string;
|
|
797
|
+
sortBy?: string[];
|
|
798
|
+
status?: TenantUserStatusEnum[];
|
|
799
|
+
}, params?: RequestParams) => Promise<UserEntityPaginatedDto>;
|
|
800
|
+
/**
|
|
801
|
+
* No description
|
|
802
|
+
*
|
|
803
|
+
* @tags Users Withdrawal Accounts
|
|
804
|
+
* @name ListUserWithdrawalAccounts
|
|
805
|
+
* @request GET:/tenants/{tenantId}/users/{userId}/withdrawal-accounts
|
|
806
|
+
* @secure
|
|
807
|
+
* @response `200` `WithdrawalAccountEntityPaginatedDto`
|
|
808
|
+
* @response `403` `HttpExceptionDto` You're not enabled to make this operation.
|
|
809
|
+
*/
|
|
810
|
+
listUserWithdrawalAccounts: (tenantId: string, userId: string, query?: {
|
|
811
|
+
createdAt?: string;
|
|
812
|
+
/**
|
|
813
|
+
* @default 10
|
|
814
|
+
* @example 10
|
|
815
|
+
*/
|
|
816
|
+
limit?: number;
|
|
817
|
+
orderBy?: OrderByEnum;
|
|
818
|
+
/**
|
|
819
|
+
* @default 1
|
|
820
|
+
* @example 1
|
|
821
|
+
*/
|
|
822
|
+
page?: number;
|
|
823
|
+
search?: string;
|
|
824
|
+
sortBy?: string[];
|
|
825
|
+
}, params?: RequestParams) => Promise<WithdrawalAccountEntityPaginatedDto>;
|
|
826
|
+
/**
|
|
827
|
+
* No description
|
|
828
|
+
*
|
|
829
|
+
* @tags Integration Webhooks
|
|
830
|
+
* @name ReceiveStatusCallback
|
|
831
|
+
* @request POST:/tenants/{tenantId}/webhooks/twilio/message-status
|
|
832
|
+
* @secure
|
|
833
|
+
* @response `200` `void`
|
|
834
|
+
*/
|
|
835
|
+
receiveStatusCallback: (tenantId: string, data: Map, params?: RequestParams) => Promise<void>;
|
|
836
|
+
};
|
|
837
|
+
public: {
|
|
838
|
+
/**
|
|
839
|
+
* No description
|
|
840
|
+
*
|
|
841
|
+
* @tags [Public] Tenant Charges
|
|
842
|
+
* @name GetPublicChargeById
|
|
843
|
+
* @request GET:/public/tenants/{tenantId}/charges/{document}/{chargeId}
|
|
844
|
+
* @secure
|
|
845
|
+
* @response `200` `PublicFullChargeEntityDto`
|
|
846
|
+
*/
|
|
847
|
+
getPublicChargeById: (tenantId: string, document: string, chargeId: string, params?: RequestParams) => Promise<PublicFullChargeEntityDto>;
|
|
848
|
+
/**
|
|
849
|
+
* No description
|
|
850
|
+
*
|
|
851
|
+
* @tags [Public] Tenant Charges
|
|
852
|
+
* @name ListPublicChargesByDocument
|
|
853
|
+
* @request GET:/public/tenants/{tenantId}/charges/{document}
|
|
854
|
+
* @secure
|
|
855
|
+
* @response `200` `PublicChargeEntityPaginatedDto`
|
|
856
|
+
*/
|
|
857
|
+
listPublicChargesByDocument: (tenantId: string, document: string, query?: {
|
|
858
|
+
createdAt?: string;
|
|
859
|
+
/**
|
|
860
|
+
* @default 10
|
|
861
|
+
* @example 10
|
|
862
|
+
*/
|
|
863
|
+
limit?: number;
|
|
864
|
+
orderBy?: OrderByEnum;
|
|
865
|
+
/**
|
|
866
|
+
* @default 1
|
|
867
|
+
* @example 1
|
|
868
|
+
*/
|
|
869
|
+
page?: number;
|
|
870
|
+
sortBy?: string[];
|
|
871
|
+
}, params?: RequestParams) => Promise<PublicChargeEntityPaginatedDto>;
|
|
872
|
+
/**
|
|
873
|
+
* No description
|
|
874
|
+
*
|
|
875
|
+
* @tags [Public] Tenant Charges
|
|
876
|
+
* @name PayCharge
|
|
877
|
+
* @request POST:/public/tenants/{tenantId}/charges/{document}/{chargeId}/pay
|
|
878
|
+
* @secure
|
|
879
|
+
* @response `200` `PublicFullChargeEntityDto`
|
|
880
|
+
*/
|
|
881
|
+
payCharge: (tenantId: string, document: string, chargeId: string, data: PayChargeDto, params?: RequestParams) => Promise<PublicFullChargeEntityDto>;
|
|
882
|
+
};
|
|
883
|
+
auth: {
|
|
884
|
+
/**
|
|
885
|
+
* No description
|
|
886
|
+
*
|
|
887
|
+
* @tags Authentication
|
|
888
|
+
* @name Logout
|
|
889
|
+
* @request POST:/auth/logout
|
|
890
|
+
* @secure
|
|
891
|
+
* @response `204` `void`
|
|
892
|
+
*/
|
|
893
|
+
logout: (params?: RequestParams) => Promise<void>;
|
|
894
|
+
/**
|
|
895
|
+
* No description
|
|
896
|
+
*
|
|
897
|
+
* @tags Authentication
|
|
898
|
+
* @name RequestPasswordReset
|
|
899
|
+
* @request POST:/auth/request-password-reset
|
|
900
|
+
* @secure
|
|
901
|
+
* @response `204` `void`
|
|
902
|
+
*/
|
|
903
|
+
requestPasswordReset: (data: RequestPasswordResetDto, params?: RequestParams) => Promise<void>;
|
|
904
|
+
/**
|
|
905
|
+
* No description
|
|
906
|
+
*
|
|
907
|
+
* @tags Authentication
|
|
908
|
+
* @name ResetPassword
|
|
909
|
+
* @request PATCH:/auth/reset-password
|
|
910
|
+
* @secure
|
|
911
|
+
* @response `200` `SigninResponseDto`
|
|
912
|
+
*/
|
|
913
|
+
resetPassword: (data: ResetPasswordDto, params?: RequestParams) => Promise<SigninResponseDto>;
|
|
914
|
+
/**
|
|
915
|
+
* No description
|
|
916
|
+
*
|
|
917
|
+
* @tags Authentication
|
|
918
|
+
* @name SignIn
|
|
919
|
+
* @request POST:/auth/signin
|
|
920
|
+
* @secure
|
|
921
|
+
* @response `200` `SigninResponseDto`
|
|
922
|
+
*/
|
|
923
|
+
signIn: (data: SigninDto, params?: RequestParams) => Promise<SigninResponseDto>;
|
|
924
|
+
};
|
|
925
|
+
}
|