UNPKG

contentful-management

Version:
34 lines (31 loc) 1.03 kB
import copy from 'fast-copy'; import { toPlainObject } from 'contentful-sdk-core'; import enhanceWithMethods from '../enhance-with-methods.js'; function createSigningSecretApi(makeRequest) { const getParams = (data) => ({ organizationId: data.sys.organization.sys.id, appDefinitionId: data.sys.appDefinition.sys.id, }); return { delete: function del() { const self = this; return makeRequest({ entityType: 'AppSigningSecret', action: 'delete', params: getParams(self), }); }, }; } /** * @internal * @param http - HTTP client instance * @param data - Raw AppSigningSecret data * @returns Wrapped AppSigningSecret data */ function wrapAppSigningSecret(makeRequest, data) { const signingSecret = toPlainObject(copy(data)); return enhanceWithMethods(signingSecret, createSigningSecretApi(makeRequest)); } export { wrapAppSigningSecret }; //# sourceMappingURL=app-signing-secret.js.map