mitra-interactions-sdk 1.0.56-beta.0 → 1.0.56-beta.2
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/index.d.mts +184 -101
- package/dist/index.d.ts +184 -101
- package/dist/index.js +187 -271
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +175 -262
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -5,7 +5,7 @@ interface LoginOptions {
|
|
|
5
5
|
/** URL da página de autenticação Mitra (ex: https://coder.mitralab.io/sdk-auth/). Opcional se já configurado via configureSdkMitra. */
|
|
6
6
|
authUrl?: string;
|
|
7
7
|
/** ID do projeto. Opcional se já configurado via configureSdkMitra. */
|
|
8
|
-
projectId?: number
|
|
8
|
+
projectId?: number;
|
|
9
9
|
/** Modo de login: 'popup' (default) abre popup, 'redirect' navega para a página de auth. */
|
|
10
10
|
mode?: 'popup' | 'redirect';
|
|
11
11
|
/** URL de retorno após login com mode 'redirect'. A página de auth redirecionará de volta para esta URL com token nos query params. */
|
|
@@ -18,8 +18,6 @@ interface LoginOptions {
|
|
|
18
18
|
interface LoginResponse {
|
|
19
19
|
/** Token JWT (já com prefixo Bearer) */
|
|
20
20
|
token: string;
|
|
21
|
-
/** Refresh token (novo Mitra). Presente apenas no novo mundo. */
|
|
22
|
-
refreshToken?: string;
|
|
23
21
|
/** URL base da API */
|
|
24
22
|
baseURL: string;
|
|
25
23
|
/** URL do serviço de integrações (opcional) */
|
|
@@ -29,7 +27,7 @@ interface EmailSignupOptions {
|
|
|
29
27
|
/** URL da página de auth (ex: https://validacao.mitralab.io/sdk-auth/). Opcional se já configurado via configureSdkMitra. */
|
|
30
28
|
authUrl?: string;
|
|
31
29
|
/** ID do projeto. Opcional se já configurado via configureSdkMitra. */
|
|
32
|
-
projectId?: number
|
|
30
|
+
projectId?: number;
|
|
33
31
|
/** Nome completo do usuário */
|
|
34
32
|
name: string;
|
|
35
33
|
/** Email do usuário */
|
|
@@ -41,7 +39,7 @@ interface EmailLoginOptions {
|
|
|
41
39
|
/** URL da página de auth (ex: https://validacao.mitralab.io/sdk-auth/). Opcional se já configurado via configureSdkMitra. */
|
|
42
40
|
authUrl?: string;
|
|
43
41
|
/** ID do projeto. Opcional se já configurado via configureSdkMitra. */
|
|
44
|
-
projectId?: number
|
|
42
|
+
projectId?: number;
|
|
45
43
|
/** Email do usuário */
|
|
46
44
|
email: string;
|
|
47
45
|
/** Senha */
|
|
@@ -51,7 +49,7 @@ interface EmailVerifyCodeOptions {
|
|
|
51
49
|
/** URL da página de auth. Opcional se já configurado via configureSdkMitra. */
|
|
52
50
|
authUrl?: string;
|
|
53
51
|
/** ID do projeto. Opcional se já configurado via configureSdkMitra. */
|
|
54
|
-
projectId?: number
|
|
52
|
+
projectId?: number;
|
|
55
53
|
/** Email do usuário */
|
|
56
54
|
email: string;
|
|
57
55
|
/** Código de verificação de 6 dígitos */
|
|
@@ -63,19 +61,47 @@ interface EmailResendCodeOptions {
|
|
|
63
61
|
/** URL da página de auth. Opcional se já configurado via configureSdkMitra. */
|
|
64
62
|
authUrl?: string;
|
|
65
63
|
/** ID do projeto. Opcional se já configurado via configureSdkMitra. */
|
|
66
|
-
projectId?: number
|
|
64
|
+
projectId?: number;
|
|
67
65
|
/** Email do usuário */
|
|
68
66
|
email: string;
|
|
69
67
|
}
|
|
70
|
-
interface
|
|
68
|
+
interface SendPasswordResetCodeOptions {
|
|
69
|
+
/** Email do usuário que esqueceu a senha */
|
|
70
|
+
email: string;
|
|
71
|
+
/** ID do projeto. Default: do config global. */
|
|
72
|
+
projectId?: number | string;
|
|
73
|
+
/** URL da página de auth (opcional — usado pra derivar a API base). Default: do config global. */
|
|
74
|
+
authUrl?: string;
|
|
75
|
+
/** Override explícito da API base (ex: https://api0.mitraecp.com:1005). Default: derivado do authUrl. */
|
|
76
|
+
authApiURL?: string;
|
|
77
|
+
}
|
|
78
|
+
interface ValidatePasswordResetCodeOptions {
|
|
79
|
+
email: string;
|
|
80
|
+
/** Código de 6 dígitos recebido por email */
|
|
81
|
+
code: string;
|
|
82
|
+
projectId?: number | string;
|
|
83
|
+
authUrl?: string;
|
|
84
|
+
authApiURL?: string;
|
|
85
|
+
}
|
|
86
|
+
interface ResetPasswordOptions {
|
|
87
|
+
email: string;
|
|
88
|
+
/** Código de 6 dígitos recebido por email */
|
|
89
|
+
code: string;
|
|
90
|
+
/** Nova senha */
|
|
91
|
+
newPassword: string;
|
|
71
92
|
projectId?: number | string;
|
|
72
|
-
|
|
93
|
+
authUrl?: string;
|
|
94
|
+
authApiURL?: string;
|
|
95
|
+
}
|
|
96
|
+
interface ExecuteDataLoaderOptions {
|
|
97
|
+
projectId?: number;
|
|
98
|
+
dataLoaderId: number;
|
|
73
99
|
input?: Record<string, unknown>;
|
|
74
100
|
}
|
|
75
101
|
interface ExecuteDataLoaderResponse {
|
|
76
102
|
status: string;
|
|
77
103
|
result: {
|
|
78
|
-
dataLoaderId: number
|
|
104
|
+
dataLoaderId: number;
|
|
79
105
|
executionLog: {
|
|
80
106
|
timestamp: string;
|
|
81
107
|
rowCount: number;
|
|
@@ -89,9 +115,9 @@ interface ExecuteDataLoaderResponse {
|
|
|
89
115
|
}
|
|
90
116
|
interface ExecuteDbActionOptions {
|
|
91
117
|
/** ID do projeto (opcional se já configurado via configureSdkMitra) */
|
|
92
|
-
projectId?: number
|
|
118
|
+
projectId?: number;
|
|
93
119
|
/** ID da DBAction cadastrada */
|
|
94
|
-
dbActionId: number
|
|
120
|
+
dbActionId: number;
|
|
95
121
|
/** Parâmetros de entrada (opcional) — substituição de variáveis no SQL (ex: { "nome": "João" } substitui :nome) */
|
|
96
122
|
input?: Record<string, unknown>;
|
|
97
123
|
}
|
|
@@ -103,7 +129,7 @@ interface ExecuteDbActionResponse {
|
|
|
103
129
|
}
|
|
104
130
|
interface SetFileStatusOptions {
|
|
105
131
|
/** ID do projeto (opcional se já configurado via configureSdkMitra) */
|
|
106
|
-
projectId?: number
|
|
132
|
+
projectId?: number;
|
|
107
133
|
/** Nome do arquivo */
|
|
108
134
|
fileName: string;
|
|
109
135
|
/** Caminho de destino: "PUBLIC" ou "LOADABLE" */
|
|
@@ -120,7 +146,7 @@ interface SetFileStatusResponse {
|
|
|
120
146
|
}
|
|
121
147
|
interface SetVariableOptions {
|
|
122
148
|
/** ID do projeto (opcional se já configurado via configureSdkMitra) */
|
|
123
|
-
projectId?: number
|
|
149
|
+
projectId?: number;
|
|
124
150
|
/** Nome da variável (key) */
|
|
125
151
|
key: string;
|
|
126
152
|
/** Valor da variável (opcional) */
|
|
@@ -135,9 +161,9 @@ interface SetVariableResponse {
|
|
|
135
161
|
}
|
|
136
162
|
interface ExecuteServerFunctionOptions {
|
|
137
163
|
/** ID do projeto (opcional se já configurado via configureSdkMitra) */
|
|
138
|
-
projectId?: number
|
|
164
|
+
projectId?: number;
|
|
139
165
|
/** ID da Server Function cadastrada */
|
|
140
|
-
serverFunctionId: number
|
|
166
|
+
serverFunctionId: number;
|
|
141
167
|
/** Objeto de entrada para a função (opcional) */
|
|
142
168
|
input?: Record<string, unknown>;
|
|
143
169
|
}
|
|
@@ -154,9 +180,9 @@ interface ExecuteServerFunctionResponse {
|
|
|
154
180
|
}
|
|
155
181
|
interface ExecuteServerFunctionAsyncOptions {
|
|
156
182
|
/** ID do projeto (opcional se já configurado via configureSdkMitra) */
|
|
157
|
-
projectId?: number
|
|
183
|
+
projectId?: number;
|
|
158
184
|
/** ID da Server Function cadastrada */
|
|
159
|
-
serverFunctionId: number
|
|
185
|
+
serverFunctionId: number;
|
|
160
186
|
/** Objeto de entrada para a função (opcional) */
|
|
161
187
|
input?: Record<string, unknown>;
|
|
162
188
|
}
|
|
@@ -169,9 +195,9 @@ interface ExecuteServerFunctionAsyncResponse {
|
|
|
169
195
|
}
|
|
170
196
|
interface ExecutePublicServerFunctionOptions {
|
|
171
197
|
/** ID do projeto (tenant) */
|
|
172
|
-
projectId: number
|
|
198
|
+
projectId: number;
|
|
173
199
|
/** ID da Server Function (deve ter publicExecution = true) */
|
|
174
|
-
serverFunctionId: number
|
|
200
|
+
serverFunctionId: number;
|
|
175
201
|
/** Objeto de entrada para a função (opcional) */
|
|
176
202
|
input?: Record<string, unknown>;
|
|
177
203
|
}
|
|
@@ -188,7 +214,7 @@ interface ExecutePublicServerFunctionAsyncResponse {
|
|
|
188
214
|
status: string;
|
|
189
215
|
}
|
|
190
216
|
interface GetPublicServerFunctionExecutionOptions {
|
|
191
|
-
projectId: number
|
|
217
|
+
projectId: number;
|
|
192
218
|
executionId: string;
|
|
193
219
|
}
|
|
194
220
|
interface GetPublicServerFunctionExecutionResponse {
|
|
@@ -207,54 +233,54 @@ interface ListRecordsResponse {
|
|
|
207
233
|
totalPages: number;
|
|
208
234
|
}
|
|
209
235
|
interface ListRecordsOptions {
|
|
210
|
-
projectId?: number
|
|
236
|
+
projectId?: number;
|
|
211
237
|
tableName: string;
|
|
212
238
|
page?: number;
|
|
213
239
|
size?: number;
|
|
214
240
|
filters?: Record<string, unknown>;
|
|
215
|
-
jdbcConnectionConfigId?: number
|
|
241
|
+
jdbcConnectionConfigId?: number;
|
|
216
242
|
}
|
|
217
243
|
interface GetRecordOptions {
|
|
218
|
-
projectId?: number
|
|
244
|
+
projectId?: number;
|
|
219
245
|
tableName: string;
|
|
220
|
-
id: number
|
|
221
|
-
jdbcConnectionConfigId?: number
|
|
246
|
+
id: number;
|
|
247
|
+
jdbcConnectionConfigId?: number;
|
|
222
248
|
}
|
|
223
249
|
interface CreateRecordOptions {
|
|
224
|
-
projectId?: number
|
|
250
|
+
projectId?: number;
|
|
225
251
|
tableName: string;
|
|
226
252
|
data: Record<string, unknown>;
|
|
227
|
-
jdbcConnectionConfigId?: number
|
|
253
|
+
jdbcConnectionConfigId?: number;
|
|
228
254
|
}
|
|
229
255
|
interface UpdateRecordOptions {
|
|
230
|
-
projectId?: number
|
|
256
|
+
projectId?: number;
|
|
231
257
|
tableName: string;
|
|
232
|
-
id: number
|
|
258
|
+
id: number;
|
|
233
259
|
data: Record<string, unknown>;
|
|
234
|
-
jdbcConnectionConfigId?: number
|
|
260
|
+
jdbcConnectionConfigId?: number;
|
|
235
261
|
}
|
|
236
262
|
interface PatchRecordOptions {
|
|
237
|
-
projectId?: number
|
|
263
|
+
projectId?: number;
|
|
238
264
|
tableName: string;
|
|
239
|
-
id: number
|
|
265
|
+
id: number;
|
|
240
266
|
data: Record<string, unknown>;
|
|
241
|
-
jdbcConnectionConfigId?: number
|
|
267
|
+
jdbcConnectionConfigId?: number;
|
|
242
268
|
}
|
|
243
269
|
interface DeleteRecordOptions {
|
|
244
|
-
projectId?: number
|
|
270
|
+
projectId?: number;
|
|
245
271
|
tableName: string;
|
|
246
|
-
id: number
|
|
247
|
-
jdbcConnectionConfigId?: number
|
|
272
|
+
id: number;
|
|
273
|
+
jdbcConnectionConfigId?: number;
|
|
248
274
|
}
|
|
249
275
|
interface CreateRecordsBatchOptions {
|
|
250
|
-
projectId?: number
|
|
276
|
+
projectId?: number;
|
|
251
277
|
tableName: string;
|
|
252
278
|
records: Record<string, unknown>[];
|
|
253
|
-
jdbcConnectionConfigId?: number
|
|
279
|
+
jdbcConnectionConfigId?: number;
|
|
254
280
|
}
|
|
255
281
|
interface UploadFileOptions {
|
|
256
282
|
/** ID do projeto (opcional se já configurado via configureSdkMitra) */
|
|
257
|
-
projectId?: number
|
|
283
|
+
projectId?: number;
|
|
258
284
|
/** Arquivo a ser enviado (File ou Blob) */
|
|
259
285
|
file: File | Blob;
|
|
260
286
|
/** Habilitar debug (opcional) */
|
|
@@ -271,11 +297,11 @@ interface UploadFileResponse {
|
|
|
271
297
|
}
|
|
272
298
|
interface ListVariablesOptions {
|
|
273
299
|
/** ID do projeto (opcional se já configurado via configureSdkMitra) */
|
|
274
|
-
projectId?: number
|
|
300
|
+
projectId?: number;
|
|
275
301
|
}
|
|
276
302
|
interface ListVariablesResponse {
|
|
277
303
|
status: string;
|
|
278
|
-
projectId: number
|
|
304
|
+
projectId: number;
|
|
279
305
|
result: {
|
|
280
306
|
key: string;
|
|
281
307
|
value: string;
|
|
@@ -283,7 +309,7 @@ interface ListVariablesResponse {
|
|
|
283
309
|
}
|
|
284
310
|
interface GetVariableOptions {
|
|
285
311
|
/** ID do projeto (opcional se já configurado via configureSdkMitra) */
|
|
286
|
-
projectId?: number
|
|
312
|
+
projectId?: number;
|
|
287
313
|
/** Nome da variável (com ou sem :VAR_) */
|
|
288
314
|
key: string;
|
|
289
315
|
}
|
|
@@ -296,9 +322,9 @@ interface GetVariableResponse {
|
|
|
296
322
|
}
|
|
297
323
|
interface RunActionOptions {
|
|
298
324
|
/** ID do projeto (opcional se já configurado via configureSdkMitra) */
|
|
299
|
-
projectId?: number
|
|
325
|
+
projectId?: number;
|
|
300
326
|
/** ID da Action a executar */
|
|
301
|
-
actionId: number
|
|
327
|
+
actionId: number;
|
|
302
328
|
/** Parâmetros de entrada para a action (opcional) */
|
|
303
329
|
input?: Record<string, unknown>;
|
|
304
330
|
}
|
|
@@ -312,7 +338,7 @@ interface RunActionResponse {
|
|
|
312
338
|
}
|
|
313
339
|
interface CallIntegrationOptions {
|
|
314
340
|
/** ID do projeto (opcional se já configurado via configureSdkMitra) */
|
|
315
|
-
projectId?: number
|
|
341
|
+
projectId?: number;
|
|
316
342
|
/** Slug da integração configurada no painel */
|
|
317
343
|
connection: string;
|
|
318
344
|
/** Método HTTP: GET, POST, PUT, DELETE */
|
|
@@ -332,11 +358,11 @@ interface CallIntegrationResponse {
|
|
|
332
358
|
}
|
|
333
359
|
interface ListIntegrationsOptions {
|
|
334
360
|
/** ID do projeto (opcional se já configurado via configureSdkMitra) */
|
|
335
|
-
projectId?: number
|
|
361
|
+
projectId?: number;
|
|
336
362
|
}
|
|
337
363
|
interface IntegrationResponse {
|
|
338
364
|
id: string;
|
|
339
|
-
projectId: number
|
|
365
|
+
projectId: number;
|
|
340
366
|
name: string;
|
|
341
367
|
slug: string;
|
|
342
368
|
blueprintId: string | null;
|
|
@@ -350,7 +376,7 @@ interface IntegrationResponse {
|
|
|
350
376
|
}
|
|
351
377
|
interface StopServerFunctionExecutionOptions {
|
|
352
378
|
/** ID do projeto (opcional se já configurado via configureSdkMitra) */
|
|
353
|
-
projectId?: number
|
|
379
|
+
projectId?: number;
|
|
354
380
|
/** ID da execução a ser parada */
|
|
355
381
|
executionId: string;
|
|
356
382
|
}
|
|
@@ -362,87 +388,87 @@ interface StopServerFunctionExecutionResponse {
|
|
|
362
388
|
};
|
|
363
389
|
}
|
|
364
390
|
interface ListProfilesOptions {
|
|
365
|
-
projectId?: number
|
|
391
|
+
projectId?: number;
|
|
366
392
|
}
|
|
367
393
|
interface ListProfilesResponse {
|
|
368
394
|
status: string;
|
|
369
|
-
projectId: number
|
|
395
|
+
projectId: number;
|
|
370
396
|
result: {
|
|
371
|
-
id: number
|
|
397
|
+
id: number;
|
|
372
398
|
name: string;
|
|
373
399
|
color: string;
|
|
374
|
-
homeScreenId: number
|
|
400
|
+
homeScreenId: number;
|
|
375
401
|
}[];
|
|
376
402
|
}
|
|
377
403
|
interface GetProfileDetailsOptions {
|
|
378
|
-
projectId?: number
|
|
379
|
-
profileId: number
|
|
404
|
+
projectId?: number;
|
|
405
|
+
profileId: number;
|
|
380
406
|
}
|
|
381
407
|
interface GetProfileDetailsResponse {
|
|
382
408
|
status: string;
|
|
383
|
-
projectId: number
|
|
409
|
+
projectId: number;
|
|
384
410
|
result: {
|
|
385
|
-
id: number
|
|
411
|
+
id: number;
|
|
386
412
|
name: string;
|
|
387
413
|
users: {
|
|
388
|
-
id: number
|
|
414
|
+
id: number;
|
|
389
415
|
name: string;
|
|
390
416
|
email: string;
|
|
391
417
|
}[];
|
|
392
418
|
selectTables: {
|
|
393
419
|
tableName: string;
|
|
394
|
-
jdbcConnectionConfigId?: number
|
|
420
|
+
jdbcConnectionConfigId?: number;
|
|
395
421
|
}[];
|
|
396
422
|
dmlTables: {
|
|
397
423
|
tableName: string;
|
|
398
|
-
jdbcConnectionConfigId?: number
|
|
424
|
+
jdbcConnectionConfigId?: number;
|
|
399
425
|
}[];
|
|
400
426
|
actions: {
|
|
401
|
-
id: number
|
|
427
|
+
id: number;
|
|
402
428
|
name: string;
|
|
403
429
|
}[];
|
|
404
430
|
screens: {
|
|
405
|
-
id: number
|
|
431
|
+
id: number;
|
|
406
432
|
name: string;
|
|
407
433
|
}[];
|
|
408
434
|
serverFunctions: {
|
|
409
|
-
id: number
|
|
435
|
+
id: number;
|
|
410
436
|
name: string;
|
|
411
437
|
}[];
|
|
412
438
|
};
|
|
413
439
|
}
|
|
414
440
|
interface CreateProfileOptions {
|
|
415
|
-
projectId?: number
|
|
441
|
+
projectId?: number;
|
|
416
442
|
name: string;
|
|
417
443
|
color?: string;
|
|
418
|
-
homeScreenId?: number
|
|
444
|
+
homeScreenId?: number;
|
|
419
445
|
}
|
|
420
446
|
interface CreateProfileResponse {
|
|
421
447
|
status: string;
|
|
422
448
|
result: {
|
|
423
|
-
id: number
|
|
449
|
+
id: number;
|
|
424
450
|
name: string;
|
|
425
451
|
message: string;
|
|
426
452
|
};
|
|
427
453
|
}
|
|
428
454
|
interface UpdateProfileOptions {
|
|
429
|
-
projectId?: number
|
|
430
|
-
profileId: number
|
|
455
|
+
projectId?: number;
|
|
456
|
+
profileId: number;
|
|
431
457
|
name?: string;
|
|
432
458
|
color?: string;
|
|
433
|
-
homeScreenId?: number
|
|
459
|
+
homeScreenId?: number;
|
|
434
460
|
}
|
|
435
461
|
interface UpdateProfileResponse {
|
|
436
462
|
status: string;
|
|
437
463
|
result: {
|
|
438
|
-
id: number
|
|
464
|
+
id: number;
|
|
439
465
|
name: string;
|
|
440
466
|
message: string;
|
|
441
467
|
};
|
|
442
468
|
}
|
|
443
469
|
interface DeleteProfileOptions {
|
|
444
|
-
projectId?: number
|
|
445
|
-
profileId: number
|
|
470
|
+
projectId?: number;
|
|
471
|
+
profileId: number;
|
|
446
472
|
}
|
|
447
473
|
interface DeleteProfileResponse {
|
|
448
474
|
status: string;
|
|
@@ -451,44 +477,44 @@ interface DeleteProfileResponse {
|
|
|
451
477
|
};
|
|
452
478
|
}
|
|
453
479
|
interface SetProfileUsersOptions {
|
|
454
|
-
projectId?: number
|
|
455
|
-
profileId: number
|
|
480
|
+
projectId?: number;
|
|
481
|
+
profileId: number;
|
|
456
482
|
userIds: number[];
|
|
457
483
|
}
|
|
458
484
|
interface ProfileTableRef {
|
|
459
485
|
tableName: string;
|
|
460
486
|
}
|
|
461
487
|
interface SetProfileSelectTablesOptions {
|
|
462
|
-
projectId?: number
|
|
463
|
-
profileId: number
|
|
464
|
-
jdbcConnectionConfigId?: number
|
|
488
|
+
projectId?: number;
|
|
489
|
+
profileId: number;
|
|
490
|
+
jdbcConnectionConfigId?: number;
|
|
465
491
|
tables: ProfileTableRef[];
|
|
466
492
|
}
|
|
467
493
|
interface SetProfileDmlTablesOptions {
|
|
468
|
-
projectId?: number
|
|
469
|
-
profileId: number
|
|
470
|
-
jdbcConnectionConfigId?: number
|
|
494
|
+
projectId?: number;
|
|
495
|
+
profileId: number;
|
|
496
|
+
jdbcConnectionConfigId?: number;
|
|
471
497
|
tables: ProfileTableRef[];
|
|
472
498
|
}
|
|
473
499
|
interface SetProfileActionsOptions {
|
|
474
|
-
projectId?: number
|
|
475
|
-
profileId: number
|
|
500
|
+
projectId?: number;
|
|
501
|
+
profileId: number;
|
|
476
502
|
actionIds: number[];
|
|
477
503
|
}
|
|
478
504
|
interface SetProfileScreensOptions {
|
|
479
|
-
projectId?: number
|
|
480
|
-
profileId: number
|
|
505
|
+
projectId?: number;
|
|
506
|
+
profileId: number;
|
|
481
507
|
screenIds: number[];
|
|
482
508
|
}
|
|
483
509
|
interface SetProfileServerFunctionsOptions {
|
|
484
|
-
projectId?: number
|
|
485
|
-
profileId: number
|
|
510
|
+
projectId?: number;
|
|
511
|
+
profileId: number;
|
|
486
512
|
serverFunctionIds: number[];
|
|
487
513
|
}
|
|
488
514
|
interface SetProfilePermissionResponse {
|
|
489
515
|
status: string;
|
|
490
516
|
result: {
|
|
491
|
-
profileId: number
|
|
517
|
+
profileId: number;
|
|
492
518
|
message: string;
|
|
493
519
|
[key: string]: unknown;
|
|
494
520
|
};
|
|
@@ -537,6 +563,9 @@ interface MitraInstance {
|
|
|
537
563
|
setProfileActions(options: SetProfileActionsOptions): Promise<SetProfilePermissionResponse>;
|
|
538
564
|
setProfileScreens(options: SetProfileScreensOptions): Promise<SetProfilePermissionResponse>;
|
|
539
565
|
setProfileServerFunctions(options: SetProfileServerFunctionsOptions): Promise<SetProfilePermissionResponse>;
|
|
566
|
+
sendPasswordResetCode(options: SendPasswordResetCodeOptions): Promise<Record<string, unknown>>;
|
|
567
|
+
validatePasswordResetCode(options: ValidatePasswordResetCodeOptions): Promise<Record<string, unknown>>;
|
|
568
|
+
resetPassword(options: ResetPasswordOptions): Promise<Record<string, unknown>>;
|
|
540
569
|
openChat(): void;
|
|
541
570
|
closeChat(): void;
|
|
542
571
|
}
|
|
@@ -547,14 +576,12 @@ interface MitraConfig {
|
|
|
547
576
|
baseURL: string;
|
|
548
577
|
/** Token JWT para autenticação (opcional para Server Functions públicas) */
|
|
549
578
|
token?: string;
|
|
550
|
-
/** Refresh token (novo Mitra). Necessário para refresh automático no novo mundo. */
|
|
551
|
-
refreshToken?: string;
|
|
552
579
|
/** URL base do serviço de integrações (ex: https://api0.mitraecp.com:1003) */
|
|
553
580
|
integrationURL?: string;
|
|
554
581
|
/** URL da página de autenticação Mitra (ex: https://coder.mitralab.io/sdk-auth/) */
|
|
555
582
|
authUrl?: string;
|
|
556
583
|
/** ID do projeto (usado como fallback nos métodos de login e serviços) */
|
|
557
|
-
projectId?: number
|
|
584
|
+
projectId?: number;
|
|
558
585
|
/** Callback chamado quando o token é renovado automaticamente (após 401/403). Recebe a nova sessão. */
|
|
559
586
|
onTokenRefresh?: (session: LoginResponse) => void;
|
|
560
587
|
}
|
|
@@ -569,7 +596,7 @@ declare function getConfig(): MitraConfig;
|
|
|
569
596
|
/**
|
|
570
597
|
* Resolve projectId: usa o valor passado, senão pega do config salvo.
|
|
571
598
|
*/
|
|
572
|
-
declare function resolveProjectId(projectId?: number
|
|
599
|
+
declare function resolveProjectId(projectId?: number): number;
|
|
573
600
|
|
|
574
601
|
/**
|
|
575
602
|
* Mitra Interactions SDK - Chat Integration
|
|
@@ -588,24 +615,80 @@ declare function openChatMitra(): void;
|
|
|
588
615
|
declare function closeChatMitra(): void;
|
|
589
616
|
|
|
590
617
|
/**
|
|
591
|
-
* Mitra Interactions SDK - Autenticação
|
|
592
|
-
*
|
|
593
|
-
* Roteia chamadas de auth para a implementação correta com base no `authUrl`:
|
|
594
|
-
* - URLs legadas (`coder.mitralab.io/sdk-auth/`, `agent.mitralab.io/sdk-auth/`) → auth-legacy.ts
|
|
595
|
-
* - Qualquer outro authUrl → auth-new.ts (novo Mitra: Kong gateway + IAM service)
|
|
618
|
+
* Mitra Interactions SDK - Autenticação
|
|
596
619
|
*
|
|
597
|
-
*
|
|
620
|
+
* Login via popup seguro hospedado no domínio Mitra.
|
|
621
|
+
* Credenciais nunca passam pelo código do desenvolvedor.
|
|
598
622
|
*/
|
|
599
623
|
|
|
600
|
-
|
|
624
|
+
/**
|
|
625
|
+
* Login com email e senha via popup/redirect seguro Mitra.
|
|
626
|
+
*/
|
|
601
627
|
declare function loginWithEmailMitra(options?: LoginOptions): Promise<LoginResponse>;
|
|
628
|
+
/**
|
|
629
|
+
* Login com Google via popup/redirect seguro Mitra.
|
|
630
|
+
*/
|
|
602
631
|
declare function loginWithGoogleMitra(options?: LoginOptions): Promise<LoginResponse>;
|
|
632
|
+
/**
|
|
633
|
+
* Login com Microsoft via popup/redirect seguro Mitra.
|
|
634
|
+
*/
|
|
603
635
|
declare function loginWithMicrosoftMitra(options?: LoginOptions): Promise<LoginResponse>;
|
|
636
|
+
/**
|
|
637
|
+
* Login genérico via popup/redirect seguro Mitra.
|
|
638
|
+
*/
|
|
639
|
+
declare function loginMitra(method: 'email' | 'google' | 'microsoft' | 'mitra', options?: LoginOptions): Promise<LoginResponse>;
|
|
640
|
+
/**
|
|
641
|
+
* Renova o token silenciosamente via iframe invisível.
|
|
642
|
+
* Se já houver um refresh em andamento, reaproveita a mesma promise.
|
|
643
|
+
*/
|
|
644
|
+
declare function refreshTokenSilently(authUrl: string, projectId: number): Promise<LoginResponse>;
|
|
645
|
+
/**
|
|
646
|
+
* Cria conta via email usando iframe silencioso.
|
|
647
|
+
* Após sucesso, o usuário recebe um código de verificação por email.
|
|
648
|
+
* Fluxo: emailSignupMitra → emailVerifyCodeMitra → emailLoginMitra
|
|
649
|
+
*/
|
|
604
650
|
declare function emailSignupMitra(options: EmailSignupOptions): Promise<void>;
|
|
605
|
-
|
|
651
|
+
/**
|
|
652
|
+
* Verifica o código de 6 dígitos enviado por email após signup.
|
|
653
|
+
* Após verificação, faz login automático e retorna LoginResponse.
|
|
654
|
+
* Auto-configura o SDK após sucesso.
|
|
655
|
+
*/
|
|
606
656
|
declare function emailVerifyCodeMitra(options: EmailVerifyCodeOptions): Promise<LoginResponse>;
|
|
657
|
+
/**
|
|
658
|
+
* Reenvia o código de verificação para o email.
|
|
659
|
+
*/
|
|
607
660
|
declare function emailResendCodeMitra(options: EmailResendCodeOptions): Promise<void>;
|
|
608
|
-
|
|
661
|
+
/**
|
|
662
|
+
* Login via email e senha usando iframe silencioso.
|
|
663
|
+
* O HTML de auth faz a chamada à API e resolve as credenciais do projeto.
|
|
664
|
+
* Retorna LoginResponse com token, baseURL e integrationURL.
|
|
665
|
+
* Auto-configura o SDK após sucesso.
|
|
666
|
+
*/
|
|
667
|
+
declare function emailLoginMitra(options: EmailLoginOptions): Promise<LoginResponse>;
|
|
668
|
+
|
|
669
|
+
/**
|
|
670
|
+
* Mitra Interactions SDK - Password Reset (legacy backend)
|
|
671
|
+
*
|
|
672
|
+
* Endpoints públicos (sem auth) para fluxo de "esqueci minha senha".
|
|
673
|
+
* Usa um backend separado (porta 1005 ou 4133 dependendo do ambiente),
|
|
674
|
+
* resolvido a partir do `authUrl` configurado.
|
|
675
|
+
*/
|
|
676
|
+
|
|
677
|
+
/**
|
|
678
|
+
* POST /mitraspace/auth/resetPassword
|
|
679
|
+
* Envia um código de verificação por email para iniciar o fluxo de reset de senha.
|
|
680
|
+
*/
|
|
681
|
+
declare function sendPasswordResetCodeMitra(options: SendPasswordResetCodeOptions): Promise<Record<string, unknown>>;
|
|
682
|
+
/**
|
|
683
|
+
* POST /mitraspace/auth/resetPassword/validateCode
|
|
684
|
+
* Valida o código recebido por email (sem trocar a senha ainda).
|
|
685
|
+
*/
|
|
686
|
+
declare function validatePasswordResetCodeMitra(options: ValidatePasswordResetCodeOptions): Promise<Record<string, unknown>>;
|
|
687
|
+
/**
|
|
688
|
+
* PUT /mitraspace/auth/resetPassword
|
|
689
|
+
* Troca a senha usando email + código + nova senha.
|
|
690
|
+
*/
|
|
691
|
+
declare function resetPasswordMitra(options: ResetPasswordOptions): Promise<Record<string, unknown>>;
|
|
609
692
|
|
|
610
693
|
/**
|
|
611
694
|
* Mitra Interactions SDK - Services
|
|
@@ -762,4 +845,4 @@ declare function setProfileScreensMitra(options: SetProfileScreensOptions): Prom
|
|
|
762
845
|
*/
|
|
763
846
|
declare function setProfileServerFunctionsMitra(options: SetProfileServerFunctionsOptions): Promise<SetProfilePermissionResponse>;
|
|
764
847
|
|
|
765
|
-
export { type CallIntegrationOptions, type CallIntegrationResponse, type CreateProfileOptions, type CreateProfileResponse, type CreateRecordOptions, type CreateRecordsBatchOptions, type DeleteProfileOptions, type DeleteProfileResponse, type DeleteRecordOptions, type EmailLoginOptions, type EmailResendCodeOptions, type EmailSignupOptions, type EmailVerifyCodeOptions, type ExecuteDataLoaderOptions, type ExecuteDataLoaderResponse, type ExecuteDbActionOptions, type ExecuteDbActionResponse, type ExecutePublicServerFunctionAsyncResponse, type ExecutePublicServerFunctionOptions, type ExecutePublicServerFunctionResponse, type ExecuteServerFunctionAsyncOptions, type ExecuteServerFunctionAsyncResponse, type ExecuteServerFunctionOptions, type ExecuteServerFunctionResponse, type GetProfileDetailsOptions, type GetProfileDetailsResponse, type GetPublicServerFunctionExecutionOptions, type GetPublicServerFunctionExecutionResponse, type GetRecordOptions, type GetVariableOptions, type GetVariableResponse, type IntegrationResponse, type ListIntegrationsOptions, type ListProfilesOptions, type ListProfilesResponse, type ListRecordsOptions, type ListRecordsResponse, type ListVariablesOptions, type ListVariablesResponse, type LoginOptions, type LoginResponse, type MitraConfig, type MitraInstance, type PatchRecordOptions, type ProfileTableRef, type RunActionOptions, type RunActionResponse, type SetFileStatusOptions, type SetFileStatusResponse, type SetProfileActionsOptions, type SetProfileDmlTablesOptions, type SetProfilePermissionResponse, type SetProfileScreensOptions, type SetProfileSelectTablesOptions, type SetProfileServerFunctionsOptions, type SetProfileUsersOptions, type SetVariableOptions, type SetVariableResponse, type StopServerFunctionExecutionOptions, type StopServerFunctionExecutionResponse, type UpdateProfileOptions, type UpdateProfileResponse, type UpdateRecordOptions, type UploadFileOptions, type UploadFileResponse, callIntegrationMitra, closeChatMitra, configureSdkMitra, createMitraInstance, createProfileMitra, createRecordMitra, createRecordsBatchMitra, deleteProfileMitra, deleteRecordMitra, emailLoginMitra, emailResendCodeMitra, emailSignupMitra, emailVerifyCodeMitra, executeDataLoaderMitra, executeDbActionMitra, executePublicServerFunctionAsyncMitra, executePublicServerFunctionMitra, executeServerFunctionAsyncMitra, executeServerFunctionMitra, getConfig, getProfileDetailsMitra, getPublicServerFunctionExecutionMitra, getRecordMitra, getVariableMitra, listIntegrationsMitra, listProfilesMitra, listRecordsMitra, listVariablesMitra, loginMitra, loginWithEmailMitra, loginWithGoogleMitra, loginWithMicrosoftMitra, openChatMitra, patchRecordMitra, refreshTokenSilently, resolveProjectId, runActionMitra, setFileStatusMitra, setProfileActionsMitra, setProfileDmlTablesMitra, setProfileScreensMitra, setProfileSelectTablesMitra, setProfileServerFunctionsMitra, setProfileUsersMitra, setVariableMitra, stopServerFunctionExecutionMitra, updateProfileMitra, updateRecordMitra, uploadFileLoadableMitra, uploadFilePublicMitra };
|
|
848
|
+
export { type CallIntegrationOptions, type CallIntegrationResponse, type CreateProfileOptions, type CreateProfileResponse, type CreateRecordOptions, type CreateRecordsBatchOptions, type DeleteProfileOptions, type DeleteProfileResponse, type DeleteRecordOptions, type EmailLoginOptions, type EmailResendCodeOptions, type EmailSignupOptions, type EmailVerifyCodeOptions, type ExecuteDataLoaderOptions, type ExecuteDataLoaderResponse, type ExecuteDbActionOptions, type ExecuteDbActionResponse, type ExecutePublicServerFunctionAsyncResponse, type ExecutePublicServerFunctionOptions, type ExecutePublicServerFunctionResponse, type ExecuteServerFunctionAsyncOptions, type ExecuteServerFunctionAsyncResponse, type ExecuteServerFunctionOptions, type ExecuteServerFunctionResponse, type GetProfileDetailsOptions, type GetProfileDetailsResponse, type GetPublicServerFunctionExecutionOptions, type GetPublicServerFunctionExecutionResponse, type GetRecordOptions, type GetVariableOptions, type GetVariableResponse, type IntegrationResponse, type ListIntegrationsOptions, type ListProfilesOptions, type ListProfilesResponse, type ListRecordsOptions, type ListRecordsResponse, type ListVariablesOptions, type ListVariablesResponse, type LoginOptions, type LoginResponse, type MitraConfig, type MitraInstance, type PatchRecordOptions, type ProfileTableRef, type ResetPasswordOptions, type RunActionOptions, type RunActionResponse, type SendPasswordResetCodeOptions, type SetFileStatusOptions, type SetFileStatusResponse, type SetProfileActionsOptions, type SetProfileDmlTablesOptions, type SetProfilePermissionResponse, type SetProfileScreensOptions, type SetProfileSelectTablesOptions, type SetProfileServerFunctionsOptions, type SetProfileUsersOptions, type SetVariableOptions, type SetVariableResponse, type StopServerFunctionExecutionOptions, type StopServerFunctionExecutionResponse, type UpdateProfileOptions, type UpdateProfileResponse, type UpdateRecordOptions, type UploadFileOptions, type UploadFileResponse, type ValidatePasswordResetCodeOptions, callIntegrationMitra, closeChatMitra, configureSdkMitra, createMitraInstance, createProfileMitra, createRecordMitra, createRecordsBatchMitra, deleteProfileMitra, deleteRecordMitra, emailLoginMitra, emailResendCodeMitra, emailSignupMitra, emailVerifyCodeMitra, executeDataLoaderMitra, executeDbActionMitra, executePublicServerFunctionAsyncMitra, executePublicServerFunctionMitra, executeServerFunctionAsyncMitra, executeServerFunctionMitra, getConfig, getProfileDetailsMitra, getPublicServerFunctionExecutionMitra, getRecordMitra, getVariableMitra, listIntegrationsMitra, listProfilesMitra, listRecordsMitra, listVariablesMitra, loginMitra, loginWithEmailMitra, loginWithGoogleMitra, loginWithMicrosoftMitra, openChatMitra, patchRecordMitra, refreshTokenSilently, resetPasswordMitra, resolveProjectId, runActionMitra, sendPasswordResetCodeMitra, setFileStatusMitra, setProfileActionsMitra, setProfileDmlTablesMitra, setProfileScreensMitra, setProfileSelectTablesMitra, setProfileServerFunctionsMitra, setProfileUsersMitra, setVariableMitra, stopServerFunctionExecutionMitra, updateProfileMitra, updateRecordMitra, uploadFileLoadableMitra, uploadFilePublicMitra, validatePasswordResetCodeMitra };
|