import { DataFetcher } from "../../../../lib/http/data-fetcher/DataFetcher";
const SERVICE_ACTION_EXECUTE_JAVA = 'ActionButtonsSP.executeJava';
export default class JavaExecutor {
  execute(action) {
    var _a;
    const execSource = {
      actionID: action.actionID,
      refreshType: (_a = action.actionConfig.javaCall) === null || _a === void 0 ? void 0 : _a.refreshType
    };
    return new Promise((resolve) => {
      resolve({ execSource, callback: this.callExecJava });
    });
  }
  async callExecJava(execSource) {
    const request = {
      requestBody: {
        javaCall: execSource
      }
    };
    await DataFetcher.get().callServiceBroker(SERVICE_ACTION_EXECUTE_JAVA, JSON.stringify(request));
  }
}
