Liferay.Loader.define("portal-workflow-kaleo-designer-web@5.0.83/designer/js/definition-builder/util/fetchUtil",["module","exports","require","frontend-js-web"],(function(e,t,n){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.publishDefinitionRequest=function(e){return(0,o.fetch)("".concat(s,"/workflow-definitions/deploy"),{body:JSON.stringify(e),headers:c(c({},a),{},{"Content-Type":"application/json"}),method:"POST"})},t.retrieveAccountRoles=function(t){return(0,o.fetch)("".concat(e,"/accounts/").concat(t,"/account-roles"),{headers:a,method:"GET"})},t.retrieveDefinitionRequest=function(e,t){let n="".concat(s,"/workflow-definitions/by-name/").concat(e);t&&(n="".concat(n,"?version=").concat(t));return(0,o.fetch)(n,{headers:a,method:"GET"})},t.retrieveRolesBy=function(t,n){if("roleId"===t)return(0,o.fetch)("".concat(window.location.origin).concat(e,"/roles/")+n,{headers:a,method:"GET"})},t.retrieveUsersBy=function(t,n){let r=String();for(const e of n)r=r+t+" eq '"+e+"' or ";r=encodeURIComponent(r).replace(/'/g,"%27").slice(0,-8);const c=new URL("".concat(window.location.origin).concat(e,"/user-accounts?filter=").concat(r));return(0,o.fetch)(c,{headers:a,method:"GET"})},t.saveDefinitionRequest=function(e){return(0,o.fetch)("".concat(s,"/workflow-definitions/save"),{body:JSON.stringify(e),headers:c(c({},a),{},{"Content-Type":"application/json"}),method:"POST"})},t.workflowBaseURL=t.userBaseURL=t.headers=void 0;var o=n("frontend-js-web");function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function c(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(Object(n),!0).forEach((function(t){i(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const e="/o/headless-admin-user/v1.0";t.userBaseURL=e;const s="/o/headless-admin-workflow/v1.0";t.workflowBaseURL=s;const a={"Accept-Language":Liferay.ThemeDisplay.getBCP47LanguageId()};t.headers=a}}));
//# sourceMappingURL=fetchUtil.js.map