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