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/git.js
DELETED
|
@@ -1,145 +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 git_exports = {};
|
|
30
|
-
__export(git_exports, {
|
|
31
|
-
GitHelper: () => GitHelper
|
|
32
|
-
});
|
|
33
|
-
module.exports = __toCommonJS(git_exports);
|
|
34
|
-
var import_giturl = __toESM(require("giturl"));
|
|
35
|
-
var import_hosted_git_info = __toESM(require("hosted-git-info"));
|
|
36
|
-
var import_parse_git_config = __toESM(require("parse-git-config"));
|
|
37
|
-
var import_path = __toESM(require("path"));
|
|
38
|
-
var import_os = require("./os");
|
|
39
|
-
var import_file_provider = require("../providers/file-provider");
|
|
40
|
-
var import_logger = require("./logger");
|
|
41
|
-
const GITLAB_CI_FILENAME = ".gitlab-ci.yml";
|
|
42
|
-
class GitHelper {
|
|
43
|
-
gitRepoPath;
|
|
44
|
-
ciFile;
|
|
45
|
-
config = {};
|
|
46
|
-
info;
|
|
47
|
-
home;
|
|
48
|
-
set ciFileName(fileName) {
|
|
49
|
-
this.ciFile = fileName;
|
|
50
|
-
}
|
|
51
|
-
get ciFileName() {
|
|
52
|
-
var _a;
|
|
53
|
-
return this.ciFile || (this.workflows ? this.type === "github" ? this.workflows.length > 1 ? "[multiple workflows]" : (_a = this.workflows) == null ? void 0 : _a[0] : GITLAB_CI_FILENAME : "[unknown]");
|
|
54
|
-
}
|
|
55
|
-
get ciFilePath() {
|
|
56
|
-
return `${this.gitRepoPath}/${this.ciFileName}`;
|
|
57
|
-
}
|
|
58
|
-
get name() {
|
|
59
|
-
var _a, _b;
|
|
60
|
-
return ((_a = this.info) == null ? void 0 : _a.project) || ((_b = this.home) == null ? void 0 : _b.split("/").pop()) || "[set arg --name]";
|
|
61
|
-
}
|
|
62
|
-
get originUrl() {
|
|
63
|
-
var _a, _b, _c;
|
|
64
|
-
const originUrl = (_c = (_b = (_a = this == null ? void 0 : this.config) == null ? void 0 : _a.remote) == null ? void 0 : _b.origin) == null ? void 0 : _c.url;
|
|
65
|
-
if (originUrl) return originUrl;
|
|
66
|
-
}
|
|
67
|
-
get secretsUri() {
|
|
68
|
-
return `${this.type === "github" ? `${this.home}/settings/secrets/actions` : `${this.home}/-/settings/ci_cd`}`;
|
|
69
|
-
}
|
|
70
|
-
get type() {
|
|
71
|
-
var _a;
|
|
72
|
-
return ((_a = this.info) == null ? void 0 : _a.type) || this.hostType();
|
|
73
|
-
}
|
|
74
|
-
get workflows() {
|
|
75
|
-
return this.type === "github" ? this.githubWorkflows() : this.gitlabWorkflow();
|
|
76
|
-
}
|
|
77
|
-
constructor(gitRepoPath = process.cwd()) {
|
|
78
|
-
this.gitRepoPath = gitRepoPath;
|
|
79
|
-
this.config = this.gitConfig();
|
|
80
|
-
this.home = import_giturl.default.parse(this.originUrl);
|
|
81
|
-
this.info = this.gitInfo();
|
|
82
|
-
}
|
|
83
|
-
gitcwd = () => import_path.default.join(this.gitRepoPath);
|
|
84
|
-
gitInfo = (url = this.originUrl) => import_hosted_git_info.default.fromUrl(url);
|
|
85
|
-
hostType = (url = this.originUrl) => {
|
|
86
|
-
if (url) {
|
|
87
|
-
if (url.includes("github.com")) return "github";
|
|
88
|
-
else return "gitlab";
|
|
89
|
-
}
|
|
90
|
-
};
|
|
91
|
-
gitConfig = (cwd = this.gitRepoPath) => {
|
|
92
|
-
const config = import_parse_git_config.default.sync({
|
|
93
|
-
cwd,
|
|
94
|
-
path: ".git/config",
|
|
95
|
-
expandKeys: true
|
|
96
|
-
});
|
|
97
|
-
if (Object.keys(config || {}).length) return config;
|
|
98
|
-
const pathParts = (0, import_os.linuxSlash)(cwd).split("/");
|
|
99
|
-
for (let i = 1; i <= pathParts.length; i++) {
|
|
100
|
-
const relPath = `${Array(i).fill("..").join("/")}/.git/config`;
|
|
101
|
-
const config2 = import_parse_git_config.default.sync({
|
|
102
|
-
path: relPath,
|
|
103
|
-
expandKeys: true
|
|
104
|
-
});
|
|
105
|
-
if (Object.keys(config2 || {}).length) {
|
|
106
|
-
this.gitRepoPath = import_path.default.join(
|
|
107
|
-
this.gitRepoPath,
|
|
108
|
-
Array(i).fill("..").join("/")
|
|
109
|
-
);
|
|
110
|
-
return config2;
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
return config;
|
|
114
|
-
};
|
|
115
|
-
githubWorkflows = () => {
|
|
116
|
-
const workflowPath = import_path.default.join(this.gitcwd(), ".github/workflows");
|
|
117
|
-
const workflowFiles = (0, import_file_provider.readFiles)(workflowPath, false);
|
|
118
|
-
const addFolderSuffix = (files) => files.map((f) => `.github/workflows/${f}`);
|
|
119
|
-
if (workflowFiles.some((f) => f.includes("build"))) {
|
|
120
|
-
return addFolderSuffix(workflowFiles.filter((f) => f.includes("build")));
|
|
121
|
-
} else {
|
|
122
|
-
return addFolderSuffix(workflowFiles);
|
|
123
|
-
}
|
|
124
|
-
};
|
|
125
|
-
gitlabWorkflow = (ciFileName = GITLAB_CI_FILENAME) => {
|
|
126
|
-
const workflowPath = this.gitcwd();
|
|
127
|
-
const workflowFilePath = import_path.default.join(workflowPath, ciFileName);
|
|
128
|
-
const workflowFile = (0, import_file_provider.readFile)(workflowFilePath);
|
|
129
|
-
return workflowFile;
|
|
130
|
-
};
|
|
131
|
-
checkIsRepo = () => {
|
|
132
|
-
if (this.config && this.config.core && this.config.core.repositoryformatversion) {
|
|
133
|
-
import_logger.Logger.success("You are inside a Git repository.");
|
|
134
|
-
return true;
|
|
135
|
-
} else {
|
|
136
|
-
import_logger.Logger.error("You are not inside a Git repository.");
|
|
137
|
-
return false;
|
|
138
|
-
}
|
|
139
|
-
};
|
|
140
|
-
}
|
|
141
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
142
|
-
0 && (module.exports = {
|
|
143
|
-
GitHelper
|
|
144
|
-
});
|
|
145
|
-
//# sourceMappingURL=git.js.map
|
package/dist/util/git.js.map
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/util/git.ts"],
|
|
4
|
-
"sourcesContent": ["import giturl from 'giturl';\nimport hostedGitInfo from 'hosted-git-info';\nimport parseGitConfig from 'parse-git-config';\nimport path from 'path';\n\nimport { linuxSlash } from './os';\nimport { readFile, readFiles } from '~/providers/file-provider';\nimport { Logger } from './logger';\n\nconst GITLAB_CI_FILENAME = '.gitlab-ci.yml';\n\ntype GitConfig = parseGitConfig.Config;\n\nexport type GitTypes = hostedGitInfo.Hosts;\n\nexport class GitHelper {\n private gitRepoPath: string;\n private ciFile?: string;\n\n config = {} as GitConfig;\n info: hostedGitInfo | undefined;\n home: string | undefined;\n\n set ciFileName(fileName: string) {\n this.ciFile = fileName;\n }\n\n get ciFileName() {\n return (\n this.ciFile ||\n (this.workflows\n ? this.type === 'github'\n ? this.workflows.length > 1\n ? '[multiple workflows]'\n : this.workflows?.[0]\n : GITLAB_CI_FILENAME\n : '[unknown]')\n );\n }\n get ciFilePath() {\n return `${this.gitRepoPath}/${this.ciFileName}`;\n }\n get name() {\n return (\n this.info?.project || this.home?.split('/').pop() || '[set arg --name]'\n );\n }\n get originUrl() {\n const originUrl = this?.config?.remote?.origin?.url;\n if (originUrl) return originUrl;\n }\n get secretsUri() {\n return `${\n this.type === 'github'\n ? `${this.home}/settings/secrets/actions`\n : `${this.home}/-/settings/ci_cd`\n }`;\n }\n get type() {\n return this.info?.type || this.hostType();\n }\n get workflows() {\n return this.type === 'github'\n ? this.githubWorkflows()\n : this.gitlabWorkflow();\n }\n constructor(gitRepoPath: string = process.cwd()) {\n this.gitRepoPath = gitRepoPath;\n this.config = this.gitConfig();\n this.home = giturl.parse(this.originUrl);\n this.info = this.gitInfo();\n // console.log(this.config);\n // console.log(this.home);\n // console.log(this.info);\n }\n gitcwd = () => path.join(this.gitRepoPath);\n gitInfo = (url: string = this.originUrl) => hostedGitInfo.fromUrl(url);\n hostType = (url: string = this.originUrl): GitTypes | undefined => {\n if (url) {\n if (url.includes('github.com')) return 'github';\n else return 'gitlab';\n }\n\n // if (url.includes('gitlab.com')) return 'gl';\n // if (url.includes('gitlab.zengenti.com')) return 'gl';\n };\n gitConfig = (cwd = this.gitRepoPath) => {\n // Find .git/config in project cwd\n const config = parseGitConfig.sync({\n cwd,\n path: '.git/config',\n expandKeys: true,\n });\n // console.log(cwd, config);\n if (Object.keys(config || {}).length) return config;\n\n // Recursively check the directory heirarchy for existance of a .git/config\n const pathParts = linuxSlash(cwd).split('/');\n for (let i = 1; i <= pathParts.length; i++) {\n const relPath = `${Array(i).fill('..').join('/')}/.git/config`;\n // Does not appear to work when using a shortened cwd, using relative path instead\n const config = parseGitConfig.sync({\n path: relPath,\n expandKeys: true,\n });\n // console.log(relPath, config);\n if (Object.keys(config || {}).length) {\n this.gitRepoPath = path.join(\n this.gitRepoPath,\n Array(i).fill('..').join('/')\n );\n return config;\n }\n }\n return config;\n };\n githubWorkflows = () => {\n const workflowPath = path.join(this.gitcwd(), '.github/workflows');\n const workflowFiles = readFiles(workflowPath, false);\n const addFolderSuffix = (files: string[]) =>\n files.map(f => `.github/workflows/${f}`);\n\n if (workflowFiles.some(f => f.includes('build'))) {\n return addFolderSuffix(workflowFiles.filter(f => f.includes('build')));\n } else {\n return addFolderSuffix(workflowFiles);\n }\n };\n gitlabWorkflow = (ciFileName = GITLAB_CI_FILENAME) => {\n const workflowPath = this.gitcwd();\n const workflowFilePath = path.join(workflowPath, ciFileName);\n const workflowFile = readFile(workflowFilePath);\n // console.log(ciFileName, workflowFile);\n\n return workflowFile;\n };\n checkIsRepo = () => {\n if (\n this.config &&\n this.config.core &&\n this.config.core.repositoryformatversion\n ) {\n Logger.success('You are inside a Git repository.');\n return true;\n } else {\n Logger.error('You are not inside a Git repository.');\n return false;\n }\n };\n}\n"],
|
|
5
|
-
"mappings": "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",
|
|
6
|
-
"names": ["giturl", "path", "hostedGitInfo", "parseGitConfig", "config"]
|
|
7
|
-
}
|
package/dist/util/gitignore.js
DELETED
|
@@ -1,61 +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 gitignore_exports = {};
|
|
30
|
-
__export(gitignore_exports, {
|
|
31
|
-
mergeContentsToAddWithGitignore: () => mergeContentsToAddWithGitignore
|
|
32
|
-
});
|
|
33
|
-
module.exports = __toCommonJS(gitignore_exports);
|
|
34
|
-
var import_fs = __toESM(require("fs"));
|
|
35
|
-
var import_logger = require("./logger");
|
|
36
|
-
const mergeContentsToAddWithGitignore = (filename, contentsToAdd) => {
|
|
37
|
-
if (import_fs.default.existsSync(filename)) {
|
|
38
|
-
const existingContent = import_fs.default.readFileSync(filename, "utf-8");
|
|
39
|
-
const existingContentSet = new Set(
|
|
40
|
-
existingContent.split("\n").filter((line) => line.trim() !== "")
|
|
41
|
-
);
|
|
42
|
-
const newContents = contentsToAdd.filter(
|
|
43
|
-
(contentsItem) => !existingContentSet.has(contentsItem)
|
|
44
|
-
);
|
|
45
|
-
if (newContents.length >= 1) {
|
|
46
|
-
import_fs.default.appendFileSync(filename, "\n" + newContents.join("\n"));
|
|
47
|
-
import_logger.Logger.success(".gitignore file updated");
|
|
48
|
-
} else {
|
|
49
|
-
import_logger.Logger.success(".gitignore checked, nothing to update");
|
|
50
|
-
}
|
|
51
|
-
} else {
|
|
52
|
-
const gitignoreContent = contentsToAdd.join("\n");
|
|
53
|
-
import_fs.default.writeFileSync(filename, gitignoreContent);
|
|
54
|
-
import_logger.Logger.success(".gitignore file created and updated");
|
|
55
|
-
}
|
|
56
|
-
};
|
|
57
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
58
|
-
0 && (module.exports = {
|
|
59
|
-
mergeContentsToAddWithGitignore
|
|
60
|
-
});
|
|
61
|
-
//# sourceMappingURL=gitignore.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/util/gitignore.ts"],
|
|
4
|
-
"sourcesContent": ["import fs from 'fs';\nimport { Logger } from './logger';\n\nexport const mergeContentsToAddWithGitignore = (\n filename: string,\n contentsToAdd: string[]\n) => {\n // Check if .gitignore file already exists\n if (fs.existsSync(filename)) {\n // Read the existing .gitignore file\n const existingContent = fs.readFileSync(filename, 'utf-8');\n\n // Create a Set from existing patterns for fast look-up\n const existingContentSet = new Set(\n existingContent.split('\\n').filter(line => line.trim() !== '')\n );\n\n // Filter out patterns that already exist\n const newContents = contentsToAdd.filter(\n contentsItem => !existingContentSet.has(contentsItem)\n );\n\n if (newContents.length >= 1) {\n // Append the new patterns to the end of the existing .gitignore content\n fs.appendFileSync(filename, '\\n' + newContents.join('\\n'));\n Logger.success('.gitignore file updated');\n } else {\n Logger.success('.gitignore checked, nothing to update');\n }\n } else {\n // If .gitignore doesn't exist, create one and add the contents\n const gitignoreContent = contentsToAdd.join('\\n');\n fs.writeFileSync(filename, gitignoreContent);\n\n Logger.success('.gitignore file created and updated');\n }\n};\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gBAAe;AACf,oBAAuB;AAEhB,MAAM,kCAAkC,CAC7C,UACA,kBACG;AAEH,MAAI,UAAAA,QAAG,WAAW,QAAQ,GAAG;AAE3B,UAAM,kBAAkB,UAAAA,QAAG,aAAa,UAAU,OAAO;AAGzD,UAAM,qBAAqB,IAAI;AAAA,MAC7B,gBAAgB,MAAM,IAAI,EAAE,OAAO,UAAQ,KAAK,KAAK,MAAM,EAAE;AAAA,IAC/D;AAGA,UAAM,cAAc,cAAc;AAAA,MAChC,kBAAgB,CAAC,mBAAmB,IAAI,YAAY;AAAA,IACtD;AAEA,QAAI,YAAY,UAAU,GAAG;AAE3B,gBAAAA,QAAG,eAAe,UAAU,OAAO,YAAY,KAAK,IAAI,CAAC;AACzD,2BAAO,QAAQ,yBAAyB;AAAA,IAC1C,OAAO;AACL,2BAAO,QAAQ,uCAAuC;AAAA,IACxD;AAAA,EACF,OAAO;AAEL,UAAM,mBAAmB,cAAc,KAAK,IAAI;AAChD,cAAAA,QAAG,cAAc,UAAU,gBAAgB;AAE3C,yBAAO,QAAQ,qCAAqC;AAAA,EACtD;AACF;",
|
|
6
|
-
"names": ["fs"]
|
|
7
|
-
}
|
|
@@ -1,70 +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 html_formatter_exports = {};
|
|
20
|
-
__export(html_formatter_exports, {
|
|
21
|
-
htmlFormatter: () => htmlFormatter
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(html_formatter_exports);
|
|
24
|
-
var import_json = require("./json.formatter");
|
|
25
|
-
const htmlFormatter = (entries, isDoc = true) => {
|
|
26
|
-
const flatEntries = [];
|
|
27
|
-
if (Array.isArray(entries))
|
|
28
|
-
for (const entry of entries) {
|
|
29
|
-
flatEntries.push((0, import_json.flattenObject)(entry));
|
|
30
|
-
}
|
|
31
|
-
else flatEntries.push((0, import_json.flattenObject)(entries));
|
|
32
|
-
const columns = new Set(flatEntries.map((e) => Object.keys(e)).flat());
|
|
33
|
-
let table = `<table id="contensis-cli-table"><thead><tr>`;
|
|
34
|
-
for (const column of columns) {
|
|
35
|
-
table += `<td>${column}</td>`;
|
|
36
|
-
}
|
|
37
|
-
table += `</tr></thead><tbody>`;
|
|
38
|
-
for (const row of flatEntries) {
|
|
39
|
-
table += `<tr>`;
|
|
40
|
-
for (const column of columns) {
|
|
41
|
-
const val = row[column];
|
|
42
|
-
table += `<td>${typeof val === "undefined" ? "" : val}</td>`;
|
|
43
|
-
}
|
|
44
|
-
table += `</tr>`;
|
|
45
|
-
}
|
|
46
|
-
table += `</tbody></table>`;
|
|
47
|
-
if (isDoc)
|
|
48
|
-
table = `<html><head>${headTag()}</head><body>${table}${scriptTag()}</body></html>`;
|
|
49
|
-
return table;
|
|
50
|
-
};
|
|
51
|
-
const headTag = () => {
|
|
52
|
-
return `<link rel="stylesheet" href="https://cdn.datatables.net/2.1.8/css/dataTables.dataTables.css" />
|
|
53
|
-
<script
|
|
54
|
-
src="https://code.jquery.com/jquery-3.7.1.slim.min.js"
|
|
55
|
-
integrity="sha256-kmHvs0B+OpCW5GVHUNjv9rOmY0IvSIRcf7zGUDTDQM8="
|
|
56
|
-
crossorigin="anonymous"></script>
|
|
57
|
-
<script src="https://cdn.datatables.net/2.1.8/js/dataTables.js"></script>`;
|
|
58
|
-
};
|
|
59
|
-
const scriptTag = () => {
|
|
60
|
-
return `<script>
|
|
61
|
-
let table = new DataTable('#contensis-cli-table', {
|
|
62
|
-
pageLength: 50
|
|
63
|
-
});
|
|
64
|
-
</script>`;
|
|
65
|
-
};
|
|
66
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
67
|
-
0 && (module.exports = {
|
|
68
|
-
htmlFormatter
|
|
69
|
-
});
|
|
70
|
-
//# sourceMappingURL=html.formatter.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/util/html.formatter.ts"],
|
|
4
|
-
"sourcesContent": ["import { flattenObject } from './json.formatter';\n\nexport const htmlFormatter = <T>(entries: T | T[], isDoc = true) => {\n // Flatten the passed in object\n const flatEntries = [] as any[];\n if (Array.isArray(entries))\n for (const entry of entries) {\n flatEntries.push(flattenObject(entry));\n }\n else flatEntries.push(flattenObject(entries));\n\n // Parse the flattened object to csv\n // const csv = stringify(flatEntries, { header: true });\n // Create an exhaustive list of columns from the entries array\n const columns = new Set<string>(flatEntries.map(e => Object.keys(e)).flat());\n\n let table = `<table id=\"contensis-cli-table\"><thead><tr>`;\n for (const column of columns) {\n table += `<td>${column}</td>`;\n }\n table += `</tr></thead><tbody>`;\n for (const row of flatEntries) {\n table += `<tr>`;\n for (const column of columns) {\n const val = row[column];\n table += `<td>${typeof val === 'undefined' ? '' : val}</td>`;\n }\n table += `</tr>`;\n }\n table += `</tbody></table>`;\n\n if (isDoc)\n table = `<html><head>${headTag()}</head><body>${table}${scriptTag()}</body></html>`;\n return table;\n};\n\nconst headTag = () => {\n return `<link rel=\"stylesheet\" href=\"https://cdn.datatables.net/2.1.8/css/dataTables.dataTables.css\" />\n<script\n src=\"https://code.jquery.com/jquery-3.7.1.slim.min.js\"\n integrity=\"sha256-kmHvs0B+OpCW5GVHUNjv9rOmY0IvSIRcf7zGUDTDQM8=\"\n crossorigin=\"anonymous\"></script>\n<script src=\"https://cdn.datatables.net/2.1.8/js/dataTables.js\"></script>`;\n};\n\nconst scriptTag = () => {\n return `<script>\nlet table = new DataTable('#contensis-cli-table', {\n pageLength: 50\n});\n</script>`;\n};\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAA8B;AAEvB,MAAM,gBAAgB,CAAI,SAAkB,QAAQ,SAAS;AAElE,QAAM,cAAc,CAAC;AACrB,MAAI,MAAM,QAAQ,OAAO;AACvB,eAAW,SAAS,SAAS;AAC3B,kBAAY,SAAK,2BAAc,KAAK,CAAC;AAAA,IACvC;AAAA,MACG,aAAY,SAAK,2BAAc,OAAO,CAAC;AAK5C,QAAM,UAAU,IAAI,IAAY,YAAY,IAAI,OAAK,OAAO,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC;AAE3E,MAAI,QAAQ;AACZ,aAAW,UAAU,SAAS;AAC5B,aAAS,OAAO,MAAM;AAAA,EACxB;AACA,WAAS;AACT,aAAW,OAAO,aAAa;AAC7B,aAAS;AACT,eAAW,UAAU,SAAS;AAC5B,YAAM,MAAM,IAAI,MAAM;AACtB,eAAS,OAAO,OAAO,QAAQ,cAAc,KAAK,GAAG;AAAA,IACvD;AACA,aAAS;AAAA,EACX;AACA,WAAS;AAET,MAAI;AACF,YAAQ,eAAe,QAAQ,CAAC,gBAAgB,KAAK,GAAG,UAAU,CAAC;AACrE,SAAO;AACT;AAEA,MAAM,UAAU,MAAM;AACpB,SAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAMT;AAEA,MAAM,YAAY,MAAM;AACtB,SAAO;AAAA;AAAA;AAAA;AAAA;AAKT;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
package/dist/util/index.js
DELETED
|
@@ -1,68 +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 util_exports = {};
|
|
30
|
-
__export(util_exports, {
|
|
31
|
-
Logging: () => Logging,
|
|
32
|
-
url: () => url
|
|
33
|
-
});
|
|
34
|
-
module.exports = __toCommonJS(util_exports);
|
|
35
|
-
var import_mergeWith = __toESM(require("lodash/mergeWith"));
|
|
36
|
-
var import_logger = require("./logger");
|
|
37
|
-
var import_en_GB = require("../localisation/en-GB.js");
|
|
38
|
-
const url = (alias, project) => {
|
|
39
|
-
const projectAndAlias = project && project.toLowerCase() !== "website" ? `${project.toLowerCase()}-${alias}` : alias;
|
|
40
|
-
return {
|
|
41
|
-
api: `https://api-${alias}.cloud.contensis.com`,
|
|
42
|
-
cms: `https://cms-${alias}.cloud.contensis.com`,
|
|
43
|
-
liveWeb: `https://live-${projectAndAlias}.cloud.contensis.com`,
|
|
44
|
-
previewWeb: `https://preview-${projectAndAlias}.cloud.contensis.com`,
|
|
45
|
-
iisWeb: `https://iis-live-${projectAndAlias}.cloud.contensis.com`,
|
|
46
|
-
iisPreviewWeb: `https://iis-preview-${projectAndAlias}.cloud.contensis.com`
|
|
47
|
-
};
|
|
48
|
-
};
|
|
49
|
-
const Logging = async (language = "en-GB") => {
|
|
50
|
-
const defaultMessages = import_en_GB.LogMessages;
|
|
51
|
-
const localisedMessages = defaultMessages;
|
|
52
|
-
if (language === "en-GB") {
|
|
53
|
-
}
|
|
54
|
-
return {
|
|
55
|
-
messages: (0, import_mergeWith.default)(
|
|
56
|
-
localisedMessages,
|
|
57
|
-
defaultMessages,
|
|
58
|
-
(v, s) => v || s
|
|
59
|
-
),
|
|
60
|
-
Log: import_logger.Logger
|
|
61
|
-
};
|
|
62
|
-
};
|
|
63
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
64
|
-
0 && (module.exports = {
|
|
65
|
-
Logging,
|
|
66
|
-
url
|
|
67
|
-
});
|
|
68
|
-
//# sourceMappingURL=index.js.map
|
package/dist/util/index.js.map
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/util/index.ts"],
|
|
4
|
-
"sourcesContent": ["import { ContentType, Component } from 'contensis-core-api';\nimport { ICreateTag, ICreateTagGroup } from 'contensis-management-api';\nimport mergeWith from 'lodash/mergeWith';\nimport { Logger } from './logger';\nimport { LogMessages as enGB } from '../localisation/en-GB.js';\nimport { isObject } from 'lodash';\n\nexport const url = (alias: string, project: string) => {\n const projectAndAlias =\n project && project.toLowerCase() !== 'website'\n ? `${project.toLowerCase()}-${alias}`\n : alias;\n return {\n api: `https://api-${alias}.cloud.contensis.com`,\n cms: `https://cms-${alias}.cloud.contensis.com`,\n liveWeb: `https://live-${projectAndAlias}.cloud.contensis.com`,\n previewWeb: `https://preview-${projectAndAlias}.cloud.contensis.com`,\n iisWeb: `https://iis-live-${projectAndAlias}.cloud.contensis.com`,\n iisPreviewWeb: `https://iis-preview-${projectAndAlias}.cloud.contensis.com`,\n };\n};\n\nexport const Logging = async (language = 'en-GB') => {\n const defaultMessages = enGB;\n // const { LogMessages: defaultMessages } = await import(\n // `../localisation/en-GB.js`\n // );\n const localisedMessages = defaultMessages;\n\n if (language === 'en-GB') {\n // Using a variable import e.g. `import(`../localisation/${language}.js`);`\n // does not play well with packaged executables\n // So we have to hard code the import for each language individually\n }\n return {\n messages: mergeWith(\n localisedMessages,\n defaultMessages,\n (v, s) => v || s\n ) as typeof defaultMessages,\n Log: Logger,\n };\n};\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,uBAAsB;AACtB,oBAAuB;AACvB,mBAAoC;AAG7B,MAAM,MAAM,CAAC,OAAe,YAAoB;AACrD,QAAM,kBACJ,WAAW,QAAQ,YAAY,MAAM,YACjC,GAAG,QAAQ,YAAY,CAAC,IAAI,KAAK,KACjC;AACN,SAAO;AAAA,IACL,KAAK,eAAe,KAAK;AAAA,IACzB,KAAK,eAAe,KAAK;AAAA,IACzB,SAAS,gBAAgB,eAAe;AAAA,IACxC,YAAY,mBAAmB,eAAe;AAAA,IAC9C,QAAQ,oBAAoB,eAAe;AAAA,IAC3C,eAAe,uBAAuB,eAAe;AAAA,EACvD;AACF;AAEO,MAAM,UAAU,OAAO,WAAW,YAAY;AACnD,QAAM,kBAAkB,aAAAA;AAIxB,QAAM,oBAAoB;AAE1B,MAAI,aAAa,SAAS;AAAA,EAI1B;AACA,SAAO;AAAA,IACL,cAAU,iBAAAC;AAAA,MACR;AAAA,MACA;AAAA,MACA,CAAC,GAAG,MAAM,KAAK;AAAA,IACjB;AAAA,IACA,KAAK;AAAA,EACP;AACF;",
|
|
6
|
-
"names": ["enGB", "mergeWith"]
|
|
7
|
-
}
|
|
@@ -1,66 +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 json_formatter_exports = {};
|
|
30
|
-
__export(json_formatter_exports, {
|
|
31
|
-
flattenObject: () => flattenObject,
|
|
32
|
-
jsonFormatter: () => jsonFormatter,
|
|
33
|
-
limitFields: () => limitFields,
|
|
34
|
-
unflattenObject: () => unflattenObject
|
|
35
|
-
});
|
|
36
|
-
module.exports = __toCommonJS(json_formatter_exports);
|
|
37
|
-
var import_flat = require("flat");
|
|
38
|
-
var import_deep_cleaner = __toESM(require("deep-cleaner"));
|
|
39
|
-
const jsonFormatter = (obj, fields) => JSON.stringify(limitFields(obj, fields), null, 2);
|
|
40
|
-
const flattenObject = (obj) => (0, import_flat.flatten)((0, import_deep_cleaner.default)(obj, ["workflow"]), { maxDepth: 99 });
|
|
41
|
-
const unflattenObject = (obj) => (0, import_flat.unflatten)(obj, { overwrite: true });
|
|
42
|
-
const limitFields = (obj, fields) => {
|
|
43
|
-
if (!fields) return obj;
|
|
44
|
-
if (obj && Array.isArray(obj)) {
|
|
45
|
-
const arr = [];
|
|
46
|
-
for (const child of obj) arr.push(limitFields(child, fields));
|
|
47
|
-
return arr;
|
|
48
|
-
}
|
|
49
|
-
if (obj && typeof obj === "object") {
|
|
50
|
-
const flattenedObj = (0, import_flat.flatten)(obj);
|
|
51
|
-
const sortedObj = {};
|
|
52
|
-
for (const field of fields) {
|
|
53
|
-
sortedObj[field] = flattenedObj[field];
|
|
54
|
-
}
|
|
55
|
-
return (0, import_flat.unflatten)(sortedObj);
|
|
56
|
-
}
|
|
57
|
-
return obj;
|
|
58
|
-
};
|
|
59
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
60
|
-
0 && (module.exports = {
|
|
61
|
-
flattenObject,
|
|
62
|
-
jsonFormatter,
|
|
63
|
-
limitFields,
|
|
64
|
-
unflattenObject
|
|
65
|
-
});
|
|
66
|
-
//# sourceMappingURL=json.formatter.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/util/json.formatter.ts"],
|
|
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": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;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
|
-
"names": ["cleaner"]
|
|
7
|
-
}
|