mitra-interactions-sdk 1.0.50 → 1.0.53

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
@@ -165,6 +165,38 @@ interface ExecuteServerFunctionAsyncResponse {
165
165
  executionStatus: string;
166
166
  };
167
167
  }
168
+ interface ExecutePublicServerFunctionOptions {
169
+ /** ID do projeto (tenant) */
170
+ projectId: number;
171
+ /** ID da Server Function (deve ter publicExecution = true) */
172
+ serverFunctionId: number;
173
+ /** Objeto de entrada para a função (opcional) */
174
+ input?: Record<string, unknown>;
175
+ }
176
+ interface ExecutePublicServerFunctionResponse {
177
+ executionId: string;
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;
199
+ }
168
200
  interface ListRecordsResponse {
169
201
  content: Record<string, any>[];
170
202
  page: number;
@@ -477,6 +509,9 @@ interface MitraInstance {
477
509
  runAction(options: RunActionOptions): Promise<RunActionResponse>;
478
510
  executeServerFunction(options: ExecuteServerFunctionOptions): Promise<ExecuteServerFunctionResponse>;
479
511
  executeServerFunctionAsync(options: ExecuteServerFunctionAsyncOptions): Promise<ExecuteServerFunctionAsyncResponse>;
512
+ executePublicServerFunction(options: ExecutePublicServerFunctionOptions): Promise<ExecutePublicServerFunctionResponse>;
513
+ executePublicServerFunctionAsync(options: ExecutePublicServerFunctionOptions): Promise<ExecutePublicServerFunctionAsyncResponse>;
514
+ getPublicServerFunctionExecution(options: GetPublicServerFunctionExecutionOptions): Promise<GetPublicServerFunctionExecutionResponse>;
480
515
  stopServerFunctionExecution(options: StopServerFunctionExecutionOptions): Promise<StopServerFunctionExecutionResponse>;
481
516
  uploadFilePublic(options: UploadFileOptions): Promise<UploadFileResponse>;
482
517
  uploadFileLoadable(options: UploadFileOptions): Promise<UploadFileResponse>;
@@ -654,6 +689,23 @@ declare function executeServerFunctionMitra(options: ExecuteServerFunctionOption
654
689
  * Executa uma Server Function de forma ASSÍNCRONA (retorna executionId imediatamente)
655
690
  */
656
691
  declare function executeServerFunctionAsyncMitra(options: ExecuteServerFunctionAsyncOptions): Promise<ExecuteServerFunctionAsyncResponse>;
692
+ /**
693
+ * POST /public/serverFunction/{projectId}/{serverFunctionId}/execute
694
+ * Executa uma Server Function pública de forma SÍNCRONA (sem autenticação).
695
+ * A SF deve ter publicExecution = true. Timeout 5min.
696
+ */
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>;
657
709
  /**
658
710
  * GET /interactions/integrations?projectId=X
659
711
  * Lista integrações configuradas no projeto
@@ -743,4 +795,4 @@ declare function setProfileScreensMitra(options: SetProfileScreensOptions): Prom
743
795
  */
744
796
  declare function setProfileServerFunctionsMitra(options: SetProfileServerFunctionsOptions): Promise<SetProfilePermissionResponse>;
745
797
 
746
- 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 };
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
@@ -165,6 +165,38 @@ interface ExecuteServerFunctionAsyncResponse {
165
165
  executionStatus: string;
166
166
  };
167
167
  }
168
+ interface ExecutePublicServerFunctionOptions {
169
+ /** ID do projeto (tenant) */
170
+ projectId: number;
171
+ /** ID da Server Function (deve ter publicExecution = true) */
172
+ serverFunctionId: number;
173
+ /** Objeto de entrada para a função (opcional) */
174
+ input?: Record<string, unknown>;
175
+ }
176
+ interface ExecutePublicServerFunctionResponse {
177
+ executionId: string;
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;
199
+ }
168
200
  interface ListRecordsResponse {
169
201
  content: Record<string, any>[];
170
202
  page: number;
@@ -477,6 +509,9 @@ interface MitraInstance {
477
509
  runAction(options: RunActionOptions): Promise<RunActionResponse>;
478
510
  executeServerFunction(options: ExecuteServerFunctionOptions): Promise<ExecuteServerFunctionResponse>;
479
511
  executeServerFunctionAsync(options: ExecuteServerFunctionAsyncOptions): Promise<ExecuteServerFunctionAsyncResponse>;
512
+ executePublicServerFunction(options: ExecutePublicServerFunctionOptions): Promise<ExecutePublicServerFunctionResponse>;
513
+ executePublicServerFunctionAsync(options: ExecutePublicServerFunctionOptions): Promise<ExecutePublicServerFunctionAsyncResponse>;
514
+ getPublicServerFunctionExecution(options: GetPublicServerFunctionExecutionOptions): Promise<GetPublicServerFunctionExecutionResponse>;
480
515
  stopServerFunctionExecution(options: StopServerFunctionExecutionOptions): Promise<StopServerFunctionExecutionResponse>;
481
516
  uploadFilePublic(options: UploadFileOptions): Promise<UploadFileResponse>;
482
517
  uploadFileLoadable(options: UploadFileOptions): Promise<UploadFileResponse>;
@@ -654,6 +689,23 @@ declare function executeServerFunctionMitra(options: ExecuteServerFunctionOption
654
689
  * Executa uma Server Function de forma ASSÍNCRONA (retorna executionId imediatamente)
655
690
  */
656
691
  declare function executeServerFunctionAsyncMitra(options: ExecuteServerFunctionAsyncOptions): Promise<ExecuteServerFunctionAsyncResponse>;
692
+ /**
693
+ * POST /public/serverFunction/{projectId}/{serverFunctionId}/execute
694
+ * Executa uma Server Function pública de forma SÍNCRONA (sem autenticação).
695
+ * A SF deve ter publicExecution = true. Timeout 5min.
696
+ */
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>;
657
709
  /**
658
710
  * GET /interactions/integrations?projectId=X
659
711
  * Lista integrações configuradas no projeto
@@ -743,4 +795,4 @@ declare function setProfileScreensMitra(options: SetProfileScreensOptions): Prom
743
795
  */
744
796
  declare function setProfileServerFunctionsMitra(options: SetProfileServerFunctionsOptions): Promise<SetProfilePermissionResponse>;
745
797
 
746
- 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 };
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
@@ -449,6 +449,38 @@ function createMitraInstance(initialConfig) {
449
449
  if (options.input !== void 0) body.input = options.input;
450
450
  return request("POST", "/interactions/executeServerFunctionAsync", { body });
451
451
  },
452
+ async executePublicServerFunction(options) {
453
+ const { projectId, serverFunctionId, input } = options;
454
+ const url = `${_config.baseURL}/public/serverFunction/${projectId}/${serverFunctionId}/execute`;
455
+ const fetchFn = getFetch();
456
+ const response = await fetchFn(url, {
457
+ method: "POST",
458
+ headers: { "Content-Type": "application/json" },
459
+ body: JSON.stringify(input || {})
460
+ });
461
+ return handleResponse2(response);
462
+ },
463
+ async executePublicServerFunctionAsync(options) {
464
+ const { projectId, serverFunctionId, input } = options;
465
+ const url = `${_config.baseURL}/public/serverFunction/${projectId}/${serverFunctionId}/executeAsync`;
466
+ const fetchFn = getFetch();
467
+ const response = await fetchFn(url, {
468
+ method: "POST",
469
+ headers: { "Content-Type": "application/json" },
470
+ body: JSON.stringify(input || {})
471
+ });
472
+ return handleResponse2(response);
473
+ },
474
+ async getPublicServerFunctionExecution(options) {
475
+ const { projectId, executionId } = options;
476
+ const url = `${_config.baseURL}/public/serverFunction/${projectId}/execution/${executionId}`;
477
+ const fetchFn = getFetch();
478
+ const response = await fetchFn(url, {
479
+ method: "GET",
480
+ headers: { "Content-Type": "application/json" }
481
+ });
482
+ return handleResponse2(response);
483
+ },
452
484
  async stopServerFunctionExecution(options) {
453
485
  return request("POST", "/interactions/stopServerFunctionExecution", {
454
486
  body: { projectId: resolveProjectId2(options.projectId), executionId: options.executionId }
@@ -945,6 +977,53 @@ async function executeServerFunctionAsyncMitra(options) {
945
977
  }
946
978
  return http.post("/interactions/executeServerFunctionAsync", body);
947
979
  }
980
+ async function executePublicServerFunctionMitra(options) {
981
+ const { projectId, serverFunctionId, input } = options;
982
+ const baseURL = getConfig().baseURL;
983
+ const url = `${baseURL}/public/serverFunction/${projectId}/${serverFunctionId}/execute`;
984
+ const response = await fetch(url, {
985
+ method: "POST",
986
+ headers: { "Content-Type": "application/json" },
987
+ body: JSON.stringify(input || {})
988
+ });
989
+ if (!response.ok) {
990
+ const data = await response.json().catch(() => null);
991
+ const msg = (data == null ? void 0 : data.message) || (data == null ? void 0 : data.error) || `HTTP ${response.status}`;
992
+ throw { message: msg, status: response.status, details: data };
993
+ }
994
+ return response.json();
995
+ }
996
+ async function executePublicServerFunctionAsyncMitra(options) {
997
+ const { projectId, serverFunctionId, input } = options;
998
+ const baseURL = getConfig().baseURL;
999
+ const url = `${baseURL}/public/serverFunction/${projectId}/${serverFunctionId}/executeAsync`;
1000
+ const response = await fetch(url, {
1001
+ method: "POST",
1002
+ headers: { "Content-Type": "application/json" },
1003
+ body: JSON.stringify(input || {})
1004
+ });
1005
+ if (!response.ok) {
1006
+ const data = await response.json().catch(() => null);
1007
+ const msg = (data == null ? void 0 : data.message) || (data == null ? void 0 : data.error) || `HTTP ${response.status}`;
1008
+ throw { message: msg, status: response.status, details: data };
1009
+ }
1010
+ return response.json();
1011
+ }
1012
+ async function getPublicServerFunctionExecutionMitra(options) {
1013
+ const { projectId, executionId } = options;
1014
+ const baseURL = getConfig().baseURL;
1015
+ const url = `${baseURL}/public/serverFunction/${projectId}/execution/${executionId}`;
1016
+ const response = await fetch(url, {
1017
+ method: "GET",
1018
+ headers: { "Content-Type": "application/json" }
1019
+ });
1020
+ if (!response.ok) {
1021
+ const data = await response.json().catch(() => null);
1022
+ const msg = (data == null ? void 0 : data.message) || (data == null ? void 0 : data.error) || `HTTP ${response.status}`;
1023
+ throw { message: msg, status: response.status, details: data };
1024
+ }
1025
+ return response.json();
1026
+ }
948
1027
  async function listIntegrationsMitra(options = {}) {
949
1028
  return http.get("/interactions/integrations", {
950
1029
  projectId: resolveProjectId(options.projectId)
@@ -1115,10 +1194,13 @@ exports.emailSignupMitra = emailSignupMitra;
1115
1194
  exports.emailVerifyCodeMitra = emailVerifyCodeMitra;
1116
1195
  exports.executeDataLoaderMitra = executeDataLoaderMitra;
1117
1196
  exports.executeDbActionMitra = executeDbActionMitra;
1197
+ exports.executePublicServerFunctionAsyncMitra = executePublicServerFunctionAsyncMitra;
1198
+ exports.executePublicServerFunctionMitra = executePublicServerFunctionMitra;
1118
1199
  exports.executeServerFunctionAsyncMitra = executeServerFunctionAsyncMitra;
1119
1200
  exports.executeServerFunctionMitra = executeServerFunctionMitra;
1120
1201
  exports.getConfig = getConfig;
1121
1202
  exports.getProfileDetailsMitra = getProfileDetailsMitra;
1203
+ exports.getPublicServerFunctionExecutionMitra = getPublicServerFunctionExecutionMitra;
1122
1204
  exports.getRecordMitra = getRecordMitra;
1123
1205
  exports.getVariableMitra = getVariableMitra;
1124
1206
  exports.listIntegrationsMitra = listIntegrationsMitra;