|
| 1 | +/** Fallback when export/import do not pass `chunkFileSizeMb`. */ |
| 2 | +export const FALLBACK_AM_CHUNK_FILE_SIZE_MB = 1; |
| 3 | +/** Fallback when import does not pass `apiConcurrency`. */ |
| 4 | +export const FALLBACK_AM_API_CONCURRENCY = 5; |
| 5 | +/** @deprecated Use FALLBACK_AM_API_CONCURRENCY */ |
| 6 | +export const DEFAULT_AM_API_CONCURRENCY = FALLBACK_AM_API_CONCURRENCY; |
| 7 | + |
| 8 | +/** Fallback strip lists when import options omit `fieldsImportInvalidKeys` / `assetTypesImportInvalidKeys`. */ |
| 9 | +export const FALLBACK_FIELDS_IMPORT_INVALID_KEYS = [ |
| 10 | + 'created_at', |
| 11 | + 'created_by', |
| 12 | + 'updated_at', |
| 13 | + 'updated_by', |
| 14 | + 'is_system', |
| 15 | + 'asset_types_count', |
| 16 | +] as const; |
| 17 | +export const FALLBACK_ASSET_TYPES_IMPORT_INVALID_KEYS = [ |
| 18 | + 'created_at', |
| 19 | + 'created_by', |
| 20 | + 'updated_at', |
| 21 | + 'updated_by', |
| 22 | + 'is_system', |
| 23 | + 'category', |
| 24 | + 'preview_image_url', |
| 25 | + 'category_detail', |
| 26 | +] as const; |
| 27 | + |
| 28 | +/** @deprecated Use FALLBACK_AM_CHUNK_FILE_SIZE_MB */ |
| 29 | +export const CHUNK_FILE_SIZE_MB = FALLBACK_AM_CHUNK_FILE_SIZE_MB; |
| 30 | + |
| 31 | +/** |
| 32 | + * Main process name for Asset Management 2.0 export (single progress bar). |
| 33 | + * Use this when adding/starting the process and for all ticks. |
| 34 | + */ |
| 35 | +export const AM_MAIN_PROCESS_NAME = 'Asset Management 2.0'; |
| 36 | + |
| 37 | +/** |
| 38 | + * Process names for Asset Management 2.0 export progress (for tick labels). |
| 39 | + */ |
| 40 | +export const PROCESS_NAMES = { |
| 41 | + AM_SPACE_METADATA: 'Space metadata', |
| 42 | + AM_FOLDERS: 'Folders', |
| 43 | + AM_ASSETS: 'Assets', |
| 44 | + AM_FIELDS: 'Fields', |
| 45 | + AM_ASSET_TYPES: 'Asset types', |
| 46 | + AM_DOWNLOADS: 'Asset downloads', |
| 47 | + // Import process names |
| 48 | + AM_IMPORT_FIELDS: 'Import fields', |
| 49 | + AM_IMPORT_ASSET_TYPES: 'Import asset types', |
| 50 | + AM_IMPORT_FOLDERS: 'Import folders', |
| 51 | + AM_IMPORT_ASSETS: 'Import assets', |
| 52 | +} as const; |
| 53 | + |
| 54 | +/** |
| 55 | + * Status messages for each process (exporting, fetching, importing, failed). |
| 56 | + */ |
| 57 | +export const PROCESS_STATUS = { |
| 58 | + [PROCESS_NAMES.AM_SPACE_METADATA]: { |
| 59 | + EXPORTING: 'Exporting space metadata...', |
| 60 | + FAILED: 'Failed to export space metadata.', |
| 61 | + }, |
| 62 | + [PROCESS_NAMES.AM_FOLDERS]: { |
| 63 | + FETCHING: 'Fetching folders...', |
| 64 | + FAILED: 'Failed to fetch folders.', |
| 65 | + }, |
| 66 | + [PROCESS_NAMES.AM_ASSETS]: { |
| 67 | + FETCHING: 'Fetching assets...', |
| 68 | + FAILED: 'Failed to fetch assets.', |
| 69 | + }, |
| 70 | + [PROCESS_NAMES.AM_FIELDS]: { |
| 71 | + FETCHING: 'Fetching fields...', |
| 72 | + FAILED: 'Failed to fetch fields.', |
| 73 | + }, |
| 74 | + [PROCESS_NAMES.AM_ASSET_TYPES]: { |
| 75 | + FETCHING: 'Fetching asset types...', |
| 76 | + FAILED: 'Failed to fetch asset types.', |
| 77 | + }, |
| 78 | + [PROCESS_NAMES.AM_DOWNLOADS]: { |
| 79 | + DOWNLOADING: 'Downloading asset files...', |
| 80 | + FAILED: 'Failed to download assets.', |
| 81 | + }, |
| 82 | + [PROCESS_NAMES.AM_IMPORT_FIELDS]: { |
| 83 | + IMPORTING: 'Importing shared fields...', |
| 84 | + FAILED: 'Failed to import fields.', |
| 85 | + }, |
| 86 | + [PROCESS_NAMES.AM_IMPORT_ASSET_TYPES]: { |
| 87 | + IMPORTING: 'Importing shared asset types...', |
| 88 | + FAILED: 'Failed to import asset types.', |
| 89 | + }, |
| 90 | + [PROCESS_NAMES.AM_IMPORT_FOLDERS]: { |
| 91 | + IMPORTING: 'Importing folders...', |
| 92 | + FAILED: 'Failed to import folders.', |
| 93 | + }, |
| 94 | + [PROCESS_NAMES.AM_IMPORT_ASSETS]: { |
| 95 | + IMPORTING: 'Importing assets...', |
| 96 | + FAILED: 'Failed to import assets.', |
| 97 | + }, |
| 98 | +} as const; |
0 commit comments