Below are instructions for migrating from one version of dc-extension-sdk to another.
We have introduced improved control over the extension types you are initialising. Previously you would initialise the extension using:
const sdk = await init<FieldModel, Parameters>();In version 2.x.x you can now pass an additional extension type:
const sdk = await init<ContentFieldExtension<FieldModel, Parameters>>();The SDK class has been removed and the SDK properties have been moved to the ContentFieldExtension class.
Previous you could create a new instance of the SDK and invoke init() on it
import { SDK } from 'dc-extensions-sdk';
const sdk = new SDK();
await sdk.init();Please initialise the sdk using the exposed init() method
import { init } from 'dc-extensions-sdk';
const sdk = await init<ContentFieldExtension<FieldModel, Parameters>>();Please use InitOptions and Partial<InitOptions> instead
Events, ContentItem, ContentLink, ContentReference, Field, Frame, Form, HttpClient & MediaLink are no longer exported
Events, ContentItem, ContentLink, ContentReference, Field, Frame, Form, HttpClient & MediaLink are no longer exported as these are internal/private data structures.
You should only be using the resolved result from the init(); call.