Skip to content

Latest commit

 

History

History
49 lines (37 loc) · 2.09 KB

File metadata and controls

49 lines (37 loc) · 2.09 KB

@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.

License

Overview

This package provides:

  • AssetManagementAdapter – 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.
  • TypesAssetManagementExportOptions, LinkedWorkspace, IAssetManagementAdapter, 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',
  assetManagementUrl,
  org_uid,
  context,
  progressManager,
  progressProcessName,
  updateStatus,
  downloadAsset, // optional
});

Exports

Export Description
exportSpaceStructure Async function to export space structure for given linked workspaces.
AssetManagementAdapter Class to call the Asset Management API (getSpace, getWorkspaceFields, getWorkspaceAssets, etc.).
Types from ./types AssetManagementExportOptions, ExportSpaceOptions, ChunkedJsonWriteOptions, LinkedWorkspace, SpaceResponse, FieldsResponse, AssetTypesResponse, and related API types.