sf-plugin-permission-sets 0.0.0-dev.22 → 0.0.0-dev.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -7
- package/lib/adapters/connection-org-client.d.ts +1 -0
- package/lib/adapters/connection-org-client.d.ts.map +1 -0
- package/lib/commands/ps/apply.d.ts +1 -0
- package/lib/commands/ps/apply.d.ts.map +1 -0
- package/lib/commands/ps/check.d.ts +1 -0
- package/lib/commands/ps/check.d.ts.map +1 -0
- package/lib/commands/ps/export.d.ts +1 -0
- package/lib/commands/ps/export.d.ts.map +1 -0
- package/lib/commands/ps/plan.d.ts +1 -0
- package/lib/commands/ps/plan.d.ts.map +1 -0
- package/lib/commands/ps/validate.d.ts +1 -0
- package/lib/commands/ps/validate.d.ts.map +1 -0
- package/lib/core/diff.d.ts +1 -0
- package/lib/core/diff.d.ts.map +1 -0
- package/lib/core/finding.d.ts +1 -0
- package/lib/core/finding.d.ts.map +1 -0
- package/lib/core/load.d.ts +1 -0
- package/lib/core/load.d.ts.map +1 -0
- package/lib/core/model.d.ts +1 -0
- package/lib/core/model.d.ts.map +1 -0
- package/lib/core/normalize.d.ts +1 -0
- package/lib/core/normalize.d.ts.map +1 -0
- package/lib/core/normalize.js +43 -25
- package/lib/core/normalize.js.map +1 -1
- package/lib/core/parse.d.ts +1 -0
- package/lib/core/parse.d.ts.map +1 -0
- package/lib/core/report.d.ts +1 -0
- package/lib/core/report.d.ts.map +1 -0
- package/lib/core/resolve.d.ts +1 -0
- package/lib/core/resolve.d.ts.map +1 -0
- package/lib/core/schema.d.ts +1 -0
- package/lib/core/schema.d.ts.map +1 -0
- package/lib/core/schema.js +15 -10
- package/lib/core/schema.js.map +1 -1
- package/lib/core/serialize.d.ts +1 -0
- package/lib/core/serialize.d.ts.map +1 -0
- package/lib/core/serialize.js +3 -3
- package/lib/core/serialize.js.map +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/services/adapters/org-client.d.ts +1 -0
- package/lib/services/adapters/org-client.d.ts.map +1 -0
- package/lib/services/apply.d.ts +1 -2
- package/lib/services/apply.d.ts.map +1 -0
- package/lib/services/apply.js +3 -27
- package/lib/services/apply.js.map +1 -1
- package/lib/services/check.d.ts +1 -0
- package/lib/services/check.d.ts.map +1 -0
- package/lib/services/export.d.ts +1 -0
- package/lib/services/export.d.ts.map +1 -0
- package/lib/services/plan.d.ts +1 -2
- package/lib/services/plan.d.ts.map +1 -0
- package/lib/services/plan.js +3 -27
- package/lib/services/plan.js.map +1 -1
- package/lib/services/resolution.d.ts +17 -0
- package/lib/services/resolution.d.ts.map +1 -0
- package/lib/services/resolution.js +36 -0
- package/lib/services/resolution.js.map +1 -0
- package/lib/services/validate.d.ts +1 -0
- package/lib/services/validate.d.ts.map +1 -0
- package/package.json +10 -24
- package/oclif.lock +0 -7888
- package/oclif.manifest.json +0 -406
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { DesiredAssignment, Kind, TargetRef } from '../core/model.js';
|
|
2
|
+
import { Finding } from '../core/finding.js';
|
|
3
|
+
import { OrgClient } from './adapters/org-client.js';
|
|
4
|
+
export type Resolution = {
|
|
5
|
+
findings: Finding[];
|
|
6
|
+
userIds: Map<string, string>;
|
|
7
|
+
targetIds: Record<Kind, Map<string, string>>;
|
|
8
|
+
};
|
|
9
|
+
export declare function managedTargets(resolution: Resolution): TargetRef[];
|
|
10
|
+
/** Look every declared reference up in the org, returning findings and the resolved id maps. */
|
|
11
|
+
export declare class ResolutionService {
|
|
12
|
+
private readonly org;
|
|
13
|
+
private readonly assignments;
|
|
14
|
+
constructor(org: OrgClient, assignments: DesiredAssignment[]);
|
|
15
|
+
run(): Promise<Resolution>;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=resolution.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolution.d.ts","sourceRoot":"","sources":["../../src/services/resolution.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,IAAI,EAAsB,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC1F,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAU7C,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAErD,MAAM,MAAM,UAAU,GAAG;IACrB,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7B,SAAS,EAAE,MAAM,CAAC,IAAI,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;CAChD,CAAC;AAEF,wBAAgB,cAAc,CAAC,UAAU,EAAE,UAAU,GAAG,SAAS,EAAE,CAQlE;AAED,gGAAgG;AAChG,qBAAa,iBAAiB;IACP,OAAO,CAAC,QAAQ,CAAC,GAAG;IAAa,OAAO,CAAC,QAAQ,CAAC,WAAW;gBAA5C,GAAG,EAAE,SAAS,EAAmB,WAAW,EAAE,iBAAiB,EAAE;IAExF,GAAG,IAAI,OAAO,CAAC,UAAU,CAAC;CAkC1C"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { kinds, distinctAssignees, distinctTargets, evaluateUsers, evaluateTargets, indexUsersById, indexTargetsById, } from '../core/resolve.js';
|
|
2
|
+
export function managedTargets(resolution) {
|
|
3
|
+
const refs = [];
|
|
4
|
+
for (const kind of kinds) {
|
|
5
|
+
for (const id of resolution.targetIds[kind].values()) {
|
|
6
|
+
refs.push({ kind, id });
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
return refs;
|
|
10
|
+
}
|
|
11
|
+
/** Look every declared reference up in the org, returning findings and the resolved id maps. */
|
|
12
|
+
export class ResolutionService {
|
|
13
|
+
org;
|
|
14
|
+
assignments;
|
|
15
|
+
constructor(org, assignments) {
|
|
16
|
+
this.org = org;
|
|
17
|
+
this.assignments = assignments;
|
|
18
|
+
}
|
|
19
|
+
async run() {
|
|
20
|
+
const usernames = distinctAssignees(this.assignments);
|
|
21
|
+
const targetsByKind = kinds.map((kind) => ({ kind, targets: distinctTargets(this.assignments, kind) }));
|
|
22
|
+
const usersTask = usernames.length > 0 ? this.org.findUsers(usernames) : Promise.resolve([]);
|
|
23
|
+
const targetsTask = Promise.all(targetsByKind.map(({ kind, targets }) => (targets.length > 0 ? this.org.findTargets(kind, targets) : Promise.resolve([])).then((found) => ({ kind, targets, found }))));
|
|
24
|
+
const [foundUsers, perKind] = await Promise.all([usersTask, targetsTask]);
|
|
25
|
+
const findings = [...evaluateUsers(usernames, foundUsers)];
|
|
26
|
+
for (const { kind, targets, found } of perKind) {
|
|
27
|
+
findings.push(...evaluateTargets(kind, targets, found.map((target) => target.name)));
|
|
28
|
+
}
|
|
29
|
+
const targetIds = {};
|
|
30
|
+
for (const { kind, found } of perKind) {
|
|
31
|
+
targetIds[kind] = indexTargetsById(found);
|
|
32
|
+
}
|
|
33
|
+
return { findings, userIds: indexUsersById(foundUsers), targetIds };
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=resolution.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolution.js","sourceRoot":"","sources":["../../src/services/resolution.ts"],"names":[],"mappings":"AAEA,OAAO,EACH,KAAK,EACL,iBAAiB,EACjB,eAAe,EACf,aAAa,EACb,eAAe,EACf,cAAc,EACd,gBAAgB,GACnB,MAAM,oBAAoB,CAAC;AAS5B,MAAM,UAAU,cAAc,CAAC,UAAsB;IACjD,MAAM,IAAI,GAAgB,EAAE,CAAC;IAC7B,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACvB,KAAK,MAAM,EAAE,IAAI,UAAU,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC;YACnD,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC;QAC5B,CAAC;I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,CAAC,KAAK;gBAAtC,GAAG,EAAE,SAAS,EAAmB,KAAK,EAAE,MAAM,EAAE;IAEvE,GAAG,IAAI,OAAO,CAAC,cAAc,CAAC;IAiB3C,iFAAiF;YACnE,OAAO;CA0BxB"}
|
package/package.json
CHANGED
|
@@ -14,22 +14,21 @@
|
|
|
14
14
|
"zod": "^4.4.3"
|
|
15
15
|
},
|
|
16
16
|
"devDependencies": {
|
|
17
|
-
"@
|
|
18
|
-
"eslint
|
|
19
|
-
"
|
|
20
|
-
"oclif": "^4.14.0",
|
|
17
|
+
"@eslint/js": "^10.0.1",
|
|
18
|
+
"eslint": "^10.6.0",
|
|
19
|
+
"globals": "^17.7.0",
|
|
21
20
|
"ts-node": "^10.9.2",
|
|
22
21
|
"typescript": "^5.4.5",
|
|
23
|
-
"
|
|
22
|
+
"typescript-eslint": "^8.62.1",
|
|
23
|
+
"vitest": "^4.1.9",
|
|
24
|
+
"wireit": "^0.14.0"
|
|
24
25
|
},
|
|
25
26
|
"engines": {
|
|
26
27
|
"node": ">=18.0.0"
|
|
27
28
|
},
|
|
28
29
|
"files": [
|
|
29
30
|
"/lib",
|
|
30
|
-
"/messages"
|
|
31
|
-
"/oclif.manifest.json",
|
|
32
|
-
"/oclif.lock"
|
|
31
|
+
"/messages"
|
|
33
32
|
],
|
|
34
33
|
"keywords": [
|
|
35
34
|
"salesforce",
|
|
@@ -60,15 +59,10 @@
|
|
|
60
59
|
},
|
|
61
60
|
"scripts": {
|
|
62
61
|
"build": "wireit",
|
|
63
|
-
"clean": "
|
|
64
|
-
"clean-all": "sf-clean all",
|
|
62
|
+
"clean": "rm -rf lib tmp *.tsbuildinfo .eslintcache .wireit",
|
|
65
63
|
"compile": "wireit",
|
|
66
|
-
"docs": "sf-docs",
|
|
67
|
-
"format": "wireit",
|
|
68
64
|
"lint": "wireit",
|
|
69
|
-
"
|
|
70
|
-
"postpack": "sf-clean --ignore-signing-artifacts",
|
|
71
|
-
"prepack": "sf-prepack",
|
|
65
|
+
"prepack": "npm run compile",
|
|
72
66
|
"test": "wireit",
|
|
73
67
|
"test:only": "wireit",
|
|
74
68
|
"version": "oclif readme"
|
|
@@ -96,14 +90,6 @@
|
|
|
96
90
|
],
|
|
97
91
|
"clean": "if-file-deleted"
|
|
98
92
|
},
|
|
99
|
-
"format": {
|
|
100
|
-
"command": "prettier --write \"src/**/*.+(ts|js|json)\"",
|
|
101
|
-
"files": [
|
|
102
|
-
"src/**/*.ts",
|
|
103
|
-
".prettier*"
|
|
104
|
-
],
|
|
105
|
-
"output": []
|
|
106
|
-
},
|
|
107
93
|
"lint": {
|
|
108
94
|
"command": "eslint src --color --cache --cache-location .eslintcache",
|
|
109
95
|
"files": [
|
|
@@ -136,5 +122,5 @@
|
|
|
136
122
|
"exports": "./lib/index.js",
|
|
137
123
|
"type": "module",
|
|
138
124
|
"author": "Isaac Ferreira",
|
|
139
|
-
"version": "0.0.0-dev.
|
|
125
|
+
"version": "0.0.0-dev.27"
|
|
140
126
|
}
|