UNPKG

contentful-management

Version:
26 lines (23 loc) 1.03 kB
import { del as del$1, get as get$1, put } from './raw.js'; import copy from 'fast-copy'; const getBaseUrl = (params) => `/organizations/${params.organizationId}/app_definitions/${params.appDefinitionId}/resource_provider/resource_types`; const getEntityUrl = (params) => `${getBaseUrl(params)}/${params.resourceTypeId}`; const getSpaceEnvUrl = (params) => `/spaces/${params.spaceId}/environments/${params.environmentId}/resource_types`; const get = (http, params) => { return get$1(http, getEntityUrl(params)); }; const upsert = (http, params, rawData, headers) => { const data = copy(rawData); return put(http, getEntityUrl(params), data, { headers }); }; const del = (http, params) => { return del$1(http, getEntityUrl(params)); }; const getMany = (http, params) => { return get$1(http, getBaseUrl(params)); }; const getForEnvironment = (http, params) => { return get$1(http, getSpaceEnvUrl(params)); }; export { del, get, getForEnvironment, getMany, upsert }; //# sourceMappingURL=resource-type.js.map