Liferay.Loader.define("portal-workflow-kaleo-designer-web@5.0.115/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(c,"/workflow-definitions/deploy"),{body:JSON.stringify(e),headers:_objectSpread(_objectSpread({},i),{},{"Content-Type":"application/json"}),method:"POST"})},t.retrieveAccountRoles=function retrieveAccountRoles(t){return(0,n.fetch)("".concat(e,"/accounts/").concat(t,"/account-roles"),{headers:i,method:"GET"})},t.retrieveDefinitionRequest=function retrieveDefinitionRequest(e,t){let o="".concat(c,"/workflow-definitions/by-name/").concat(e);t&&(o="".concat(o,"?version=").concat(t));return(0,n.fetch)(o,{headers:i,method:"GET"})},t.retrieveRoleById=function retrieveRoleById(t){return(0,n.fetch)("".concat(window.location.origin).concat(r.contextUrl).concat(e,"/roles/").concat(t),{headers:i,method:"GET"})},t.retrieveRoles=function retrieveRoles(){return(0,n.fetch)("".concat(window.location.origin).concat(r.contextUrl).concat(e,"/roles?pageSize=-1"),{headers:i,method:"GET"})},t.retrieveUsersBy=function retrieveUsersBy(t,o){let c=String();for(const e of o)c=c+t+" eq '"+e+"' or ";c=encodeURIComponent(c).replace(/'/g,"%27").slice(0,-8);const s=new URL("".concat(window.location.origin).concat(r.contextUrl).concat(e,"/user-accounts?filter=").concat(c));return(0,n.fetch)(s,{headers:i,method:"GET"})},t.saveDefinitionRequest=function saveDefinitionRequest(e){return(0,n.fetch)("".concat(c,"/workflow-definitions/save"),{body:JSON.stringify(e),headers:_objectSpread(_objectSpread({},i),{},{"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 c="/o/headless-admin-workflow/v1.0";t.workflowBaseURL=c;const i={"Accept-Language":Liferay.ThemeDisplay.getBCP47LanguageId()};t.headers=i}}));
//# sourceMappingURL=fetchUtil.js.map