contensis-cli 1.1.1 → 1.1.2-beta.1
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/factories/RequestHandlerFactory.js +203 -0
- package/dist/factories/RequestHandlerFactory.js.map +7 -0
- package/dist/localisation/en-GB.js +28 -5
- package/dist/localisation/en-GB.js.map +2 -2
- package/dist/mappers/DevRequests-to-RequestHanderCliArgs.js +119 -0
- package/dist/mappers/DevRequests-to-RequestHanderCliArgs.js.map +7 -0
- package/dist/providers/GitHubCliModuleProvider.js +107 -0
- package/dist/providers/GitHubCliModuleProvider.js.map +7 -0
- package/dist/providers/HttpProvider.js +72 -0
- package/dist/providers/HttpProvider.js.map +7 -0
- package/dist/providers/ManifestProvider.js +53 -0
- package/dist/providers/ManifestProvider.js.map +7 -0
- package/dist/providers/file-provider.js +11 -0
- package/dist/providers/file-provider.js.map +2 -2
- package/dist/services/ContensisAuthService.js +19 -11
- package/dist/services/ContensisAuthService.js.map +2 -2
- package/dist/services/ContensisCliService.js +27 -14
- package/dist/services/ContensisCliService.js.map +2 -2
- package/dist/services/ContensisDevService.js +10 -59
- package/dist/services/ContensisDevService.js.map +3 -3
- package/dist/util/debug.js +29 -0
- package/dist/util/debug.js.map +7 -0
- package/dist/util/fetch.js +65 -0
- package/dist/util/fetch.js.map +7 -0
- package/dist/util/index.js.map +1 -1
- package/dist/util/logger.js.map +2 -2
- package/dist/version.js +1 -1
- package/dist/version.js.map +1 -1
- package/package.json +4 -1
- package/src/factories/RequestHandlerFactory.ts +225 -0
- package/src/localisation/en-GB.ts +54 -12
- package/src/mappers/DevRequests-to-RequestHanderCliArgs.ts +145 -0
- package/src/providers/GitHubCliModuleProvider.ts +114 -0
- package/src/providers/HttpProvider.ts +50 -0
- package/src/providers/ManifestProvider.ts +43 -0
- package/src/providers/file-provider.ts +9 -0
- package/src/services/ContensisAuthService.ts +23 -14
- package/src/services/ContensisCliService.ts +30 -15
- package/src/services/ContensisDevService.ts +19 -85
- package/src/util/debug.ts +1 -0
- package/src/util/fetch.ts +74 -0
- package/src/util/index.ts +1 -1
- package/src/util/logger.ts +0 -1
- package/src/version.ts +1 -1
- package/dist/mappers/DevRequests-to-RequestHanderSiteConfigYaml.js +0 -56
- package/dist/mappers/DevRequests-to-RequestHanderSiteConfigYaml.js.map +0 -7
- package/src/mappers/DevRequests-to-RequestHanderSiteConfigYaml.ts +0 -44
|
@@ -0,0 +1,203 @@
|
|
|
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 RequestHandlerFactory_exports = {};
|
|
26
|
+
__export(RequestHandlerFactory_exports, {
|
|
27
|
+
RequestHandlerFactory: () => RequestHandlerFactory,
|
|
28
|
+
createRequestHandler: () => createRequestHandler
|
|
29
|
+
});
|
|
30
|
+
module.exports = __toCommonJS(RequestHandlerFactory_exports);
|
|
31
|
+
var import_child_process = require("child_process");
|
|
32
|
+
var import_inquirer = __toESM(require("inquirer"));
|
|
33
|
+
var import_nanospinner = require("nanospinner");
|
|
34
|
+
var import_path = __toESM(require("path"));
|
|
35
|
+
var import_en_GB = require("../localisation/en-GB");
|
|
36
|
+
var import_GitHubCliModuleProvider = __toESM(require("../providers/GitHubCliModuleProvider"));
|
|
37
|
+
var import_ManifestProvider = __toESM(require("../providers/ManifestProvider"));
|
|
38
|
+
var import_file_provider = require("../providers/file-provider");
|
|
39
|
+
var import_debug = require("../util/debug");
|
|
40
|
+
var import_logger = require("../util/logger");
|
|
41
|
+
class RequestHandlerFactory {
|
|
42
|
+
debug = (0, import_debug.isDebug)();
|
|
43
|
+
log = import_logger.Logger;
|
|
44
|
+
messages = import_en_GB.LogMessages;
|
|
45
|
+
manifest = new import_ManifestProvider.default();
|
|
46
|
+
basePath = import_path.default.join(import_file_provider.appRootDir);
|
|
47
|
+
name = "request-handler-localdevelopment";
|
|
48
|
+
cmd = "Zengenti.Contensis.RequestHandler.LocalDevelopment";
|
|
49
|
+
prerelease;
|
|
50
|
+
get exePath() {
|
|
51
|
+
return import_path.default.join(this.basePath, `${this.name}-${this.moduleInfo.version}`);
|
|
52
|
+
}
|
|
53
|
+
get moduleInfo() {
|
|
54
|
+
return this.manifest.getModule(this.name) || {
|
|
55
|
+
github: "contensis/request-handler-localdevelopment",
|
|
56
|
+
version: "*"
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
constructor(prerelease = false) {
|
|
60
|
+
this.prerelease = prerelease;
|
|
61
|
+
}
|
|
62
|
+
async Create() {
|
|
63
|
+
const { moduleInfo } = this;
|
|
64
|
+
const firstUse = !(moduleInfo == null ? void 0 : moduleInfo.version) || (moduleInfo == null ? void 0 : moduleInfo.version) === "*";
|
|
65
|
+
if (firstUse) {
|
|
66
|
+
this.manifest.writeModule(this.name, this.moduleInfo);
|
|
67
|
+
await this.CheckUpdate({ verbose: true });
|
|
68
|
+
}
|
|
69
|
+
await this.ApplyUpdate();
|
|
70
|
+
if (!firstUse)
|
|
71
|
+
this.CheckUpdate();
|
|
72
|
+
return this.CreateInvoke(this);
|
|
73
|
+
}
|
|
74
|
+
CreateInvoke(self = this) {
|
|
75
|
+
const { debug, log, messages, cmd, exePath } = self;
|
|
76
|
+
return async (args) => {
|
|
77
|
+
var _a, _b;
|
|
78
|
+
const child = (0, import_child_process.spawn)((0, import_file_provider.joinPath)(exePath, cmd), args, { stdio: "inherit" });
|
|
79
|
+
if ((args == null ? void 0 : args.length) && debug)
|
|
80
|
+
log.warning(
|
|
81
|
+
`Spawning process with supplied args: ${JSON.stringify(
|
|
82
|
+
child.spawnargs,
|
|
83
|
+
null,
|
|
84
|
+
2
|
|
85
|
+
)}`
|
|
86
|
+
);
|
|
87
|
+
let isRunning = false;
|
|
88
|
+
(_a = child == null ? void 0 : child.stdout) == null ? void 0 : _a.on("data", (data) => {
|
|
89
|
+
isRunning = true;
|
|
90
|
+
log.raw(data);
|
|
91
|
+
});
|
|
92
|
+
(_b = child == null ? void 0 : child.stderr) == null ? void 0 : _b.on("data", (data) => {
|
|
93
|
+
log.error(data);
|
|
94
|
+
});
|
|
95
|
+
child.on("spawn", () => {
|
|
96
|
+
isRunning = true;
|
|
97
|
+
log.help(messages.devrequests.spawn());
|
|
98
|
+
});
|
|
99
|
+
child.on("exit", (code) => {
|
|
100
|
+
isRunning = false;
|
|
101
|
+
log[code === 0 ? "success" : "warning"](
|
|
102
|
+
messages.devrequests.exited(code)
|
|
103
|
+
);
|
|
104
|
+
});
|
|
105
|
+
child.on("error", (error) => {
|
|
106
|
+
isRunning = false;
|
|
107
|
+
log.error(messages.devrequests.errored(error));
|
|
108
|
+
});
|
|
109
|
+
await new Promise((resolve) => setTimeout(resolve, 2e3));
|
|
110
|
+
while (true) {
|
|
111
|
+
if (!isRunning)
|
|
112
|
+
return;
|
|
113
|
+
await new Promise((resolve) => setTimeout(resolve, 1e3));
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
async CheckUpdate({ verbose = false } = {}) {
|
|
118
|
+
const { debug, log, manifest, messages, moduleInfo } = this;
|
|
119
|
+
const github = new import_GitHubCliModuleProvider.default(moduleInfo.github);
|
|
120
|
+
const release = await github.FindLatestRelease();
|
|
121
|
+
if (verbose || debug)
|
|
122
|
+
if (release)
|
|
123
|
+
log.info(
|
|
124
|
+
`${messages.devrequests.install.download(
|
|
125
|
+
moduleInfo.github,
|
|
126
|
+
release.tag_name
|
|
127
|
+
)}
|
|
128
|
+
${release.html_url}`
|
|
129
|
+
);
|
|
130
|
+
else
|
|
131
|
+
log.warning(messages.devrequests.install.notFound(moduleInfo.github));
|
|
132
|
+
if ((release == null ? void 0 : release.tag_name) && ![moduleInfo.version, moduleInfo.install].includes(release.tag_name)) {
|
|
133
|
+
const downloadPath = import_path.default.join(
|
|
134
|
+
this.basePath,
|
|
135
|
+
`${this.name}-${release.tag_name}`
|
|
136
|
+
);
|
|
137
|
+
const spinner = (0, import_nanospinner.createSpinner)(
|
|
138
|
+
messages.devrequests.install.downloading(
|
|
139
|
+
moduleInfo.github,
|
|
140
|
+
release.tag_name
|
|
141
|
+
)
|
|
142
|
+
);
|
|
143
|
+
if (verbose || debug) {
|
|
144
|
+
spinner.start();
|
|
145
|
+
}
|
|
146
|
+
try {
|
|
147
|
+
await github.DownloadRelease(release, {
|
|
148
|
+
path: downloadPath,
|
|
149
|
+
platforms: [
|
|
150
|
+
["win32", "win-x64"],
|
|
151
|
+
["darwin", "osx-x64"],
|
|
152
|
+
["linux", "linux-x64"]
|
|
153
|
+
]
|
|
154
|
+
});
|
|
155
|
+
} catch (ex) {
|
|
156
|
+
spinner.error();
|
|
157
|
+
log.error(
|
|
158
|
+
messages.devrequests.install.downloadFail(
|
|
159
|
+
moduleInfo.github,
|
|
160
|
+
release.tag_name
|
|
161
|
+
),
|
|
162
|
+
ex
|
|
163
|
+
);
|
|
164
|
+
} finally {
|
|
165
|
+
if (verbose || debug)
|
|
166
|
+
spinner.success({
|
|
167
|
+
text: messages.devrequests.install.downloaded(
|
|
168
|
+
moduleInfo.github,
|
|
169
|
+
release.tag_name
|
|
170
|
+
)
|
|
171
|
+
});
|
|
172
|
+
this.moduleInfo.install = release.tag_name;
|
|
173
|
+
manifest.writeModule(this.name, this.moduleInfo);
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
async ApplyUpdate() {
|
|
178
|
+
const { manifest, messages, moduleInfo } = this;
|
|
179
|
+
if (moduleInfo.install && moduleInfo.version !== moduleInfo.install) {
|
|
180
|
+
let { apply } = moduleInfo.version === "*" ? { apply: true } : await import_inquirer.default.prompt({
|
|
181
|
+
name: "apply",
|
|
182
|
+
type: "confirm",
|
|
183
|
+
message: messages.devrequests.install.applyUpdate(
|
|
184
|
+
moduleInfo.install,
|
|
185
|
+
moduleInfo.version
|
|
186
|
+
),
|
|
187
|
+
default: "Y"
|
|
188
|
+
});
|
|
189
|
+
if (apply) {
|
|
190
|
+
moduleInfo.version = moduleInfo.install;
|
|
191
|
+
delete moduleInfo.install;
|
|
192
|
+
manifest.writeModule(this.name, this.moduleInfo);
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
const createRequestHandler = () => new RequestHandlerFactory().Create();
|
|
198
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
199
|
+
0 && (module.exports = {
|
|
200
|
+
RequestHandlerFactory,
|
|
201
|
+
createRequestHandler
|
|
202
|
+
});
|
|
203
|
+
//# sourceMappingURL=RequestHandlerFactory.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/factories/RequestHandlerFactory.ts"],
|
|
4
|
+
"sourcesContent": ["import { spawn } from 'child_process';\nimport inquirer from 'inquirer';\nimport { createSpinner } from 'nanospinner';\nimport path from 'path';\nimport { LogMessages } from '~/localisation/en-GB';\nimport GitHubCliModuleProvider from '~/providers/GitHubCliModuleProvider';\n\nimport ManifestProvider from '~/providers/ManifestProvider';\nimport { appRootDir, joinPath } from '~/providers/file-provider';\nimport { isDebug } from '~/util/debug';\nimport { Logger } from '~/util/logger';\n\nexport class RequestHandlerFactory {\n debug = isDebug();\n log = Logger;\n messages = LogMessages;\n manifest = new ManifestProvider(); // Load cli-manifest.json\n\n basePath = path.join(appRootDir);\n name = 'request-handler-localdevelopment';\n cmd = 'Zengenti.Contensis.RequestHandler.LocalDevelopment';\n\n prerelease;\n\n get exePath() {\n return path.join(this.basePath, `${this.name}-${this.moduleInfo.version}`);\n }\n\n get moduleInfo() {\n return (\n this.manifest.getModule(this.name) || {\n github: 'contensis/request-handler-localdevelopment',\n version: '*',\n }\n );\n }\n\n constructor(prerelease = false) {\n this.prerelease = prerelease;\n }\n\n // Use the factory to create a request handler instance\n // handling the download and updating of the external binary\n async Create() {\n const { moduleInfo } = this;\n const firstUse = !moduleInfo?.version || moduleInfo?.version === '*';\n\n if (firstUse) {\n // Create cli-manifest.json\n this.manifest.writeModule(this.name, this.moduleInfo);\n\n // Download for first time use (await)\n await this.CheckUpdate({ verbose: true });\n }\n\n // Apply any downloaded/pending update so we launch that version\n await this.ApplyUpdate();\n\n // Fire an async update check and continue working in the background (do not await)\n if (!firstUse) this.CheckUpdate();\n\n // Return a RequestHandler ready to invoke\n return this.CreateInvoke(this);\n }\n\n CreateInvoke(self = this) {\n // Hoist the vars we need from `this` as we lose scope\n // when the function is returned from the Create() method\n const { debug, log, messages, cmd, exePath } = self;\n\n // Invoke request handler method\n return async (args: string[]) => {\n const child = spawn(joinPath(exePath, cmd), args, { stdio: 'inherit' });\n\n if (args?.length && debug)\n log.warning(\n `Spawning process with supplied args: ${JSON.stringify(\n child.spawnargs,\n null,\n 2\n )}`\n );\n\n let isRunning = false;\n\n // Log child output through event listeners\n child?.stdout?.on('data', data => {\n isRunning = true;\n log.raw(data);\n });\n\n child?.stderr?.on('data', data => {\n log.error(data);\n });\n\n child.on('spawn', () => {\n isRunning = true;\n log.help(messages.devrequests.spawn());\n });\n\n child.on('exit', code => {\n isRunning = false;\n\n log[code === 0 ? 'success' : 'warning'](\n messages.devrequests.exited(code)\n );\n });\n\n child.on('error', error => {\n isRunning = false;\n log.error(messages.devrequests.errored(error));\n });\n\n await new Promise(resolve => setTimeout(resolve, 2000));\n\n // keep the method running until we can return\n while (true === true) {\n if (!isRunning) return;\n await new Promise(resolve => setTimeout(resolve, 1000));\n }\n };\n }\n\n async CheckUpdate({ verbose = false }: { verbose?: boolean } = {}) {\n const { debug, log, manifest, messages, moduleInfo } = this;\n const github = new GitHubCliModuleProvider(moduleInfo.github);\n // Find latest version\n const release = await github.FindLatestRelease();\n if (verbose || debug)\n if (release)\n log.info(\n `${messages.devrequests.install.download(\n moduleInfo.github,\n release.tag_name\n )}\\n${release.html_url}`\n );\n else\n log.warning(messages.devrequests.install.notFound(moduleInfo.github));\n\n // Should we download an update?\n if (\n release?.tag_name &&\n ![moduleInfo.version, moduleInfo.install].includes(release.tag_name)\n ) {\n // Download platform-specific release asset\n const downloadPath = path.join(\n this.basePath,\n `${this.name}-${release.tag_name}`\n );\n\n // add spinner while downloading\n const spinner = createSpinner(\n messages.devrequests.install.downloading(\n moduleInfo.github,\n release.tag_name\n )\n );\n if (verbose || debug) {\n spinner.start();\n }\n try {\n await github.DownloadRelease(release, {\n path: downloadPath,\n // Map NodeJS os platform to release asset name\n platforms: [\n ['win32', 'win-x64'],\n ['darwin', 'osx-x64'],\n ['linux', 'linux-x64'],\n ],\n });\n } catch (ex: any) {\n spinner.error();\n log.error(\n messages.devrequests.install.downloadFail(\n moduleInfo.github,\n release.tag_name\n ),\n ex\n );\n } finally {\n if (verbose || debug)\n spinner.success({\n text: messages.devrequests.install.downloaded(\n moduleInfo.github,\n release.tag_name\n ),\n });\n\n // Update module info with downloaded release\n this.moduleInfo.install = release.tag_name;\n // Write module info update to manifest so it installs on next invoke\n manifest.writeModule(this.name, this.moduleInfo);\n }\n }\n }\n\n async ApplyUpdate() {\n const { manifest, messages, moduleInfo } = this;\n\n if (moduleInfo.install && moduleInfo.version !== moduleInfo.install) {\n let { apply } =\n moduleInfo.version === '*'\n ? { apply: true }\n : await inquirer.prompt({\n name: 'apply',\n type: 'confirm',\n message: messages.devrequests.install.applyUpdate(\n moduleInfo.install,\n moduleInfo.version\n ),\n default: 'Y',\n });\n\n if (apply) {\n moduleInfo.version = moduleInfo.install;\n delete moduleInfo.install;\n manifest.writeModule(this.name, this.moduleInfo);\n\n // TODO: clean up user folder by deleting old version(s)}\n }\n }\n }\n}\n\nexport const createRequestHandler = () => new RequestHandlerFactory().Create();\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,2BAAsB;AACtB,sBAAqB;AACrB,yBAA8B;AAC9B,kBAAiB;AACjB,mBAA4B;AAC5B,qCAAoC;AAEpC,8BAA6B;AAC7B,2BAAqC;AACrC,mBAAwB;AACxB,oBAAuB;AAEhB,MAAM,sBAAsB;AAAA,EACjC,YAAQ,sBAAQ;AAAA,EAChB,MAAM;AAAA,EACN,WAAW;AAAA,EACX,WAAW,IAAI,wBAAAA,QAAiB;AAAA,EAEhC,WAAW,YAAAC,QAAK,KAAK,+BAAU;AAAA,EAC/B,OAAO;AAAA,EACP,MAAM;AAAA,EAEN;AAAA,EAEA,IAAI,UAAU;AACZ,WAAO,YAAAA,QAAK,KAAK,KAAK,UAAU,GAAG,KAAK,QAAQ,KAAK,WAAW,SAAS;AAAA,EAC3E;AAAA,EAEA,IAAI,aAAa;AACf,WACE,KAAK,SAAS,UAAU,KAAK,IAAI,KAAK;AAAA,MACpC,QAAQ;AAAA,MACR,SAAS;AAAA,IACX;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AC;AAAA,MACH,SAAS,IAAP;AACA,gBAAQ,MAAM;AACd,YAAI;AAAA,UACF,SAAS,YAAY,QAAQ;AAAA,YAC3B,WAAW;AAAA,YACX,QAAQ;AAAA,UACV;AAAA,UACA;AAAA,QACF;AAAA,MACF,UAAE;AACA,YAAI,WAAW;AACb,kBAAQ,QAAQ;AAAA,YACd,MAAM,SAAS,YAAY,QAAQ;AAAA,cACjC,WAAW;AAAA,cACX,QAAQ;AAAA,YACV;AAAA,UACF,CAAC;AAGH,aAAK,WAAW,UAAU,QAAQ;AAElC,iBAAS,YAAY,KAAK,MAAM,KAAK,UAAU;AAAA,MACjD;AAAA,IACF;AAAA,EACF;AAAA,EAEA,MAAM,cAAc;AAClB,UAAM,EAAE,UAAU,UAAU,WAAW,IAAI;AAE3C,QAAI,WAAW,WAAW,WAAW,YAAY,WAAW,SAAS;AACnE,UAAI,EAAE,MAAM,IACV,WAAW,YAAY,MACnB,EAAE,OAAO,KAAK,IACd,MAAM,gBAAAE,QAAS,OAAO;AAAA,QACpB,MAAM;AAAA,QACN,MAAM;AAAA,QACN,SAAS,SAAS,YAAY,QAAQ;AAAA,UACpC,WAAW;AAAA,UACX,WAAW;AAAA,QACb;AAAA,QACA,SAAS;AAAA,MACX,CAAC;AAEP,UAAI,OAAO;AACT,mBAAW,UAAU,WAAW;AAChC,eAAO,WAAW;AAClB,iBAAS,YAAY,KAAK,MAAM,KAAK,UAAU;AAAA,MAGjD;AAAA,IACF;AAAA,EACF;AACF;AAEO,MAAM,uBAAuB,MAAM,IAAI,sBAAsB,EAAE,OAAO;",
|
|
6
|
+
"names": ["ManifestProvider", "path", "GitHubCliModuleProvider", "inquirer"]
|
|
7
|
+
}
|
|
@@ -293,8 +293,16 @@ ${import_logger.Logger.errorText(">>")} Available commands:`,
|
|
|
293
293
|
return import_logger.Logger.infoText(status);
|
|
294
294
|
}
|
|
295
295
|
},
|
|
296
|
-
get: (id, env, projectId) => `[${env}]
|
|
297
|
-
|
|
296
|
+
get: (id, branch, version, env, projectId) => `[${env}] ${version && version !== "latest" ? `Found v${version}` : "Latest block versions"} for ${import_logger.Logger.infoText(`${branch}/`)}${import_logger.Logger.highlightText(
|
|
297
|
+
id
|
|
298
|
+
)} in project ${projectId}
|
|
299
|
+
`,
|
|
300
|
+
noGet: (id, branch, version, env, projectId) => `[${env}] Did not find ${version ? `v${version}` : "any block versions"} for ${import_logger.Logger.highlightText(id)} in branch ${import_logger.Logger.infoText(
|
|
301
|
+
branch
|
|
302
|
+
)} in ${import_logger.Logger.infoText(projectId)} project`,
|
|
303
|
+
noGetTip: () => `Check the available blocks and branches in this project by running "list blocks"`,
|
|
304
|
+
list: (env, projectId) => `[${env}] Blocks in project ${projectId}
|
|
305
|
+
`,
|
|
298
306
|
noList: (env, projectId) => `[${env}] Cannot retrieve blocks in project ${projectId}`,
|
|
299
307
|
getLogs: (id, branch, env, projectId) => `[${env}] Requesting logs from block ${import_logger.Logger.highlightText(
|
|
300
308
|
id
|
|
@@ -311,9 +319,6 @@ ${import_logger.Logger.errorText(">>")} Available commands:`,
|
|
|
311
319
|
failedPush: (id, env, projectId) => `[${env}] Unable to push block ${import_logger.Logger.highlightText(
|
|
312
320
|
id
|
|
313
321
|
)} in project ${projectId}`,
|
|
314
|
-
latestVersion: (version, id, env, projectId) => `[${env}] Found latest block version ${import_logger.Logger.highlightText(
|
|
315
|
-
id
|
|
316
|
-
)} in project ${projectId} ${import_logger.Logger.highlightText(version)}`,
|
|
317
322
|
failedParsingVersion: () => `Did not find a "version.versionNo" in response`,
|
|
318
323
|
actionComplete: (action, id, env, projectId) => `[${env}] Action ${import_logger.Logger.highlightText(
|
|
319
324
|
action
|
|
@@ -455,6 +460,24 @@ ${git.type === "github" ? `Add a "New repository secret"` : `Expand "Variables"
|
|
|
455
460
|
blockIdQuestion: () => `Please enter your block id, this should be unquie and in kebab case e.g ${import_logger.Logger.highlightText(
|
|
456
461
|
"my-awesome-website"
|
|
457
462
|
)}`
|
|
463
|
+
},
|
|
464
|
+
devrequests: {
|
|
465
|
+
install: {
|
|
466
|
+
notFound: (repo) => `Could not find a release in ${repo} repo - please check github`,
|
|
467
|
+
download: (repo, version) => `Found release ${repo} ${version}`,
|
|
468
|
+
downloading: (repo, version) => `Downloading ${repo} ${version}`,
|
|
469
|
+
downloadFail: (repo, version) => `Problem downloading release ${version} from ${repo}`,
|
|
470
|
+
downloaded: (repo, version) => `Downloaded ${repo} ${version}`,
|
|
471
|
+
applyUpdate: (version, existing) => `Use updated version ${version} ${import_logger.Logger.infoText(
|
|
472
|
+
`(replaces ${existing})`
|
|
473
|
+
)}?`
|
|
474
|
+
},
|
|
475
|
+
launch: () => `Launching request handler for local development`,
|
|
476
|
+
spawn: () => `If you see a firewall popup requesting network access, it is safe to approve`,
|
|
477
|
+
exited: (code) => `Request handler exited with code ${code}
|
|
478
|
+
`,
|
|
479
|
+
errored: (error) => `Could not launch request handler due to error
|
|
480
|
+
${error}`
|
|
458
481
|
}
|
|
459
482
|
};
|
|
460
483
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/localisation/en-GB.ts"],
|
|
4
|
-
"sourcesContent": ["import {\n BlockActionType,\n BlockRunningStatus,\n MigrateModelsResult,\n MigrateStatus,\n} from 'migratortron';\nimport { GitHelper } from '~/util/git';\nimport { Logger } from '~/util/logger';\nimport { winSlash } from '~/util/os';\n\nexport const LogMessages = {\n app: {\n contensis: () => 'Contensis',\n quit: () => `Goodbye \uD83D\uDC4B\\n`,\n startup: (version: string) =>\n `v${version} \u00A9 2001-${new Date().getFullYear()} Zengenti \uD83C\uDDEC\uD83C\uDDE7. \\n - Creators of Contensis and purveyors of other fine software\\n\\n\uD83D\uDC4B Welcome to the contensis-cli\\n`,\n help: () =>\n 'Press [CTRL]+[C] or type \"quit\" to return to your system shell\\nPress [TAB] for suggestions\\n',\n suggestions: () =>\n `\\n${Logger.errorText('>>')} Press [TAB] for suggestions\\n`,\n autocomplete: () => `\\n${Logger.errorText('>>')} Available commands:`,\n unknownError: () => `Something went wrong...`,\n fileOutput: (format = 'json', path?: string) =>\n `Output ${format} file: ${Logger.infoText(path)}\\n`,\n noFileOutput: () => `No output written\\n`,\n },\n command: {\n notKnown: (command: string) => `${command} is not known`,\n },\n envs: {\n found: (num: number) =>\n `environments store found containing ${num} environment${\n num === 1 ? '' : 's'\n }`,\n tip: () =>\n `Connect to a Contensis cloud instance using \"contensis connect {cms alias}\"`,\n },\n connect: {\n command: {\n name: () => 'connect',\n example: () => `Example call:\\n > connect example-dev`,\n },\n args: {\n alias: {\n name: () => '<alias>',\n description: () => 'the Contensis Cloud alias to connect with',\n },\n },\n noEnv: () => `Cannot connect - no environment alias specified`,\n unreachable: (url: string, status: number) =>\n `Cannot reach ${url}${status ? ` - status ${status}` : ''}`,\n connected: (env: string) => `Current environment set to \"${env}\"`,\n help: () =>\n `Connect to a Contensis cloud instance using \"contensis connect {cms alias}\"`,\n projects: () => `Available projects:`,\n noProjects: () => `Cannot retrieve projects list`,\n tip: () =>\n `Introduce yourself with \"login {username}\" or \"login {clientId} -s {secret}\" or by passing credentials as options with your command`,\n },\n login: {\n command: {\n name: () => 'login',\n usage: () => `<user/clientId> [password] [-s <sharedSecret>]`,\n example: () =>\n `Example call:\\n > login myuserid\\n -- or --\\n > login {clientId} -s {sharedSecret}`,\n },\n args: {\n user: {\n name: () => '<user/clientId>',\n description: () => 'the username to login with',\n },\n password: {\n name: () => '[password]',\n description: () =>\n 'the password to use to login with (optional/insecure)',\n },\n secret: {\n name: () => '-s --sharedSecret <sharedSecret>',\n description: () =>\n 'the shared secret to use when logging in with a client id',\n },\n },\n passwordPrompt: (env?: string, userId?: string) =>\n userId\n ? `Enter password for ${userId}@${env}:`\n : `Please enter a password`,\n failed: (env: string, userId: string) =>\n `Unable to login to ${env} as ${userId}`,\n success: (env: string, userId: string) =>\n `User ${userId} connected to ${env} successfully\\n`,\n insecurePassword: () =>\n `Could not connect to local keystore - your password could be stored unencrypted!`,\n noEnv: () => `No environment set, use \"contensis connect {alias}\" first`,\n noUserId: () => `No user id specified`,\n },\n projects: {\n list: () => `Available projects:`,\n noList: () => `Cannot retrieve projects list`,\n set: (projectId: string) =>\n `Current project is set to ${Logger.highlightText(projectId)}`,\n failedSet: (projectId: string) =>\n `Project ${Logger.highlightText(projectId)} not found`,\n tip: () =>\n `You need to set your current working project with \"set project {projectId}\"`,\n created: (env: string, id: string) =>\n `[${env}] Created project ${Logger.highlightText(id)}`,\n failedCreate: (env: string, id: string) =>\n `[${env}] Unable to create project ${Logger.highlightText(id)}`,\n updated: (env: string, id: string) =>\n `[${env}] Updated project ${Logger.highlightText(id)}`,\n failedUpdate: (env: string, id: string) =>\n `[${env}] Unable to update project ${Logger.highlightText(id)}`,\n },\n migrate: {\n models: {\n result: (\n status: keyof MigrateModelsResult['project']['contentTypes']\n ) => {\n switch (status) {\n case 'created':\n case 'updated':\n return Logger.successText;\n case 'errors':\n return Logger.errorText;\n default:\n return Logger.infoText;\n }\n },\n },\n status: (status: MigrateStatus) => {\n switch (status) {\n case 'no change':\n return Logger.successText;\n case 'create':\n case 'two-pass':\n case 'update':\n case 'delete':\n return Logger.warningText;\n case 'error':\n case 'not found':\n return Logger.errorText;\n default:\n return Logger.infoText;\n }\n },\n },\n models: {\n list: (projectId: string) =>\n `Content models in ${Logger.highlightText(projectId)}:`,\n noList: (projectId: string) =>\n `[${projectId}] Cannot retrieve content models`,\n get: (projectId: string, id: string) =>\n `[${projectId}] Content models ${Logger.infoText(`[ ${id} ]`)}`,\n failedGet: (projectId: string, id: string) =>\n `[${projectId}] Unable to get content models ${Logger.highlightText(id)}`,\n },\n nodes: {\n imported: (env: string, commit: boolean, count: number) =>\n `[${env}] ${commit ? `Imported` : `Will import`} ${count} nodes`,\n failedImport: (env: string) => `[${env}] Unable to import nodes`,\n removed: (env: string, commit: boolean, root: string) =>\n `[${env}] ${commit ? `Deleted` : `Will delete`} nodes at ${root}`,\n failedRemove: (env: string) => `[${env}] Unable to delete nodes`,\n notFound: (env: string) => `[${env}] Nodes were not found `,\n commitTip: () => `Add --commit flag to commit the previewed changes`,\n failedGet: (projectId: string) =>\n `[${projectId}] Cannot retrieve nodes from Site view`,\n get: (projectId: string, root: string, depth: number) =>\n `[${projectId}] Site view nodes at: ${Logger.highlightText(root)}${\n depth ? ` to a depth of ${depth}` : ``\n }\\n`,\n noChange: (env: string) => `[${env}] No changes to be made`,\n },\n contenttypes: {\n list: (projectId: string) =>\n `Content types in ${Logger.highlightText(projectId)}:`,\n get: (projectId: string, id: string) =>\n `[${projectId}] Content type ${Logger.highlightText(id)}`,\n failedGet: (projectId: string, id: string) =>\n `[${projectId}] Unable to get content type ${Logger.highlightText(id)}`,\n created: (projectId: string, id: string, status?: string) =>\n `[${projectId}] Content type ${status}d ${Logger.highlightText(id)}`,\n removed: (env: string, id: string, commit: boolean) =>\n `[${env}] ${\n commit ? `Deleted` : `Will delete`\n } content type ${Logger.highlightText(id)}`,\n failedRemove: (env: string, id: string) =>\n `[${env}] Unable to delete content type ${Logger.highlightText(id)}`,\n },\n components: {\n list: (projectId: string) =>\n `Components in ${Logger.highlightText(projectId)}:`,\n get: (projectId: string, id: string) =>\n `[${projectId}] Component ${Logger.highlightText(id)}`,\n failedGet: (projectId: string, id: string) =>\n `[${projectId}] Unable to get component ${Logger.highlightText(id)}`,\n created: (projectId: string, id: string, status?: string) =>\n `[${projectId}] Component ${status}d ${Logger.highlightText(id)}`,\n removed: (env: string, id: string, commit: boolean) =>\n `[${env}] ${\n commit ? `Deleted` : `Will delete`\n } component ${Logger.highlightText(id)}`,\n failedRemove: (env: string, id: string) =>\n `[${env}] Unable to delete component ${Logger.highlightText(id)}`,\n },\n version: {\n set: (env: string, versionStatus: string) =>\n `[${env}] Content version status set to \"${versionStatus}\"`,\n invalid: (versionStatus: string) =>\n `Content version status \"${versionStatus}\" is not valid, allowed values are \"published\" or \"latest\".`,\n noEnv: () =>\n `No Contensis environment set, connect to your Contensis cloud instance using \"contensis connect {cms alias}\"`,\n },\n entries: {\n imported: (env: string, commit: boolean, count: number) =>\n `[${env}] ${commit ? `Imported` : `Will import`} ${count} entries`,\n failedImport: (env: string) => `[${env}] Unable to import entries`,\n removed: (env: string, commit: boolean) =>\n `[${env}] ${commit ? `Deleted` : `Will delete`} entries`,\n failedRemove: (env: string) => `[${env}] Unable to delete entries`,\n notFound: (env: string) => `[${env}] Entries were not found`,\n commitTip: () => `Add --commit flag to commit the previewed changes`,\n },\n keys: {\n list: (env: string) => `[${env}] API keys:`,\n noList: (env: string) => `[${env}] Cannot retrieve API keys`,\n created: (env: string, name: string) =>\n `[${env}] Created API key ${Logger.highlightText(name)}`,\n tip: () =>\n `Assign your new key to a role with \"set role assignments\", or create a new role with \"create role\"`,\n failedCreate: (env: string, name: string) =>\n `[${env}] Unable to create API key ${Logger.highlightText(name)}`,\n failedUpdate: (env: string, name: string) =>\n `[${env}] Unable to update API key ${Logger.highlightText(name)}`,\n removed: (env: string, id: string) =>\n `[${env}] Deleted API key ${Logger.highlightText(id)}`,\n failedRemove: (env: string, id: string) =>\n `[${env}] Unable to delete API key ${Logger.highlightText(id)}`,\n },\n proxies: {\n list: (env: string, projectId: string | undefined) =>\n `[${env}] Retrieved proxies in project ${projectId}:`,\n noList: (env: string, projectId: string | undefined) =>\n `[${env}] Cannot retrieve proxies in project ${projectId}`,\n // noneExist: () => `Create a role with \"create renderer\"`,\n failedGet: (env: string, name: string, projectId: string) =>\n `[${env}] Unable to find proxy ${Logger.highlightText(\n name\n )} in project ${projectId}`,\n created: (env: string, name: string, projectId: string) =>\n `[${env}] Created proxy ${Logger.highlightText(\n name\n )} in project ${projectId}\\n`,\n failedCreate: (env: string, name: string, projectId: string) =>\n `[${env}] Unable to create proxy ${Logger.highlightText(\n name\n )} in project ${projectId}`,\n setPayload: () => `Updating proxy with details\\n`,\n set: () => `Succesfully updated proxy\\n`,\n failedSet: (env: string, name: string, projectId: string) =>\n `[${env}] Unable to update proxy ${Logger.highlightText(\n name\n )} in project ${projectId}`,\n removed: (env: string, id: string, projectId: string) =>\n `[${env}] Deleted proxy ${Logger.highlightText(\n id\n )} in project ${projectId}\\n`,\n failedRemove: (env: string, id: string, projectId: string) =>\n `[${env}] Unable to delete proxy ${Logger.highlightText(\n id\n )} in project ${projectId}`,\n },\n renderers: {\n list: (env: string, projectId: string | undefined) =>\n `[${env}] Retrieved renderers in project ${projectId}:`,\n noList: (env: string, projectId: string | undefined) =>\n `[${env}] Cannot retrieve renderers in project ${projectId}`,\n // noneExist: () => `Create a role with \"create renderer\"`,\n failedGet: (env: string, name: string, projectId: string) =>\n `[${env}] Unable to find renderer ${Logger.highlightText(\n name\n )} in project ${projectId}`,\n created: (env: string, name: string, projectId: string) =>\n `[${env}] Created renderer ${Logger.highlightText(\n name\n )} in project ${projectId}\\n`,\n failedCreate: (env: string, name: string, projectId: string) =>\n `[${env}] Unable to create renderer ${Logger.highlightText(\n name\n )} in project ${projectId}`,\n setPayload: () => `Updating renderer with details\\n`,\n set: () => `Succesfully updated renderer\\n`,\n failedSet: (env: string, name: string, projectId: string) =>\n `[${env}] Unable to update renderer ${Logger.highlightText(\n name\n )} in project ${projectId}`,\n removed: (env: string, id: string, projectId: string) =>\n `[${env}] Deleted renderer ${Logger.highlightText(\n id\n )} in project ${projectId}\\n`,\n failedRemove: (env: string, id: string, projectId: string) =>\n `[${env}] Unable to delete renderer ${Logger.highlightText(\n id\n )} in project ${projectId}`,\n },\n roles: {\n list: (env: string) => `[${env}] Retrieved roles`,\n noList: (env: string) => `[${env}] Cannot retrieve roles`,\n noneExist: () => `Create a role with \"create role\"`,\n failedGet: (env: string, name: string) =>\n `[${env}] Unable to find role ${Logger.highlightText(name)}`,\n created: (env: string, name: string) =>\n `[${env}] Created role ${Logger.highlightText(name)}\\n`,\n tip: () =>\n `Give access to your role with \"set role assignments\", allow your role to do things with \"set role permissions\"`,\n failedCreate: (env: string, name?: string) =>\n `[${env}] Unable to create role ${Logger.highlightText(name)}`,\n setPayload: () => `Updating role with details\\n`,\n set: () => `Succesfully updated role\\n`,\n failedSet: (env: string, name?: string) =>\n `[${env}] Unable to update role ${Logger.highlightText(name)}`,\n removed: (env: string, id: string) =>\n `[${env}] Deleted role ${Logger.highlightText(id)}\\n`,\n failedRemove: (env: string, id: string) =>\n `[${env}] Unable to delete role ${Logger.highlightText(id)}`,\n },\n blocks: {\n runningStatus: (status: BlockRunningStatus | 'broken') => {\n switch (status) {\n case 'available':\n return Logger.successText(status);\n case 'pending':\n case 'starting':\n case 'stopped':\n return Logger.warningText(status);\n case 'degraded':\n case 'faulted':\n case 'broken':\n return Logger.errorText(status);\n default:\n return Logger.infoText(status);\n }\n },\n get: (id: string, env: string, projectId?: string) =>\n `[${env}] Block ${id} in project ${projectId}:`,\n list: (env: string, projectId?: string) =>\n `[${env}] Blocks in project ${projectId}:`,\n noList: (env: string, projectId?: string) =>\n `[${env}] Cannot retrieve blocks in project ${projectId}`,\n getLogs: (id: string, branch: string, env: string, projectId?: string) =>\n `[${env}] Requesting logs from block ${Logger.highlightText(\n id\n )} in branch ${branch} in project ${projectId}`,\n failedGetLogs: (id: string, env: string, projectId?: string) =>\n `[${env}] Unable to fetch block logs for ${Logger.highlightText(\n id\n )} in project ${projectId}`,\n tryPush: (id: string, branch: string, env: string, projectId?: string) =>\n `[${env}] Request to push block ${Logger.highlightText(\n id\n )} in branch ${branch} in project ${projectId}`,\n pushed: (id: string, branch: string, env: string, projectId?: string) =>\n `[${env}] Pushed block ${Logger.highlightText(\n id\n )} in branch ${branch} in project ${projectId}`,\n failedPush: (id: string, env: string, projectId?: string) =>\n `[${env}] Unable to push block ${Logger.highlightText(\n id\n )} in project ${projectId}`,\n latestVersion: (\n version: string,\n id: string,\n env: string,\n projectId?: string\n ) =>\n `[${env}] Found latest block version ${Logger.highlightText(\n id\n )} in project ${projectId} ${Logger.highlightText(version)}`,\n failedParsingVersion: () =>\n `Did not find a \"version.versionNo\" in response`,\n actionComplete: (\n action: BlockActionType,\n id: string,\n env: string,\n projectId?: string\n ) =>\n `[${env}] Action ${Logger.highlightText(\n action\n )} on ${Logger.highlightText(\n id\n )} in project ${projectId} requested successfully`,\n actionFailed: (\n action: BlockActionType,\n id: string,\n env: string,\n projectId?: string\n ) =>\n `[${env}] Problem executing ${action} on block ${Logger.highlightText(\n id\n )} in project ${projectId}`,\n deleted: (id: string, env: string, projectId?: string) =>\n `[${env}] Deleted block ${Logger.highlightText(\n id\n )} in project ${projectId}`,\n failedDelete: (id: string, env: string, projectId?: string) =>\n `[${env}] Unable to delete block ${Logger.highlightText(\n id\n )} in project ${projectId}`,\n stopFollow: (id: string, env: string, projectId?: string) =>\n `[${env}]\\n\\n \uD83D\uDC4C stop fetching new ${Logger.highlightText(\n id\n )} logs in project ${projectId}`,\n timeoutFollow: (id: string, env: string, projectId?: string) =>\n `[${env}]\\n\\n \uD83E\uDD0F pausing fetching new ${Logger.highlightText(\n id\n )} logs in project ${projectId} due to too many requests`,\n },\n webhooks: {\n list: (env: string) => `[${env}] Webhook subscriptions:`,\n noList: (env: string) => `[${env}] Cannot retrieve webhook subscriptions`,\n noneExist: () => `No webhook subscriptions exist`,\n created: (env: string, name: string) =>\n `[${env}] Created Webhook subscription ${Logger.highlightText(name)}`,\n failedCreate: (env: string, name: string) =>\n `[${env}] Unable to create Webhook subscription ${Logger.highlightText(\n name\n )}`,\n deleted: (env: string, id: string) =>\n `[${env}] Deleted Webhook subscription ${Logger.highlightText(id)}`,\n failedDelete: (env: string, id: string) =>\n `[${env}] Unable to delete Webhook subscription ${Logger.highlightText(\n id\n )}`,\n },\n workflows: {\n list: (env: string) => `[${env}] Retrieved workflows`,\n noList: (env: string) => `[${env}] Cannot retrieve workflows`,\n noneExist: () => `No workflows found`,\n failedGet: (env: string, name: string) =>\n `[${env}] Unable to find workflow ${Logger.highlightText(name)}`,\n },\n devinit: {\n intro: () => `Contensis developer environment initialisation`,\n //`This will initialise your local working directory to develop with the current connected Contensis project`,\n projectDetails: (\n name: string,\n env: string,\n projectId: string,\n blockId: string,\n git: GitHelper\n ) =>\n `\n Project: ${Logger.standardText(name)}\n - Home: ${Logger.standardText(git.gitcwd())}\n - Repository: ${Logger.standardText(git.home)} \n - Block id: ${Logger.highlightText(blockId)}\n \n Connect to Contensis instance: ${Logger.standardText(env)}\n - Project id: ${Logger.standardText(projectId)}\n `,\n developmentKey: (name: string, existing: boolean) =>\n ` - ${\n !existing ? 'Create development API key' : 'Development API key found'\n }: ${Logger[!existing ? 'highlightText' : 'standardText'](name)}`,\n deploymentKey: (name: string, existing: boolean) =>\n ` - ${\n !existing ? 'Create deployment API key' : 'Deployment API key found'\n }: ${Logger[!existing ? 'highlightText' : 'standardText'](name)}`,\n ciIntro: (git: GitHelper, location: 'git' | 'env') =>\n `We will create API keys with permissions to use this project with Contensis, and add a job to your CI that will deploy a container build.\n ${\n location === 'git'\n ? `We will ask you to add secrets/variables to your git repository to give your workflow permission to push a Block to Contensis.\n ${Logger.infoText(`You could visit ${git.secretsUri} to check that you can see repository settings, \n a page not found generally indicates you need to ask the repo owner for permission to add repository secrets, \n or ask the repo owner to add these secrets for you.`)}`\n : ''\n }`,\n ciDetails: (filename: string) =>\n `Add push-block job to CI file: ${Logger.highlightText(filename)}\\n`,\n ciMultipleChoices: () =>\n `Multiple GitHub workflow files found\\n${Logger.infoText(\n `Tell us which GitHub workflow builds a container image after each push:`\n )}`,\n ciMultipleBuildJobChoices: () =>\n `Multiple build jobs found in workflow\\n${Logger.infoText(\n `Choose the build job that produces a fresh container image to push to a block:`\n )}`,\n ciMultipleJobChoices: () =>\n `Other jobs found in workflow\\n${Logger.infoText(\n `Choose the job that produces a fresh container image we can push to a block:`\n )}`,\n ciMultipleAppImageVarChoices: () =>\n `Do one of these variables point to your tagged app image?\\n${Logger.infoText(\n `we have included a default choice - ensure your build image is tagged exactly the same as this`\n )}`,\n ciEnterOwnAppImagePrompt: (git: GitHelper) =>\n `Tell us the registry uri your app image is tagged and pushed with (\u23CE accept default) \\n${Logger.infoText(\n `Tip: ${\n git.type === 'github'\n ? `GitHub context variables available\\nhttps://docs.github.com/en/actions/learn-github-actions/variables#using-contexts-to-access-variable-values`\n : `GitLab CI/CD variables available\\nhttps://docs.gitlab.com/ee/ci/variables/`\n }`\n )}\\n`,\n confirm: () =>\n `Confirm these details are correct so we can make changes to your project`,\n createDevKey: (keyName: string, existing: boolean) =>\n `${\n !existing ? 'Created' : 'Checked permissions for'\n } development API key ${Logger.standardText(keyName)}`,\n createDeployKey: (keyName: string, existing: boolean) =>\n `${\n !existing ? 'Created' : 'Checked permissions for'\n } deployment API key ${Logger.standardText(keyName)}`,\n createKeyFail: (keyName: string, existing: boolean) =>\n `Failed to ${\n !existing ? 'create' : 'update'\n } API key ${Logger.highlightText(keyName)}`,\n writeEnvFile: () => `Written .env file to project home directory`,\n useEnvFileTip: () =>\n `You should alter existing project code that connects a Contensis client to use the variables from this file`,\n writeCiFile: (ciFilePath: string) =>\n `Updated CI file ${Logger.standardText(winSlash(ciFilePath))}`,\n ciFileNoChanges: (ciFilePath: string) =>\n `No updates needed for CI file ${Logger.standardText(\n winSlash(ciFilePath)\n )}`,\n ciBlockTip: (blockId: string, env: string, projectId: string) =>\n `A job is included to deploy your built container image to ${Logger.standardText(\n projectId\n )} at ${Logger.standardText(env)} in a block called ${Logger.standardText(\n blockId\n )}`,\n addGitSecretsIntro: () =>\n `We have created an API key that allows you to deploy your app image to a Contensis Block but we need you to add these details to your GitLab repository.`,\n addGitSecretsHelp: (git: GitHelper, id?: string, secret?: string) =>\n `Add secrets or variables in your repository's settings page\\n\\nGo to ${Logger.highlightText(\n git.secretsUri\n )}\\n\\n${\n git.type === 'github'\n ? `Add a \"New repository secret\"`\n : `Expand \"Variables\" and hit \"Add variable\"`\n }\\n\\n ${\n git.type === 'github' ? `Secret name:` : `Key:`\n } ${Logger.highlightText(`CONTENSIS_CLIENT_ID`)}\\n ${\n git.type === 'github' ? `Secret:` : `Value:`\n } ${Logger.standardText(\n id\n )}\\n\\n ${`Add one more secret/variable to the repository`}\\n\\n ${\n git.type === 'github' ? `Secret name:` : `Key:`\n } ${Logger.highlightText(`CONTENSIS_SHARED_SECRET`)}\\n ${\n git.type === 'github' ? `Secret:` : `Value:`\n } ${Logger.standardText(secret)}`,\n accessTokenFetch: () =>\n `Please wait, fetching Delivery API access token \u23F3`,\n accessTokenSuccess: (token: string) =>\n `Successfully fetched Delivery API token\\n ${Logger.infoText(token)}`,\n accessTokenFailed: () =>\n `Something went wrong! If the problem persists, please contact our support team \uD83D\uDEDF`,\n accessTokenPermission: () =>\n `We need permission to fetch your Delivery API token, please try again \u26A0\uFE0F`,\n clientDetailsLocation: () =>\n `Which option would you like to use for storing your client ID and secret`,\n clientDetailsInGit: (git: GitHelper) =>\n `${\n git.type === 'github' ? 'GitHub' : 'GitLab'\n } variables (recommended for public repositories)`,\n clientDetailsInEnv: () =>\n `Env variables (recommended for private repositories)`,\n success: () => `Contensis developer environment initialisation complete`,\n partialSuccess: () =>\n `Contensis developer environment initialisation completed with errors`,\n failed: () => `Contensis developer environment initialisation failed`,\n dryRun: () =>\n `Contensis developer environment initialisation dry run completed`,\n dryRunKeyMessage: (dryRun: boolean) =>\n dryRun ? '<< not created: dry-run >>' : undefined,\n noChanges: () =>\n `No changes were made to your project, run the command again without the ${Logger.highlightText(\n '--dry-run'\n )} flag to update your project with these changes`,\n startProjectTip: () =>\n `Start up your project in the normal way for development`,\n blockIdQuestion: () =>\n `Please enter your block id, this should be unquie and in kebab case e.g ${Logger.highlightText(\n 'my-awesome-website'\n )}`,\n },\n};\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAOA,oBAAuB;AACvB,gBAAyB;AAElB,MAAM,cAAc;AAAA,EACzB,KAAK;AAAA,IACH,WAAW,MAAM;AAAA,IACjB,MAAM,MAAM;AAAA;AAAA,IACZ,SAAS,CAAC,YACR,IAAI,qBAAkB,IAAI,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AAgB,MACd;AAAA,IACF,QAAQ,MAAM;AAAA,IACd,QAAQ,MACN;AAAA,IACF,kBAAkB,CAAC,WACjB,SAAS,+BAA+B;AAAA,IAC1C,WAAW,MACT,2EAA2E,qBAAO;AAAA,MAChF;AAAA,IACF;AAAA,IACF,iBAAiB,MACf;AAAA,IACF,iBAAiB,MACf,2EAA2E,qBAAO;AAAA,MAChF;AAAA,IACF;AAAA,EACJ;AACF;",
|
|
4
|
+
"sourcesContent": ["import {\n BlockActionType,\n BlockRunningStatus,\n MigrateModelsResult,\n MigrateStatus,\n} from 'migratortron';\nimport { GitHelper } from '~/util/git';\nimport { Logger } from '~/util/logger';\nimport { winSlash } from '~/util/os';\n\nexport const LogMessages = {\n app: {\n contensis: () => 'Contensis',\n quit: () => `Goodbye \uD83D\uDC4B\\n`,\n startup: (version: string) =>\n `v${version} \u00A9 2001-${new Date().getFullYear()} Zengenti \uD83C\uDDEC\uD83C\uDDE7. \\n - Creators of Contensis and purveyors of other fine software\\n\\n\uD83D\uDC4B Welcome to the contensis-cli\\n`,\n help: () =>\n 'Press [CTRL]+[C] or type \"quit\" to return to your system shell\\nPress [TAB] for suggestions\\n',\n suggestions: () =>\n `\\n${Logger.errorText('>>')} Press [TAB] for suggestions\\n`,\n autocomplete: () => `\\n${Logger.errorText('>>')} Available commands:`,\n unknownError: () => `Something went wrong...`,\n fileOutput: (format = 'json', path?: string) =>\n `Output ${format} file: ${Logger.infoText(path)}\\n`,\n noFileOutput: () => `No output written\\n`,\n },\n command: {\n notKnown: (command: string) => `${command} is not known`,\n },\n envs: {\n found: (num: number) =>\n `environments store found containing ${num} environment${\n num === 1 ? '' : 's'\n }`,\n tip: () =>\n `Connect to a Contensis cloud instance using \"contensis connect {cms alias}\"`,\n },\n connect: {\n command: {\n name: () => 'connect',\n example: () => `Example call:\\n > connect example-dev`,\n },\n args: {\n alias: {\n name: () => '<alias>',\n description: () => 'the Contensis Cloud alias to connect with',\n },\n },\n noEnv: () => `Cannot connect - no environment alias specified`,\n unreachable: (url: string, status: number) =>\n `Cannot reach ${url}${status ? ` - status ${status}` : ''}`,\n connected: (env: string) => `Current environment set to \"${env}\"`,\n help: () =>\n `Connect to a Contensis cloud instance using \"contensis connect {cms alias}\"`,\n projects: () => `Available projects:`,\n noProjects: () => `Cannot retrieve projects list`,\n tip: () =>\n `Introduce yourself with \"login {username}\" or \"login {clientId} -s {secret}\" or by passing credentials as options with your command`,\n },\n login: {\n command: {\n name: () => 'login',\n usage: () => `<user/clientId> [password] [-s <sharedSecret>]`,\n example: () =>\n `Example call:\\n > login myuserid\\n -- or --\\n > login {clientId} -s {sharedSecret}`,\n },\n args: {\n user: {\n name: () => '<user/clientId>',\n description: () => 'the username to login with',\n },\n password: {\n name: () => '[password]',\n description: () =>\n 'the password to use to login with (optional/insecure)',\n },\n secret: {\n name: () => '-s --sharedSecret <sharedSecret>',\n description: () =>\n 'the shared secret to use when logging in with a client id',\n },\n },\n passwordPrompt: (env?: string, userId?: string) =>\n userId\n ? `Enter password for ${userId}@${env}:`\n : `Please enter a password`,\n failed: (env: string, userId: string) =>\n `Unable to login to ${env} as ${userId}`,\n success: (env: string, userId: string) =>\n `User ${userId} connected to ${env} successfully\\n`,\n insecurePassword: () =>\n `Could not connect to local keystore - your password could be stored unencrypted!`,\n noEnv: () => `No environment set, use \"contensis connect {alias}\" first`,\n noUserId: () => `No user id specified`,\n },\n projects: {\n list: () => `Available projects:`,\n noList: () => `Cannot retrieve projects list`,\n set: (projectId: string) =>\n `Current project is set to ${Logger.highlightText(projectId)}`,\n failedSet: (projectId: string) =>\n `Project ${Logger.highlightText(projectId)} not found`,\n tip: () =>\n `You need to set your current working project with \"set project {projectId}\"`,\n created: (env: string, id: string) =>\n `[${env}] Created project ${Logger.highlightText(id)}`,\n failedCreate: (env: string, id: string) =>\n `[${env}] Unable to create project ${Logger.highlightText(id)}`,\n updated: (env: string, id: string) =>\n `[${env}] Updated project ${Logger.highlightText(id)}`,\n failedUpdate: (env: string, id: string) =>\n `[${env}] Unable to update project ${Logger.highlightText(id)}`,\n },\n migrate: {\n models: {\n result: (\n status: keyof MigrateModelsResult['project']['contentTypes']\n ) => {\n switch (status) {\n case 'created':\n case 'updated':\n return Logger.successText;\n case 'errors':\n return Logger.errorText;\n default:\n return Logger.infoText;\n }\n },\n },\n status: (status: MigrateStatus) => {\n switch (status) {\n case 'no change':\n return Logger.successText;\n case 'create':\n case 'two-pass':\n case 'update':\n case 'delete':\n return Logger.warningText;\n case 'error':\n case 'not found':\n return Logger.errorText;\n default:\n return Logger.infoText;\n }\n },\n },\n models: {\n list: (projectId: string) =>\n `Content models in ${Logger.highlightText(projectId)}:`,\n noList: (projectId: string) =>\n `[${projectId}] Cannot retrieve content models`,\n get: (projectId: string, id: string) =>\n `[${projectId}] Content models ${Logger.infoText(`[ ${id} ]`)}`,\n failedGet: (projectId: string, id: string) =>\n `[${projectId}] Unable to get content models ${Logger.highlightText(id)}`,\n },\n nodes: {\n imported: (env: string, commit: boolean, count: number) =>\n `[${env}] ${commit ? `Imported` : `Will import`} ${count} nodes`,\n failedImport: (env: string) => `[${env}] Unable to import nodes`,\n removed: (env: string, commit: boolean, root: string) =>\n `[${env}] ${commit ? `Deleted` : `Will delete`} nodes at ${root}`,\n failedRemove: (env: string) => `[${env}] Unable to delete nodes`,\n notFound: (env: string) => `[${env}] Nodes were not found `,\n commitTip: () => `Add --commit flag to commit the previewed changes`,\n failedGet: (projectId: string) =>\n `[${projectId}] Cannot retrieve nodes from Site view`,\n get: (projectId: string, root: string, depth: number) =>\n `[${projectId}] Site view nodes at: ${Logger.highlightText(root)}${\n depth ? ` to a depth of ${depth}` : ``\n }\\n`,\n noChange: (env: string) => `[${env}] No changes to be made`,\n },\n contenttypes: {\n list: (projectId: string) =>\n `Content types in ${Logger.highlightText(projectId)}:`,\n get: (projectId: string, id: string) =>\n `[${projectId}] Content type ${Logger.highlightText(id)}`,\n failedGet: (projectId: string, id: string) =>\n `[${projectId}] Unable to get content type ${Logger.highlightText(id)}`,\n created: (projectId: string, id: string, status?: string) =>\n `[${projectId}] Content type ${status}d ${Logger.highlightText(id)}`,\n removed: (env: string, id: string, commit: boolean) =>\n `[${env}] ${\n commit ? `Deleted` : `Will delete`\n } content type ${Logger.highlightText(id)}`,\n failedRemove: (env: string, id: string) =>\n `[${env}] Unable to delete content type ${Logger.highlightText(id)}`,\n },\n components: {\n list: (projectId: string) =>\n `Components in ${Logger.highlightText(projectId)}:`,\n get: (projectId: string, id: string) =>\n `[${projectId}] Component ${Logger.highlightText(id)}`,\n failedGet: (projectId: string, id: string) =>\n `[${projectId}] Unable to get component ${Logger.highlightText(id)}`,\n created: (projectId: string, id: string, status?: string) =>\n `[${projectId}] Component ${status}d ${Logger.highlightText(id)}`,\n removed: (env: string, id: string, commit: boolean) =>\n `[${env}] ${\n commit ? `Deleted` : `Will delete`\n } component ${Logger.highlightText(id)}`,\n failedRemove: (env: string, id: string) =>\n `[${env}] Unable to delete component ${Logger.highlightText(id)}`,\n },\n version: {\n set: (env: string, versionStatus: string) =>\n `[${env}] Content version status set to \"${versionStatus}\"`,\n invalid: (versionStatus: string) =>\n `Content version status \"${versionStatus}\" is not valid, allowed values are \"published\" or \"latest\".`,\n noEnv: () =>\n `No Contensis environment set, connect to your Contensis cloud instance using \"contensis connect {cms alias}\"`,\n },\n entries: {\n imported: (env: string, commit: boolean, count: number) =>\n `[${env}] ${commit ? `Imported` : `Will import`} ${count} entries`,\n failedImport: (env: string) => `[${env}] Unable to import entries`,\n removed: (env: string, commit: boolean) =>\n `[${env}] ${commit ? `Deleted` : `Will delete`} entries`,\n failedRemove: (env: string) => `[${env}] Unable to delete entries`,\n notFound: (env: string) => `[${env}] Entries were not found`,\n commitTip: () => `Add --commit flag to commit the previewed changes`,\n },\n keys: {\n list: (env: string) => `[${env}] API keys:`,\n noList: (env: string) => `[${env}] Cannot retrieve API keys`,\n created: (env: string, name: string) =>\n `[${env}] Created API key ${Logger.highlightText(name)}`,\n tip: () =>\n `Assign your new key to a role with \"set role assignments\", or create a new role with \"create role\"`,\n failedCreate: (env: string, name: string) =>\n `[${env}] Unable to create API key ${Logger.highlightText(name)}`,\n failedUpdate: (env: string, name: string) =>\n `[${env}] Unable to update API key ${Logger.highlightText(name)}`,\n removed: (env: string, id: string) =>\n `[${env}] Deleted API key ${Logger.highlightText(id)}`,\n failedRemove: (env: string, id: string) =>\n `[${env}] Unable to delete API key ${Logger.highlightText(id)}`,\n },\n proxies: {\n list: (env: string, projectId: string | undefined) =>\n `[${env}] Retrieved proxies in project ${projectId}:`,\n noList: (env: string, projectId: string | undefined) =>\n `[${env}] Cannot retrieve proxies in project ${projectId}`,\n // noneExist: () => `Create a role with \"create renderer\"`,\n failedGet: (env: string, name: string, projectId: string) =>\n `[${env}] Unable to find proxy ${Logger.highlightText(\n name\n )} in project ${projectId}`,\n created: (env: string, name: string, projectId: string) =>\n `[${env}] Created proxy ${Logger.highlightText(\n name\n )} in project ${projectId}\\n`,\n failedCreate: (env: string, name: string, projectId: string) =>\n `[${env}] Unable to create proxy ${Logger.highlightText(\n name\n )} in project ${projectId}`,\n setPayload: () => `Updating proxy with details\\n`,\n set: () => `Succesfully updated proxy\\n`,\n failedSet: (env: string, name: string, projectId: string) =>\n `[${env}] Unable to update proxy ${Logger.highlightText(\n name\n )} in project ${projectId}`,\n removed: (env: string, id: string, projectId: string) =>\n `[${env}] Deleted proxy ${Logger.highlightText(\n id\n )} in project ${projectId}\\n`,\n failedRemove: (env: string, id: string, projectId: string) =>\n `[${env}] Unable to delete proxy ${Logger.highlightText(\n id\n )} in project ${projectId}`,\n },\n renderers: {\n list: (env: string, projectId: string | undefined) =>\n `[${env}] Retrieved renderers in project ${projectId}:`,\n noList: (env: string, projectId: string | undefined) =>\n `[${env}] Cannot retrieve renderers in project ${projectId}`,\n // noneExist: () => `Create a role with \"create renderer\"`,\n failedGet: (env: string, name: string, projectId: string) =>\n `[${env}] Unable to find renderer ${Logger.highlightText(\n name\n )} in project ${projectId}`,\n created: (env: string, name: string, projectId: string) =>\n `[${env}] Created renderer ${Logger.highlightText(\n name\n )} in project ${projectId}\\n`,\n failedCreate: (env: string, name: string, projectId: string) =>\n `[${env}] Unable to create renderer ${Logger.highlightText(\n name\n )} in project ${projectId}`,\n setPayload: () => `Updating renderer with details\\n`,\n set: () => `Succesfully updated renderer\\n`,\n failedSet: (env: string, name: string, projectId: string) =>\n `[${env}] Unable to update renderer ${Logger.highlightText(\n name\n )} in project ${projectId}`,\n removed: (env: string, id: string, projectId: string) =>\n `[${env}] Deleted renderer ${Logger.highlightText(\n id\n )} in project ${projectId}\\n`,\n failedRemove: (env: string, id: string, projectId: string) =>\n `[${env}] Unable to delete renderer ${Logger.highlightText(\n id\n )} in project ${projectId}`,\n },\n roles: {\n list: (env: string) => `[${env}] Retrieved roles`,\n noList: (env: string) => `[${env}] Cannot retrieve roles`,\n noneExist: () => `Create a role with \"create role\"`,\n failedGet: (env: string, name: string) =>\n `[${env}] Unable to find role ${Logger.highlightText(name)}`,\n created: (env: string, name: string) =>\n `[${env}] Created role ${Logger.highlightText(name)}\\n`,\n tip: () =>\n `Give access to your role with \"set role assignments\", allow your role to do things with \"set role permissions\"`,\n failedCreate: (env: string, name?: string) =>\n `[${env}] Unable to create role ${Logger.highlightText(name)}`,\n setPayload: () => `Updating role with details\\n`,\n set: () => `Succesfully updated role\\n`,\n failedSet: (env: string, name?: string) =>\n `[${env}] Unable to update role ${Logger.highlightText(name)}`,\n removed: (env: string, id: string) =>\n `[${env}] Deleted role ${Logger.highlightText(id)}\\n`,\n failedRemove: (env: string, id: string) =>\n `[${env}] Unable to delete role ${Logger.highlightText(id)}`,\n },\n blocks: {\n runningStatus: (status: BlockRunningStatus | 'broken') => {\n switch (status) {\n case 'available':\n return Logger.successText(status);\n case 'pending':\n case 'starting':\n case 'stopped':\n return Logger.warningText(status);\n case 'degraded':\n case 'faulted':\n case 'broken':\n return Logger.errorText(status);\n default:\n return Logger.infoText(status);\n }\n },\n get: (\n id: string,\n branch: string,\n version: string,\n env: string,\n projectId?: string\n ) =>\n `[${env}] ${\n version && version !== 'latest'\n ? `Found v${version}`\n : 'Latest block versions'\n } for ${Logger.infoText(`${branch}/`)}${Logger.highlightText(\n id\n )} in project ${projectId}\\n`,\n noGet: (\n id: string,\n branch: string,\n version: string,\n env: string,\n projectId?: string\n ) =>\n `[${env}] Did not find ${\n version ? `v${version}` : 'any block versions'\n } for ${Logger.highlightText(id)} in branch ${Logger.infoText(\n branch\n )} in ${Logger.infoText(projectId)} project`,\n noGetTip: () =>\n `Check the available blocks and branches in this project by running \"list blocks\"`,\n list: (env: string, projectId?: string) =>\n `[${env}] Blocks in project ${projectId}\\n`,\n noList: (env: string, projectId?: string) =>\n `[${env}] Cannot retrieve blocks in project ${projectId}`,\n getLogs: (id: string, branch: string, env: string, projectId?: string) =>\n `[${env}] Requesting logs from block ${Logger.highlightText(\n id\n )} in branch ${branch} in project ${projectId}`,\n failedGetLogs: (id: string, env: string, projectId?: string) =>\n `[${env}] Unable to fetch block logs for ${Logger.highlightText(\n id\n )} in project ${projectId}`,\n tryPush: (id: string, branch: string, env: string, projectId?: string) =>\n `[${env}] Request to push block ${Logger.highlightText(\n id\n )} in branch ${branch} in project ${projectId}`,\n pushed: (id: string, branch: string, env: string, projectId?: string) =>\n `[${env}] Pushed block ${Logger.highlightText(\n id\n )} in branch ${branch} in project ${projectId}`,\n failedPush: (id: string, env: string, projectId?: string) =>\n `[${env}] Unable to push block ${Logger.highlightText(\n id\n )} in project ${projectId}`,\n failedParsingVersion: () =>\n `Did not find a \"version.versionNo\" in response`,\n actionComplete: (\n action: BlockActionType,\n id: string,\n env: string,\n projectId?: string\n ) =>\n `[${env}] Action ${Logger.highlightText(\n action\n )} on ${Logger.highlightText(\n id\n )} in project ${projectId} requested successfully`,\n actionFailed: (\n action: BlockActionType,\n id: string,\n env: string,\n projectId?: string\n ) =>\n `[${env}] Problem executing ${action} on block ${Logger.highlightText(\n id\n )} in project ${projectId}`,\n deleted: (id: string, env: string, projectId?: string) =>\n `[${env}] Deleted block ${Logger.highlightText(\n id\n )} in project ${projectId}`,\n failedDelete: (id: string, env: string, projectId?: string) =>\n `[${env}] Unable to delete block ${Logger.highlightText(\n id\n )} in project ${projectId}`,\n stopFollow: (id: string, env: string, projectId?: string) =>\n `[${env}]\\n\\n \uD83D\uDC4C stop fetching new ${Logger.highlightText(\n id\n )} logs in project ${projectId}`,\n timeoutFollow: (id: string, env: string, projectId?: string) =>\n `[${env}]\\n\\n \uD83E\uDD0F pausing fetching new ${Logger.highlightText(\n id\n )} logs in project ${projectId} due to too many requests`,\n },\n webhooks: {\n list: (env: string) => `[${env}] Webhook subscriptions:`,\n noList: (env: string) => `[${env}] Cannot retrieve webhook subscriptions`,\n noneExist: () => `No webhook subscriptions exist`,\n created: (env: string, name: string) =>\n `[${env}] Created Webhook subscription ${Logger.highlightText(name)}`,\n failedCreate: (env: string, name: string) =>\n `[${env}] Unable to create Webhook subscription ${Logger.highlightText(\n name\n )}`,\n deleted: (env: string, id: string) =>\n `[${env}] Deleted Webhook subscription ${Logger.highlightText(id)}`,\n failedDelete: (env: string, id: string) =>\n `[${env}] Unable to delete Webhook subscription ${Logger.highlightText(\n id\n )}`,\n },\n workflows: {\n list: (env: string) => `[${env}] Retrieved workflows`,\n noList: (env: string) => `[${env}] Cannot retrieve workflows`,\n noneExist: () => `No workflows found`,\n failedGet: (env: string, name: string) =>\n `[${env}] Unable to find workflow ${Logger.highlightText(name)}`,\n },\n devinit: {\n intro: () => `Contensis developer environment initialisation`,\n //`This will initialise your local working directory to develop with the current connected Contensis project`,\n projectDetails: (\n name: string,\n env: string,\n projectId: string,\n blockId: string,\n git: GitHelper\n ) =>\n `\n Project: ${Logger.standardText(name)}\n - Home: ${Logger.standardText(git.gitcwd())}\n - Repository: ${Logger.standardText(git.home)} \n - Block id: ${Logger.highlightText(blockId)}\n \n Connect to Contensis instance: ${Logger.standardText(env)}\n - Project id: ${Logger.standardText(projectId)}\n `,\n developmentKey: (name: string, existing: boolean) =>\n ` - ${\n !existing ? 'Create development API key' : 'Development API key found'\n }: ${Logger[!existing ? 'highlightText' : 'standardText'](name)}`,\n deploymentKey: (name: string, existing: boolean) =>\n ` - ${\n !existing ? 'Create deployment API key' : 'Deployment API key found'\n }: ${Logger[!existing ? 'highlightText' : 'standardText'](name)}`,\n ciIntro: (git: GitHelper, location: 'git' | 'env') =>\n `We will create API keys with permissions to use this project with Contensis, and add a job to your CI that will deploy a container build.\n ${\n location === 'git'\n ? `We will ask you to add secrets/variables to your git repository to give your workflow permission to push a Block to Contensis.\n ${Logger.infoText(`You could visit ${git.secretsUri} to check that you can see repository settings, \n a page not found generally indicates you need to ask the repo owner for permission to add repository secrets, \n or ask the repo owner to add these secrets for you.`)}`\n : ''\n }`,\n ciDetails: (filename: string) =>\n `Add push-block job to CI file: ${Logger.highlightText(filename)}\\n`,\n ciMultipleChoices: () =>\n `Multiple GitHub workflow files found\\n${Logger.infoText(\n `Tell us which GitHub workflow builds a container image after each push:`\n )}`,\n ciMultipleBuildJobChoices: () =>\n `Multiple build jobs found in workflow\\n${Logger.infoText(\n `Choose the build job that produces a fresh container image to push to a block:`\n )}`,\n ciMultipleJobChoices: () =>\n `Other jobs found in workflow\\n${Logger.infoText(\n `Choose the job that produces a fresh container image we can push to a block:`\n )}`,\n ciMultipleAppImageVarChoices: () =>\n `Do one of these variables point to your tagged app image?\\n${Logger.infoText(\n `we have included a default choice - ensure your build image is tagged exactly the same as this`\n )}`,\n ciEnterOwnAppImagePrompt: (git: GitHelper) =>\n `Tell us the registry uri your app image is tagged and pushed with (\u23CE accept default) \\n${Logger.infoText(\n `Tip: ${\n git.type === 'github'\n ? `GitHub context variables available\\nhttps://docs.github.com/en/actions/learn-github-actions/variables#using-contexts-to-access-variable-values`\n : `GitLab CI/CD variables available\\nhttps://docs.gitlab.com/ee/ci/variables/`\n }`\n )}\\n`,\n confirm: () =>\n `Confirm these details are correct so we can make changes to your project`,\n createDevKey: (keyName: string, existing: boolean) =>\n `${\n !existing ? 'Created' : 'Checked permissions for'\n } development API key ${Logger.standardText(keyName)}`,\n createDeployKey: (keyName: string, existing: boolean) =>\n `${\n !existing ? 'Created' : 'Checked permissions for'\n } deployment API key ${Logger.standardText(keyName)}`,\n createKeyFail: (keyName: string, existing: boolean) =>\n `Failed to ${\n !existing ? 'create' : 'update'\n } API key ${Logger.highlightText(keyName)}`,\n writeEnvFile: () => `Written .env file to project home directory`,\n useEnvFileTip: () =>\n `You should alter existing project code that connects a Contensis client to use the variables from this file`,\n writeCiFile: (ciFilePath: string) =>\n `Updated CI file ${Logger.standardText(winSlash(ciFilePath))}`,\n ciFileNoChanges: (ciFilePath: string) =>\n `No updates needed for CI file ${Logger.standardText(\n winSlash(ciFilePath)\n )}`,\n ciBlockTip: (blockId: string, env: string, projectId: string) =>\n `A job is included to deploy your built container image to ${Logger.standardText(\n projectId\n )} at ${Logger.standardText(env)} in a block called ${Logger.standardText(\n blockId\n )}`,\n addGitSecretsIntro: () =>\n `We have created an API key that allows you to deploy your app image to a Contensis Block but we need you to add these details to your GitLab repository.`,\n addGitSecretsHelp: (git: GitHelper, id?: string, secret?: string) =>\n `Add secrets or variables in your repository's settings page\\n\\nGo to ${Logger.highlightText(\n git.secretsUri\n )}\\n\\n${\n git.type === 'github'\n ? `Add a \"New repository secret\"`\n : `Expand \"Variables\" and hit \"Add variable\"`\n }\\n\\n ${\n git.type === 'github' ? `Secret name:` : `Key:`\n } ${Logger.highlightText(`CONTENSIS_CLIENT_ID`)}\\n ${\n git.type === 'github' ? `Secret:` : `Value:`\n } ${Logger.standardText(\n id\n )}\\n\\n ${`Add one more secret/variable to the repository`}\\n\\n ${\n git.type === 'github' ? `Secret name:` : `Key:`\n } ${Logger.highlightText(`CONTENSIS_SHARED_SECRET`)}\\n ${\n git.type === 'github' ? `Secret:` : `Value:`\n } ${Logger.standardText(secret)}`,\n accessTokenFetch: () =>\n `Please wait, fetching Delivery API access token \u23F3`,\n accessTokenSuccess: (token: string) =>\n `Successfully fetched Delivery API token\\n ${Logger.infoText(token)}`,\n accessTokenFailed: () =>\n `Something went wrong! If the problem persists, please contact our support team \uD83D\uDEDF`,\n accessTokenPermission: () =>\n `We need permission to fetch your Delivery API token, please try again \u26A0\uFE0F`,\n clientDetailsLocation: () =>\n `Which option would you like to use for storing your client ID and secret`,\n clientDetailsInGit: (git: GitHelper) =>\n `${\n git.type === 'github' ? 'GitHub' : 'GitLab'\n } variables (recommended for public repositories)`,\n clientDetailsInEnv: () =>\n `Env variables (recommended for private repositories)`,\n success: () => `Contensis developer environment initialisation complete`,\n partialSuccess: () =>\n `Contensis developer environment initialisation completed with errors`,\n failed: () => `Contensis developer environment initialisation failed`,\n dryRun: () =>\n `Contensis developer environment initialisation dry run completed`,\n dryRunKeyMessage: (dryRun: boolean) =>\n dryRun ? '<< not created: dry-run >>' : undefined,\n noChanges: () =>\n `No changes were made to your project, run the command again without the ${Logger.highlightText(\n '--dry-run'\n )} flag to update your project with these changes`,\n startProjectTip: () =>\n `Start up your project in the normal way for development`,\n blockIdQuestion: () =>\n `Please enter your block id, this should be unquie and in kebab case e.g ${Logger.highlightText(\n 'my-awesome-website'\n )}`,\n },\n devrequests: {\n install: {\n notFound: (repo: string) =>\n `Could not find a release in ${repo} repo - please check github`,\n download: (repo: string, version: string) =>\n `Found release ${repo} ${version}`,\n downloading: (repo: string, version: string) =>\n `Downloading ${repo} ${version}`,\n downloadFail: (repo: string, version: string) =>\n `Problem downloading release ${version} from ${repo}`,\n downloaded: (repo: string, version: string) =>\n `Downloaded ${repo} ${version}`,\n applyUpdate: (version: string, existing: string) =>\n `Use updated version ${version} ${Logger.infoText(\n `(replaces ${existing})`\n )}?`,\n },\n launch: () => `Launching request handler for local development`,\n spawn: () =>\n `If you see a firewall popup requesting network access, it is safe to approve`,\n exited: (code: number | null) =>\n `Request handler exited with code ${code}\\n`,\n errored: (error: Error) =>\n `Could not launch request handler due to error \\n${error}`,\n },\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;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
|
|
|
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 DevRequests_to_RequestHanderCliArgs_exports = {};
|
|
20
|
+
__export(DevRequests_to_RequestHanderCliArgs_exports, {
|
|
21
|
+
buildSiteConfig: () => buildSiteConfig,
|
|
22
|
+
requestHandlerCliArgs: () => requestHandlerCliArgs
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(DevRequests_to_RequestHanderCliArgs_exports);
|
|
25
|
+
const buildSiteConfig = async (cli) => {
|
|
26
|
+
var _a;
|
|
27
|
+
const { currentEnv, env, log, messages } = cli;
|
|
28
|
+
const siteConfig = {
|
|
29
|
+
alias: cli.currentEnv,
|
|
30
|
+
projectId: cli.currentProject,
|
|
31
|
+
accessToken: "",
|
|
32
|
+
clientId: "",
|
|
33
|
+
sharedSecret: "",
|
|
34
|
+
blocks: [],
|
|
35
|
+
renderers: []
|
|
36
|
+
};
|
|
37
|
+
const getBlocks = async (contensis2) => {
|
|
38
|
+
const [err, blocksRaw] = await contensis2.blocks.GetBlocks();
|
|
39
|
+
if (err)
|
|
40
|
+
log.error(messages.blocks.noList(currentEnv, env.currentProject));
|
|
41
|
+
const blocks = [];
|
|
42
|
+
for (const block of blocksRaw || []) {
|
|
43
|
+
const [err2, versions] = await contensis2.blocks.GetBlockVersions(
|
|
44
|
+
block.id,
|
|
45
|
+
"default",
|
|
46
|
+
"latest"
|
|
47
|
+
);
|
|
48
|
+
if (err2 || (versions == null ? void 0 : versions.length) === 0)
|
|
49
|
+
log.warning(
|
|
50
|
+
messages.blocks.noGet(
|
|
51
|
+
block.id,
|
|
52
|
+
"default",
|
|
53
|
+
"latest",
|
|
54
|
+
currentEnv,
|
|
55
|
+
env.currentProject
|
|
56
|
+
)
|
|
57
|
+
);
|
|
58
|
+
if (versions == null ? void 0 : versions[0]) {
|
|
59
|
+
const v = versions[0];
|
|
60
|
+
blocks.push({
|
|
61
|
+
id: v.id,
|
|
62
|
+
baseUri: v.previewUrl,
|
|
63
|
+
staticPaths: v.staticPaths,
|
|
64
|
+
endpoints: v.endpoints,
|
|
65
|
+
versionNo: v.version.versionNo,
|
|
66
|
+
branch: v.source.branch
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
return blocks;
|
|
71
|
+
};
|
|
72
|
+
const contensis = await cli.ConnectContensis();
|
|
73
|
+
if (contensis) {
|
|
74
|
+
const [blocks, renderers] = await Promise.all([
|
|
75
|
+
getBlocks(contensis),
|
|
76
|
+
contensis.renderers.GetRenderers()
|
|
77
|
+
]);
|
|
78
|
+
siteConfig.blocks = blocks;
|
|
79
|
+
siteConfig.renderers = (_a = renderers == null ? void 0 : renderers[1]) == null ? void 0 : _a.map((r) => ({
|
|
80
|
+
id: r.id,
|
|
81
|
+
name: r.name,
|
|
82
|
+
assignedContentTypes: r.assignedContentTypes,
|
|
83
|
+
rules: r.rules
|
|
84
|
+
}));
|
|
85
|
+
}
|
|
86
|
+
return siteConfig;
|
|
87
|
+
};
|
|
88
|
+
const requestHandlerCliArgs = async (cli, overrideArgs = []) => {
|
|
89
|
+
var _a;
|
|
90
|
+
const args = overrideArgs ? typeof (overrideArgs == null ? void 0 : overrideArgs[0]) === "string" && overrideArgs[0].includes(" ", 2) ? overrideArgs[0].split(" ") : overrideArgs : [];
|
|
91
|
+
const siteConfig = await buildSiteConfig(cli);
|
|
92
|
+
if (!args.find((a) => a === "--alias"))
|
|
93
|
+
args.push("--alias", cli.currentEnv);
|
|
94
|
+
if (!args.find((a) => a === "--project-api-id"))
|
|
95
|
+
args.push("--project-api-id", cli.currentProject);
|
|
96
|
+
if (!args.find((a) => a === "--blocks-json"))
|
|
97
|
+
args.push("--blocks-json", JSON.stringify(siteConfig.blocks));
|
|
98
|
+
if (!args.find((a) => a === "--renderers-json"))
|
|
99
|
+
args.push("--renderers-json", JSON.stringify(siteConfig.renderers));
|
|
100
|
+
await cli.Login(cli.env.lastUserId, { silent: true });
|
|
101
|
+
const client = (_a = cli.auth) == null ? void 0 : _a.clientDetails;
|
|
102
|
+
if (client) {
|
|
103
|
+
if (!args.find((a) => a === "--client-id") && "clientId" in client)
|
|
104
|
+
args.push("--client-id", client.clientId);
|
|
105
|
+
if (!args.find((a) => a === "--client-secret") && "clientSecret" in client)
|
|
106
|
+
args.push("--client-secret", client.clientSecret);
|
|
107
|
+
if (!args.find((a) => a === "--username") && "username" in client)
|
|
108
|
+
args.push("--username", client.username);
|
|
109
|
+
if (!args.find((a) => a === "--password") && "password" in client)
|
|
110
|
+
args.push("--password", client.password);
|
|
111
|
+
}
|
|
112
|
+
return args;
|
|
113
|
+
};
|
|
114
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
115
|
+
0 && (module.exports = {
|
|
116
|
+
buildSiteConfig,
|
|
117
|
+
requestHandlerCliArgs
|
|
118
|
+
});
|
|
119
|
+
//# sourceMappingURL=DevRequests-to-RequestHanderCliArgs.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/mappers/DevRequests-to-RequestHanderCliArgs.ts"],
|
|
4
|
+
"sourcesContent": ["import { ContensisMigrationService } from 'migratortron';\nimport ContensisCli from '~/services/ContensisCliService';\n\ntype EndpointJson = {\n id: string;\n path: string;\n};\n\ntype BlockJson = {\n id: string;\n baseUri: string;\n staticPaths: string[];\n endpoints: EndpointJson[];\n versionNo: number;\n branch: string;\n};\n\ntype RendererJson = {\n id: string;\n name: string;\n rules: RendererRuleJson[];\n assignedContentTypes: string[];\n};\n\ntype RendererRuleJson = {\n return?: {\n blockId?: string;\n endpointId?: string | null;\n version?: string;\n };\n};\ninterface ISiteConfigYaml {\n alias: string;\n projectId: string;\n accessToken: string;\n clientId: string;\n sharedSecret: string;\n blocks: BlockJson[];\n renderers: RendererJson[];\n}\n\nexport const buildSiteConfig = async (cli: ContensisCli) => {\n const { currentEnv, env, log, messages } = cli;\n const siteConfig: ISiteConfigYaml = {\n alias: cli.currentEnv,\n projectId: cli.currentProject,\n accessToken: '',\n clientId: '',\n sharedSecret: '',\n blocks: [],\n renderers: [],\n };\n\n const getBlocks = async (contensis: ContensisMigrationService) => {\n const [err, blocksRaw] = await contensis.blocks.GetBlocks();\n if (err) log.error(messages.blocks.noList(currentEnv, env.currentProject));\n\n // const blocksRaw = await cli.PrintBlocks();\n\n const blocks: BlockJson[] = [];\n for (const block of blocksRaw || []) {\n // Retrieve block version\n const [err, versions] = await contensis.blocks.GetBlockVersions(\n block.id,\n 'default',\n 'latest'\n );\n if (err || versions?.length === 0)\n log.warning(\n messages.blocks.noGet(\n block.id,\n 'default',\n 'latest',\n currentEnv,\n env.currentProject\n )\n );\n if (versions?.[0]) {\n const v = versions[0];\n blocks.push({\n id: v.id,\n baseUri: v.previewUrl,\n staticPaths: v.staticPaths,\n endpoints: v.endpoints,\n versionNo: v.version.versionNo,\n branch: v.source.branch,\n });\n }\n }\n return blocks;\n };\n\n const contensis = await cli.ConnectContensis();\n if (contensis) {\n const [blocks, renderers] = await Promise.all([\n getBlocks(contensis),\n contensis.renderers.GetRenderers(),\n ]);\n\n siteConfig.blocks = blocks;\n siteConfig.renderers = renderers?.[1]?.map(r => ({\n id: r.id,\n name: r.name,\n assignedContentTypes: r.assignedContentTypes,\n rules: r.rules,\n }));\n }\n return siteConfig;\n};\n\nexport const requestHandlerCliArgs = async (\n cli: ContensisCli,\n overrideArgs: string[] = []\n) => {\n const args = overrideArgs\n ? typeof overrideArgs?.[0] === 'string' && overrideArgs[0].includes(' ', 2)\n ? overrideArgs[0].split(' ')\n : overrideArgs\n : []; // args could be [ '-c .\\\\site_config.yaml' ] or [ '-c', '.\\\\site_config.yaml' ]\n\n const siteConfig = await buildSiteConfig(cli);\n // Add required args\n if (!args.find(a => a === '--alias')) args.push('--alias', cli.currentEnv);\n if (!args.find(a => a === '--project-api-id'))\n args.push('--project-api-id', cli.currentProject);\n if (!args.find(a => a === '--blocks-json'))\n args.push('--blocks-json', JSON.stringify(siteConfig.blocks));\n if (!args.find(a => a === '--renderers-json'))\n args.push('--renderers-json', JSON.stringify(siteConfig.renderers));\n\n await cli.Login(cli.env.lastUserId, { silent: true }); // to hydrate the auth service\n const client = cli.auth?.clientDetails;\n if (client) {\n if (!args.find(a => a === '--client-id') && 'clientId' in client)\n args.push('--client-id', client.clientId);\n if (!args.find(a => a === '--client-secret') && 'clientSecret' in client)\n args.push('--client-secret', client.clientSecret);\n if (!args.find(a => a === '--username') && 'username' in client)\n args.push('--username', client.username);\n if (!args.find(a => a === '--password') && 'password' in client)\n args.push('--password', client.password);\n }\n\n return args;\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAyCO,MAAM,kBAAkB,OAAO,QAAsB;AAzC5D;AA0CE,QAAM,EAAE,YAAY,KAAK,KAAK,SAAS,IAAI;AAC3C,QAAM,aAA8B;AAAA,IAClC,OAAO,IAAI;AAAA,IACX,WAAW,IAAI;AAAA,IACf,aAAa;AAAA,IACb,UAAU;AA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