contensis-cli 1.6.1-beta.21 → 1.6.1-beta.23
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/LICENSE +674 -0
- package/dist/index.js +36 -6
- package/dist/index.js.map +2 -2
- package/dist/shell.js +36 -6
- package/dist/shell.js.map +2 -2
- package/docs/copy_field_templates.md +112 -0
- package/package.json +3 -3
- package/src/commands/set.ts +4 -3
- package/src/localisation/en-GB.ts +4 -0
- package/src/services/ContensisCliService.ts +29 -3
- package/src/version.ts +1 -1
package/dist/index.js
CHANGED
|
@@ -46453,7 +46453,7 @@ var progress = {
|
|
|
46453
46453
|
};
|
|
46454
46454
|
|
|
46455
46455
|
// src/version.ts
|
|
46456
|
-
var LIB_VERSION = "1.6.1-beta.
|
|
46456
|
+
var LIB_VERSION = "1.6.1-beta.23";
|
|
46457
46457
|
|
|
46458
46458
|
// src/commands/connect.ts
|
|
46459
46459
|
var import_commander2 = require("commander");
|
|
@@ -46786,6 +46786,9 @@ ${Logger.errorText(">>")} Available commands:`,
|
|
|
46786
46786
|
failedGet: (env, name, projectId) => `[${env}] Unable to find renderer ${Logger.highlightText(
|
|
46787
46787
|
name
|
|
46788
46788
|
)} in project ${projectId}`,
|
|
46789
|
+
resolved: (env, name, uuid) => `[${env}] Resolved renderer ${Logger.highlightText(
|
|
46790
|
+
name
|
|
46791
|
+
)} to uuid ${Logger.highlightText(uuid)}`,
|
|
46789
46792
|
created: (env, name, projectId) => `[${env}] Created renderer ${Logger.highlightText(
|
|
46790
46793
|
name
|
|
46791
46794
|
)} in project ${projectId}
|
|
@@ -48218,8 +48221,9 @@ var promiseDelay = (delay, value) => {
|
|
|
48218
48221
|
var insecurePasswordWarningShown = false;
|
|
48219
48222
|
var ContensisCli = class {
|
|
48220
48223
|
static quit = (error) => {
|
|
48224
|
+
var _a;
|
|
48221
48225
|
process.removeAllListeners("exit");
|
|
48222
|
-
const exitCode = error ? 1 : 0;
|
|
48226
|
+
const exitCode = (_a = error == null ? void 0 : error.exitCode) != null ? _a : error ? 1 : 0;
|
|
48223
48227
|
process.exit(exitCode);
|
|
48224
48228
|
};
|
|
48225
48229
|
format;
|
|
@@ -50284,7 +50288,7 @@ Components:`));
|
|
|
50284
50288
|
}
|
|
50285
50289
|
};
|
|
50286
50290
|
CreateOrUpdateNode = async (nodePathOrId, nodeUpdates, displayName, slug, language) => {
|
|
50287
|
-
var _a, _b;
|
|
50291
|
+
var _a, _b, _c;
|
|
50288
50292
|
const { currentEnv, currentProject, log, messages } = this;
|
|
50289
50293
|
const contensis = await this.ConnectContensis();
|
|
50290
50294
|
const nodePath = nodePathOrId.startsWith("/") ? nodePathOrId : void 0;
|
|
@@ -50305,6 +50309,31 @@ Components:`));
|
|
|
50305
50309
|
);
|
|
50306
50310
|
if (nodeById) existingNode = nodeById;
|
|
50307
50311
|
}
|
|
50312
|
+
const rendererRef = (_b = nodeUpdates.renderer) == null ? void 0 : _b.id;
|
|
50313
|
+
if (rendererRef && !isUuid(rendererRef)) {
|
|
50314
|
+
const [, renderers] = await contensis.renderers.GetRenderers();
|
|
50315
|
+
const match = renderers == null ? void 0 : renderers.find(
|
|
50316
|
+
(r) => {
|
|
50317
|
+
var _a2, _b2;
|
|
50318
|
+
return ((_a2 = r.id) == null ? void 0 : _a2.toLowerCase()) === rendererRef.toLowerCase() || ((_b2 = r.name) == null ? void 0 : _b2.toLowerCase()) === rendererRef.toLowerCase();
|
|
50319
|
+
}
|
|
50320
|
+
);
|
|
50321
|
+
if (match) {
|
|
50322
|
+
log.info(
|
|
50323
|
+
messages.renderers.resolved(
|
|
50324
|
+
currentEnv,
|
|
50325
|
+
rendererRef,
|
|
50326
|
+
match.uuid
|
|
50327
|
+
)
|
|
50328
|
+
);
|
|
50329
|
+
nodeUpdates.renderer.id = match.uuid;
|
|
50330
|
+
} else {
|
|
50331
|
+
log.error(
|
|
50332
|
+
messages.renderers.failedGet(currentEnv, rendererRef, currentProject)
|
|
50333
|
+
);
|
|
50334
|
+
return;
|
|
50335
|
+
}
|
|
50336
|
+
}
|
|
50308
50337
|
if (!existingNode) {
|
|
50309
50338
|
if (!language) {
|
|
50310
50339
|
const project2 = await contensis.source.repo.GetProject(currentProject);
|
|
@@ -50319,7 +50348,7 @@ Components:`));
|
|
|
50319
50348
|
const [, parentNodesByPath] = await (0, import_await_to_js2.default)(
|
|
50320
50349
|
contensis.nodes.GetNodes(parentPath, 0)
|
|
50321
50350
|
);
|
|
50322
|
-
if (!((
|
|
50351
|
+
if (!((_c = parentNodesByPath == null ? void 0 : parentNodesByPath[0]) == null ? void 0 : _c.id))
|
|
50323
50352
|
throw new Error(
|
|
50324
50353
|
`A node with id "${nodeId}" does not exist, and the parent node could not be found at path "${parentPath}".`
|
|
50325
50354
|
);
|
|
@@ -57988,15 +58017,16 @@ Example call:
|
|
|
57988
58017
|
{ entryId: entryId2 }
|
|
57989
58018
|
);
|
|
57990
58019
|
});
|
|
57991
|
-
node.command("renderer").description("assign a renderer to a node").argument('<"node path or id">', "the path or id of the node to update").argument("<
|
|
58020
|
+
node.command("renderer").description("assign a renderer to a node").argument('<"node path or id">', "the path or id of the node to update").argument("<rendererUuidOrName>", "the renderer uuid, id or name to assign to the node").option(
|
|
57992
58021
|
"--is-partial-match-root",
|
|
57993
58022
|
"should the renderer be used as the partial match root for the node",
|
|
57994
58023
|
false
|
|
57995
|
-
).usage('<"node path or id"> <
|
|
58024
|
+
).usage('<"node path or id"> <rendererUuidOrName>').addHelpText(
|
|
57996
58025
|
"after",
|
|
57997
58026
|
`
|
|
57998
58027
|
Example call:
|
|
57999
58028
|
> set node renderer /path 1502f64e-e9b1-436b-b62f-e273f639ecb6 --is-partial-match-root
|
|
58029
|
+
> set node renderer /path my-block --is-partial-match-root
|
|
58000
58030
|
`
|
|
58001
58031
|
).action(async (nodePathOrId, rendererId, opts) => {
|
|
58002
58032
|
await cliCommand(["set", "node", "renderer"], opts).CreateOrUpdateNode(
|