contensis-cli 1.3.1-beta.8 → 1.3.1-beta.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/localisation/en-GB.js +8 -2
- package/dist/localisation/en-GB.js.map +2 -2
- package/dist/services/ContensisCliService.js +13 -12
- package/dist/services/ContensisCliService.js.map +2 -2
- package/dist/util/console.printer.js +3 -1
- package/dist/util/console.printer.js.map +2 -2
- package/dist/version.js +1 -1
- package/dist/version.js.map +1 -1
- package/package.json +2 -2
- package/src/localisation/en-GB.ts +11 -2
- package/src/services/ContensisCliService.ts +13 -14
- package/src/util/console.printer.ts +23 -19
- package/src/version.ts +1 -1
|
@@ -182,7 +182,9 @@ const printEntriesMigrateResult = (service, migrateResult, {
|
|
|
182
182
|
migrateResult.entries || {}
|
|
183
183
|
)) {
|
|
184
184
|
log.help(
|
|
185
|
-
|
|
185
|
+
action === "update" ? `update entries in project ${log.boldText(
|
|
186
|
+
log.warningText(currentProject)
|
|
187
|
+
)}` : `${action} from project ${action === "delete" ? log.warningText(currentProject) : `${log.highlightText(projectId)} to ${log.boldText(
|
|
186
188
|
log.warningText(currentProject)
|
|
187
189
|
)}`}`
|
|
188
190
|
);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/util/console.printer.ts"],
|
|
4
|
-
"sourcesContent": ["import { Node } from 'contensis-delivery-api/lib/models';\nimport dayjs from 'dayjs';\nimport { deconstructApiError } from './error';\nimport { Logger, addNewLines } from './logger';\nimport {\n BlockVersion,\n CopyFieldResult,\n EntriesMigrationResult,\n EntriesResult,\n MigrateModelsResult,\n MigrateNodesTree,\n MigrateStatus,\n NodesResult,\n ProjectNodesToMigrate,\n} from 'migratortron';\nimport ContensisCli from '~/services/ContensisCliService';\n\nconst formatDate = (date: Date | string, format = 'DD/MM/YYYY HH:mm') =>\n dayjs(date).format(format);\n\nexport const printBlockVersion = (\n { log, messages }: ContensisCli,\n block: BlockVersion,\n printOptions = {\n showSource: true,\n showStatus: true,\n showStaticPaths: true,\n showImage: true,\n }\n) => {\n console.log(\n ` ${log.standardText(`v${block.version.versionNo}`)} ${block.id}`\n );\n console.log(\n ` state: ${messages.blocks.runningStatus(\n block.status.broken ? 'broken' : block.status.running.global\n )}`\n );\n console.log(\n ` released: ${log.infoText(\n block.version.released\n ? `[${formatDate(block.version.released)}] ${block.version.releasedBy}`\n : 'no'\n )}`\n );\n if (block.version.madeLive)\n console.log(\n ` live: ${log.infoText(\n `[${formatDate(block.version.madeLive)}] ${block.version.madeLiveBy}`\n )}`\n );\n if (printOptions.showStatus) {\n console.log(` status:`);\n console.log(` deployment: ${log.infoText(block.status.deployment)}`);\n console.log(` workflow: ${log.infoText(block.status.workflow)}`);\n console.log(\n ` running status: ${messages.blocks.runningStatus(\n block.status.running.global\n )}`\n );\n console.log(` datacentres:`);\n console.log(\n ` hq: ${messages.blocks.runningStatus(\n block.status.running.dataCenters.hq\n )}`\n );\n console.log(\n ` london: ${messages.blocks.runningStatus(\n block.status.running.dataCenters.london\n )}`\n );\n console.log(\n ` manchester: ${messages.blocks.runningStatus(\n block.status.running.dataCenters.manchester\n )}`\n );\n }\n if (printOptions.showSource) {\n console.log(` source:`);\n console.log(` commit: ${log.helpText(block.source.commit.id)}`);\n console.log(\n ` message: ${log.infoText(\n block.source.commit.message\n ?.replaceAll('\\n', '\\\\n')\n .replaceAll('\\\\n\\\\n', '\\\\n')\n .replaceAll('\\\\n', '; ')\n )}`\n );\n console.log(\n ` committed: ${log.infoText(\n `[${formatDate(block.source.commit.dateTime)}] ${\n block.source.commit.authorEmail\n }`\n )}`\n );\n console.log(\n ` pushed: ${log.infoText(\n `[${formatDate(block.version.pushed)}] ${block.version.pushedBy}`\n )}`\n );\n console.log(` ${log.infoText(block.source.commit.commitUrl)}`);\n }\n if (printOptions.showImage) {\n console.log(` image:`);\n console.log(` uri: ${log.infoText(block.image.uri)}`);\n console.log(` tag: ${log.helpText(block.image.tag)}`);\n }\n if (printOptions.showStaticPaths) {\n if (block.staticPaths?.length) {\n console.log(` static paths:`);\n for (const path of block.staticPaths) console.log(` - ${path}`);\n }\n }\n if (block.stagingUrl)\n console.log(` staging url: ${log.infoText(block.stagingUrl)}`);\n console.log('');\n};\n\nexport const printEntriesMigrateResult = (\n service: ContensisCli,\n migrateResult: EntriesMigrationResult | EntriesResult | CopyFieldResult,\n {\n action = 'import',\n showDiff = false,\n showAll = false,\n showChanged = false,\n }: {\n action?: 'import' | 'delete';\n showDiff?: boolean;\n showAll?: boolean;\n showChanged?: boolean;\n } = {}\n) => {\n console.log(``);\n const { log, messages, currentProject } = service;\n for (const [contentTypeId, entryRes] of Object.entries(\n migrateResult.entriesToMigrate.entryIds\n ) as [string, any]) {\n for (const [originalId, entryStatus] of Object.entries(entryRes) as [\n string,\n any\n ][]) {\n if (\n showAll ||\n (showChanged &&\n (\n Object.entries(\n Object.entries(entryStatus[currentProject])[0]\n )[1][1] as any\n ).status !== 'no change')\n ) {\n console.log(\n log.infoText(\n `${Object.entries(entryStatus || {})\n .filter(x => x[0] !== 'entryTitle')\n .map(([projectId, projectStatus]) => {\n const [targetGuid, { status }] = (Object.entries(\n projectStatus || {}\n )?.[0] as [string, { status: MigrateStatus }]) || [\n '',\n { x: { status: undefined } },\n ];\n return `${messages.migrate.status(status)(\n `${status}`\n )} ${originalId}${\n targetGuid !== originalId ? ` -> ${targetGuid}\\n ` : ' '\n }`;\n })}`\n ) + `${log.helpText(contentTypeId)} ${entryStatus.entryTitle}`\n );\n\n for (const [projectId, projectStatus] of Object.entries(\n entryStatus\n ).filter(([key]) => key !== 'entryTitle') as [string, any][]) {\n const [targetGuid, { error, diff, status }] = Object.entries(\n projectStatus\n )[0] as [string, any];\n if (error) log.error(error);\n if (diff && showDiff) {\n console.log(\n ` ${log.infoText(`diff: ${highlightDiffText(diff)}`)}\\n`\n );\n }\n }\n }\n }\n }\n if (showAll || showChanged) console.log(``);\n\n for (const [projectId, contentTypeCounts] of Object.entries(\n migrateResult.entries || {}\n ) as [string, any][]) {\n log.help(\n `${action} from project ${\n action === 'delete'\n ? log.warningText(currentProject)\n : `${log.highlightText(projectId)} to ${log.boldText(\n log.warningText(currentProject)\n )}`\n }`\n );\n for (const [contentTypeId, count] of Object.entries(contentTypeCounts) as [\n string,\n number\n ][]) {\n const isTotalCountRow = contentTypeId === 'totalCount';\n const migrateStatusAndCount =\n migrateResult.entriesToMigrate[currentProject][contentTypeId];\n const existingCount =\n migrateResult.existing?.[currentProject]?.[contentTypeId] || 0;\n const existingPercent = ((existingCount / count) * 100).toFixed(0);\n const noChangeOrTotalEntriesCount =\n typeof migrateStatusAndCount !== 'number'\n ? migrateStatusAndCount?.['no change'] || 0\n : migrateStatusAndCount;\n\n const changedPercentage = (\n (noChangeOrTotalEntriesCount / count) *\n 100\n ).toFixed(0);\n\n const existingColor =\n existingPercent === '0' || action === 'delete'\n ? log.warningText\n : log.infoText;\n\n const changedColor = isTotalCountRow\n ? log.helpText\n : changedPercentage === '100'\n ? log.successText\n : log.warningText;\n\n if (isTotalCountRow && 'nodes' in migrateResult) {\n printNodesMigrateResult(service, migrateResult, {\n showAll,\n showDiff,\n showChanged,\n isEntriesMigration: true,\n });\n }\n console.log(\n ` - ${\n isTotalCountRow\n ? log.highlightText(\n `${contentTypeId}: ${noChangeOrTotalEntriesCount}`\n )\n : `${contentTypeId}: ${log.helpText(count)}`\n }${\n changedPercentage === '100' || isTotalCountRow\n ? ''\n : existingColor(` [existing: ${`${existingPercent}%`}]`)\n }${\n existingPercent === '0' || (action === 'import' && isTotalCountRow)\n ? ''\n : changedColor(\n ` ${\n isTotalCountRow\n ? `[to ${action}: ${noChangeOrTotalEntriesCount}]`\n : changedPercentage === '100'\n ? 'up to date'\n : `[needs update: ${100 - Number(changedPercentage)}%]`\n }`\n )\n }`\n );\n }\n }\n if (migrateResult.errors?.length) {\n console.log(\n ` - ${log.errorText(`errors: ${migrateResult.errors.length}`)}\\n`\n );\n for (const error of migrateResult.errors)\n log.error(error.message, null, '');\n }\n};\n\nexport const printNodesMigrateResult = (\n { log, currentProject }: ContensisCli,\n migrateResult: EntriesMigrationResult | NodesResult,\n {\n action = 'import',\n logLimit = 50,\n showDiff = false,\n showAll = false,\n showChanged = false,\n isEntriesMigration = false,\n }: {\n action?: 'import' | 'delete';\n logLimit?: number;\n showDiff?: boolean;\n showAll?: boolean;\n showChanged?: boolean;\n isEntriesMigration?: boolean;\n } = {}\n) => {\n if (!isEntriesMigration) log.raw(``);\n for (const [projectId, counts] of Object.entries(migrateResult.nodes || {})) {\n const importTitle =\n action === 'delete'\n ? `Delete from project ${log.warningText(currentProject)}`\n : `Import ${\n projectId && projectId !== 'null'\n ? `from project ${log.highlightText(projectId)} `\n : ''\n }to ${log.boldText(log.warningText(currentProject))}`;\n if (!isEntriesMigration) log.help(importTitle);\n\n const migrateStatusAndCount = migrateResult.nodesToMigrate[\n currentProject\n ] as ProjectNodesToMigrate;\n\n const existingCount = migrateResult.nodes?.[projectId]?.totalCount || 0;\n\n const totalCount = Object.keys(migrateResult.nodesToMigrate.nodeIds).length;\n const existingPercent = counts.totalCount\n ? ((existingCount / totalCount) * 100).toFixed(0)\n : '0';\n\n const noChangeCount = migrateStatusAndCount?.['no change'] || 0;\n\n const changedPercentage = counts.totalCount\n ? ((noChangeCount / totalCount) * 100).toFixed(0)\n : '0';\n\n const existingColor =\n existingPercent === '0' || action === 'delete'\n ? log.warningText\n : log.infoText;\n\n const changedColor =\n changedPercentage === '100' ? log.successText : log.warningText;\n\n if (!isEntriesMigration || migrateStatusAndCount.totalCount > 0)\n console.log(\n ` - ${log.highlightText(\n `${isEntriesMigration ? ' + nodes' : 'totalCount'}: ${\n migrateStatusAndCount.totalCount\n }`\n )}${\n changedPercentage === '100'\n ? ''\n : existingColor(` [existing: ${`${existingPercent}%`}]`)\n }${\n existingPercent === '0'\n ? ''\n : changedColor(\n ` ${\n changedPercentage === '100'\n ? 'up to date'\n : `[needs update: ${100 - Number(changedPercentage)}%]`\n }`\n )\n }`\n );\n }\n if (migrateResult.errors?.length) {\n console.log(\n ` - ${log.errorText(`errors: ${migrateResult.errors.length}`)}\\n`\n );\n\n log.limits(\n migrateResult.errors\n .map(error => {\n return log.errorText(deconstructApiError(error));\n })\n .join('\\n'),\n logLimit\n );\n }\n};\n\nconst highlightDiffText = (str: string) => {\n const addedRegex = new RegExp(/<<\\+>>(.*?)<<\\/\\+>>/, 'g');\n const removedRegex = new RegExp(/<<->>(.*?)<<\\/->>/, 'g');\n return str\n .replace(addedRegex, match => {\n return Logger.successText(\n match.replace(/<<\\+>>/g, '<+>').replace(/<<\\/\\+>>/g, '</+>')\n );\n })\n .replace(removedRegex, match => {\n return Logger.errorText(\n match.replace(/<<->>/g, '<->').replace(/<<\\/->>/g, '</->')\n );\n });\n};\n\nexport const printModelMigrationAnalysis = (\n { log, messages }: ContensisCli,\n result: any = {}\n) => {\n for (const [contentTypeId, model] of Object.entries(result) as [\n string,\n any\n ][]) {\n let mainOutput = log.standardText(\n ` - ${contentTypeId}${\n model.contentTypeId ? ` ${log.helpText(model.contentTypeId)}` : ''\n }`\n );\n let extraOutput = '';\n let errorOutput = '';\n let diffOutput = '';\n for (const [key, details] of Object.entries(model) as [string, any][]) {\n if (key === 'dependencies') {\n extraOutput += log.infoText(\n ` references: [${details?.join(', ')}]\\n`\n );\n }\n if (key === 'dependencyOf') {\n extraOutput += log.infoText(\n ` required by: [${details?.join(', ')}]\\n`\n );\n }\n if (key === 'projects') {\n for (const [projectId, projectDetails] of Object.entries(details) as [\n string,\n any\n ][]) {\n mainOutput += log.infoText(\n ` [${messages.migrate.status(projectDetails.status)(\n `${projectId}: ${projectDetails.status}`\n )}]${\n projectDetails.versionNo ? ` v${projectDetails.versionNo}` : ''\n }`\n );\n if (projectDetails.diff)\n diffOutput += ` ${log.highlightText(`diff:`)} ${log.infoText(\n highlightDiffText(projectDetails.diff)\n )}`;\n if (projectDetails.error)\n errorOutput += ` ${log.highlightText(\n `error::`\n )} ${log.errorText(projectDetails.error)}`;\n }\n }\n }\n console.log(mainOutput);\n if (extraOutput) {\n const search = '\\n';\n const replace = '';\n console.log(\n extraOutput.replace(\n new RegExp(search + '([^' + search + ']*)$'),\n replace + '$1'\n )\n );\n }\n if (diffOutput) console.log(diffOutput);\n if (errorOutput) console.log(errorOutput);\n }\n};\n\ntype MigrateResultSummary = MigrateModelsResult['']['contentTypes'];\ntype MigrateResultStatus = keyof MigrateResultSummary;\n\nexport const printModelMigrationResult = (\n { log, messages }: ContensisCli,\n result: MigrateResultSummary\n) => {\n for (const [status, ids] of Object.entries(result) as [\n MigrateResultStatus,\n string[]\n ][]) {\n if (ids?.length) {\n if (status === 'errors') {\n const errors: [string, MappedError][] = ids as any;\n log.raw(\n ` - ${status}: [ ${messages.migrate.models.result(status)(\n ids.map(id => id[0]).join(', ')\n )} ]\\n`\n );\n for (const [contentTypeId, error] of errors)\n log.error(\n `${log.highlightText(contentTypeId)}: ${error.message}`,\n error\n );\n } else\n log.raw(\n ` - ${status}: [ ${messages.migrate.models.result(status)(\n ids.join(', ')\n )} ]`\n );\n }\n }\n};\n\nexport const printNodeTreeOutput = (\n { log, messages }: ContensisCli,\n root: Node | Partial<MigrateNodesTree> | undefined,\n logDetail = 'errors',\n logLimit = 1000\n) => {\n log.raw('');\n const statusColour = messages.migrate.status;\n\n if (root && 'status' in root)\n log.info(\n `Migrate status: ${statusColour('no change')(\n 'N'\n )} [no change]; ${statusColour('create')('C')} [create]; ${statusColour(\n 'update'\n )('U')} [update]; ${statusColour('delete')('D')} [delete]; ${statusColour(\n 'error'\n )('E')} [error];`\n );\n log.info(\n `Node properties: ${log.highlightText(\n 'e'\n )} = has entry; ${log.highlightText('c')} = canonical; ${log.highlightText(\n 'm'\n )} = include in menu`\n );\n\n log.line();\n\n const outputNode = (\n node: Partial<Node | MigrateNodesTree>,\n spaces: string,\n isRoot = false\n ) => {\n const errorOutput =\n 'error' in node && node.error && deconstructApiError(node.error);\n const fullOutput = logDetail === 'all';\n const changesOutput =\n logDetail === 'changes' &&\n 'status' in node &&\n node.status &&\n ['create', 'update'].includes(node.status);\n\n const diffOutput =\n (fullOutput || changesOutput || errorOutput) &&\n 'diff' in node &&\n node.diff?.replaceAll('\\n', '');\n\n return `${\n 'status' in node && node.status\n ? `${statusColour(node.status)(\n node.status.substring(0, 1).toUpperCase()\n )} `\n : ''\n }${node.entry ? log.highlightText('e') : log.infoText('-')}${\n 'isCanonical' in node && node.isCanonical\n ? log.highlightText('c')\n : log.infoText('-')\n }${\n node.includeInMenu ? log.highlightText('m') : log.infoText('-')\n }${spaces}${log[\n 'status' in node && node.status === 'no change'\n ? 'infoText'\n : 'standardText'\n ](\n 'isCanonical' in node && node.isCanonical\n ? log.boldText(\n fullOutput || isRoot || !node.slug ? node.path : `/${node.slug}`\n )\n : fullOutput || isRoot || !node.slug\n ? node.path\n : `/${node.slug}`\n )}${node.entry ? ` ${log.helpText(node.entry.sys.contentTypeId)}` : ''}${\n node.childCount ? ` +${node.childCount}` : ``\n } ${'displayName' in node ? log.infoText(node.displayName) : ''}${\n fullOutput || (changesOutput && node.id !== node.originalId)\n ? `~n ${log.infoText(`id:`)} ${\n !('originalId' in node) || node.id === node.originalId\n ? node.id\n : `${node.id} ${log.infoText(`<= ${node.originalId}`)}`\n }`\n : ''\n }${\n (fullOutput ||\n (changesOutput && node.parentId !== node.originalParentId)) &&\n node.parentId\n ? `~n ${log.infoText(\n `parentId: ${\n !('originalParentId' in node) ||\n node.parentId === node.originalParentId\n ? node.parentId\n : `${node.parentId} <= ${node.originalParentId}`\n }`\n )}`\n : ''\n }${\n fullOutput && node.entry?.sys.id\n ? `~n ${log.infoText(`entryId: ${node.entry.sys.id}`)}`\n : ''\n }${\n errorOutput\n ? `~n${addNewLines(` ${log.errorText(errorOutput)}`, '~n')}`\n : ''\n }${\n diffOutput\n ? `~n${addNewLines(\n ` ${log.infoText(`diff: ${highlightDiffText(diffOutput)}`)}`,\n '~n'\n )}`\n : ''\n }`;\n };\n\n const outputChildren = (\n node: Partial<Node | MigrateNodesTree> | undefined,\n depth = 2\n ) => {\n let str = '';\n for (const child of ((node as any)?.children || []) as Node[]) {\n str += `${outputNode(child, Array(depth + 1).join(' '))}\\n`;\n if ('children' in child) str += outputChildren(child, depth + 1);\n }\n return str;\n };\n\n const children = outputChildren(root);\n log.limits(\n `${outputNode(root || {}, ' ', true)}${children ? `\\n${children}` : ''}`,\n logLimit\n );\n};\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,mBAAkB;AAClB,mBAAoC;AACpC,oBAAoC;AAcpC,MAAM,aAAa,CAAC,MAAqB,SAAS,2BAChD,aAAAA,SAAM,IAAI,EAAE,OAAO,MAAM;AAEpB,MAAM,oBAAoB,CAC/B,EAAE,KAAK,SAAS,GAChB,OACA,eAAe;AAAA,EACb,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,iBAAiB;AAAA,EACjB,WAAW;AACb,MACG;AA7BL;AA8BE,UAAQ;AAAA,IACN,KAAK,IAAI,aAAa,IAAI,MAAM,QAAQ,SAAS,EAAE,CAAC,IAAI,MAAM,EAAE;AAAA,EAClE;AACA,UAAQ;AAAA,IACN,cAAc,SAAS,OAAO;AAAA,MAC5B,MAAM,OAAO,SAAS,WAAW,MAAM,OAAO,QAAQ;AAAA,IACxD,CAAC;AAAA,EACH;AACA,UAAQ;AAAA,IACN,iBAAiB,IAAI;AAAA,MACnB,MAAM,QAAQ,WACV,IAAI,WAAW,MAAM,QAAQ,QAAQ,CAAC,KAAK,MAAM,QAAQ,UAAU,KACnE;AAAA,IACN,CAAC;AAAA,EACH;AACA,MAAI,MAAM,QAAQ;AAChB,YAAQ;AAAA,MACN,aAAa,IAAI;AAAA,QACf,IAAI,WAAW,MAAM,QAAQ,QAAQ,CAAC,KAAK,MAAM,QAAQ,UAAU;AA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KAAK,EAAE,IAAI,IAAI,SAAS,MAAM,KAAK,UAAU,EAAE,CAAC,EACzD,KACA,EACN,IACG,cACE,iBAAiB,KAAK,aAAa,KAAK,qBAC3C,KAAK,WACD,OAAO,IAAI;AAAA,MACT,aACE,EAAE,sBAAsB,SACxB,KAAK,aAAa,KAAK,mBACnB,KAAK,WACL,GAAG,KAAK,QAAQ,OAAO,KAAK,gBAAgB,EAClD;AAAA,IACF,CAAC,KACD,EACN,GACE,gBAAc,UAAK,UAAL,mBAAY,IAAI,MAC1B,OAAO,IAAI,SAAS,YAAY,KAAK,MAAM,IAAI,EAAE,EAAE,CAAC,KACpD,EACN,GACE,cACI,SAAK,2BAAY,KAAK,IAAI,UAAU,WAAW,CAAC,IAAI,IAAI,CAAC,KACzD,EACN,GACE,aACI,SAAK;AAAA,MACH,KAAK,IAAI,SAAS,SAAS,kBAAkB,UAAU,CAAC,EAAE,CAAC;AAAA,MAC3D;AAAA,IACF,CAAC,KACD,EACN;AAAA,EACF;AAEA,QAAM,iBAAiB,CACrB,MACA,QAAQ,MACL;AACH,QAAI,MAAM;AACV,eAAW,UAAW,6BAAc,aAAY,CAAC,GAAc;AAC7D,aAAO,GAAG,WAAW,OAAO,MAAM,QAAQ,CAAC,EAAE,KAAK,IAAI,CAAC,CAAC;AAAA;AACxD,UAAI,cAAc,MAAO,QAAO,eAAe,OAAO,QAAQ,CAAC;AAAA,IACjE;AACA,WAAO;AAAA,EACT;AAEA,QAAM,WAAW,eAAe,IAAI;AACpC,MAAI;AAAA,IACF,GAAG,WAAW,QAAQ,CAAC,GAAG,KAAK,IAAI,CAAC,GAAG,WAAW;AAAA,EAAK,QAAQ,KAAK,EAAE;AAAA,IACtE;AAAA,EACF;AACF;",
|
|
4
|
+
"sourcesContent": ["import { Node } from 'contensis-delivery-api/lib/models';\nimport dayjs from 'dayjs';\nimport { deconstructApiError } from './error';\nimport { Logger, addNewLines } from './logger';\nimport {\n BlockVersion,\n CopyFieldResult,\n EntriesMigrationResult,\n EntriesResult,\n MigrateModelsResult,\n MigrateNodesTree,\n MigrateStatus,\n NodesResult,\n ProjectNodesToMigrate,\n} from 'migratortron';\nimport ContensisCli from '~/services/ContensisCliService';\n\nconst formatDate = (date: Date | string, format = 'DD/MM/YYYY HH:mm') =>\n dayjs(date).format(format);\n\nexport const printBlockVersion = (\n { log, messages }: ContensisCli,\n block: BlockVersion,\n printOptions = {\n showSource: true,\n showStatus: true,\n showStaticPaths: true,\n showImage: true,\n }\n) => {\n console.log(\n ` ${log.standardText(`v${block.version.versionNo}`)} ${block.id}`\n );\n console.log(\n ` state: ${messages.blocks.runningStatus(\n block.status.broken ? 'broken' : block.status.running.global\n )}`\n );\n console.log(\n ` released: ${log.infoText(\n block.version.released\n ? `[${formatDate(block.version.released)}] ${block.version.releasedBy}`\n : 'no'\n )}`\n );\n if (block.version.madeLive)\n console.log(\n ` live: ${log.infoText(\n `[${formatDate(block.version.madeLive)}] ${block.version.madeLiveBy}`\n )}`\n );\n if (printOptions.showStatus) {\n console.log(` status:`);\n console.log(` deployment: ${log.infoText(block.status.deployment)}`);\n console.log(` workflow: ${log.infoText(block.status.workflow)}`);\n console.log(\n ` running status: ${messages.blocks.runningStatus(\n block.status.running.global\n )}`\n );\n console.log(` datacentres:`);\n console.log(\n ` hq: ${messages.blocks.runningStatus(\n block.status.running.dataCenters.hq\n )}`\n );\n console.log(\n ` london: ${messages.blocks.runningStatus(\n block.status.running.dataCenters.london\n )}`\n );\n console.log(\n ` manchester: ${messages.blocks.runningStatus(\n block.status.running.dataCenters.manchester\n )}`\n );\n }\n if (printOptions.showSource) {\n console.log(` source:`);\n console.log(` commit: ${log.helpText(block.source.commit.id)}`);\n console.log(\n ` message: ${log.infoText(\n block.source.commit.message\n ?.replaceAll('\\n', '\\\\n')\n .replaceAll('\\\\n\\\\n', '\\\\n')\n .replaceAll('\\\\n', '; ')\n )}`\n );\n console.log(\n ` committed: ${log.infoText(\n `[${formatDate(block.source.commit.dateTime)}] ${\n block.source.commit.authorEmail\n }`\n )}`\n );\n console.log(\n ` pushed: ${log.infoText(\n `[${formatDate(block.version.pushed)}] ${block.version.pushedBy}`\n )}`\n );\n console.log(` ${log.infoText(block.source.commit.commitUrl)}`);\n }\n if (printOptions.showImage) {\n console.log(` image:`);\n console.log(` uri: ${log.infoText(block.image.uri)}`);\n console.log(` tag: ${log.helpText(block.image.tag)}`);\n }\n if (printOptions.showStaticPaths) {\n if (block.staticPaths?.length) {\n console.log(` static paths:`);\n for (const path of block.staticPaths) console.log(` - ${path}`);\n }\n }\n if (block.stagingUrl)\n console.log(` staging url: ${log.infoText(block.stagingUrl)}`);\n console.log('');\n};\n\nexport const printEntriesMigrateResult = (\n service: ContensisCli,\n migrateResult: EntriesMigrationResult | EntriesResult | CopyFieldResult,\n {\n action = 'import',\n showDiff = false,\n showAll = false,\n showChanged = false,\n }: {\n action?: 'import' | 'update' | 'delete';\n showDiff?: boolean;\n showAll?: boolean;\n showChanged?: boolean;\n } = {}\n) => {\n console.log(``);\n const { log, messages, currentProject } = service;\n for (const [contentTypeId, entryRes] of Object.entries(\n migrateResult.entriesToMigrate.entryIds\n ) as [string, any]) {\n for (const [originalId, entryStatus] of Object.entries(entryRes) as [\n string,\n any,\n ][]) {\n if (\n showAll ||\n (showChanged &&\n (\n Object.entries(\n Object.entries(entryStatus[currentProject])[0]\n )[1][1] as any\n ).status !== 'no change')\n ) {\n console.log(\n log.infoText(\n `${Object.entries(entryStatus || {})\n .filter(x => x[0] !== 'entryTitle')\n .map(([projectId, projectStatus]) => {\n const [targetGuid, { status }] = (Object.entries(\n projectStatus || {}\n )?.[0] as [string, { status: MigrateStatus }]) || [\n '',\n { x: { status: undefined } },\n ];\n return `${messages.migrate.status(status)(\n `${status}`\n )} ${originalId}${\n targetGuid !== originalId ? ` -> ${targetGuid}\\n ` : ' '\n }`;\n })}`\n ) + `${log.helpText(contentTypeId)} ${entryStatus.entryTitle}`\n );\n\n for (const [projectId, projectStatus] of Object.entries(\n entryStatus\n ).filter(([key]) => key !== 'entryTitle') as [string, any][]) {\n const [targetGuid, { error, diff, status }] = Object.entries(\n projectStatus\n )[0] as [string, any];\n if (error) log.error(error);\n if (diff && showDiff) {\n console.log(\n ` ${log.infoText(`diff: ${highlightDiffText(diff)}`)}\\n`\n );\n }\n }\n }\n }\n }\n if (showAll || showChanged) console.log(``);\n\n for (const [projectId, contentTypeCounts] of Object.entries(\n migrateResult.entries || {}\n ) as [string, any][]) {\n log.help(\n action === 'update'\n ? `update entries in project ${log.boldText(\n log.warningText(currentProject)\n )}`\n : `${action} from project ${\n action === 'delete'\n ? log.warningText(currentProject)\n : `${log.highlightText(projectId)} to ${log.boldText(\n log.warningText(currentProject)\n )}`\n }`\n );\n for (const [contentTypeId, count] of Object.entries(contentTypeCounts) as [\n string,\n number,\n ][]) {\n const isTotalCountRow = contentTypeId === 'totalCount';\n const migrateStatusAndCount =\n migrateResult.entriesToMigrate[currentProject][contentTypeId];\n const existingCount =\n migrateResult.existing?.[currentProject]?.[contentTypeId] || 0;\n const existingPercent = ((existingCount / count) * 100).toFixed(0);\n const noChangeOrTotalEntriesCount =\n typeof migrateStatusAndCount !== 'number'\n ? migrateStatusAndCount?.['no change'] || 0\n : migrateStatusAndCount;\n\n const changedPercentage = (\n (noChangeOrTotalEntriesCount / count) *\n 100\n ).toFixed(0);\n\n const existingColor =\n existingPercent === '0' || action === 'delete'\n ? log.warningText\n : log.infoText;\n\n const changedColor = isTotalCountRow\n ? log.helpText\n : changedPercentage === '100'\n ? log.successText\n : log.warningText;\n\n if (isTotalCountRow && 'nodes' in migrateResult) {\n printNodesMigrateResult(service, migrateResult, {\n showAll,\n showDiff,\n showChanged,\n isEntriesMigration: true,\n });\n }\n console.log(\n ` - ${\n isTotalCountRow\n ? log.highlightText(\n `${contentTypeId}: ${noChangeOrTotalEntriesCount}`\n )\n : `${contentTypeId}: ${log.helpText(count)}`\n }${\n changedPercentage === '100' || isTotalCountRow\n ? ''\n : existingColor(` [existing: ${`${existingPercent}%`}]`)\n }${\n existingPercent === '0' || (action === 'import' && isTotalCountRow)\n ? ''\n : changedColor(\n ` ${\n isTotalCountRow\n ? `[to ${action}: ${noChangeOrTotalEntriesCount}]`\n : changedPercentage === '100'\n ? 'up to date'\n : `[needs update: ${100 - Number(changedPercentage)}%]`\n }`\n )\n }`\n );\n }\n }\n if (migrateResult.errors?.length) {\n console.log(\n ` - ${log.errorText(`errors: ${migrateResult.errors.length}`)}\\n`\n );\n for (const error of migrateResult.errors)\n log.error(error.message, null, '');\n }\n};\n\nexport const printNodesMigrateResult = (\n { log, currentProject }: ContensisCli,\n migrateResult: EntriesMigrationResult | NodesResult,\n {\n action = 'import',\n logLimit = 50,\n showDiff = false,\n showAll = false,\n showChanged = false,\n isEntriesMigration = false,\n }: {\n action?: 'import' | 'delete';\n logLimit?: number;\n showDiff?: boolean;\n showAll?: boolean;\n showChanged?: boolean;\n isEntriesMigration?: boolean;\n } = {}\n) => {\n if (!isEntriesMigration) log.raw(``);\n for (const [projectId, counts] of Object.entries(migrateResult.nodes || {})) {\n const importTitle =\n action === 'delete'\n ? `Delete from project ${log.warningText(currentProject)}`\n : `Import ${\n projectId && projectId !== 'null'\n ? `from project ${log.highlightText(projectId)} `\n : ''\n }to ${log.boldText(log.warningText(currentProject))}`;\n if (!isEntriesMigration) log.help(importTitle);\n\n const migrateStatusAndCount = migrateResult.nodesToMigrate[\n currentProject\n ] as ProjectNodesToMigrate;\n\n const existingCount = migrateResult.nodes?.[projectId]?.totalCount || 0;\n\n const totalCount = Object.keys(migrateResult.nodesToMigrate.nodeIds).length;\n const existingPercent = counts.totalCount\n ? ((existingCount / totalCount) * 100).toFixed(0)\n : '0';\n\n const noChangeCount = migrateStatusAndCount?.['no change'] || 0;\n\n const changedPercentage = counts.totalCount\n ? ((noChangeCount / totalCount) * 100).toFixed(0)\n : '0';\n\n const existingColor =\n existingPercent === '0' || action === 'delete'\n ? log.warningText\n : log.infoText;\n\n const changedColor =\n changedPercentage === '100' ? log.successText : log.warningText;\n\n if (!isEntriesMigration || migrateStatusAndCount.totalCount > 0)\n console.log(\n ` - ${log.highlightText(\n `${isEntriesMigration ? ' + nodes' : 'totalCount'}: ${\n migrateStatusAndCount.totalCount\n }`\n )}${\n changedPercentage === '100'\n ? ''\n : existingColor(` [existing: ${`${existingPercent}%`}]`)\n }${\n existingPercent === '0'\n ? ''\n : changedColor(\n ` ${\n changedPercentage === '100'\n ? 'up to date'\n : `[needs update: ${100 - Number(changedPercentage)}%]`\n }`\n )\n }`\n );\n }\n if (migrateResult.errors?.length) {\n console.log(\n ` - ${log.errorText(`errors: ${migrateResult.errors.length}`)}\\n`\n );\n\n log.limits(\n migrateResult.errors\n .map(error => {\n return log.errorText(deconstructApiError(error));\n })\n .join('\\n'),\n logLimit\n );\n }\n};\n\nconst highlightDiffText = (str: string) => {\n const addedRegex = new RegExp(/<<\\+>>(.*?)<<\\/\\+>>/, 'g');\n const removedRegex = new RegExp(/<<->>(.*?)<<\\/->>/, 'g');\n return str\n .replace(addedRegex, match => {\n return Logger.successText(\n match.replace(/<<\\+>>/g, '<+>').replace(/<<\\/\\+>>/g, '</+>')\n );\n })\n .replace(removedRegex, match => {\n return Logger.errorText(\n match.replace(/<<->>/g, '<->').replace(/<<\\/->>/g, '</->')\n );\n });\n};\n\nexport const printModelMigrationAnalysis = (\n { log, messages }: ContensisCli,\n result: any = {}\n) => {\n for (const [contentTypeId, model] of Object.entries(result) as [\n string,\n any,\n ][]) {\n let mainOutput = log.standardText(\n ` - ${contentTypeId}${\n model.contentTypeId ? ` ${log.helpText(model.contentTypeId)}` : ''\n }`\n );\n let extraOutput = '';\n let errorOutput = '';\n let diffOutput = '';\n for (const [key, details] of Object.entries(model) as [string, any][]) {\n if (key === 'dependencies') {\n extraOutput += log.infoText(\n ` references: [${details?.join(', ')}]\\n`\n );\n }\n if (key === 'dependencyOf') {\n extraOutput += log.infoText(\n ` required by: [${details?.join(', ')}]\\n`\n );\n }\n if (key === 'projects') {\n for (const [projectId, projectDetails] of Object.entries(details) as [\n string,\n any,\n ][]) {\n mainOutput += log.infoText(\n ` [${messages.migrate.status(projectDetails.status)(\n `${projectId}: ${projectDetails.status}`\n )}]${\n projectDetails.versionNo ? ` v${projectDetails.versionNo}` : ''\n }`\n );\n if (projectDetails.diff)\n diffOutput += ` ${log.highlightText(`diff:`)} ${log.infoText(\n highlightDiffText(projectDetails.diff)\n )}`;\n if (projectDetails.error)\n errorOutput += ` ${log.highlightText(\n `error::`\n )} ${log.errorText(projectDetails.error)}`;\n }\n }\n }\n console.log(mainOutput);\n if (extraOutput) {\n const search = '\\n';\n const replace = '';\n console.log(\n extraOutput.replace(\n new RegExp(search + '([^' + search + ']*)$'),\n replace + '$1'\n )\n );\n }\n if (diffOutput) console.log(diffOutput);\n if (errorOutput) console.log(errorOutput);\n }\n};\n\ntype MigrateResultSummary = MigrateModelsResult['']['contentTypes'];\ntype MigrateResultStatus = keyof MigrateResultSummary;\n\nexport const printModelMigrationResult = (\n { log, messages }: ContensisCli,\n result: MigrateResultSummary\n) => {\n for (const [status, ids] of Object.entries(result) as [\n MigrateResultStatus,\n string[],\n ][]) {\n if (ids?.length) {\n if (status === 'errors') {\n const errors: [string, MappedError][] = ids as any;\n log.raw(\n ` - ${status}: [ ${messages.migrate.models.result(status)(\n ids.map(id => id[0]).join(', ')\n )} ]\\n`\n );\n for (const [contentTypeId, error] of errors)\n log.error(\n `${log.highlightText(contentTypeId)}: ${error.message}`,\n error\n );\n } else\n log.raw(\n ` - ${status}: [ ${messages.migrate.models.result(status)(\n ids.join(', ')\n )} ]`\n );\n }\n }\n};\n\nexport const printNodeTreeOutput = (\n { log, messages }: ContensisCli,\n root: Node | Partial<MigrateNodesTree> | undefined,\n logDetail = 'errors',\n logLimit = 1000\n) => {\n log.raw('');\n const statusColour = messages.migrate.status;\n\n if (root && 'status' in root)\n log.info(\n `Migrate status: ${statusColour('no change')(\n 'N'\n )} [no change]; ${statusColour('create')('C')} [create]; ${statusColour(\n 'update'\n )('U')} [update]; ${statusColour('delete')('D')} [delete]; ${statusColour(\n 'error'\n )('E')} [error];`\n );\n log.info(\n `Node properties: ${log.highlightText(\n 'e'\n )} = has entry; ${log.highlightText('c')} = canonical; ${log.highlightText(\n 'm'\n )} = include in menu`\n );\n\n log.line();\n\n const outputNode = (\n node: Partial<Node | MigrateNodesTree>,\n spaces: string,\n isRoot = false\n ) => {\n const errorOutput =\n 'error' in node && node.error && deconstructApiError(node.error);\n const fullOutput = logDetail === 'all';\n const changesOutput =\n logDetail === 'changes' &&\n 'status' in node &&\n node.status &&\n ['create', 'update'].includes(node.status);\n\n const diffOutput =\n (fullOutput || changesOutput || errorOutput) &&\n 'diff' in node &&\n node.diff?.replaceAll('\\n', '');\n\n return `${\n 'status' in node && node.status\n ? `${statusColour(node.status)(\n node.status.substring(0, 1).toUpperCase()\n )} `\n : ''\n }${node.entry ? log.highlightText('e') : log.infoText('-')}${\n 'isCanonical' in node && node.isCanonical\n ? log.highlightText('c')\n : log.infoText('-')\n }${\n node.includeInMenu ? log.highlightText('m') : log.infoText('-')\n }${spaces}${log[\n 'status' in node && node.status === 'no change'\n ? 'infoText'\n : 'standardText'\n ](\n 'isCanonical' in node && node.isCanonical\n ? log.boldText(\n fullOutput || isRoot || !node.slug ? node.path : `/${node.slug}`\n )\n : fullOutput || isRoot || !node.slug\n ? node.path\n : `/${node.slug}`\n )}${node.entry ? ` ${log.helpText(node.entry.sys.contentTypeId)}` : ''}${\n node.childCount ? ` +${node.childCount}` : ``\n } ${'displayName' in node ? log.infoText(node.displayName) : ''}${\n fullOutput || (changesOutput && node.id !== node.originalId)\n ? `~n ${log.infoText(`id:`)} ${\n !('originalId' in node) || node.id === node.originalId\n ? node.id\n : `${node.id} ${log.infoText(`<= ${node.originalId}`)}`\n }`\n : ''\n }${\n (fullOutput ||\n (changesOutput && node.parentId !== node.originalParentId)) &&\n node.parentId\n ? `~n ${log.infoText(\n `parentId: ${\n !('originalParentId' in node) ||\n node.parentId === node.originalParentId\n ? node.parentId\n : `${node.parentId} <= ${node.originalParentId}`\n }`\n )}`\n : ''\n }${\n fullOutput && node.entry?.sys.id\n ? `~n ${log.infoText(`entryId: ${node.entry.sys.id}`)}`\n : ''\n }${\n errorOutput\n ? `~n${addNewLines(` ${log.errorText(errorOutput)}`, '~n')}`\n : ''\n }${\n diffOutput\n ? `~n${addNewLines(\n ` ${log.infoText(`diff: ${highlightDiffText(diffOutput)}`)}`,\n '~n'\n )}`\n : ''\n }`;\n };\n\n const outputChildren = (\n node: Partial<Node | MigrateNodesTree> | undefined,\n depth = 2\n ) => {\n let str = '';\n for (const child of ((node as any)?.children || []) as Node[]) {\n str += `${outputNode(child, Array(depth + 1).join(' '))}\\n`;\n if ('children' in child) str += outputChildren(child, depth + 1);\n }\n return str;\n };\n\n const children = outputChildren(root);\n log.limits(\n `${outputNode(root || {}, ' ', true)}${children ? `\\n${children}` : ''}`,\n logLimit\n );\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,mBAAkB;AAClB,mBAAoC;AACpC,oBAAoC;AAcpC,MAAM,aAAa,CAAC,MAAqB,SAAS,2BAChD,aAAAA,SAAM,IAAI,EAAE,OAAO,MAAM;AAEpB,MAAM,oBAAoB,CAC/B,EAAE,KAAK,SAAS,GAChB,OACA,eAAe;AAAA,EACb,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,iBAAiB;AAAA,EACjB,WAAW;AACb,MACG;AA7BL;AA8BE,UAAQ;AAAA,IACN,KAAK,IAAI,aAAa,IAAI,MAAM,QAAQ,SAAS,EAAE,CAAC,IAAI,MAAM,EAAE;AAAA,EAClE;AACA,UAAQ;AAAA,IACN,cAAc,SAAS,OAAO;AAAA,MAC5B,MAAM,OAAO,SAAS,WAAW,MAAM,OAAO,QAAQ;AAAA,IACxD,CAAC;AAAA,EACH;AACA,UAAQ;AAAA,IACN,iBAAi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A,WAAO;AAAA,EACT;AAEA,QAAM,WAAW,eAAe,IAAI;AACpC,MAAI;AAAA,IACF,GAAG,WAAW,QAAQ,CAAC,GAAG,KAAK,IAAI,CAAC,GAAG,WAAW;AAAA,EAAK,QAAQ,KAAK,EAAE;AAAA,IACtE;AAAA,EACF;AACF;",
|
|
6
6
|
"names": ["dayjs", "_a"]
|
|
7
7
|
}
|
package/dist/version.js
CHANGED
|
@@ -21,7 +21,7 @@ __export(version_exports, {
|
|
|
21
21
|
LIB_VERSION: () => LIB_VERSION
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(version_exports);
|
|
24
|
-
const LIB_VERSION = "1.3.1-beta.
|
|
24
|
+
const LIB_VERSION = "1.3.1-beta.9";
|
|
25
25
|
// Annotate the CommonJS export names for ESM import in node:
|
|
26
26
|
0 && (module.exports = {
|
|
27
27
|
LIB_VERSION
|
package/dist/version.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/version.ts"],
|
|
4
|
-
"sourcesContent": ["export const LIB_VERSION = \"1.3.1-beta.
|
|
4
|
+
"sourcesContent": ["export const LIB_VERSION = \"1.3.1-beta.9\";\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,MAAM,cAAc;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "contensis-cli",
|
|
3
|
-
"version": "1.3.1-beta.
|
|
3
|
+
"version": "1.3.1-beta.9",
|
|
4
4
|
"description": "A fully featured Contensis command line interface with a shell UI provides simple and intuitive ways to manage or profile your content in any NodeJS terminal.",
|
|
5
5
|
"repository": "https://github.com/contensis/cli",
|
|
6
6
|
"homepage": "https://github.com/contensis/cli/tree/main/packages/contensis-cli#readme",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"inquirer-command-prompt": "^0.1.0",
|
|
40
40
|
"keytar": "^7.9.0",
|
|
41
41
|
"lodash": "^4.17.21",
|
|
42
|
-
"migratortron": "^1.0.0-beta.
|
|
42
|
+
"migratortron": "^1.0.0-beta.71",
|
|
43
43
|
"nanospinner": "^1.2.0",
|
|
44
44
|
"node-fetch": "^2.6.7",
|
|
45
45
|
"parse-git-config": "^3.0.0",
|
|
@@ -115,8 +115,8 @@ export const LogMessages = {
|
|
|
115
115
|
`[${env}] Unable to update project ${Logger.highlightText(id)}`,
|
|
116
116
|
},
|
|
117
117
|
migrate: {
|
|
118
|
-
preview: () => `🔍
|
|
119
|
-
commit: () => `COMMITTING
|
|
118
|
+
preview: (verb = 'IMPORT') => `🔍 ${verb} PREVIEW 🔭`,
|
|
119
|
+
commit: (verb = 'IMPORT') => `COMMITTING ${verb} ✨☄️ `,
|
|
120
120
|
models: {
|
|
121
121
|
result: (
|
|
122
122
|
status: keyof MigrateModelsResult['project']['contentTypes']
|
|
@@ -226,6 +226,15 @@ export const LogMessages = {
|
|
|
226
226
|
nodes > 0 ? ` and ${pl('node', nodes, true)}` : ''
|
|
227
227
|
} into ${env} environment`,
|
|
228
228
|
failedImport: (env: string) => `[${env}] Unable to import entries`,
|
|
229
|
+
update: {
|
|
230
|
+
preview: () => LogMessages.migrate.preview('UPDATE FIELD'),
|
|
231
|
+
commit: () => LogMessages.migrate.preview('FIELD UPDATES'),
|
|
232
|
+
success: (env: string, commit: boolean, entries: number, nodes = 0) =>
|
|
233
|
+
`${commit ? `Updated` : `Will update`} ${pl('entry', entries, true)}${
|
|
234
|
+
nodes > 0 ? ` and ${pl('node', nodes, true)}` : ''
|
|
235
|
+
} in ${env} environment`,
|
|
236
|
+
failed: (env: string) => `[${env}] Unable to update any entries`,
|
|
237
|
+
},
|
|
229
238
|
removed: (env: string, commit: boolean) =>
|
|
230
239
|
`[${env}] ${commit ? `Deleted` : `Will delete`} entries`,
|
|
231
240
|
failedRemove: (env: string) => `[${env}] Unable to delete entries`,
|
|
@@ -627,7 +627,7 @@ class ContensisCli {
|
|
|
627
627
|
if (contensis) {
|
|
628
628
|
// Retrieve token for env
|
|
629
629
|
const [error, token] = await to(
|
|
630
|
-
contensis.content.
|
|
630
|
+
contensis.content.source.repo.BearerToken()
|
|
631
631
|
);
|
|
632
632
|
if (token) {
|
|
633
633
|
// Print bearer token to console
|
|
@@ -1079,7 +1079,7 @@ class ContensisCli {
|
|
|
1079
1079
|
if (contensis) {
|
|
1080
1080
|
// Retrieve workflows list for env
|
|
1081
1081
|
const [workflowsErr, workflows] =
|
|
1082
|
-
await contensis.content.
|
|
1082
|
+
await contensis.content.source.workflows.GetWorkflows();
|
|
1083
1083
|
|
|
1084
1084
|
if (Array.isArray(workflows)) {
|
|
1085
1085
|
log.success(messages.workflows.list(currentEnv));
|
|
@@ -1145,7 +1145,7 @@ class ContensisCli {
|
|
|
1145
1145
|
if (contensis) {
|
|
1146
1146
|
// Retrieve workflows list for env
|
|
1147
1147
|
const [workflowsErr, workflows] =
|
|
1148
|
-
await contensis.content.
|
|
1148
|
+
await contensis.content.source.workflows.GetWorkflows();
|
|
1149
1149
|
|
|
1150
1150
|
if (Array.isArray(workflows)) {
|
|
1151
1151
|
log.success(messages.workflows.list(currentEnv));
|
|
@@ -1564,7 +1564,7 @@ class ContensisCli {
|
|
|
1564
1564
|
contentType.projectId = currentProject;
|
|
1565
1565
|
delete contentType.uuid;
|
|
1566
1566
|
|
|
1567
|
-
const [err, , createStatus] = await contensis.models.
|
|
1567
|
+
const [err, , createStatus] = await contensis.models.targets[
|
|
1568
1568
|
currentProject
|
|
1569
1569
|
].repo.UpsertContentType(false, contentType);
|
|
1570
1570
|
|
|
@@ -1755,7 +1755,7 @@ class ContensisCli {
|
|
|
1755
1755
|
component.projectId = currentProject;
|
|
1756
1756
|
delete component.uuid;
|
|
1757
1757
|
|
|
1758
|
-
const [err, , createStatus] = await contensis.models.
|
|
1758
|
+
const [err, , createStatus] = await contensis.models.targets[
|
|
1759
1759
|
currentProject
|
|
1760
1760
|
].repo.UpsertComponent(false, component);
|
|
1761
1761
|
|
|
@@ -2066,9 +2066,9 @@ class ContensisCli {
|
|
|
2066
2066
|
if (contensis) {
|
|
2067
2067
|
log.line();
|
|
2068
2068
|
if (contensis.isPreview) {
|
|
2069
|
-
log.success(messages.
|
|
2069
|
+
log.success(messages.entries.update.preview());
|
|
2070
2070
|
} else {
|
|
2071
|
-
log.warning(messages.
|
|
2071
|
+
log.warning(messages.entries.update.commit());
|
|
2072
2072
|
}
|
|
2073
2073
|
|
|
2074
2074
|
const [err, result] = await to(
|
|
@@ -2085,6 +2085,7 @@ class ContensisCli {
|
|
|
2085
2085
|
await this.HandleFormattingAndOutput(output, () => {
|
|
2086
2086
|
// print the migrateResult to console
|
|
2087
2087
|
printEntriesMigrateResult(this, result, {
|
|
2088
|
+
action: 'update',
|
|
2088
2089
|
showAll: logOutput === 'all',
|
|
2089
2090
|
showDiff: logOutput === 'all' || logOutput === 'changes',
|
|
2090
2091
|
showChanged: logOutput === 'changes',
|
|
@@ -2101,7 +2102,7 @@ class ContensisCli {
|
|
|
2101
2102
|
(result.migrateResult?.created || result.migrateResult?.updated)))
|
|
2102
2103
|
) {
|
|
2103
2104
|
log.success(
|
|
2104
|
-
messages.entries.
|
|
2105
|
+
messages.entries.update.success(
|
|
2105
2106
|
currentEnv,
|
|
2106
2107
|
commit,
|
|
2107
2108
|
commit
|
|
@@ -2115,7 +2116,7 @@ class ContensisCli {
|
|
|
2115
2116
|
log.help(messages.entries.commitTip());
|
|
2116
2117
|
}
|
|
2117
2118
|
} else {
|
|
2118
|
-
log.error(messages.entries.
|
|
2119
|
+
log.error(messages.entries.update.failed(currentEnv), err);
|
|
2119
2120
|
if (!result?.entriesToMigrate?.[currentProject]?.totalCount)
|
|
2120
2121
|
log.help(messages.entries.notFound(currentEnv));
|
|
2121
2122
|
}
|
|
@@ -2135,7 +2136,7 @@ class ContensisCli {
|
|
|
2135
2136
|
log.error(messages.nodes.failedGet(currentProject), err);
|
|
2136
2137
|
return;
|
|
2137
2138
|
}
|
|
2138
|
-
const root = contensis.nodes.
|
|
2139
|
+
const root = contensis.nodes.source.nodes.tree;
|
|
2139
2140
|
|
|
2140
2141
|
log.success(messages.nodes.get(currentProject, rootPath, depth));
|
|
2141
2142
|
|
|
@@ -2184,8 +2185,7 @@ class ContensisCli {
|
|
|
2184
2185
|
await this.HandleFormattingAndOutput(result, () => {
|
|
2185
2186
|
// print the migrateResult to console
|
|
2186
2187
|
const migrateTree =
|
|
2187
|
-
contensis.nodes.
|
|
2188
|
-
.migrateNodesTreeView;
|
|
2188
|
+
contensis.nodes.targets[currentProject].nodes.migrateNodesTreeView;
|
|
2189
2189
|
printNodeTreeOutput(this, migrateTree, logOutput, logLimit);
|
|
2190
2190
|
printNodesMigrateResult(this, result, {
|
|
2191
2191
|
showAll: logOutput === 'all',
|
|
@@ -2257,8 +2257,7 @@ class ContensisCli {
|
|
|
2257
2257
|
// print the migrateResult to console
|
|
2258
2258
|
printNodeTreeOutput(
|
|
2259
2259
|
this,
|
|
2260
|
-
contensis.nodes.
|
|
2261
|
-
.migrateNodesTreeView
|
|
2260
|
+
contensis.nodes.targets[currentProject].nodes.migrateNodesTreeView
|
|
2262
2261
|
);
|
|
2263
2262
|
// printNodesMigrateResult(this, result, {
|
|
2264
2263
|
// action: 'delete',
|
|
@@ -125,7 +125,7 @@ export const printEntriesMigrateResult = (
|
|
|
125
125
|
showAll = false,
|
|
126
126
|
showChanged = false,
|
|
127
127
|
}: {
|
|
128
|
-
action?: 'import' | 'delete';
|
|
128
|
+
action?: 'import' | 'update' | 'delete';
|
|
129
129
|
showDiff?: boolean;
|
|
130
130
|
showAll?: boolean;
|
|
131
131
|
showChanged?: boolean;
|
|
@@ -138,7 +138,7 @@ export const printEntriesMigrateResult = (
|
|
|
138
138
|
) as [string, any]) {
|
|
139
139
|
for (const [originalId, entryStatus] of Object.entries(entryRes) as [
|
|
140
140
|
string,
|
|
141
|
-
any
|
|
141
|
+
any,
|
|
142
142
|
][]) {
|
|
143
143
|
if (
|
|
144
144
|
showAll ||
|
|
@@ -191,17 +191,21 @@ export const printEntriesMigrateResult = (
|
|
|
191
191
|
migrateResult.entries || {}
|
|
192
192
|
) as [string, any][]) {
|
|
193
193
|
log.help(
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
194
|
+
action === 'update'
|
|
195
|
+
? `update entries in project ${log.boldText(
|
|
196
|
+
log.warningText(currentProject)
|
|
197
|
+
)}`
|
|
198
|
+
: `${action} from project ${
|
|
199
|
+
action === 'delete'
|
|
200
|
+
? log.warningText(currentProject)
|
|
201
|
+
: `${log.highlightText(projectId)} to ${log.boldText(
|
|
202
|
+
log.warningText(currentProject)
|
|
203
|
+
)}`
|
|
204
|
+
}`
|
|
201
205
|
);
|
|
202
206
|
for (const [contentTypeId, count] of Object.entries(contentTypeCounts) as [
|
|
203
207
|
string,
|
|
204
|
-
number
|
|
208
|
+
number,
|
|
205
209
|
][]) {
|
|
206
210
|
const isTotalCountRow = contentTypeId === 'totalCount';
|
|
207
211
|
const migrateStatusAndCount =
|
|
@@ -227,8 +231,8 @@ export const printEntriesMigrateResult = (
|
|
|
227
231
|
const changedColor = isTotalCountRow
|
|
228
232
|
? log.helpText
|
|
229
233
|
: changedPercentage === '100'
|
|
230
|
-
|
|
231
|
-
|
|
234
|
+
? log.successText
|
|
235
|
+
: log.warningText;
|
|
232
236
|
|
|
233
237
|
if (isTotalCountRow && 'nodes' in migrateResult) {
|
|
234
238
|
printNodesMigrateResult(service, migrateResult, {
|
|
@@ -257,8 +261,8 @@ export const printEntriesMigrateResult = (
|
|
|
257
261
|
isTotalCountRow
|
|
258
262
|
? `[to ${action}: ${noChangeOrTotalEntriesCount}]`
|
|
259
263
|
: changedPercentage === '100'
|
|
260
|
-
|
|
261
|
-
|
|
264
|
+
? 'up to date'
|
|
265
|
+
: `[needs update: ${100 - Number(changedPercentage)}%]`
|
|
262
266
|
}`
|
|
263
267
|
)
|
|
264
268
|
}`
|
|
@@ -391,7 +395,7 @@ export const printModelMigrationAnalysis = (
|
|
|
391
395
|
) => {
|
|
392
396
|
for (const [contentTypeId, model] of Object.entries(result) as [
|
|
393
397
|
string,
|
|
394
|
-
any
|
|
398
|
+
any,
|
|
395
399
|
][]) {
|
|
396
400
|
let mainOutput = log.standardText(
|
|
397
401
|
` - ${contentTypeId}${
|
|
@@ -415,7 +419,7 @@ export const printModelMigrationAnalysis = (
|
|
|
415
419
|
if (key === 'projects') {
|
|
416
420
|
for (const [projectId, projectDetails] of Object.entries(details) as [
|
|
417
421
|
string,
|
|
418
|
-
any
|
|
422
|
+
any,
|
|
419
423
|
][]) {
|
|
420
424
|
mainOutput += log.infoText(
|
|
421
425
|
` [${messages.migrate.status(projectDetails.status)(
|
|
@@ -460,7 +464,7 @@ export const printModelMigrationResult = (
|
|
|
460
464
|
) => {
|
|
461
465
|
for (const [status, ids] of Object.entries(result) as [
|
|
462
466
|
MigrateResultStatus,
|
|
463
|
-
string[]
|
|
467
|
+
string[],
|
|
464
468
|
][]) {
|
|
465
469
|
if (ids?.length) {
|
|
466
470
|
if (status === 'errors') {
|
|
@@ -555,8 +559,8 @@ export const printNodeTreeOutput = (
|
|
|
555
559
|
fullOutput || isRoot || !node.slug ? node.path : `/${node.slug}`
|
|
556
560
|
)
|
|
557
561
|
: fullOutput || isRoot || !node.slug
|
|
558
|
-
|
|
559
|
-
|
|
562
|
+
? node.path
|
|
563
|
+
: `/${node.slug}`
|
|
560
564
|
)}${node.entry ? ` ${log.helpText(node.entry.sys.contentTypeId)}` : ''}${
|
|
561
565
|
node.childCount ? ` +${node.childCount}` : ``
|
|
562
566
|
} ${'displayName' in node ? log.infoText(node.displayName) : ''}${
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const LIB_VERSION = "1.3.1-beta.
|
|
1
|
+
export const LIB_VERSION = "1.3.1-beta.9";
|