UNPKG

contentful-management

Version:
36 lines (33 loc) 1.11 kB
import { post, del as del$1, get as get$1 } from './raw.js'; import { normalizeSelect } from './utils.js'; const getBaseUrl = (params) => `/organizations/${params.organizationId}/app_definitions/${params.appDefinitionId}/app_bundles`; const getAppBundleUrl = (params) => `${getBaseUrl(params)}/${params.appBundleId}`; const get = (http, params) => { return get$1(http, getAppBundleUrl(params)); }; const getMany = (http, params) => { return get$1(http, getBaseUrl(params), { params: normalizeSelect(params.query), }); }; const del = (http, params) => { return del$1(http, getAppBundleUrl(params)); }; const create = (http, params, payload) => { const { appUploadId, comment, actions, functions } = payload; const data = { upload: { sys: { type: 'Link', linkType: 'AppUpload', id: appUploadId, }, }, comment, actions, functions, }; return post(http, getBaseUrl(params), data); }; export { create, del, get, getMany }; //# sourceMappingURL=app-bundle.js.map