contensis-cli 1.6.1-beta.2 → 1.6.1-beta.20
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/index.js +58301 -11
- package/dist/index.js.map +4 -4
- package/dist/shell.js +58040 -52
- package/dist/shell.js.map +4 -4
- package/esbuild.config.js +8 -13
- package/package.json +3 -2
- package/src/commands/create.ts +48 -0
- package/src/commands/dev.ts +12 -2
- package/src/commands/globalOptions.ts +5 -3
- package/src/commands/import.ts +46 -5
- package/src/commands/push.ts +8 -1
- package/src/commands/set.ts +69 -1
- package/src/factories/RequestHandlerFactory.ts +19 -8
- package/src/localisation/en-GB.ts +22 -4
- package/src/mappers/DevRequests-to-RequestHanderCliArgs.ts +25 -17
- package/src/models/CliService.d.ts +5 -1
- package/src/providers/GitHubCliModuleProvider.ts +8 -8
- package/src/providers/HttpProvider.ts +2 -2
- package/src/providers/file-provider.ts +3 -0
- package/src/services/ContensisCliService.ts +265 -23
- package/src/services/ContensisDevService.ts +99 -35
- package/src/shell.ts +7 -1
- package/src/util/console.printer.ts +52 -0
- package/src/util/logger.ts +3 -4
- package/src/util/os.ts +5 -3
- package/src/version.ts +1 -1
- package/dist/commands/connect.js +0 -44
- package/dist/commands/connect.js.map +0 -7
- package/dist/commands/copy.js +0 -78
- package/dist/commands/copy.js.map +0 -7
- package/dist/commands/create.js +0 -170
- package/dist/commands/create.js.map +0 -7
- package/dist/commands/dev.js +0 -78
- package/dist/commands/dev.js.map +0 -7
- package/dist/commands/diff.js +0 -57
- package/dist/commands/diff.js.map +0 -7
- package/dist/commands/execute.js +0 -103
- package/dist/commands/execute.js.map +0 -7
- package/dist/commands/get.js +0 -330
- package/dist/commands/get.js.map +0 -7
- package/dist/commands/globalOptions.js +0 -252
- package/dist/commands/globalOptions.js.map +0 -7
- package/dist/commands/import.js +0 -229
- package/dist/commands/import.js.map +0 -7
- package/dist/commands/index.js +0 -107
- package/dist/commands/index.js.map +0 -7
- package/dist/commands/list.js +0 -195
- package/dist/commands/list.js.map +0 -7
- package/dist/commands/login.js +0 -55
- package/dist/commands/login.js.map +0 -7
- package/dist/commands/push.js +0 -229
- package/dist/commands/push.js.map +0 -7
- package/dist/commands/remove.js +0 -193
- package/dist/commands/remove.js.map +0 -7
- package/dist/commands/set.js +0 -180
- package/dist/commands/set.js.map +0 -7
- package/dist/commands/update.js +0 -70
- package/dist/commands/update.js.map +0 -7
- package/dist/factories/RequestHandlerFactory.js +0 -221
- package/dist/factories/RequestHandlerFactory.js.map +0 -7
- package/dist/localisation/en-GB.js +0 -552
- package/dist/localisation/en-GB.js.map +0 -7
- package/dist/mappers/ContensisCliService-to-RequestHanderSiteConfigYaml.js +0 -56
- package/dist/mappers/ContensisCliService-to-RequestHanderSiteConfigYaml.js.map +0 -7
- package/dist/mappers/DevInit-to-CIWorkflow.js +0 -409
- package/dist/mappers/DevInit-to-CIWorkflow.js.map +0 -7
- package/dist/mappers/DevInit-to-RolePermissions.js +0 -56
- package/dist/mappers/DevInit-to-RolePermissions.js.map +0 -7
- package/dist/mappers/DevRequests-to-RequestHanderCliArgs.js +0 -161
- package/dist/mappers/DevRequests-to-RequestHanderCliArgs.js.map +0 -7
- package/dist/mappers/MixedFileData.js +0 -83
- package/dist/mappers/MixedFileData.js.map +0 -7
- package/dist/models/AppError.d.js +0 -2
- package/dist/models/AppError.d.js.map +0 -7
- package/dist/models/Cache.d.js +0 -2
- package/dist/models/Cache.d.js.map +0 -7
- package/dist/models/CliService.d.js +0 -17
- package/dist/models/CliService.d.js.map +0 -7
- package/dist/models/DevService.d.js +0 -17
- package/dist/models/DevService.d.js.map +0 -7
- package/dist/models/JsModules.d.js +0 -2
- package/dist/models/JsModules.d.js.map +0 -7
- package/dist/providers/CredentialProvider.js +0 -126
- package/dist/providers/CredentialProvider.js.map +0 -7
- package/dist/providers/GitHubCliModuleProvider.js +0 -115
- package/dist/providers/GitHubCliModuleProvider.js.map +0 -7
- package/dist/providers/HttpProvider.js +0 -73
- package/dist/providers/HttpProvider.js.map +0 -7
- package/dist/providers/ManifestProvider.js +0 -50
- package/dist/providers/ManifestProvider.js.map +0 -7
- package/dist/providers/SessionCacheProvider.js +0 -132
- package/dist/providers/SessionCacheProvider.js.map +0 -7
- package/dist/providers/file-provider.js +0 -174
- package/dist/providers/file-provider.js.map +0 -7
- package/dist/services/ContensisAuthService.js +0 -88
- package/dist/services/ContensisAuthService.js.map +0 -7
- package/dist/services/ContensisCliService.js +0 -2598
- package/dist/services/ContensisCliService.js.map +0 -7
- package/dist/services/ContensisDevService.js +0 -387
- package/dist/services/ContensisDevService.js.map +0 -7
- package/dist/services/ContensisRoleService.js +0 -112
- package/dist/services/ContensisRoleService.js.map +0 -7
- package/dist/util/api-ids.js +0 -110
- package/dist/util/api-ids.js.map +0 -7
- package/dist/util/assert.js +0 -62
- package/dist/util/assert.js.map +0 -7
- package/dist/util/console.printer.js +0 -425
- package/dist/util/console.printer.js.map +0 -7
- package/dist/util/csv.formatter.js +0 -118
- package/dist/util/csv.formatter.js.map +0 -7
- package/dist/util/debug.js +0 -29
- package/dist/util/debug.js.map +0 -7
- package/dist/util/diff.js +0 -118
- package/dist/util/diff.js.map +0 -7
- package/dist/util/dotenv.js +0 -56
- package/dist/util/dotenv.js.map +0 -7
- package/dist/util/error.js +0 -36
- package/dist/util/error.js.map +0 -7
- package/dist/util/fetch.js +0 -69
- package/dist/util/fetch.js.map +0 -7
- package/dist/util/find.js +0 -39
- package/dist/util/find.js.map +0 -7
- package/dist/util/git.js +0 -145
- package/dist/util/git.js.map +0 -7
- package/dist/util/gitignore.js +0 -61
- package/dist/util/gitignore.js.map +0 -7
- package/dist/util/html.formatter.js +0 -70
- package/dist/util/html.formatter.js.map +0 -7
- package/dist/util/index.js +0 -68
- package/dist/util/index.js.map +0 -7
- package/dist/util/json.formatter.js +0 -66
- package/dist/util/json.formatter.js.map +0 -7
- package/dist/util/logger.js +0 -304
- package/dist/util/logger.js.map +0 -7
- package/dist/util/os.js +0 -46
- package/dist/util/os.js.map +0 -7
- package/dist/util/timers.js +0 -49
- package/dist/util/timers.js.map +0 -7
- package/dist/util/xml.formatter.js +0 -62
- package/dist/util/xml.formatter.js.map +0 -7
- package/dist/util/yaml.js +0 -44
- package/dist/util/yaml.js.map +0 -7
- package/dist/version.js +0 -29
- package/dist/version.js.map +0 -7
package/dist/util/logger.js
DELETED
|
@@ -1,304 +0,0 @@
|
|
|
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
|
-
// 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.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var logger_exports = {};
|
|
30
|
-
__export(logger_exports, {
|
|
31
|
-
Logger: () => Logger,
|
|
32
|
-
addNewLines: () => addNewLines,
|
|
33
|
-
logError: () => logError,
|
|
34
|
-
progress: () => progress
|
|
35
|
-
});
|
|
36
|
-
module.exports = __toCommonJS(logger_exports);
|
|
37
|
-
var import_chalk = __toESM(require("chalk"));
|
|
38
|
-
var import_dateformat = __toESM(require("dateformat"));
|
|
39
|
-
var import_deep_cleaner = __toESM(require("deep-cleaner"));
|
|
40
|
-
var import_printable_characters = require("printable-characters");
|
|
41
|
-
var import_assert = require("./assert");
|
|
42
|
-
const cleanseError = (e) => {
|
|
43
|
-
if (e && typeof e === "object") {
|
|
44
|
-
if ((0, import_assert.isSysError)(e) && e instanceof Error) return e.toString();
|
|
45
|
-
if (e.type === "undefined") delete e.type;
|
|
46
|
-
if (e.status === 500) delete e.status;
|
|
47
|
-
delete e.stack;
|
|
48
|
-
}
|
|
49
|
-
return JSON.stringify(e, null, 2);
|
|
50
|
-
};
|
|
51
|
-
const errorMessages = (errors) => {
|
|
52
|
-
if (Array.isArray(errors))
|
|
53
|
-
return errors.map((error) => cleanseError(error)).join("\n\n");
|
|
54
|
-
return cleanseError(errors);
|
|
55
|
-
};
|
|
56
|
-
class Logger {
|
|
57
|
-
static isUserTerminal = !!process.stdout.columns;
|
|
58
|
-
static getPrefix = () => {
|
|
59
|
-
return Logger.isUserTerminal ? Logger.infoText(`[cli]`) : `[${(0, import_dateformat.default)(/* @__PURE__ */ new Date(), "dd/mm HH:MM:ss")}]`;
|
|
60
|
-
};
|
|
61
|
-
static errorText = import_chalk.default.bold.red;
|
|
62
|
-
static warningText = import_chalk.default.keyword("orange");
|
|
63
|
-
static successText = import_chalk.default.keyword("green");
|
|
64
|
-
static helpText = import_chalk.default.blue;
|
|
65
|
-
static highlightText = import_chalk.default.yellow;
|
|
66
|
-
static infoText = import_chalk.default.keyword("grey");
|
|
67
|
-
static standardText = import_chalk.default.keyword("white");
|
|
68
|
-
static boldText = import_chalk.default.bold;
|
|
69
|
-
static critical = (content) => {
|
|
70
|
-
const message = `${Logger.getPrefix()} ${Logger.errorText(
|
|
71
|
-
"[CRITICAL]"
|
|
72
|
-
)} ${content}`;
|
|
73
|
-
console.log(message);
|
|
74
|
-
};
|
|
75
|
-
static error = (content, err, newline = "\n") => {
|
|
76
|
-
const message = `${Logger.getPrefix()} ${Logger.errorText(
|
|
77
|
-
`${Logger.isUserTerminal ? "\u274C" : "[ERROR]"} ${content}${err ? `
|
|
78
|
-
${Logger.infoText(errorMessages(err))}` : ""}`
|
|
79
|
-
)}${newline}`;
|
|
80
|
-
if (progress.active) progress.current.interrupt(message);
|
|
81
|
-
else console.log(message);
|
|
82
|
-
};
|
|
83
|
-
static warning = (content, newline = "\n") => {
|
|
84
|
-
const message = `${Logger.getPrefix()} ${Logger.warningText(
|
|
85
|
-
`${Logger.isUserTerminal ? "\u26A0\uFE0F " : "[WARN]"} ${content}`
|
|
86
|
-
)}${newline}`;
|
|
87
|
-
if (progress.active) progress.current.interrupt(message);
|
|
88
|
-
else console.log(message);
|
|
89
|
-
};
|
|
90
|
-
static success = (content) => {
|
|
91
|
-
const message = `${Logger.getPrefix()} ${Logger.successText(
|
|
92
|
-
`${Logger.isUserTerminal ? "\u2705" : "[OK]"} ${content}`
|
|
93
|
-
)}`;
|
|
94
|
-
if (progress.active) progress.current.interrupt(message);
|
|
95
|
-
else console.log(message);
|
|
96
|
-
};
|
|
97
|
-
static info = (content) => {
|
|
98
|
-
const message = `${Logger.getPrefix()} ${Logger.isUserTerminal ? import_chalk.default.bgCyan(" \u2139 ") : "[INFO]"} ${Logger.infoText(content)}`;
|
|
99
|
-
if (progress.active) progress.current.interrupt(message);
|
|
100
|
-
else console.log(message);
|
|
101
|
-
};
|
|
102
|
-
static help = (content) => {
|
|
103
|
-
const message = `${Logger.getPrefix()} ${import_chalk.default.blue(
|
|
104
|
-
`${Logger.isUserTerminal ? "\u23E9" : "[HELP]"} ${content}`
|
|
105
|
-
)}
|
|
106
|
-
`;
|
|
107
|
-
if (progress.active) progress.current.interrupt(message);
|
|
108
|
-
else console.log(message);
|
|
109
|
-
};
|
|
110
|
-
static standard = (content) => {
|
|
111
|
-
const message = `${Logger.getPrefix()} ${Logger.isUserTerminal ? "\u25FB\uFE0F" : "[STD]"}
|
|
112
|
-
${Logger.standardText(content)}`;
|
|
113
|
-
if (progress.active) progress.current.interrupt(message);
|
|
114
|
-
else console.log(message);
|
|
115
|
-
progress.current.interrupt(message);
|
|
116
|
-
};
|
|
117
|
-
static debug = (content) => {
|
|
118
|
-
if (["true", "1"].includes(process.env.debug || "")) {
|
|
119
|
-
const message = `${Logger.getPrefix()} ${Logger.isUserTerminal ? import_chalk.default.bgGrey(" \u2699 ") : "[DEBUG]"} ${Logger.infoText(content)}`;
|
|
120
|
-
if (progress.active) progress.current.interrupt(message);
|
|
121
|
-
else console.log(message);
|
|
122
|
-
}
|
|
123
|
-
};
|
|
124
|
-
static json = (content, depth = 9) => console.dir((0, import_deep_cleaner.default)(content), { colors: true, depth });
|
|
125
|
-
static mixed = (contentArray) => console.log(`${Logger.getPrefix()} ${contentArray.join(" ")}`);
|
|
126
|
-
static line = () => Logger.raw(` ${Logger.infoText(`-------------------------------------`)}`);
|
|
127
|
-
static object = (content) => {
|
|
128
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
129
|
-
for (const [key, value] of Object.entries(content || {})) {
|
|
130
|
-
if (value && typeof value === "object") {
|
|
131
|
-
Logger.raw(` ${import_chalk.default.bold.grey(key)}:`);
|
|
132
|
-
if (key === "fields" && Array.isArray(value)) {
|
|
133
|
-
for (const field of value || []) {
|
|
134
|
-
Logger.raw(
|
|
135
|
-
` ${import_chalk.default.bold(field.id)}${field.id === content.entryTitleField ? "**" : ((_a = field.validations.minCount) == null ? void 0 : _a.value) || typeof ((_b = field.validations.required) == null ? void 0 : _b.message) !== "undefined" ? "*" : ""}: ${import_chalk.default.grey(
|
|
136
|
-
`${field.dataType}${field.dataFormat ? `<${Array.isArray(
|
|
137
|
-
(_c = field.validations.allowedFieldTypes) == null ? void 0 : _c.fields
|
|
138
|
-
) ? `composer[${field.validations.allowedFieldTypes.fields.map((f) => f.id).join(" | ")}]` : field.dataFormat}${field.dataFormat === "entry" ? `, ${field.validations.allowedContentTypes.contentTypes.join(
|
|
139
|
-
" | "
|
|
140
|
-
)}` : ""}${field.dataFormat === "contenttype" ? `[${(_d = field.validations) == null ? void 0 : _d.allowedDataFormats.dataFormats.join(
|
|
141
|
-
" | "
|
|
142
|
-
)}], ${(((_f = (_e = field.validations) == null ? void 0 : _e.allowedIds) == null ? void 0 : _f.ids) || ["*"]).join(" | ")}` : ""}>` : ""}${((_g = field.validations.maxLength) == null ? void 0 : _g.value) ? `(${field.validations.maxLength.value})` : ""}`
|
|
143
|
-
)}`
|
|
144
|
-
);
|
|
145
|
-
}
|
|
146
|
-
} else if (key === "groups" && Array.isArray(value)) {
|
|
147
|
-
for (const group of value || []) {
|
|
148
|
-
const description = Object.keys(group.description).length && ((_h = Object.values(group.description)) == null ? void 0 : _h[0]);
|
|
149
|
-
Logger.raw(
|
|
150
|
-
` ${import_chalk.default.bold(group.id)}${description ? `: ${import_chalk.default.grey((_i = Object.values(group.description)) == null ? void 0 : _i[0])}` : ""}`
|
|
151
|
-
);
|
|
152
|
-
}
|
|
153
|
-
} else {
|
|
154
|
-
Logger.objectRecurse(value, 3, " ");
|
|
155
|
-
}
|
|
156
|
-
} else if (typeof value !== "undefined" && value !== null) {
|
|
157
|
-
const valueText = key === "id" && typeof value === "string" ? Logger.highlightText(value) : value;
|
|
158
|
-
Logger.raw(` ${import_chalk.default.bold.grey(key)}: ${valueText}`);
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
};
|
|
162
|
-
static objectRecurse = (content, depth = 3, indent = "") => {
|
|
163
|
-
if (Array.isArray(content)) {
|
|
164
|
-
for (const item of content) {
|
|
165
|
-
if (item && typeof item === "object") {
|
|
166
|
-
if (Array.isArray(item) && depth > 3)
|
|
167
|
-
if (item.length)
|
|
168
|
-
Logger.raw(import_chalk.default.grey(`${indent} [${item.join(", ")}]`));
|
|
169
|
-
else Logger.objectRecurse(item, depth + 1, `${indent} `);
|
|
170
|
-
else {
|
|
171
|
-
if (Array.isArray(item))
|
|
172
|
-
Logger.raw(
|
|
173
|
-
`${indent}${import_chalk.default.grey(`[`)}${item.join(", ")}${import_chalk.default.grey(
|
|
174
|
-
`]`
|
|
175
|
-
)}`
|
|
176
|
-
);
|
|
177
|
-
else if (typeof item === "object" && item)
|
|
178
|
-
Logger.objectRecurse(item, depth + 1, `${indent} `);
|
|
179
|
-
else Logger.raw(`${indent}${item}`);
|
|
180
|
-
}
|
|
181
|
-
} else Logger.raw(`${indent}${item}`);
|
|
182
|
-
}
|
|
183
|
-
} else {
|
|
184
|
-
let pos = 0;
|
|
185
|
-
for (const [key, value] of Object.entries(content)) {
|
|
186
|
-
if (key === "stack") continue;
|
|
187
|
-
const thisIndent = pos === 0 ? `${indent.substring(0, indent.length - 2)}- ` : indent;
|
|
188
|
-
if (Array.isArray(value)) {
|
|
189
|
-
if (value.length) Logger.raw(`${thisIndent}${import_chalk.default.bold.grey(key)}:`);
|
|
190
|
-
for (const item of value) {
|
|
191
|
-
if (item && typeof item === "object") {
|
|
192
|
-
if (Array.isArray(item) && depth > 3)
|
|
193
|
-
Logger.raw(import_chalk.default.grey(`${indent} [${item.join(", ")}]`));
|
|
194
|
-
else Logger.objectRecurse(item, depth + 1, `${indent} `);
|
|
195
|
-
} else {
|
|
196
|
-
Logger.raw(`${indent} ${item}`);
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
} else if (value && typeof value === "object") {
|
|
200
|
-
Logger.raw(`${indent}${import_chalk.default.bold.grey(key)}:`);
|
|
201
|
-
Logger.objectRecurse(value, depth + 1, `${indent} `);
|
|
202
|
-
} else if (typeof value !== "undefined" && value !== null) {
|
|
203
|
-
Logger.raw(`${thisIndent}${import_chalk.default.bold.grey(key)}: ${value}`);
|
|
204
|
-
}
|
|
205
|
-
pos++;
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
};
|
|
209
|
-
static raw = (content) => {
|
|
210
|
-
if (progress.active) progress.current.interrupt(content);
|
|
211
|
-
else console.log(content);
|
|
212
|
-
};
|
|
213
|
-
static limits = (content, displayLength = 30, consoleWidth = process.stdout.columns, logMethod = console.info) => {
|
|
214
|
-
if (consoleWidth) {
|
|
215
|
-
const contentArray = content.endsWith("\n") ? content.split("\n").slice(0, -1) : content.split("\n");
|
|
216
|
-
const contentLines = contentArray.slice(
|
|
217
|
-
0,
|
|
218
|
-
consoleWidth ? displayLength : void 0
|
|
219
|
-
);
|
|
220
|
-
for (const line of contentLines)
|
|
221
|
-
logMethod(
|
|
222
|
-
line.split("~n").map(
|
|
223
|
-
(l) => consoleWidth && (0, import_printable_characters.strlen)(l) > consoleWidth ? (0, import_printable_characters.first)(l, consoleWidth) : l
|
|
224
|
-
).join("\n")
|
|
225
|
-
);
|
|
226
|
-
} else {
|
|
227
|
-
logMethod(content.replace(import_printable_characters.ansiEscapeCodes, "").replaceAll("~n", "\n"));
|
|
228
|
-
}
|
|
229
|
-
const tableArray = content.split("\n");
|
|
230
|
-
if (consoleWidth && tableArray.length > displayLength)
|
|
231
|
-
console.info(
|
|
232
|
-
`
|
|
233
|
-
`,
|
|
234
|
-
`- and ${tableArray.length - displayLength} more...
|
|
235
|
-
`
|
|
236
|
-
);
|
|
237
|
-
};
|
|
238
|
-
}
|
|
239
|
-
const logError = (err = new Error("Undefined error"), msg, level = "error") => {
|
|
240
|
-
var _a;
|
|
241
|
-
Logger[level](msg || err.message || ((_a = err == null ? void 0 : err.data) == null ? void 0 : _a.message) || err.Message);
|
|
242
|
-
(Array.isArray(err) ? err : [err]).map((error) => {
|
|
243
|
-
if (typeof error === "string") {
|
|
244
|
-
Logger.raw(`${Logger.infoText(error)}
|
|
245
|
-
`);
|
|
246
|
-
return;
|
|
247
|
-
}
|
|
248
|
-
if ("stack" in error) Logger.raw(` ${Logger.infoText(error.stack)}
|
|
249
|
-
`);
|
|
250
|
-
if ("data" in error)
|
|
251
|
-
Logger.raw(` ${Logger.infoText((0, import_assert.tryStringify)(error.data))}
|
|
252
|
-
`);
|
|
253
|
-
});
|
|
254
|
-
return null;
|
|
255
|
-
};
|
|
256
|
-
const addNewLines = (message = "", newLineSeparater = "\n", atPosition = process.stdout.columns) => {
|
|
257
|
-
if (message === "" || atPosition === 0) {
|
|
258
|
-
return "";
|
|
259
|
-
}
|
|
260
|
-
let result = "";
|
|
261
|
-
let lengthCounter = 0;
|
|
262
|
-
const partitioned = (0, import_printable_characters.partition)(message);
|
|
263
|
-
const addSeparater = () => {
|
|
264
|
-
if (lengthCounter >= atPosition) {
|
|
265
|
-
result += newLineSeparater;
|
|
266
|
-
lengthCounter = 0;
|
|
267
|
-
}
|
|
268
|
-
};
|
|
269
|
-
for (const [nonPrintable, printable] of partitioned) {
|
|
270
|
-
const textParts = Array.from(printable);
|
|
271
|
-
const text = textParts.splice(0, atPosition - lengthCounter);
|
|
272
|
-
result += nonPrintable + text.join("");
|
|
273
|
-
lengthCounter += text.length;
|
|
274
|
-
addSeparater();
|
|
275
|
-
while (textParts.length) {
|
|
276
|
-
const text2 = textParts.splice(0, atPosition - lengthCounter);
|
|
277
|
-
result += text2.join("");
|
|
278
|
-
lengthCounter += text2.length;
|
|
279
|
-
addSeparater();
|
|
280
|
-
}
|
|
281
|
-
}
|
|
282
|
-
return result;
|
|
283
|
-
};
|
|
284
|
-
const progress = {
|
|
285
|
-
current: { interrupt: (x) => {
|
|
286
|
-
} },
|
|
287
|
-
active: false
|
|
288
|
-
// done: () => new ProgressBar('', 0),
|
|
289
|
-
// colours: { green: '\u001b[42m \u001b[0m', red: '\u001b[41m \u001b[0m' },
|
|
290
|
-
// current: new ProgressBar(`:bar`, {
|
|
291
|
-
// complete: '=',
|
|
292
|
-
// incomplete: ' ',
|
|
293
|
-
// width: 20,
|
|
294
|
-
// total: 100,
|
|
295
|
-
// }),
|
|
296
|
-
};
|
|
297
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
298
|
-
0 && (module.exports = {
|
|
299
|
-
Logger,
|
|
300
|
-
addNewLines,
|
|
301
|
-
logError,
|
|
302
|
-
progress
|
|
303
|
-
});
|
|
304
|
-
//# sourceMappingURL=logger.js.map
|
package/dist/util/logger.js.map
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/util/logger.ts"],
|
|
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 './assert';\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\nconst cleanseError = (e: any) => {\n if (e && typeof e === 'object') {\n if (isSysError(e) && e instanceof Error) return e.toString();\n if (e.type === 'undefined') delete e.type;\n if (e.status === 500) delete e.status;\n delete e.stack;\n }\n return JSON.stringify(e, null, 2);\n};\n\nconst errorMessages = (errors: any) => {\n if (Array.isArray(errors))\n return errors.map(error => cleanseError(error)).join('\\n\\n');\n return cleanseError(errors);\n};\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${Logger.infoText(errorMessages(err))}` : ''\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,oBAAyC;AAazC,MAAM,eAAe,CAAC,MAAW;AAC/B,MAAI,KAAK,OAAO,MAAM,UAAU;AAC9B,YAAI,0BAAW,CAAC,KAAK,aAAa,MAAO,QAAO,EAAE,SAAS;AAC3D,QAAI,EAAE,SAAS,YAAa,QAAO,EAAE;AACrC,QAAI,EAAE,WAAW,IAAK,QAAO,EAAE;AAC/B,WAAO,EAAE;AAAA,EACX;AACA,SAAO,KAAK,UAAU,GAAG,MAAM,CAAC;AAClC;AA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U,OAAO;AACrC,QAAM,eAAe,MAAM;AAGzB,QAAI,iBAAiB,YAAY;AAC/B,gBAAU;AACV,sBAAgB;AAAA,IAClB;AAAA,EACF;AAGA,aAAW,CAAC,cAAc,SAAS,KAAK,aAAa;AAGnD,UAAM,YAAY,MAAM,KAAK,SAAS;AAEtC,UAAM,OAAO,UAAU,OAAO,GAAG,aAAa,aAAa;AAG3D,cAAU,eAAe,KAAK,KAAK,EAAE;AAGrC,qBAAiB,KAAK;AACtB,iBAAa;AAGb,WAAO,UAAU,QAAQ;AAEvB,YAAME,QAAO,UAAU,OAAO,GAAG,aAAa,aAAa;AAE3D,gBAAUA,MAAK,KAAK,EAAE;AAEtB,uBAAiBA,MAAK;AACtB,mBAAa;AAAA,IACf;AAAA,EACF;AACA,SAAO;AACT;AAEO,MAAM,WAAW;AAAA,EACtB,SAAS,EAAE,WAAW,CAAC,MAAc;AAAA,EAAC,EAAE;AAAA,EACxC,QAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASV;",
|
|
6
|
-
"names": ["dateFormat", "chalk", "deepCleaner", "text"]
|
|
7
|
-
}
|
package/dist/util/os.js
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
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
|
-
// 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.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var os_exports = {};
|
|
30
|
-
__export(os_exports, {
|
|
31
|
-
linuxSlash: () => linuxSlash,
|
|
32
|
-
normaliseLineEndings: () => normaliseLineEndings,
|
|
33
|
-
winSlash: () => winSlash
|
|
34
|
-
});
|
|
35
|
-
module.exports = __toCommonJS(os_exports);
|
|
36
|
-
var import_os = __toESM(require("os"));
|
|
37
|
-
const winSlash = (str) => import_os.default.platform() === "win32" ? str.replaceAll("/", "\\") : str;
|
|
38
|
-
const linuxSlash = (str) => import_os.default.platform() === "win32" ? str.replaceAll("\\", "/") : str;
|
|
39
|
-
const normaliseLineEndings = (str, lineEnd = import_os.default.platform() === "win32" ? "\r\n" : "n") => str.replace(/\r?\n/g, lineEnd);
|
|
40
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
41
|
-
0 && (module.exports = {
|
|
42
|
-
linuxSlash,
|
|
43
|
-
normaliseLineEndings,
|
|
44
|
-
winSlash
|
|
45
|
-
});
|
|
46
|
-
//# sourceMappingURL=os.js.map
|
package/dist/util/os.js.map
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/util/os.ts"],
|
|
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": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;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
|
-
"names": ["os"]
|
|
7
|
-
}
|
package/dist/util/timers.js
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
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 timers_exports = {};
|
|
20
|
-
__export(timers_exports, {
|
|
21
|
-
promiseDelay: () => promiseDelay
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(timers_exports);
|
|
24
|
-
const promiseDelay = (delay, value) => {
|
|
25
|
-
let timeout;
|
|
26
|
-
let _reject;
|
|
27
|
-
const wait = () => new Promise((resolve, reject) => {
|
|
28
|
-
_reject = reject;
|
|
29
|
-
timeout = setTimeout(resolve, delay, value);
|
|
30
|
-
});
|
|
31
|
-
const promise = wait();
|
|
32
|
-
return {
|
|
33
|
-
promise,
|
|
34
|
-
cancel() {
|
|
35
|
-
if (timeout) {
|
|
36
|
-
clearTimeout(timeout);
|
|
37
|
-
timeout = null;
|
|
38
|
-
_reject();
|
|
39
|
-
_reject = null;
|
|
40
|
-
}
|
|
41
|
-
},
|
|
42
|
-
wait
|
|
43
|
-
};
|
|
44
|
-
};
|
|
45
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
46
|
-
0 && (module.exports = {
|
|
47
|
-
promiseDelay
|
|
48
|
-
});
|
|
49
|
-
//# sourceMappingURL=timers.js.map
|
package/dist/util/timers.js.map
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/util/timers.ts"],
|
|
4
|
-
"sourcesContent": ["export const promiseDelay = (delay: number, value: any) => {\n let timeout: NodeJS.Timeout | null;\n let _reject: PromiseRejectionEvent['reason'];\n\n const wait = () =>\n new Promise((resolve, reject) => {\n _reject = reject;\n timeout = setTimeout(resolve, delay, value);\n });\n\n const promise = wait();\n return {\n promise,\n cancel() {\n if (timeout) {\n clearTimeout(timeout);\n timeout = null;\n _reject();\n _reject = null;\n }\n },\n wait,\n };\n};\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,MAAM,eAAe,CAAC,OAAe,UAAe;AACzD,MAAI;AACJ,MAAI;AAEJ,QAAM,OAAO,MACX,IAAI,QAAQ,CAAC,SAAS,WAAW;AAC/B,cAAU;AACV,cAAU,WAAW,SAAS,OAAO,KAAK;AAAA,EAC5C,CAAC;AAEH,QAAM,UAAU,KAAK;AACrB,SAAO;AAAA,IACL;AAAA,IACA,SAAS;AACP,UAAI,SAAS;AACX,qBAAa,OAAO;AACpB,kBAAU;AACV,gBAAQ;AACR,kBAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA;AAAA,EACF;AACF;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,62 +0,0 @@
|
|
|
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
|
-
// 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.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var xml_formatter_exports = {};
|
|
30
|
-
__export(xml_formatter_exports, {
|
|
31
|
-
xmlFormatter: () => xmlFormatter,
|
|
32
|
-
xmlToJson: () => xmlToJson
|
|
33
|
-
});
|
|
34
|
-
module.exports = __toCommonJS(xml_formatter_exports);
|
|
35
|
-
var import_xml2js = __toESM(require("xml2js"));
|
|
36
|
-
var import_deep_cleaner = __toESM(require("deep-cleaner"));
|
|
37
|
-
var import_logger = require("./logger");
|
|
38
|
-
const xmlFormatter = (entries) => {
|
|
39
|
-
try {
|
|
40
|
-
const cleanedEntries = (0, import_deep_cleaner.default)((0, import_deep_cleaner.default)(entries, ["workflow"]));
|
|
41
|
-
const builder = new import_xml2js.default.Builder({
|
|
42
|
-
cdata: true,
|
|
43
|
-
rootName: "Items"
|
|
44
|
-
});
|
|
45
|
-
const xml = builder.buildObject({ Entry: cleanedEntries });
|
|
46
|
-
return xml;
|
|
47
|
-
} catch (ex) {
|
|
48
|
-
import_logger.Logger.error(`Problem building XML from json data`, ex);
|
|
49
|
-
return "";
|
|
50
|
-
}
|
|
51
|
-
};
|
|
52
|
-
const xmlToJson = async (data) => {
|
|
53
|
-
var _a;
|
|
54
|
-
const json = await import_xml2js.default.parseStringPromise(data, { explicitArray: false });
|
|
55
|
-
return ((_a = json.Items) == null ? void 0 : _a.Entry) || json;
|
|
56
|
-
};
|
|
57
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
58
|
-
0 && (module.exports = {
|
|
59
|
-
xmlFormatter,
|
|
60
|
-
xmlToJson
|
|
61
|
-
});
|
|
62
|
-
//# sourceMappingURL=xml.formatter.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/util/xml.formatter.ts"],
|
|
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": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;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
|
-
"names": ["cleaner", "xml2js"]
|
|
7
|
-
}
|
package/dist/util/yaml.js
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
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 yaml_exports = {};
|
|
20
|
-
__export(yaml_exports, {
|
|
21
|
-
parseYaml: () => parseYaml,
|
|
22
|
-
parseYamlDocument: () => parseYamlDocument,
|
|
23
|
-
stringifyYaml: () => stringifyYaml,
|
|
24
|
-
validateWorkflowYaml: () => validateWorkflowYaml
|
|
25
|
-
});
|
|
26
|
-
module.exports = __toCommonJS(yaml_exports);
|
|
27
|
-
var import_core = require("@action-validator/core");
|
|
28
|
-
var import_yaml = require("yaml");
|
|
29
|
-
const parseYaml = import_yaml.parse;
|
|
30
|
-
const parseYamlDocument = import_yaml.parseDocument;
|
|
31
|
-
const stringifyYaml = import_yaml.stringify;
|
|
32
|
-
const validateWorkflowYaml = (yaml) => {
|
|
33
|
-
const { actionType, errors } = (0, import_core.validateWorkflow)(yaml);
|
|
34
|
-
if (actionType && errors.length === 0) return true;
|
|
35
|
-
return errors;
|
|
36
|
-
};
|
|
37
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
38
|
-
0 && (module.exports = {
|
|
39
|
-
parseYaml,
|
|
40
|
-
parseYamlDocument,
|
|
41
|
-
stringifyYaml,
|
|
42
|
-
validateWorkflowYaml
|
|
43
|
-
});
|
|
44
|
-
//# sourceMappingURL=yaml.js.map
|
package/dist/util/yaml.js.map
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/util/yaml.ts"],
|
|
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,EAAG,QAAO;AAC9C,SAAO;AACT;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
package/dist/version.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
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 version_exports = {};
|
|
20
|
-
__export(version_exports, {
|
|
21
|
-
LIB_VERSION: () => LIB_VERSION
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(version_exports);
|
|
24
|
-
const LIB_VERSION = "1.6.1-beta.2";
|
|
25
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
26
|
-
0 && (module.exports = {
|
|
27
|
-
LIB_VERSION
|
|
28
|
-
});
|
|
29
|
-
//# sourceMappingURL=version.js.map
|