mitra-interactions-sdk 1.0.60-beta.11 → 1.0.60-beta.13
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 +3 -3
- package/dist/index.d.mts +12 -123
- package/dist/index.d.ts +12 -123
- package/dist/index.js +110 -112
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +110 -106
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
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
|
|
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
|
|
545
|
+
const result = await executeServerFunctionMitra({
|
|
546
546
|
projectId: 123,
|
|
547
|
-
|
|
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
|
*
|
|
@@ -974,6 +881,13 @@ declare function emailLoginMitra(options: EmailLoginOptions): Promise<LoginRespo
|
|
|
974
881
|
declare function emailVerifyCodeMitra(options: EmailVerifyCodeOptions): Promise<LoginResponse>;
|
|
975
882
|
declare function emailResendCodeMitra(options: EmailResendCodeOptions): Promise<void>;
|
|
976
883
|
declare function refreshTokenSilently(authUrl: string, projectId: number | string): Promise<LoginResponse>;
|
|
884
|
+
/**
|
|
885
|
+
* Conclui o SSO em modo redirect (novo Mitra). O app chama no boot: se houver
|
|
886
|
+
* codeMitra/stateMitra no fragment, valida e troca o code por token. Retorna null
|
|
887
|
+
* quando não há retorno de SSO pendente. Exclusivo do novo mundo — o legacy trata
|
|
888
|
+
* o retorno de redirect pelo próprio template (tokenMitra no fragment).
|
|
889
|
+
*/
|
|
890
|
+
declare function completeSsoRedirectMitra(): Promise<LoginResponse | null>;
|
|
977
891
|
|
|
978
892
|
/**
|
|
979
893
|
* Mitra Interactions SDK - Password Reset (legacy backend)
|
|
@@ -1099,36 +1013,11 @@ declare function manageAgentCredentialMitra<R = ManageAgentCredentialResult>(opt
|
|
|
1099
1013
|
* Executa um Data Loader
|
|
1100
1014
|
*/
|
|
1101
1015
|
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
1016
|
/**
|
|
1108
1017
|
* POST /interactions/setFileStatus
|
|
1109
1018
|
* Move arquivo do chat para PUBLIC ou LOADABLE
|
|
1110
1019
|
*/
|
|
1111
1020
|
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
1021
|
/**
|
|
1133
1022
|
* POST /interactions/executeServerFunction
|
|
1134
1023
|
* Executa uma Server Function de forma SÍNCRONA (timeout 60s no backend)
|
|
@@ -1245,4 +1134,4 @@ declare function setProfileScreensMitra(options: SetProfileScreensOptions): Prom
|
|
|
1245
1134
|
*/
|
|
1246
1135
|
declare function setProfileServerFunctionsMitra(options: SetProfileServerFunctionsOptions): Promise<SetProfilePermissionResponse>;
|
|
1247
1136
|
|
|
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
|
|
1137
|
+
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, completeSsoRedirectMitra, 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
|
*
|
|
@@ -974,6 +881,13 @@ declare function emailLoginMitra(options: EmailLoginOptions): Promise<LoginRespo
|
|
|
974
881
|
declare function emailVerifyCodeMitra(options: EmailVerifyCodeOptions): Promise<LoginResponse>;
|
|
975
882
|
declare function emailResendCodeMitra(options: EmailResendCodeOptions): Promise<void>;
|
|
976
883
|
declare function refreshTokenSilently(authUrl: string, projectId: number | string): Promise<LoginResponse>;
|
|
884
|
+
/**
|
|
885
|
+
* Conclui o SSO em modo redirect (novo Mitra). O app chama no boot: se houver
|
|
886
|
+
* codeMitra/stateMitra no fragment, valida e troca o code por token. Retorna null
|
|
887
|
+
* quando não há retorno de SSO pendente. Exclusivo do novo mundo — o legacy trata
|
|
888
|
+
* o retorno de redirect pelo próprio template (tokenMitra no fragment).
|
|
889
|
+
*/
|
|
890
|
+
declare function completeSsoRedirectMitra(): Promise<LoginResponse | null>;
|
|
977
891
|
|
|
978
892
|
/**
|
|
979
893
|
* Mitra Interactions SDK - Password Reset (legacy backend)
|
|
@@ -1099,36 +1013,11 @@ declare function manageAgentCredentialMitra<R = ManageAgentCredentialResult>(opt
|
|
|
1099
1013
|
* Executa um Data Loader
|
|
1100
1014
|
*/
|
|
1101
1015
|
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
1016
|
/**
|
|
1108
1017
|
* POST /interactions/setFileStatus
|
|
1109
1018
|
* Move arquivo do chat para PUBLIC ou LOADABLE
|
|
1110
1019
|
*/
|
|
1111
1020
|
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
1021
|
/**
|
|
1133
1022
|
* POST /interactions/executeServerFunction
|
|
1134
1023
|
* Executa uma Server Function de forma SÍNCRONA (timeout 60s no backend)
|
|
@@ -1245,4 +1134,4 @@ declare function setProfileScreensMitra(options: SetProfileScreensOptions): Prom
|
|
|
1245
1134
|
*/
|
|
1246
1135
|
declare function setProfileServerFunctionsMitra(options: SetProfileServerFunctionsOptions): Promise<SetProfilePermissionResponse>;
|
|
1247
1136
|
|
|
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
|
|
1137
|
+
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, completeSsoRedirectMitra, 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 };
|