contensis-cli 1.3.1-beta.0 → 1.3.1-beta.10
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/README.md +78 -6
- package/dist/commands/copy.js +2 -2
- package/dist/commands/copy.js.map +2 -2
- package/dist/commands/create.js +1 -2
- package/dist/commands/create.js.map +1 -1
- package/dist/commands/globalOptions.js +16 -4
- package/dist/commands/globalOptions.js.map +2 -2
- package/dist/commands/import.js +1 -1
- package/dist/commands/import.js.map +2 -2
- package/dist/commands/index.js +4 -2
- package/dist/commands/index.js.map +2 -2
- package/dist/commands/list.js.map +1 -1
- package/dist/commands/login.js +1 -2
- package/dist/commands/login.js.map +1 -1
- package/dist/commands/push.js +102 -10
- package/dist/commands/push.js.map +3 -3
- package/dist/commands/remove.js +15 -4
- package/dist/commands/remove.js.map +2 -2
- package/dist/commands/set.js +2 -4
- package/dist/commands/set.js.map +1 -1
- package/dist/commands/update.js +70 -0
- package/dist/commands/update.js.map +7 -0
- package/dist/factories/RequestHandlerFactory.js +12 -5
- package/dist/factories/RequestHandlerFactory.js.map +2 -2
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/localisation/en-GB.js +19 -2
- package/dist/localisation/en-GB.js.map +2 -2
- package/dist/mappers/ContensisCliService-to-RequestHanderSiteConfigYaml.js.map +1 -1
- package/dist/mappers/DevInit-to-CIWorkflow.js +11 -6
- package/dist/mappers/DevInit-to-CIWorkflow.js.map +1 -1
- package/dist/mappers/DevRequests-to-RequestHanderCliArgs.js +4 -2
- package/dist/mappers/DevRequests-to-RequestHanderCliArgs.js.map +1 -1
- package/dist/models/CliService.d.js.map +1 -1
- package/dist/providers/CredentialProvider.js +11 -4
- package/dist/providers/CredentialProvider.js.map +2 -2
- package/dist/providers/GitHubCliModuleProvider.js +8 -10
- package/dist/providers/GitHubCliModuleProvider.js.map +1 -1
- package/dist/providers/HttpProvider.js +5 -4
- package/dist/providers/HttpProvider.js.map +1 -1
- package/dist/providers/ManifestProvider.js +1 -4
- package/dist/providers/ManifestProvider.js.map +1 -1
- package/dist/providers/SessionCacheProvider.js +26 -8
- package/dist/providers/SessionCacheProvider.js.map +2 -2
- package/dist/providers/file-provider.js +13 -11
- package/dist/providers/file-provider.js.map +1 -1
- package/dist/services/ContensisAuthService.js +1 -2
- package/dist/services/ContensisAuthService.js.map +1 -1
- package/dist/services/ContensisCliService.js +194 -127
- package/dist/services/ContensisCliService.js.map +3 -3
- package/dist/services/ContensisDevService.js +15 -18
- package/dist/services/ContensisDevService.js.map +2 -2
- package/dist/services/ContensisRoleService.js +8 -10
- package/dist/services/ContensisRoleService.js.map +1 -1
- package/dist/shell.js +31 -15
- package/dist/shell.js.map +2 -2
- package/dist/util/api-ids.js.map +1 -1
- package/dist/util/console.printer.js +15 -17
- package/dist/util/console.printer.js.map +2 -2
- package/dist/util/csv.formatter.js +8 -15
- package/dist/util/csv.formatter.js.map +2 -2
- package/dist/util/diff.js +6 -4
- package/dist/util/diff.js.map +1 -1
- package/dist/util/dotenv.js +1 -2
- package/dist/util/dotenv.js.map +1 -1
- package/dist/util/error.js.map +1 -1
- package/dist/util/fetch.js +4 -0
- package/dist/util/fetch.js.map +1 -1
- package/dist/util/git.js +8 -8
- package/dist/util/git.js.map +1 -1
- package/dist/util/gitignore.js +4 -0
- package/dist/util/gitignore.js.map +1 -1
- package/dist/util/html.formatter.js +70 -0
- package/dist/util/html.formatter.js.map +7 -0
- package/dist/util/index.js +5 -1
- package/dist/util/index.js.map +2 -2
- package/dist/util/json.formatter.js +6 -4
- package/dist/util/json.formatter.js.map +1 -1
- package/dist/util/logger.js +47 -53
- package/dist/util/logger.js.map +2 -2
- package/dist/util/os.js +4 -0
- package/dist/util/os.js.map +1 -1
- package/dist/util/xml.formatter.js +4 -0
- package/dist/util/xml.formatter.js.map +1 -1
- package/dist/util/yaml.js +1 -2
- package/dist/util/yaml.js.map +1 -1
- package/dist/version.js +1 -1
- package/dist/version.js.map +1 -1
- package/esbuild.config.js +12 -16
- package/package.json +31 -32
- package/src/commands/copy.ts +3 -1
- package/src/commands/globalOptions.ts +10 -3
- package/src/commands/import.ts +2 -0
- package/src/commands/index.ts +4 -0
- package/src/commands/push.ts +125 -1
- package/src/commands/remove.ts +20 -0
- package/src/commands/update.ts +84 -0
- package/src/factories/RequestHandlerFactory.ts +1 -1
- package/src/localisation/en-GB.ts +16 -1
- package/src/models/CliService.d.ts +1 -1
- package/src/providers/CredentialProvider.ts +2 -2
- package/src/providers/SessionCacheProvider.ts +26 -2
- package/src/services/ContensisCliService.ts +187 -49
- package/src/services/ContensisDevService.ts +2 -2
- package/src/shell.ts +20 -9
- package/src/util/console.printer.ts +23 -19
- package/src/util/csv.formatter.ts +1 -1
- package/src/util/html.formatter.ts +52 -0
- package/src/util/index.ts +1 -1
- package/src/util/logger.ts +17 -16
- package/src/version.ts +1 -1
- package/tsconfig.json +1 -1
|
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
20
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
25
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
26
|
mod
|
|
23
27
|
));
|
|
@@ -36,12 +40,10 @@ const jsonFormatter = (obj, fields) => JSON.stringify(limitFields(obj, fields),
|
|
|
36
40
|
const flattenObject = (obj) => (0, import_flat.flatten)((0, import_deep_cleaner.default)(obj, ["workflow"]), { maxDepth: 99 });
|
|
37
41
|
const unflattenObject = (obj) => (0, import_flat.unflatten)(obj, { overwrite: true });
|
|
38
42
|
const limitFields = (obj, fields) => {
|
|
39
|
-
if (!fields)
|
|
40
|
-
return obj;
|
|
43
|
+
if (!fields) return obj;
|
|
41
44
|
if (obj && Array.isArray(obj)) {
|
|
42
45
|
const arr = [];
|
|
43
|
-
for (const child of obj)
|
|
44
|
-
arr.push(limitFields(child, fields));
|
|
46
|
+
for (const child of obj) arr.push(limitFields(child, fields));
|
|
45
47
|
return arr;
|
|
46
48
|
}
|
|
47
49
|
if (obj && typeof obj === "object") {
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/util/json.formatter.ts"],
|
|
4
4
|
"sourcesContent": ["import { flatten, unflatten } from 'flat';\nimport cleaner from 'deep-cleaner';\n\n// Format a JSON object for a nice output\nexport const jsonFormatter = <T>(obj: T, fields?: string[]) =>\n JSON.stringify(limitFields(obj, fields), null, 2);\n\n// Flatten a JSON object such as an entry so there are no\n// nested object and the keys are presented like \"sys.version.versionNo\": \"1.0\"\nexport const flattenObject = (obj: any) =>\n flatten(cleaner(obj, ['workflow']), { maxDepth: 99 });\n\n// Unflatten a JSON object such as an entry so the arrays and\n// nested objects are reconstructed - the opposite of flattenObject\nexport const unflattenObject = (obj: any) =>\n unflatten(obj, { overwrite: true });\n\n// Will limit and sort an object's keys by an array of supplied fields\nexport const limitFields = (obj: any, fields?: string[]): any => {\n if (!fields) return obj;\n if (obj && Array.isArray(obj)) {\n const arr = [];\n for (const child of obj) arr.push(limitFields(child, fields));\n return arr;\n }\n\n if (obj && typeof obj === 'object') {\n const flattenedObj = flatten(obj) as any;\n const sortedObj = {} as any;\n for (const field of fields) {\n sortedObj[field] = flattenedObj[field];\n }\n\n return unflatten(sortedObj);\n }\n\n return obj;\n};\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAmC;AACnC,0BAAoB;AAGb,MAAM,gBAAgB,CAAI,KAAQ,WACvC,KAAK,UAAU,YAAY,KAAK,MAAM,GAAG,MAAM,CAAC;AAI3C,MAAM,gBAAgB,CAAC,YAC5B,yBAAQ,oBAAAA,SAAQ,KAAK,CAAC,UAAU,CAAC,GAAG,EAAE,UAAU,GAAG,CAAC;AAI/C,MAAM,kBAAkB,CAAC,YAC9B,uBAAU,KAAK,EAAE,WAAW,KAAK,CAAC;AAG7B,MAAM,cAAc,CAAC,KAAU,WAA2B;AAC/D,MAAI,CAAC,OAAQ,QAAO;AACpB,MAAI,OAAO,MAAM,QAAQ,GAAG,GAAG;AAC7B,UAAM,MAAM,CAAC;AACb,eAAW,SAAS,IAAK,KAAI,KAAK,YAAY,OAAO,MAAM,CAAC;AAC5D,WAAO;AAAA,EACT;AAEA,MAAI,OAAO,OAAO,QAAQ,UAAU;AAClC,UAAM,mBAAe,qBAAQ,GAAG;AAChC,UAAM,YAAY,CAAC;AACnB,eAAW,SAAS,QAAQ;AAC1B,gBAAU,KAAK,IAAI,aAAa,KAAK;AAAA,IACvC;AAEA,eAAO,uBAAU,SAAS;AAAA,EAC5B;AAEA,SAAO;AACT;",
|
|
6
6
|
"names": ["cleaner"]
|
|
7
7
|
}
|
package/dist/util/logger.js
CHANGED
|
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
20
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
25
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
26
|
mod
|
|
23
27
|
));
|
|
@@ -38,7 +42,7 @@ var import__ = require(".");
|
|
|
38
42
|
class Logger {
|
|
39
43
|
static isUserTerminal = !!process.stdout.columns;
|
|
40
44
|
static getPrefix = () => {
|
|
41
|
-
return Logger.isUserTerminal ? Logger.infoText(`[cli]`) : `[${(0, import_dateformat.default)(new Date(), "dd/mm HH:MM:ss")}]`;
|
|
45
|
+
return Logger.isUserTerminal ? Logger.infoText(`[cli]`) : `[${(0, import_dateformat.default)(/* @__PURE__ */ new Date(), "dd/mm HH:MM:ss")}]`;
|
|
42
46
|
};
|
|
43
47
|
static errorText = import_chalk.default.bold.red;
|
|
44
48
|
static warningText = import_chalk.default.keyword("orange");
|
|
@@ -62,63 +66,48 @@ ${Logger.infoText(
|
|
|
62
66
|
(0, import__.isSysError)(err) ? err.toString() : JSON.stringify(err, null, 2)
|
|
63
67
|
)}` : ""}`
|
|
64
68
|
)}${newline}`;
|
|
65
|
-
if (progress.active)
|
|
66
|
-
|
|
67
|
-
else
|
|
68
|
-
console.log(message);
|
|
69
|
+
if (progress.active) progress.current.interrupt(message);
|
|
70
|
+
else console.log(message);
|
|
69
71
|
};
|
|
70
|
-
static warning = (content) => {
|
|
72
|
+
static warning = (content, newline = "\n") => {
|
|
71
73
|
const message = `${Logger.getPrefix()} ${Logger.warningText(
|
|
72
74
|
`${Logger.isUserTerminal ? "\u26A0\uFE0F " : "[WARN]"} ${content}`
|
|
73
|
-
)}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
progress.current.interrupt(message);
|
|
77
|
-
else
|
|
78
|
-
console.log(message);
|
|
75
|
+
)}${newline}`;
|
|
76
|
+
if (progress.active) progress.current.interrupt(message);
|
|
77
|
+
else console.log(message);
|
|
79
78
|
};
|
|
80
79
|
static success = (content) => {
|
|
81
80
|
const message = `${Logger.getPrefix()} ${Logger.successText(
|
|
82
81
|
`${Logger.isUserTerminal ? "\u2705" : "[OK]"} ${content}`
|
|
83
82
|
)}`;
|
|
84
|
-
if (progress.active)
|
|
85
|
-
|
|
86
|
-
else
|
|
87
|
-
console.log(message);
|
|
83
|
+
if (progress.active) progress.current.interrupt(message);
|
|
84
|
+
else console.log(message);
|
|
88
85
|
};
|
|
89
86
|
static info = (content) => {
|
|
90
87
|
const message = `${Logger.getPrefix()} ${Logger.isUserTerminal ? import_chalk.default.bgCyan(" \u2139 ") : "[INFO]"} ${Logger.infoText(content)}`;
|
|
91
|
-
if (progress.active)
|
|
92
|
-
|
|
93
|
-
else
|
|
94
|
-
console.log(message);
|
|
88
|
+
if (progress.active) progress.current.interrupt(message);
|
|
89
|
+
else console.log(message);
|
|
95
90
|
};
|
|
96
91
|
static help = (content) => {
|
|
97
92
|
const message = `${Logger.getPrefix()} ${import_chalk.default.blue(
|
|
98
93
|
`${Logger.isUserTerminal ? "\u23E9" : "[HELP]"} ${content}`
|
|
99
94
|
)}
|
|
100
95
|
`;
|
|
101
|
-
if (progress.active)
|
|
102
|
-
|
|
103
|
-
else
|
|
104
|
-
console.log(message);
|
|
96
|
+
if (progress.active) progress.current.interrupt(message);
|
|
97
|
+
else console.log(message);
|
|
105
98
|
};
|
|
106
99
|
static standard = (content) => {
|
|
107
100
|
const message = `${Logger.getPrefix()} ${Logger.isUserTerminal ? "\u25FB\uFE0F" : "[STD]"}
|
|
108
101
|
${Logger.standardText(content)}`;
|
|
109
|
-
if (progress.active)
|
|
110
|
-
|
|
111
|
-
else
|
|
112
|
-
console.log(message);
|
|
102
|
+
if (progress.active) progress.current.interrupt(message);
|
|
103
|
+
else console.log(message);
|
|
113
104
|
progress.current.interrupt(message);
|
|
114
105
|
};
|
|
115
106
|
static debug = (content) => {
|
|
116
107
|
if (["true", "1"].includes(process.env.debug || "")) {
|
|
117
108
|
const message = `${Logger.getPrefix()} ${Logger.isUserTerminal ? import_chalk.default.bgGrey(" \u2699 ") : "[DEBUG]"} ${Logger.infoText(content)}`;
|
|
118
|
-
if (progress.active)
|
|
119
|
-
|
|
120
|
-
else
|
|
121
|
-
console.log(message);
|
|
109
|
+
if (progress.active) progress.current.interrupt(message);
|
|
110
|
+
else console.log(message);
|
|
122
111
|
}
|
|
123
112
|
};
|
|
124
113
|
static json = (content, depth = 9) => console.dir((0, import_deep_cleaner.default)(content), { colors: true, depth });
|
|
@@ -166,32 +155,32 @@ ${Logger.standardText(content)}`;
|
|
|
166
155
|
if (Array.isArray(item) && depth > 3)
|
|
167
156
|
if (item.length)
|
|
168
157
|
Logger.raw(import_chalk.default.grey(`${indent} [${item.join(", ")}]`));
|
|
169
|
-
else
|
|
158
|
+
else Logger.objectRecurse(item, depth + 1, `${indent} `);
|
|
159
|
+
else {
|
|
160
|
+
if (Array.isArray(item))
|
|
161
|
+
Logger.raw(
|
|
162
|
+
`${indent}${import_chalk.default.grey(`[`)}${item.join(", ")}${import_chalk.default.grey(
|
|
163
|
+
`]`
|
|
164
|
+
)}`
|
|
165
|
+
);
|
|
166
|
+
else if (typeof item === "object" && item)
|
|
170
167
|
Logger.objectRecurse(item, depth + 1, `${indent} `);
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
`]`
|
|
175
|
-
)}`
|
|
176
|
-
) : typeof item === "object" && item ? Logger.objectRecurse(item, depth + 1, `${indent} `) : Logger.raw(`${indent}${item}`);
|
|
177
|
-
} else
|
|
178
|
-
Logger.raw(`${indent}${item}`);
|
|
168
|
+
else Logger.raw(`${indent}${item}`);
|
|
169
|
+
}
|
|
170
|
+
} else Logger.raw(`${indent}${item}`);
|
|
179
171
|
}
|
|
180
172
|
} else {
|
|
181
173
|
let pos = 0;
|
|
182
174
|
for (const [key, value] of Object.entries(content)) {
|
|
183
|
-
if (key === "stack")
|
|
184
|
-
continue;
|
|
175
|
+
if (key === "stack") continue;
|
|
185
176
|
const thisIndent = pos === 0 ? `${indent.substring(0, indent.length - 2)}- ` : indent;
|
|
186
177
|
if (Array.isArray(value)) {
|
|
187
|
-
if (value.length)
|
|
188
|
-
Logger.raw(`${thisIndent}${import_chalk.default.bold.grey(key)}:`);
|
|
178
|
+
if (value.length) Logger.raw(`${thisIndent}${import_chalk.default.bold.grey(key)}:`);
|
|
189
179
|
for (const item of value) {
|
|
190
180
|
if (item && typeof item === "object") {
|
|
191
181
|
if (Array.isArray(item) && depth > 3)
|
|
192
182
|
Logger.raw(import_chalk.default.grey(`${indent} [${item.join(", ")}]`));
|
|
193
|
-
else
|
|
194
|
-
Logger.objectRecurse(item, depth + 1, `${indent} `);
|
|
183
|
+
else Logger.objectRecurse(item, depth + 1, `${indent} `);
|
|
195
184
|
} else {
|
|
196
185
|
Logger.raw(`${indent} ${item}`);
|
|
197
186
|
}
|
|
@@ -207,10 +196,8 @@ ${Logger.standardText(content)}`;
|
|
|
207
196
|
}
|
|
208
197
|
};
|
|
209
198
|
static raw = (content) => {
|
|
210
|
-
if (progress.active)
|
|
211
|
-
|
|
212
|
-
else
|
|
213
|
-
console.log(content);
|
|
199
|
+
if (progress.active) progress.current.interrupt(content);
|
|
200
|
+
else console.log(content);
|
|
214
201
|
};
|
|
215
202
|
static limits = (content, displayLength = 30, consoleWidth = process.stdout.columns, logMethod = console.info) => {
|
|
216
203
|
if (consoleWidth) {
|
|
@@ -247,8 +234,7 @@ const logError = (err = new Error("Undefined error"), msg, level = "error") => {
|
|
|
247
234
|
`);
|
|
248
235
|
return;
|
|
249
236
|
}
|
|
250
|
-
if ("stack" in error)
|
|
251
|
-
Logger.raw(` ${Logger.infoText(error.stack)}
|
|
237
|
+
if ("stack" in error) Logger.raw(` ${Logger.infoText(error.stack)}
|
|
252
238
|
`);
|
|
253
239
|
if ("data" in error)
|
|
254
240
|
Logger.raw(` ${Logger.infoText((0, import__.tryStringify)(error.data))}
|
|
@@ -288,6 +274,14 @@ const progress = {
|
|
|
288
274
|
current: { interrupt: (x) => {
|
|
289
275
|
} },
|
|
290
276
|
active: false
|
|
277
|
+
// done: () => new ProgressBar('', 0),
|
|
278
|
+
// colours: { green: '\u001b[42m \u001b[0m', red: '\u001b[41m \u001b[0m' },
|
|
279
|
+
// current: new ProgressBar(`:bar`, {
|
|
280
|
+
// complete: '=',
|
|
281
|
+
// incomplete: ' ',
|
|
282
|
+
// width: 20,
|
|
283
|
+
// total: 100,
|
|
284
|
+
// }),
|
|
291
285
|
};
|
|
292
286
|
// Annotate the CommonJS export names for ESM import in node:
|
|
293
287
|
0 && (module.exports = {
|
package/dist/util/logger.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/util/logger.ts"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable no-console */\nimport chalk from 'chalk';\nimport dateFormat from 'dateformat';\nimport deepCleaner from 'deep-cleaner';\nimport {\n ansiEscapeCodes,\n first,\n partition,\n strlen,\n} from 'printable-characters';\n// import ProgressBar from 'progress';\nimport { isSysError, tryStringify } from '.';\n\ntype LogMethod = (content: string) => void;\ntype LogErrorMethod = (content: string, err?: any, newline?: string) => void;\ntype LogJsonMethod = (content: any, depth?: number, indent?: string) => void;\ntype LogJsonDepthMethod = (content: any, depth?: number) => void;\ntype LogArrayMethod = (contentArray: string[]) => void;\ntype LogErrorFunc = (\n err: any,\n msg?: string,\n level?: 'error' | 'critical'\n) => void;\n\nexport class Logger {\n static isUserTerminal = !!process.stdout.columns;\n static getPrefix = () => {\n return Logger.isUserTerminal\n ? Logger.infoText(`[cli]`)\n : `[${dateFormat(new Date(), 'dd/mm HH:MM:ss')}]`;\n };\n static errorText = chalk.bold.red;\n static warningText = chalk.keyword('orange');\n static successText = chalk.keyword('green');\n static helpText = chalk.blue;\n static highlightText = chalk.yellow;\n static infoText = chalk.keyword('grey');\n static standardText = chalk.keyword('white');\n static boldText = chalk.bold;\n static critical: LogMethod = content => {\n const message = `${Logger.getPrefix()} ${Logger.errorText(\n '[CRITICAL]'\n )} ${content}`;\n console.log(message);\n };\n static error: LogErrorMethod = (content, err, newline = '\\n') => {\n const message = `${Logger.getPrefix()} ${Logger.errorText(\n `${Logger.isUserTerminal ? '\u274C' : '[ERROR]'} ${content}${\n err\n ? `\\n\\n${Logger.infoText(\n isSysError(err) ? err.toString() : JSON.stringify(err, null, 2)\n )}`\n : ''\n }`\n )}${newline}`;\n if (progress.active) progress.current.interrupt(message);\n else console.log(message);\n };\n static warning: LogMethod = content => {\n const message = `${Logger.getPrefix()} ${Logger.warningText(\n `${Logger.isUserTerminal ? '\u26A0\uFE0F ' : '[WARN]'} ${content}`\n )}\\n`;\n if (progress.active) progress.current.interrupt(message);\n else console.log(message);\n // }\n };\n static success: LogMethod = content => {\n const message = `${Logger.getPrefix()} ${Logger.successText(\n `${Logger.isUserTerminal ? '\u2705' : '[OK]'} ${content}`\n )}`;\n if (progress.active) progress.current.interrupt(message);\n else console.log(message);\n };\n static info: LogMethod = content => {\n const message = `${Logger.getPrefix()} ${\n Logger.isUserTerminal ? chalk.bgCyan(' \u2139 ') : '[INFO]'\n } ${Logger.infoText(content)}`;\n if (progress.active) progress.current.interrupt(message);\n else console.log(message);\n };\n static help: LogMethod = content => {\n const message = `${Logger.getPrefix()} ${chalk.blue(\n `${Logger.isUserTerminal ? '\u23E9' : '[HELP]'} ${content}`\n )}\\n`;\n if (progress.active) progress.current.interrupt(message);\n else console.log(message);\n };\n static standard: LogMethod = content => {\n const message = `${Logger.getPrefix()} ${\n Logger.isUserTerminal ? '\u25FB\uFE0F' : '[STD]'\n } \\n${Logger.standardText(content)}`;\n if (progress.active) progress.current.interrupt(message);\n else console.log(message);\n progress.current.interrupt(message);\n };\n static debug: LogMethod = content => {\n if (['true', '1'].includes(process.env.debug || '')) {\n const message = `${Logger.getPrefix()} ${\n Logger.isUserTerminal ? chalk.bgGrey(' \u2699 ') : '[DEBUG]'\n } ${Logger.infoText(content)}`;\n if (progress.active) progress.current.interrupt(message);\n else console.log(message);\n }\n };\n static json: LogJsonDepthMethod = (content, depth = 9) =>\n console.dir(deepCleaner(content), { colors: true, depth });\n static mixed: LogArrayMethod = contentArray =>\n console.log(`${Logger.getPrefix()} ${contentArray.join(' ')}`);\n static line = () =>\n Logger.raw(` ${Logger.infoText(`-------------------------------------`)}`);\n\n static object: LogJsonMethod = content => {\n for (const [key, value] of Object.entries(content || {})) {\n if (value && typeof value === 'object') {\n Logger.raw(` ${chalk.bold.grey(key)}:`);\n if (key === 'fields' && Array.isArray(value)) {\n for (const field of value || []) {\n Logger.raw(\n ` ${chalk.bold(field.id)}${\n field.id === content.entryTitleField\n ? '**'\n : field.validations.minCount?.value ||\n typeof field.validations.required?.message !== 'undefined'\n ? '*'\n : ''\n }: ${chalk.grey(\n `${field.dataType}${\n field.dataFormat\n ? `<${\n Array.isArray(\n field.validations.allowedFieldTypes?.fields\n )\n ? `composer[${field.validations.allowedFieldTypes.fields\n .map((f: any) => f.id)\n .join(' | ')}]`\n : field.dataFormat\n }${\n field.dataFormat === 'entry'\n ? `, ${field.validations.allowedContentTypes.contentTypes.join(\n ' | '\n )}`\n : ''\n }${\n field.dataFormat === 'contenttype'\n ? `[${field.validations?.allowedDataFormats.dataFormats.join(\n ' | '\n )}], ${(\n field.validations?.allowedIds?.ids || ['*']\n ).join(' | ')}`\n : ''\n }>`\n : ''\n }${\n field.validations.maxLength?.value\n ? `(${field.validations.maxLength.value})`\n : ''\n }`\n )}`\n );\n }\n } else if (key === 'groups' && Array.isArray(value)) {\n for (const group of value || []) {\n const description =\n Object.keys(group.description).length &&\n Object.values(group.description)?.[0];\n Logger.raw(\n ` ${chalk.bold(group.id)}${\n description\n ? `: ${chalk.grey(Object.values(group.description)?.[0])}`\n : ''\n }`\n );\n }\n } else {\n Logger.objectRecurse(value, 3, ' ');\n // for (const [innerkey, innervalue] of Object.entries(value)) {\n // if (innervalue && typeof innervalue === 'object') {\n // Logger.raw(` ${chalk.bold.grey(innerkey)}:`);\n // console.table(innervalue);\n // } else if (\n // typeof innervalue !== 'undefined' &&\n // innervalue !== null\n // ) {\n // Logger.raw(` ${chalk.bold.grey(innerkey)}: ${innervalue}`);\n // }\n // }\n }\n } else if (typeof value !== 'undefined' && value !== null) {\n const valueText =\n key === 'id' && typeof value === 'string'\n ? Logger.highlightText(value)\n : value;\n Logger.raw(` ${chalk.bold.grey(key)}: ${valueText}`);\n }\n }\n };\n\n static objectRecurse: LogJsonMethod = (content, depth = 3, indent = '') => {\n if (Array.isArray(content)) {\n for (const item of content) {\n if (item && typeof item === 'object') {\n if (Array.isArray(item) && depth > 3)\n if (item.length)\n Logger.raw(chalk.grey(`${indent} [${item.join(', ')}]`));\n else Logger.objectRecurse(item, depth + 1, `${indent} `);\n else\n Array.isArray(item)\n ? Logger.raw(\n `${indent}${chalk.grey(`[`)}${item.join(', ')}${chalk.grey(\n `]`\n )}`\n )\n : typeof item === 'object' && item\n ? Logger.objectRecurse(item, depth + 1, `${indent} `)\n : Logger.raw(`${indent}${item}`);\n } else Logger.raw(`${indent}${item}`);\n }\n } else {\n let pos = 0;\n for (const [key, value] of Object.entries(content)) {\n if (key === 'stack') continue; // skip stack output for errors\n const thisIndent =\n pos === 0 ? `${indent.substring(0, indent.length - 2)}- ` : indent;\n if (Array.isArray(value)) {\n if (value.length) Logger.raw(`${thisIndent}${chalk.bold.grey(key)}:`);\n for (const item of value) {\n if (item && typeof item === 'object') {\n if (Array.isArray(item) && depth > 3)\n Logger.raw(chalk.grey(`${indent} [${item.join(', ')}]`));\n else Logger.objectRecurse(item, depth + 1, `${indent} `);\n } else {\n Logger.raw(`${indent} ${item}`);\n }\n }\n } else if (value && typeof value === 'object') {\n Logger.raw(`${indent}${chalk.bold.grey(key)}:`);\n\n Logger.objectRecurse(value, depth + 1, `${indent} `);\n // console.table(value);\n } else if (typeof value !== 'undefined' && value !== null) {\n Logger.raw(`${thisIndent}${chalk.bold.grey(key)}: ${value}`);\n }\n pos++;\n }\n }\n };\n static raw: LogMethod = (content: string) => {\n if (progress.active) progress.current.interrupt(content);\n else console.log(content);\n };\n\n static limits = (\n content: string,\n displayLength = 30,\n consoleWidth = process.stdout.columns,\n logMethod: Function = console.info\n ) => {\n if (consoleWidth) {\n const contentArray = content.endsWith('\\n')\n ? content.split('\\n').slice(0, -1)\n : content.split('\\n');\n const contentLines = contentArray.slice(\n 0,\n consoleWidth ? displayLength : undefined\n );\n for (const line of contentLines)\n logMethod(\n line\n .split('~n')\n .map(l =>\n consoleWidth && strlen(l) > consoleWidth\n ? first(l, consoleWidth)\n : l\n )\n .join('\\n')\n );\n } else {\n logMethod(content.replace(ansiEscapeCodes, '').replaceAll('~n', '\\n'));\n }\n\n const tableArray = content.split('\\n');\n if (consoleWidth && tableArray.length > displayLength)\n console.info(\n `\\n`,\n `- and ${tableArray.length - displayLength} more...\\n`\n );\n };\n}\n\nexport const logError: LogErrorFunc = (\n err = new Error('Undefined error'),\n msg,\n level = 'error'\n) => {\n Logger[level](msg || err.message || err?.data?.message || err.Message);\n (Array.isArray(err) ? err : [err]).map((error: AppError) => {\n if (typeof error === 'string') {\n Logger.raw(`${Logger.infoText(error)}\\n`);\n return;\n }\n if ('stack' in error) Logger.raw(` ${Logger.infoText(error.stack)}\\n`);\n if ('data' in error)\n Logger.raw(` ${Logger.infoText(tryStringify(error.data))}\\n`);\n });\n //Logger.line();\n return null;\n};\n\nexport const addNewLines = (\n message = '',\n newLineSeparater = '\\n',\n atPosition = process.stdout.columns\n) => {\n if (message === '' || atPosition === 0) {\n return '';\n }\n\n let result = '';\n let lengthCounter = 0;\n\n // Partition the message string into an array of\n // [nonPrintable, printable][]\n const partitioned = partition(message);\n const addSeparater = () => {\n // If line length counter has exceeded the console width\n // add a new line separater and reset the line length counter\n if (lengthCounter >= atPosition) {\n result += newLineSeparater;\n lengthCounter = 0;\n }\n };\n\n // Loop through the partitioned message parts\n for (const [nonPrintable, printable] of partitioned) {\n // Convert string to array as this will provide accurate\n // lengths and splicing methods with all unicode chars\n const textParts = Array.from(printable);\n // Splice the remaining allowable line length from the text parts array\n const text = textParts.splice(0, atPosition - lengthCounter);\n // In the first iteration append the non printable unicode chars\n // to the beginning of the spliced text\n result += nonPrintable + text.join('');\n // Keep a count of the current line length\n // as one line of output could span multiple \"partitions\"\n lengthCounter += text.length;\n addSeparater();\n\n // Handle any remaining text in this \"partition\"\n while (textParts.length) {\n // Splice the remaining allowable line length from the text parts array\n const text = textParts.splice(0, atPosition - lengthCounter);\n // Append the spliced text to the result\n result += text.join('');\n // Increase line length counter\n lengthCounter += text.length;\n addSeparater();\n }\n }\n return result;\n};\n\nexport const progress = {\n current: { interrupt: (x: string) => {} },\n active: false,\n // done: () => new ProgressBar('', 0),\n // colours: { green: '\\u001b[42m \\u001b[0m', red: '\\u001b[41m \\u001b[0m' },\n // current: new ProgressBar(`:bar`, {\n // complete: '=',\n // incomplete: ' ',\n // width: 20,\n // total: 100,\n // }),\n};\n"],
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["import chalk from 'chalk';\nimport dateFormat from 'dateformat';\nimport deepCleaner from 'deep-cleaner';\nimport {\n ansiEscapeCodes,\n first,\n partition,\n strlen,\n} from 'printable-characters';\n// import ProgressBar from 'progress';\nimport { isSysError, tryStringify } from '.';\n\ntype LogMethod = (content: string) => void;\ntype LogErrorMethod = (content: string, err?: any, newline?: string) => void;\ntype LogJsonMethod = (content: any, depth?: number, indent?: string) => void;\ntype LogJsonDepthMethod = (content: any, depth?: number) => void;\ntype LogArrayMethod = (contentArray: string[]) => void;\ntype LogErrorFunc = (\n err: any,\n msg?: string,\n level?: 'error' | 'critical'\n) => void;\n\nexport class Logger {\n static isUserTerminal = !!process.stdout.columns;\n static getPrefix = () => {\n return Logger.isUserTerminal\n ? Logger.infoText(`[cli]`)\n : `[${dateFormat(new Date(), 'dd/mm HH:MM:ss')}]`;\n };\n static errorText = chalk.bold.red;\n static warningText = chalk.keyword('orange');\n static successText = chalk.keyword('green');\n static helpText = chalk.blue;\n static highlightText = chalk.yellow;\n static infoText = chalk.keyword('grey');\n static standardText = chalk.keyword('white');\n static boldText = chalk.bold;\n static critical: LogMethod = content => {\n const message = `${Logger.getPrefix()} ${Logger.errorText(\n '[CRITICAL]'\n )} ${content}`;\n console.log(message);\n };\n static error: LogErrorMethod = (content, err, newline = '\\n') => {\n const message = `${Logger.getPrefix()} ${Logger.errorText(\n `${Logger.isUserTerminal ? '\u274C' : '[ERROR]'} ${content}${\n err\n ? `\\n\\n${Logger.infoText(\n isSysError(err) ? err.toString() : JSON.stringify(err, null, 2)\n )}`\n : ''\n }`\n )}${newline}`;\n if (progress.active) progress.current.interrupt(message);\n else console.log(message);\n };\n static warning: LogMethod = (content, newline = '\\n') => {\n const message = `${Logger.getPrefix()} ${Logger.warningText(\n `${Logger.isUserTerminal ? '\u26A0\uFE0F ' : '[WARN]'} ${content}`\n )}${newline}`;\n if (progress.active) progress.current.interrupt(message);\n else console.log(message);\n // }\n };\n static success: LogMethod = content => {\n const message = `${Logger.getPrefix()} ${Logger.successText(\n `${Logger.isUserTerminal ? '\u2705' : '[OK]'} ${content}`\n )}`;\n if (progress.active) progress.current.interrupt(message);\n else console.log(message);\n };\n static info: LogMethod = content => {\n const message = `${Logger.getPrefix()} ${\n Logger.isUserTerminal ? chalk.bgCyan(' \u2139 ') : '[INFO]'\n } ${Logger.infoText(content)}`;\n if (progress.active) progress.current.interrupt(message);\n else console.log(message);\n };\n static help: LogMethod = content => {\n const message = `${Logger.getPrefix()} ${chalk.blue(\n `${Logger.isUserTerminal ? '\u23E9' : '[HELP]'} ${content}`\n )}\\n`;\n if (progress.active) progress.current.interrupt(message);\n else console.log(message);\n };\n static standard: LogMethod = content => {\n const message = `${Logger.getPrefix()} ${\n Logger.isUserTerminal ? '\u25FB\uFE0F' : '[STD]'\n } \\n${Logger.standardText(content)}`;\n if (progress.active) progress.current.interrupt(message);\n else console.log(message);\n progress.current.interrupt(message);\n };\n static debug: LogMethod = content => {\n if (['true', '1'].includes(process.env.debug || '')) {\n const message = `${Logger.getPrefix()} ${\n Logger.isUserTerminal ? chalk.bgGrey(' \u2699 ') : '[DEBUG]'\n } ${Logger.infoText(content)}`;\n if (progress.active) progress.current.interrupt(message);\n else console.log(message);\n }\n };\n static json: LogJsonDepthMethod = (content, depth = 9) =>\n console.dir(deepCleaner(content), { colors: true, depth });\n static mixed: LogArrayMethod = contentArray =>\n console.log(`${Logger.getPrefix()} ${contentArray.join(' ')}`);\n static line = () =>\n Logger.raw(` ${Logger.infoText(`-------------------------------------`)}`);\n\n static object: LogJsonMethod = content => {\n for (const [key, value] of Object.entries(content || {})) {\n if (value && typeof value === 'object') {\n Logger.raw(` ${chalk.bold.grey(key)}:`);\n if (key === 'fields' && Array.isArray(value)) {\n for (const field of value || []) {\n Logger.raw(\n ` ${chalk.bold(field.id)}${\n field.id === content.entryTitleField\n ? '**'\n : field.validations.minCount?.value ||\n typeof field.validations.required?.message !== 'undefined'\n ? '*'\n : ''\n }: ${chalk.grey(\n `${field.dataType}${\n field.dataFormat\n ? `<${\n Array.isArray(\n field.validations.allowedFieldTypes?.fields\n )\n ? `composer[${field.validations.allowedFieldTypes.fields\n .map((f: any) => f.id)\n .join(' | ')}]`\n : field.dataFormat\n }${\n field.dataFormat === 'entry'\n ? `, ${field.validations.allowedContentTypes.contentTypes.join(\n ' | '\n )}`\n : ''\n }${\n field.dataFormat === 'contenttype'\n ? `[${field.validations?.allowedDataFormats.dataFormats.join(\n ' | '\n )}], ${(\n field.validations?.allowedIds?.ids || ['*']\n ).join(' | ')}`\n : ''\n }>`\n : ''\n }${\n field.validations.maxLength?.value\n ? `(${field.validations.maxLength.value})`\n : ''\n }`\n )}`\n );\n }\n } else if (key === 'groups' && Array.isArray(value)) {\n for (const group of value || []) {\n const description =\n Object.keys(group.description).length &&\n Object.values(group.description)?.[0];\n Logger.raw(\n ` ${chalk.bold(group.id)}${\n description\n ? `: ${chalk.grey(Object.values(group.description)?.[0])}`\n : ''\n }`\n );\n }\n } else {\n Logger.objectRecurse(value, 3, ' ');\n // for (const [innerkey, innervalue] of Object.entries(value)) {\n // if (innervalue && typeof innervalue === 'object') {\n // Logger.raw(` ${chalk.bold.grey(innerkey)}:`);\n // console.table(innervalue);\n // } else if (\n // typeof innervalue !== 'undefined' &&\n // innervalue !== null\n // ) {\n // Logger.raw(` ${chalk.bold.grey(innerkey)}: ${innervalue}`);\n // }\n // }\n }\n } else if (typeof value !== 'undefined' && value !== null) {\n const valueText =\n key === 'id' && typeof value === 'string'\n ? Logger.highlightText(value)\n : value;\n Logger.raw(` ${chalk.bold.grey(key)}: ${valueText}`);\n }\n }\n };\n\n static objectRecurse: LogJsonMethod = (content, depth = 3, indent = '') => {\n if (Array.isArray(content)) {\n for (const item of content) {\n if (item && typeof item === 'object') {\n if (Array.isArray(item) && depth > 3)\n if (item.length)\n Logger.raw(chalk.grey(`${indent} [${item.join(', ')}]`));\n else Logger.objectRecurse(item, depth + 1, `${indent} `);\n else {\n if (Array.isArray(item))\n Logger.raw(\n `${indent}${chalk.grey(`[`)}${item.join(', ')}${chalk.grey(\n `]`\n )}`\n );\n else if (typeof item === 'object' && item)\n Logger.objectRecurse(item, depth + 1, `${indent} `);\n else Logger.raw(`${indent}${item}`);\n }\n } else Logger.raw(`${indent}${item}`);\n }\n } else {\n let pos = 0;\n for (const [key, value] of Object.entries(content)) {\n if (key === 'stack') continue; // skip stack output for errors\n const thisIndent =\n pos === 0 ? `${indent.substring(0, indent.length - 2)}- ` : indent;\n if (Array.isArray(value)) {\n if (value.length) Logger.raw(`${thisIndent}${chalk.bold.grey(key)}:`);\n for (const item of value) {\n if (item && typeof item === 'object') {\n if (Array.isArray(item) && depth > 3)\n Logger.raw(chalk.grey(`${indent} [${item.join(', ')}]`));\n else Logger.objectRecurse(item, depth + 1, `${indent} `);\n } else {\n Logger.raw(`${indent} ${item}`);\n }\n }\n } else if (value && typeof value === 'object') {\n Logger.raw(`${indent}${chalk.bold.grey(key)}:`);\n\n Logger.objectRecurse(value, depth + 1, `${indent} `);\n // console.table(value);\n } else if (typeof value !== 'undefined' && value !== null) {\n Logger.raw(`${thisIndent}${chalk.bold.grey(key)}: ${value}`);\n }\n pos++;\n }\n }\n };\n static raw: LogMethod = (content: string) => {\n if (progress.active) progress.current.interrupt(content);\n else console.log(content);\n };\n\n static limits = (\n content: string,\n displayLength = 30,\n consoleWidth = process.stdout.columns,\n // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type\n logMethod: Function = console.info\n ) => {\n if (consoleWidth) {\n const contentArray = content.endsWith('\\n')\n ? content.split('\\n').slice(0, -1)\n : content.split('\\n');\n const contentLines = contentArray.slice(\n 0,\n consoleWidth ? displayLength : undefined\n );\n for (const line of contentLines)\n logMethod(\n line\n .split('~n')\n .map(l =>\n consoleWidth && strlen(l) > consoleWidth\n ? first(l, consoleWidth)\n : l\n )\n .join('\\n')\n );\n } else {\n logMethod(content.replace(ansiEscapeCodes, '').replaceAll('~n', '\\n'));\n }\n\n const tableArray = content.split('\\n');\n if (consoleWidth && tableArray.length > displayLength)\n console.info(\n `\\n`,\n `- and ${tableArray.length - displayLength} more...\\n`\n );\n };\n}\n\nexport const logError: LogErrorFunc = (\n err = new Error('Undefined error'),\n msg,\n level = 'error'\n) => {\n Logger[level](msg || err.message || err?.data?.message || err.Message);\n (Array.isArray(err) ? err : [err]).map((error: AppError) => {\n if (typeof error === 'string') {\n Logger.raw(`${Logger.infoText(error)}\\n`);\n return;\n }\n if ('stack' in error) Logger.raw(` ${Logger.infoText(error.stack)}\\n`);\n if ('data' in error)\n Logger.raw(` ${Logger.infoText(tryStringify(error.data))}\\n`);\n });\n //Logger.line();\n return null;\n};\n\nexport const addNewLines = (\n message = '',\n newLineSeparater = '\\n',\n atPosition = process.stdout.columns\n) => {\n if (message === '' || atPosition === 0) {\n return '';\n }\n\n let result = '';\n let lengthCounter = 0;\n\n // Partition the message string into an array of\n // [nonPrintable, printable][]\n const partitioned = partition(message);\n const addSeparater = () => {\n // If line length counter has exceeded the console width\n // add a new line separater and reset the line length counter\n if (lengthCounter >= atPosition) {\n result += newLineSeparater;\n lengthCounter = 0;\n }\n };\n\n // Loop through the partitioned message parts\n for (const [nonPrintable, printable] of partitioned) {\n // Convert string to array as this will provide accurate\n // lengths and splicing methods with all unicode chars\n const textParts = Array.from(printable);\n // Splice the remaining allowable line length from the text parts array\n const text = textParts.splice(0, atPosition - lengthCounter);\n // In the first iteration append the non printable unicode chars\n // to the beginning of the spliced text\n result += nonPrintable + text.join('');\n // Keep a count of the current line length\n // as one line of output could span multiple \"partitions\"\n lengthCounter += text.length;\n addSeparater();\n\n // Handle any remaining text in this \"partition\"\n while (textParts.length) {\n // Splice the remaining allowable line length from the text parts array\n const text = textParts.splice(0, atPosition - lengthCounter);\n // Append the spliced text to the result\n result += text.join('');\n // Increase line length counter\n lengthCounter += text.length;\n addSeparater();\n }\n }\n return result;\n};\n\nexport const progress = {\n current: { interrupt: (x: string) => {} },\n active: false,\n // done: () => new ProgressBar('', 0),\n // colours: { green: '\\u001b[42m \\u001b[0m', red: '\\u001b[41m \\u001b[0m' },\n // current: new ProgressBar(`:bar`, {\n // complete: '=',\n // incomplete: ' ',\n // width: 20,\n // total: 100,\n // }),\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAkB;AAClB,wBAAuB;AACvB,0BAAwB;AACxB,kCAKO;AAEP,eAAyC;AAalC,MAAM,OAAO;AAAA,EAClB,OAAO,iBAAiB,CAAC,CAAC,QAAQ,OAAO;AAAA,EACzC,OAAO,YAAY,MAAM;AACvB,WAAO,OAAO,iBACV,OAAO,SAAS,OAAO,IACvB,QAAI,kBAAAA,SAAW,oBAAI,KAAK,GAAG,gBAAgB,CAAC;AAAA,EAClD;AAAA,EACA,OAAO,YAAY,aAAAC,QAAM,KAAK;AAAA,EAC9B,OAAO,cAAc,aAAAA,QAAM,QAAQ,QAAQ;AAAA,EAC3C,OAAO,cAAc,aAAAA,QAAM,QAAQ,OAAO;AAAA,EAC1C,OAAO,WAAW,aAAAA,QAAM;AAAA,EACxB,OAAO,gBAAgB,aAAAA,QAAM;AAAA,EAC7B,OAAO,WAAW,aAAAA,QAAM,QAAQ,MAAM;AAAA,EACtC,OAAO,eAAe,aAAAA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A;AAAA;AAAA;AAAA;AAAA;AASV;",
|
|
6
6
|
"names": ["dateFormat", "chalk", "deepCleaner", "text"]
|
|
7
7
|
}
|
package/dist/util/os.js
CHANGED
|
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
20
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
25
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
26
|
mod
|
|
23
27
|
));
|
package/dist/util/os.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/util/os.ts"],
|
|
4
4
|
"sourcesContent": ["import os from 'os';\n\nexport const winSlash = (str: string) =>\n os.platform() === 'win32' ? str.replaceAll('/', '\\\\') : str;\n\nexport const linuxSlash = (str: string) =>\n os.platform() === 'win32' ? str.replaceAll('\\\\', '/') : str;\n\nexport const normaliseLineEndings = (\n str: string,\n lineEnd = os.platform() === 'win32' ? '\\r\\n' : 'n'\n) => str.replace(/\\r?\\n/g, lineEnd);\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gBAAe;AAER,MAAM,WAAW,CAAC,QACvB,UAAAA,QAAG,SAAS,MAAM,UAAU,IAAI,WAAW,KAAK,IAAI,IAAI;AAEnD,MAAM,aAAa,CAAC,QACzB,UAAAA,QAAG,SAAS,MAAM,UAAU,IAAI,WAAW,MAAM,GAAG,IAAI;AAEnD,MAAM,uBAAuB,CAClC,KACA,UAAU,UAAAA,QAAG,SAAS,MAAM,UAAU,SAAS,QAC5C,IAAI,QAAQ,UAAU,OAAO;",
|
|
6
6
|
"names": ["os"]
|
|
7
7
|
}
|
|
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
20
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
25
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
26
|
mod
|
|
23
27
|
));
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/util/xml.formatter.ts"],
|
|
4
4
|
"sourcesContent": ["import xml2js from 'xml2js';\nimport cleaner from 'deep-cleaner';\nimport { Logger } from './logger';\n\nexport const xmlFormatter = <T>(entries: T | T[]) => {\n try {\n const cleanedEntries = cleaner(cleaner(entries, ['workflow']));\n\n const builder = new xml2js.Builder({\n cdata: true,\n rootName: 'Items',\n });\n const xml = builder.buildObject({ Entry: cleanedEntries });\n\n return xml;\n } catch (ex) {\n Logger.error(`Problem building XML from json data`, ex);\n return '';\n }\n};\n\nexport const xmlToJson = async <T>(data: string) => {\n const json = await xml2js.parseStringPromise(data, { explicitArray: false });\n\n return json.Items?.Entry || json;\n};\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAAmB;AACnB,0BAAoB;AACpB,oBAAuB;AAEhB,MAAM,eAAe,CAAI,YAAqB;AACnD,MAAI;AACF,UAAM,qBAAiB,oBAAAA,aAAQ,oBAAAA,SAAQ,SAAS,CAAC,UAAU,CAAC,CAAC;AAE7D,UAAM,UAAU,IAAI,cAAAC,QAAO,QAAQ;AAAA,MACjC,OAAO;AAAA,MACP,UAAU;AAAA,IACZ,CAAC;AACD,UAAM,MAAM,QAAQ,YAAY,EAAE,OAAO,eAAe,CAAC;AAEzD,WAAO;AAAA,EACT,SAAS,IAAI;AACX,yBAAO,MAAM,uCAAuC,EAAE;AACtD,WAAO;AAAA,EACT;AACF;AAEO,MAAM,YAAY,OAAU,SAAiB;AArBpD;AAsBE,QAAM,OAAO,MAAM,cAAAA,QAAO,mBAAmB,MAAM,EAAE,eAAe,MAAM,CAAC;AAE3E,WAAO,UAAK,UAAL,mBAAY,UAAS;AAC9B;",
|
|
6
6
|
"names": ["cleaner", "xml2js"]
|
|
7
7
|
}
|
package/dist/util/yaml.js
CHANGED
|
@@ -31,8 +31,7 @@ const parseYamlDocument = import_yaml.parseDocument;
|
|
|
31
31
|
const stringifyYaml = import_yaml.stringify;
|
|
32
32
|
const validateWorkflowYaml = (yaml) => {
|
|
33
33
|
const { actionType, errors } = (0, import_core.validateWorkflow)(yaml);
|
|
34
|
-
if (actionType && errors.length === 0)
|
|
35
|
-
return true;
|
|
34
|
+
if (actionType && errors.length === 0) return true;
|
|
36
35
|
return errors;
|
|
37
36
|
};
|
|
38
37
|
// Annotate the CommonJS export names for ESM import in node:
|
package/dist/util/yaml.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/util/yaml.ts"],
|
|
4
4
|
"sourcesContent": ["import { validateWorkflow } from '@action-validator/core';\n\nimport { parse, parseDocument, stringify } from 'yaml';\n\nexport const parseYaml = parse;\nexport const parseYamlDocument = parseDocument;\nexport const stringifyYaml = stringify;\n\nexport const validateWorkflowYaml = (yaml: string) => {\n const { actionType, errors } = validateWorkflow(yaml);\n if (actionType && errors.length === 0) return true;\n return errors;\n};\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAiC;AAEjC,kBAAgD;AAEzC,MAAM,YAAY;AAClB,MAAM,oBAAoB;AAC1B,MAAM,gBAAgB;AAEtB,MAAM,uBAAuB,CAAC,SAAiB;AACpD,QAAM,EAAE,YAAY,OAAO,QAAI,8BAAiB,IAAI;AACpD,MAAI,cAAc,OAAO,WAAW
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAiC;AAEjC,kBAAgD;AAEzC,MAAM,YAAY;AAClB,MAAM,oBAAoB;AAC1B,MAAM,gBAAgB;AAEtB,MAAM,uBAAuB,CAAC,SAAiB;AACpD,QAAM,EAAE,YAAY,OAAO,QAAI,8BAAiB,IAAI;AACpD,MAAI,cAAc,OAAO,WAAW,EAAG,QAAO;AAC9C,SAAO;AACT;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/version.js
CHANGED
|
@@ -21,7 +21,7 @@ __export(version_exports, {
|
|
|
21
21
|
LIB_VERSION: () => LIB_VERSION
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(version_exports);
|
|
24
|
-
const LIB_VERSION = "1.3.1-beta.
|
|
24
|
+
const LIB_VERSION = "1.3.1-beta.10";
|
|
25
25
|
// Annotate the CommonJS export names for ESM import in node:
|
|
26
26
|
0 && (module.exports = {
|
|
27
27
|
LIB_VERSION
|
package/dist/version.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/version.ts"],
|
|
4
|
-
"sourcesContent": ["export const LIB_VERSION = \"1.3.1-beta.
|
|
4
|
+
"sourcesContent": ["export const LIB_VERSION = \"1.3.1-beta.10\";\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,MAAM,cAAc;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/esbuild.config.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
const rimraf = require('rimraf');
|
|
1
|
+
const { rimraf } = require('rimraf');
|
|
2
2
|
const esbuild = require('esbuild');
|
|
3
3
|
const chalk = require('chalk');
|
|
4
4
|
const { globPlugin } = require('esbuild-plugin-glob');
|
|
5
5
|
const { nodeExternalsPlugin } = require('esbuild-node-externals');
|
|
6
6
|
const { replaceTscAliasPaths } = require('tsc-alias');
|
|
7
7
|
|
|
8
|
-
const watch = !!process.argv.includes('--watch');
|
|
8
|
+
// const watch = !!process.argv.includes('--watch');
|
|
9
9
|
const completed = `${chalk.green('[contensis-cli]')} Build successful 👍\n`;
|
|
10
10
|
|
|
11
11
|
console.time(completed);
|
|
12
12
|
console.time(' - rimraf complete');
|
|
13
13
|
|
|
14
|
-
rimraf('./dist'
|
|
14
|
+
rimraf('./dist').then(() => {
|
|
15
15
|
console.timeEnd(' - rimraf complete');
|
|
16
16
|
console.time(' - esbuild complete');
|
|
17
17
|
esbuild
|
|
@@ -27,15 +27,15 @@ rimraf('./dist', () => {
|
|
|
27
27
|
// so the bundles are compatible with the pkg exe builds
|
|
28
28
|
target: 'node12',
|
|
29
29
|
plugins: [globPlugin(), nodeExternalsPlugin()],
|
|
30
|
-
watch: watch && {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
},
|
|
30
|
+
// watch: watch && {
|
|
31
|
+
// onRebuild(error) {
|
|
32
|
+
// if (error) console.error('esbuild watch build failed:', error);
|
|
33
|
+
// else
|
|
34
|
+
// console.log(
|
|
35
|
+
// 'esbuild watch build succeeded, waiting for changes...'
|
|
36
|
+
// );
|
|
37
|
+
// },
|
|
38
|
+
// },
|
|
39
39
|
})
|
|
40
40
|
.then(() => {
|
|
41
41
|
console.timeEnd(' - esbuild complete');
|
|
@@ -43,9 +43,5 @@ rimraf('./dist', () => {
|
|
|
43
43
|
replaceTscAliasPaths();
|
|
44
44
|
console.timeEnd(' - replace alias paths');
|
|
45
45
|
console.timeEnd(completed);
|
|
46
|
-
})
|
|
47
|
-
.catch(error => {
|
|
48
|
-
console.error(error);
|
|
49
|
-
process.exit(1);
|
|
50
46
|
});
|
|
51
47
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "contensis-cli",
|
|
3
|
-
"version": "1.3.1-beta.
|
|
3
|
+
"version": "1.3.1-beta.10",
|
|
4
4
|
"description": "A fully featured Contensis command line interface with a shell UI provides simple and intuitive ways to manage or profile your content in any NodeJS terminal.",
|
|
5
5
|
"repository": "https://github.com/contensis/cli",
|
|
6
6
|
"homepage": "https://github.com/contensis/cli/tree/main/packages/contensis-cli#readme",
|
|
@@ -24,50 +24,49 @@
|
|
|
24
24
|
"author": "Zengenti",
|
|
25
25
|
"license": "ISC",
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@action-validator/core": "^0.
|
|
28
|
-
"adm-zip": "^0.5.
|
|
27
|
+
"@action-validator/core": "^0.6.0",
|
|
28
|
+
"adm-zip": "^0.5.16",
|
|
29
29
|
"app-root-path": "^3.1.0",
|
|
30
30
|
"chalk": "^4.1.2",
|
|
31
|
-
"commander": "^
|
|
32
|
-
"csv": "^6.
|
|
33
|
-
"dayjs": "^1.11.
|
|
34
|
-
"diff": "^
|
|
35
|
-
"figlet": "^1.
|
|
31
|
+
"commander": "^12.1.0",
|
|
32
|
+
"csv": "^6.3.11",
|
|
33
|
+
"dayjs": "^1.11.13",
|
|
34
|
+
"diff": "^7.0.0",
|
|
35
|
+
"figlet": "^1.8.0",
|
|
36
36
|
"flat": "^5.0.2",
|
|
37
37
|
"giturl": "^2.0.0",
|
|
38
|
-
"hosted-git-info": "^
|
|
38
|
+
"hosted-git-info": "^8.0.2",
|
|
39
39
|
"inquirer-command-prompt": "^0.1.0",
|
|
40
|
-
"jsonpath-mapper": "^1.1.0",
|
|
41
40
|
"keytar": "^7.9.0",
|
|
42
41
|
"lodash": "^4.17.21",
|
|
43
|
-
"migratortron": "^1.0.0-beta.
|
|
44
|
-
"nanospinner": "^1.
|
|
42
|
+
"migratortron": "^1.0.0-beta.71",
|
|
43
|
+
"nanospinner": "^1.2.0",
|
|
45
44
|
"node-fetch": "^2.6.7",
|
|
46
45
|
"parse-git-config": "^3.0.0",
|
|
47
|
-
"patch-package": "^
|
|
46
|
+
"patch-package": "^8.0.0",
|
|
48
47
|
"printable-characters": "^1.0.42",
|
|
49
48
|
"split-cmd": "^1.1.0",
|
|
50
|
-
"xml2js": "^0.
|
|
51
|
-
"yaml": "^2.
|
|
49
|
+
"xml2js": "^0.6.2",
|
|
50
|
+
"yaml": "^2.6.1"
|
|
52
51
|
},
|
|
53
52
|
"devDependencies": {
|
|
54
|
-
"@octokit/types": "^
|
|
55
|
-
"@types/adm-zip": "^0.5.
|
|
56
|
-
"@types/figlet": "^1.
|
|
57
|
-
"@types/flat": "^5.0.
|
|
58
|
-
"@types/hosted-git-info": "^3.0.
|
|
59
|
-
"@types/inquirer": "^
|
|
60
|
-
"@types/json2csv": "^5.0.
|
|
61
|
-
"@types/lodash": "^4.
|
|
62
|
-
"@types/node-fetch": "^2.6.
|
|
63
|
-
"@types/parse-git-config": "^3.0.
|
|
64
|
-
"@types/xml2js": "^0.4.
|
|
65
|
-
"esbuild": "^0.
|
|
66
|
-
"esbuild-node-externals": "^1.
|
|
67
|
-
"esbuild-plugin-glob": "^
|
|
53
|
+
"@octokit/types": "^13.6.2",
|
|
54
|
+
"@types/adm-zip": "^0.5.7",
|
|
55
|
+
"@types/figlet": "^1.7.0",
|
|
56
|
+
"@types/flat": "^5.0.5",
|
|
57
|
+
"@types/hosted-git-info": "^3.0.5",
|
|
58
|
+
"@types/inquirer": "^9.0.7",
|
|
59
|
+
"@types/json2csv": "^5.0.7",
|
|
60
|
+
"@types/lodash": "^4.17.13",
|
|
61
|
+
"@types/node-fetch": "^2.6.12",
|
|
62
|
+
"@types/parse-git-config": "^3.0.4",
|
|
63
|
+
"@types/xml2js": "^0.4.14",
|
|
64
|
+
"esbuild": "^0.24.0",
|
|
65
|
+
"esbuild-node-externals": "^1.15.0",
|
|
66
|
+
"esbuild-plugin-glob": "^2.2.3",
|
|
68
67
|
"nodemon": "^2.0.18",
|
|
69
|
-
"rimraf": "^
|
|
70
|
-
"tsc-alias": "^1.
|
|
71
|
-
"typescript": "^
|
|
68
|
+
"rimraf": "^6.0.1",
|
|
69
|
+
"tsc-alias": "^1.8.10",
|
|
70
|
+
"typescript": "^5.7.2"
|
|
72
71
|
}
|
|
73
72
|
}
|
package/src/commands/copy.ts
CHANGED
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
latest,
|
|
10
10
|
mapContensisOpts,
|
|
11
11
|
noCache,
|
|
12
|
+
noPublish,
|
|
12
13
|
outputDetail,
|
|
13
14
|
saveEntries,
|
|
14
15
|
versionStatus,
|
|
@@ -45,6 +46,7 @@ export const makeCopyCommand = () => {
|
|
|
45
46
|
.addOption(ignoreErrors)
|
|
46
47
|
.addOption(outputDetail)
|
|
47
48
|
.addOption(noCache)
|
|
49
|
+
.addOption(noPublish)
|
|
48
50
|
.option(
|
|
49
51
|
'--search <phrase>',
|
|
50
52
|
'get entries with the search phrase, use quotes for multiple words'
|
|
@@ -74,7 +76,7 @@ Example call:
|
|
|
74
76
|
contentTypeId,
|
|
75
77
|
fieldId,
|
|
76
78
|
destinationId,
|
|
77
|
-
template
|
|
79
|
+
template,
|
|
78
80
|
rootUri: opts.rootUri,
|
|
79
81
|
};
|
|
80
82
|
|