@@ -2,15 +2,15 @@ import { resolve as pResolve } from 'node:path';
22import { mkdir } from 'node:fs/promises' ;
33import { log , CLIProgressManager , configHandler , handleAndLogError } from '@contentstack/cli-utilities' ;
44
5- import type { AssetManagementExportOptions , AssetManagementAPIConfig } from '../types/asset-management -api' ;
5+ import type { AssetManagementExportOptions , CSAssetsAPIConfig } from '../types/cs-assets -api' ;
66import type { ExportContext } from '../types/export-types' ;
7- import { AM_MAIN_PROCESS_NAME , PROCESS_NAMES , getSpaceProcessName } from '../constants/index' ;
7+ import { CS_ASSETS_MAIN_PROCESS_NAME , PROCESS_NAMES , getSpaceProcessName } from '../constants/index' ;
88import ExportAssetTypes from './asset-types' ;
99import ExportFields from './fields' ;
1010import ExportWorkspace from './workspaces' ;
1111
1212/**
13- * Orchestrates the full Asset Management 2.0 export: shared asset types and fields,
13+ * Orchestrates the full Contentstack Assets export: shared asset types and fields,
1414 * then per-workspace metadata and assets (including internal download).
1515 * Progress and download are fully owned by this package.
1616 */
@@ -32,7 +32,7 @@ export class ExportSpaces {
3232 linkedWorkspaces,
3333 exportDir,
3434 branchName,
35- assetManagementUrl ,
35+ csAssetsUrl ,
3636 org_uid,
3737 apiKey,
3838 context,
@@ -45,9 +45,9 @@ export class ExportSpaces {
4545 return ;
4646 }
4747
48- log . debug ( 'Starting Asset Management export process...' , context ) ;
49- log . info ( 'Started Asset Management export' , context ) ;
50- log . debug ( `Exporting Asset Management 2.0 (${ linkedWorkspaces . length } space(s))` , context ) ;
48+ log . debug ( 'Starting Contentstack Assets export process...' , context ) ;
49+ log . info ( 'Started Contentstack Assets export' , context ) ;
50+ log . debug ( `Exporting Contentstack Assets (${ linkedWorkspaces . length } space(s))` , context ) ;
5151 log . debug ( `Spaces: ${ linkedWorkspaces . map ( ( ws ) => ws . space_uid ) . join ( ', ' ) } ` , context ) ;
5252
5353 const spacesRootPath = pResolve ( exportDir , 'spaces' ) ;
@@ -67,8 +67,8 @@ export class ExportSpaces {
6767 progress . addProcess ( spaceProcess , 1 ) ;
6868 }
6969
70- const apiConfig : AssetManagementAPIConfig = {
71- baseURL : assetManagementUrl ,
70+ const apiConfig : CSAssetsAPIConfig = {
71+ baseURL : csAssetsUrl ,
7272 headers : { organization_uid : org_uid } ,
7373 context,
7474 } ;
@@ -135,11 +135,11 @@ export class ExportSpaces {
135135
136136 log . info (
137137 anySpaceFailed
138- ? 'Asset Management export completed with errors in one or more spaces'
139- : 'Asset Management export completed successfully' ,
138+ ? 'Contentstack Assets export completed with errors in one or more spaces'
139+ : 'Contentstack Assets export completed successfully' ,
140140 context ,
141141 ) ;
142- log . debug ( 'Asset Management 2.0 export completed' , context ) ;
142+ log . debug ( 'Contentstack Assets export completed' , context ) ;
143143 } catch ( err ) {
144144 if ( ! bootstrapFailed ) {
145145 // Mark any spaces that hadn't been processed as failed so the multibar
@@ -148,7 +148,7 @@ export class ExportSpaces {
148148 progress . completeProcess ( spaceProcess , false ) ;
149149 }
150150 }
151- handleAndLogError ( err , { ...( context as Record < string , unknown > ) } , 'Asset Management export failed' ) ;
151+ handleAndLogError ( err , { ...( context as Record < string , unknown > ) } , 'Contentstack Assets export failed' ) ;
152152 throw err ;
153153 }
154154 }
@@ -160,7 +160,7 @@ export class ExportSpaces {
160160 }
161161 const logConfig = configHandler . get ( 'log' ) || { } ;
162162 const showConsoleLogs = logConfig . showConsoleLogs ?? false ;
163- this . progressManager = CLIProgressManager . createNested ( AM_MAIN_PROCESS_NAME , showConsoleLogs ) ;
163+ this . progressManager = CLIProgressManager . createNested ( CS_ASSETS_MAIN_PROCESS_NAME , showConsoleLogs ) ;
164164 return this . progressManager ;
165165 }
166166}
0 commit comments