mitra-interactions-sdk 1.0.46-beta.1 → 1.0.46

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
@@ -265,9 +265,10 @@ import { executeDataLoaderMitra } from 'mitra-interactions-sdk';
265
265
 
266
266
  const result = await executeDataLoaderMitra({
267
267
  projectId: 123,
268
- dataLoaderId: 5
268
+ dataLoaderId: 5,
269
+ input: { mes: 1, ano: 2025 } // Opcional — parâmetros {{var}} da query
269
270
  });
270
- // result: { result: { timestamp, rowCount, query, status, fileSize, duration } }
271
+ // result: { status, result: { dataLoaderId, executionLog: { timestamp, rowCount, query, status, fileSize?, duration? }, message } }
271
272
  ```
272
273
 
273
274
  ### uploadFilePublicMitra / uploadFileLoadableMitra
package/dist/index.d.mts CHANGED
@@ -68,15 +68,21 @@ interface EmailResendCodeOptions {
68
68
  interface ExecuteDataLoaderOptions {
69
69
  projectId?: number;
70
70
  dataLoaderId: number;
71
+ input?: Record<string, unknown>;
71
72
  }
72
73
  interface ExecuteDataLoaderResponse {
74
+ status: string;
73
75
  result: {
74
- timestamp: string;
75
- rowCount: number;
76
- query: string;
77
- status: string;
78
- fileSize: number;
79
- duration: string;
76
+ dataLoaderId: number;
77
+ executionLog: {
78
+ timestamp: string;
79
+ rowCount: number;
80
+ query: string;
81
+ status: string;
82
+ fileSize?: string;
83
+ duration?: string;
84
+ };
85
+ message: string;
80
86
  };
81
87
  }
82
88
  interface ExecuteDbActionOptions {
@@ -494,8 +500,6 @@ interface MitraInstance {
494
500
  setProfileActions(options: SetProfileActionsOptions): Promise<SetProfilePermissionResponse>;
495
501
  setProfileScreens(options: SetProfileScreensOptions): Promise<SetProfilePermissionResponse>;
496
502
  setProfileServerFunctions(options: SetProfileServerFunctionsOptions): Promise<SetProfilePermissionResponse>;
497
- openChat(): void;
498
- closeChat(): void;
499
503
  }
500
504
  declare function createMitraInstance(initialConfig: Partial<MitraConfig>): MitraInstance;
501
505
 
@@ -531,22 +535,6 @@ declare function resolveProjectId(projectId?: number): number;
531
535
  */
532
536
  declare function stopTracking(): void;
533
537
 
534
- /**
535
- * Mitra Interactions SDK - Chat Integration
536
- *
537
- * Integrates with the __mitraChat object injected by the build-proxy
538
- * in published apps. Provides openMitraChat() and closeMitraChat().
539
- */
540
- /**
541
- * Opens the Mitra Chat sidebar.
542
- * If chat is not ready, initializes with the configured token and waits for connection.
543
- */
544
- declare function openChatMitra(): void;
545
- /**
546
- * Closes the Mitra Chat sidebar.
547
- */
548
- declare function closeChatMitra(): void;
549
-
550
538
  /**
551
539
  * Mitra Interactions SDK - Autenticação
552
540
  *
@@ -737,4 +725,4 @@ declare function setProfileScreensMitra(options: SetProfileScreensOptions): Prom
737
725
  */
738
726
  declare function setProfileServerFunctionsMitra(options: SetProfileServerFunctionsOptions): Promise<SetProfilePermissionResponse>;
739
727
 
740
- export { type CallIntegrationOptions, type CallIntegrationResponse, type CreateProfileOptions, type CreateProfileResponse, type CreateRecordOptions, type CreateRecordsBatchOptions, type DeleteProfileOptions, type DeleteProfileResponse, type DeleteRecordOptions, type EmailLoginOptions, type EmailResendCodeOptions, type EmailSignupOptions, type EmailVerifyCodeOptions, type ExecuteDataLoaderOptions, type ExecuteDataLoaderResponse, type ExecuteDbActionOptions, type ExecuteDbActionResponse, type ExecuteServerFunctionAsyncOptions, type ExecuteServerFunctionAsyncResponse, type ExecuteServerFunctionOptions, type ExecuteServerFunctionResponse, type GetProfileDetailsOptions, type GetProfileDetailsResponse, type GetRecordOptions, type GetVariableOptions, type GetVariableResponse, type IntegrationResponse, type ListIntegrationsOptions, type ListProfilesOptions, type ListProfilesResponse, type ListRecordsOptions, type ListRecordsResponse, type ListVariablesOptions, type ListVariablesResponse, type LoginOptions, type LoginResponse, type MitraConfig, type MitraInstance, type PatchRecordOptions, type ProfileTableRef, type RunActionOptions, type RunActionResponse, 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, callIntegrationMitra, closeChatMitra, configureSdkMitra, createMitraInstance, createProfileMitra, createRecordMitra, createRecordsBatchMitra, deleteProfileMitra, deleteRecordMitra, emailLoginMitra, emailResendCodeMitra, emailSignupMitra, emailVerifyCodeMitra, executeDataLoaderMitra, executeDbActionMitra, executeServerFunctionAsyncMitra, executeServerFunctionMitra, getConfig, getProfileDetailsMitra, getRecordMitra, getVariableMitra, listIntegrationsMitra, listProfilesMitra, listRecordsMitra, listVariablesMitra, loginMitra, loginWithEmailMitra, loginWithGoogleMitra, loginWithMicrosoftMitra, openChatMitra, patchRecordMitra, refreshTokenSilently, resolveProjectId, runActionMitra, setFileStatusMitra, setProfileActionsMitra, setProfileDmlTablesMitra, setProfileScreensMitra, setProfileSelectTablesMitra, setProfileServerFunctionsMitra, setProfileUsersMitra, setVariableMitra, stopServerFunctionExecutionMitra, stopTracking, updateProfileMitra, updateRecordMitra, uploadFileLoadableMitra, uploadFilePublicMitra };
728
+ export { type CallIntegrationOptions, type CallIntegrationResponse, type CreateProfileOptions, type CreateProfileResponse, type CreateRecordOptions, type CreateRecordsBatchOptions, type DeleteProfileOptions, type DeleteProfileResponse, type DeleteRecordOptions, type EmailLoginOptions, type EmailResendCodeOptions, type EmailSignupOptions, type EmailVerifyCodeOptions, type ExecuteDataLoaderOptions, type ExecuteDataLoaderResponse, type ExecuteDbActionOptions, type ExecuteDbActionResponse, type ExecuteServerFunctionAsyncOptions, type ExecuteServerFunctionAsyncResponse, type ExecuteServerFunctionOptions, type ExecuteServerFunctionResponse, type GetProfileDetailsOptions, type GetProfileDetailsResponse, type GetRecordOptions, type GetVariableOptions, type GetVariableResponse, type IntegrationResponse, type ListIntegrationsOptions, type ListProfilesOptions, type ListProfilesResponse, type ListRecordsOptions, type ListRecordsResponse, type ListVariablesOptions, type ListVariablesResponse, type LoginOptions, type LoginResponse, type MitraConfig, type MitraInstance, type PatchRecordOptions, type ProfileTableRef, type RunActionOptions, type RunActionResponse, 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, callIntegrationMitra, configureSdkMitra, createMitraInstance, createProfileMitra, createRecordMitra, createRecordsBatchMitra, deleteProfileMitra, deleteRecordMitra, emailLoginMitra, emailResendCodeMitra, emailSignupMitra, emailVerifyCodeMitra, executeDataLoaderMitra, executeDbActionMitra, executeServerFunctionAsyncMitra, executeServerFunctionMitra, getConfig, getProfileDetailsMitra, getRecordMitra, getVariableMitra, listIntegrationsMitra, listProfilesMitra, listRecordsMitra, listVariablesMitra, loginMitra, loginWithEmailMitra, loginWithGoogleMitra, loginWithMicrosoftMitra, patchRecordMitra, refreshTokenSilently, resolveProjectId, runActionMitra, setFileStatusMitra, setProfileActionsMitra, setProfileDmlTablesMitra, setProfileScreensMitra, setProfileSelectTablesMitra, setProfileServerFunctionsMitra, setProfileUsersMitra, setVariableMitra, stopServerFunctionExecutionMitra, stopTracking, updateProfileMitra, updateRecordMitra, uploadFileLoadableMitra, uploadFilePublicMitra };
package/dist/index.d.ts CHANGED
@@ -68,15 +68,21 @@ interface EmailResendCodeOptions {
68
68
  interface ExecuteDataLoaderOptions {
69
69
  projectId?: number;
70
70
  dataLoaderId: number;
71
+ input?: Record<string, unknown>;
71
72
  }
72
73
  interface ExecuteDataLoaderResponse {
74
+ status: string;
73
75
  result: {
74
- timestamp: string;
75
- rowCount: number;
76
- query: string;
77
- status: string;
78
- fileSize: number;
79
- duration: string;
76
+ dataLoaderId: number;
77
+ executionLog: {
78
+ timestamp: string;
79
+ rowCount: number;
80
+ query: string;
81
+ status: string;
82
+ fileSize?: string;
83
+ duration?: string;
84
+ };
85
+ message: string;
80
86
  };
81
87
  }
82
88
  interface ExecuteDbActionOptions {
@@ -494,8 +500,6 @@ interface MitraInstance {
494
500
  setProfileActions(options: SetProfileActionsOptions): Promise<SetProfilePermissionResponse>;
495
501
  setProfileScreens(options: SetProfileScreensOptions): Promise<SetProfilePermissionResponse>;
496
502
  setProfileServerFunctions(options: SetProfileServerFunctionsOptions): Promise<SetProfilePermissionResponse>;
497
- openChat(): void;
498
- closeChat(): void;
499
503
  }
500
504
  declare function createMitraInstance(initialConfig: Partial<MitraConfig>): MitraInstance;
501
505
 
@@ -531,22 +535,6 @@ declare function resolveProjectId(projectId?: number): number;
531
535
  */
532
536
  declare function stopTracking(): void;
533
537
 
534
- /**
535
- * Mitra Interactions SDK - Chat Integration
536
- *
537
- * Integrates with the __mitraChat object injected by the build-proxy
538
- * in published apps. Provides openMitraChat() and closeMitraChat().
539
- */
540
- /**
541
- * Opens the Mitra Chat sidebar.
542
- * If chat is not ready, initializes with the configured token and waits for connection.
543
- */
544
- declare function openChatMitra(): void;
545
- /**
546
- * Closes the Mitra Chat sidebar.
547
- */
548
- declare function closeChatMitra(): void;
549
-
550
538
  /**
551
539
  * Mitra Interactions SDK - Autenticação
552
540
  *
@@ -737,4 +725,4 @@ declare function setProfileScreensMitra(options: SetProfileScreensOptions): Prom
737
725
  */
738
726
  declare function setProfileServerFunctionsMitra(options: SetProfileServerFunctionsOptions): Promise<SetProfilePermissionResponse>;
739
727
 
740
- export { type CallIntegrationOptions, type CallIntegrationResponse, type CreateProfileOptions, type CreateProfileResponse, type CreateRecordOptions, type CreateRecordsBatchOptions, type DeleteProfileOptions, type DeleteProfileResponse, type DeleteRecordOptions, type EmailLoginOptions, type EmailResendCodeOptions, type EmailSignupOptions, type EmailVerifyCodeOptions, type ExecuteDataLoaderOptions, type ExecuteDataLoaderResponse, type ExecuteDbActionOptions, type ExecuteDbActionResponse, type ExecuteServerFunctionAsyncOptions, type ExecuteServerFunctionAsyncResponse, type ExecuteServerFunctionOptions, type ExecuteServerFunctionResponse, type GetProfileDetailsOptions, type GetProfileDetailsResponse, type GetRecordOptions, type GetVariableOptions, type GetVariableResponse, type IntegrationResponse, type ListIntegrationsOptions, type ListProfilesOptions, type ListProfilesResponse, type ListRecordsOptions, type ListRecordsResponse, type ListVariablesOptions, type ListVariablesResponse, type LoginOptions, type LoginResponse, type MitraConfig, type MitraInstance, type PatchRecordOptions, type ProfileTableRef, type RunActionOptions, type RunActionResponse, 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, callIntegrationMitra, closeChatMitra, configureSdkMitra, createMitraInstance, createProfileMitra, createRecordMitra, createRecordsBatchMitra, deleteProfileMitra, deleteRecordMitra, emailLoginMitra, emailResendCodeMitra, emailSignupMitra, emailVerifyCodeMitra, executeDataLoaderMitra, executeDbActionMitra, executeServerFunctionAsyncMitra, executeServerFunctionMitra, getConfig, getProfileDetailsMitra, getRecordMitra, getVariableMitra, listIntegrationsMitra, listProfilesMitra, listRecordsMitra, listVariablesMitra, loginMitra, loginWithEmailMitra, loginWithGoogleMitra, loginWithMicrosoftMitra, openChatMitra, patchRecordMitra, refreshTokenSilently, resolveProjectId, runActionMitra, setFileStatusMitra, setProfileActionsMitra, setProfileDmlTablesMitra, setProfileScreensMitra, setProfileSelectTablesMitra, setProfileServerFunctionsMitra, setProfileUsersMitra, setVariableMitra, stopServerFunctionExecutionMitra, stopTracking, updateProfileMitra, updateRecordMitra, uploadFileLoadableMitra, uploadFilePublicMitra };
728
+ export { type CallIntegrationOptions, type CallIntegrationResponse, type CreateProfileOptions, type CreateProfileResponse, type CreateRecordOptions, type CreateRecordsBatchOptions, type DeleteProfileOptions, type DeleteProfileResponse, type DeleteRecordOptions, type EmailLoginOptions, type EmailResendCodeOptions, type EmailSignupOptions, type EmailVerifyCodeOptions, type ExecuteDataLoaderOptions, type ExecuteDataLoaderResponse, type ExecuteDbActionOptions, type ExecuteDbActionResponse, type ExecuteServerFunctionAsyncOptions, type ExecuteServerFunctionAsyncResponse, type ExecuteServerFunctionOptions, type ExecuteServerFunctionResponse, type GetProfileDetailsOptions, type GetProfileDetailsResponse, type GetRecordOptions, type GetVariableOptions, type GetVariableResponse, type IntegrationResponse, type ListIntegrationsOptions, type ListProfilesOptions, type ListProfilesResponse, type ListRecordsOptions, type ListRecordsResponse, type ListVariablesOptions, type ListVariablesResponse, type LoginOptions, type LoginResponse, type MitraConfig, type MitraInstance, type PatchRecordOptions, type ProfileTableRef, type RunActionOptions, type RunActionResponse, 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, callIntegrationMitra, configureSdkMitra, createMitraInstance, createProfileMitra, createRecordMitra, createRecordsBatchMitra, deleteProfileMitra, deleteRecordMitra, emailLoginMitra, emailResendCodeMitra, emailSignupMitra, emailVerifyCodeMitra, executeDataLoaderMitra, executeDbActionMitra, executeServerFunctionAsyncMitra, executeServerFunctionMitra, getConfig, getProfileDetailsMitra, getRecordMitra, getVariableMitra, listIntegrationsMitra, listProfilesMitra, listRecordsMitra, listVariablesMitra, loginMitra, loginWithEmailMitra, loginWithGoogleMitra, loginWithMicrosoftMitra, patchRecordMitra, refreshTokenSilently, resolveProjectId, runActionMitra, setFileStatusMitra, setProfileActionsMitra, setProfileDmlTablesMitra, setProfileScreensMitra, setProfileSelectTablesMitra, setProfileServerFunctionsMitra, setProfileUsersMitra, setVariableMitra, stopServerFunctionExecutionMitra, stopTracking, updateProfileMitra, updateRecordMitra, uploadFileLoadableMitra, uploadFilePublicMitra };
package/dist/index.js CHANGED
@@ -248,31 +248,6 @@ async function emailLoginMitra(options) {
248
248
  return response;
249
249
  }
250
250
 
251
- // src/chat.ts
252
- function openChatMitra() {
253
- if (typeof window === "undefined") return;
254
- const chat = window.__mitraChat;
255
- if (!chat) return;
256
- if (!chat.isReady) {
257
- const token = isConfigured() ? getConfig().token : void 0;
258
- if (token) chat.init(token);
259
- const iv = setInterval(() => {
260
- if (chat.isReady) {
261
- clearInterval(iv);
262
- chat.open();
263
- }
264
- }, 200);
265
- setTimeout(() => clearInterval(iv), 15e3);
266
- return;
267
- }
268
- chat.open();
269
- }
270
- function closeChatMitra() {
271
- var _a;
272
- if (typeof window === "undefined") return;
273
- (_a = window.__mitraChat) == null ? void 0 : _a.close();
274
- }
275
-
276
251
  // src/instance.ts
277
252
  function formatToken(token) {
278
253
  return token.startsWith("Bearer ") ? token : `Bearer ${token}`;
@@ -411,9 +386,9 @@ function createMitraInstance(initialConfig) {
411
386
  },
412
387
  // Services
413
388
  async executeDataLoader(options) {
414
- return request("POST", "/interactions/executeDataLoader", {
415
- body: { projectId: resolveProjectId2(options.projectId), dataLoaderId: options.dataLoaderId }
416
- });
389
+ const body = { projectId: resolveProjectId2(options.projectId), dataLoaderId: options.dataLoaderId };
390
+ if (options.input !== void 0) body.input = options.input;
391
+ return request("POST", "/interactions/executeDataLoader", { body });
417
392
  },
418
393
  async executeDbAction(options) {
419
394
  const body = { projectId: resolveProjectId2(options.projectId), dbActionId: options.dbActionId };
@@ -574,13 +549,6 @@ function createMitraInstance(initialConfig) {
574
549
  return request("POST", "/interactions/profiles/serverFunctions", {
575
550
  body: { projectId: resolveProjectId2(options.projectId), profileId: options.profileId, serverFunctionIds: options.serverFunctionIds }
576
551
  });
577
- },
578
- // Chat
579
- openChat() {
580
- openChatMitra();
581
- },
582
- closeChat() {
583
- closeChatMitra();
584
552
  }
585
553
  };
586
554
  return instance;
@@ -870,10 +838,12 @@ var httpTenant = {
870
838
 
871
839
  // src/services.ts
872
840
  async function executeDataLoaderMitra(options) {
873
- return http.post("/interactions/executeDataLoader", {
841
+ const body = {
874
842
  projectId: resolveProjectId(options.projectId),
875
843
  dataLoaderId: options.dataLoaderId
876
- });
844
+ };
845
+ if (options.input !== void 0) body.input = options.input;
846
+ return http.post("/interactions/executeDataLoader", body);
877
847
  }
878
848
  async function executeDbActionMitra(options) {
879
849
  const body = {
@@ -1099,7 +1069,6 @@ async function setProfileServerFunctionsMitra(options) {
1099
1069
  }
1100
1070
 
1101
1071
  exports.callIntegrationMitra = callIntegrationMitra;
1102
- exports.closeChatMitra = closeChatMitra;
1103
1072
  exports.configureSdkMitra = configureSdkMitra;
1104
1073
  exports.createMitraInstance = createMitraInstance;
1105
1074
  exports.createProfileMitra = createProfileMitra;
@@ -1127,7 +1096,6 @@ exports.loginMitra = loginMitra;
1127
1096
  exports.loginWithEmailMitra = loginWithEmailMitra;
1128
1097
  exports.loginWithGoogleMitra = loginWithGoogleMitra;
1129
1098
  exports.loginWithMicrosoftMitra = loginWithMicrosoftMitra;
1130
- exports.openChatMitra = openChatMitra;
1131
1099
  exports.patchRecordMitra = patchRecordMitra;
1132
1100
  exports.refreshTokenSilently = refreshTokenSilently;
1133
1101
  exports.resolveProjectId = resolveProjectId;