contensis-cli 1.0.12-beta.1 → 1.0.12-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commands/import.js +6 -1
- package/dist/commands/import.js.map +2 -2
- package/dist/services/ContensisCliService.js +15 -41
- package/dist/services/ContensisCliService.js.map +3 -3
- package/dist/shell.js +1 -0
- package/dist/shell.js.map +2 -2
- package/dist/util/console.printer.js +101 -9
- package/dist/util/console.printer.js.map +3 -3
- package/dist/version.js +1 -1
- package/dist/version.js.map +1 -1
- package/package.json +2 -2
- package/src/commands/import.ts +8 -0
- package/src/services/ContensisCliService.ts +21 -52
- package/src/shell.ts +1 -0
- package/src/util/console.printer.ts +157 -10
- package/src/version.ts +1 -1
package/dist/commands/import.js
CHANGED
|
@@ -119,7 +119,12 @@ Example call:
|
|
|
119
119
|
logOutput: opts.outputEntries
|
|
120
120
|
});
|
|
121
121
|
});
|
|
122
|
-
program.command("nodes").description("import nodes").addOption(import_globalOptions.commit).
|
|
122
|
+
program.command("nodes").description("import nodes").addOption(import_globalOptions.commit).addOption(
|
|
123
|
+
new import_commander.Option(
|
|
124
|
+
"-on --output-nodes <outputNodes>",
|
|
125
|
+
"how much detail to output from the nodes import"
|
|
126
|
+
).choices(["errors", "changes", "all"]).default("errors")
|
|
127
|
+
).addHelpText(
|
|
123
128
|
"after",
|
|
124
129
|
`
|
|
125
130
|
Example call:
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/commands/import.ts"],
|
|
4
|
-
"sourcesContent": ["import { Command, Option } from 'commander';\nimport { cliCommand } from '~/services/ContensisCliService';\nimport { commit, mapContensisOpts } from './globalOptions';\n\nexport const makeImportCommand = () => {\n const program = new Command()\n .command('import')\n .description('import command')\n .addHelpText('after', `\\n`)\n .showHelpAfterError(true)\n .exitOverride();\n\n program\n .command('models')\n .description('import complete content models')\n .argument('[modelIds...]', 'ids of the content models to import (optional)')\n .addOption(commit)\n .addHelpText(\n 'after',\n `\nExample call:\n > import models blogPost --from-file contentmodels-backup.json\n > import models --source-alias example-dev\n`\n )\n .action(async (modelIds: string[], opts) => {\n await cliCommand(\n ['import', 'models', modelIds.join(' ')],\n opts,\n mapContensisOpts({ modelIds, ...opts })\n ).ImportContentModels({\n fromFile: opts.fromFile,\n commit: opts.commit,\n });\n });\n\n program\n .command('contenttypes')\n .description('import content types')\n .argument(\n '[contentTypeIds...]',\n 'Optional list of API id(s) of the content type(s) to import'\n )\n .addOption(commit)\n .addHelpText(\n 'after',\n `\nExample call:\n > import contenttypes {contentTypeIds} --from-file contenttypes-backup.json\n > import contenttypes {contentTypeIds} --source-alias example-dev\n`\n )\n .action(async (contentTypeIds: string[], opts) => {\n await cliCommand(\n ['import', 'contenttypes'],\n opts,\n mapContensisOpts({ contentTypeIds, ...opts })\n ).ImportContentTypes(\n {\n fromFile: opts.fromFile,\n commit: opts.commit,\n },\n contentTypeIds\n );\n });\n\n program\n .command('components')\n .description('import components')\n .argument(\n '[componentIds...]',\n 'Optional list of API id(s) of the component(s) to import'\n )\n .addOption(commit)\n .addHelpText(\n 'after',\n `\nExample call:\n > import components {componentIds} --from-file component-backup.json\n > import components {componentIds} --source-alias example-dev\n`\n )\n .action(async (componentIds: string[], opts) => {\n await cliCommand(\n ['import', 'component'],\n opts,\n mapContensisOpts({ componentIds, ...opts })\n ).ImportComponents(\n {\n fromFile: opts.fromFile,\n commit: opts.commit,\n },\n componentIds\n );\n });\n\n program\n .command('entries')\n .description('import entries')\n .argument(\n '[search phrase]',\n 'get entries with the search phrase, use quotes for multiple words'\n )\n .addOption(commit)\n .option(\n '-preserve --preserve-guids',\n 'include this flag when you are importing entries that you have previously exported and wish to update'\n )\n .addOption(\n new Option(\n '-oe --output-entries <outputEntries>',\n 'which details of the entries included in the import to output'\n )\n .choices(['errors', 'changes', 'all'])\n .default('errors')\n )\n .addHelpText(\n 'after',\n `\nExample call:\n > import entries --source-cms example-dev --source-project-id microsite --zenql \"sys.contentTypeId = blog\"\n`\n )\n .action(async (phrase: string, opts, cmd) => {\n await cliCommand(\n ['import', 'entries'],\n opts,\n mapContensisOpts({ phrase, ...opts })\n ).ImportEntries({\n commit: opts.commit,\n fromFile: opts.fromFile,\n logOutput: opts.outputEntries,\n });\n });\n\n // TODO: add options to import one an array of nodes? nodeIds: string[]\n program\n .command('nodes')\n .description('import nodes')\n .addOption(commit)\n .addHelpText(\n 'after',\n `\nExample call:\n > import nodes --from-file component-backup.json\n > import nodes --source-alias example-alias --source-project-id example-project\n`\n )\n .action(async opts => {\n await cliCommand(\n ['import', 'nodes'],\n opts,\n mapContensisOpts({ ...opts })\n ).ImportNodes({\n commit: opts.commit,\n fromFile: opts.fromFile,\n logOutput: opts.outputNodes,\n });\n });\n\n return program;\n};\n\nexport const get = makeImportCommand();\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAAgC;AAChC,iCAA2B;AAC3B,2BAAyC;AAElC,MAAM,oBAAoB,MAAM;AACrC,QAAM,UAAU,IAAI,yBAAQ,EACzB,QAAQ,QAAQ,EAChB,YAAY,gBAAgB,EAC5B,YAAY,SAAS;AAAA,CAAI,EACzB,mBAAmB,IAAI,EACvB,aAAa;AAEhB,UACG,QAAQ,QAAQ,EAChB,YAAY,gCAAgC,EAC5C,SAAS,iBAAiB,gDAAgD,EAC1E,UAAU,2BAAM,EAChB;AAAA,IACC;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,EAKF,EACC,OAAO,OAAO,UAAoB,SAAS;AAC1C,cAAM;AAAA,MACJ,CAAC,UAAU,UAAU,SAAS,KAAK,GAAG,CAAC;AAAA,MACvC;AAAA,UACA,uCAAiB,EAAE,UAAU,GAAG,KAAK,CAAC;AAAA,IACxC,EAAE,oBAAoB;AAAA,MACpB,UAAU,KAAK;AAAA,MACf,QAAQ,KAAK;AAAA,I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MAAM,QAAQ;AAC3C,cAAM;AAAA,MACJ,CAAC,UAAU,SAAS;AAAA,MACpB;AAAA,UACA,uCAAiB,EAAE,QAAQ,GAAG,KAAK,CAAC;AAAA,IACtC,EAAE,cAAc;AAAA,MACd,QAAQ,KAAK;AAAA,MACb,UAAU,KAAK;AAAA,MACf,WAAW,KAAK;AAAA,IAClB,CAAC;AAAA,EACH,CAAC;AAGH,UACG,QAAQ,OAAO,EACf,YAAY,cAAc,EAC1B,UAAU,2BAAM,EAChB;AAAA,IACC;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,EAKF,EACC,OAAO,OAAM,SAAQ;AACpB,cAAM;AAAA,MACJ,CAAC,UAAU,OAAO;AAAA,MAClB;AAAA,UACA,uCAAiB,EAAE,GAAG,KAAK,CAAC;AAAA,IAC9B,EAAE,YAAY;AAAA,MACZ,QAAQ,KAAK;AAAA,MACb,UAAU,KAAK;AAAA,MACf,WAAW,KAAK;AAAA,IAClB,CAAC;AAAA,EACH,CAAC;AAEH,SAAO;AACT;AAEO,MAAM,MAAM,kBAAkB;",
|
|
4
|
+
"sourcesContent": ["import { Command, Option } from 'commander';\nimport { cliCommand } from '~/services/ContensisCliService';\nimport { commit, mapContensisOpts } from './globalOptions';\n\nexport const makeImportCommand = () => {\n const program = new Command()\n .command('import')\n .description('import command')\n .addHelpText('after', `\\n`)\n .showHelpAfterError(true)\n .exitOverride();\n\n program\n .command('models')\n .description('import complete content models')\n .argument('[modelIds...]', 'ids of the content models to import (optional)')\n .addOption(commit)\n .addHelpText(\n 'after',\n `\nExample call:\n > import models blogPost --from-file contentmodels-backup.json\n > import models --source-alias example-dev\n`\n )\n .action(async (modelIds: string[], opts) => {\n await cliCommand(\n ['import', 'models', modelIds.join(' ')],\n opts,\n mapContensisOpts({ modelIds, ...opts })\n ).ImportContentModels({\n fromFile: opts.fromFile,\n commit: opts.commit,\n });\n });\n\n program\n .command('contenttypes')\n .description('import content types')\n .argument(\n '[contentTypeIds...]',\n 'Optional list of API id(s) of the content type(s) to import'\n )\n .addOption(commit)\n .addHelpText(\n 'after',\n `\nExample call:\n > import contenttypes {contentTypeIds} --from-file contenttypes-backup.json\n > import contenttypes {contentTypeIds} --source-alias example-dev\n`\n )\n .action(async (contentTypeIds: string[], opts) => {\n await cliCommand(\n ['import', 'contenttypes'],\n opts,\n mapContensisOpts({ contentTypeIds, ...opts })\n ).ImportContentTypes(\n {\n fromFile: opts.fromFile,\n commit: opts.commit,\n },\n contentTypeIds\n );\n });\n\n program\n .command('components')\n .description('import components')\n .argument(\n '[componentIds...]',\n 'Optional list of API id(s) of the component(s) to import'\n )\n .addOption(commit)\n .addHelpText(\n 'after',\n `\nExample call:\n > import components {componentIds} --from-file component-backup.json\n > import components {componentIds} --source-alias example-dev\n`\n )\n .action(async (componentIds: string[], opts) => {\n await cliCommand(\n ['import', 'component'],\n opts,\n mapContensisOpts({ componentIds, ...opts })\n ).ImportComponents(\n {\n fromFile: opts.fromFile,\n commit: opts.commit,\n },\n componentIds\n );\n });\n\n program\n .command('entries')\n .description('import entries')\n .argument(\n '[search phrase]',\n 'get entries with the search phrase, use quotes for multiple words'\n )\n .addOption(commit)\n .option(\n '-preserve --preserve-guids',\n 'include this flag when you are importing entries that you have previously exported and wish to update'\n )\n .addOption(\n new Option(\n '-oe --output-entries <outputEntries>',\n 'which details of the entries included in the import to output'\n )\n .choices(['errors', 'changes', 'all'])\n .default('errors')\n )\n .addHelpText(\n 'after',\n `\nExample call:\n > import entries --source-cms example-dev --source-project-id microsite --zenql \"sys.contentTypeId = blog\"\n`\n )\n .action(async (phrase: string, opts, cmd) => {\n await cliCommand(\n ['import', 'entries'],\n opts,\n mapContensisOpts({ phrase, ...opts })\n ).ImportEntries({\n commit: opts.commit,\n fromFile: opts.fromFile,\n logOutput: opts.outputEntries,\n });\n });\n\n // TODO: add options to import one an array of nodes? nodeIds: string[]\n program\n .command('nodes')\n .description('import nodes')\n .addOption(commit)\n .addOption(\n new Option(\n '-on --output-nodes <outputNodes>',\n 'how much detail to output from the nodes import'\n )\n .choices(['errors', 'changes', 'all'])\n .default('errors')\n )\n .addHelpText(\n 'after',\n `\nExample call:\n > import nodes --from-file component-backup.json\n > import nodes --source-alias example-alias --source-project-id example-project\n`\n )\n .action(async opts => {\n await cliCommand(\n ['import', 'nodes'],\n opts,\n mapContensisOpts({ ...opts })\n ).ImportNodes({\n commit: opts.commit,\n fromFile: opts.fromFile,\n logOutput: opts.outputNodes,\n });\n });\n\n return program;\n};\n\nexport const get = makeImportCommand();\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAAgC;AAChC,iCAA2B;AAC3B,2BAAyC;AAElC,MAAM,oBAAoB,MAAM;AACrC,QAAM,UAAU,IAAI,yBAAQ,EACzB,QAAQ,QAAQ,EAChB,YAAY,gBAAgB,EAC5B,YAAY,SAAS;AAAA,CAAI,EACzB,mBAAmB,IAAI,EACvB,aAAa;AAEhB,UACG,QAAQ,QAAQ,EAChB,YAAY,gCAAgC,EAC5C,SAAS,iBAAiB,gDAAgD,EAC1E,UAAU,2BAAM,EAChB;AAAA,IACC;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,EAKF,EACC,OAAO,OAAO,UAAoB,SAAS;AAC1C,cAAM;AAAA,MACJ,CAAC,UAAU,UAAU,SAAS,KAAK,GAAG,CAAC;AAAA,MACvC;AAAA,UACA,uCAAiB,EAAE,UAAU,GAAG,KAAK,CAAC;AAAA,IACxC,EAAE,oBAAoB;AAAA,MACpB,UAAU,KAAK;AAAA,MACf,QAAQ,KAAK;AAAA,IACf,CAAC;AAAA,EACH,CAAC;AAEH,UACG,QAAQ,cAAc,EACtB,YAAY,sBAAsB,EAClC;AAAA,IACC;AAAA,IACA;AAAA,EACF,EACC,UAAU,2BAAM,EAChB;AAAA,IACC;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,EAKF,EACC,OAAO,OAAO,gBAA0B,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A,IAClB,CAAC;AAAA,EACH,CAAC;AAGH,UACG,QAAQ,OAAO,EACf,YAAY,cAAc,EAC1B,UAAU,2BAAM,EAChB;AAAA,IACC,IAAI;AAAA,MACF;AAAA,MACA;AAAA,IACF,EACG,QAAQ,CAAC,UAAU,WAAW,KAAK,CAAC,EACpC,QAAQ,QAAQ;AAAA,EACrB,EACC;AAAA,IACC;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,EAKF,EACC,OAAO,OAAM,SAAQ;AACpB,cAAM;AAAA,MACJ,CAAC,UAAU,OAAO;AAAA,MAClB;AAAA,UACA,uCAAiB,EAAE,GAAG,KAAK,CAAC;AAAA,IAC9B,EAAE,YAAY;AAAA,MACZ,QAAQ,KAAK;AAAA,MACb,UAAU,KAAK;AAAA,MACf,WAAW,KAAK;AAAA,IAClB,CAAC;AAAA,EACH,CAAC;AAEH,SAAO;AACT;AAEO,MAAM,MAAM,kBAAkB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -688,9 +688,7 @@ class ContensisCli {
|
|
|
688
688
|
` ${import_chalk.default.bold.grey(
|
|
689
689
|
"contentTypes"
|
|
690
690
|
)}: ${permissions.contentTypes.map(
|
|
691
|
-
(p) => `${p.id} [${p.actions.join(",")}] ${p.languages.join(
|
|
692
|
-
" "
|
|
693
|
-
)}`
|
|
691
|
+
(p) => `${p.id} [${p.actions.join(",")}] ${p.languages.join(" ")}`
|
|
694
692
|
).join(", ")}`
|
|
695
693
|
);
|
|
696
694
|
}
|
|
@@ -1240,9 +1238,9 @@ Components:`));
|
|
|
1240
1238
|
const [err, result] = await contensis.DeleteEntries();
|
|
1241
1239
|
if (result)
|
|
1242
1240
|
this.HandleFormattingAndOutput(result, () => {
|
|
1243
|
-
(0, import_console.
|
|
1241
|
+
(0, import_console.printEntriesMigrateResult)(this, result, {
|
|
1244
1242
|
action: "delete",
|
|
1245
|
-
|
|
1243
|
+
showAll: true
|
|
1246
1244
|
});
|
|
1247
1245
|
});
|
|
1248
1246
|
if (!err && (!commit && result.entriesToMigrate[currentProject].totalCount || commit && ((_a = result.migrateResult) == null ? void 0 : _a.deleted))) {
|
|
@@ -1270,11 +1268,11 @@ Components:`));
|
|
|
1270
1268
|
entries,
|
|
1271
1269
|
() => {
|
|
1272
1270
|
var _a;
|
|
1273
|
-
return (0, import_migratortron.
|
|
1271
|
+
return (0, import_migratortron.logEntitiesTable)({
|
|
1274
1272
|
entries,
|
|
1275
|
-
currentProject,
|
|
1276
|
-
(_a = contensis.payload.query) == null ? void 0 : _a.fields
|
|
1277
|
-
);
|
|
1273
|
+
projectId: currentProject,
|
|
1274
|
+
fields: (_a = contensis.payload.query) == null ? void 0 : _a.fields
|
|
1275
|
+
});
|
|
1278
1276
|
}
|
|
1279
1277
|
);
|
|
1280
1278
|
} else {
|
|
@@ -1306,9 +1304,9 @@ Components:`));
|
|
|
1306
1304
|
(0, import_logger.logError)(err);
|
|
1307
1305
|
else
|
|
1308
1306
|
this.HandleFormattingAndOutput(result, () => {
|
|
1309
|
-
(0, import_console.
|
|
1310
|
-
|
|
1311
|
-
|
|
1307
|
+
(0, import_console.printEntriesMigrateResult)(this, result, {
|
|
1308
|
+
showAll: logOutput === "all",
|
|
1309
|
+
showChanged: logOutput === "changes"
|
|
1312
1310
|
});
|
|
1313
1311
|
});
|
|
1314
1312
|
if (!err && !((_a = result.errors) == null ? void 0 : _a.length) && (!commit && result.entriesToMigrate[currentProject].totalCount || commit && (((_b = result.migrateResult) == null ? void 0 : _b.created) || ((_c = result.migrateResult) == null ? void 0 : _c.updated)))) {
|
|
@@ -1347,32 +1345,8 @@ Components:`));
|
|
|
1347
1345
|
}
|
|
1348
1346
|
const root = contensis.content.sourceRepo.nodes.tree;
|
|
1349
1347
|
log.success(messages.nodes.get(currentProject, rootPath, depth));
|
|
1350
|
-
const outputNode = (node, spaces) => `${node.entry ? log.highlightText("e") : log.infoText("-")}${node.isCanonical ? log.highlightText("c") : log.infoText("-")}${node.includeInMenu ? log.highlightText("m") : log.infoText("-")}${spaces}${node.isCanonical ? log.boldText(`/${node.slug}`) : `/${node.slug}`}${node.entry ? ` ${log.helpText(node.entry.sys.contentTypeId)}` : ""}${node.childCount ? ` +${node.childCount}` : ``} ${log.infoText(node.displayName)}`;
|
|
1351
1348
|
this.HandleFormattingAndOutput(root, () => {
|
|
1352
|
-
|
|
1353
|
-
log.raw("");
|
|
1354
|
-
log.info(
|
|
1355
|
-
`${log.highlightText("e")} = has entry; ${log.highlightText(
|
|
1356
|
-
"c"
|
|
1357
|
-
)} = canonical; ${log.highlightText("m")} = include in menu`
|
|
1358
|
-
);
|
|
1359
|
-
log.line();
|
|
1360
|
-
const outputChildren = (root2, depth2 = 2) => {
|
|
1361
|
-
let str = "";
|
|
1362
|
-
for (const node of root2 == null ? void 0 : root2.children) {
|
|
1363
|
-
str += `${outputNode(node, Array(depth2 + 1).join(" "))}
|
|
1364
|
-
`;
|
|
1365
|
-
if ("children" in node)
|
|
1366
|
-
str += outputChildren(node, depth2 + 1);
|
|
1367
|
-
}
|
|
1368
|
-
return str;
|
|
1369
|
-
};
|
|
1370
|
-
const children = outputChildren(root);
|
|
1371
|
-
log.limits(
|
|
1372
|
-
`${outputNode(root, " ")}${children ? `
|
|
1373
|
-
${children}` : ""}`,
|
|
1374
|
-
100
|
|
1375
|
-
);
|
|
1349
|
+
(0, import_console.printNodeTreeOutput)(this, root);
|
|
1376
1350
|
});
|
|
1377
1351
|
} else {
|
|
1378
1352
|
log.warning(messages.models.noList(currentProject));
|
|
@@ -1403,9 +1377,9 @@ ${children}` : ""}`,
|
|
|
1403
1377
|
(0, import_logger.logError)(err);
|
|
1404
1378
|
else
|
|
1405
1379
|
this.HandleFormattingAndOutput(result, () => {
|
|
1406
|
-
(0, import_console.
|
|
1407
|
-
|
|
1408
|
-
|
|
1380
|
+
(0, import_console.printNodesMigrateResult)(this, result, {
|
|
1381
|
+
showAll: logOutput === "all",
|
|
1382
|
+
showChanged: logOutput === "changes"
|
|
1409
1383
|
});
|
|
1410
1384
|
});
|
|
1411
1385
|
const nodesTotalCount = result == null ? void 0 : result.nodesToMigrate[currentProject].totalCount;
|
|
@@ -1428,7 +1402,7 @@ ${children}` : ""}`,
|
|
|
1428
1402
|
}
|
|
1429
1403
|
} else {
|
|
1430
1404
|
if (noChange) {
|
|
1431
|
-
log.help(messages.nodes.noChange(currentEnv)
|
|
1405
|
+
log.help(messages.nodes.noChange(currentEnv));
|
|
1432
1406
|
} else {
|
|
1433
1407
|
log.error(messages.nodes.failedImport(currentEnv), err);
|
|
1434
1408
|
if (!nodesTotalCount)
|