contensis-cli 1.2.2-beta.4 → 1.2.2-beta.6

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.
@@ -124,7 +124,7 @@ const printBlockVersion = ({ log, messages }, block, printOptions = {
124
124
  console.log(` staging url: ${log.infoText(block.stagingUrl)}`);
125
125
  console.log("");
126
126
  };
127
- const printEntriesMigrateResult = ({ log, messages, currentProject }, migrateResult, {
127
+ const printEntriesMigrateResult = (service, migrateResult, {
128
128
  action = "import",
129
129
  showDiff = false,
130
130
  showAll = false,
@@ -132,6 +132,7 @@ const printEntriesMigrateResult = ({ log, messages, currentProject }, migrateRes
132
132
  } = {}) => {
133
133
  var _a, _b, _c;
134
134
  console.log(``);
135
+ const { log, messages, currentProject } = service;
135
136
  for (const [contentTypeId, entryRes] of Object.entries(
136
137
  migrateResult.entriesToMigrate.entryIds
137
138
  )) {
@@ -193,6 +194,14 @@ const printEntriesMigrateResult = ({ log, messages, currentProject }, migrateRes
193
194
  const changedPercentage = (noChangeOrTotalEntriesCount / count * 100).toFixed(0);
194
195
  const existingColor = existingPercent === "0" || action === "delete" ? log.warningText : log.infoText;
195
196
  const changedColor = isTotalCountRow ? log.helpText : changedPercentage === "100" ? log.successText : log.warningText;
197
+ if (isTotalCountRow && "nodes" in migrateResult) {
198
+ printNodesMigrateResult(service, migrateResult, {
199
+ showAll,
200
+ showDiff,
201
+ showChanged,
202
+ isEntriesMigration: true
203
+ });
204
+ }
196
205
  console.log(
197
206
  ` - ${isTotalCountRow ? log.highlightText(
198
207
  `${contentTypeId}: ${noChangeOrTotalEntriesCount}`
@@ -216,28 +225,32 @@ const printNodesMigrateResult = ({ log, currentProject }, migrateResult, {
216
225
  logLimit = 50,
217
226
  showDiff = false,
218
227
  showAll = false,
219
- showChanged = false
228
+ showChanged = false,
229
+ isEntriesMigration = false
220
230
  } = {}) => {
221
231
  var _a, _b, _c;
222
- log.raw(``);
232
+ if (!isEntriesMigration)
233
+ log.raw(``);
223
234
  for (const [projectId, counts] of Object.entries(migrateResult.nodes || {})) {
224
235
  const importTitle = action === "delete" ? `Delete from project ${log.warningText(currentProject)}` : `Import ${projectId && projectId !== "null" ? `from project ${log.highlightText(projectId)} ` : ""}to ${log.boldText(log.warningText(currentProject))}`;
225
- log.help(importTitle);
236
+ if (!isEntriesMigration)
237
+ log.help(importTitle);
226
238
  const migrateStatusAndCount = migrateResult.nodesToMigrate[currentProject];
227
- const existingCount = ((_b = (_a = migrateResult.existing) == null ? void 0 : _a[currentProject]) == null ? void 0 : _b.totalCount) || 0;
239
+ const existingCount = ((_b = (_a = migrateResult.nodes) == null ? void 0 : _a[projectId]) == null ? void 0 : _b.totalCount) || 0;
228
240
  const totalCount = Object.keys(migrateResult.nodesToMigrate.nodeIds).length;
229
241
  const existingPercent = counts.totalCount ? (existingCount / totalCount * 100).toFixed(0) : "0";
230
242
  const noChangeCount = (migrateStatusAndCount == null ? void 0 : migrateStatusAndCount["no change"]) || 0;
231
243
  const changedPercentage = counts.totalCount ? (noChangeCount / totalCount * 100).toFixed(0) : "0";
232
244
  const existingColor = existingPercent === "0" || action === "delete" ? log.warningText : log.infoText;
233
245
  const changedColor = changedPercentage === "100" ? log.successText : log.warningText;
234
- console.log(
235
- ` - ${log.highlightText(
236
- `totalCount: ${migrateStatusAndCount.totalCount}`
237
- )}${changedPercentage === "100" ? "" : existingColor(` [existing: ${`${existingPercent}%`}]`)}${existingPercent === "0" ? "" : changedColor(
238
- ` ${changedPercentage === "100" ? "up to date" : `[needs update: ${100 - Number(changedPercentage)}%]`}`
239
- )}`
240
- );
246
+ if (!isEntriesMigration || migrateStatusAndCount.totalCount > 0)
247
+ console.log(
248
+ ` - ${log.highlightText(
249
+ `${isEntriesMigration ? " + nodes" : "totalCount"}: ${migrateStatusAndCount.totalCount}`
250
+ )}${changedPercentage === "100" ? "" : existingColor(` [existing: ${`${existingPercent}%`}]`)}${existingPercent === "0" ? "" : changedColor(
251
+ ` ${changedPercentage === "100" ? "up to date" : `[needs update: ${100 - Number(changedPercentage)}%]`}`
252
+ )}`
253
+ );
241
254
  }
242
255
  if ((_c = migrateResult.errors) == null ? void 0 : _c.length) {
243
256
  console.log(
@@ -370,14 +383,16 @@ const printNodeTreeOutput = ({ log, messages }, root, logDetail = "errors", logL
370
383
  var _a, _b;
371
384
  const errorOutput = "error" in node && node.error && (0, import_error.deconstructApiError)(node.error);
372
385
  const fullOutput = logDetail === "all";
373
- const changesOutput = logDetail === "changes" && "status" in node && ["create", "update"].includes(node.status);
386
+ const changesOutput = logDetail === "changes" && "status" in node && node.status && ["create", "update"].includes(node.status);
374
387
  const diffOutput = (fullOutput || changesOutput || errorOutput) && "diff" in node && ((_a = node.diff) == null ? void 0 : _a.replaceAll("\n", ""));
375
- return `${"status" in node ? `${statusColour(node.status)(
388
+ return `${"status" in node && node.status ? `${statusColour(node.status)(
376
389
  node.status.substring(0, 1).toUpperCase()
377
390
  )} ` : ""}${node.entry ? log.highlightText("e") : log.infoText("-")}${"isCanonical" in node && node.isCanonical ? log.highlightText("c") : log.infoText("-")}${node.includeInMenu ? log.highlightText("m") : log.infoText("-")}${spaces}${log["status" in node && node.status === "no change" ? "infoText" : "standardText"](
378
- "isCanonical" in node && node.isCanonical ? log.boldText(fullOutput || isRoot ? node.path : `/${node.slug}`) : fullOutput || isRoot ? node.path : `/${node.slug}`
379
- )}${node.entry ? ` ${log.helpText(node.entry.sys.contentTypeId)}` : ""}${node.childCount ? ` +${node.childCount}` : ``} ${"displayName" in node ? log.infoText(node.displayName) : ""}${fullOutput || changesOutput && node.id !== node.originalId ? `~n ${log.infoText(`id:`)} ${node.id === node.originalId ? node.id : `${node.id} ${log.infoText(`<= ${node.originalId}`)}`}` : ""}${(fullOutput || changesOutput && node.parentId !== node.originalParentId) && node.parentId ? `~n ${log.infoText(
380
- `parentId: ${node.parentId === node.originalParentId ? node.parentId : `${node.parentId} <= ${node.originalParentId}`}`
391
+ "isCanonical" in node && node.isCanonical ? log.boldText(
392
+ fullOutput || isRoot || !node.slug ? node.path : `/${node.slug}`
393
+ ) : fullOutput || isRoot || !node.slug ? node.path : `/${node.slug}`
394
+ )}${node.entry ? ` ${log.helpText(node.entry.sys.contentTypeId)}` : ""}${node.childCount ? ` +${node.childCount}` : ``} ${"displayName" in node ? log.infoText(node.displayName) : ""}${fullOutput || changesOutput && node.id !== node.originalId ? `~n ${log.infoText(`id:`)} ${!("originalId" in node) || node.id === node.originalId ? node.id : `${node.id} ${log.infoText(`<= ${node.originalId}`)}`}` : ""}${(fullOutput || changesOutput && node.parentId !== node.originalParentId) && node.parentId ? `~n ${log.infoText(
395
+ `parentId: ${!("originalParentId" in node) || node.parentId === node.originalParentId ? node.parentId : `${node.parentId} <= ${node.originalParentId}`}`
381
396
  )}` : ""}${fullOutput && ((_b = node.entry) == null ? void 0 : _b.sys.id) ? `~n ${log.infoText(`entryId: ${node.entry.sys.id}`)}` : ""}${errorOutput ? `~n${(0, import_logger.addNewLines)(` ${log.errorText(errorOutput)}`, "~n")}` : ""}${diffOutput ? `~n${(0, import_logger.addNewLines)(
382
397
  ` ${log.infoText(`diff: ${highlightDiffText(diffOutput)}`)}`,
383
398
  "~n"
@@ -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 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 { log, messages, currentProject }: ContensisCli,\n migrateResult: 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\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 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: NodesResult,\n {\n action = 'import',\n logLimit = 50,\n showDiff = false,\n showAll = false,\n showChanged = false,\n }: {\n action?: 'import' | 'delete';\n logLimit?: number;\n showDiff?: boolean;\n showAll?: boolean;\n showChanged?: boolean;\n } = {}\n) => {\n 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 log.help(importTitle);\n\n const migrateStatusAndCount = migrateResult.nodesToMigrate[\n currentProject\n ] as ProjectNodesToMigrate;\n\n const existingCount =\n migrateResult.existing?.[currentProject]?.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 console.log(\n ` - ${log.highlightText(\n `totalCount: ${migrateStatusAndCount.totalCount}`\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(` - ${contentTypeId}`);\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 )}] v${projectDetails.versionNo}`\n );\n if (projectDetails.diff)\n diffOutput += ` ${log.highlightText(`diff:`)} ${log.infoText(\n highlightDiffText(projectDetails.diff)\n )}\\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 | 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: 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 ['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\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(fullOutput || isRoot ? node.path : `/${node.slug}`)\n : fullOutput || isRoot\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 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 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 = (node: Node | undefined, depth = 2) => {\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;AAapC,MAAM,aAAa,CAAC,MAAqB,SAAS,2BAChD,aAAAA,SAAM,IAAI,EAAE,OAAO,MAAM;AAEpB,M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iB,CAAC,MAAwB,QAAQ,MAAM;AAC5D,QAAI,MAAM;AACV,eAAW,UAAW,6BAAc,aAAY,CAAC,GAAc;AAC7D,aAAO,GAAG,WAAW,OAAO,MAAM,QAAQ,CAAC,EAAE,KAAK,IAAI,CAAC;AAAA;AACvD,UAAI,cAAc;AAAO,eAAO,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,IAAI,WAAW;AAAA,EAAK,aAAa;AAAA,IACpE;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' | '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(` - ${contentTypeId}`);\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 )}] v${projectDetails.versionNo}`\n );\n if (projectDetails.diff)\n diffOutput += ` ${log.highlightText(`diff:`)} ${log.infoText(\n highlightDiffText(projectDetails.diff)\n )}\\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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T,aACE,EAAE,sBAAsB,SACxB,KAAK,aAAa,KAAK,mBACnB,KAAK,WACL,GAAG,KAAK,eAAe,KAAK;AAAA,IAEpC,MACA,KAEJ,gBAAc,UAAK,UAAL,mBAAY,IAAI,MAC1B,OAAO,IAAI,SAAS,YAAY,KAAK,MAAM,IAAI,IAAI,MACnD,KAEJ,cACI,SAAK,2BAAY,KAAK,IAAI,UAAU,WAAW,KAAK,IAAI,MACxD,KAEJ,aACI,SAAK;AAAA,MACH,KAAK,IAAI,SAAS,SAAS,kBAAkB,UAAU,GAAG;AAAA,MAC1D;AAAA,IACF,MACA;AAAA,EAER;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;AAAA;AACvD,UAAI,cAAc;AAAO,eAAO,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,IAAI,WAAW;AAAA,EAAK,aAAa;AAAA,IACpE;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.2.2-beta.4";
24
+ const LIB_VERSION = "1.2.2-beta.6";
25
25
  // Annotate the CommonJS export names for ESM import in node:
26
26
  0 && (module.exports = {
27
27
  LIB_VERSION
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/version.ts"],
4
- "sourcesContent": ["export const LIB_VERSION = \"1.2.2-beta.4\";\n"],
4
+ "sourcesContent": ["export const LIB_VERSION = \"1.2.2-beta.6\";\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.2.2-beta.4",
3
+ "version": "1.2.2-beta.6",
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",
@@ -40,7 +40,7 @@
40
40
  "jsonpath-mapper": "^1.1.0",
41
41
  "keytar": "^7.9.0",
42
42
  "lodash": "^4.17.21",
43
- "migratortron": "^1.0.0-beta.55",
43
+ "migratortron": "^1.0.0-beta.58",
44
44
  "nanospinner": "^1.1.0",
45
45
  "node-fetch": "^2.6.7",
46
46
  "parse-git-config": "^3.0.0",
@@ -9,7 +9,7 @@ import {
9
9
  latest,
10
10
  mapContensisOpts,
11
11
  noCache,
12
- outputEntries,
12
+ outputDetail,
13
13
  saveEntries,
14
14
  versionStatus,
15
15
  zenql,
@@ -43,7 +43,7 @@ export const makeCopyCommand = () => {
43
43
  .addOption(commit)
44
44
  .addOption(concurrency)
45
45
  .addOption(ignoreErrors)
46
- .addOption(outputEntries)
46
+ .addOption(outputDetail)
47
47
  .addOption(noCache)
48
48
  .option(
49
49
  '--search <phrase>',
@@ -147,6 +147,16 @@ export const ignoreErrors = new Option(
147
147
  'commit the import ignoring any reported errors'
148
148
  ).default(false);
149
149
 
150
+ export const outputDetail = new Option(
151
+ '-od --output-detail <outputDetail>',
152
+ 'how much detail to output from the import'
153
+ )
154
+ .choices(['errors', 'changes', 'all'])
155
+ .default('errors');
156
+
157
+ /**
158
+ * Deprecated: use outputDetail instead
159
+ */
150
160
  export const outputEntries = new Option(
151
161
  '-oe --output-entries <outputEntries>',
152
162
  'which details of the entries included in the import to output'
@@ -10,6 +10,7 @@ import {
10
10
  latest,
11
11
  mapContensisOpts,
12
12
  noCache,
13
+ outputDetail,
13
14
  outputEntries,
14
15
  saveEntries,
15
16
  versionStatus,
@@ -128,7 +129,8 @@ Example call:
128
129
  'include this flag when you are importing entries that you have previously exported and wish to update'
129
130
  )
130
131
  .addOption(concurrency)
131
- .addOption(outputEntries)
132
+ .addOption(outputDetail)
133
+ .addOption(outputEntries) // TODO: retire favouring outputDetail
132
134
  .addOption(ignoreErrors)
133
135
  .addOption(noCache)
134
136
  .addOption(saveEntries)
@@ -148,7 +150,7 @@ Example call:
148
150
  ).ImportEntries({
149
151
  commit: opts.commit,
150
152
  fromFile: opts.fromFile,
151
- logOutput: opts.outputEntries,
153
+ logOutput: opts.outputDetail || opts.outputEntries,
152
154
  saveEntries: opts.saveEntries,
153
155
  });
154
156
  });
@@ -4,6 +4,7 @@ import {
4
4
  MigrateModelsResult,
5
5
  MigrateStatus,
6
6
  } from 'migratortron';
7
+ import pl from 'pluralize';
7
8
  import { GitHelper } from '~/util/git';
8
9
  import { Logger } from '~/util/logger';
9
10
  import { winSlash } from '~/util/os';
@@ -29,9 +30,7 @@ export const LogMessages = {
29
30
  },
30
31
  envs: {
31
32
  found: (num: number) =>
32
- `environments store found containing ${num} environment${
33
- num === 1 ? '' : 's'
34
- }`,
33
+ `environments store found containing ${pl('environment', num, true)}`,
35
34
  tip: () =>
36
35
  `Connect to a Contensis cloud instance using "contensis connect {cms alias}"`,
37
36
  },
@@ -156,7 +155,11 @@ export const LogMessages = {
156
155
  },
157
156
  nodes: {
158
157
  imported: (env: string, commit: boolean, count: number) =>
159
- `[${env}] ${commit ? `Imported` : `Will import`} ${count} nodes`,
158
+ `[${env}] ${commit ? `Imported` : `Will import`} ${pl(
159
+ 'node',
160
+ count,
161
+ true
162
+ )}`,
160
163
  failedImport: (env: string) => `[${env}] Unable to import nodes`,
161
164
  removed: (env: string, commit: boolean, root: string) =>
162
165
  `[${env}] ${commit ? `Deleted` : `Will delete`} nodes at ${root}`,
@@ -212,8 +215,10 @@ export const LogMessages = {
212
215
  `No Contensis environment set, connect to your Contensis cloud instance using "contensis connect {cms alias}"`,
213
216
  },
214
217
  entries: {
215
- imported: (env: string, commit: boolean, count: number) =>
216
- `[${env}] ${commit ? `Imported` : `Will import`} ${count} entries`,
218
+ imported: (env: string, commit: boolean, entries: number, nodes = 0) =>
219
+ `${commit ? `Imported` : `Will import`} ${pl('entry', entries, true)}${
220
+ nodes > 0 ? ` and ${pl('node', nodes, true)}` : ''
221
+ } into ${env} environment`,
217
222
  failedImport: (env: string) => `[${env}] Unable to import entries`,
218
223
  removed: (env: string, commit: boolean) =>
219
224
  `[${env}] ${commit ? `Deleted` : `Will delete`} entries`,
@@ -1779,10 +1779,11 @@ class ContensisCli {
1779
1779
 
1780
1780
  if (err) logError(err);
1781
1781
  else {
1782
+ const { migrateEntries, nodes } =
1783
+ contensis.content.targets[currentProject];
1784
+
1782
1785
  const output = saveEntries
1783
- ? contensis.content.targets[currentProject].migrateEntries?.map(
1784
- me => me.finalEntry
1785
- )
1786
+ ? migrateEntries?.map(me => me.finalEntry)
1786
1787
  : result;
1787
1788
  await this.HandleFormattingAndOutput(output, () => {
1788
1789
  // print the migrateResult to console
@@ -1791,6 +1792,16 @@ class ContensisCli {
1791
1792
  showDiff: logOutput === 'all' || logOutput === 'changes',
1792
1793
  showChanged: logOutput === 'changes',
1793
1794
  });
1795
+ if (['all', 'changes'].includes(logOutput))
1796
+ printNodeTreeOutput(
1797
+ this,
1798
+ {
1799
+ ...nodes.rootAncestor,
1800
+ status: 'no change',
1801
+ children: nodes.migrateNodes as any,
1802
+ },
1803
+ logOutput
1804
+ );
1794
1805
  });
1795
1806
  }
1796
1807
  if (
@@ -1807,7 +1818,11 @@ class ContensisCli {
1807
1818
  commit
1808
1819
  ? (result.migrateResult?.created || 0) +
1809
1820
  (result.migrateResult?.updated || 0)
1810
- : result.entriesToMigrate[currentProject].totalCount
1821
+ : result.entriesToMigrate[currentProject].totalCount,
1822
+ commit
1823
+ ? (result.nodesResult?.created || 0) +
1824
+ (result.nodesResult?.updated || 0)
1825
+ : (result.nodesToMigrate[currentProject].totalCount as number)
1811
1826
  )
1812
1827
  );
1813
1828
  if (!commit) {
@@ -1960,13 +1975,14 @@ class ContensisCli {
1960
1975
  }
1961
1976
 
1962
1977
  const [err, result] = await contensis.MigrateNodes();
1963
- const migrateTree =
1964
- contensis.nodes.targetRepos[currentProject].nodes.migrateNodesTreeView;
1965
1978
 
1966
1979
  if (err) log.raw(``);
1967
1980
  else
1968
1981
  await this.HandleFormattingAndOutput(result, () => {
1969
1982
  // print the migrateResult to console
1983
+ const migrateTree =
1984
+ contensis.nodes.targetRepos[currentProject].nodes
1985
+ .migrateNodesTreeView;
1970
1986
  printNodeTreeOutput(this, migrateTree, logOutput, logLimit);
1971
1987
  printNodesMigrateResult(this, result, {
1972
1988
  showAll: logOutput === 'all',