Liferay.Loader.define("@liferay/analytics-settings-web@5.0.51/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,o.default)("/channels",{body:JSON.stringify({name:e}),method:"POST"})},t.deleteConnection=function deleteConnection(){return(0,o.default)("/data-sources",{method:"DELETE"})},t.fetchAccountGroups=function fetchAccountGroups(e){const t=(0,c.serializeTableRequestParams)(e);return(0,o.default)("/contacts/account-groups?".concat(t),{method:"GET"})},t.fetchChannels=function fetchChannels(e){const t=(0,c.serializeTableRequestParams)(e);return(0,o.default)("/commerce-channels?".concat(t),{method:"GET"})},t.fetchConnection=function fetchConnection(e){return(0,o.default)("/data-sources",{body:JSON.stringify({token:e}),method:"POST"},Liferay.Language.get("token-is-not-valid.-please-insert-a-valid-analytics-cloud-token"))},t.fetchContactsOrganization=function fetchContactsOrganization(e){const t=(0,c.serializeTableRequestParams)(e);return(0,o.default)("/contacts/organizations?".concat(t),{method:"GET"})},t.fetchContactsUsersGroup=function fetchContactsUsersGroup(e){const t=(0,c.serializeTableRequestParams)(e);return(0,o.default)("/contacts/user-groups?".concat(t),{method:"GET"})},t.fetchAttributesConfiguration=function fetchAttributesConfiguration(){return(0,o.default)("/contacts/configuration",{method:"GET"})},t.fetchProperties=function fetchProperties(e){const t=(0,c.serializeTableRequestParams)(e);return(0,o.default)("/channels?".concat(t),{method:"GET"})},t.fetchSites=function fetchSites(e){const t=(0,c.serializeTableRequestParams)(e);return(0,o.default)("/sites?".concat(t),{method:"GET"})},t.updateProperty=function updateProperty({channelId:e,commerceChannelIds:t=[],commerceSyncEnabled:n,dataSourceId:c,siteIds:s=[]}){return(0,o.default)("/channels",{body:JSON.stringify({channelId:e,commerceSyncEnabled:n,dataSources:[{commerceChannelIds:t,dataSourceId:c,siteIds:s}]}),method:"PATCH"})},t.updatecommerceSyncEnabled=function updatecommerceSyncEnabled({channelId:e,commerceSyncEnabled:t}){return(0,o.default)("/channels",{body:JSON.stringify({channelId:e,commerceSyncEnabled:t}),method:"PATCH"})},t.updateAttributesConfiguration=function updateAttributesConfiguration({syncAllAccounts:e,syncAllContacts:t,syncedAccountGroupIds:n,syncedOrganizationIds:c,syncedUserGroupIds:s}){return(0,o.default)("/contacts/configuration",{body:JSON.stringify({syncAllAccounts:e,syncAllContacts:t,syncedAccountGroupIds:n,syncedOrganizationIds:c,syncedUserGroupIds:s}),method:"PUT"})},t.fetchSelectedFields=function fetchSelectedFields(){return(0,o.default)("/fields",{method:"GET"})},t.fetchAccountsFields=function fetchAccountsFields(e){const t=(0,c.serializeTableRequestParams)(e);return(0,o.default)("/fields/accounts?".concat(t.replace("keywords","keyword")),{method:"GET"})},t.fetchOrdersFields=function fetchOrdersFields(e){const t=(0,c.serializeTableRequestParams)(e);return(0,o.default)("/fields/orders?".concat(t.replace("keywords","keyword")),{method:"GET"})},t.fetchPeopleFields=function fetchPeopleFields(e){const t=(0,c.serializeTableRequestParams)(e);return(0,o.default)("/fields/people?".concat(t.replace("keywords","keyword")),{method:"GET"})},t.fetchProductsFields=function fetchProductsFields(e){const t=(0,c.serializeTableRequestParams)(e);return(0,o.default)("/fields/products?".concat(t.replace("keywords","keyword")),{method:"GET"})},t.updateAccountsFields=function updateAccountsFields(e){return(0,o.default)("/fields/accounts",{body:JSON.stringify(e),method:"PATCH"})},t.updateOrdersFields=function updateOrdersFields(e){return(0,o.default)("/fields/orders",{body:JSON.stringify(e),method:"PATCH"})},t.updatePeopleFields=function updatePeopleFields(e){return(0,o.default)("/fields/people",{body:JSON.stringify(e),method:"PATCH"})},t.updateProductsFields=function updateProductsFields(e){return(0,o.default)("/fields/products",{body:JSON.stringify(e),method:"PATCH"})};var c=n("../components/table/utils"),o=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(n("./request"))}));
//# sourceMappingURL=api.js.map