mitra-interactions-sdk 1.0.60-beta.17 → 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 CHANGED
@@ -25,48 +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 ExecuteDataLoaderOptions {
51
- projectId?: number | string;
52
- dataLoaderId: number | string;
53
- input?: Record<string, unknown>;
54
- }
55
- interface ExecuteDataLoaderResponse {
56
- status: string;
57
- result: {
58
- dataLoaderId: number | string;
59
- executionLog: {
60
- timestamp: string;
61
- rowCount: number;
62
- query: string;
63
- status: string;
64
- fileSize?: string;
65
- duration?: string;
66
- };
67
- message: string;
68
- };
69
- }
70
28
  interface ExecuteServerFunctionOptions {
71
29
  /** ID do projeto (opcional se já configurado via configureSdkMitra) */
72
30
  projectId?: number | string;
@@ -101,6 +59,38 @@ interface ExecuteServerFunctionAsyncResponse {
101
59
  executionStatus: string;
102
60
  };
103
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
+ }
104
94
  interface ListRecordsResponse {
105
95
  content: Record<string, any>[];
106
96
  page: number;
@@ -214,9 +204,11 @@ interface StopServerFunctionExecutionResponse {
214
204
 
215
205
  interface MitraInstance {
216
206
  readonly config: MitraConfig;
217
- executeDataLoader(options: ExecuteDataLoaderOptions): Promise<ExecuteDataLoaderResponse>;
218
207
  executeServerFunction(options: ExecuteServerFunctionOptions): Promise<ExecuteServerFunctionResponse>;
219
208
  executeServerFunctionAsync(options: ExecuteServerFunctionAsyncOptions): Promise<ExecuteServerFunctionAsyncResponse>;
209
+ executePublicServerFunction(options: ExecutePublicServerFunctionOptions): Promise<ExecutePublicServerFunctionResponse>;
210
+ executePublicServerFunctionAsync(options: ExecutePublicServerFunctionOptions): Promise<ExecutePublicServerFunctionAsyncResponse>;
211
+ getPublicServerFunctionExecution(options: GetPublicServerFunctionExecutionOptions): Promise<GetPublicServerFunctionExecutionResponse>;
220
212
  stopServerFunctionExecution(options: StopServerFunctionExecutionOptions): Promise<StopServerFunctionExecutionResponse>;
221
213
  listIntegrations(options?: ListIntegrationsOptions): Promise<IntegrationResponse[]>;
222
214
  callIntegration(options: CallIntegrationOptions): Promise<CallIntegrationResponse>;
@@ -274,32 +266,14 @@ declare function resolveProjectId(projectId?: number | string): number | string;
274
266
  */
275
267
 
276
268
  declare function loginMitra(method: 'email' | 'google' | 'microsoft' | 'mitra', options?: LoginOptions): Promise<LoginResponse>;
277
- declare function loginWithEmailMitra(options?: LoginOptions): Promise<LoginResponse>;
278
269
  declare function loginWithGoogleMitra(options?: LoginOptions): Promise<LoginResponse>;
279
270
  declare function loginWithMicrosoftMitra(options?: LoginOptions): Promise<LoginResponse>;
280
- declare function emailSignupMitra(options: EmailSignupOptions): Promise<void>;
281
- declare function emailLoginMitra(options: EmailLoginOptions): Promise<LoginResponse>;
282
271
  declare function refreshTokenSilently(authUrl: string, projectId: number | string): Promise<LoginResponse>;
283
- /**
284
- * Gera o JWT a partir do code do SSO (novo Mitra). O app lê codeMitra/stateMitra
285
- * do fragment (lógica de template) e chama aqui pra validar o nonce e trocar o
286
- * code por token no BFF. Exclusivo do novo mundo — no legacy o token já vem
287
- * pronto no fragment (tokenMitra).
288
- */
289
- declare function exchangeSsoCodeMitra(options: {
290
- code: string;
291
- state: string;
292
- }): Promise<LoginResponse>;
293
272
 
294
273
  /**
295
274
  * Mitra Interactions SDK - Services
296
275
  */
297
276
 
298
- /**
299
- * POST /interactions/executeDataLoader
300
- * Executa um Data Loader
301
- */
302
- declare function executeDataLoaderMitra(options: ExecuteDataLoaderOptions): Promise<ExecuteDataLoaderResponse>;
303
277
  /**
304
278
  * POST /interactions/executeServerFunction
305
279
  * Executa uma Server Function de forma SÍNCRONA (timeout 60s no backend)
@@ -310,6 +284,23 @@ declare function executeServerFunctionMitra(options: ExecuteServerFunctionOption
310
284
  * Executa uma Server Function de forma ASSÍNCRONA (retorna executionId imediatamente)
311
285
  */
312
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>;
313
304
  /**
314
305
  * GET /interactions/integrations?projectId=X
315
306
  * Lista integrações configuradas no projeto
@@ -334,4 +325,4 @@ declare function patchRecordMitra(options: PatchRecordOptions): Promise<Record<s
334
325
  declare function deleteRecordMitra(options: DeleteRecordOptions): Promise<void>;
335
326
  declare function createRecordsBatchMitra(options: CreateRecordsBatchOptions): Promise<Record<string, any>[]>;
336
327
 
337
- export { type CallIntegrationOptions, type CallIntegrationResponse, type CreateRecordOptions, type CreateRecordsBatchOptions, type DeleteRecordOptions, type EmailLoginOptions, type EmailSignupOptions, type ExecuteDataLoaderOptions, type ExecuteDataLoaderResponse, type ExecuteServerFunctionAsyncOptions, type ExecuteServerFunctionAsyncResponse, type ExecuteServerFunctionOptions, type ExecuteServerFunctionResponse, 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, emailLoginMitra, emailSignupMitra, exchangeSsoCodeMitra, executeDataLoaderMitra, executeServerFunctionAsyncMitra, executeServerFunctionMitra, getConfig, getRecordMitra, listIntegrationsMitra, listRecordsMitra, loginMitra, loginWithEmailMitra, loginWithGoogleMitra, loginWithMicrosoftMitra, patchRecordMitra, refreshTokenSilently, resolveProjectId, stopServerFunctionExecutionMitra, updateRecordMitra };
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,48 +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 ExecuteDataLoaderOptions {
51
- projectId?: number | string;
52
- dataLoaderId: number | string;
53
- input?: Record<string, unknown>;
54
- }
55
- interface ExecuteDataLoaderResponse {
56
- status: string;
57
- result: {
58
- dataLoaderId: number | string;
59
- executionLog: {
60
- timestamp: string;
61
- rowCount: number;
62
- query: string;
63
- status: string;
64
- fileSize?: string;
65
- duration?: string;
66
- };
67
- message: string;
68
- };
69
- }
70
28
  interface ExecuteServerFunctionOptions {
71
29
  /** ID do projeto (opcional se já configurado via configureSdkMitra) */
72
30
  projectId?: number | string;
@@ -101,6 +59,38 @@ interface ExecuteServerFunctionAsyncResponse {
101
59
  executionStatus: string;
102
60
  };
103
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
+ }
104
94
  interface ListRecordsResponse {
105
95
  content: Record<string, any>[];
106
96
  page: number;
@@ -214,9 +204,11 @@ interface StopServerFunctionExecutionResponse {
214
204
 
215
205
  interface MitraInstance {
216
206
  readonly config: MitraConfig;
217
- executeDataLoader(options: ExecuteDataLoaderOptions): Promise<ExecuteDataLoaderResponse>;
218
207
  executeServerFunction(options: ExecuteServerFunctionOptions): Promise<ExecuteServerFunctionResponse>;
219
208
  executeServerFunctionAsync(options: ExecuteServerFunctionAsyncOptions): Promise<ExecuteServerFunctionAsyncResponse>;
209
+ executePublicServerFunction(options: ExecutePublicServerFunctionOptions): Promise<ExecutePublicServerFunctionResponse>;
210
+ executePublicServerFunctionAsync(options: ExecutePublicServerFunctionOptions): Promise<ExecutePublicServerFunctionAsyncResponse>;
211
+ getPublicServerFunctionExecution(options: GetPublicServerFunctionExecutionOptions): Promise<GetPublicServerFunctionExecutionResponse>;
220
212
  stopServerFunctionExecution(options: StopServerFunctionExecutionOptions): Promise<StopServerFunctionExecutionResponse>;
221
213
  listIntegrations(options?: ListIntegrationsOptions): Promise<IntegrationResponse[]>;
222
214
  callIntegration(options: CallIntegrationOptions): Promise<CallIntegrationResponse>;
@@ -274,32 +266,14 @@ declare function resolveProjectId(projectId?: number | string): number | string;
274
266
  */
275
267
 
276
268
  declare function loginMitra(method: 'email' | 'google' | 'microsoft' | 'mitra', options?: LoginOptions): Promise<LoginResponse>;
277
- declare function loginWithEmailMitra(options?: LoginOptions): Promise<LoginResponse>;
278
269
  declare function loginWithGoogleMitra(options?: LoginOptions): Promise<LoginResponse>;
279
270
  declare function loginWithMicrosoftMitra(options?: LoginOptions): Promise<LoginResponse>;
280
- declare function emailSignupMitra(options: EmailSignupOptions): Promise<void>;
281
- declare function emailLoginMitra(options: EmailLoginOptions): Promise<LoginResponse>;
282
271
  declare function refreshTokenSilently(authUrl: string, projectId: number | string): Promise<LoginResponse>;
283
- /**
284
- * Gera o JWT a partir do code do SSO (novo Mitra). O app lê codeMitra/stateMitra
285
- * do fragment (lógica de template) e chama aqui pra validar o nonce e trocar o
286
- * code por token no BFF. Exclusivo do novo mundo — no legacy o token já vem
287
- * pronto no fragment (tokenMitra).
288
- */
289
- declare function exchangeSsoCodeMitra(options: {
290
- code: string;
291
- state: string;
292
- }): Promise<LoginResponse>;
293
272
 
294
273
  /**
295
274
  * Mitra Interactions SDK - Services
296
275
  */
297
276
 
298
- /**
299
- * POST /interactions/executeDataLoader
300
- * Executa um Data Loader
301
- */
302
- declare function executeDataLoaderMitra(options: ExecuteDataLoaderOptions): Promise<ExecuteDataLoaderResponse>;
303
277
  /**
304
278
  * POST /interactions/executeServerFunction
305
279
  * Executa uma Server Function de forma SÍNCRONA (timeout 60s no backend)
@@ -310,6 +284,23 @@ declare function executeServerFunctionMitra(options: ExecuteServerFunctionOption
310
284
  * Executa uma Server Function de forma ASSÍNCRONA (retorna executionId imediatamente)
311
285
  */
312
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>;
313
304
  /**
314
305
  * GET /interactions/integrations?projectId=X
315
306
  * Lista integrações configuradas no projeto
@@ -334,4 +325,4 @@ declare function patchRecordMitra(options: PatchRecordOptions): Promise<Record<s
334
325
  declare function deleteRecordMitra(options: DeleteRecordOptions): Promise<void>;
335
326
  declare function createRecordsBatchMitra(options: CreateRecordsBatchOptions): Promise<Record<string, any>[]>;
336
327
 
337
- export { type CallIntegrationOptions, type CallIntegrationResponse, type CreateRecordOptions, type CreateRecordsBatchOptions, type DeleteRecordOptions, type EmailLoginOptions, type EmailSignupOptions, type ExecuteDataLoaderOptions, type ExecuteDataLoaderResponse, type ExecuteServerFunctionAsyncOptions, type ExecuteServerFunctionAsyncResponse, type ExecuteServerFunctionOptions, type ExecuteServerFunctionResponse, 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, emailLoginMitra, emailSignupMitra, exchangeSsoCodeMitra, executeDataLoaderMitra, executeServerFunctionAsyncMitra, executeServerFunctionMitra, getConfig, getRecordMitra, listIntegrationsMitra, listRecordsMitra, loginMitra, loginWithEmailMitra, loginWithGoogleMitra, loginWithMicrosoftMitra, patchRecordMitra, refreshTokenSilently, resolveProjectId, stopServerFunctionExecutionMitra, updateRecordMitra };
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 };