mitra-interactions-sdk 1.0.52 → 1.0.54

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -176,6 +176,26 @@ interface ExecutePublicServerFunctionOptions {
176
176
  interface ExecutePublicServerFunctionResponse {
177
177
  executionId: string;
178
178
  status: string;
179
+ output: any | null;
180
+ logs: string | null;
181
+ error: string | null;
182
+ durationMs: number | null;
183
+ }
184
+ interface ExecutePublicServerFunctionAsyncResponse {
185
+ executionId: string;
186
+ status: string;
187
+ }
188
+ interface GetPublicServerFunctionExecutionOptions {
189
+ projectId: number;
190
+ executionId: string;
191
+ }
192
+ interface GetPublicServerFunctionExecutionResponse {
193
+ executionId: string;
194
+ status: string;
195
+ output: any | null;
196
+ logs: string | null;
197
+ error: string | null;
198
+ durationMs: number | null;
179
199
  }
180
200
  interface ListRecordsResponse {
181
201
  content: Record<string, any>[];
@@ -490,6 +510,8 @@ interface MitraInstance {
490
510
  executeServerFunction(options: ExecuteServerFunctionOptions): Promise<ExecuteServerFunctionResponse>;
491
511
  executeServerFunctionAsync(options: ExecuteServerFunctionAsyncOptions): Promise<ExecuteServerFunctionAsyncResponse>;
492
512
  executePublicServerFunction(options: ExecutePublicServerFunctionOptions): Promise<ExecutePublicServerFunctionResponse>;
513
+ executePublicServerFunctionAsync(options: ExecutePublicServerFunctionOptions): Promise<ExecutePublicServerFunctionAsyncResponse>;
514
+ getPublicServerFunctionExecution(options: GetPublicServerFunctionExecutionOptions): Promise<GetPublicServerFunctionExecutionResponse>;
493
515
  stopServerFunctionExecution(options: StopServerFunctionExecutionOptions): Promise<StopServerFunctionExecutionResponse>;
494
516
  uploadFilePublic(options: UploadFileOptions): Promise<UploadFileResponse>;
495
517
  uploadFileLoadable(options: UploadFileOptions): Promise<UploadFileResponse>;
@@ -669,11 +691,21 @@ declare function executeServerFunctionMitra(options: ExecuteServerFunctionOption
669
691
  declare function executeServerFunctionAsyncMitra(options: ExecuteServerFunctionAsyncOptions): Promise<ExecuteServerFunctionAsyncResponse>;
670
692
  /**
671
693
  * POST /public/serverFunction/{projectId}/{serverFunctionId}/execute
672
- * Executa uma Server Function pública (sem autenticação).
673
- * A SF deve ter publicExecution = true no backend.
674
- * Retorna executionId (assíncrono).
694
+ * Executa uma Server Function pública de forma SÍNCRONA (sem autenticação).
695
+ * A SF deve ter publicExecution = true. Timeout 5min.
675
696
  */
676
697
  declare function executePublicServerFunctionMitra(options: ExecutePublicServerFunctionOptions): Promise<ExecutePublicServerFunctionResponse>;
698
+ /**
699
+ * POST /public/serverFunction/{projectId}/{serverFunctionId}/executeAsync
700
+ * Executa uma Server Function pública de forma ASSÍNCRONA (sem autenticação).
701
+ * Retorna executionId imediatamente. Use getPublicServerFunctionExecutionMitra para polling.
702
+ */
703
+ declare function executePublicServerFunctionAsyncMitra(options: ExecutePublicServerFunctionOptions): Promise<ExecutePublicServerFunctionAsyncResponse>;
704
+ /**
705
+ * GET /public/serverFunction/{projectId}/execution/{executionId}
706
+ * Consulta o status/resultado de uma execução pública de SF (sem autenticação).
707
+ */
708
+ declare function getPublicServerFunctionExecutionMitra(options: GetPublicServerFunctionExecutionOptions): Promise<GetPublicServerFunctionExecutionResponse>;
677
709
  /**
678
710
  * GET /interactions/integrations?projectId=X
679
711
  * Lista integrações configuradas no projeto
@@ -763,4 +795,4 @@ declare function setProfileScreensMitra(options: SetProfileScreensOptions): Prom
763
795
  */
764
796
  declare function setProfileServerFunctionsMitra(options: SetProfileServerFunctionsOptions): Promise<SetProfilePermissionResponse>;
765
797
 
766
- 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 ExecutePublicServerFunctionOptions, type ExecutePublicServerFunctionResponse, 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, executePublicServerFunctionMitra, 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 };
798
+ 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 ExecutePublicServerFunctionAsyncResponse, type ExecutePublicServerFunctionOptions, type ExecutePublicServerFunctionResponse, type ExecuteServerFunctionAsyncOptions, type ExecuteServerFunctionAsyncResponse, type ExecuteServerFunctionOptions, type ExecuteServerFunctionResponse, type GetProfileDetailsOptions, type GetProfileDetailsResponse, type GetPublicServerFunctionExecutionOptions, type GetPublicServerFunctionExecutionResponse, 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, executePublicServerFunctionAsyncMitra, executePublicServerFunctionMitra, executeServerFunctionAsyncMitra, executeServerFunctionMitra, getConfig, getProfileDetailsMitra, getPublicServerFunctionExecutionMitra, 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 };
package/dist/index.d.ts CHANGED
@@ -176,6 +176,26 @@ interface ExecutePublicServerFunctionOptions {
176
176
  interface ExecutePublicServerFunctionResponse {
177
177
  executionId: string;
178
178
  status: string;
179
+ output: any | null;
180
+ logs: string | null;
181
+ error: string | null;
182
+ durationMs: number | null;
183
+ }
184
+ interface ExecutePublicServerFunctionAsyncResponse {
185
+ executionId: string;
186
+ status: string;
187
+ }
188
+ interface GetPublicServerFunctionExecutionOptions {
189
+ projectId: number;
190
+ executionId: string;
191
+ }
192
+ interface GetPublicServerFunctionExecutionResponse {
193
+ executionId: string;
194
+ status: string;
195
+ output: any | null;
196
+ logs: string | null;
197
+ error: string | null;
198
+ durationMs: number | null;
179
199
  }
180
200
  interface ListRecordsResponse {
181
201
  content: Record<string, any>[];
@@ -490,6 +510,8 @@ interface MitraInstance {
490
510
  executeServerFunction(options: ExecuteServerFunctionOptions): Promise<ExecuteServerFunctionResponse>;
491
511
  executeServerFunctionAsync(options: ExecuteServerFunctionAsyncOptions): Promise<ExecuteServerFunctionAsyncResponse>;
492
512
  executePublicServerFunction(options: ExecutePublicServerFunctionOptions): Promise<ExecutePublicServerFunctionResponse>;
513
+ executePublicServerFunctionAsync(options: ExecutePublicServerFunctionOptions): Promise<ExecutePublicServerFunctionAsyncResponse>;
514
+ getPublicServerFunctionExecution(options: GetPublicServerFunctionExecutionOptions): Promise<GetPublicServerFunctionExecutionResponse>;
493
515
  stopServerFunctionExecution(options: StopServerFunctionExecutionOptions): Promise<StopServerFunctionExecutionResponse>;
494
516
  uploadFilePublic(options: UploadFileOptions): Promise<UploadFileResponse>;
495
517
  uploadFileLoadable(options: UploadFileOptions): Promise<UploadFileResponse>;
@@ -669,11 +691,21 @@ declare function executeServerFunctionMitra(options: ExecuteServerFunctionOption
669
691
  declare function executeServerFunctionAsyncMitra(options: ExecuteServerFunctionAsyncOptions): Promise<ExecuteServerFunctionAsyncResponse>;
670
692
  /**
671
693
  * POST /public/serverFunction/{projectId}/{serverFunctionId}/execute
672
- * Executa uma Server Function pública (sem autenticação).
673
- * A SF deve ter publicExecution = true no backend.
674
- * Retorna executionId (assíncrono).
694
+ * Executa uma Server Function pública de forma SÍNCRONA (sem autenticação).
695
+ * A SF deve ter publicExecution = true. Timeout 5min.
675
696
  */
676
697
  declare function executePublicServerFunctionMitra(options: ExecutePublicServerFunctionOptions): Promise<ExecutePublicServerFunctionResponse>;
698
+ /**
699
+ * POST /public/serverFunction/{projectId}/{serverFunctionId}/executeAsync
700
+ * Executa uma Server Function pública de forma ASSÍNCRONA (sem autenticação).
701
+ * Retorna executionId imediatamente. Use getPublicServerFunctionExecutionMitra para polling.
702
+ */
703
+ declare function executePublicServerFunctionAsyncMitra(options: ExecutePublicServerFunctionOptions): Promise<ExecutePublicServerFunctionAsyncResponse>;
704
+ /**
705
+ * GET /public/serverFunction/{projectId}/execution/{executionId}
706
+ * Consulta o status/resultado de uma execução pública de SF (sem autenticação).
707
+ */
708
+ declare function getPublicServerFunctionExecutionMitra(options: GetPublicServerFunctionExecutionOptions): Promise<GetPublicServerFunctionExecutionResponse>;
677
709
  /**
678
710
  * GET /interactions/integrations?projectId=X
679
711
  * Lista integrações configuradas no projeto
@@ -763,4 +795,4 @@ declare function setProfileScreensMitra(options: SetProfileScreensOptions): Prom
763
795
  */
764
796
  declare function setProfileServerFunctionsMitra(options: SetProfileServerFunctionsOptions): Promise<SetProfilePermissionResponse>;
765
797
 
766
- 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 ExecutePublicServerFunctionOptions, type ExecutePublicServerFunctionResponse, 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, executePublicServerFunctionMitra, 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 };
798
+ 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 ExecutePublicServerFunctionAsyncResponse, type ExecutePublicServerFunctionOptions, type ExecutePublicServerFunctionResponse, type ExecuteServerFunctionAsyncOptions, type ExecuteServerFunctionAsyncResponse, type ExecuteServerFunctionOptions, type ExecuteServerFunctionResponse, type GetProfileDetailsOptions, type GetProfileDetailsResponse, type GetPublicServerFunctionExecutionOptions, type GetPublicServerFunctionExecutionResponse, 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, executePublicServerFunctionAsyncMitra, executePublicServerFunctionMitra, executeServerFunctionAsyncMitra, executeServerFunctionMitra, getConfig, getProfileDetailsMitra, getPublicServerFunctionExecutionMitra, 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 };
package/dist/index.js CHANGED
@@ -60,7 +60,8 @@ function autoConfigureFromLogin(response, authUrl, projectId) {
60
60
  }
61
61
  function buildAuthUrl(authUrl, method, projectId, opts) {
62
62
  const base = authUrl.endsWith("/") ? authUrl : authUrl + "/";
63
- let url = `${base}?method=${method}&projectId=${encodeURIComponent(projectId)}`;
63
+ const separator = base.includes("?") ? "&" : "?";
64
+ let url = `${base}${separator}method=${method}&projectId=${encodeURIComponent(projectId)}`;
64
65
  if (opts == null ? void 0 : opts.returnTo) url += `&returnTo=${encodeURIComponent(opts.returnTo)}`;
65
66
  if (opts == null ? void 0 : opts.create) url += `&create=true`;
66
67
  if (opts == null ? void 0 : opts.title) url += `&title=${encodeURIComponent(opts.title)}`;
@@ -169,7 +170,8 @@ function openSilentAuthIframe(authUrl, projectId, credentials) {
169
170
  return new Promise((resolve, reject) => {
170
171
  const origin = getOriginFromUrl(authUrl);
171
172
  const base = authUrl.endsWith("/") ? authUrl : authUrl + "/";
172
- let url = `${base}?mode=silent&projectId=${encodeURIComponent(projectId)}`;
173
+ const separator = base.includes("?") ? "&" : "?";
174
+ let url = `${base}${separator}mode=silent&projectId=${encodeURIComponent(projectId)}`;
173
175
  if (typeof window !== "undefined") {
174
176
  url += `&originUrl=${encodeURIComponent(window.location.href)}`;
175
177
  }
@@ -460,6 +462,27 @@ function createMitraInstance(initialConfig) {
460
462
  });
461
463
  return handleResponse2(response);
462
464
  },
465
+ async executePublicServerFunctionAsync(options) {
466
+ const { projectId, serverFunctionId, input } = options;
467
+ const url = `${_config.baseURL}/public/serverFunction/${projectId}/${serverFunctionId}/executeAsync`;
468
+ const fetchFn = getFetch();
469
+ const response = await fetchFn(url, {
470
+ method: "POST",
471
+ headers: { "Content-Type": "application/json" },
472
+ body: JSON.stringify(input || {})
473
+ });
474
+ return handleResponse2(response);
475
+ },
476
+ async getPublicServerFunctionExecution(options) {
477
+ const { projectId, executionId } = options;
478
+ const url = `${_config.baseURL}/public/serverFunction/${projectId}/execution/${executionId}`;
479
+ const fetchFn = getFetch();
480
+ const response = await fetchFn(url, {
481
+ method: "GET",
482
+ headers: { "Content-Type": "application/json" }
483
+ });
484
+ return handleResponse2(response);
485
+ },
463
486
  async stopServerFunctionExecution(options) {
464
487
  return request("POST", "/interactions/stopServerFunctionExecution", {
465
488
  body: { projectId: resolveProjectId2(options.projectId), executionId: options.executionId }
@@ -972,6 +995,37 @@ async function executePublicServerFunctionMitra(options) {
972
995
  }
973
996
  return response.json();
974
997
  }
998
+ async function executePublicServerFunctionAsyncMitra(options) {
999
+ const { projectId, serverFunctionId, input } = options;
1000
+ const baseURL = getConfig().baseURL;
1001
+ const url = `${baseURL}/public/serverFunction/${projectId}/${serverFunctionId}/executeAsync`;
1002
+ const response = await fetch(url, {
1003
+ method: "POST",
1004
+ headers: { "Content-Type": "application/json" },
1005
+ body: JSON.stringify(input || {})
1006
+ });
1007
+ if (!response.ok) {
1008
+ const data = await response.json().catch(() => null);
1009
+ const msg = (data == null ? void 0 : data.message) || (data == null ? void 0 : data.error) || `HTTP ${response.status}`;
1010
+ throw { message: msg, status: response.status, details: data };
1011
+ }
1012
+ return response.json();
1013
+ }
1014
+ async function getPublicServerFunctionExecutionMitra(options) {
1015
+ const { projectId, executionId } = options;
1016
+ const baseURL = getConfig().baseURL;
1017
+ const url = `${baseURL}/public/serverFunction/${projectId}/execution/${executionId}`;
1018
+ const response = await fetch(url, {
1019
+ method: "GET",
1020
+ headers: { "Content-Type": "application/json" }
1021
+ });
1022
+ if (!response.ok) {
1023
+ const data = await response.json().catch(() => null);
1024
+ const msg = (data == null ? void 0 : data.message) || (data == null ? void 0 : data.error) || `HTTP ${response.status}`;
1025
+ throw { message: msg, status: response.status, details: data };
1026
+ }
1027
+ return response.json();
1028
+ }
975
1029
  async function listIntegrationsMitra(options = {}) {
976
1030
  return http.get("/interactions/integrations", {
977
1031
  projectId: resolveProjectId(options.projectId)
@@ -1142,11 +1196,13 @@ exports.emailSignupMitra = emailSignupMitra;
1142
1196
  exports.emailVerifyCodeMitra = emailVerifyCodeMitra;
1143
1197
  exports.executeDataLoaderMitra = executeDataLoaderMitra;
1144
1198
  exports.executeDbActionMitra = executeDbActionMitra;
1199
+ exports.executePublicServerFunctionAsyncMitra = executePublicServerFunctionAsyncMitra;
1145
1200
  exports.executePublicServerFunctionMitra = executePublicServerFunctionMitra;
1146
1201
  exports.executeServerFunctionAsyncMitra = executeServerFunctionAsyncMitra;
1147
1202
  exports.executeServerFunctionMitra = executeServerFunctionMitra;
1148
1203
  exports.getConfig = getConfig;
1149
1204
  exports.getProfileDetailsMitra = getProfileDetailsMitra;
1205
+ exports.getPublicServerFunctionExecutionMitra = getPublicServerFunctionExecutionMitra;
1150
1206
  exports.getRecordMitra = getRecordMitra;
1151
1207
  exports.getVariableMitra = getVariableMitra;
1152
1208
  exports.listIntegrationsMitra = listIntegrationsMitra;