mitra-interactions-sdk 1.0.65 → 1.0.66
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 +769 -725
- package/dist/index.d.mts +67 -8
- package/dist/index.d.ts +67 -8
- package/dist/index.js +17 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +17 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +52 -52
package/dist/index.d.mts
CHANGED
|
@@ -290,7 +290,15 @@ interface UploadFileResponse {
|
|
|
290
290
|
status: string;
|
|
291
291
|
result: {
|
|
292
292
|
fileName: string;
|
|
293
|
+
/** No PUBLIC é a URL completa; no PRIVATE/LOADABLE é a chave relativa. Prefira `key`. */
|
|
293
294
|
currentPath: string;
|
|
295
|
+
/**
|
|
296
|
+
* Chave relativa do objeto. No PRIVATE: `ai-files/private/{24 chars aleatórios}/nome` — não é
|
|
297
|
+
* adivinhável e dois uploads com o mesmo nome não se sobrescrevem. Guarde-a na tabela da
|
|
298
|
+
* aplicação, na linha do registro dono; é ela que a Server Function usa para liberar o
|
|
299
|
+
* arquivo. (Backends anteriores ao TKT-000a0394 não a enviam.)
|
|
300
|
+
*/
|
|
301
|
+
key?: string;
|
|
294
302
|
publicUrl: string | null;
|
|
295
303
|
message: string;
|
|
296
304
|
};
|
|
@@ -298,20 +306,59 @@ interface UploadFileResponse {
|
|
|
298
306
|
interface DownloadFileOptions {
|
|
299
307
|
/** ID do projeto (opcional se já configurado via configureSdkMitra) */
|
|
300
308
|
projectId?: number;
|
|
301
|
-
/**
|
|
309
|
+
/**
|
|
310
|
+
* Chave do arquivo: `result.key` do upload (`ai-files/private/{aleatório}/nome`, ou
|
|
311
|
+
* `ai-files/{public|loadable}/nome`). Também aceita `result.currentPath`, inclusive a URL
|
|
312
|
+
* pública de um upload PUBLIC do mesmo projeto. Chave fora dessas pastas é recusada com 400.
|
|
313
|
+
*
|
|
314
|
+
* Permissão: só usuário DEV do projeto ou Server Function em execução. Tela de usuário final
|
|
315
|
+
* NÃO chama isto — pede o anexo pelo registro a uma SF (ver README, "Anexos").
|
|
316
|
+
*/
|
|
302
317
|
key: string;
|
|
303
318
|
}
|
|
319
|
+
interface FileLinkOptions {
|
|
320
|
+
/** ID do projeto (opcional se já configurado via configureSdkMitra) */
|
|
321
|
+
projectId?: number;
|
|
322
|
+
/** Chave do arquivo — mesma regra de `DownloadFileOptions.key` */
|
|
323
|
+
key: string;
|
|
324
|
+
/** Validade em segundos (padrão 300 no backend; máximo configurado no backend, 3600 por padrão) */
|
|
325
|
+
ttlSeconds?: number;
|
|
326
|
+
}
|
|
327
|
+
/**
|
|
328
|
+
* Sucesso: `{ status: "success", result }`. Erro: `{ status: "error", error: { code, message } }`
|
|
329
|
+
* com HTTP 400 (INVALID_KEY/MISSING_*), 403 (ACCESS_DENIED), 404 (FILE_NOT_FOUND), 500.
|
|
330
|
+
*/
|
|
331
|
+
interface FileLinkResponse {
|
|
332
|
+
status: string;
|
|
333
|
+
result?: {
|
|
334
|
+
key: string;
|
|
335
|
+
/** URL assinada; vale até `expiresAt` */
|
|
336
|
+
url: string;
|
|
337
|
+
expiresAt: string;
|
|
338
|
+
expiresInSeconds: number;
|
|
339
|
+
};
|
|
340
|
+
error?: {
|
|
341
|
+
code: string;
|
|
342
|
+
message: string;
|
|
343
|
+
};
|
|
344
|
+
}
|
|
304
345
|
interface DeleteFileOptions {
|
|
305
346
|
/** ID do projeto (opcional se já configurado via configureSdkMitra) */
|
|
306
347
|
projectId?: number;
|
|
307
|
-
/** Chave do arquivo
|
|
348
|
+
/** Chave do arquivo — mesma regra de `DownloadFileOptions.key`. Exclui exatamente um objeto. */
|
|
308
349
|
key: string;
|
|
309
350
|
}
|
|
351
|
+
/**
|
|
352
|
+
* Sucesso: `{ status: "success", result }`. Erro: `{ status: "error", error: { code, message } }`
|
|
353
|
+
* com code MISSING_KEY | INVALID_KEY | ACCESS_DENIED (usuário sem perfil DEV no projeto ou API key
|
|
354
|
+
* BUSINESS) | FILE_NOT_FOUND (nada apagado) | INTERNAL_ERROR.
|
|
355
|
+
*/
|
|
310
356
|
interface DeleteFileResponse {
|
|
311
357
|
status: string;
|
|
312
358
|
result: {
|
|
313
359
|
fileName: string;
|
|
314
360
|
currentPath: string;
|
|
361
|
+
key?: string;
|
|
315
362
|
publicUrl: string | null;
|
|
316
363
|
message: string;
|
|
317
364
|
};
|
|
@@ -916,6 +963,7 @@ interface MitraInstance {
|
|
|
916
963
|
uploadFilePrivate(options: UploadFileOptions): Promise<UploadFileResponse>;
|
|
917
964
|
uploadFileLoadable(options: UploadFileOptions): Promise<UploadFileResponse>;
|
|
918
965
|
downloadFilePrivate(options: DownloadFileOptions): Promise<Blob>;
|
|
966
|
+
getFileLink(options: FileLinkOptions): Promise<FileLinkResponse>;
|
|
919
967
|
deleteFile(options: DeleteFileOptions): Promise<DeleteFileResponse>;
|
|
920
968
|
listIntegrations(options?: ListIntegrationsOptions): Promise<IntegrationResponse[]>;
|
|
921
969
|
callIntegration(options: CallIntegrationOptions): Promise<CallIntegrationResponse>;
|
|
@@ -1271,19 +1319,30 @@ declare function uploadFileLoadableMitra(options: UploadFileOptions): Promise<Up
|
|
|
1271
1319
|
* POST /interactions/uploadFilePrivate (multipart/form-data)
|
|
1272
1320
|
* Faz upload de um arquivo para a pasta PRIVATE do projeto. O arquivo NAO fica publico
|
|
1273
1321
|
* no S3 (sem ACL public-read) — este e o modo recomendado/padrao. O acesso e feito por
|
|
1274
|
-
* download autenticado;
|
|
1275
|
-
* `result.publicUrl` sempre vem `null` para upload privado.
|
|
1322
|
+
* download autenticado; guarde `result.key` (a chave relativa) para baixar ou excluir depois.
|
|
1323
|
+
* `result.publicUrl` sempre vem `null` para upload privado. Privado e por PROJETO, nao por
|
|
1324
|
+
* usuario: qualquer usuario do projeto que conheca a chave consegue baixar.
|
|
1276
1325
|
*/
|
|
1277
1326
|
declare function uploadFilePrivateMitra(options: UploadFileOptions): Promise<UploadFileResponse>;
|
|
1278
1327
|
/**
|
|
1279
1328
|
* GET /interactions/downloadFile
|
|
1280
|
-
* Baixa (com credencial) um arquivo
|
|
1281
|
-
* `key` é a chave retornada no upload (`result.currentPath`).
|
|
1329
|
+
* Baixa (com credencial) um arquivo do projeto e retorna o conteúdo como Blob.
|
|
1330
|
+
* `key` é a chave retornada no upload (`result.key`; `result.currentPath` também é aceito).
|
|
1331
|
+
* Permissão: usuário DEV do projeto ou Server Function em execução (403 para usuário final).
|
|
1282
1332
|
*/
|
|
1283
1333
|
declare function downloadFilePrivateMitra(options: DownloadFileOptions): Promise<Blob>;
|
|
1334
|
+
/**
|
|
1335
|
+
* GET /interactions/fileLink
|
|
1336
|
+
* Link temporário (assinado) para um arquivo do projeto. Mesma permissão do download: DEV ou
|
|
1337
|
+
* Server Function em execução. Use quando precisar exibir muitas imagens numa tela de DEV ou em
|
|
1338
|
+
* ferramental; para usuário final, a SF é quem emite o link depois de validar o registro.
|
|
1339
|
+
*/
|
|
1340
|
+
declare function getFileLinkMitra(options: FileLinkOptions): Promise<FileLinkResponse>;
|
|
1284
1341
|
/**
|
|
1285
1342
|
* DELETE /interactions/deleteFile
|
|
1286
|
-
* Exclui um arquivo do projeto pela `key` (`result.
|
|
1343
|
+
* Exclui exatamente um arquivo do projeto pela `key` (`result.key` do upload).
|
|
1344
|
+
* Permissão: usuário DEV do projeto ou Server Function em execução (403 para usuário final);
|
|
1345
|
+
* chave inexistente devolve FILE_NOT_FOUND (HTTP 404).
|
|
1287
1346
|
*/
|
|
1288
1347
|
declare function deleteFileMitra(options: DeleteFileOptions): Promise<DeleteFileResponse>;
|
|
1289
1348
|
declare function listRecordsMitra(options: ListRecordsOptions): Promise<ListRecordsResponse>;
|
|
@@ -1349,4 +1408,4 @@ declare function setProfileScreensMitra(options: SetProfileScreensOptions): Prom
|
|
|
1349
1408
|
*/
|
|
1350
1409
|
declare function setProfileServerFunctionsMitra(options: SetProfileServerFunctionsOptions): Promise<SetProfilePermissionResponse>;
|
|
1351
1410
|
|
|
1352
|
-
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, deleteFileMitra, deleteProfileMitra, deleteRecordMitra, downloadFilePrivateMitra, 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, uploadFilePrivateMitra, uploadFilePublicMitra, validatePasswordResetCodeMitra };
|
|
1411
|
+
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 DeleteFileOptions, type DeleteFileResponse, type DeleteProfileOptions, type DeleteProfileResponse, type DeleteRecordOptions, type DownloadFileOptions, 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 FileLinkOptions, type FileLinkResponse, 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, deleteFileMitra, deleteProfileMitra, deleteRecordMitra, downloadFilePrivateMitra, emailLoginMitra, emailResendCodeMitra, emailSignupMitra, emailVerifyCodeMitra, executeDataLoaderMitra, executeDbActionMitra, executePublicServerFunctionAsyncMitra, executePublicServerFunctionMitra, executeServerFunctionAsyncMitra, executeServerFunctionMitra, getAgentTaskMitra, getConfig, getFileLinkMitra, 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, uploadFilePrivateMitra, uploadFilePublicMitra, validatePasswordResetCodeMitra };
|
package/dist/index.d.ts
CHANGED
|
@@ -290,7 +290,15 @@ interface UploadFileResponse {
|
|
|
290
290
|
status: string;
|
|
291
291
|
result: {
|
|
292
292
|
fileName: string;
|
|
293
|
+
/** No PUBLIC é a URL completa; no PRIVATE/LOADABLE é a chave relativa. Prefira `key`. */
|
|
293
294
|
currentPath: string;
|
|
295
|
+
/**
|
|
296
|
+
* Chave relativa do objeto. No PRIVATE: `ai-files/private/{24 chars aleatórios}/nome` — não é
|
|
297
|
+
* adivinhável e dois uploads com o mesmo nome não se sobrescrevem. Guarde-a na tabela da
|
|
298
|
+
* aplicação, na linha do registro dono; é ela que a Server Function usa para liberar o
|
|
299
|
+
* arquivo. (Backends anteriores ao TKT-000a0394 não a enviam.)
|
|
300
|
+
*/
|
|
301
|
+
key?: string;
|
|
294
302
|
publicUrl: string | null;
|
|
295
303
|
message: string;
|
|
296
304
|
};
|
|
@@ -298,20 +306,59 @@ interface UploadFileResponse {
|
|
|
298
306
|
interface DownloadFileOptions {
|
|
299
307
|
/** ID do projeto (opcional se já configurado via configureSdkMitra) */
|
|
300
308
|
projectId?: number;
|
|
301
|
-
/**
|
|
309
|
+
/**
|
|
310
|
+
* Chave do arquivo: `result.key` do upload (`ai-files/private/{aleatório}/nome`, ou
|
|
311
|
+
* `ai-files/{public|loadable}/nome`). Também aceita `result.currentPath`, inclusive a URL
|
|
312
|
+
* pública de um upload PUBLIC do mesmo projeto. Chave fora dessas pastas é recusada com 400.
|
|
313
|
+
*
|
|
314
|
+
* Permissão: só usuário DEV do projeto ou Server Function em execução. Tela de usuário final
|
|
315
|
+
* NÃO chama isto — pede o anexo pelo registro a uma SF (ver README, "Anexos").
|
|
316
|
+
*/
|
|
302
317
|
key: string;
|
|
303
318
|
}
|
|
319
|
+
interface FileLinkOptions {
|
|
320
|
+
/** ID do projeto (opcional se já configurado via configureSdkMitra) */
|
|
321
|
+
projectId?: number;
|
|
322
|
+
/** Chave do arquivo — mesma regra de `DownloadFileOptions.key` */
|
|
323
|
+
key: string;
|
|
324
|
+
/** Validade em segundos (padrão 300 no backend; máximo configurado no backend, 3600 por padrão) */
|
|
325
|
+
ttlSeconds?: number;
|
|
326
|
+
}
|
|
327
|
+
/**
|
|
328
|
+
* Sucesso: `{ status: "success", result }`. Erro: `{ status: "error", error: { code, message } }`
|
|
329
|
+
* com HTTP 400 (INVALID_KEY/MISSING_*), 403 (ACCESS_DENIED), 404 (FILE_NOT_FOUND), 500.
|
|
330
|
+
*/
|
|
331
|
+
interface FileLinkResponse {
|
|
332
|
+
status: string;
|
|
333
|
+
result?: {
|
|
334
|
+
key: string;
|
|
335
|
+
/** URL assinada; vale até `expiresAt` */
|
|
336
|
+
url: string;
|
|
337
|
+
expiresAt: string;
|
|
338
|
+
expiresInSeconds: number;
|
|
339
|
+
};
|
|
340
|
+
error?: {
|
|
341
|
+
code: string;
|
|
342
|
+
message: string;
|
|
343
|
+
};
|
|
344
|
+
}
|
|
304
345
|
interface DeleteFileOptions {
|
|
305
346
|
/** ID do projeto (opcional se já configurado via configureSdkMitra) */
|
|
306
347
|
projectId?: number;
|
|
307
|
-
/** Chave do arquivo
|
|
348
|
+
/** Chave do arquivo — mesma regra de `DownloadFileOptions.key`. Exclui exatamente um objeto. */
|
|
308
349
|
key: string;
|
|
309
350
|
}
|
|
351
|
+
/**
|
|
352
|
+
* Sucesso: `{ status: "success", result }`. Erro: `{ status: "error", error: { code, message } }`
|
|
353
|
+
* com code MISSING_KEY | INVALID_KEY | ACCESS_DENIED (usuário sem perfil DEV no projeto ou API key
|
|
354
|
+
* BUSINESS) | FILE_NOT_FOUND (nada apagado) | INTERNAL_ERROR.
|
|
355
|
+
*/
|
|
310
356
|
interface DeleteFileResponse {
|
|
311
357
|
status: string;
|
|
312
358
|
result: {
|
|
313
359
|
fileName: string;
|
|
314
360
|
currentPath: string;
|
|
361
|
+
key?: string;
|
|
315
362
|
publicUrl: string | null;
|
|
316
363
|
message: string;
|
|
317
364
|
};
|
|
@@ -916,6 +963,7 @@ interface MitraInstance {
|
|
|
916
963
|
uploadFilePrivate(options: UploadFileOptions): Promise<UploadFileResponse>;
|
|
917
964
|
uploadFileLoadable(options: UploadFileOptions): Promise<UploadFileResponse>;
|
|
918
965
|
downloadFilePrivate(options: DownloadFileOptions): Promise<Blob>;
|
|
966
|
+
getFileLink(options: FileLinkOptions): Promise<FileLinkResponse>;
|
|
919
967
|
deleteFile(options: DeleteFileOptions): Promise<DeleteFileResponse>;
|
|
920
968
|
listIntegrations(options?: ListIntegrationsOptions): Promise<IntegrationResponse[]>;
|
|
921
969
|
callIntegration(options: CallIntegrationOptions): Promise<CallIntegrationResponse>;
|
|
@@ -1271,19 +1319,30 @@ declare function uploadFileLoadableMitra(options: UploadFileOptions): Promise<Up
|
|
|
1271
1319
|
* POST /interactions/uploadFilePrivate (multipart/form-data)
|
|
1272
1320
|
* Faz upload de um arquivo para a pasta PRIVATE do projeto. O arquivo NAO fica publico
|
|
1273
1321
|
* no S3 (sem ACL public-read) — este e o modo recomendado/padrao. O acesso e feito por
|
|
1274
|
-
* download autenticado;
|
|
1275
|
-
* `result.publicUrl` sempre vem `null` para upload privado.
|
|
1322
|
+
* download autenticado; guarde `result.key` (a chave relativa) para baixar ou excluir depois.
|
|
1323
|
+
* `result.publicUrl` sempre vem `null` para upload privado. Privado e por PROJETO, nao por
|
|
1324
|
+
* usuario: qualquer usuario do projeto que conheca a chave consegue baixar.
|
|
1276
1325
|
*/
|
|
1277
1326
|
declare function uploadFilePrivateMitra(options: UploadFileOptions): Promise<UploadFileResponse>;
|
|
1278
1327
|
/**
|
|
1279
1328
|
* GET /interactions/downloadFile
|
|
1280
|
-
* Baixa (com credencial) um arquivo
|
|
1281
|
-
* `key` é a chave retornada no upload (`result.currentPath`).
|
|
1329
|
+
* Baixa (com credencial) um arquivo do projeto e retorna o conteúdo como Blob.
|
|
1330
|
+
* `key` é a chave retornada no upload (`result.key`; `result.currentPath` também é aceito).
|
|
1331
|
+
* Permissão: usuário DEV do projeto ou Server Function em execução (403 para usuário final).
|
|
1282
1332
|
*/
|
|
1283
1333
|
declare function downloadFilePrivateMitra(options: DownloadFileOptions): Promise<Blob>;
|
|
1334
|
+
/**
|
|
1335
|
+
* GET /interactions/fileLink
|
|
1336
|
+
* Link temporário (assinado) para um arquivo do projeto. Mesma permissão do download: DEV ou
|
|
1337
|
+
* Server Function em execução. Use quando precisar exibir muitas imagens numa tela de DEV ou em
|
|
1338
|
+
* ferramental; para usuário final, a SF é quem emite o link depois de validar o registro.
|
|
1339
|
+
*/
|
|
1340
|
+
declare function getFileLinkMitra(options: FileLinkOptions): Promise<FileLinkResponse>;
|
|
1284
1341
|
/**
|
|
1285
1342
|
* DELETE /interactions/deleteFile
|
|
1286
|
-
* Exclui um arquivo do projeto pela `key` (`result.
|
|
1343
|
+
* Exclui exatamente um arquivo do projeto pela `key` (`result.key` do upload).
|
|
1344
|
+
* Permissão: usuário DEV do projeto ou Server Function em execução (403 para usuário final);
|
|
1345
|
+
* chave inexistente devolve FILE_NOT_FOUND (HTTP 404).
|
|
1287
1346
|
*/
|
|
1288
1347
|
declare function deleteFileMitra(options: DeleteFileOptions): Promise<DeleteFileResponse>;
|
|
1289
1348
|
declare function listRecordsMitra(options: ListRecordsOptions): Promise<ListRecordsResponse>;
|
|
@@ -1349,4 +1408,4 @@ declare function setProfileScreensMitra(options: SetProfileScreensOptions): Prom
|
|
|
1349
1408
|
*/
|
|
1350
1409
|
declare function setProfileServerFunctionsMitra(options: SetProfileServerFunctionsOptions): Promise<SetProfilePermissionResponse>;
|
|
1351
1410
|
|
|
1352
|
-
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, deleteFileMitra, deleteProfileMitra, deleteRecordMitra, downloadFilePrivateMitra, 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, uploadFilePrivateMitra, uploadFilePublicMitra, validatePasswordResetCodeMitra };
|
|
1411
|
+
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 DeleteFileOptions, type DeleteFileResponse, type DeleteProfileOptions, type DeleteProfileResponse, type DeleteRecordOptions, type DownloadFileOptions, 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 FileLinkOptions, type FileLinkResponse, 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, deleteFileMitra, deleteProfileMitra, deleteRecordMitra, downloadFilePrivateMitra, emailLoginMitra, emailResendCodeMitra, emailSignupMitra, emailVerifyCodeMitra, executeDataLoaderMitra, executeDbActionMitra, executePublicServerFunctionAsyncMitra, executePublicServerFunctionMitra, executeServerFunctionAsyncMitra, executeServerFunctionMitra, getAgentTaskMitra, getConfig, getFileLinkMitra, 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, uploadFilePrivateMitra, uploadFilePublicMitra, validatePasswordResetCodeMitra };
|
package/dist/index.js
CHANGED
|
@@ -724,6 +724,13 @@ async function downloadFilePrivateMitra(options) {
|
|
|
724
724
|
key: options.key
|
|
725
725
|
});
|
|
726
726
|
}
|
|
727
|
+
async function getFileLinkMitra(options) {
|
|
728
|
+
return http.get("/interactions/fileLink", {
|
|
729
|
+
projectId: resolveProjectId2(options.projectId),
|
|
730
|
+
key: options.key,
|
|
731
|
+
...options.ttlSeconds !== void 0 ? { ttlSeconds: options.ttlSeconds } : {}
|
|
732
|
+
});
|
|
733
|
+
}
|
|
727
734
|
async function deleteFileMitra(options) {
|
|
728
735
|
return http.del("/interactions/deleteFile", {
|
|
729
736
|
projectId: resolveProjectId2(options.projectId),
|
|
@@ -2069,6 +2076,15 @@ function createMitraInstance(initialConfig) {
|
|
|
2069
2076
|
key: options.key
|
|
2070
2077
|
});
|
|
2071
2078
|
},
|
|
2079
|
+
async getFileLink(options) {
|
|
2080
|
+
return request("GET", "/interactions/fileLink", {
|
|
2081
|
+
params: {
|
|
2082
|
+
projectId: resolveProjectId4(options.projectId),
|
|
2083
|
+
key: options.key,
|
|
2084
|
+
...options.ttlSeconds !== void 0 ? { ttlSeconds: options.ttlSeconds } : {}
|
|
2085
|
+
}
|
|
2086
|
+
});
|
|
2087
|
+
},
|
|
2072
2088
|
async deleteFile(options) {
|
|
2073
2089
|
return request("DELETE", "/interactions/deleteFile", {
|
|
2074
2090
|
params: { projectId: resolveProjectId4(options.projectId), key: options.key }
|
|
@@ -2317,6 +2333,7 @@ exports.executeServerFunctionAsyncMitra = executeServerFunctionAsyncMitra;
|
|
|
2317
2333
|
exports.executeServerFunctionMitra = executeServerFunctionMitra;
|
|
2318
2334
|
exports.getAgentTaskMitra = getAgentTaskMitra;
|
|
2319
2335
|
exports.getConfig = getConfig;
|
|
2336
|
+
exports.getFileLinkMitra = getFileLinkMitra;
|
|
2320
2337
|
exports.getProfileDetailsMitra = getProfileDetailsMitra;
|
|
2321
2338
|
exports.getPublicServerFunctionExecutionMitra = getPublicServerFunctionExecutionMitra;
|
|
2322
2339
|
exports.getRecordMitra = getRecordMitra;
|