mitra-interactions-sdk 1.0.60-beta.11 → 1.0.60-beta.12

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 CHANGED
@@ -215,7 +215,7 @@ await emailSignupMitra({ name: 'João', email, password });
215
215
  const session = await emailVerifyCodeMitra({ email, code: '123456', password });
216
216
 
217
217
  // 3. SDK já está configurado — pode chamar qualquer método
218
- await executeDbActionMitra({ dbActionId: 1 });
218
+ await executeServerFunctionMitra({ serverFunctionId: 1 });
219
219
  ```
220
220
 
221
221
  > **Nota:** `authUrl` e `projectId` são opcionais em todas as funções de email se já foram configurados via `configureSdkMitra()`.
@@ -542,9 +542,9 @@ import type {
542
542
 
543
543
  ```typescript
544
544
  try {
545
- const result = await executeDbActionMitra({
545
+ const result = await executeServerFunctionMitra({
546
546
  projectId: 123,
547
- dbActionId: 456
547
+ serverFunctionId: 456
548
548
  });
549
549
  } catch (error) {
550
550
  console.log('Erro:', error.message);
package/dist/index.d.mts CHANGED
@@ -115,20 +115,6 @@ interface ExecuteDataLoaderResponse {
115
115
  message: string;
116
116
  };
117
117
  }
118
- interface ExecuteDbActionOptions {
119
- /** ID do projeto (opcional se já configurado via configureSdkMitra) */
120
- projectId?: number | string;
121
- /** ID da DBAction cadastrada */
122
- dbActionId: number | string;
123
- /** Parâmetros de entrada (opcional) — substituição de variáveis no SQL (ex: { "nome": "João" } substitui :nome) */
124
- input?: Record<string, unknown>;
125
- }
126
- interface ExecuteDbActionResponse {
127
- status: string;
128
- result: {
129
- rowsAffected: number;
130
- };
131
- }
132
118
  interface SetFileStatusOptions {
133
119
  /** ID do projeto (opcional se já configurado via configureSdkMitra) */
134
120
  projectId?: number | string;
@@ -146,21 +132,6 @@ interface SetFileStatusResponse {
146
132
  message: string;
147
133
  };
148
134
  }
149
- interface SetVariableOptions {
150
- /** ID do projeto (opcional se já configurado via configureSdkMitra) */
151
- projectId?: number | string;
152
- /** Nome da variável (key) */
153
- key: string;
154
- /** Valor da variável (opcional) */
155
- value?: string;
156
- }
157
- interface SetVariableResponse {
158
- status: string;
159
- result: {
160
- key: string;
161
- value: string;
162
- };
163
- }
164
135
  interface ExecuteServerFunctionOptions {
165
136
  /** ID do projeto (opcional se já configurado via configureSdkMitra) */
166
137
  projectId?: number | string;
@@ -297,47 +268,6 @@ interface UploadFileResponse {
297
268
  message: string;
298
269
  };
299
270
  }
300
- interface ListVariablesOptions {
301
- /** ID do projeto (opcional se já configurado via configureSdkMitra) */
302
- projectId?: number | string;
303
- }
304
- interface ListVariablesResponse {
305
- status: string;
306
- projectId: number | string;
307
- result: {
308
- key: string;
309
- value: string;
310
- }[];
311
- }
312
- interface GetVariableOptions {
313
- /** ID do projeto (opcional se já configurado via configureSdkMitra) */
314
- projectId?: number | string;
315
- /** Nome da variável (com ou sem :VAR_) */
316
- key: string;
317
- }
318
- interface GetVariableResponse {
319
- status: string;
320
- result: {
321
- key: string;
322
- value: string;
323
- };
324
- }
325
- interface RunActionOptions {
326
- /** ID do projeto (opcional se já configurado via configureSdkMitra) */
327
- projectId?: number | string;
328
- /** ID da Action a executar */
329
- actionId: number | string;
330
- /** Parâmetros de entrada para a action (opcional) */
331
- input?: Record<string, unknown>;
332
- }
333
- interface RunActionResponse {
334
- status: string;
335
- executionTime?: string;
336
- result: {
337
- stepsExecuted: number;
338
- message: string;
339
- };
340
- }
341
271
  interface CallIntegrationOptions {
342
272
  /** ID do projeto (opcional se já configurado via configureSdkMitra) */
343
273
  projectId?: number | string;
@@ -481,7 +411,7 @@ interface DeleteProfileResponse {
481
411
  interface SetProfileUsersOptions {
482
412
  projectId?: number | string;
483
413
  profileId: number | string;
484
- userIds: number[];
414
+ userIds: (number | string)[];
485
415
  }
486
416
  interface ProfileTableRef {
487
417
  tableName: string;
@@ -501,17 +431,17 @@ interface SetProfileDmlTablesOptions {
501
431
  interface SetProfileActionsOptions {
502
432
  projectId?: number | string;
503
433
  profileId: number | string;
504
- actionIds: number[];
434
+ actionIds: (number | string)[];
505
435
  }
506
436
  interface SetProfileScreensOptions {
507
437
  projectId?: number | string;
508
438
  profileId: number | string;
509
- screenIds: number[];
439
+ screenIds: (number | string)[];
510
440
  }
511
441
  interface SetProfileServerFunctionsOptions {
512
442
  projectId?: number | string;
513
443
  profileId: number | string;
514
- serverFunctionIds: number[];
444
+ serverFunctionIds: (number | string)[];
515
445
  }
516
446
  interface SetProfilePermissionResponse {
517
447
  status: string;
@@ -861,12 +791,7 @@ interface ConnectAgentSubscriptionResult {
861
791
  interface MitraInstance {
862
792
  readonly config: MitraConfig;
863
793
  executeDataLoader(options: ExecuteDataLoaderOptions): Promise<ExecuteDataLoaderResponse>;
864
- executeDbAction(options: ExecuteDbActionOptions): Promise<ExecuteDbActionResponse>;
865
794
  setFileStatus(options: SetFileStatusOptions): Promise<SetFileStatusResponse>;
866
- setVariable(options: SetVariableOptions): Promise<SetVariableResponse>;
867
- listVariables(options?: ListVariablesOptions): Promise<ListVariablesResponse>;
868
- getVariable(options: GetVariableOptions): Promise<GetVariableResponse>;
869
- runAction(options: RunActionOptions): Promise<RunActionResponse>;
870
795
  executeServerFunction(options: ExecuteServerFunctionOptions): Promise<ExecuteServerFunctionResponse>;
871
796
  executeServerFunctionAsync(options: ExecuteServerFunctionAsyncOptions): Promise<ExecuteServerFunctionAsyncResponse>;
872
797
  executePublicServerFunction(options: ExecutePublicServerFunctionOptions): Promise<ExecutePublicServerFunctionResponse>;
@@ -901,8 +826,6 @@ interface MitraInstance {
901
826
  getAgentTask(options: GetAgentTaskOptions): AgentTaskSession;
902
827
  manageAgentChat(options: ManageAgentChatOptions): Promise<unknown>;
903
828
  manageAgentCredential(options: ManageAgentCredentialOptions | ConnectAgentCredentialOptions): Promise<unknown>;
904
- openChat(): void;
905
- closeChat(): void;
906
829
  }
907
830
  declare function createMitraInstance(initialConfig: Partial<MitraConfig>): MitraInstance;
908
831
 
@@ -939,22 +862,6 @@ declare function getConfig(): MitraConfig;
939
862
  */
940
863
  declare function resolveProjectId(projectId?: number | string): number | string;
941
864
 
942
- /**
943
- * Mitra Interactions SDK - Chat Integration
944
- *
945
- * Integrates with the __mitraChat object injected by the build-proxy
946
- * in published apps. Chat is initialized automatically by configureSdkMitra().
947
- */
948
- /**
949
- * Opens the Mitra Chat sidebar.
950
- * If chat is still loading, polls until ready (max 15s).
951
- */
952
- declare function openChatMitra(): void;
953
- /**
954
- * Closes the Mitra Chat sidebar.
955
- */
956
- declare function closeChatMitra(): void;
957
-
958
865
  /**
959
866
  * Mitra Interactions SDK - Autenticação (Router)
960
867
  *
@@ -1099,36 +1006,11 @@ declare function manageAgentCredentialMitra<R = ManageAgentCredentialResult>(opt
1099
1006
  * Executa um Data Loader
1100
1007
  */
1101
1008
  declare function executeDataLoaderMitra(options: ExecuteDataLoaderOptions): Promise<ExecuteDataLoaderResponse>;
1102
- /**
1103
- * POST /interactions/executeDbAction
1104
- * Executa uma DBAction (DML) cadastrada
1105
- */
1106
- declare function executeDbActionMitra(options: ExecuteDbActionOptions): Promise<ExecuteDbActionResponse>;
1107
1009
  /**
1108
1010
  * POST /interactions/setFileStatus
1109
1011
  * Move arquivo do chat para PUBLIC ou LOADABLE
1110
1012
  */
1111
1013
  declare function setFileStatusMitra(options: SetFileStatusOptions): Promise<SetFileStatusResponse>;
1112
- /**
1113
- * POST /interactions/setVariable
1114
- * Cria ou atualiza uma variável customizada
1115
- */
1116
- declare function setVariableMitra(options: SetVariableOptions): Promise<SetVariableResponse>;
1117
- /**
1118
- * GET /interactions/listVariables?projectId={id}
1119
- * Lista variáveis de um projeto
1120
- */
1121
- declare function listVariablesMitra(options?: ListVariablesOptions): Promise<ListVariablesResponse>;
1122
- /**
1123
- * GET /interactions/getVariable?projectId={id}&key={key}
1124
- * Busca o valor de uma variável específica
1125
- */
1126
- declare function getVariableMitra(options: GetVariableOptions): Promise<GetVariableResponse>;
1127
- /**
1128
- * POST /interactions/runAction
1129
- * Executa uma Action (fluxo de ação) cadastrada
1130
- */
1131
- declare function runActionMitra(options: RunActionOptions): Promise<RunActionResponse>;
1132
1014
  /**
1133
1015
  * POST /interactions/executeServerFunction
1134
1016
  * Executa uma Server Function de forma SÍNCRONA (timeout 60s no backend)
@@ -1245,4 +1127,4 @@ declare function setProfileScreensMitra(options: SetProfileScreensOptions): Prom
1245
1127
  */
1246
1128
  declare function setProfileServerFunctionsMitra(options: SetProfileServerFunctionsOptions): Promise<SetProfilePermissionResponse>;
1247
1129
 
1248
- export { type AgentApiKeyTarget, type AgentAttachment, type AgentAttachmentType, type AgentAuthMeta, type AgentChat, type AgentDeltaEvent, type AgentErrorEvent, type AgentMessage, type AgentModelGroup, type AgentModelOption, type AgentProviderListItem, type AgentQueueChangeEvent, type AgentStatusChangeEvent, type AgentSubscriptionAccount, type AgentSubscriptionTarget, type AgentTaskCreatedEvent, type AgentTaskEventMap, type AgentTaskEventName, type AgentTaskSession, type AgentTaskStatus, type AgentToolEvent, type AgentTurnEndEvent, type AgentType, type AuthAgentCredentialOptions, type AuthAgentCredentialResult, type AuthClaudeResult, type AuthCodexResult, type AuthMethod, type CallIntegrationOptions, type CallIntegrationResponse, type ChatManageAction, type ConnectAgentCredentialOptions, type ConnectAgentSubscriptionResult, type ConnectableSubscriptionTarget, type CreateProfileOptions, type CreateProfileResponse, type CreateRecordOptions, type CreateRecordsBatchOptions, type CredentialAccessType, type CredentialAction, type CredentialTarget, type DeleteAgentChatResult, 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 GetAgentTaskCreateOptions, type GetAgentTaskOpenOptions, type GetAgentTaskOptions, type GetProfileDetailsOptions, type GetProfileDetailsResponse, type GetPublicServerFunctionExecutionOptions, type GetPublicServerFunctionExecutionResponse, type GetRecordOptions, type GetVariableOptions, type GetVariableResponse, type IntegrationResponse, type ListAgentModelsResult, type ListAgentProvidersResult, type ListIntegrationsOptions, type ListProfilesOptions, type ListProfilesResponse, type ListRecordsOptions, type ListRecordsResponse, type ListVariablesOptions, type ListVariablesResponse, type LoginOptions, type LoginResponse, type ManageAgentChatDeleteOptions, type ManageAgentChatListOptions, type ManageAgentChatOptions, type ManageAgentChatRenameOptions, type ManageAgentCredentialOptions, type ManageAgentCredentialResult, type MitraConfig, type MitraInstance, type PatchRecordOptions, type ProfileTableRef, type QueuedItem, type RenameAgentChatResult, type ResetPasswordOptions, type RunActionOptions, type RunActionResponse, type SendOptions, 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, getAgentTaskMitra, getConfig, getProfileDetailsMitra, getPublicServerFunctionExecutionMitra, getRecordMitra, getVariableMitra, listIntegrationsMitra, listProfilesMitra, listRecordsMitra, listVariablesMitra, loginMitra, loginWithEmailMitra, loginWithGoogleMitra, loginWithMicrosoftMitra, manageAgentChatMitra, manageAgentCredentialMitra, openChatMitra, patchRecordMitra, refreshTokenSilently, resetPasswordMitra, resolveProjectId, runActionMitra, sendPasswordResetCodeMitra, setFileStatusMitra, setProfileActionsMitra, setProfileDmlTablesMitra, setProfileScreensMitra, setProfileSelectTablesMitra, setProfileServerFunctionsMitra, setProfileUsersMitra, setVariableMitra, stopServerFunctionExecutionMitra, updateProfileMitra, updateRecordMitra, uploadFileLoadableMitra, uploadFilePublicMitra, validatePasswordResetCodeMitra };
1130
+ export { type AgentApiKeyTarget, type AgentAttachment, type AgentAttachmentType, type AgentAuthMeta, type AgentChat, type AgentDeltaEvent, type AgentErrorEvent, type AgentMessage, type AgentModelGroup, type AgentModelOption, type AgentProviderListItem, type AgentQueueChangeEvent, type AgentStatusChangeEvent, type AgentSubscriptionAccount, type AgentSubscriptionTarget, type AgentTaskCreatedEvent, type AgentTaskEventMap, type AgentTaskEventName, type AgentTaskSession, type AgentTaskStatus, type AgentToolEvent, type AgentTurnEndEvent, type AgentType, type AuthAgentCredentialOptions, type AuthAgentCredentialResult, type AuthClaudeResult, type AuthCodexResult, type AuthMethod, type CallIntegrationOptions, type CallIntegrationResponse, type ChatManageAction, type ConnectAgentCredentialOptions, type ConnectAgentSubscriptionResult, type ConnectableSubscriptionTarget, type CreateProfileOptions, type CreateProfileResponse, type CreateRecordOptions, type CreateRecordsBatchOptions, type CredentialAccessType, type CredentialAction, type CredentialTarget, type DeleteAgentChatResult, type DeleteProfileOptions, type DeleteProfileResponse, type DeleteRecordOptions, type EmailLoginOptions, type EmailResendCodeOptions, type EmailSignupOptions, type EmailVerifyCodeOptions, type ExecuteDataLoaderOptions, type ExecuteDataLoaderResponse, type ExecutePublicServerFunctionAsyncResponse, type ExecutePublicServerFunctionOptions, type ExecutePublicServerFunctionResponse, type ExecuteServerFunctionAsyncOptions, type ExecuteServerFunctionAsyncResponse, type ExecuteServerFunctionOptions, type ExecuteServerFunctionResponse, type GetAgentTaskCreateOptions, type GetAgentTaskOpenOptions, type GetAgentTaskOptions, type GetProfileDetailsOptions, type GetProfileDetailsResponse, type GetPublicServerFunctionExecutionOptions, type GetPublicServerFunctionExecutionResponse, type GetRecordOptions, type IntegrationResponse, type ListAgentModelsResult, type ListAgentProvidersResult, type ListIntegrationsOptions, type ListProfilesOptions, type ListProfilesResponse, type ListRecordsOptions, type ListRecordsResponse, type LoginOptions, type LoginResponse, type ManageAgentChatDeleteOptions, type ManageAgentChatListOptions, type ManageAgentChatOptions, type ManageAgentChatRenameOptions, type ManageAgentCredentialOptions, type ManageAgentCredentialResult, type MitraConfig, type MitraInstance, type PatchRecordOptions, type ProfileTableRef, type QueuedItem, type RenameAgentChatResult, type ResetPasswordOptions, type SendOptions, type SendPasswordResetCodeOptions, type SetFileStatusOptions, type SetFileStatusResponse, type SetProfileActionsOptions, type SetProfileDmlTablesOptions, type SetProfilePermissionResponse, type SetProfileScreensOptions, type SetProfileSelectTablesOptions, type SetProfileServerFunctionsOptions, type SetProfileUsersOptions, type StopServerFunctionExecutionOptions, type StopServerFunctionExecutionResponse, type UpdateProfileOptions, type UpdateProfileResponse, type UpdateRecordOptions, type UploadFileOptions, type UploadFileResponse, type ValidatePasswordResetCodeOptions, callIntegrationMitra, configureSdkMitra, createMitraInstance, createProfileMitra, createRecordMitra, createRecordsBatchMitra, deleteProfileMitra, deleteRecordMitra, emailLoginMitra, emailResendCodeMitra, emailSignupMitra, emailVerifyCodeMitra, executeDataLoaderMitra, executePublicServerFunctionAsyncMitra, executePublicServerFunctionMitra, executeServerFunctionAsyncMitra, executeServerFunctionMitra, getAgentTaskMitra, getConfig, getProfileDetailsMitra, getPublicServerFunctionExecutionMitra, getRecordMitra, listIntegrationsMitra, listProfilesMitra, listRecordsMitra, loginMitra, loginWithEmailMitra, loginWithGoogleMitra, loginWithMicrosoftMitra, manageAgentChatMitra, manageAgentCredentialMitra, patchRecordMitra, refreshTokenSilently, resetPasswordMitra, resolveProjectId, sendPasswordResetCodeMitra, setFileStatusMitra, setProfileActionsMitra, setProfileDmlTablesMitra, setProfileScreensMitra, setProfileSelectTablesMitra, setProfileServerFunctionsMitra, setProfileUsersMitra, stopServerFunctionExecutionMitra, updateProfileMitra, updateRecordMitra, uploadFileLoadableMitra, uploadFilePublicMitra, validatePasswordResetCodeMitra };
package/dist/index.d.ts CHANGED
@@ -115,20 +115,6 @@ interface ExecuteDataLoaderResponse {
115
115
  message: string;
116
116
  };
117
117
  }
118
- interface ExecuteDbActionOptions {
119
- /** ID do projeto (opcional se já configurado via configureSdkMitra) */
120
- projectId?: number | string;
121
- /** ID da DBAction cadastrada */
122
- dbActionId: number | string;
123
- /** Parâmetros de entrada (opcional) — substituição de variáveis no SQL (ex: { "nome": "João" } substitui :nome) */
124
- input?: Record<string, unknown>;
125
- }
126
- interface ExecuteDbActionResponse {
127
- status: string;
128
- result: {
129
- rowsAffected: number;
130
- };
131
- }
132
118
  interface SetFileStatusOptions {
133
119
  /** ID do projeto (opcional se já configurado via configureSdkMitra) */
134
120
  projectId?: number | string;
@@ -146,21 +132,6 @@ interface SetFileStatusResponse {
146
132
  message: string;
147
133
  };
148
134
  }
149
- interface SetVariableOptions {
150
- /** ID do projeto (opcional se já configurado via configureSdkMitra) */
151
- projectId?: number | string;
152
- /** Nome da variável (key) */
153
- key: string;
154
- /** Valor da variável (opcional) */
155
- value?: string;
156
- }
157
- interface SetVariableResponse {
158
- status: string;
159
- result: {
160
- key: string;
161
- value: string;
162
- };
163
- }
164
135
  interface ExecuteServerFunctionOptions {
165
136
  /** ID do projeto (opcional se já configurado via configureSdkMitra) */
166
137
  projectId?: number | string;
@@ -297,47 +268,6 @@ interface UploadFileResponse {
297
268
  message: string;
298
269
  };
299
270
  }
300
- interface ListVariablesOptions {
301
- /** ID do projeto (opcional se já configurado via configureSdkMitra) */
302
- projectId?: number | string;
303
- }
304
- interface ListVariablesResponse {
305
- status: string;
306
- projectId: number | string;
307
- result: {
308
- key: string;
309
- value: string;
310
- }[];
311
- }
312
- interface GetVariableOptions {
313
- /** ID do projeto (opcional se já configurado via configureSdkMitra) */
314
- projectId?: number | string;
315
- /** Nome da variável (com ou sem :VAR_) */
316
- key: string;
317
- }
318
- interface GetVariableResponse {
319
- status: string;
320
- result: {
321
- key: string;
322
- value: string;
323
- };
324
- }
325
- interface RunActionOptions {
326
- /** ID do projeto (opcional se já configurado via configureSdkMitra) */
327
- projectId?: number | string;
328
- /** ID da Action a executar */
329
- actionId: number | string;
330
- /** Parâmetros de entrada para a action (opcional) */
331
- input?: Record<string, unknown>;
332
- }
333
- interface RunActionResponse {
334
- status: string;
335
- executionTime?: string;
336
- result: {
337
- stepsExecuted: number;
338
- message: string;
339
- };
340
- }
341
271
  interface CallIntegrationOptions {
342
272
  /** ID do projeto (opcional se já configurado via configureSdkMitra) */
343
273
  projectId?: number | string;
@@ -481,7 +411,7 @@ interface DeleteProfileResponse {
481
411
  interface SetProfileUsersOptions {
482
412
  projectId?: number | string;
483
413
  profileId: number | string;
484
- userIds: number[];
414
+ userIds: (number | string)[];
485
415
  }
486
416
  interface ProfileTableRef {
487
417
  tableName: string;
@@ -501,17 +431,17 @@ interface SetProfileDmlTablesOptions {
501
431
  interface SetProfileActionsOptions {
502
432
  projectId?: number | string;
503
433
  profileId: number | string;
504
- actionIds: number[];
434
+ actionIds: (number | string)[];
505
435
  }
506
436
  interface SetProfileScreensOptions {
507
437
  projectId?: number | string;
508
438
  profileId: number | string;
509
- screenIds: number[];
439
+ screenIds: (number | string)[];
510
440
  }
511
441
  interface SetProfileServerFunctionsOptions {
512
442
  projectId?: number | string;
513
443
  profileId: number | string;
514
- serverFunctionIds: number[];
444
+ serverFunctionIds: (number | string)[];
515
445
  }
516
446
  interface SetProfilePermissionResponse {
517
447
  status: string;
@@ -861,12 +791,7 @@ interface ConnectAgentSubscriptionResult {
861
791
  interface MitraInstance {
862
792
  readonly config: MitraConfig;
863
793
  executeDataLoader(options: ExecuteDataLoaderOptions): Promise<ExecuteDataLoaderResponse>;
864
- executeDbAction(options: ExecuteDbActionOptions): Promise<ExecuteDbActionResponse>;
865
794
  setFileStatus(options: SetFileStatusOptions): Promise<SetFileStatusResponse>;
866
- setVariable(options: SetVariableOptions): Promise<SetVariableResponse>;
867
- listVariables(options?: ListVariablesOptions): Promise<ListVariablesResponse>;
868
- getVariable(options: GetVariableOptions): Promise<GetVariableResponse>;
869
- runAction(options: RunActionOptions): Promise<RunActionResponse>;
870
795
  executeServerFunction(options: ExecuteServerFunctionOptions): Promise<ExecuteServerFunctionResponse>;
871
796
  executeServerFunctionAsync(options: ExecuteServerFunctionAsyncOptions): Promise<ExecuteServerFunctionAsyncResponse>;
872
797
  executePublicServerFunction(options: ExecutePublicServerFunctionOptions): Promise<ExecutePublicServerFunctionResponse>;
@@ -901,8 +826,6 @@ interface MitraInstance {
901
826
  getAgentTask(options: GetAgentTaskOptions): AgentTaskSession;
902
827
  manageAgentChat(options: ManageAgentChatOptions): Promise<unknown>;
903
828
  manageAgentCredential(options: ManageAgentCredentialOptions | ConnectAgentCredentialOptions): Promise<unknown>;
904
- openChat(): void;
905
- closeChat(): void;
906
829
  }
907
830
  declare function createMitraInstance(initialConfig: Partial<MitraConfig>): MitraInstance;
908
831
 
@@ -939,22 +862,6 @@ declare function getConfig(): MitraConfig;
939
862
  */
940
863
  declare function resolveProjectId(projectId?: number | string): number | string;
941
864
 
942
- /**
943
- * Mitra Interactions SDK - Chat Integration
944
- *
945
- * Integrates with the __mitraChat object injected by the build-proxy
946
- * in published apps. Chat is initialized automatically by configureSdkMitra().
947
- */
948
- /**
949
- * Opens the Mitra Chat sidebar.
950
- * If chat is still loading, polls until ready (max 15s).
951
- */
952
- declare function openChatMitra(): void;
953
- /**
954
- * Closes the Mitra Chat sidebar.
955
- */
956
- declare function closeChatMitra(): void;
957
-
958
865
  /**
959
866
  * Mitra Interactions SDK - Autenticação (Router)
960
867
  *
@@ -1099,36 +1006,11 @@ declare function manageAgentCredentialMitra<R = ManageAgentCredentialResult>(opt
1099
1006
  * Executa um Data Loader
1100
1007
  */
1101
1008
  declare function executeDataLoaderMitra(options: ExecuteDataLoaderOptions): Promise<ExecuteDataLoaderResponse>;
1102
- /**
1103
- * POST /interactions/executeDbAction
1104
- * Executa uma DBAction (DML) cadastrada
1105
- */
1106
- declare function executeDbActionMitra(options: ExecuteDbActionOptions): Promise<ExecuteDbActionResponse>;
1107
1009
  /**
1108
1010
  * POST /interactions/setFileStatus
1109
1011
  * Move arquivo do chat para PUBLIC ou LOADABLE
1110
1012
  */
1111
1013
  declare function setFileStatusMitra(options: SetFileStatusOptions): Promise<SetFileStatusResponse>;
1112
- /**
1113
- * POST /interactions/setVariable
1114
- * Cria ou atualiza uma variável customizada
1115
- */
1116
- declare function setVariableMitra(options: SetVariableOptions): Promise<SetVariableResponse>;
1117
- /**
1118
- * GET /interactions/listVariables?projectId={id}
1119
- * Lista variáveis de um projeto
1120
- */
1121
- declare function listVariablesMitra(options?: ListVariablesOptions): Promise<ListVariablesResponse>;
1122
- /**
1123
- * GET /interactions/getVariable?projectId={id}&key={key}
1124
- * Busca o valor de uma variável específica
1125
- */
1126
- declare function getVariableMitra(options: GetVariableOptions): Promise<GetVariableResponse>;
1127
- /**
1128
- * POST /interactions/runAction
1129
- * Executa uma Action (fluxo de ação) cadastrada
1130
- */
1131
- declare function runActionMitra(options: RunActionOptions): Promise<RunActionResponse>;
1132
1014
  /**
1133
1015
  * POST /interactions/executeServerFunction
1134
1016
  * Executa uma Server Function de forma SÍNCRONA (timeout 60s no backend)
@@ -1245,4 +1127,4 @@ declare function setProfileScreensMitra(options: SetProfileScreensOptions): Prom
1245
1127
  */
1246
1128
  declare function setProfileServerFunctionsMitra(options: SetProfileServerFunctionsOptions): Promise<SetProfilePermissionResponse>;
1247
1129
 
1248
- export { type AgentApiKeyTarget, type AgentAttachment, type AgentAttachmentType, type AgentAuthMeta, type AgentChat, type AgentDeltaEvent, type AgentErrorEvent, type AgentMessage, type AgentModelGroup, type AgentModelOption, type AgentProviderListItem, type AgentQueueChangeEvent, type AgentStatusChangeEvent, type AgentSubscriptionAccount, type AgentSubscriptionTarget, type AgentTaskCreatedEvent, type AgentTaskEventMap, type AgentTaskEventName, type AgentTaskSession, type AgentTaskStatus, type AgentToolEvent, type AgentTurnEndEvent, type AgentType, type AuthAgentCredentialOptions, type AuthAgentCredentialResult, type AuthClaudeResult, type AuthCodexResult, type AuthMethod, type CallIntegrationOptions, type CallIntegrationResponse, type ChatManageAction, type ConnectAgentCredentialOptions, type ConnectAgentSubscriptionResult, type ConnectableSubscriptionTarget, type CreateProfileOptions, type CreateProfileResponse, type CreateRecordOptions, type CreateRecordsBatchOptions, type CredentialAccessType, type CredentialAction, type CredentialTarget, type DeleteAgentChatResult, 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 GetAgentTaskCreateOptions, type GetAgentTaskOpenOptions, type GetAgentTaskOptions, type GetProfileDetailsOptions, type GetProfileDetailsResponse, type GetPublicServerFunctionExecutionOptions, type GetPublicServerFunctionExecutionResponse, type GetRecordOptions, type GetVariableOptions, type GetVariableResponse, type IntegrationResponse, type ListAgentModelsResult, type ListAgentProvidersResult, type ListIntegrationsOptions, type ListProfilesOptions, type ListProfilesResponse, type ListRecordsOptions, type ListRecordsResponse, type ListVariablesOptions, type ListVariablesResponse, type LoginOptions, type LoginResponse, type ManageAgentChatDeleteOptions, type ManageAgentChatListOptions, type ManageAgentChatOptions, type ManageAgentChatRenameOptions, type ManageAgentCredentialOptions, type ManageAgentCredentialResult, type MitraConfig, type MitraInstance, type PatchRecordOptions, type ProfileTableRef, type QueuedItem, type RenameAgentChatResult, type ResetPasswordOptions, type RunActionOptions, type RunActionResponse, type SendOptions, 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, getAgentTaskMitra, getConfig, getProfileDetailsMitra, getPublicServerFunctionExecutionMitra, getRecordMitra, getVariableMitra, listIntegrationsMitra, listProfilesMitra, listRecordsMitra, listVariablesMitra, loginMitra, loginWithEmailMitra, loginWithGoogleMitra, loginWithMicrosoftMitra, manageAgentChatMitra, manageAgentCredentialMitra, openChatMitra, patchRecordMitra, refreshTokenSilently, resetPasswordMitra, resolveProjectId, runActionMitra, sendPasswordResetCodeMitra, setFileStatusMitra, setProfileActionsMitra, setProfileDmlTablesMitra, setProfileScreensMitra, setProfileSelectTablesMitra, setProfileServerFunctionsMitra, setProfileUsersMitra, setVariableMitra, stopServerFunctionExecutionMitra, updateProfileMitra, updateRecordMitra, uploadFileLoadableMitra, uploadFilePublicMitra, validatePasswordResetCodeMitra };
1130
+ export { type AgentApiKeyTarget, type AgentAttachment, type AgentAttachmentType, type AgentAuthMeta, type AgentChat, type AgentDeltaEvent, type AgentErrorEvent, type AgentMessage, type AgentModelGroup, type AgentModelOption, type AgentProviderListItem, type AgentQueueChangeEvent, type AgentStatusChangeEvent, type AgentSubscriptionAccount, type AgentSubscriptionTarget, type AgentTaskCreatedEvent, type AgentTaskEventMap, type AgentTaskEventName, type AgentTaskSession, type AgentTaskStatus, type AgentToolEvent, type AgentTurnEndEvent, type AgentType, type AuthAgentCredentialOptions, type AuthAgentCredentialResult, type AuthClaudeResult, type AuthCodexResult, type AuthMethod, type CallIntegrationOptions, type CallIntegrationResponse, type ChatManageAction, type ConnectAgentCredentialOptions, type ConnectAgentSubscriptionResult, type ConnectableSubscriptionTarget, type CreateProfileOptions, type CreateProfileResponse, type CreateRecordOptions, type CreateRecordsBatchOptions, type CredentialAccessType, type CredentialAction, type CredentialTarget, type DeleteAgentChatResult, type DeleteProfileOptions, type DeleteProfileResponse, type DeleteRecordOptions, type EmailLoginOptions, type EmailResendCodeOptions, type EmailSignupOptions, type EmailVerifyCodeOptions, type ExecuteDataLoaderOptions, type ExecuteDataLoaderResponse, type ExecutePublicServerFunctionAsyncResponse, type ExecutePublicServerFunctionOptions, type ExecutePublicServerFunctionResponse, type ExecuteServerFunctionAsyncOptions, type ExecuteServerFunctionAsyncResponse, type ExecuteServerFunctionOptions, type ExecuteServerFunctionResponse, type GetAgentTaskCreateOptions, type GetAgentTaskOpenOptions, type GetAgentTaskOptions, type GetProfileDetailsOptions, type GetProfileDetailsResponse, type GetPublicServerFunctionExecutionOptions, type GetPublicServerFunctionExecutionResponse, type GetRecordOptions, type IntegrationResponse, type ListAgentModelsResult, type ListAgentProvidersResult, type ListIntegrationsOptions, type ListProfilesOptions, type ListProfilesResponse, type ListRecordsOptions, type ListRecordsResponse, type LoginOptions, type LoginResponse, type ManageAgentChatDeleteOptions, type ManageAgentChatListOptions, type ManageAgentChatOptions, type ManageAgentChatRenameOptions, type ManageAgentCredentialOptions, type ManageAgentCredentialResult, type MitraConfig, type MitraInstance, type PatchRecordOptions, type ProfileTableRef, type QueuedItem, type RenameAgentChatResult, type ResetPasswordOptions, type SendOptions, type SendPasswordResetCodeOptions, type SetFileStatusOptions, type SetFileStatusResponse, type SetProfileActionsOptions, type SetProfileDmlTablesOptions, type SetProfilePermissionResponse, type SetProfileScreensOptions, type SetProfileSelectTablesOptions, type SetProfileServerFunctionsOptions, type SetProfileUsersOptions, type StopServerFunctionExecutionOptions, type StopServerFunctionExecutionResponse, type UpdateProfileOptions, type UpdateProfileResponse, type UpdateRecordOptions, type UploadFileOptions, type UploadFileResponse, type ValidatePasswordResetCodeOptions, callIntegrationMitra, configureSdkMitra, createMitraInstance, createProfileMitra, createRecordMitra, createRecordsBatchMitra, deleteProfileMitra, deleteRecordMitra, emailLoginMitra, emailResendCodeMitra, emailSignupMitra, emailVerifyCodeMitra, executeDataLoaderMitra, executePublicServerFunctionAsyncMitra, executePublicServerFunctionMitra, executeServerFunctionAsyncMitra, executeServerFunctionMitra, getAgentTaskMitra, getConfig, getProfileDetailsMitra, getPublicServerFunctionExecutionMitra, getRecordMitra, listIntegrationsMitra, listProfilesMitra, listRecordsMitra, loginMitra, loginWithEmailMitra, loginWithGoogleMitra, loginWithMicrosoftMitra, manageAgentChatMitra, manageAgentCredentialMitra, patchRecordMitra, refreshTokenSilently, resetPasswordMitra, resolveProjectId, sendPasswordResetCodeMitra, setFileStatusMitra, setProfileActionsMitra, setProfileDmlTablesMitra, setProfileScreensMitra, setProfileSelectTablesMitra, setProfileServerFunctionsMitra, setProfileUsersMitra, stopServerFunctionExecutionMitra, updateProfileMitra, updateRecordMitra, uploadFileLoadableMitra, uploadFilePublicMitra, validatePasswordResetCodeMitra };
package/dist/index.js CHANGED
@@ -549,29 +549,6 @@ async function refreshTokenSilently3(authUrl, projectId) {
549
549
  return isLegacyAuthUrl(authUrl) ? refreshTokenSilently(authUrl, projectId) : refreshTokenSilently2(authUrl);
550
550
  }
551
551
 
552
- // src/chat.ts
553
- function openChatMitra() {
554
- if (typeof window === "undefined") return;
555
- const chat = window.__mitraChat;
556
- if (!chat) return;
557
- if (chat.isReady) {
558
- chat.open();
559
- } else {
560
- const iv = setInterval(() => {
561
- if (chat.isReady) {
562
- clearInterval(iv);
563
- chat.open();
564
- }
565
- }, 200);
566
- setTimeout(() => clearInterval(iv), 15e3);
567
- }
568
- }
569
- function closeChatMitra() {
570
- var _a;
571
- if (typeof window === "undefined") return;
572
- (_a = window.__mitraChat) == null ? void 0 : _a.close();
573
- }
574
-
575
552
  // src/password-reset.ts
576
553
  var AUTH_API_BY_AUTH_URL = {
577
554
  "https://coder.mitralab.io/sdk-auth/": "https://api0.mitraecp.com:1005",
@@ -855,16 +832,6 @@ async function executeDataLoaderMitra(options) {
855
832
  if (options.input !== void 0) body.input = options.input;
856
833
  return http.post("/interactions/executeDataLoader", body);
857
834
  }
858
- async function executeDbActionMitra(options) {
859
- const body = {
860
- projectId: resolveProjectId2(options.projectId),
861
- dbActionId: options.dbActionId
862
- };
863
- if (options.input !== void 0) {
864
- body.input = options.input;
865
- }
866
- return http.post("/interactions/executeDbAction", body);
867
- }
868
835
  async function setFileStatusMitra(options) {
869
836
  return http.post("/interactions/setFileStatus", {
870
837
  projectId: resolveProjectId2(options.projectId),
@@ -872,37 +839,6 @@ async function setFileStatusMitra(options) {
872
839
  targetPath: options.targetPath
873
840
  });
874
841
  }
875
- async function setVariableMitra(options) {
876
- const body = {
877
- projectId: resolveProjectId2(options.projectId),
878
- key: options.key
879
- };
880
- if (options.value !== void 0) {
881
- body.value = options.value;
882
- }
883
- return http.post("/interactions/setVariable", body);
884
- }
885
- async function listVariablesMitra(options = {}) {
886
- return http.get("/interactions/listVariables", {
887
- projectId: resolveProjectId2(options.projectId)
888
- });
889
- }
890
- async function getVariableMitra(options) {
891
- return http.get("/interactions/getVariable", {
892
- projectId: resolveProjectId2(options.projectId),
893
- key: options.key
894
- });
895
- }
896
- async function runActionMitra(options) {
897
- const body = {
898
- projectId: resolveProjectId2(options.projectId),
899
- actionId: options.actionId
900
- };
901
- if (options.input !== void 0) {
902
- body.input = options.input;
903
- }
904
- return http.post("/interactions/runAction", body);
905
- }
906
842
  async function executeServerFunctionMitra(options) {
907
843
  const body = {
908
844
  projectId: resolveProjectId2(options.projectId),
@@ -2118,32 +2054,11 @@ function createMitraInstance(initialConfig) {
2118
2054
  if (options.input !== void 0) body.input = options.input;
2119
2055
  return request("POST", "/interactions/executeDataLoader", { body });
2120
2056
  },
2121
- async executeDbAction(options) {
2122
- const body = { projectId: resolveProjectId4(options.projectId), dbActionId: options.dbActionId };
2123
- if (options.input !== void 0) body.input = options.input;
2124
- return request("POST", "/interactions/executeDbAction", { body });
2125
- },
2126
2057
  async setFileStatus(options) {
2127
2058
  return request("POST", "/interactions/setFileStatus", {
2128
2059
  body: { projectId: resolveProjectId4(options.projectId), fileName: options.fileName, targetPath: options.targetPath }
2129
2060
  });
2130
2061
  },
2131
- async setVariable(options) {
2132
- const body = { projectId: resolveProjectId4(options.projectId), key: options.key };
2133
- if (options.value !== void 0) body.value = options.value;
2134
- return request("POST", "/interactions/setVariable", { body });
2135
- },
2136
- async listVariables(options = {}) {
2137
- return request("GET", "/interactions/listVariables", { params: { projectId: resolveProjectId4(options.projectId) } });
2138
- },
2139
- async getVariable(options) {
2140
- return request("GET", "/interactions/getVariable", { params: { projectId: resolveProjectId4(options.projectId), key: options.key } });
2141
- },
2142
- async runAction(options) {
2143
- const body = { projectId: resolveProjectId4(options.projectId), actionId: options.actionId };
2144
- if (options.input !== void 0) body.input = options.input;
2145
- return request("POST", "/interactions/runAction", { body });
2146
- },
2147
2062
  async executeServerFunction(options) {
2148
2063
  const body = { projectId: resolveProjectId4(options.projectId), serverFunctionId: options.serverFunctionId };
2149
2064
  if (options.input !== void 0) body.input = options.input;
@@ -2332,13 +2247,6 @@ function createMitraInstance(initialConfig) {
2332
2247
  },
2333
2248
  manageAgentCredential(options) {
2334
2249
  return manageAgentCredentialMitra(options);
2335
- },
2336
- // Chat
2337
- openChat() {
2338
- openChatMitra();
2339
- },
2340
- closeChat() {
2341
- closeChatMitra();
2342
2250
  }
2343
2251
  };
2344
2252
  return instance;
@@ -2419,10 +2327,6 @@ function configureSdkMitra(config = {}) {
2419
2327
  ...merged,
2420
2328
  baseURL: merged.baseURL.replace(/\/+$/, "")
2421
2329
  };
2422
- if (merged.token && typeof window !== "undefined") {
2423
- const chat = window.__mitraChat;
2424
- if (chat) chat.init(merged.token);
2425
- }
2426
2330
  return createMitraInstance(globalConfig);
2427
2331
  }
2428
2332
  function getConfig() {
@@ -2451,7 +2355,6 @@ function resolveProjectId2(projectId) {
2451
2355
  }
2452
2356
 
2453
2357
  exports.callIntegrationMitra = callIntegrationMitra;
2454
- exports.closeChatMitra = closeChatMitra;
2455
2358
  exports.configureSdkMitra = configureSdkMitra;
2456
2359
  exports.createMitraInstance = createMitraInstance;
2457
2360
  exports.createProfileMitra = createProfileMitra;
@@ -2464,7 +2367,6 @@ exports.emailResendCodeMitra = emailResendCodeMitra3;
2464
2367
  exports.emailSignupMitra = emailSignupMitra3;
2465
2368
  exports.emailVerifyCodeMitra = emailVerifyCodeMitra3;
2466
2369
  exports.executeDataLoaderMitra = executeDataLoaderMitra;
2467
- exports.executeDbActionMitra = executeDbActionMitra;
2468
2370
  exports.executePublicServerFunctionAsyncMitra = executePublicServerFunctionAsyncMitra;
2469
2371
  exports.executePublicServerFunctionMitra = executePublicServerFunctionMitra;
2470
2372
  exports.executeServerFunctionAsyncMitra = executeServerFunctionAsyncMitra;
@@ -2474,23 +2376,19 @@ exports.getConfig = getConfig;
2474
2376
  exports.getProfileDetailsMitra = getProfileDetailsMitra;
2475
2377
  exports.getPublicServerFunctionExecutionMitra = getPublicServerFunctionExecutionMitra;
2476
2378
  exports.getRecordMitra = getRecordMitra;
2477
- exports.getVariableMitra = getVariableMitra;
2478
2379
  exports.listIntegrationsMitra = listIntegrationsMitra;
2479
2380
  exports.listProfilesMitra = listProfilesMitra;
2480
2381
  exports.listRecordsMitra = listRecordsMitra;
2481
- exports.listVariablesMitra = listVariablesMitra;
2482
2382
  exports.loginMitra = loginMitra3;
2483
2383
  exports.loginWithEmailMitra = loginWithEmailMitra3;
2484
2384
  exports.loginWithGoogleMitra = loginWithGoogleMitra3;
2485
2385
  exports.loginWithMicrosoftMitra = loginWithMicrosoftMitra3;
2486
2386
  exports.manageAgentChatMitra = manageAgentChatMitra;
2487
2387
  exports.manageAgentCredentialMitra = manageAgentCredentialMitra;
2488
- exports.openChatMitra = openChatMitra;
2489
2388
  exports.patchRecordMitra = patchRecordMitra;
2490
2389
  exports.refreshTokenSilently = refreshTokenSilently3;
2491
2390
  exports.resetPasswordMitra = resetPasswordMitra;
2492
2391
  exports.resolveProjectId = resolveProjectId2;
2493
- exports.runActionMitra = runActionMitra;
2494
2392
  exports.sendPasswordResetCodeMitra = sendPasswordResetCodeMitra;
2495
2393
  exports.setFileStatusMitra = setFileStatusMitra;
2496
2394
  exports.setProfileActionsMitra = setProfileActionsMitra;
@@ -2499,7 +2397,6 @@ exports.setProfileScreensMitra = setProfileScreensMitra;
2499
2397
  exports.setProfileSelectTablesMitra = setProfileSelectTablesMitra;
2500
2398
  exports.setProfileServerFunctionsMitra = setProfileServerFunctionsMitra;
2501
2399
  exports.setProfileUsersMitra = setProfileUsersMitra;
2502
- exports.setVariableMitra = setVariableMitra;
2503
2400
  exports.stopServerFunctionExecutionMitra = stopServerFunctionExecutionMitra;
2504
2401
  exports.updateProfileMitra = updateProfileMitra;
2505
2402
  exports.updateRecordMitra = updateRecordMitra;