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/shell.js
CHANGED
|
@@ -46464,7 +46464,7 @@ var progress = {
|
|
|
46464
46464
|
};
|
|
46465
46465
|
|
|
46466
46466
|
// src/version.ts
|
|
46467
|
-
var LIB_VERSION = "1.6.1-beta.
|
|
46467
|
+
var LIB_VERSION = "1.6.1-beta.23";
|
|
46468
46468
|
|
|
46469
46469
|
// src/commands/connect.ts
|
|
46470
46470
|
var import_commander2 = require("commander");
|
|
@@ -46797,6 +46797,9 @@ ${Logger.errorText(">>")} Available commands:`,
|
|
|
46797
46797
|
failedGet: (env, name, projectId) => `[${env}] Unable to find renderer ${Logger.highlightText(
|
|
46798
46798
|
name
|
|
46799
46799
|
)} in project ${projectId}`,
|
|
46800
|
+
resolved: (env, name, uuid) => `[${env}] Resolved renderer ${Logger.highlightText(
|
|
46801
|
+
name
|
|
46802
|
+
)} to uuid ${Logger.highlightText(uuid)}`,
|
|
46800
46803
|
created: (env, name, projectId) => `[${env}] Created renderer ${Logger.highlightText(
|
|
46801
46804
|
name
|
|
46802
46805
|
)} in project ${projectId}
|
|
@@ -48229,8 +48232,9 @@ var promiseDelay = (delay, value) => {
|
|
|
48229
48232
|
var insecurePasswordWarningShown = false;
|
|
48230
48233
|
var ContensisCli = class {
|
|
48231
48234
|
static quit = (error) => {
|
|
48235
|
+
var _a;
|
|
48232
48236
|
process.removeAllListeners("exit");
|
|
48233
|
-
const exitCode = error ? 1 : 0;
|
|
48237
|
+
const exitCode = (_a = error == null ? void 0 : error.exitCode) != null ? _a : error ? 1 : 0;
|
|
48234
48238
|
process.exit(exitCode);
|
|
48235
48239
|
};
|
|
48236
48240
|
format;
|
|
@@ -50295,7 +50299,7 @@ Components:`));
|
|
|
50295
50299
|
}
|
|
50296
50300
|
};
|
|
50297
50301
|
CreateOrUpdateNode = async (nodePathOrId, nodeUpdates, displayName, slug, language) => {
|
|
50298
|
-
var _a, _b;
|
|
50302
|
+
var _a, _b, _c;
|
|
50299
50303
|
const { currentEnv, currentProject, log, messages } = this;
|
|
50300
50304
|
const contensis = await this.ConnectContensis();
|
|
50301
50305
|
const nodePath = nodePathOrId.startsWith("/") ? nodePathOrId : void 0;
|
|
@@ -50316,6 +50320,31 @@ Components:`));
|
|
|
50316
50320
|
);
|
|
50317
50321
|
if (nodeById) existingNode = nodeById;
|
|
50318
50322
|
}
|
|
50323
|
+
const rendererRef = (_b = nodeUpdates.renderer) == null ? void 0 : _b.id;
|
|
50324
|
+
if (rendererRef && !isUuid(rendererRef)) {
|
|
50325
|
+
const [, renderers] = await contensis.renderers.GetRenderers();
|
|
50326
|
+
const match = renderers == null ? void 0 : renderers.find(
|
|
50327
|
+
(r) => {
|
|
50328
|
+
var _a2, _b2;
|
|
50329
|
+
return ((_a2 = r.id) == null ? void 0 : _a2.toLowerCase()) === rendererRef.toLowerCase() || ((_b2 = r.name) == null ? void 0 : _b2.toLowerCase()) === rendererRef.toLowerCase();
|
|
50330
|
+
}
|
|
50331
|
+
);
|
|
50332
|
+
if (match) {
|
|
50333
|
+
log.info(
|
|
50334
|
+
messages.renderers.resolved(
|
|
50335
|
+
currentEnv,
|
|
50336
|
+
rendererRef,
|
|
50337
|
+
match.uuid
|
|
50338
|
+
)
|
|
50339
|
+
);
|
|
50340
|
+
nodeUpdates.renderer.id = match.uuid;
|
|
50341
|
+
} else {
|
|
50342
|
+
log.error(
|
|
50343
|
+
messages.renderers.failedGet(currentEnv, rendererRef, currentProject)
|
|
50344
|
+
);
|
|
50345
|
+
return;
|
|
50346
|
+
}
|
|
50347
|
+
}
|
|
50319
50348
|
if (!existingNode) {
|
|
50320
50349
|
if (!language) {
|
|
50321
50350
|
const project2 = await contensis.source.repo.GetProject(currentProject);
|
|
@@ -50330,7 +50359,7 @@ Components:`));
|
|
|
50330
50359
|
const [, parentNodesByPath] = await (0, import_await_to_js2.default)(
|
|
50331
50360
|
contensis.nodes.GetNodes(parentPath, 0)
|
|
50332
50361
|
);
|
|
50333
|
-
if (!((
|
|
50362
|
+
if (!((_c = parentNodesByPath == null ? void 0 : parentNodesByPath[0]) == null ? void 0 : _c.id))
|
|
50334
50363
|
throw new Error(
|
|
50335
50364
|
`A node with id "${nodeId}" does not exist, and the parent node could not be found at path "${parentPath}".`
|
|
50336
50365
|
);
|
|
@@ -57699,15 +57728,16 @@ Example call:
|
|
|
57699
57728
|
{ entryId: entryId2 }
|
|
57700
57729
|
);
|
|
57701
57730
|
});
|
|
57702
|
-
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("<
|
|
57731
|
+
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(
|
|
57703
57732
|
"--is-partial-match-root",
|
|
57704
57733
|
"should the renderer be used as the partial match root for the node",
|
|
57705
57734
|
false
|
|
57706
|
-
).usage('<"node path or id"> <
|
|
57735
|
+
).usage('<"node path or id"> <rendererUuidOrName>').addHelpText(
|
|
57707
57736
|
"after",
|
|
57708
57737
|
`
|
|
57709
57738
|
Example call:
|
|
57710
57739
|
> set node renderer /path 1502f64e-e9b1-436b-b62f-e273f639ecb6 --is-partial-match-root
|
|
57740
|
+
> set node renderer /path my-block --is-partial-match-root
|
|
57711
57741
|
`
|
|
57712
57742
|
).action(async (nodePathOrId, rendererId, opts) => {
|
|
57713
57743
|
await cliCommand(["set", "node", "renderer"], opts).CreateOrUpdateNode(
|