contensis-cli 1.0.12-beta.9 → 1.1.1-beta.0
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/CHANGELOG.md +38 -0
- package/dist/localisation/en-GB.js +5 -3
- package/dist/localisation/en-GB.js.map +2 -2
- package/dist/mappers/DevInit-to-CIWorkflow.js +6 -8
- package/dist/mappers/DevInit-to-CIWorkflow.js.map +2 -2
- package/dist/mappers/DevInit-to-RolePermissions.js +4 -4
- package/dist/mappers/DevInit-to-RolePermissions.js.map +2 -2
- package/dist/services/ContensisAuthService.js.map +2 -2
- package/dist/services/ContensisCliService.js +14 -16
- package/dist/services/ContensisCliService.js.map +2 -2
- package/dist/services/ContensisDevService.js +51 -56
- package/dist/services/ContensisDevService.js.map +3 -3
- package/dist/shell.js +2 -0
- package/dist/shell.js.map +2 -2
- package/dist/util/csv.formatter.js +3 -11
- package/dist/util/csv.formatter.js.map +3 -3
- package/dist/util/diff.js +1 -1
- package/dist/util/diff.js.map +2 -2
- package/dist/util/git.js +1 -0
- package/dist/util/git.js.map +2 -2
- package/dist/util/json.formatter.js +35 -3
- package/dist/util/json.formatter.js.map +3 -3
- package/dist/version.js +1 -1
- package/dist/version.js.map +1 -1
- package/package.json +1 -1
- package/src/localisation/en-GB.ts +6 -3
- package/src/mappers/DevInit-to-CIWorkflow.ts +8 -8
- package/src/mappers/DevInit-to-RolePermissions.ts +5 -2
- package/src/models/Cache.d.ts +2 -1
- package/src/services/ContensisAuthService.ts +1 -1
- package/src/services/ContensisCliService.ts +16 -25
- package/src/services/ContensisDevService.ts +76 -70
- package/src/shell.ts +4 -0
- package/src/util/csv.formatter.ts +1 -4
- package/src/util/diff.ts +1 -1
- package/src/util/git.ts +2 -1
- package/src/util/json.formatter.ts +32 -1
- package/src/version.ts +1 -1
package/src/util/git.ts
CHANGED
|
@@ -75,7 +75,7 @@ export class GitHelper {
|
|
|
75
75
|
}
|
|
76
76
|
gitcwd = () => path.join(this.gitRepoPath);
|
|
77
77
|
gitInfo = (url: string = this.originUrl) => hostedGitInfo.fromUrl(url);
|
|
78
|
-
hostType = (url: string = this.originUrl): GitTypes => {
|
|
78
|
+
hostType = (url: string = this.originUrl): GitTypes | undefined => {
|
|
79
79
|
if (url) {
|
|
80
80
|
if (url.includes('github.com')) return 'github';
|
|
81
81
|
else return 'gitlab';
|
|
@@ -87,6 +87,7 @@ export class GitHelper {
|
|
|
87
87
|
gitConfig = (cwd = this.gitRepoPath) => {
|
|
88
88
|
// Find .git/config in project cwd
|
|
89
89
|
const config = parseGitConfig.sync({
|
|
90
|
+
cwd,
|
|
90
91
|
path: '.git/config',
|
|
91
92
|
expandKeys: true,
|
|
92
93
|
});
|
|
@@ -1 +1,32 @@
|
|
|
1
|
-
|
|
1
|
+
import { flatten, unflatten } from 'flat';
|
|
2
|
+
import cleaner from 'deep-cleaner';
|
|
3
|
+
|
|
4
|
+
// Format a JSON object for a nice output
|
|
5
|
+
export const jsonFormatter = <T>(obj: T, fields?: string[]) =>
|
|
6
|
+
JSON.stringify(limitFields(obj, fields), null, 2);
|
|
7
|
+
|
|
8
|
+
// Flatten a JSON object such as an entry so there are no
|
|
9
|
+
// nested object and the keys are presented like "sys.version.versionNo": "1.0"
|
|
10
|
+
export const flattenObject = (obj: any) => flatten(cleaner(obj, ['workflow']));
|
|
11
|
+
|
|
12
|
+
// Will limit and sort an object's keys by an array of supplied fields
|
|
13
|
+
export const limitFields = (obj: any, fields?: string[]): any => {
|
|
14
|
+
if (!fields) return obj;
|
|
15
|
+
if (obj && Array.isArray(obj)) {
|
|
16
|
+
const arr = [];
|
|
17
|
+
for (const child of obj) arr.push(limitFields(child, fields));
|
|
18
|
+
return arr;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
if (obj && typeof obj === 'object') {
|
|
22
|
+
const flattenedObj = flatten(obj) as any;
|
|
23
|
+
const sortedObj = {} as any;
|
|
24
|
+
for (const field of fields) {
|
|
25
|
+
sortedObj[field] = flattenedObj[field];
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
return unflatten(sortedObj);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
return obj;
|
|
32
|
+
};
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const LIB_VERSION = "1.
|
|
1
|
+
export const LIB_VERSION = "1.1.1-beta.0";
|