Liferay.Loader.define("@liferay/analytics-settings-web@5.0.47/js/utils/api",["module","exports","require","../components/table/utils","./request"],(function(e,t,n){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.createProperty=function createProperty(e){return(0,r.default)("/channels",{body:JSON.stringify({name:e}),method:"POST"})},t.deleteConnection=function deleteConnection(){return(0,r.default)("/data-sources",{method:"DELETE"})},t.fetchAccountGroups=function fetchAccountGroups(e){const t=(0,o.serializeTableRequestParams)(e);return(0,r.default)("/contacts/account-groups?".concat(t),{method:"GET"})},t.fetchChannels=function fetchChannels(e){const t=(0,o.serializeTableRequestParams)(e);return(0,r.default)("/commerce-channels?".concat(t),{method:"GET"})},t.fetchConnection=function fetchConnection(e){return(0,r.default)("/data-sources",{body:JSON.stringify({token:e}),method:"POST"})},t.fetchContactsOrganization=function fetchContactsOrganization(e){const t=(0,o.serializeTableRequestParams)(e);return(0,r.default)("/contacts/organizations?".concat(t),{method:"GET"})},t.fetchContactsUsersGroup=function fetchContactsUsersGroup(e){const t=(0,o.serializeTableRequestParams)(e);return(0,r.default)("/contacts/user-groups?".concat(t),{method:"GET"})},t.fetchAttributesConfiguration=function fetchAttributesConfiguration(){return(0,r.default)("/contacts/configuration",{method:"GET"})},t.fetchProperties=function fetchProperties(){return(0,r.default)("/channels?sort=createDate:desc",{method:"GET"})},t.fetchSites=function fetchSites(e){const t=(0,o.serializeTableRequestParams)(e);return(0,r.default)("/sites?".concat(t),{method:"GET"})},t.updateProperty=function updateProperty({channelId:e,commerceChannelIds:t,commerceSyncEnabled:n,dataSourceId:o,siteIds:c}){return(0,r.default)("/channels",{body:JSON.stringify(_objectSpread({channelId:e,commerceSyncEnabled:n},o&&{dataSources:[{commerceChannelIds:t,dataSourceId:o,siteIds:c}]})),method:"PATCH"})},t.updateAttributesConfiguration=function updateAttributesConfiguration({syncAllAccounts:e,syncAllContacts:t,syncedAccountGroupIds:n,syncedOrganizationIds:o,syncedUserGroupIds:c}){return(0,r.default)("/contacts/configuration",{body:JSON.stringify({syncAllAccounts:e,syncAllContacts:t,syncedAccountGroupIds:n,syncedOrganizationIds:o,syncedUserGroupIds:c}),method:"PUT"})},t.fetchSelectedFields=function fetchSelectedFields(){return(0,r.default)("/fields",{method:"GET"})},t.fetchPeopleFields=function fetchPeopleFields(e){const t=(0,o.serializeTableRequestParams)(e);return(0,r.default)("/fields/people?".concat(t.replace("keywords","keyword")),{method:"GET"})},t.updatePeopleFields=function updatePeopleFields(e){return(0,r.default)("/fields/people",{body:JSON.stringify(e),method:"PATCH"})};var o=n("../components/table/utils"),r=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(n("./request"));function ownKeys(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 _objectSpread(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(n),!0).forEach((function(t){_defineProperty(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ownKeys(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function _defineProperty(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}}}));
//# sourceMappingURL=api.js.map