contentful-management
Version:
Client for Contentful's Content Management API
30 lines (27 loc) • 890 B
JavaScript
import { toPlainObject, freezeSys } from 'contentful-sdk-core';
import copy from 'fast-copy';
import { wrapCollection } from '../common-utils.js';
import enhanceWithMethods from '../enhance-with-methods.js';
/**
* @internal
*/
function createPreviewApiKeyApi() {
return {};
}
/**
* @internal
* @param makeRequest - function to make requests via an adapter
* @param data - Raw api key data
* @returns Wrapped preview api key data
*/
function wrapPreviewApiKey(_makeRequest, data) {
const previewApiKey = toPlainObject(copy(data));
const previewApiKeyWithMethods = enhanceWithMethods(previewApiKey, createPreviewApiKeyApi());
return freezeSys(previewApiKeyWithMethods);
}
/**
* @internal
*/
const wrapPreviewApiKeyCollection = wrapCollection(wrapPreviewApiKey);
export { wrapPreviewApiKey, wrapPreviewApiKeyCollection };
//# sourceMappingURL=preview-api-key.js.map