contensis-cli 1.6.1-beta.22 → 1.6.1-beta.24
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 +48 -7
- package/dist/index.js.map +2 -2
- package/dist/shell.js +48 -7
- package/dist/shell.js.map +2 -2
- package/docs/copy_field_templates.md +112 -0
- package/package.json +2 -2
- package/src/commands/push.ts +12 -1
- 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.24";
|
|
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
|
);
|
|
@@ -57475,6 +57504,13 @@ Example call:
|
|
|
57475
57504
|
},
|
|
57476
57505
|
projectId: () => cli.env.currentProject || "",
|
|
57477
57506
|
source: {
|
|
57507
|
+
// Provenance resolution order per field:
|
|
57508
|
+
// 1. explicit cli flag (camelCase key from commander opts)
|
|
57509
|
+
// 2. CONTENSIS_* env var - a safe channel for CI actions to supply
|
|
57510
|
+
// values without embedding them in the command string (where mapped)
|
|
57511
|
+
// 3. generic CI variables the runner exports
|
|
57512
|
+
// The mapper skips empty/undefined candidates and uses the first
|
|
57513
|
+
// non-empty value, so unset optional vars never mask a fallback.
|
|
57478
57514
|
provider: {
|
|
57479
57515
|
$path: ["provider"],
|
|
57480
57516
|
$return: (provider, { GITHUB_ACTIONS, GITLAB_CI }) => {
|
|
@@ -57496,7 +57532,11 @@ Example call:
|
|
|
57496
57532
|
commit: {
|
|
57497
57533
|
id: ["commitId", "CI_COMMIT_SHORT_SHA", "GITHUB_SHA"],
|
|
57498
57534
|
message: {
|
|
57499
|
-
$path: [
|
|
57535
|
+
$path: [
|
|
57536
|
+
"commitMessage",
|
|
57537
|
+
"CONTENSIS_COMMIT_MESSAGE",
|
|
57538
|
+
"CI_COMMIT_MESSAGE"
|
|
57539
|
+
],
|
|
57500
57540
|
// ${{ github.event.head_commit.message }}
|
|
57501
57541
|
$formatting: (msg) => msg == null ? void 0 : msg.replace(/\\n/g, " ").replace(/\\n/g, " ").trim()
|
|
57502
57542
|
},
|
|
@@ -57699,15 +57739,16 @@ Example call:
|
|
|
57699
57739
|
{ entryId: entryId2 }
|
|
57700
57740
|
);
|
|
57701
57741
|
});
|
|
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("<
|
|
57742
|
+
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
57743
|
"--is-partial-match-root",
|
|
57704
57744
|
"should the renderer be used as the partial match root for the node",
|
|
57705
57745
|
false
|
|
57706
|
-
).usage('<"node path or id"> <
|
|
57746
|
+
).usage('<"node path or id"> <rendererUuidOrName>').addHelpText(
|
|
57707
57747
|
"after",
|
|
57708
57748
|
`
|
|
57709
57749
|
Example call:
|
|
57710
57750
|
> set node renderer /path 1502f64e-e9b1-436b-b62f-e273f639ecb6 --is-partial-match-root
|
|
57751
|
+
> set node renderer /path my-block --is-partial-match-root
|
|
57711
57752
|
`
|
|
57712
57753
|
).action(async (nodePathOrId, rendererId, opts) => {
|
|
57713
57754
|
await cliCommand(["set", "node", "renderer"], opts).CreateOrUpdateNode(
|