mitra-interactions-sdk 1.0.52 → 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.mjs CHANGED
@@ -458,6 +458,27 @@ function createMitraInstance(initialConfig) {
458
458
  });
459
459
  return handleResponse2(response);
460
460
  },
461
+ async executePublicServerFunctionAsync(options) {
462
+ const { projectId, serverFunctionId, input } = options;
463
+ const url = `${_config.baseURL}/public/serverFunction/${projectId}/${serverFunctionId}/executeAsync`;
464
+ const fetchFn = getFetch();
465
+ const response = await fetchFn(url, {
466
+ method: "POST",
467
+ headers: { "Content-Type": "application/json" },
468
+ body: JSON.stringify(input || {})
469
+ });
470
+ return handleResponse2(response);
471
+ },
472
+ async getPublicServerFunctionExecution(options) {
473
+ const { projectId, executionId } = options;
474
+ const url = `${_config.baseURL}/public/serverFunction/${projectId}/execution/${executionId}`;
475
+ const fetchFn = getFetch();
476
+ const response = await fetchFn(url, {
477
+ method: "GET",
478
+ headers: { "Content-Type": "application/json" }
479
+ });
480
+ return handleResponse2(response);
481
+ },
461
482
  async stopServerFunctionExecution(options) {
462
483
  return request("POST", "/interactions/stopServerFunctionExecution", {
463
484
  body: { projectId: resolveProjectId2(options.projectId), executionId: options.executionId }
@@ -970,6 +991,37 @@ async function executePublicServerFunctionMitra(options) {
970
991
  }
971
992
  return response.json();
972
993
  }
994
+ async function executePublicServerFunctionAsyncMitra(options) {
995
+ const { projectId, serverFunctionId, input } = options;
996
+ const baseURL = getConfig().baseURL;
997
+ const url = `${baseURL}/public/serverFunction/${projectId}/${serverFunctionId}/executeAsync`;
998
+ const response = await fetch(url, {
999
+ method: "POST",
1000
+ headers: { "Content-Type": "application/json" },
1001
+ body: JSON.stringify(input || {})
1002
+ });
1003
+ if (!response.ok) {
1004
+ const data = await response.json().catch(() => null);
1005
+ const msg = (data == null ? void 0 : data.message) || (data == null ? void 0 : data.error) || `HTTP ${response.status}`;
1006
+ throw { message: msg, status: response.status, details: data };
1007
+ }
1008
+ return response.json();
1009
+ }
1010
+ async function getPublicServerFunctionExecutionMitra(options) {
1011
+ const { projectId, executionId } = options;
1012
+ const baseURL = getConfig().baseURL;
1013
+ const url = `${baseURL}/public/serverFunction/${projectId}/execution/${executionId}`;
1014
+ const response = await fetch(url, {
1015
+ method: "GET",
1016
+ headers: { "Content-Type": "application/json" }
1017
+ });
1018
+ if (!response.ok) {
1019
+ const data = await response.json().catch(() => null);
1020
+ const msg = (data == null ? void 0 : data.message) || (data == null ? void 0 : data.error) || `HTTP ${response.status}`;
1021
+ throw { message: msg, status: response.status, details: data };
1022
+ }
1023
+ return response.json();
1024
+ }
973
1025
  async function listIntegrationsMitra(options = {}) {
974
1026
  return http.get("/interactions/integrations", {
975
1027
  projectId: resolveProjectId(options.projectId)
@@ -1125,6 +1177,6 @@ async function setProfileServerFunctionsMitra(options) {
1125
1177
  });
1126
1178
  }
1127
1179
 
1128
- export { 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 };
1180
+ export { 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 };
1129
1181
  //# sourceMappingURL=index.mjs.map
1130
1182
  //# sourceMappingURL=index.mjs.map