contensis-cli 1.2.1 → 1.2.2-beta.1
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/README.md +1 -1
- package/dist/commands/copy.js +2 -5
- package/dist/commands/copy.js.map +2 -2
- package/dist/commands/diff.js +4 -4
- package/dist/commands/diff.js.map +2 -2
- package/dist/commands/get.js +5 -4
- package/dist/commands/get.js.map +2 -2
- package/dist/commands/globalOptions.js +25 -5
- package/dist/commands/globalOptions.js.map +2 -2
- package/dist/commands/import.js +8 -9
- package/dist/commands/import.js.map +2 -2
- package/dist/commands/index.js +3 -3
- package/dist/commands/index.js.map +2 -2
- package/dist/commands/list.js +7 -2
- package/dist/commands/list.js.map +2 -2
- package/dist/services/ContensisCliService.js +21 -8
- package/dist/services/ContensisCliService.js.map +2 -2
- package/dist/util/logger.js +4 -3
- package/dist/util/logger.js.map +2 -2
- package/dist/version.js +1 -1
- package/dist/version.js.map +1 -1
- package/package.json +2 -2
- package/src/commands/copy.ts +8 -4
- package/src/commands/diff.ts +5 -4
- package/src/commands/get.ts +10 -2
- package/src/commands/globalOptions.ts +27 -12
- package/src/commands/import.ts +25 -10
- package/src/commands/index.ts +3 -3
- package/src/commands/list.ts +7 -1
- package/src/services/ContensisCliService.ts +23 -4
- package/src/util/logger.ts +3 -2
- package/src/version.ts +1 -1
package/dist/util/logger.js
CHANGED
|
@@ -162,9 +162,10 @@ ${Logger.standardText(content)}`;
|
|
|
162
162
|
for (const item of content) {
|
|
163
163
|
if (item && typeof item === "object") {
|
|
164
164
|
if (Array.isArray(item) && depth > 3)
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
165
|
+
if (item.length)
|
|
166
|
+
Logger.raw(import_chalk.default.grey(`${indent} [${item.join(", ")}]`));
|
|
167
|
+
else
|
|
168
|
+
Logger.objectRecurse(item, depth + 1, `${indent} `);
|
|
168
169
|
} else
|
|
169
170
|
Logger.raw(`${indent}${item}`);
|
|
170
171
|
}
|
package/dist/util/logger.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/util/logger.ts"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable no-console */\nimport chalk from 'chalk';\nimport dateFormat from 'dateformat';\nimport deepCleaner from 'deep-cleaner';\nimport {\n ansiEscapeCodes,\n first,\n partition,\n strlen,\n} from 'printable-characters';\n// import ProgressBar from 'progress';\nimport { isSysError, tryStringify } from '.';\n\ntype LogMethod = (content: string) => void;\ntype LogErrorMethod = (content: string, err?: any, newline?: string) => void;\ntype LogJsonMethod = (content: any, depth?: number, indent?: string) => void;\ntype LogJsonDepthMethod = (content: any, depth?: number) => void;\ntype LogArrayMethod = (contentArray: string[]) => void;\ntype LogErrorFunc = (\n err: any,\n msg?: string,\n level?: 'error' | 'critical'\n) => void;\n\nexport class Logger {\n static isUserTerminal = !!process.stdout.columns;\n static getPrefix = () => {\n return Logger.isUserTerminal\n ? Logger.infoText(`[cli]`)\n : `[${dateFormat(new Date(), 'dd/mm HH:MM:ss')}]`;\n };\n static errorText = chalk.bold.red;\n static warningText = chalk.keyword('orange');\n static successText = chalk.keyword('green');\n static helpText = chalk.blue;\n static highlightText = chalk.yellow;\n static infoText = chalk.keyword('grey');\n static standardText = chalk.keyword('white');\n static boldText = chalk.bold;\n static critical: LogMethod = content => {\n const message = `${Logger.getPrefix()} ${Logger.errorText(\n '[CRITICAL]'\n )} ${content}`;\n console.log(message);\n };\n static error: LogErrorMethod = (content, err, newline = '\\n') => {\n const message = `${Logger.getPrefix()} ${Logger.errorText(\n `${Logger.isUserTerminal ? '\u274C' : '[ERROR]'} ${content}${\n err\n ? `\\n\\n${Logger.infoText(\n isSysError(err) ? err.toString() : JSON.stringify(err, null, 2)\n )}`\n : ''\n }`\n )}${newline}`;\n if (progress.active) progress.current.interrupt(message);\n else console.log(message);\n };\n static warning: LogMethod = content => {\n const message = `${Logger.getPrefix()} ${Logger.warningText(\n `${Logger.isUserTerminal ? '\u26A0\uFE0F ' : '[WARN]'} ${content}`\n )}\\n`;\n if (progress.active) progress.current.interrupt(message);\n else console.log(message);\n // }\n };\n static success: LogMethod = content => {\n const message = `${Logger.getPrefix()} ${Logger.successText(\n `${Logger.isUserTerminal ? '\u2705' : '[OK]'} ${content}`\n )}`;\n if (progress.active) progress.current.interrupt(message);\n else console.log(message);\n };\n static info: LogMethod = content => {\n const message = `${Logger.getPrefix()} ${\n Logger.isUserTerminal ? chalk.bgCyan(' \u2139 ') : '[INFO]'\n } ${Logger.infoText(content)}`;\n if (progress.active) progress.current.interrupt(message);\n else console.log(message);\n };\n static help: LogMethod = content => {\n const message = `${Logger.getPrefix()} ${chalk.blue(\n `${Logger.isUserTerminal ? '\u23E9' : '[HELP]'} ${content}`\n )}\\n`;\n if (progress.active) progress.current.interrupt(message);\n else console.log(message);\n };\n static standard: LogMethod = content => {\n const message = `${Logger.getPrefix()} ${\n Logger.isUserTerminal ? '\u25FB\uFE0F' : '[STD]'\n } \\n${Logger.standardText(content)}`;\n if (progress.active) progress.current.interrupt(message);\n else console.log(message);\n progress.current.interrupt(message);\n };\n static debug: LogMethod = content => {\n if (['true', '1'].includes(process.env.debug || '')) {\n const message = `${Logger.getPrefix()} ${\n Logger.isUserTerminal ? chalk.bgGrey(' \u2699 ') : '[DEBUG]'\n } ${Logger.infoText(content)}`;\n if (progress.active) progress.current.interrupt(message);\n else console.log(message);\n }\n };\n static json: LogJsonDepthMethod = (content, depth = 9) =>\n console.dir(deepCleaner(content), { colors: true, depth });\n static mixed: LogArrayMethod = contentArray =>\n console.log(`${Logger.getPrefix()} ${contentArray.join(' ')}`);\n static line = () =>\n Logger.raw(` ${Logger.infoText(`-------------------------------------`)}`);\n\n static object: LogJsonMethod = content => {\n for (const [key, value] of Object.entries(content || {})) {\n if (value && typeof value === 'object') {\n Logger.raw(` ${chalk.bold.grey(key)}:`);\n if (key === 'fields' && Array.isArray(value)) {\n for (const field of value || []) {\n Logger.raw(\n ` ${chalk.bold(field.id)}${\n field.id === content.entryTitleField\n ? '**'\n : field.validations.minCount?.value ||\n typeof field.validations.required?.message !== 'undefined'\n ? '*'\n : ''\n }: ${chalk.grey(\n `${field.dataType}${\n field.dataFormat\n ? `<${\n Array.isArray(\n field.validations.allowedFieldTypes?.fields\n )\n ? `composer[${field.validations.allowedFieldTypes.fields\n .map((f: any) => f.id)\n .join(' | ')}]`\n : field.dataFormat\n }${\n field.dataFormat === 'entry'\n ? `, ${field.validations.allowedContentTypes.contentTypes.join(\n ' | '\n )}`\n : ''\n }>`\n : ''\n }${\n field.validations.maxLength?.value\n ? `(${field.validations.maxLength.value})`\n : ''\n }`\n )}`\n );\n }\n } else if (key === 'groups' && Array.isArray(value)) {\n for (const group of value || []) {\n const description =\n Object.keys(group.description).length &&\n Object.values(group.description)?.[0];\n Logger.raw(\n ` ${chalk.bold(group.id)}${\n description\n ? `: ${chalk.grey(Object.values(group.description)?.[0])}`\n : ''\n }`\n );\n }\n } else {\n Logger.objectRecurse(value, 3, ' ');\n // for (const [innerkey, innervalue] of Object.entries(value)) {\n // if (innervalue && typeof innervalue === 'object') {\n // Logger.raw(` ${chalk.bold.grey(innerkey)}:`);\n // console.table(innervalue);\n // } else if (\n // typeof innervalue !== 'undefined' &&\n // innervalue !== null\n // ) {\n // Logger.raw(` ${chalk.bold.grey(innerkey)}: ${innervalue}`);\n // }\n // }\n }\n } else if (typeof value !== 'undefined' && value !== null) {\n const valueText =\n key === 'id' && typeof value === 'string'\n ? Logger.highlightText(value)\n : value;\n Logger.raw(` ${chalk.bold.grey(key)}: ${valueText}`);\n }\n }\n };\n\n static objectRecurse: LogJsonMethod = (content, depth = 3, indent = '') => {\n if (Array.isArray(content)) {\n for (const item of content) {\n if (item && typeof item === 'object') {\n if (Array.isArray(item) && depth > 3)\n Logger.raw(chalk.grey(`${indent} [${item.join(', ')}]`));\n else Logger.objectRecurse(item, depth + 1, `${indent} `);\n } else Logger.raw(`${indent}${item}`);\n }\n } else {\n let pos = 0;\n for (const [key, value] of Object.entries(content)) {\n const thisIndent =\n pos === 0 ? `${indent.substring(0, indent.length - 2)}- ` : indent;\n if (Array.isArray(value)) {\n if (value.length) Logger.raw(`${thisIndent}${chalk.bold.grey(key)}:`);\n for (const item of value) {\n if (item && typeof item === 'object') {\n if (Array.isArray(item) && depth > 3)\n Logger.raw(chalk.grey(`${indent} [${item.join(', ')}]`));\n else Logger.objectRecurse(item, depth + 1, `${indent} `);\n } else {\n Logger.raw(`${indent} ${item}`);\n }\n }\n } else if (value && typeof value === 'object') {\n Logger.raw(`${indent}${chalk.bold.grey(key)}:`);\n\n Logger.objectRecurse(value, depth + 1, `${indent} `);\n // console.table(value);\n } else if (typeof value !== 'undefined' && value !== null) {\n Logger.raw(`${thisIndent}${chalk.bold.grey(key)}: ${value}`);\n }\n pos++;\n }\n }\n };\n static raw: LogMethod = (content: string) => {\n if (progress.active) progress.current.interrupt(content);\n else console.log(content);\n };\n\n static limits = (\n content: string,\n displayLength = 30,\n consoleWidth = process.stdout.columns,\n logMethod: Function = console.info\n ) => {\n if (consoleWidth) {\n const contentArray = content.endsWith('\\n')\n ? content.split('\\n').slice(0, -1)\n : content.split('\\n');\n const contentLines = contentArray.slice(\n 0,\n consoleWidth ? displayLength : undefined\n );\n for (const line of contentLines)\n logMethod(\n line\n .split('~n')\n .map(l =>\n consoleWidth && strlen(l) > consoleWidth\n ? first(l, consoleWidth)\n : l\n )\n .join('\\n')\n );\n } else {\n logMethod(content.replace(ansiEscapeCodes, '').replaceAll('~n', '\\n'));\n }\n\n const tableArray = content.split('\\n');\n if (consoleWidth && tableArray.length > displayLength)\n console.info(\n `\\n`,\n `- and ${tableArray.length - displayLength} more...\\n`\n );\n };\n}\n\nexport const logError: LogErrorFunc = (\n err = new Error('Undefined error'),\n msg,\n level = 'error'\n) => {\n Logger[level](msg || err.message || err?.data?.message || err.Message);\n (Array.isArray(err) ? err : [err]).map((error: AppError) => {\n if (typeof error === 'string') {\n Logger.raw(`${Logger.infoText(error)}\\n`);\n return;\n }\n if ('stack' in error) Logger.raw(` ${Logger.infoText(error.stack)}\\n`);\n if ('data' in error)\n Logger.raw(` ${Logger.infoText(tryStringify(error.data))}\\n`);\n });\n //Logger.line();\n return null;\n};\n\nexport const addNewLines = (\n message = '',\n newLineSeparater = '\\n',\n atPosition = process.stdout.columns\n) => {\n if (message === '' || atPosition === 0) {\n return '';\n }\n\n let result = '';\n let lengthCounter = 0;\n\n // Partition the message string into an array of\n // [nonPrintable, printable][]\n const partitioned = partition(message);\n const addSeparater = () => {\n // If line length counter has exceeded the console width\n // add a new line separater and reset the line length counter\n if (lengthCounter >= atPosition) {\n result += newLineSeparater;\n lengthCounter = 0;\n }\n };\n\n // Loop through the partitioned message parts\n for (const [nonPrintable, printable] of partitioned) {\n // Convert string to array as this will provide accurate\n // lengths and splicing methods with all unicode chars\n const textParts = Array.from(printable);\n // Splice the remaining allowable line length from the text parts array\n const text = textParts.splice(0, atPosition - lengthCounter);\n // In the first iteration append the non printable unicode chars\n // to the beginning of the spliced text\n result += nonPrintable + text.join('');\n // Keep a count of the current line length\n // as one line of output could span multiple \"partitions\"\n lengthCounter += text.length;\n addSeparater();\n\n // Handle any remaining text in this \"partition\"\n while (textParts.length) {\n // Splice the remaining allowable line length from the text parts array\n const text = textParts.splice(0, atPosition - lengthCounter);\n // Append the spliced text to the result\n result += text.join('');\n // Increase line length counter\n lengthCounter += text.length;\n addSeparater();\n }\n }\n return result;\n};\n\nexport const progress = {\n current: { interrupt: (x: string) => {} },\n active: false,\n // done: () => new ProgressBar('', 0),\n // colours: { green: '\\u001b[42m \\u001b[0m', red: '\\u001b[41m \\u001b[0m' },\n // current: new ProgressBar(`:bar`, {\n // complete: '=',\n // incomplete: ' ',\n // width: 20,\n // total: 100,\n // }),\n};\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,m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OACb,MAAM,aAEV,MAAM,eAAe,UACjB,KAAK,MAAM,YAAY,oBAAoB,aAAa;AAAA,kBACtD;AAAA,gBACF,MACA,QAEN,OAEJ,WAAM,YAAY,cAAlB,mBAA6B,SACzB,IAAI,MAAM,YAAY,UAAU,WAChC;AAAA,cAER;AAAA,YACF;AAAA,UACF;AAAA,QACF,WAAW,QAAQ,YAAY,MAAM,QAAQ,KAAK,GAAG;AACnD,qBAAW,SAAS,SAAS,CAAC,GAAG;AAC/B,kBAAM,cACJ,OAAO,KAAK,MAAM,WAAW,EAAE,YAC/B,YAAO,OAAO,MAAM,WAAW,MAA/B,mBAAmC;AACrC,mBAAO;AAAA,cACL,OAAO,aAAAA,QAAM,KAAK,MAAM,EAAE,IACxB,cACI,KAAK,aAAAA,QAAM,MAAK,YAAO,OAAO,MAAM,WAAW,MAA/B,mBAAmC,EAAE,MACrD;AAAA,YAER;AAAA,UACF;AAAA,QACF,OAAO;AACL,iBAAO,cAAc,OAAO,GAAG,MAAM;AAAA,QAYvC;AAAA,MACF,WAAW,OAAO,UAAU,eAAe,UAAU,MAAM;AACzD,cAAM,YACJ,QAAQ,QAAQ,OAAO,UAAU,WAC7B,OAAO,cAAc,KAAK,IAC1B;AACN,eAAO,IAAI,KAAK,aAAAA,QAAM,KAAK,KAAK,GAAG,MAAM,WAAW;AAAA,MACtD;AAAA,IACF;AAAA,EACF;AAAA,EAEA,OAAO,gBAA+B,CAAC,SAAS,QAAQ,GAAG,SAAS,OAAO;AACzE,QAAI,MAAM,QAAQ,OAAO,GAAG;AAC1B,iBAAW,QAAQ,SAAS;AAC1B,YAAI,QAAQ,OAAO,SAAS,UAAU;AACpC,cAAI,MAAM,QAAQ,IAAI,KAAK,QAAQ;AACjC,
|
|
4
|
+
"sourcesContent": ["/* eslint-disable no-console */\nimport chalk from 'chalk';\nimport dateFormat from 'dateformat';\nimport deepCleaner from 'deep-cleaner';\nimport {\n ansiEscapeCodes,\n first,\n partition,\n strlen,\n} from 'printable-characters';\n// import ProgressBar from 'progress';\nimport { isSysError, tryStringify } from '.';\n\ntype LogMethod = (content: string) => void;\ntype LogErrorMethod = (content: string, err?: any, newline?: string) => void;\ntype LogJsonMethod = (content: any, depth?: number, indent?: string) => void;\ntype LogJsonDepthMethod = (content: any, depth?: number) => void;\ntype LogArrayMethod = (contentArray: string[]) => void;\ntype LogErrorFunc = (\n err: any,\n msg?: string,\n level?: 'error' | 'critical'\n) => void;\n\nexport class Logger {\n static isUserTerminal = !!process.stdout.columns;\n static getPrefix = () => {\n return Logger.isUserTerminal\n ? Logger.infoText(`[cli]`)\n : `[${dateFormat(new Date(), 'dd/mm HH:MM:ss')}]`;\n };\n static errorText = chalk.bold.red;\n static warningText = chalk.keyword('orange');\n static successText = chalk.keyword('green');\n static helpText = chalk.blue;\n static highlightText = chalk.yellow;\n static infoText = chalk.keyword('grey');\n static standardText = chalk.keyword('white');\n static boldText = chalk.bold;\n static critical: LogMethod = content => {\n const message = `${Logger.getPrefix()} ${Logger.errorText(\n '[CRITICAL]'\n )} ${content}`;\n console.log(message);\n };\n static error: LogErrorMethod = (content, err, newline = '\\n') => {\n const message = `${Logger.getPrefix()} ${Logger.errorText(\n `${Logger.isUserTerminal ? '\u274C' : '[ERROR]'} ${content}${\n err\n ? `\\n\\n${Logger.infoText(\n isSysError(err) ? err.toString() : JSON.stringify(err, null, 2)\n )}`\n : ''\n }`\n )}${newline}`;\n if (progress.active) progress.current.interrupt(message);\n else console.log(message);\n };\n static warning: LogMethod = content => {\n const message = `${Logger.getPrefix()} ${Logger.warningText(\n `${Logger.isUserTerminal ? '\u26A0\uFE0F ' : '[WARN]'} ${content}`\n )}\\n`;\n if (progress.active) progress.current.interrupt(message);\n else console.log(message);\n // }\n };\n static success: LogMethod = content => {\n const message = `${Logger.getPrefix()} ${Logger.successText(\n `${Logger.isUserTerminal ? '\u2705' : '[OK]'} ${content}`\n )}`;\n if (progress.active) progress.current.interrupt(message);\n else console.log(message);\n };\n static info: LogMethod = content => {\n const message = `${Logger.getPrefix()} ${\n Logger.isUserTerminal ? chalk.bgCyan(' \u2139 ') : '[INFO]'\n } ${Logger.infoText(content)}`;\n if (progress.active) progress.current.interrupt(message);\n else console.log(message);\n };\n static help: LogMethod = content => {\n const message = `${Logger.getPrefix()} ${chalk.blue(\n `${Logger.isUserTerminal ? '\u23E9' : '[HELP]'} ${content}`\n )}\\n`;\n if (progress.active) progress.current.interrupt(message);\n else console.log(message);\n };\n static standard: LogMethod = content => {\n const message = `${Logger.getPrefix()} ${\n Logger.isUserTerminal ? '\u25FB\uFE0F' : '[STD]'\n } \\n${Logger.standardText(content)}`;\n if (progress.active) progress.current.interrupt(message);\n else console.log(message);\n progress.current.interrupt(message);\n };\n static debug: LogMethod = content => {\n if (['true', '1'].includes(process.env.debug || '')) {\n const message = `${Logger.getPrefix()} ${\n Logger.isUserTerminal ? chalk.bgGrey(' \u2699 ') : '[DEBUG]'\n } ${Logger.infoText(content)}`;\n if (progress.active) progress.current.interrupt(message);\n else console.log(message);\n }\n };\n static json: LogJsonDepthMethod = (content, depth = 9) =>\n console.dir(deepCleaner(content), { colors: true, depth });\n static mixed: LogArrayMethod = contentArray =>\n console.log(`${Logger.getPrefix()} ${contentArray.join(' ')}`);\n static line = () =>\n Logger.raw(` ${Logger.infoText(`-------------------------------------`)}`);\n\n static object: LogJsonMethod = content => {\n for (const [key, value] of Object.entries(content || {})) {\n if (value && typeof value === 'object') {\n Logger.raw(` ${chalk.bold.grey(key)}:`);\n if (key === 'fields' && Array.isArray(value)) {\n for (const field of value || []) {\n Logger.raw(\n ` ${chalk.bold(field.id)}${\n field.id === content.entryTitleField\n ? '**'\n : field.validations.minCount?.value ||\n typeof field.validations.required?.message !== 'undefined'\n ? '*'\n : ''\n }: ${chalk.grey(\n `${field.dataType}${\n field.dataFormat\n ? `<${\n Array.isArray(\n field.validations.allowedFieldTypes?.fields\n )\n ? `composer[${field.validations.allowedFieldTypes.fields\n .map((f: any) => f.id)\n .join(' | ')}]`\n : field.dataFormat\n }${\n field.dataFormat === 'entry'\n ? `, ${field.validations.allowedContentTypes.contentTypes.join(\n ' | '\n )}`\n : ''\n }>`\n : ''\n }${\n field.validations.maxLength?.value\n ? `(${field.validations.maxLength.value})`\n : ''\n }`\n )}`\n );\n }\n } else if (key === 'groups' && Array.isArray(value)) {\n for (const group of value || []) {\n const description =\n Object.keys(group.description).length &&\n Object.values(group.description)?.[0];\n Logger.raw(\n ` ${chalk.bold(group.id)}${\n description\n ? `: ${chalk.grey(Object.values(group.description)?.[0])}`\n : ''\n }`\n );\n }\n } else {\n Logger.objectRecurse(value, 3, ' ');\n // for (const [innerkey, innervalue] of Object.entries(value)) {\n // if (innervalue && typeof innervalue === 'object') {\n // Logger.raw(` ${chalk.bold.grey(innerkey)}:`);\n // console.table(innervalue);\n // } else if (\n // typeof innervalue !== 'undefined' &&\n // innervalue !== null\n // ) {\n // Logger.raw(` ${chalk.bold.grey(innerkey)}: ${innervalue}`);\n // }\n // }\n }\n } else if (typeof value !== 'undefined' && value !== null) {\n const valueText =\n key === 'id' && typeof value === 'string'\n ? Logger.highlightText(value)\n : value;\n Logger.raw(` ${chalk.bold.grey(key)}: ${valueText}`);\n }\n }\n };\n\n static objectRecurse: LogJsonMethod = (content, depth = 3, indent = '') => {\n if (Array.isArray(content)) {\n for (const item of content) {\n if (item && typeof item === 'object') {\n if (Array.isArray(item) && depth > 3)\n if (item.length)\n Logger.raw(chalk.grey(`${indent} [${item.join(', ')}]`));\n else Logger.objectRecurse(item, depth + 1, `${indent} `);\n } else Logger.raw(`${indent}${item}`);\n }\n } else {\n let pos = 0;\n for (const [key, value] of Object.entries(content)) {\n const thisIndent =\n pos === 0 ? `${indent.substring(0, indent.length - 2)}- ` : indent;\n if (Array.isArray(value)) {\n if (value.length) Logger.raw(`${thisIndent}${chalk.bold.grey(key)}:`);\n for (const item of value) {\n if (item && typeof item === 'object') {\n if (Array.isArray(item) && depth > 3)\n Logger.raw(chalk.grey(`${indent} [${item.join(', ')}]`));\n else Logger.objectRecurse(item, depth + 1, `${indent} `);\n } else {\n Logger.raw(`${indent} ${item}`);\n }\n }\n } else if (value && typeof value === 'object') {\n Logger.raw(`${indent}${chalk.bold.grey(key)}:`);\n\n Logger.objectRecurse(value, depth + 1, `${indent} `);\n // console.table(value);\n } else if (typeof value !== 'undefined' && value !== null) {\n Logger.raw(`${thisIndent}${chalk.bold.grey(key)}: ${value}`);\n }\n pos++;\n }\n }\n };\n static raw: LogMethod = (content: string) => {\n if (progress.active) progress.current.interrupt(content);\n else console.log(content);\n };\n\n static limits = (\n content: string,\n displayLength = 30,\n consoleWidth = process.stdout.columns,\n logMethod: Function = console.info\n ) => {\n if (consoleWidth) {\n const contentArray = content.endsWith('\\n')\n ? content.split('\\n').slice(0, -1)\n : content.split('\\n');\n const contentLines = contentArray.slice(\n 0,\n consoleWidth ? displayLength : undefined\n );\n for (const line of contentLines)\n logMethod(\n line\n .split('~n')\n .map(l =>\n consoleWidth && strlen(l) > consoleWidth\n ? first(l, consoleWidth)\n : l\n )\n .join('\\n')\n );\n } else {\n logMethod(content.replace(ansiEscapeCodes, '').replaceAll('~n', '\\n'));\n }\n\n const tableArray = content.split('\\n');\n if (consoleWidth && tableArray.length > displayLength)\n console.info(\n `\\n`,\n `- and ${tableArray.length - displayLength} more...\\n`\n );\n };\n}\n\nexport const logError: LogErrorFunc = (\n err = new Error('Undefined error'),\n msg,\n level = 'error'\n) => {\n Logger[level](msg || err.message || err?.data?.message || err.Message);\n (Array.isArray(err) ? err : [err]).map((error: AppError) => {\n if (typeof error === 'string') {\n Logger.raw(`${Logger.infoText(error)}\\n`);\n return;\n }\n if ('stack' in error) Logger.raw(` ${Logger.infoText(error.stack)}\\n`);\n if ('data' in error)\n Logger.raw(` ${Logger.infoText(tryStringify(error.data))}\\n`);\n });\n //Logger.line();\n return null;\n};\n\nexport const addNewLines = (\n message = '',\n newLineSeparater = '\\n',\n atPosition = process.stdout.columns\n) => {\n if (message === '' || atPosition === 0) {\n return '';\n }\n\n let result = '';\n let lengthCounter = 0;\n\n // Partition the message string into an array of\n // [nonPrintable, printable][]\n const partitioned = partition(message);\n const addSeparater = () => {\n // If line length counter has exceeded the console width\n // add a new line separater and reset the line length counter\n if (lengthCounter >= atPosition) {\n result += newLineSeparater;\n lengthCounter = 0;\n }\n };\n\n // Loop through the partitioned message parts\n for (const [nonPrintable, printable] of partitioned) {\n // Convert string to array as this will provide accurate\n // lengths and splicing methods with all unicode chars\n const textParts = Array.from(printable);\n // Splice the remaining allowable line length from the text parts array\n const text = textParts.splice(0, atPosition - lengthCounter);\n // In the first iteration append the non printable unicode chars\n // to the beginning of the spliced text\n result += nonPrintable + text.join('');\n // Keep a count of the current line length\n // as one line of output could span multiple \"partitions\"\n lengthCounter += text.length;\n addSeparater();\n\n // Handle any remaining text in this \"partition\"\n while (textParts.length) {\n // Splice the remaining allowable line length from the text parts array\n const text = textParts.splice(0, atPosition - lengthCounter);\n // Append the spliced text to the result\n result += text.join('');\n // Increase line length counter\n lengthCounter += text.length;\n addSeparater();\n }\n }\n return result;\n};\n\nexport const progress = {\n current: { interrupt: (x: string) => {} },\n active: false,\n // done: () => new ProgressBar('', 0),\n // colours: { green: '\\u001b[42m \\u001b[0m', red: '\\u001b[41m \\u001b[0m' },\n // current: new ProgressBar(`:bar`, {\n // complete: '=',\n // incomplete: ' ',\n // width: 20,\n // total: 100,\n // }),\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,mBAAkB;AAClB,wBAAuB;AACvB,0BAAwB;AACxB,kCAKO;AAEP,eAAyC;AAalC,MAAM,OAAO;AAAA,EAClB,OAAO,iBAAiB,CAAC,CAAC,QAAQ,OAAO;AAAA,EACzC,OAAO,YAAY,MAAM;AACvB,WAAO,OAAO,iBACV,OAAO,SAAS,OAAO,IACvB,QAAI,kBAAAA,SAAW,IAAI,KAAK,GAAG,gBAAgB;AAAA,EACjD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AAA,EACF;AAGA,aAAW,CAAC,cAAc,SAAS,KAAK,aAAa;AAGnD,UAAM,YAAY,MAAM,KAAK,SAAS;AAEtC,UAAM,OAAO,UAAU,OAAO,GAAG,aAAa,aAAa;AAG3D,cAAU,eAAe,KAAK,KAAK,EAAE;AAGrC,qBAAiB,KAAK;AACtB,iBAAa;AAGb,WAAO,UAAU,QAAQ;AAEvB,YAAME,QAAO,UAAU,OAAO,GAAG,aAAa,aAAa;AAE3D,gBAAUA,MAAK,KAAK,EAAE;AAEtB,uBAAiBA,MAAK;AACtB,mBAAa;AAAA,IACf;AAAA,EACF;AACA,SAAO;AACT;AAEO,MAAM,WAAW;AAAA,EACtB,SAAS,EAAE,WAAW,CAAC,MAAc;AAAA,EAAC,EAAE;AAAA,EACxC,QAAQ;AASV;",
|
|
6
6
|
"names": ["dateFormat", "chalk", "deepCleaner", "text"]
|
|
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.1";
|
|
24
|
+
const LIB_VERSION = "1.2.2-beta.1";
|
|
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.2.1\";\n"],
|
|
4
|
+
"sourcesContent": ["export const LIB_VERSION = \"1.2.2-beta.1\";\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.1",
|
|
3
|
+
"version": "1.2.2-beta.1",
|
|
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.
|
|
43
|
+
"migratortron": "^1.0.0-beta.51",
|
|
44
44
|
"nanospinner": "^1.1.0",
|
|
45
45
|
"node-fetch": "^2.6.7",
|
|
46
46
|
"parse-git-config": "^3.0.0",
|
package/src/commands/copy.ts
CHANGED
|
@@ -6,8 +6,12 @@ import {
|
|
|
6
6
|
concurrency,
|
|
7
7
|
entryId,
|
|
8
8
|
ignoreErrors,
|
|
9
|
+
latest,
|
|
9
10
|
mapContensisOpts,
|
|
11
|
+
noCache,
|
|
10
12
|
outputEntries,
|
|
13
|
+
saveEntries,
|
|
14
|
+
versionStatus,
|
|
11
15
|
zenql,
|
|
12
16
|
} from './globalOptions';
|
|
13
17
|
|
|
@@ -36,16 +40,16 @@ export const makeCopyCommand = () => {
|
|
|
36
40
|
.addOption(concurrency)
|
|
37
41
|
.addOption(ignoreErrors)
|
|
38
42
|
.addOption(outputEntries)
|
|
43
|
+
.addOption(noCache)
|
|
39
44
|
.option(
|
|
40
45
|
'--search <phrase>',
|
|
41
46
|
'get entries with the search phrase, use quotes for multiple words'
|
|
42
47
|
)
|
|
43
48
|
.addOption(entryId)
|
|
44
49
|
.addOption(zenql)
|
|
45
|
-
.
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
)
|
|
50
|
+
.addOption(latest)
|
|
51
|
+
.addOption(versionStatus)
|
|
52
|
+
.addOption(saveEntries)
|
|
49
53
|
.usage('<contentTypeId> <fieldId> <destinationId> (all arguments required)')
|
|
50
54
|
.addHelpText(
|
|
51
55
|
'after',
|
package/src/commands/diff.ts
CHANGED
|
@@ -1,22 +1,23 @@
|
|
|
1
1
|
import { Command } from 'commander';
|
|
2
2
|
import { cliCommand } from '~/services/ContensisCliService';
|
|
3
|
-
import { mapContensisOpts } from './globalOptions';
|
|
3
|
+
import { mapContensisOpts, noCache } from './globalOptions';
|
|
4
4
|
|
|
5
5
|
export const makeDiffCommand = () => {
|
|
6
|
-
const
|
|
6
|
+
const diff = new Command()
|
|
7
7
|
.command('diff')
|
|
8
8
|
.description('diff command')
|
|
9
9
|
.addHelpText('after', `\n`)
|
|
10
10
|
.showHelpAfterError(true)
|
|
11
11
|
.exitOverride();
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
diff
|
|
14
14
|
.command('models')
|
|
15
15
|
.description('differences with content models')
|
|
16
16
|
.argument(
|
|
17
17
|
'[model-ids...]',
|
|
18
18
|
'ids of any content types or components to diff (optional)'
|
|
19
19
|
)
|
|
20
|
+
.addOption(noCache)
|
|
20
21
|
.usage('[model-ids...]')
|
|
21
22
|
.addHelpText(
|
|
22
23
|
'after',
|
|
@@ -37,5 +38,5 @@ Example call:
|
|
|
37
38
|
);
|
|
38
39
|
});
|
|
39
40
|
|
|
40
|
-
return
|
|
41
|
+
return diff;
|
|
41
42
|
};
|
package/src/commands/get.ts
CHANGED
|
@@ -7,7 +7,10 @@ import {
|
|
|
7
7
|
contentTypes,
|
|
8
8
|
delivery,
|
|
9
9
|
entryId,
|
|
10
|
+
latest,
|
|
10
11
|
mapContensisOpts,
|
|
12
|
+
noCache,
|
|
13
|
+
versionStatus,
|
|
11
14
|
zenql,
|
|
12
15
|
} from './globalOptions';
|
|
13
16
|
|
|
@@ -121,6 +124,8 @@ Example call:
|
|
|
121
124
|
.command('model')
|
|
122
125
|
.description('get a content model')
|
|
123
126
|
.argument('<contentTypeId...>', 'ids of the content models to get')
|
|
127
|
+
.option('--required-by', 'shows the id(s) that created each dependency')
|
|
128
|
+
.addOption(noCache)
|
|
124
129
|
.addHelpText(
|
|
125
130
|
'after',
|
|
126
131
|
`
|
|
@@ -131,8 +136,9 @@ Example call:
|
|
|
131
136
|
.action(async (modelIds: string[], opts) => {
|
|
132
137
|
await cliCommand(
|
|
133
138
|
['get', 'model', modelIds.join(' ')],
|
|
134
|
-
opts
|
|
135
|
-
|
|
139
|
+
opts,
|
|
140
|
+
mapContensisOpts(opts)
|
|
141
|
+
).PrintContentModels(modelIds, opts.requiredBy);
|
|
136
142
|
});
|
|
137
143
|
|
|
138
144
|
program
|
|
@@ -186,6 +192,8 @@ Example call:
|
|
|
186
192
|
'field name(s) to order the results by (prefix "-" for descending)'
|
|
187
193
|
)
|
|
188
194
|
)
|
|
195
|
+
.addOption(latest)
|
|
196
|
+
.addOption(versionStatus)
|
|
189
197
|
.addOption(delivery);
|
|
190
198
|
|
|
191
199
|
sharedGetEntryOptions(
|
|
@@ -27,7 +27,9 @@ export const mapContensisOpts = (opts: any = {}): MigrateRequest => ({
|
|
|
27
27
|
opts.assetType ||
|
|
28
28
|
opts.contentType ||
|
|
29
29
|
opts.dataFormat ||
|
|
30
|
-
opts.deliveryApi
|
|
30
|
+
opts.deliveryApi ||
|
|
31
|
+
opts.latest ||
|
|
32
|
+
opts.versionStatus
|
|
31
33
|
? {
|
|
32
34
|
assetTypes: opts.assetType,
|
|
33
35
|
contentTypeIds: opts.contentType,
|
|
@@ -38,11 +40,13 @@ export const mapContensisOpts = (opts: any = {}): MigrateRequest => ({
|
|
|
38
40
|
orderBy: opts.orderBy,
|
|
39
41
|
searchTerm: opts.search,
|
|
40
42
|
useDelivery: opts.deliveryApi,
|
|
43
|
+
versionStatus: opts.latest ? 'latest' : opts.versionStatus,
|
|
41
44
|
}
|
|
42
45
|
: undefined,
|
|
43
46
|
zenQL: opts.zenql,
|
|
44
47
|
transformGuids: !opts.preserveGuids,
|
|
45
48
|
ignoreErrors: opts.ignoreErrors,
|
|
49
|
+
noCache: !opts.cache,
|
|
46
50
|
concurrency: opts.concurrency ? Number(opts.concurrency) : undefined,
|
|
47
51
|
});
|
|
48
52
|
|
|
@@ -91,10 +95,10 @@ export const delivery = new Option(
|
|
|
91
95
|
'-delivery --delivery-api',
|
|
92
96
|
'use delivery api to get the entries'
|
|
93
97
|
);
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
+
export const search = new Option(
|
|
99
|
+
'--search <phrase>',
|
|
100
|
+
'get entries with the search phrase, use quotes for multiple words'
|
|
101
|
+
);
|
|
98
102
|
export const zenql = new Option(
|
|
99
103
|
'-q --zenql <zenql>',
|
|
100
104
|
'get entries with a supplied ZenQL statement'
|
|
@@ -109,6 +113,14 @@ export const assetTypes = new Option(
|
|
|
109
113
|
'-at --asset-type <assetType...>',
|
|
110
114
|
'get assets of given content type(s) e.g. image word pdf'
|
|
111
115
|
);
|
|
116
|
+
export const versionStatus = new Option(
|
|
117
|
+
'-vs --version-status <versionStatus>',
|
|
118
|
+
'the entry versions to get'
|
|
119
|
+
)
|
|
120
|
+
.choices(['latest', 'published'])
|
|
121
|
+
.default('published');
|
|
122
|
+
|
|
123
|
+
export const latest = new Option('--latest', 'get the latest entry versions');
|
|
112
124
|
|
|
113
125
|
/* Import options */
|
|
114
126
|
export const fromFile = new Option(
|
|
@@ -142,11 +154,21 @@ export const outputEntries = new Option(
|
|
|
142
154
|
.choices(['errors', 'changes', 'all'])
|
|
143
155
|
.default('errors');
|
|
144
156
|
|
|
157
|
+
export const saveEntries = new Option(
|
|
158
|
+
'-save --save-entries',
|
|
159
|
+
"save the entries we're migrating instead of the migration preview when using --output option"
|
|
160
|
+
);
|
|
161
|
+
|
|
145
162
|
export const concurrency = new Option(
|
|
146
163
|
'-conc --concurrency <concurrency>',
|
|
147
164
|
'the number of entries to load in parallel'
|
|
148
165
|
).default(2);
|
|
149
166
|
|
|
167
|
+
export const noCache = new Option(
|
|
168
|
+
'--no-cache',
|
|
169
|
+
'add this flag to ignore internal cache and rebuild all resources from scratch'
|
|
170
|
+
);
|
|
171
|
+
|
|
150
172
|
export const addConnectOptions = (program: Command) =>
|
|
151
173
|
program.addOption(alias.hideHelp()).addOption(project.hideHelp());
|
|
152
174
|
|
|
@@ -167,13 +189,6 @@ export const addImportOptions = (program: Command) => {
|
|
|
167
189
|
return program;
|
|
168
190
|
};
|
|
169
191
|
|
|
170
|
-
export const getEntryOptions = (command: Command) =>
|
|
171
|
-
command
|
|
172
|
-
.addOption(entryId)
|
|
173
|
-
.addOption(zenql)
|
|
174
|
-
.addOption(contentTypes)
|
|
175
|
-
.addOption(assetTypes);
|
|
176
|
-
|
|
177
192
|
export const addGlobalOptions = (program: Command) => {
|
|
178
193
|
for (const command of program.commands) {
|
|
179
194
|
addOutputAndFormatOptions(command);
|
package/src/commands/import.ts
CHANGED
|
@@ -1,12 +1,19 @@
|
|
|
1
1
|
import { Command, Option } from 'commander';
|
|
2
2
|
import { cliCommand } from '~/services/ContensisCliService';
|
|
3
3
|
import {
|
|
4
|
+
assetTypes,
|
|
4
5
|
commit,
|
|
5
6
|
concurrency,
|
|
6
|
-
|
|
7
|
+
contentTypes,
|
|
8
|
+
entryId,
|
|
7
9
|
ignoreErrors,
|
|
10
|
+
latest,
|
|
8
11
|
mapContensisOpts,
|
|
12
|
+
noCache,
|
|
9
13
|
outputEntries,
|
|
14
|
+
saveEntries,
|
|
15
|
+
versionStatus,
|
|
16
|
+
zenql,
|
|
10
17
|
} from './globalOptions';
|
|
11
18
|
|
|
12
19
|
export const makeImportCommand = () => {
|
|
@@ -21,6 +28,7 @@ export const makeImportCommand = () => {
|
|
|
21
28
|
.command('models')
|
|
22
29
|
.description('import complete content models')
|
|
23
30
|
.argument('[modelIds...]', 'ids of the content models to import (optional)')
|
|
31
|
+
.addOption(noCache)
|
|
24
32
|
.addOption(commit)
|
|
25
33
|
.addHelpText(
|
|
26
34
|
'after',
|
|
@@ -101,15 +109,19 @@ Example call:
|
|
|
101
109
|
);
|
|
102
110
|
});
|
|
103
111
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
112
|
+
program
|
|
113
|
+
.command('entries')
|
|
114
|
+
.description('import entries')
|
|
115
|
+
.argument(
|
|
116
|
+
'[search phrase]',
|
|
117
|
+
'get entries with the search phrase, use quotes for multiple words'
|
|
118
|
+
)
|
|
119
|
+
.addOption(entryId)
|
|
120
|
+
.addOption(zenql)
|
|
121
|
+
.addOption(contentTypes)
|
|
122
|
+
.addOption(assetTypes)
|
|
123
|
+
.addOption(latest)
|
|
124
|
+
.addOption(versionStatus)
|
|
113
125
|
.addOption(commit)
|
|
114
126
|
.option(
|
|
115
127
|
'-preserve --preserve-guids',
|
|
@@ -118,6 +130,8 @@ Example call:
|
|
|
118
130
|
.addOption(concurrency)
|
|
119
131
|
.addOption(outputEntries)
|
|
120
132
|
.addOption(ignoreErrors)
|
|
133
|
+
.addOption(noCache)
|
|
134
|
+
.addOption(saveEntries)
|
|
121
135
|
.addHelpText(
|
|
122
136
|
'after',
|
|
123
137
|
`
|
|
@@ -135,6 +149,7 @@ Example call:
|
|
|
135
149
|
commit: opts.commit,
|
|
136
150
|
fromFile: opts.fromFile,
|
|
137
151
|
logOutput: opts.outputEntries,
|
|
152
|
+
saveEntries: opts.saveEntries,
|
|
138
153
|
});
|
|
139
154
|
});
|
|
140
155
|
|
package/src/commands/index.ts
CHANGED
|
@@ -58,14 +58,14 @@ const commands = () => {
|
|
|
58
58
|
addAuthenticationOptions(makeDevCommand())
|
|
59
59
|
).copyInheritedSettings(program)
|
|
60
60
|
);
|
|
61
|
-
program.addCommand(
|
|
62
|
-
addGlobalOptions(makeExecuteCommand()).copyInheritedSettings(program)
|
|
63
|
-
);
|
|
64
61
|
program.addCommand(
|
|
65
62
|
addGlobalOptions(addImportOptions(makeDiffCommand())).copyInheritedSettings(
|
|
66
63
|
program
|
|
67
64
|
)
|
|
68
65
|
);
|
|
66
|
+
program.addCommand(
|
|
67
|
+
addGlobalOptions(makeExecuteCommand()).copyInheritedSettings(program)
|
|
68
|
+
);
|
|
69
69
|
program.addCommand(
|
|
70
70
|
addGlobalOptions(makeGetCommand()).copyInheritedSettings(program)
|
|
71
71
|
);
|
package/src/commands/list.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Command } from 'commander';
|
|
2
2
|
import { cliCommand } from '~/services/ContensisCliService';
|
|
3
|
+
import { mapContensisOpts, noCache } from './globalOptions';
|
|
3
4
|
|
|
4
5
|
export const makeListCommand = () => {
|
|
5
6
|
const list = new Command()
|
|
@@ -40,6 +41,7 @@ Example call:
|
|
|
40
41
|
list
|
|
41
42
|
.command('models')
|
|
42
43
|
.description('print list of content models')
|
|
44
|
+
.addOption(noCache)
|
|
43
45
|
.addHelpText(
|
|
44
46
|
'after',
|
|
45
47
|
`
|
|
@@ -48,7 +50,11 @@ Example call:
|
|
|
48
50
|
`
|
|
49
51
|
)
|
|
50
52
|
.action(async opts => {
|
|
51
|
-
await cliCommand(
|
|
53
|
+
await cliCommand(
|
|
54
|
+
['list', 'models'],
|
|
55
|
+
opts,
|
|
56
|
+
mapContensisOpts(opts)
|
|
57
|
+
).PrintContentModels();
|
|
52
58
|
});
|
|
53
59
|
|
|
54
60
|
list
|
|
@@ -1181,7 +1181,10 @@ class ContensisCli {
|
|
|
1181
1181
|
}
|
|
1182
1182
|
};
|
|
1183
1183
|
|
|
1184
|
-
PrintContentModels = async (
|
|
1184
|
+
PrintContentModels = async (
|
|
1185
|
+
modelIds: string[] = [],
|
|
1186
|
+
printRequiredBy?: boolean
|
|
1187
|
+
) => {
|
|
1185
1188
|
const { currentProject, log, messages } = this;
|
|
1186
1189
|
const contensis = await this.ConnectContensis();
|
|
1187
1190
|
if (contensis) {
|
|
@@ -1231,6 +1234,15 @@ class ContensisCli {
|
|
|
1231
1234
|
await this.HandleFormattingAndOutput(contentModelBackup, () => {
|
|
1232
1235
|
// print the content models to console
|
|
1233
1236
|
for (const model of returnModels) {
|
|
1237
|
+
if (!printRequiredBy) {
|
|
1238
|
+
// truncate parts of the output
|
|
1239
|
+
delete model.dependencyOf;
|
|
1240
|
+
if (model.dependencies?.contentTypes)
|
|
1241
|
+
model.dependencies.contentTypes.forEach(id => (id[1] = []));
|
|
1242
|
+
if (model.dependencies?.components)
|
|
1243
|
+
model.dependencies.components.forEach(id => (id[1] = []));
|
|
1244
|
+
}
|
|
1245
|
+
|
|
1234
1246
|
log.raw('');
|
|
1235
1247
|
log.object(model);
|
|
1236
1248
|
}
|
|
@@ -1745,10 +1757,12 @@ class ContensisCli {
|
|
|
1745
1757
|
commit,
|
|
1746
1758
|
fromFile,
|
|
1747
1759
|
logOutput,
|
|
1760
|
+
saveEntries,
|
|
1748
1761
|
}: {
|
|
1749
1762
|
commit: boolean;
|
|
1750
1763
|
fromFile: string;
|
|
1751
1764
|
logOutput: string;
|
|
1765
|
+
saveEntries: boolean;
|
|
1752
1766
|
}) => {
|
|
1753
1767
|
const { currentEnv, currentProject, log, messages } = this;
|
|
1754
1768
|
|
|
@@ -1769,8 +1783,13 @@ class ContensisCli {
|
|
|
1769
1783
|
const [err, result] = await contensis.MigrateEntries();
|
|
1770
1784
|
|
|
1771
1785
|
if (err) logError(err);
|
|
1772
|
-
else
|
|
1773
|
-
|
|
1786
|
+
else {
|
|
1787
|
+
const output = saveEntries
|
|
1788
|
+
? contensis.content.targets[currentProject].migrateEntries?.map(
|
|
1789
|
+
me => me.finalEntry
|
|
1790
|
+
)
|
|
1791
|
+
: result;
|
|
1792
|
+
await this.HandleFormattingAndOutput(output, () => {
|
|
1774
1793
|
// print the migrateResult to console
|
|
1775
1794
|
printEntriesMigrateResult(this, result, {
|
|
1776
1795
|
showAll: logOutput === 'all',
|
|
@@ -1778,7 +1797,7 @@ class ContensisCli {
|
|
|
1778
1797
|
showChanged: logOutput === 'changes',
|
|
1779
1798
|
});
|
|
1780
1799
|
});
|
|
1781
|
-
|
|
1800
|
+
}
|
|
1782
1801
|
if (
|
|
1783
1802
|
!err &&
|
|
1784
1803
|
!result.errors?.length &&
|
package/src/util/logger.ts
CHANGED
|
@@ -192,8 +192,9 @@ export class Logger {
|
|
|
192
192
|
for (const item of content) {
|
|
193
193
|
if (item && typeof item === 'object') {
|
|
194
194
|
if (Array.isArray(item) && depth > 3)
|
|
195
|
-
|
|
196
|
-
|
|
195
|
+
if (item.length)
|
|
196
|
+
Logger.raw(chalk.grey(`${indent} [${item.join(', ')}]`));
|
|
197
|
+
else Logger.objectRecurse(item, depth + 1, `${indent} `);
|
|
197
198
|
} else Logger.raw(`${indent}${item}`);
|
|
198
199
|
}
|
|
199
200
|
} else {
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const LIB_VERSION = "1.2.1";
|
|
1
|
+
export const LIB_VERSION = "1.2.2-beta.1";
|