@contentstack/cli-asset-management
v1.0.0
Published
Contentstack Assets API adapter for export and import
Downloads
4,270
Readme
@contentstack/cli-asset-management
Asset Management 2.0 API adapter for Contentstack CLI export and import. Used by the export and import plugins when Asset Management (AM 2.0) is enabled. To learn how to export and import content in Contentstack, refer to the Migration guide.
Overview
This package provides:
- CSAssetsAdapter – HTTP client for the Asset Management API (spaces, assets, folders, fields, asset types).
- exportSpaceStructure – Exports space metadata and full workspace structure (metadata, folders, assets, fields, asset types) for linked workspaces.
- Types –
AssetManagementExportOptions,LinkedWorkspace,ICSAssetsAdapter, and related types for export/import integration.
Usage
This package is consumed by the export and import plugins. When using the export CLI with the --asset-management flag (or when the host app enables AM 2.0), the export plugin calls exportSpaceStructure with linked workspaces and options:
import { exportSpaceStructure } from '@contentstack/cli-asset-management';
await exportSpaceStructure({
linkedWorkspaces,
exportDir,
branchName: 'main',
csAssetsUrl,
org_uid,
context,
});Exports
| Export | Description |
|--------|-------------|
| exportSpaceStructure | Async function to export space structure for given linked workspaces. |
| CSAssetsAdapter | Class to call the Asset Management API (getSpace, getWorkspaceFields, getWorkspaceAssets, etc.). |
| Types from ./types | AssetManagementExportOptions, ExportContext, ChunkedJsonWriteOptions, LinkedWorkspace, SpaceResponse, FieldsResponse, AssetTypesResponse, and related API types. |
