mitra-interactions-sdk 1.0.60-beta.16 → 1.0.60-beta.18
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 +53 -139
- package/dist/index.d.ts +53 -139
- package/dist/index.js +121 -368
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +118 -358
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -25,96 +25,6 @@ interface LoginResponse {
|
|
|
25
25
|
/** URL do serviço de integrações (opcional) */
|
|
26
26
|
integrationURL?: string;
|
|
27
27
|
}
|
|
28
|
-
interface EmailSignupOptions {
|
|
29
|
-
/** URL da página de auth (ex: https://validacao.mitralab.io/sdk-auth/). Opcional se já configurado via configureSdkMitra. */
|
|
30
|
-
authUrl?: string;
|
|
31
|
-
/** ID do projeto. Opcional se já configurado via configureSdkMitra. */
|
|
32
|
-
projectId?: number | string;
|
|
33
|
-
/** Nome completo do usuário */
|
|
34
|
-
name: string;
|
|
35
|
-
/** Email do usuário */
|
|
36
|
-
email: string;
|
|
37
|
-
/** Senha */
|
|
38
|
-
password: string;
|
|
39
|
-
}
|
|
40
|
-
interface EmailLoginOptions {
|
|
41
|
-
/** URL da página de auth (ex: https://validacao.mitralab.io/sdk-auth/). Opcional se já configurado via configureSdkMitra. */
|
|
42
|
-
authUrl?: string;
|
|
43
|
-
/** ID do projeto. Opcional se já configurado via configureSdkMitra. */
|
|
44
|
-
projectId?: number | string;
|
|
45
|
-
/** Email do usuário */
|
|
46
|
-
email: string;
|
|
47
|
-
/** Senha */
|
|
48
|
-
password: string;
|
|
49
|
-
}
|
|
50
|
-
interface EmailVerifyCodeOptions {
|
|
51
|
-
/** URL da página de auth. Opcional se já configurado via configureSdkMitra. */
|
|
52
|
-
authUrl?: string;
|
|
53
|
-
/** ID do projeto. Opcional se já configurado via configureSdkMitra. */
|
|
54
|
-
projectId?: number | string;
|
|
55
|
-
/** Email do usuário */
|
|
56
|
-
email: string;
|
|
57
|
-
/** Código de verificação de 6 dígitos */
|
|
58
|
-
code: string;
|
|
59
|
-
/** Senha do usuário (necessário para login automático após verificação) */
|
|
60
|
-
password: string;
|
|
61
|
-
}
|
|
62
|
-
interface EmailResendCodeOptions {
|
|
63
|
-
/** URL da página de auth. Opcional se já configurado via configureSdkMitra. */
|
|
64
|
-
authUrl?: string;
|
|
65
|
-
/** ID do projeto. Opcional se já configurado via configureSdkMitra. */
|
|
66
|
-
projectId?: number | string;
|
|
67
|
-
/** Email do usuário */
|
|
68
|
-
email: string;
|
|
69
|
-
}
|
|
70
|
-
interface SendPasswordResetCodeOptions {
|
|
71
|
-
/** Email do usuário que esqueceu a senha */
|
|
72
|
-
email: string;
|
|
73
|
-
/** ID do projeto. Default: do config global. */
|
|
74
|
-
projectId?: number | string;
|
|
75
|
-
/** URL da página de auth (opcional — usado pra derivar a API base). Default: do config global. */
|
|
76
|
-
authUrl?: string;
|
|
77
|
-
/** Override explícito da API base (ex: https://api0.mitraecp.com:1005). Default: derivado do authUrl. */
|
|
78
|
-
authApiURL?: string;
|
|
79
|
-
}
|
|
80
|
-
interface ValidatePasswordResetCodeOptions {
|
|
81
|
-
email: string;
|
|
82
|
-
/** Código de 6 dígitos recebido por email */
|
|
83
|
-
code: string;
|
|
84
|
-
projectId?: number | string;
|
|
85
|
-
authUrl?: string;
|
|
86
|
-
authApiURL?: string;
|
|
87
|
-
}
|
|
88
|
-
interface ResetPasswordOptions {
|
|
89
|
-
email: string;
|
|
90
|
-
/** Código de 6 dígitos recebido por email */
|
|
91
|
-
code: string;
|
|
92
|
-
/** Nova senha */
|
|
93
|
-
newPassword: string;
|
|
94
|
-
projectId?: number | string;
|
|
95
|
-
authUrl?: string;
|
|
96
|
-
authApiURL?: string;
|
|
97
|
-
}
|
|
98
|
-
interface ExecuteDataLoaderOptions {
|
|
99
|
-
projectId?: number | string;
|
|
100
|
-
dataLoaderId: number | string;
|
|
101
|
-
input?: Record<string, unknown>;
|
|
102
|
-
}
|
|
103
|
-
interface ExecuteDataLoaderResponse {
|
|
104
|
-
status: string;
|
|
105
|
-
result: {
|
|
106
|
-
dataLoaderId: number | string;
|
|
107
|
-
executionLog: {
|
|
108
|
-
timestamp: string;
|
|
109
|
-
rowCount: number;
|
|
110
|
-
query: string;
|
|
111
|
-
status: string;
|
|
112
|
-
fileSize?: string;
|
|
113
|
-
duration?: string;
|
|
114
|
-
};
|
|
115
|
-
message: string;
|
|
116
|
-
};
|
|
117
|
-
}
|
|
118
28
|
interface ExecuteServerFunctionOptions {
|
|
119
29
|
/** ID do projeto (opcional se já configurado via configureSdkMitra) */
|
|
120
30
|
projectId?: number | string;
|
|
@@ -149,6 +59,38 @@ interface ExecuteServerFunctionAsyncResponse {
|
|
|
149
59
|
executionStatus: string;
|
|
150
60
|
};
|
|
151
61
|
}
|
|
62
|
+
interface ExecutePublicServerFunctionOptions {
|
|
63
|
+
/** ID do projeto (tenant) */
|
|
64
|
+
projectId: number | string;
|
|
65
|
+
/** ID da Server Function (deve ter publicExecution = true) */
|
|
66
|
+
serverFunctionId: number | string;
|
|
67
|
+
/** Objeto de entrada para a função (opcional) */
|
|
68
|
+
input?: Record<string, unknown>;
|
|
69
|
+
}
|
|
70
|
+
interface ExecutePublicServerFunctionResponse {
|
|
71
|
+
executionId: string;
|
|
72
|
+
status: string;
|
|
73
|
+
output: any | null;
|
|
74
|
+
logs: string | null;
|
|
75
|
+
error: string | null;
|
|
76
|
+
durationMs: number | null;
|
|
77
|
+
}
|
|
78
|
+
interface ExecutePublicServerFunctionAsyncResponse {
|
|
79
|
+
executionId: string;
|
|
80
|
+
status: string;
|
|
81
|
+
}
|
|
82
|
+
interface GetPublicServerFunctionExecutionOptions {
|
|
83
|
+
projectId: number | string;
|
|
84
|
+
executionId: string;
|
|
85
|
+
}
|
|
86
|
+
interface GetPublicServerFunctionExecutionResponse {
|
|
87
|
+
executionId: string;
|
|
88
|
+
status: string;
|
|
89
|
+
output: any | null;
|
|
90
|
+
logs: string | null;
|
|
91
|
+
error: string | null;
|
|
92
|
+
durationMs: number | null;
|
|
93
|
+
}
|
|
152
94
|
interface ListRecordsResponse {
|
|
153
95
|
content: Record<string, any>[];
|
|
154
96
|
page: number;
|
|
@@ -262,9 +204,11 @@ interface StopServerFunctionExecutionResponse {
|
|
|
262
204
|
|
|
263
205
|
interface MitraInstance {
|
|
264
206
|
readonly config: MitraConfig;
|
|
265
|
-
executeDataLoader(options: ExecuteDataLoaderOptions): Promise<ExecuteDataLoaderResponse>;
|
|
266
207
|
executeServerFunction(options: ExecuteServerFunctionOptions): Promise<ExecuteServerFunctionResponse>;
|
|
267
208
|
executeServerFunctionAsync(options: ExecuteServerFunctionAsyncOptions): Promise<ExecuteServerFunctionAsyncResponse>;
|
|
209
|
+
executePublicServerFunction(options: ExecutePublicServerFunctionOptions): Promise<ExecutePublicServerFunctionResponse>;
|
|
210
|
+
executePublicServerFunctionAsync(options: ExecutePublicServerFunctionOptions): Promise<ExecutePublicServerFunctionAsyncResponse>;
|
|
211
|
+
getPublicServerFunctionExecution(options: GetPublicServerFunctionExecutionOptions): Promise<GetPublicServerFunctionExecutionResponse>;
|
|
268
212
|
stopServerFunctionExecution(options: StopServerFunctionExecutionOptions): Promise<StopServerFunctionExecutionResponse>;
|
|
269
213
|
listIntegrations(options?: ListIntegrationsOptions): Promise<IntegrationResponse[]>;
|
|
270
214
|
callIntegration(options: CallIntegrationOptions): Promise<CallIntegrationResponse>;
|
|
@@ -275,9 +219,6 @@ interface MitraInstance {
|
|
|
275
219
|
patchRecord(options: PatchRecordOptions): Promise<Record<string, any>>;
|
|
276
220
|
deleteRecord(options: DeleteRecordOptions): Promise<void>;
|
|
277
221
|
createRecordsBatch(options: CreateRecordsBatchOptions): Promise<Record<string, any>[]>;
|
|
278
|
-
sendPasswordResetCode(options: SendPasswordResetCodeOptions): Promise<Record<string, unknown>>;
|
|
279
|
-
validatePasswordResetCode(options: ValidatePasswordResetCodeOptions): Promise<Record<string, unknown>>;
|
|
280
|
-
resetPassword(options: ResetPasswordOptions): Promise<Record<string, unknown>>;
|
|
281
222
|
}
|
|
282
223
|
declare function createMitraInstance(initialConfig: Partial<MitraConfig>): MitraInstance;
|
|
283
224
|
|
|
@@ -325,58 +266,14 @@ declare function resolveProjectId(projectId?: number | string): number | string;
|
|
|
325
266
|
*/
|
|
326
267
|
|
|
327
268
|
declare function loginMitra(method: 'email' | 'google' | 'microsoft' | 'mitra', options?: LoginOptions): Promise<LoginResponse>;
|
|
328
|
-
declare function loginWithEmailMitra(options?: LoginOptions): Promise<LoginResponse>;
|
|
329
269
|
declare function loginWithGoogleMitra(options?: LoginOptions): Promise<LoginResponse>;
|
|
330
270
|
declare function loginWithMicrosoftMitra(options?: LoginOptions): Promise<LoginResponse>;
|
|
331
|
-
declare function emailSignupMitra(options: EmailSignupOptions): Promise<void>;
|
|
332
|
-
declare function emailLoginMitra(options: EmailLoginOptions): Promise<LoginResponse>;
|
|
333
|
-
declare function emailVerifyCodeMitra(options: EmailVerifyCodeOptions): Promise<LoginResponse>;
|
|
334
|
-
declare function emailResendCodeMitra(options: EmailResendCodeOptions): Promise<void>;
|
|
335
271
|
declare function refreshTokenSilently(authUrl: string, projectId: number | string): Promise<LoginResponse>;
|
|
336
|
-
/**
|
|
337
|
-
* Gera o JWT a partir do code do SSO (novo Mitra). O app lê codeMitra/stateMitra
|
|
338
|
-
* do fragment (lógica de template) e chama aqui pra validar o nonce e trocar o
|
|
339
|
-
* code por token no BFF. Exclusivo do novo mundo — no legacy o token já vem
|
|
340
|
-
* pronto no fragment (tokenMitra).
|
|
341
|
-
*/
|
|
342
|
-
declare function exchangeSsoCodeMitra(options: {
|
|
343
|
-
code: string;
|
|
344
|
-
state: string;
|
|
345
|
-
}): Promise<LoginResponse>;
|
|
346
|
-
|
|
347
|
-
/**
|
|
348
|
-
* Mitra Interactions SDK - Password Reset (legacy backend)
|
|
349
|
-
*
|
|
350
|
-
* Endpoints públicos (sem auth) para fluxo de "esqueci minha senha".
|
|
351
|
-
* Usa um backend separado (porta 1005 ou 4133 dependendo do ambiente),
|
|
352
|
-
* resolvido a partir do `authUrl` configurado.
|
|
353
|
-
*/
|
|
354
|
-
|
|
355
|
-
/**
|
|
356
|
-
* POST /mitraspace/auth/resetPassword
|
|
357
|
-
* Envia um código de verificação por email para iniciar o fluxo de reset de senha.
|
|
358
|
-
*/
|
|
359
|
-
declare function sendPasswordResetCodeMitra(options: SendPasswordResetCodeOptions): Promise<Record<string, unknown>>;
|
|
360
|
-
/**
|
|
361
|
-
* POST /mitraspace/auth/resetPassword/validateCode
|
|
362
|
-
* Valida o código recebido por email (sem trocar a senha ainda).
|
|
363
|
-
*/
|
|
364
|
-
declare function validatePasswordResetCodeMitra(options: ValidatePasswordResetCodeOptions): Promise<Record<string, unknown>>;
|
|
365
|
-
/**
|
|
366
|
-
* PUT /mitraspace/auth/resetPassword
|
|
367
|
-
* Troca a senha usando email + código + nova senha.
|
|
368
|
-
*/
|
|
369
|
-
declare function resetPasswordMitra(options: ResetPasswordOptions): Promise<Record<string, unknown>>;
|
|
370
272
|
|
|
371
273
|
/**
|
|
372
274
|
* Mitra Interactions SDK - Services
|
|
373
275
|
*/
|
|
374
276
|
|
|
375
|
-
/**
|
|
376
|
-
* POST /interactions/executeDataLoader
|
|
377
|
-
* Executa um Data Loader
|
|
378
|
-
*/
|
|
379
|
-
declare function executeDataLoaderMitra(options: ExecuteDataLoaderOptions): Promise<ExecuteDataLoaderResponse>;
|
|
380
277
|
/**
|
|
381
278
|
* POST /interactions/executeServerFunction
|
|
382
279
|
* Executa uma Server Function de forma SÍNCRONA (timeout 60s no backend)
|
|
@@ -387,6 +284,23 @@ declare function executeServerFunctionMitra(options: ExecuteServerFunctionOption
|
|
|
387
284
|
* Executa uma Server Function de forma ASSÍNCRONA (retorna executionId imediatamente)
|
|
388
285
|
*/
|
|
389
286
|
declare function executeServerFunctionAsyncMitra(options: ExecuteServerFunctionAsyncOptions): Promise<ExecuteServerFunctionAsyncResponse>;
|
|
287
|
+
/**
|
|
288
|
+
* POST /public/serverFunction/{projectId}/{serverFunctionId}/execute
|
|
289
|
+
* Executa uma Server Function pública de forma SÍNCRONA (sem autenticação).
|
|
290
|
+
* A SF deve ter publicExecution = true. Timeout 5min.
|
|
291
|
+
*/
|
|
292
|
+
declare function executePublicServerFunctionMitra(options: ExecutePublicServerFunctionOptions): Promise<ExecutePublicServerFunctionResponse>;
|
|
293
|
+
/**
|
|
294
|
+
* POST /public/serverFunction/{projectId}/{serverFunctionId}/executeAsync
|
|
295
|
+
* Executa uma Server Function pública de forma ASSÍNCRONA (sem autenticação).
|
|
296
|
+
* Retorna executionId imediatamente. Use getPublicServerFunctionExecutionMitra para polling.
|
|
297
|
+
*/
|
|
298
|
+
declare function executePublicServerFunctionAsyncMitra(options: ExecutePublicServerFunctionOptions): Promise<ExecutePublicServerFunctionAsyncResponse>;
|
|
299
|
+
/**
|
|
300
|
+
* GET /public/serverFunction/{projectId}/execution/{executionId}
|
|
301
|
+
* Consulta o status/resultado de uma execução pública de SF (sem autenticação).
|
|
302
|
+
*/
|
|
303
|
+
declare function getPublicServerFunctionExecutionMitra(options: GetPublicServerFunctionExecutionOptions): Promise<GetPublicServerFunctionExecutionResponse>;
|
|
390
304
|
/**
|
|
391
305
|
* GET /interactions/integrations?projectId=X
|
|
392
306
|
* Lista integrações configuradas no projeto
|
|
@@ -411,4 +325,4 @@ declare function patchRecordMitra(options: PatchRecordOptions): Promise<Record<s
|
|
|
411
325
|
declare function deleteRecordMitra(options: DeleteRecordOptions): Promise<void>;
|
|
412
326
|
declare function createRecordsBatchMitra(options: CreateRecordsBatchOptions): Promise<Record<string, any>[]>;
|
|
413
327
|
|
|
414
|
-
export { type CallIntegrationOptions, type CallIntegrationResponse, type CreateRecordOptions, type CreateRecordsBatchOptions, type DeleteRecordOptions, type
|
|
328
|
+
export { type CallIntegrationOptions, type CallIntegrationResponse, type CreateRecordOptions, type CreateRecordsBatchOptions, type DeleteRecordOptions, type ExecutePublicServerFunctionAsyncResponse, type ExecutePublicServerFunctionOptions, type ExecutePublicServerFunctionResponse, type ExecuteServerFunctionAsyncOptions, type ExecuteServerFunctionAsyncResponse, type ExecuteServerFunctionOptions, type ExecuteServerFunctionResponse, type GetPublicServerFunctionExecutionOptions, type GetPublicServerFunctionExecutionResponse, type GetRecordOptions, type IntegrationResponse, type ListIntegrationsOptions, type ListRecordsOptions, type ListRecordsResponse, type LoginOptions, type LoginResponse, type MitraConfig, type MitraInstance, type PatchRecordOptions, type StopServerFunctionExecutionOptions, type StopServerFunctionExecutionResponse, type UpdateRecordOptions, callIntegrationMitra, configureSdkMitra, createMitraInstance, createRecordMitra, createRecordsBatchMitra, deleteRecordMitra, executePublicServerFunctionAsyncMitra, executePublicServerFunctionMitra, executeServerFunctionAsyncMitra, executeServerFunctionMitra, getConfig, getPublicServerFunctionExecutionMitra, getRecordMitra, listIntegrationsMitra, listRecordsMitra, loginMitra, loginWithGoogleMitra, loginWithMicrosoftMitra, patchRecordMitra, refreshTokenSilently, resolveProjectId, stopServerFunctionExecutionMitra, updateRecordMitra };
|
package/dist/index.d.ts
CHANGED
|
@@ -25,96 +25,6 @@ interface LoginResponse {
|
|
|
25
25
|
/** URL do serviço de integrações (opcional) */
|
|
26
26
|
integrationURL?: string;
|
|
27
27
|
}
|
|
28
|
-
interface EmailSignupOptions {
|
|
29
|
-
/** URL da página de auth (ex: https://validacao.mitralab.io/sdk-auth/). Opcional se já configurado via configureSdkMitra. */
|
|
30
|
-
authUrl?: string;
|
|
31
|
-
/** ID do projeto. Opcional se já configurado via configureSdkMitra. */
|
|
32
|
-
projectId?: number | string;
|
|
33
|
-
/** Nome completo do usuário */
|
|
34
|
-
name: string;
|
|
35
|
-
/** Email do usuário */
|
|
36
|
-
email: string;
|
|
37
|
-
/** Senha */
|
|
38
|
-
password: string;
|
|
39
|
-
}
|
|
40
|
-
interface EmailLoginOptions {
|
|
41
|
-
/** URL da página de auth (ex: https://validacao.mitralab.io/sdk-auth/). Opcional se já configurado via configureSdkMitra. */
|
|
42
|
-
authUrl?: string;
|
|
43
|
-
/** ID do projeto. Opcional se já configurado via configureSdkMitra. */
|
|
44
|
-
projectId?: number | string;
|
|
45
|
-
/** Email do usuário */
|
|
46
|
-
email: string;
|
|
47
|
-
/** Senha */
|
|
48
|
-
password: string;
|
|
49
|
-
}
|
|
50
|
-
interface EmailVerifyCodeOptions {
|
|
51
|
-
/** URL da página de auth. Opcional se já configurado via configureSdkMitra. */
|
|
52
|
-
authUrl?: string;
|
|
53
|
-
/** ID do projeto. Opcional se já configurado via configureSdkMitra. */
|
|
54
|
-
projectId?: number | string;
|
|
55
|
-
/** Email do usuário */
|
|
56
|
-
email: string;
|
|
57
|
-
/** Código de verificação de 6 dígitos */
|
|
58
|
-
code: string;
|
|
59
|
-
/** Senha do usuário (necessário para login automático após verificação) */
|
|
60
|
-
password: string;
|
|
61
|
-
}
|
|
62
|
-
interface EmailResendCodeOptions {
|
|
63
|
-
/** URL da página de auth. Opcional se já configurado via configureSdkMitra. */
|
|
64
|
-
authUrl?: string;
|
|
65
|
-
/** ID do projeto. Opcional se já configurado via configureSdkMitra. */
|
|
66
|
-
projectId?: number | string;
|
|
67
|
-
/** Email do usuário */
|
|
68
|
-
email: string;
|
|
69
|
-
}
|
|
70
|
-
interface SendPasswordResetCodeOptions {
|
|
71
|
-
/** Email do usuário que esqueceu a senha */
|
|
72
|
-
email: string;
|
|
73
|
-
/** ID do projeto. Default: do config global. */
|
|
74
|
-
projectId?: number | string;
|
|
75
|
-
/** URL da página de auth (opcional — usado pra derivar a API base). Default: do config global. */
|
|
76
|
-
authUrl?: string;
|
|
77
|
-
/** Override explícito da API base (ex: https://api0.mitraecp.com:1005). Default: derivado do authUrl. */
|
|
78
|
-
authApiURL?: string;
|
|
79
|
-
}
|
|
80
|
-
interface ValidatePasswordResetCodeOptions {
|
|
81
|
-
email: string;
|
|
82
|
-
/** Código de 6 dígitos recebido por email */
|
|
83
|
-
code: string;
|
|
84
|
-
projectId?: number | string;
|
|
85
|
-
authUrl?: string;
|
|
86
|
-
authApiURL?: string;
|
|
87
|
-
}
|
|
88
|
-
interface ResetPasswordOptions {
|
|
89
|
-
email: string;
|
|
90
|
-
/** Código de 6 dígitos recebido por email */
|
|
91
|
-
code: string;
|
|
92
|
-
/** Nova senha */
|
|
93
|
-
newPassword: string;
|
|
94
|
-
projectId?: number | string;
|
|
95
|
-
authUrl?: string;
|
|
96
|
-
authApiURL?: string;
|
|
97
|
-
}
|
|
98
|
-
interface ExecuteDataLoaderOptions {
|
|
99
|
-
projectId?: number | string;
|
|
100
|
-
dataLoaderId: number | string;
|
|
101
|
-
input?: Record<string, unknown>;
|
|
102
|
-
}
|
|
103
|
-
interface ExecuteDataLoaderResponse {
|
|
104
|
-
status: string;
|
|
105
|
-
result: {
|
|
106
|
-
dataLoaderId: number | string;
|
|
107
|
-
executionLog: {
|
|
108
|
-
timestamp: string;
|
|
109
|
-
rowCount: number;
|
|
110
|
-
query: string;
|
|
111
|
-
status: string;
|
|
112
|
-
fileSize?: string;
|
|
113
|
-
duration?: string;
|
|
114
|
-
};
|
|
115
|
-
message: string;
|
|
116
|
-
};
|
|
117
|
-
}
|
|
118
28
|
interface ExecuteServerFunctionOptions {
|
|
119
29
|
/** ID do projeto (opcional se já configurado via configureSdkMitra) */
|
|
120
30
|
projectId?: number | string;
|
|
@@ -149,6 +59,38 @@ interface ExecuteServerFunctionAsyncResponse {
|
|
|
149
59
|
executionStatus: string;
|
|
150
60
|
};
|
|
151
61
|
}
|
|
62
|
+
interface ExecutePublicServerFunctionOptions {
|
|
63
|
+
/** ID do projeto (tenant) */
|
|
64
|
+
projectId: number | string;
|
|
65
|
+
/** ID da Server Function (deve ter publicExecution = true) */
|
|
66
|
+
serverFunctionId: number | string;
|
|
67
|
+
/** Objeto de entrada para a função (opcional) */
|
|
68
|
+
input?: Record<string, unknown>;
|
|
69
|
+
}
|
|
70
|
+
interface ExecutePublicServerFunctionResponse {
|
|
71
|
+
executionId: string;
|
|
72
|
+
status: string;
|
|
73
|
+
output: any | null;
|
|
74
|
+
logs: string | null;
|
|
75
|
+
error: string | null;
|
|
76
|
+
durationMs: number | null;
|
|
77
|
+
}
|
|
78
|
+
interface ExecutePublicServerFunctionAsyncResponse {
|
|
79
|
+
executionId: string;
|
|
80
|
+
status: string;
|
|
81
|
+
}
|
|
82
|
+
interface GetPublicServerFunctionExecutionOptions {
|
|
83
|
+
projectId: number | string;
|
|
84
|
+
executionId: string;
|
|
85
|
+
}
|
|
86
|
+
interface GetPublicServerFunctionExecutionResponse {
|
|
87
|
+
executionId: string;
|
|
88
|
+
status: string;
|
|
89
|
+
output: any | null;
|
|
90
|
+
logs: string | null;
|
|
91
|
+
error: string | null;
|
|
92
|
+
durationMs: number | null;
|
|
93
|
+
}
|
|
152
94
|
interface ListRecordsResponse {
|
|
153
95
|
content: Record<string, any>[];
|
|
154
96
|
page: number;
|
|
@@ -262,9 +204,11 @@ interface StopServerFunctionExecutionResponse {
|
|
|
262
204
|
|
|
263
205
|
interface MitraInstance {
|
|
264
206
|
readonly config: MitraConfig;
|
|
265
|
-
executeDataLoader(options: ExecuteDataLoaderOptions): Promise<ExecuteDataLoaderResponse>;
|
|
266
207
|
executeServerFunction(options: ExecuteServerFunctionOptions): Promise<ExecuteServerFunctionResponse>;
|
|
267
208
|
executeServerFunctionAsync(options: ExecuteServerFunctionAsyncOptions): Promise<ExecuteServerFunctionAsyncResponse>;
|
|
209
|
+
executePublicServerFunction(options: ExecutePublicServerFunctionOptions): Promise<ExecutePublicServerFunctionResponse>;
|
|
210
|
+
executePublicServerFunctionAsync(options: ExecutePublicServerFunctionOptions): Promise<ExecutePublicServerFunctionAsyncResponse>;
|
|
211
|
+
getPublicServerFunctionExecution(options: GetPublicServerFunctionExecutionOptions): Promise<GetPublicServerFunctionExecutionResponse>;
|
|
268
212
|
stopServerFunctionExecution(options: StopServerFunctionExecutionOptions): Promise<StopServerFunctionExecutionResponse>;
|
|
269
213
|
listIntegrations(options?: ListIntegrationsOptions): Promise<IntegrationResponse[]>;
|
|
270
214
|
callIntegration(options: CallIntegrationOptions): Promise<CallIntegrationResponse>;
|
|
@@ -275,9 +219,6 @@ interface MitraInstance {
|
|
|
275
219
|
patchRecord(options: PatchRecordOptions): Promise<Record<string, any>>;
|
|
276
220
|
deleteRecord(options: DeleteRecordOptions): Promise<void>;
|
|
277
221
|
createRecordsBatch(options: CreateRecordsBatchOptions): Promise<Record<string, any>[]>;
|
|
278
|
-
sendPasswordResetCode(options: SendPasswordResetCodeOptions): Promise<Record<string, unknown>>;
|
|
279
|
-
validatePasswordResetCode(options: ValidatePasswordResetCodeOptions): Promise<Record<string, unknown>>;
|
|
280
|
-
resetPassword(options: ResetPasswordOptions): Promise<Record<string, unknown>>;
|
|
281
222
|
}
|
|
282
223
|
declare function createMitraInstance(initialConfig: Partial<MitraConfig>): MitraInstance;
|
|
283
224
|
|
|
@@ -325,58 +266,14 @@ declare function resolveProjectId(projectId?: number | string): number | string;
|
|
|
325
266
|
*/
|
|
326
267
|
|
|
327
268
|
declare function loginMitra(method: 'email' | 'google' | 'microsoft' | 'mitra', options?: LoginOptions): Promise<LoginResponse>;
|
|
328
|
-
declare function loginWithEmailMitra(options?: LoginOptions): Promise<LoginResponse>;
|
|
329
269
|
declare function loginWithGoogleMitra(options?: LoginOptions): Promise<LoginResponse>;
|
|
330
270
|
declare function loginWithMicrosoftMitra(options?: LoginOptions): Promise<LoginResponse>;
|
|
331
|
-
declare function emailSignupMitra(options: EmailSignupOptions): Promise<void>;
|
|
332
|
-
declare function emailLoginMitra(options: EmailLoginOptions): Promise<LoginResponse>;
|
|
333
|
-
declare function emailVerifyCodeMitra(options: EmailVerifyCodeOptions): Promise<LoginResponse>;
|
|
334
|
-
declare function emailResendCodeMitra(options: EmailResendCodeOptions): Promise<void>;
|
|
335
271
|
declare function refreshTokenSilently(authUrl: string, projectId: number | string): Promise<LoginResponse>;
|
|
336
|
-
/**
|
|
337
|
-
* Gera o JWT a partir do code do SSO (novo Mitra). O app lê codeMitra/stateMitra
|
|
338
|
-
* do fragment (lógica de template) e chama aqui pra validar o nonce e trocar o
|
|
339
|
-
* code por token no BFF. Exclusivo do novo mundo — no legacy o token já vem
|
|
340
|
-
* pronto no fragment (tokenMitra).
|
|
341
|
-
*/
|
|
342
|
-
declare function exchangeSsoCodeMitra(options: {
|
|
343
|
-
code: string;
|
|
344
|
-
state: string;
|
|
345
|
-
}): Promise<LoginResponse>;
|
|
346
|
-
|
|
347
|
-
/**
|
|
348
|
-
* Mitra Interactions SDK - Password Reset (legacy backend)
|
|
349
|
-
*
|
|
350
|
-
* Endpoints públicos (sem auth) para fluxo de "esqueci minha senha".
|
|
351
|
-
* Usa um backend separado (porta 1005 ou 4133 dependendo do ambiente),
|
|
352
|
-
* resolvido a partir do `authUrl` configurado.
|
|
353
|
-
*/
|
|
354
|
-
|
|
355
|
-
/**
|
|
356
|
-
* POST /mitraspace/auth/resetPassword
|
|
357
|
-
* Envia um código de verificação por email para iniciar o fluxo de reset de senha.
|
|
358
|
-
*/
|
|
359
|
-
declare function sendPasswordResetCodeMitra(options: SendPasswordResetCodeOptions): Promise<Record<string, unknown>>;
|
|
360
|
-
/**
|
|
361
|
-
* POST /mitraspace/auth/resetPassword/validateCode
|
|
362
|
-
* Valida o código recebido por email (sem trocar a senha ainda).
|
|
363
|
-
*/
|
|
364
|
-
declare function validatePasswordResetCodeMitra(options: ValidatePasswordResetCodeOptions): Promise<Record<string, unknown>>;
|
|
365
|
-
/**
|
|
366
|
-
* PUT /mitraspace/auth/resetPassword
|
|
367
|
-
* Troca a senha usando email + código + nova senha.
|
|
368
|
-
*/
|
|
369
|
-
declare function resetPasswordMitra(options: ResetPasswordOptions): Promise<Record<string, unknown>>;
|
|
370
272
|
|
|
371
273
|
/**
|
|
372
274
|
* Mitra Interactions SDK - Services
|
|
373
275
|
*/
|
|
374
276
|
|
|
375
|
-
/**
|
|
376
|
-
* POST /interactions/executeDataLoader
|
|
377
|
-
* Executa um Data Loader
|
|
378
|
-
*/
|
|
379
|
-
declare function executeDataLoaderMitra(options: ExecuteDataLoaderOptions): Promise<ExecuteDataLoaderResponse>;
|
|
380
277
|
/**
|
|
381
278
|
* POST /interactions/executeServerFunction
|
|
382
279
|
* Executa uma Server Function de forma SÍNCRONA (timeout 60s no backend)
|
|
@@ -387,6 +284,23 @@ declare function executeServerFunctionMitra(options: ExecuteServerFunctionOption
|
|
|
387
284
|
* Executa uma Server Function de forma ASSÍNCRONA (retorna executionId imediatamente)
|
|
388
285
|
*/
|
|
389
286
|
declare function executeServerFunctionAsyncMitra(options: ExecuteServerFunctionAsyncOptions): Promise<ExecuteServerFunctionAsyncResponse>;
|
|
287
|
+
/**
|
|
288
|
+
* POST /public/serverFunction/{projectId}/{serverFunctionId}/execute
|
|
289
|
+
* Executa uma Server Function pública de forma SÍNCRONA (sem autenticação).
|
|
290
|
+
* A SF deve ter publicExecution = true. Timeout 5min.
|
|
291
|
+
*/
|
|
292
|
+
declare function executePublicServerFunctionMitra(options: ExecutePublicServerFunctionOptions): Promise<ExecutePublicServerFunctionResponse>;
|
|
293
|
+
/**
|
|
294
|
+
* POST /public/serverFunction/{projectId}/{serverFunctionId}/executeAsync
|
|
295
|
+
* Executa uma Server Function pública de forma ASSÍNCRONA (sem autenticação).
|
|
296
|
+
* Retorna executionId imediatamente. Use getPublicServerFunctionExecutionMitra para polling.
|
|
297
|
+
*/
|
|
298
|
+
declare function executePublicServerFunctionAsyncMitra(options: ExecutePublicServerFunctionOptions): Promise<ExecutePublicServerFunctionAsyncResponse>;
|
|
299
|
+
/**
|
|
300
|
+
* GET /public/serverFunction/{projectId}/execution/{executionId}
|
|
301
|
+
* Consulta o status/resultado de uma execução pública de SF (sem autenticação).
|
|
302
|
+
*/
|
|
303
|
+
declare function getPublicServerFunctionExecutionMitra(options: GetPublicServerFunctionExecutionOptions): Promise<GetPublicServerFunctionExecutionResponse>;
|
|
390
304
|
/**
|
|
391
305
|
* GET /interactions/integrations?projectId=X
|
|
392
306
|
* Lista integrações configuradas no projeto
|
|
@@ -411,4 +325,4 @@ declare function patchRecordMitra(options: PatchRecordOptions): Promise<Record<s
|
|
|
411
325
|
declare function deleteRecordMitra(options: DeleteRecordOptions): Promise<void>;
|
|
412
326
|
declare function createRecordsBatchMitra(options: CreateRecordsBatchOptions): Promise<Record<string, any>[]>;
|
|
413
327
|
|
|
414
|
-
export { type CallIntegrationOptions, type CallIntegrationResponse, type CreateRecordOptions, type CreateRecordsBatchOptions, type DeleteRecordOptions, type
|
|
328
|
+
export { type CallIntegrationOptions, type CallIntegrationResponse, type CreateRecordOptions, type CreateRecordsBatchOptions, type DeleteRecordOptions, type ExecutePublicServerFunctionAsyncResponse, type ExecutePublicServerFunctionOptions, type ExecutePublicServerFunctionResponse, type ExecuteServerFunctionAsyncOptions, type ExecuteServerFunctionAsyncResponse, type ExecuteServerFunctionOptions, type ExecuteServerFunctionResponse, type GetPublicServerFunctionExecutionOptions, type GetPublicServerFunctionExecutionResponse, type GetRecordOptions, type IntegrationResponse, type ListIntegrationsOptions, type ListRecordsOptions, type ListRecordsResponse, type LoginOptions, type LoginResponse, type MitraConfig, type MitraInstance, type PatchRecordOptions, type StopServerFunctionExecutionOptions, type StopServerFunctionExecutionResponse, type UpdateRecordOptions, callIntegrationMitra, configureSdkMitra, createMitraInstance, createRecordMitra, createRecordsBatchMitra, deleteRecordMitra, executePublicServerFunctionAsyncMitra, executePublicServerFunctionMitra, executeServerFunctionAsyncMitra, executeServerFunctionMitra, getConfig, getPublicServerFunctionExecutionMitra, getRecordMitra, listIntegrationsMitra, listRecordsMitra, loginMitra, loginWithGoogleMitra, loginWithMicrosoftMitra, patchRecordMitra, refreshTokenSilently, resolveProjectId, stopServerFunctionExecutionMitra, updateRecordMitra };
|