To manipulate design system versions, access the versions object on the SDK. Through that, you can invoke all version methods mentioned, like this:
const activeVersion = await sdk.versions.getActiveVersion(designSystemId)
Read methods
Fetch the active design system version
Fetches the active design system version, which is the one all changes are currently being written to. For every design system, there is always one active version.
async getActiveVersion(designSystemId: string): Promise<DesignSystemVersion | null>
Fetch all versions of a design system
Retrieves all versions associated with a specified design system.
async getVersions(designSystemId: string): Promise<Array<DesignSystemVersion>>
Fetch a specific design system version
Fetches a specific version of a design system using the provided design system ID and version ID.
async getVersion(from: RemoteVersionIdentifier): Promise<DesignSystemVersion>
Create/update methods
Create a new design system version
Creates a new version for a specified design system and retrieves the newly created version object.
async createVersion(designSystemId: string, model: DesignSystemVersionUpdateModel): Promise<DesignSystemVersion>
Edit a design system version
Updates a specific version of a design system using the provided design system ID, version ID, and update model.
async editVersion(designSystemId: string, versionId: string, model: DesignSystemVersionUpdateModel): Promise<void>
Delete methods
Delete a design system version
Deletes a specific version of a design system using the provided design system ID and version ID.
async deleteVersion(designSystemId: string, versionId: string): Promise<void>