contensis-cli 1.0.0-beta.10 → 1.0.0-beta.100
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 +1146 -78
- package/cli.js +3 -0
- package/dist/commands/connect.js +3 -3
- package/dist/commands/connect.js.map +2 -2
- package/dist/commands/create.js +45 -10
- package/dist/commands/create.js.map +2 -2
- package/dist/commands/dev.js +71 -0
- package/dist/commands/dev.js.map +7 -0
- package/dist/commands/diff.js +57 -0
- package/dist/commands/diff.js.map +7 -0
- package/dist/commands/execute.js +103 -0
- package/dist/commands/execute.js.map +7 -0
- package/dist/commands/get.js +169 -32
- package/dist/commands/get.js.map +3 -3
- package/dist/commands/globalOptions.js +37 -12
- package/dist/commands/globalOptions.js.map +2 -2
- package/dist/commands/import.js +65 -12
- package/dist/commands/import.js.map +2 -2
- package/dist/commands/index.js +22 -2
- package/dist/commands/index.js.map +2 -2
- package/dist/commands/list.js +53 -10
- package/dist/commands/list.js.map +2 -2
- package/dist/commands/login.js +2 -2
- package/dist/commands/login.js.map +2 -2
- package/dist/commands/push.js +17 -13
- package/dist/commands/push.js.map +2 -2
- package/dist/commands/remove.js +51 -8
- package/dist/commands/remove.js.map +2 -2
- package/dist/commands/set.js +139 -12
- package/dist/commands/set.js.map +2 -2
- package/dist/index.js +1 -1
- package/dist/index.js.map +2 -2
- package/dist/localisation/en-GB.js +297 -49
- package/dist/localisation/en-GB.js.map +2 -2
- package/dist/mappers/ContensisCliService-to-RequestHanderSiteConfigYaml.js +56 -0
- package/dist/mappers/ContensisCliService-to-RequestHanderSiteConfigYaml.js.map +7 -0
- package/dist/mappers/DevInit-to-CIWorkflow.js +374 -0
- package/dist/mappers/DevInit-to-CIWorkflow.js.map +7 -0
- package/dist/mappers/DevInit-to-RolePermissions.js +56 -0
- package/dist/mappers/DevInit-to-RolePermissions.js.map +7 -0
- package/dist/mappers/DevRequests-to-RequestHanderSiteConfigYaml.js +56 -0
- package/dist/mappers/DevRequests-to-RequestHanderSiteConfigYaml.js.map +7 -0
- package/dist/models/CliService.d.js +17 -0
- package/dist/models/CliService.d.js.map +7 -0
- package/dist/models/DevService.d.js +17 -0
- package/dist/models/DevService.d.js.map +7 -0
- package/dist/providers/CredentialProvider.js +46 -14
- package/dist/providers/CredentialProvider.js.map +3 -3
- package/dist/providers/SessionCacheProvider.js +21 -1
- package/dist/providers/SessionCacheProvider.js.map +2 -2
- package/dist/providers/file-provider.js +12 -6
- package/dist/providers/file-provider.js.map +3 -3
- package/dist/services/ContensisCliService.js +1211 -420
- package/dist/services/ContensisCliService.js.map +3 -3
- package/dist/services/ContensisDevService.js +368 -0
- package/dist/services/ContensisDevService.js.map +7 -0
- package/dist/services/ContensisRoleService.js +114 -0
- package/dist/services/ContensisRoleService.js.map +7 -0
- package/dist/shell.js +58 -18
- package/dist/shell.js.map +3 -3
- package/dist/util/console.printer.js +171 -55
- package/dist/util/console.printer.js.map +2 -2
- package/dist/util/diff.js +116 -0
- package/dist/util/diff.js.map +7 -0
- package/dist/util/dotenv.js +57 -0
- package/dist/util/dotenv.js.map +7 -0
- package/dist/util/find.js +31 -0
- package/dist/util/find.js.map +7 -0
- package/dist/util/git.js +128 -0
- package/dist/util/git.js.map +7 -0
- package/dist/util/index.js +8 -2
- package/dist/util/index.js.map +3 -3
- package/dist/util/logger.js +90 -29
- package/dist/util/logger.js.map +3 -3
- package/dist/util/os.js +42 -0
- package/dist/util/os.js.map +7 -0
- package/dist/util/timers.js +49 -0
- package/dist/util/timers.js.map +7 -0
- package/dist/util/yaml.js +45 -0
- package/dist/util/yaml.js.map +7 -0
- package/dist/version.js +1 -1
- package/dist/version.js.map +1 -1
- package/esbuild.config.js +3 -1
- package/package.json +14 -3
- package/src/commands/connect.ts +3 -2
- package/src/commands/create.ts +61 -8
- package/src/commands/dev.ts +69 -0
- package/src/commands/diff.ts +41 -0
- package/src/commands/execute.ts +117 -0
- package/src/commands/get.ts +242 -28
- package/src/commands/globalOptions.ts +42 -12
- package/src/commands/import.ts +83 -8
- package/src/commands/index.ts +22 -1
- package/src/commands/list.ts +85 -11
- package/src/commands/login.ts +2 -1
- package/src/commands/push.ts +18 -11
- package/src/commands/remove.ts +66 -4
- package/src/commands/set.ts +189 -9
- package/src/index.ts +1 -4
- package/src/localisation/en-GB.ts +428 -66
- package/src/mappers/ContensisCliService-to-RequestHanderSiteConfigYaml.ts +44 -0
- package/src/mappers/DevInit-to-CIWorkflow.ts +526 -0
- package/src/mappers/DevInit-to-RolePermissions.ts +32 -0
- package/src/mappers/DevRequests-to-RequestHanderSiteConfigYaml.ts +44 -0
- package/src/models/CliService.d.ts +36 -0
- package/src/models/DevService.d.ts +40 -0
- package/src/models/JsModules.d.ts +2 -0
- package/src/providers/CredentialProvider.ts +51 -18
- package/src/providers/SessionCacheProvider.ts +29 -2
- package/src/providers/file-provider.ts +17 -6
- package/src/services/ContensisCliService.ts +1532 -508
- package/src/services/ContensisDevService.ts +434 -0
- package/src/services/ContensisRoleService.ts +108 -0
- package/src/shell.ts +68 -18
- package/src/util/console.printer.ts +240 -78
- package/src/util/diff.ts +124 -0
- package/src/util/dotenv.ts +37 -0
- package/src/util/find.ts +8 -0
- package/src/util/git.ts +131 -0
- package/src/util/index.ts +16 -7
- package/src/util/logger.ts +145 -31
- package/src/util/os.ts +12 -0
- package/src/util/timers.ts +24 -0
- package/src/util/yaml.ts +13 -0
- package/src/version.ts +1 -1
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 ProgressBar from 'progress';\nimport { tryStringify } from '.';\n\ntype LogMethod = (content: string) => void;\ntype LogErrorMethod = (content: string, err?: any) => void;\ntype LogJsonMethod = (content: any) => 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) => {\n const message = `${Logger.getPrefix()} ${Logger.errorText(\n `${Logger.isUserTerminal ? '\u274C' : '[ERROR]'} ${content}${\n err ? `\\n\\n${JSON.stringify(err, null, 2)}` : ''\n }`\n )}\\n`;\n if (progress.active) progress.current.interrupt(message);\n else console.log(message);\n };\n static warning: LogMethod = content => {\n // if (process.env.DEBUG === 'true') {\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 json: LogJsonMethod = (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)}: ${chalk.grey(field.dataType)}`\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 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 Logger.raw(` ${chalk.bold.grey(key)}: ${value}`);\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\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 ('stack' in error) Logger.raw(` ${Logger.infoText(error.stack)}`);\n if ('data' in error)\n Logger.raw(` ${Logger.infoText(tryStringify(error.data))}`);\n });\n //Logger.line();\n return null;\n};\n\nexport const progress = {\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;AACA,mBAAkB;AAClB,wBAAuB;AACvB,0BAAwB;AACxB,
|
|
6
|
-
"names": ["dateFormat", "chalk", "deepCleaner"
|
|
4
|
+
"sourcesContent": ["/* eslint-disable no-console */\nimport chalk from 'chalk';\nimport dateFormat from 'dateformat';\nimport deepCleaner from 'deep-cleaner';\nimport { ansiEscapeCodes, first, strlen } 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 // if (process.env.DEBUG === 'true') {\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 = (content: string, displayLength = 30) => {\n const consoleWidth = process.stdout.columns;\n console.info(\n consoleWidth\n ? content\n .split('\\n')\n .slice(0, consoleWidth ? displayLength : undefined)\n .map((line: string) =>\n consoleWidth && strlen(line) > consoleWidth\n ? first(line, consoleWidth)\n : line\n )\n .join('\\n')\n : content.replace(ansiEscapeCodes, '')\n );\n const tableArray = content.split('\\n');\n if (consoleWidth && tableArray.length > displayLength)\n console.info(`\\n`, `- and ${tableArray.length - displayLength} more...`);\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 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;AACA,mBAAkB;AAClB,wBAAuB;AACvB,0BAAwB;AACxB,kCAA+C;AAE/C,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;AAAA,EACA,OAAO,YAAY,aAAAC,QAAM,KAAK;AAAA,EAC9B,OAAO,cAAc,aAAAA,QAAM,QAAQ,QAAQ;AAAA,EAC3C,OAAO,cAAc,aAAAA,QAAM,QAAQ,OAAO;AAAA,EAC1C,OAAO,WAAW,aAAAA,QAAM;AAAA,EACxB,OAAO,gBAAgB,aAAAA,QAAM;AAAA,EAC7B,OAA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,mBAAW,YAAW,IAAI,OAAO;AACrE,GAAC,MAAM,QAAQ,GAAG,IAAI,MAAM,CAAC,GAAG,GAAG,IAAI,CAAC,UAAoB;AAC1D,QAAI,OAAO,UAAU,UAAU;AAC7B,aAAO,IAAI,GAAG,OAAO,SAAS,KAAK;AAAA,CAAK;AACxC;AAAA,IACF;AACA,QAAI,WAAW;AAAO,aAAO,IAAI,KAAK,OAAO,SAAS,MAAM,KAAK;AAAA,CAAK;AACtE,QAAI,UAAU;AACZ,aAAO,IAAI,KAAK,OAAO,aAAS,uBAAa,MAAM,IAAI,CAAC;AAAA,CAAK;AAAA,EACjE,CAAC;AAED,SAAO;AACT;AAEO,MAAM,WAAW;AAAA,EACtB,SAAS,EAAE,WAAW,CAAC,MAAc;AAAA,EAAC,EAAE;AAAA,EACxC,QAAQ;AASV;",
|
|
6
|
+
"names": ["dateFormat", "chalk", "deepCleaner"]
|
|
7
7
|
}
|
package/dist/util/os.js
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
+
mod
|
|
23
|
+
));
|
|
24
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
25
|
+
var os_exports = {};
|
|
26
|
+
__export(os_exports, {
|
|
27
|
+
linuxSlash: () => linuxSlash,
|
|
28
|
+
normaliseLineEndings: () => normaliseLineEndings,
|
|
29
|
+
winSlash: () => winSlash
|
|
30
|
+
});
|
|
31
|
+
module.exports = __toCommonJS(os_exports);
|
|
32
|
+
var import_os = __toESM(require("os"));
|
|
33
|
+
const winSlash = (str) => import_os.default.platform() === "win32" ? str.replaceAll("/", "\\") : str;
|
|
34
|
+
const linuxSlash = (str) => import_os.default.platform() === "win32" ? str.replaceAll("\\", "/") : str;
|
|
35
|
+
const normaliseLineEndings = (str, lineEnd = import_os.default.platform() === "win32" ? "\r\n" : "n") => str.replace(/\r?\n/g, lineEnd);
|
|
36
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
37
|
+
0 && (module.exports = {
|
|
38
|
+
linuxSlash,
|
|
39
|
+
normaliseLineEndings,
|
|
40
|
+
winSlash
|
|
41
|
+
});
|
|
42
|
+
//# sourceMappingURL=os.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/util/os.ts"],
|
|
4
|
+
"sourcesContent": ["import os from 'os';\n\nexport const winSlash = (str: string) =>\n os.platform() === 'win32' ? str.replaceAll('/', '\\\\') : str;\n\nexport const linuxSlash = (str: string) =>\n os.platform() === 'win32' ? str.replaceAll('\\\\', '/') : str;\n\nexport const normaliseLineEndings = (\n str: string,\n lineEnd = os.platform() === 'win32' ? '\\r\\n' : 'n'\n) => str.replace(/\\r?\\n/g, lineEnd);\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gBAAe;AAER,MAAM,WAAW,CAAC,QACvB,UAAAA,QAAG,SAAS,MAAM,UAAU,IAAI,WAAW,KAAK,IAAI,IAAI;AAEnD,MAAM,aAAa,CAAC,QACzB,UAAAA,QAAG,SAAS,MAAM,UAAU,IAAI,WAAW,MAAM,GAAG,IAAI;AAEnD,MAAM,uBAAuB,CAClC,KACA,UAAU,UAAAA,QAAG,SAAS,MAAM,UAAU,SAAS,QAC5C,IAAI,QAAQ,UAAU,OAAO;",
|
|
6
|
+
"names": ["os"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var timers_exports = {};
|
|
20
|
+
__export(timers_exports, {
|
|
21
|
+
promiseDelay: () => promiseDelay
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(timers_exports);
|
|
24
|
+
const promiseDelay = (delay, value) => {
|
|
25
|
+
let timeout;
|
|
26
|
+
let _reject;
|
|
27
|
+
const wait = () => new Promise((resolve, reject) => {
|
|
28
|
+
_reject = reject;
|
|
29
|
+
timeout = setTimeout(resolve, delay, value);
|
|
30
|
+
});
|
|
31
|
+
const promise = wait();
|
|
32
|
+
return {
|
|
33
|
+
promise,
|
|
34
|
+
cancel() {
|
|
35
|
+
if (timeout) {
|
|
36
|
+
clearTimeout(timeout);
|
|
37
|
+
timeout = null;
|
|
38
|
+
_reject();
|
|
39
|
+
_reject = null;
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
wait
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
46
|
+
0 && (module.exports = {
|
|
47
|
+
promiseDelay
|
|
48
|
+
});
|
|
49
|
+
//# sourceMappingURL=timers.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/util/timers.ts"],
|
|
4
|
+
"sourcesContent": ["export const promiseDelay = (delay: number, value: any) => {\n let timeout: NodeJS.Timeout | null;\n let _reject: PromiseRejectionEvent['reason'];\n\n const wait = () =>\n new Promise((resolve, reject) => {\n _reject = reject;\n timeout = setTimeout(resolve, delay, value);\n });\n\n const promise = wait();\n return {\n promise,\n cancel() {\n if (timeout) {\n clearTimeout(timeout);\n timeout = null;\n _reject();\n _reject = null;\n }\n },\n wait,\n };\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,MAAM,eAAe,CAAC,OAAe,UAAe;AACzD,MAAI;AACJ,MAAI;AAEJ,QAAM,OAAO,MACX,IAAI,QAAQ,CAAC,SAAS,WAAW;AAC/B,cAAU;AACV,cAAU,WAAW,SAAS,OAAO,KAAK;AAAA,EAC5C,CAAC;AAEH,QAAM,UAAU,KAAK;AACrB,SAAO;AAAA,IACL;AAAA,IACA,SAAS;AACP,UAAI,SAAS;AACX,qBAAa,OAAO;AACpB,kBAAU;AACV,gBAAQ;AACR,kBAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA;AAAA,EACF;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var yaml_exports = {};
|
|
20
|
+
__export(yaml_exports, {
|
|
21
|
+
parseYaml: () => parseYaml,
|
|
22
|
+
parseYamlDocument: () => parseYamlDocument,
|
|
23
|
+
stringifyYaml: () => stringifyYaml,
|
|
24
|
+
validateWorkflowYaml: () => validateWorkflowYaml
|
|
25
|
+
});
|
|
26
|
+
module.exports = __toCommonJS(yaml_exports);
|
|
27
|
+
var import_core = require("@action-validator/core");
|
|
28
|
+
var import_yaml = require("yaml");
|
|
29
|
+
const parseYaml = import_yaml.parse;
|
|
30
|
+
const parseYamlDocument = import_yaml.parseDocument;
|
|
31
|
+
const stringifyYaml = import_yaml.stringify;
|
|
32
|
+
const validateWorkflowYaml = (yaml) => {
|
|
33
|
+
const { actionType, errors } = (0, import_core.validateWorkflow)(yaml);
|
|
34
|
+
if (actionType && errors.length === 0)
|
|
35
|
+
return true;
|
|
36
|
+
return errors;
|
|
37
|
+
};
|
|
38
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
39
|
+
0 && (module.exports = {
|
|
40
|
+
parseYaml,
|
|
41
|
+
parseYamlDocument,
|
|
42
|
+
stringifyYaml,
|
|
43
|
+
validateWorkflowYaml
|
|
44
|
+
});
|
|
45
|
+
//# sourceMappingURL=yaml.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/util/yaml.ts"],
|
|
4
|
+
"sourcesContent": ["import { validateWorkflow } from '@action-validator/core';\n\nimport { parse, parseDocument, stringify } from 'yaml';\n\nexport const parseYaml = parse;\nexport const parseYamlDocument = parseDocument;\nexport const stringifyYaml = stringify;\n\nexport const validateWorkflowYaml = (yaml: string) => {\n const { actionType, errors } = validateWorkflow(yaml);\n if (actionType && errors.length === 0) return true;\n return errors;\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAiC;AAEjC,kBAAgD;AAEzC,MAAM,YAAY;AAClB,MAAM,oBAAoB;AAC1B,MAAM,gBAAgB;AAEtB,MAAM,uBAAuB,CAAC,SAAiB;AACpD,QAAM,EAAE,YAAY,OAAO,QAAI,8BAAiB,IAAI;AACpD,MAAI,cAAc,OAAO,WAAW;AAAG,WAAO;AAC9C,SAAO;AACT;",
|
|
6
|
+
"names": []
|
|
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.0.0-beta.
|
|
24
|
+
const LIB_VERSION = "1.0.0-beta.100";
|
|
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.0.0-beta.
|
|
4
|
+
"sourcesContent": ["export const LIB_VERSION = \"1.0.0-beta.100\";\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,MAAM,cAAc;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/esbuild.config.js
CHANGED
|
@@ -23,7 +23,9 @@ rimraf('./dist', () => {
|
|
|
23
23
|
platform: 'node',
|
|
24
24
|
format: 'cjs',
|
|
25
25
|
sourcemap: true,
|
|
26
|
-
|
|
26
|
+
// needs to be node12 to transform dynamic imports into requires
|
|
27
|
+
// so the bundles are compatible with the pkg exe builds
|
|
28
|
+
target: 'node12',
|
|
27
29
|
plugins: [globPlugin(), nodeExternalsPlugin()],
|
|
28
30
|
watch: watch && {
|
|
29
31
|
onRebuild(error) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "contensis-cli",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.100",
|
|
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/node-cli",
|
|
6
6
|
"homepage": "https://github.com/contensis/node-cli/tree/main/packages/contensis-cli#readme",
|
|
@@ -23,30 +23,41 @@
|
|
|
23
23
|
"author": "Zengenti",
|
|
24
24
|
"license": "ISC",
|
|
25
25
|
"dependencies": {
|
|
26
|
+
"@action-validator/core": "^0.5.3",
|
|
26
27
|
"app-root-path": "^3.1.0",
|
|
27
28
|
"chalk": "^4.1.2",
|
|
28
29
|
"commander": "^9.4.1",
|
|
30
|
+
"contensis-management-api": "^2.1.2",
|
|
29
31
|
"csv": "^6.1.0",
|
|
30
32
|
"dayjs": "^1.11.6",
|
|
33
|
+
"diff": "^5.1.0",
|
|
31
34
|
"figlet": "^1.5.2",
|
|
32
35
|
"flat": "^5.0.2",
|
|
36
|
+
"giturl": "^2.0.0",
|
|
37
|
+
"hosted-git-info": "^6.1.1",
|
|
33
38
|
"inquirer-command-prompt": "^0.1.0",
|
|
34
39
|
"json2csv": "^5.0.7",
|
|
35
40
|
"jsonpath-mapper": "^1.1.0",
|
|
36
41
|
"keytar": "^7.9.0",
|
|
37
42
|
"lodash": "^4.17.21",
|
|
38
|
-
"migratortron": "^1.0.0-beta.
|
|
43
|
+
"migratortron": "^1.0.0-beta.32",
|
|
44
|
+
"nanospinner": "^1.1.0",
|
|
39
45
|
"node-fetch": "^2.6.7",
|
|
46
|
+
"parse-git-config": "^3.0.0",
|
|
40
47
|
"patch-package": "^6.4.7",
|
|
41
|
-
"
|
|
48
|
+
"printable-characters": "^1.0.42",
|
|
49
|
+
"xml2js": "^0.4.23",
|
|
50
|
+
"yaml": "^2.3.1"
|
|
42
51
|
},
|
|
43
52
|
"devDependencies": {
|
|
44
53
|
"@types/figlet": "^1.5.4",
|
|
45
54
|
"@types/flat": "^5.0.2",
|
|
55
|
+
"@types/hosted-git-info": "^3.0.2",
|
|
46
56
|
"@types/inquirer": "^8.2.1",
|
|
47
57
|
"@types/json2csv": "^5.0.3",
|
|
48
58
|
"@types/lodash": "^4.14.182",
|
|
49
59
|
"@types/node-fetch": "^2.6.1",
|
|
60
|
+
"@types/parse-git-config": "^3.0.1",
|
|
50
61
|
"@types/xml2js": "^0.4.11",
|
|
51
62
|
"esbuild": "^0.14.43",
|
|
52
63
|
"esbuild-node-externals": "^1.4.1",
|
package/src/commands/connect.ts
CHANGED
|
@@ -6,6 +6,7 @@ import { project } from './globalOptions';
|
|
|
6
6
|
export const makeConnectCommand = () => {
|
|
7
7
|
const connect = new Command()
|
|
8
8
|
.command('connect')
|
|
9
|
+
.description('connect to a Contensis instance')
|
|
9
10
|
.argument('<alias>', 'the Contensis Cloud alias to connect with')
|
|
10
11
|
.addOption(project)
|
|
11
12
|
.usage('<alias>')
|
|
@@ -16,8 +17,8 @@ Example call:
|
|
|
16
17
|
> connect example-dev`
|
|
17
18
|
)
|
|
18
19
|
.action(async (alias, opts) => {
|
|
19
|
-
await cliCommand(['connect', alias], opts).Connect(alias);
|
|
20
|
-
await shell().
|
|
20
|
+
await cliCommand(['connect', alias], { ...opts, alias }).Connect(alias);
|
|
21
|
+
await shell().restart();
|
|
21
22
|
});
|
|
22
23
|
return connect;
|
|
23
24
|
};
|
package/src/commands/create.ts
CHANGED
|
@@ -1,26 +1,57 @@
|
|
|
1
1
|
import { Command } from 'commander';
|
|
2
|
+
import { Project } from 'contensis-core-api';
|
|
2
3
|
import { cliCommand } from '~/services/ContensisCliService';
|
|
3
4
|
import { shell } from '~/shell';
|
|
5
|
+
import { isUuid } from '~/util';
|
|
4
6
|
|
|
5
7
|
export const makeCreateCommand = () => {
|
|
6
8
|
const create = new Command()
|
|
7
9
|
.command('create')
|
|
10
|
+
.description('create command')
|
|
11
|
+
.addHelpText('after', `\n`)
|
|
8
12
|
.showHelpAfterError(true)
|
|
9
13
|
.exitOverride();
|
|
10
14
|
|
|
11
15
|
create
|
|
12
16
|
.command('project')
|
|
17
|
+
.description('create a new project')
|
|
13
18
|
.argument('<projectId>', 'the id of the project to create')
|
|
14
|
-
.
|
|
15
|
-
.
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
.argument('<name>', 'the name of the project to create')
|
|
20
|
+
.argument('[description]', 'optional description of the project')
|
|
21
|
+
.option(
|
|
22
|
+
'-l --language',
|
|
23
|
+
'the default language of the project to create',
|
|
24
|
+
'en-GB'
|
|
25
|
+
)
|
|
26
|
+
.option(
|
|
27
|
+
'-langs --supported-languages <langs...>',
|
|
28
|
+
'space separated list of other supported languages'
|
|
29
|
+
)
|
|
30
|
+
.usage(
|
|
31
|
+
'projectId "Project name" ["Description of project"] --language en-GB --supported-languages es-ES de-DE nl-NL'
|
|
32
|
+
)
|
|
33
|
+
.addHelpText('after', `\n`)
|
|
34
|
+
.action(
|
|
35
|
+
async (projectId: string, name: string, description = '', opts: any) => {
|
|
36
|
+
const createProject: Project = {
|
|
37
|
+
id: projectId,
|
|
38
|
+
name,
|
|
39
|
+
description,
|
|
40
|
+
primaryLanguage: opts.language,
|
|
41
|
+
supportedLanguages: opts.supportedLanguages || [],
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
const project = await cliCommand(
|
|
45
|
+
['create', 'project', projectId],
|
|
46
|
+
opts
|
|
47
|
+
).CreateProject(createProject);
|
|
48
|
+
if (project) await shell().restart();
|
|
49
|
+
}
|
|
50
|
+
);
|
|
51
|
+
|
|
22
52
|
create
|
|
23
53
|
.command('key')
|
|
54
|
+
.description('create a new api key')
|
|
24
55
|
.argument('<"key name">', 'the name of the key to create')
|
|
25
56
|
.argument('["description"]', 'provide a description for the key (optional)')
|
|
26
57
|
.usage('<"key name"> ["description"] (both args in "double quotes")')
|
|
@@ -37,5 +68,27 @@ Example call:
|
|
|
37
68
|
);
|
|
38
69
|
});
|
|
39
70
|
|
|
71
|
+
create
|
|
72
|
+
.command('role')
|
|
73
|
+
.description('create a new role')
|
|
74
|
+
.argument('<"Role name">', 'the name of the role to create')
|
|
75
|
+
.argument('["Role description">', 'the description of the role')
|
|
76
|
+
.option('--disabled', 'do not enable the created role', false)
|
|
77
|
+
.addHelpText(
|
|
78
|
+
'after',
|
|
79
|
+
`
|
|
80
|
+
Example call:
|
|
81
|
+
> create role "My role" "This role is for testing" --disabled \n`
|
|
82
|
+
)
|
|
83
|
+
.action(async (roleName: string, description: string, opts) => {
|
|
84
|
+
await cliCommand(['create', 'role', roleName], opts).CreateRole({
|
|
85
|
+
name: roleName,
|
|
86
|
+
description,
|
|
87
|
+
enabled: !opts.disabled,
|
|
88
|
+
assignments: { apiKeys: [], groups: [], users: [] },
|
|
89
|
+
permissions: { contentTypes: [], entries: [] },
|
|
90
|
+
});
|
|
91
|
+
});
|
|
92
|
+
|
|
40
93
|
return create;
|
|
41
94
|
};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
import { devCommand } from '~/services/ContensisDevService';
|
|
3
|
+
|
|
4
|
+
export const makeDevCommand = () => {
|
|
5
|
+
const dev = new Command()
|
|
6
|
+
.command('dev')
|
|
7
|
+
.description('dev command')
|
|
8
|
+
.addHelpText('after', `\n`)
|
|
9
|
+
.showHelpAfterError(true)
|
|
10
|
+
.exitOverride();
|
|
11
|
+
|
|
12
|
+
dev
|
|
13
|
+
.command('init')
|
|
14
|
+
.description(
|
|
15
|
+
'initialise a git clone directory to connect and deploy to Contensis'
|
|
16
|
+
)
|
|
17
|
+
.argument(
|
|
18
|
+
'[projectHome]',
|
|
19
|
+
'the path of the folder to initialise',
|
|
20
|
+
process.cwd()
|
|
21
|
+
)
|
|
22
|
+
.option(
|
|
23
|
+
'--url <url>',
|
|
24
|
+
'override the git url or add one to initialise a non-git folder'
|
|
25
|
+
)
|
|
26
|
+
.option(
|
|
27
|
+
'-d --dry-run',
|
|
28
|
+
'perform a dry run of the project initialisation where no changes are made'
|
|
29
|
+
)
|
|
30
|
+
// .option(
|
|
31
|
+
// '--commit',
|
|
32
|
+
// 'commit change (will eventually be deprecated in favour of --dry-run)',
|
|
33
|
+
// true
|
|
34
|
+
// )
|
|
35
|
+
.addHelpText(
|
|
36
|
+
'after',
|
|
37
|
+
`
|
|
38
|
+
Example call:
|
|
39
|
+
> dev init\n`
|
|
40
|
+
)
|
|
41
|
+
.action(async (projectHome: string, opts) => {
|
|
42
|
+
// TODO: add opts for overriding project name and git url
|
|
43
|
+
await devCommand(['dev', 'init', projectHome], opts).DevelopmentInit(
|
|
44
|
+
projectHome,
|
|
45
|
+
{ ...opts, dryRun: opts.dryRun }
|
|
46
|
+
);
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
dev
|
|
50
|
+
.command('requests')
|
|
51
|
+
.description('launch request handler for local development')
|
|
52
|
+
.argument('[block-ids...]', 'ids of any blocks to develop locally')
|
|
53
|
+
.option('--args <args...>', 'override or add additional args')
|
|
54
|
+
.usage('[block-ids...]')
|
|
55
|
+
.addHelpText(
|
|
56
|
+
'after',
|
|
57
|
+
`
|
|
58
|
+
Example call:
|
|
59
|
+
> dev requests test-block-one\n`
|
|
60
|
+
)
|
|
61
|
+
.action(async (blockIds: string[] = [], opts) => {
|
|
62
|
+
await devCommand(
|
|
63
|
+
['dev', 'requests', blockIds.join(' ')],
|
|
64
|
+
opts
|
|
65
|
+
).ExecRequestHandler(blockIds, opts?.args);
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
return dev;
|
|
69
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
import { cliCommand } from '~/services/ContensisCliService';
|
|
3
|
+
import { mapContensisOpts } from './globalOptions';
|
|
4
|
+
|
|
5
|
+
export const makeDiffCommand = () => {
|
|
6
|
+
const release = new Command()
|
|
7
|
+
.command('diff')
|
|
8
|
+
.description('diff command')
|
|
9
|
+
.addHelpText('after', `\n`)
|
|
10
|
+
.showHelpAfterError(true)
|
|
11
|
+
.exitOverride();
|
|
12
|
+
|
|
13
|
+
release
|
|
14
|
+
.command('models')
|
|
15
|
+
.description('differences with content models')
|
|
16
|
+
.argument(
|
|
17
|
+
'[model-ids...]',
|
|
18
|
+
'ids of any content types or components to diff (optional)'
|
|
19
|
+
)
|
|
20
|
+
.usage('[model-ids...]')
|
|
21
|
+
.addHelpText(
|
|
22
|
+
'after',
|
|
23
|
+
`
|
|
24
|
+
Example call:
|
|
25
|
+
> diff models blogPost\n`
|
|
26
|
+
)
|
|
27
|
+
.action(async (modelIds: string[] = [], opts) => {
|
|
28
|
+
await cliCommand(
|
|
29
|
+
['diff', 'models', modelIds.join(' ')],
|
|
30
|
+
opts,
|
|
31
|
+
mapContensisOpts({ modelIds, ...opts })
|
|
32
|
+
).DiffModels(
|
|
33
|
+
{
|
|
34
|
+
...opts,
|
|
35
|
+
},
|
|
36
|
+
modelIds
|
|
37
|
+
);
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
return release;
|
|
41
|
+
};
|