sfdx-easy-sources 0.7.2 → 0.7.3
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/lib/commands/easysources/permissionsets/minify.js +4 -5
- package/lib/commands/easysources/permissionsets/minify.js.map +1 -1
- package/lib/utils/constants/constants_permissionsets.d.ts +1 -1
- package/lib/utils/constants/constants_permissionsets.js +2 -2
- package/oclif.manifest.json +1 -1
- package/package.json +1 -1
|
@@ -13,7 +13,6 @@ const fs = require('fs-extra');
|
|
|
13
13
|
const path_1 = require("path");
|
|
14
14
|
const performance_1 = require("../../../utils/performance");
|
|
15
15
|
const { Parser, transforms: { unwind } } = require('json2csv');
|
|
16
|
-
const constants_profiles_1 = require("../../../utils/constants/constants_profiles");
|
|
17
16
|
const filesUtils_1 = require("../../../utils/filesUtils");
|
|
18
17
|
const utils_1 = require("../../../utils/utils");
|
|
19
18
|
const constants_1 = require("../../../utils/constants/constants");
|
|
@@ -45,7 +44,7 @@ class Clean extends command_1.SfdxCommand {
|
|
|
45
44
|
// profileName is the profile name without the extension
|
|
46
45
|
for (const profileName of profileList) {
|
|
47
46
|
console.log('Minifying on: ' + profileName);
|
|
48
|
-
for (const tag_section in
|
|
47
|
+
for (const tag_section in constants_permissionsets_1.PERMSET_ITEMS) {
|
|
49
48
|
// tag_section is a profile section (applicationVisibilities, classAccess ecc)
|
|
50
49
|
const csvFilePath = (0, path_1.join)(csvDir, profileName, (0, filesUtils_1.calcCsvFilename)(profileName, tag_section));
|
|
51
50
|
if (fs.existsSync(csvFilePath)) {
|
|
@@ -53,16 +52,16 @@ class Clean extends command_1.SfdxCommand {
|
|
|
53
52
|
var resListCsv = await (0, filesUtils_1.readCsvToJsonArray)(csvFilePath);
|
|
54
53
|
resListCsv = resListCsv.filter(function (res) {
|
|
55
54
|
// return true to persist, false to delete
|
|
56
|
-
if (
|
|
55
|
+
if (constants_permissionsets_1.PERMSET_TAG_BOOL[tag_section] == null)
|
|
57
56
|
return true;
|
|
58
|
-
for (const boolName of (0, utils_1.toArray)(
|
|
57
|
+
for (const boolName of (0, utils_1.toArray)(constants_permissionsets_1.PERMSET_TAG_BOOL[tag_section])) {
|
|
59
58
|
if (res[boolName] === 'true' || res[boolName] === 'FALSE')
|
|
60
59
|
return true;
|
|
61
60
|
}
|
|
62
61
|
return false;
|
|
63
62
|
});
|
|
64
63
|
// write the cleaned csv
|
|
65
|
-
const headers =
|
|
64
|
+
const headers = constants_permissionsets_1.PERMSET_ITEMS[tag_section].headers;
|
|
66
65
|
const transforms = [unwind({ paths: headers })];
|
|
67
66
|
const parser = new Parser({ fields: [...headers, '_tagid'], transforms });
|
|
68
67
|
if (this.flags.sort === 'true') {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"minify.js","sourceRoot":"","sources":["../../../../src/commands/easysources/permissionsets/minify.ts"],"names":[],"mappings":";;AAAA;;;;;GAKG;AACH,yBAAyB;AACzB,iDAAyD;AACzD,2CAA4C;AAE5C,MAAM,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAC/B,+BAA4B;AAC5B,4DAAqD;AACrD,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,EAAE,MAAM,EAAE,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAC/D,
|
|
1
|
+
{"version":3,"file":"minify.js","sourceRoot":"","sources":["../../../../src/commands/easysources/permissionsets/minify.ts"],"names":[],"mappings":";;AAAA;;;;;GAKG;AACH,yBAAyB;AACzB,iDAAyD;AACzD,2CAA4C;AAE5C,MAAM,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAC/B,+BAA4B;AAC5B,4DAAqD;AACrD,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,EAAE,MAAM,EAAE,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAC/D,0DAAoG;AACpG,gDAAyD;AACzD,kEAA4F;AAC5F,gEAA4D;AAC5D,gGAAsH;AAEtH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eAAK,CAAC,IAAI,CAAC;QACb,IAAI,EAAE,GAAG;QACT,WAAW,EAAE,QAAQ,CAAC,UAAU,CAAC,qBAAqB,EAAE,CAAC,MAAM,CAAC,CAAC;QACjE,OAAO,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC;QAC1B,OAAO,EAAE,MAAM;KAClB,CAAC;CACL,CAAC"}
|
|
@@ -83,7 +83,7 @@ export declare const PERMSET_ITEMS: {
|
|
|
83
83
|
key: string;
|
|
84
84
|
};
|
|
85
85
|
};
|
|
86
|
-
export declare const
|
|
86
|
+
export declare const PERMSET_TAG_BOOL: {
|
|
87
87
|
applicationVisibilities: string[];
|
|
88
88
|
classAccesses: string[];
|
|
89
89
|
customMetadataTypeAccesses: string[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PERMSETS_DEFAULT_SFXML_PATH = exports.PERMSETS_SUBPATH = exports.PERMSETS_ROOT_TAG = exports.PERMSETS_EXTENSION = exports.
|
|
3
|
+
exports.PERMSETS_DEFAULT_SFXML_PATH = exports.PERMSETS_SUBPATH = exports.PERMSETS_ROOT_TAG = exports.PERMSETS_EXTENSION = exports.PERMSET_TAG_BOOL = exports.PERMSET_ITEMS = exports.PERMSET_USERPERM_KEY = exports.PERMSET_USERPERM_HEADER = exports.PERMSET_USERPERM_ROOT = exports.PERMSET_TAB_KEY = exports.PERMSET_TAB_HEADER = exports.PERMSET_TAB_ROOT = exports.PERMSET_RECTYPE_KEY = exports.PERMSET_RECTYPE_HEADER = exports.PERMSET_RECTYPE_ROOT = exports.PERMSET_PAGE_KEY = exports.PERMSET_PAGE_HEADER = exports.PERMSET_PAGE_ROOT = exports.PERMSET_OBJECT_KEY = exports.PERMSET_OBJECT_HEADER = exports.PERMSET_OBJECT_ROOT = exports.PERMSET_FIELD_KEY = exports.PERMSET_FIELD_HEADER = exports.PERMSET_FIELD_ROOT = exports.PERMSET_CSET_KEY = exports.PERMSET_CSET_HEADER = exports.PERMSET_CSET_ROOT = exports.PERMSET_CPERM_KEY = exports.PERMSET_CPERM_HEADER = exports.PERMSET_CPERM_ROOT = exports.PERMSET_CMDT_KEY = exports.PERMSET_CMDT_HEADER = exports.PERMSET_CMDT_ROOT = exports.PERMSET_CLASS_KEY = exports.PERMSET_CLASS_HEADER = exports.PERMSET_CLASS_ROOT = exports.PERMSET_APP_KEY = exports.PERMSET_APP_HEADER = exports.PERMSET_APP_ROOT = void 0;
|
|
4
4
|
const utils_1 = require("../utils");
|
|
5
5
|
const constants_1 = require("./constants");
|
|
6
6
|
exports.PERMSET_APP_ROOT = 'applicationVisibilities';
|
|
@@ -55,7 +55,7 @@ exports.PERMSET_ITEMS = {
|
|
|
55
55
|
[exports.PERMSET_USERPERM_ROOT]: { headers: exports.PERMSET_USERPERM_HEADER, key: exports.PERMSET_USERPERM_KEY }
|
|
56
56
|
};
|
|
57
57
|
// used for minify command
|
|
58
|
-
exports.
|
|
58
|
+
exports.PERMSET_TAG_BOOL = {
|
|
59
59
|
[exports.PERMSET_APP_ROOT]: ['default', 'visible'],
|
|
60
60
|
[exports.PERMSET_CLASS_ROOT]: ['enabled'],
|
|
61
61
|
[exports.PERMSET_CMDT_ROOT]: ['enabled'],
|