sf-plugin-permission-sets 0.3.0 → 0.4.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/LICENSE.md +28 -0
- package/README.md +176 -36
- package/lib/adapters/connection-org-client.d.ts +7 -3
- package/lib/adapters/connection-org-client.d.ts.map +1 -1
- package/lib/adapters/connection-org-client.js +94 -63
- package/lib/adapters/connection-org-client.js.map +1 -1
- package/lib/adapters/index.d.ts +2 -0
- package/lib/adapters/index.d.ts.map +1 -0
- package/lib/adapters/index.js +2 -0
- package/lib/adapters/index.js.map +1 -0
- package/lib/commands/ps/apply.d.ts +29 -1
- package/lib/commands/ps/apply.d.ts.map +1 -1
- package/lib/commands/ps/apply.js +160 -35
- package/lib/commands/ps/apply.js.map +1 -1
- package/lib/commands/ps/check.d.ts +3 -1
- package/lib/commands/ps/check.d.ts.map +1 -1
- package/lib/commands/ps/check.js +15 -6
- package/lib/commands/ps/check.js.map +1 -1
- package/lib/commands/ps/export.d.ts +11 -2
- package/lib/commands/ps/export.d.ts.map +1 -1
- package/lib/commands/ps/export.js +53 -7
- package/lib/commands/ps/export.js.map +1 -1
- package/lib/commands/ps/plan.d.ts +51 -6
- package/lib/commands/ps/plan.d.ts.map +1 -1
- package/lib/commands/ps/plan.js +203 -34
- package/lib/commands/ps/plan.js.map +1 -1
- package/lib/commands/ps/validate.d.ts +3 -1
- package/lib/commands/ps/validate.d.ts.map +1 -1
- package/lib/commands/ps/validate.js +16 -7
- package/lib/commands/ps/validate.js.map +1 -1
- package/lib/core/diff.d.ts.map +1 -1
- package/lib/core/diff.js +1 -0
- package/lib/core/diff.js.map +1 -1
- package/lib/core/finding.d.ts +3 -2
- package/lib/core/finding.d.ts.map +1 -1
- package/lib/core/finding.js +1 -1
- package/lib/core/finding.js.map +1 -1
- package/lib/core/index.d.ts +11 -0
- package/lib/core/index.d.ts.map +1 -0
- package/lib/core/index.js +10 -0
- package/lib/core/index.js.map +1 -0
- package/lib/core/load.d.ts.map +1 -1
- package/lib/core/load.js +17 -10
- package/lib/core/load.js.map +1 -1
- package/lib/core/mode.d.ts +18 -0
- package/lib/core/mode.d.ts.map +1 -0
- package/lib/core/mode.js +16 -0
- package/lib/core/mode.js.map +1 -0
- package/lib/core/model.d.ts +9 -0
- package/lib/core/model.d.ts.map +1 -1
- package/lib/core/normalize.d.ts +2 -0
- package/lib/core/normalize.d.ts.map +1 -1
- package/lib/core/normalize.js +7 -0
- package/lib/core/normalize.js.map +1 -1
- package/lib/core/plan-file.d.ts +61 -0
- package/lib/core/plan-file.d.ts.map +1 -0
- package/lib/core/plan-file.js +74 -0
- package/lib/core/plan-file.js.map +1 -0
- package/lib/core/report.d.ts +12 -5
- package/lib/core/report.d.ts.map +1 -1
- package/lib/core/report.js +84 -32
- package/lib/core/report.js.map +1 -1
- package/lib/core/schema.d.ts +2 -12
- package/lib/core/schema.d.ts.map +1 -1
- package/lib/core/schema.js +2 -2
- package/lib/core/schema.js.map +1 -1
- package/lib/services/adapters/index.d.ts +2 -0
- package/lib/services/adapters/index.d.ts.map +1 -0
- package/lib/services/adapters/index.js +2 -0
- package/lib/services/adapters/index.js.map +1 -0
- package/lib/services/adapters/org-client.d.ts +3 -3
- package/lib/services/adapters/org-client.d.ts.map +1 -1
- package/lib/services/apply.d.ts +21 -11
- package/lib/services/apply.d.ts.map +1 -1
- package/lib/services/apply.js +54 -37
- package/lib/services/apply.js.map +1 -1
- package/lib/services/check.d.ts +3 -7
- package/lib/services/check.d.ts.map +1 -1
- package/lib/services/check.js +5 -12
- package/lib/services/check.js.map +1 -1
- package/lib/services/export.d.ts +11 -6
- package/lib/services/export.d.ts.map +1 -1
- package/lib/services/export.js +14 -10
- package/lib/services/export.js.map +1 -1
- package/lib/services/index.d.ts +7 -0
- package/lib/services/index.d.ts.map +1 -0
- package/lib/services/index.js +7 -0
- package/lib/services/index.js.map +1 -0
- package/lib/services/plan.d.ts +7 -10
- package/lib/services/plan.d.ts.map +1 -1
- package/lib/services/plan.js +28 -18
- package/lib/services/plan.js.map +1 -1
- package/lib/services/resolution.d.ts +6 -6
- package/lib/services/resolution.d.ts.map +1 -1
- package/lib/services/resolution.js +21 -9
- package/lib/services/resolution.js.map +1 -1
- package/lib/services/validate.d.ts +7 -7
- package/lib/services/validate.d.ts.map +1 -1
- package/lib/services/validate.js +20 -13
- package/lib/services/validate.js.map +1 -1
- package/messages/ps.apply.md +38 -2
- package/messages/ps.check.md +1 -1
- package/messages/ps.export.md +21 -1
- package/messages/ps.plan.md +55 -7
- package/messages/ps.validate.md +1 -1
- package/package.json +18 -14
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolution.js","sourceRoot":"","sources":["../../src/services/resolution.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"resolution.js","sourceRoot":"","sources":["../../src/services/resolution.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { DesiredAssignment } from '../core/
|
|
2
|
-
import {
|
|
3
|
-
import { OrgClient } from './adapters/org-client.js';
|
|
1
|
+
import { DesiredAssignment, Finding } from '../core/index.js';
|
|
2
|
+
import { OrgClient } from './adapters/index.js';
|
|
4
3
|
export type ValidateResult = {
|
|
5
4
|
files: string[];
|
|
6
5
|
assignments: DesiredAssignment[];
|
|
@@ -9,13 +8,14 @@ export type ValidateResult = {
|
|
|
9
8
|
warnings: number;
|
|
10
9
|
failed: boolean;
|
|
11
10
|
};
|
|
12
|
-
/**
|
|
11
|
+
/** Load the files, then resolve every reference against the org. */
|
|
13
12
|
export declare class ValidateService {
|
|
14
13
|
private readonly org;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
run(): Promise<ValidateResult>;
|
|
14
|
+
constructor(org: OrgClient);
|
|
15
|
+
run(files: string[]): Promise<ValidateResult>;
|
|
18
16
|
/** Look every reference up in the org (in parallel) and evaluate the results. */
|
|
19
17
|
private resolve;
|
|
18
|
+
private evaluateUserRefs;
|
|
19
|
+
private evaluateTargetRefs;
|
|
20
20
|
}
|
|
21
21
|
//# sourceMappingURL=validate.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../src/services/validate.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../src/services/validate.ts"],"names":[],"mappings":"AAAA,OAAO,EAOH,iBAAiB,EACjB,OAAO,EAGV,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAEhD,MAAM,MAAM,cAAc,GAAG;IACzB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,WAAW,EAAE,iBAAiB,EAAE,CAAC;IACjC,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,oEAAoE;AACpE,qBAAa,eAAe;IACL,OAAO,CAAC,QAAQ,CAAC,GAAG;gBAAH,GAAG,EAAE,SAAS;IAErC,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,cAAc,CAAC;IAoB1D,iFAAiF;YACnE,OAAO;YAmBP,gBAAgB;YAKhB,kBAAkB;CAQnC"}
|
package/lib/services/validate.js
CHANGED
|
@@ -1,18 +1,17 @@
|
|
|
1
|
-
import { loadFiles } from '../core/
|
|
2
|
-
|
|
3
|
-
import { countFindings } from '../core/finding.js';
|
|
4
|
-
/** Online validate: run the offline load, then resolve every reference against the org. */
|
|
1
|
+
import { loadFiles, kinds, distinctAssignees, distinctTargets, evaluateUsers, evaluateTargets, countFindings, } from '../core/index.js';
|
|
2
|
+
/** Load the files, then resolve every reference against the org. */
|
|
5
3
|
export class ValidateService {
|
|
6
4
|
org;
|
|
7
|
-
|
|
8
|
-
constructor(org, files) {
|
|
5
|
+
constructor(org) {
|
|
9
6
|
this.org = org;
|
|
10
|
-
this.files = files;
|
|
11
7
|
}
|
|
12
|
-
async run() {
|
|
13
|
-
const loaded = await loadFiles(
|
|
14
|
-
const
|
|
15
|
-
const findings = [
|
|
8
|
+
async run(files) {
|
|
9
|
+
const loaded = await loadFiles(files);
|
|
10
|
+
const resolved = await this.resolve(loaded.assignments);
|
|
11
|
+
const findings = [
|
|
12
|
+
...loaded.findings,
|
|
13
|
+
...resolved,
|
|
14
|
+
];
|
|
16
15
|
const { errors, warnings } = countFindings(findings);
|
|
17
16
|
return {
|
|
18
17
|
files: loaded.files,
|
|
@@ -28,16 +27,24 @@ export class ValidateService {
|
|
|
28
27
|
const tasks = [];
|
|
29
28
|
const usernames = distinctAssignees(assignments);
|
|
30
29
|
if (usernames.length > 0) {
|
|
31
|
-
tasks.push(this.
|
|
30
|
+
tasks.push(this.evaluateUserRefs(usernames));
|
|
32
31
|
}
|
|
33
32
|
for (const kind of kinds) {
|
|
34
33
|
const targets = distinctTargets(assignments, kind);
|
|
35
34
|
if (targets.length > 0) {
|
|
36
|
-
tasks.push(this.
|
|
35
|
+
tasks.push(this.evaluateTargetRefs(kind, targets));
|
|
37
36
|
}
|
|
38
37
|
}
|
|
39
38
|
const results = await Promise.all(tasks);
|
|
40
39
|
return results.flat();
|
|
41
40
|
}
|
|
41
|
+
async evaluateUserRefs(usernames) {
|
|
42
|
+
const found = await this.org.findUsers(usernames);
|
|
43
|
+
return evaluateUsers(usernames, found);
|
|
44
|
+
}
|
|
45
|
+
async evaluateTargetRefs(kind, targets) {
|
|
46
|
+
const found = await this.org.findTargets(kind, targets);
|
|
47
|
+
return evaluateTargets(kind, targets, found.map((target) => target.name));
|
|
48
|
+
}
|
|
42
49
|
}
|
|
43
50
|
//# sourceMappingURL=validate.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate.js","sourceRoot":"","sources":["../../src/services/validate.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"validate.js","sourceRoot":"","sources":["../../src/services/validate.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,SAAS,EACT,KAAK,EACL,iBAAiB,EACjB,eAAe,EACf,aAAa,EACb,eAAe,EAIf,aAAa,GAChB,MAAM,kBAAkB,CAAC;AAY1B,oEAAoE;AACpE,MAAM,OAAO,eAAe;IACY;IAApC,YAAoC,GAAc;QAAd,QAAG,GAAH,GAAG,CAAW;IAAG,CAAC;IAE/C,KAAK,CAAC,GAAG,CAAC,KAAe;QAC5B,MAAM,MAAM,GAAG,MAAM,SAAS,CAAC,KAAK,CAAC,CAAC;QACtC,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;QAExD,MAAM,QAAQ,GAAG;YACb,GAAG,MAAM,CAAC,QAAQ;YAClB,GAAG,QAAQ;SACd,CAAC;QACF,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,aAAa,CAAC,QAAQ,CAAC,CAAC;QAErD,OAAO;YACH,KAAK,EAAE,MAAM,CAAC,KAAK;YACnB,WAAW,EAAE,MAAM,CAAC,WAAW;YAC/B,QAAQ;YACR,MAAM;YACN,QAAQ;YACR,MAAM,EAAE,MAAM,GAAG,CAAC;SACrB,CAAC;IACN,CAAC;IAED,iFAAiF;IACzE,KAAK,CAAC,OAAO,CAAC,WAAgC;QAClD,MAAM,KAAK,GAA8B,EAAE,CAAC;QAE5C,MAAM,SAAS,GAAG,iBAAiB,CAAC,WAAW,CAAC,CAAC;QACjD,IAAI,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACvB,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,SAAS,CAAC,CAAC,CAAC;QACjD,CAAC;QAED,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;YACvB,MAAM,OAAO,GAAG,eAAe,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;YACnD,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBACrB,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC;YACvD,CAAC;QACL,CAAC;QAED,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QACzC,OAAO,OAAO,CAAC,IAAI,EAAE,CAAC;IAC1B,CAAC;IAEO,KAAK,CAAC,gBAAgB,CAAC,SAAmB;QAC9C,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;QAClD,OAAO,aAAa,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;IAC3C,CAAC;IAEO,KAAK,CAAC,kBAAkB,CAAC,IAAU,EAAE,OAAiB;QAC1D,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,GAAG,CAAC,WAAW,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QACxD,OAAO,eAAe,CAClB,IAAI,EACJ,OAAO,EACP,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CACrC,CAAC;IACN,CAAC;CACJ"}
|
package/messages/ps.apply.md
CHANGED
|
@@ -8,11 +8,15 @@ Load the files, resolve every user and target against the org, diff the desired
|
|
|
8
8
|
|
|
9
9
|
# flags.file.summary
|
|
10
10
|
|
|
11
|
-
YAML file or glob to apply. Repeatable.
|
|
11
|
+
YAML file or glob to apply. Repeatable. Provide either this or --plan.
|
|
12
|
+
|
|
13
|
+
# flags.plan.summary
|
|
14
|
+
|
|
15
|
+
Apply a saved plan file from plan --out, running the reviewed change set verbatim. Provide either this or --file.
|
|
12
16
|
|
|
13
17
|
# flags.mode.summary
|
|
14
18
|
|
|
15
|
-
Which half of the reconcile to run: additive adds missing assignments and updates expirations, destructive removes only, sync does both.
|
|
19
|
+
Which half of the reconcile to run: additive adds missing assignments and updates expirations, destructive removes only, sync does both. Cannot be combined with --plan, which carries its own mode.
|
|
16
20
|
|
|
17
21
|
# flags.max-deletes.summary
|
|
18
22
|
|
|
@@ -22,10 +26,18 @@ Abort before any change if the run would remove more than this many assignments.
|
|
|
22
26
|
|
|
23
27
|
Resolve and diff, print the plan, and change nothing.
|
|
24
28
|
|
|
29
|
+
# flags.show-unchanged.summary
|
|
30
|
+
|
|
31
|
+
List assignments that already match, instead of only counting them.
|
|
32
|
+
|
|
25
33
|
# flags.no-prompt.summary
|
|
26
34
|
|
|
27
35
|
Skip the deletion confirmation prompt. Required to delete in JSON or other non-interactive runs.
|
|
28
36
|
|
|
37
|
+
# info.applyingPlan
|
|
38
|
+
|
|
39
|
+
Applying saved plan (mode %s).
|
|
40
|
+
|
|
29
41
|
# confirm.delete
|
|
30
42
|
|
|
31
43
|
This will remove %s assignment(s) from the org. Continue?
|
|
@@ -50,6 +62,30 @@ Aborted at the confirmation prompt. Nothing was changed.
|
|
|
50
62
|
|
|
51
63
|
failed to %s %s on %s: %s
|
|
52
64
|
|
|
65
|
+
# error.sourceConflict
|
|
66
|
+
|
|
67
|
+
Pass either --file or --plan, not both. --plan runs a saved plan; --file reads and diffs the YAML now.
|
|
68
|
+
|
|
69
|
+
# error.sourceMissing
|
|
70
|
+
|
|
71
|
+
Provide a source to apply: --file <glob> to read the YAML now, or --plan <file> to run a saved plan.
|
|
72
|
+
|
|
73
|
+
# error.modeWithPlan
|
|
74
|
+
|
|
75
|
+
--mode cannot be combined with --plan. A saved plan already carries the mode it was computed for. Re-run plan with the mode you want to get a new plan.
|
|
76
|
+
|
|
77
|
+
# error.planRead
|
|
78
|
+
|
|
79
|
+
Could not read the plan file: %s
|
|
80
|
+
|
|
81
|
+
# error.planInvalid
|
|
82
|
+
|
|
83
|
+
The plan file %s is not a valid plan: %s. Regenerate it with plan --out.
|
|
84
|
+
|
|
85
|
+
# error.planOrg
|
|
86
|
+
|
|
87
|
+
This plan was built for org %s but the target org is %s. Regenerate the plan against the target org.
|
|
88
|
+
|
|
53
89
|
# error.invalid
|
|
54
90
|
|
|
55
91
|
The files do not resolve cleanly against the org. Fix the errors above, then re-run.
|
package/messages/ps.check.md
CHANGED
|
@@ -4,7 +4,7 @@ Statically check permission set assignment files, with no org connection.
|
|
|
4
4
|
|
|
5
5
|
# description
|
|
6
6
|
|
|
7
|
-
Parse and validate the YAML files
|
|
7
|
+
Parse and validate the YAML files, no org needed. Reports invalid YAML, schema violations, duplicate keys, duplicate targets, and empty entries. Run it in a pre-commit hook or in CI before validate, plan, or apply.
|
|
8
8
|
|
|
9
9
|
# flags.file.summary
|
|
10
10
|
|
package/messages/ps.export.md
CHANGED
|
@@ -8,12 +8,24 @@ Query the target org for every assignable permission set, group, and license ass
|
|
|
8
8
|
|
|
9
9
|
# flags.output-file.summary
|
|
10
10
|
|
|
11
|
-
Path of the YAML file to write. Created (and its parent directories) if missing, overwritten if present.
|
|
11
|
+
Path of the YAML file to write. Created (and its parent directories) if missing, overwritten if present. Omit to write the document to stdout.
|
|
12
|
+
|
|
13
|
+
# flags.user.summary
|
|
14
|
+
|
|
15
|
+
Only export these users, matched on exact username. Repeatable; multiple values are a union.
|
|
16
|
+
|
|
17
|
+
# flags.kind.summary
|
|
18
|
+
|
|
19
|
+
Only export these scopes: permissionSets, permissionSetGroups, or permissionSetLicenses. Repeatable; combined with --user as an intersection.
|
|
12
20
|
|
|
13
21
|
# success
|
|
14
22
|
|
|
15
23
|
Exported %s assignments across %s users to %s.
|
|
16
24
|
|
|
25
|
+
# warnNoAssignments
|
|
26
|
+
|
|
27
|
+
No assignments in scope for user %s, it was skipped.
|
|
28
|
+
|
|
17
29
|
# examples
|
|
18
30
|
|
|
19
31
|
- Export the dev org's assignments to permissions.yml:
|
|
@@ -23,3 +35,11 @@ Exported %s assignments across %s users to %s.
|
|
|
23
35
|
- Export a production org into an environment folder:
|
|
24
36
|
|
|
25
37
|
<%= config.bin %> <%= command.id %> --target-org prod --output-file permissions/prod.yml
|
|
38
|
+
|
|
39
|
+
- Write to stdout and diff against a committed snapshot:
|
|
40
|
+
|
|
41
|
+
<%= config.bin %> <%= command.id %> --target-org prod | diff - permissions/prod.yml
|
|
42
|
+
|
|
43
|
+
- Export two users' permission sets and groups only:
|
|
44
|
+
|
|
45
|
+
<%= config.bin %> <%= command.id %> --target-org prod --output-file team.yml --user jdoe@acme.com --user asmith@acme.com --kind permissionSets --kind permissionSetGroups
|
package/messages/ps.plan.md
CHANGED
|
@@ -4,7 +4,7 @@ Preview the changes that would reconcile a target org to the assignment files.
|
|
|
4
4
|
|
|
5
5
|
# description
|
|
6
6
|
|
|
7
|
-
Load the files, resolve every user and target against the org, fetch the org's current assignments, and diff the desired state against them. Read-only: it queries the org but never changes it, so it is the apply pipeline stopping before any DML. The
|
|
7
|
+
Load the files, resolve every user and target against the org, fetch the org's current assignments, and diff the desired state against them. Read-only: it queries the org but never changes it, so it is the apply pipeline stopping before any DML. The body shows only what the chosen mode would do, so what plan shows is what apply does. Anything the mode would not touch is reported beneath the plan as drift. Run it before apply to preview what would change.
|
|
8
8
|
|
|
9
9
|
# flags.file.summary
|
|
10
10
|
|
|
@@ -12,19 +12,67 @@ YAML file or glob to plan. Repeatable.
|
|
|
12
12
|
|
|
13
13
|
# flags.mode.summary
|
|
14
14
|
|
|
15
|
-
Which half of the reconcile to preview: additive adds and updates expirations, destructive removes only, sync does both.
|
|
15
|
+
Which half of the reconcile to preview: additive adds and updates expirations, destructive removes only, sync does both. The plan shows only what the chosen mode would do; anything it skips is reported as drift.
|
|
16
16
|
|
|
17
|
-
# summary
|
|
17
|
+
# flags.show-unchanged.summary
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
List assignments that already match, instead of only counting them.
|
|
20
|
+
|
|
21
|
+
# flags.out.summary
|
|
22
|
+
|
|
23
|
+
Write the computed change set to a plan file that apply can run verbatim with --plan.
|
|
24
|
+
|
|
25
|
+
# summary.wrotePlan
|
|
26
|
+
|
|
27
|
+
Wrote a plan with %s change(s) to %s. Apply it with: ps apply --plan %s
|
|
28
|
+
|
|
29
|
+
# header.title
|
|
30
|
+
|
|
31
|
+
Permission Set Assignments Plan
|
|
32
|
+
|
|
33
|
+
# header.org
|
|
34
|
+
|
|
35
|
+
Org: %s (%s) Mode: %s
|
|
36
|
+
|
|
37
|
+
# summary.counts.additive
|
|
38
|
+
|
|
39
|
+
Plan: %s to add, %s to update. %s users affected.
|
|
40
|
+
|
|
41
|
+
# summary.counts.destructive
|
|
42
|
+
|
|
43
|
+
Plan: %s to remove. %s users affected.
|
|
44
|
+
|
|
45
|
+
# summary.counts.sync
|
|
46
|
+
|
|
47
|
+
Plan: %s to add, %s to update, %s to remove. %s users affected.
|
|
48
|
+
|
|
49
|
+
# summary.unchanged
|
|
50
|
+
|
|
51
|
+
Unchanged: %s assignments (--show-unchanged to list).
|
|
52
|
+
|
|
53
|
+
# summary.unchangedListed
|
|
54
|
+
|
|
55
|
+
Unchanged: %s assignments.
|
|
20
56
|
|
|
21
57
|
# summary.next
|
|
22
58
|
|
|
23
|
-
|
|
59
|
+
Next: %s
|
|
60
|
+
|
|
61
|
+
# drift.additive
|
|
62
|
+
|
|
63
|
+
Drift: %s undeclared assignment(s) not removed in additive mode. Run --mode sync to remove them.
|
|
64
|
+
|
|
65
|
+
# drift.destructive
|
|
66
|
+
|
|
67
|
+
Drift: %s declared assignment(s) not applied in destructive mode. Run --mode additive or sync to apply them.
|
|
68
|
+
|
|
69
|
+
# empty.noChanges
|
|
70
|
+
|
|
71
|
+
No changes. %s already matches your files.
|
|
24
72
|
|
|
25
|
-
#
|
|
73
|
+
# empty.nothingToApply
|
|
26
74
|
|
|
27
|
-
|
|
75
|
+
Nothing to apply in %s mode.
|
|
28
76
|
|
|
29
77
|
# error.invalid
|
|
30
78
|
|
package/messages/ps.validate.md
CHANGED
|
@@ -4,7 +4,7 @@ Validate permission set assignment files against a target org.
|
|
|
4
4
|
|
|
5
5
|
# description
|
|
6
6
|
|
|
7
|
-
Run
|
|
7
|
+
Run the same file checks as check, then resolve each referenced user, permission set, group, and license against the org. Reports users that are missing or inactive and targets that are missing or not unique. Read-only: it queries the org but never changes it. Run it before plan or apply.
|
|
8
8
|
|
|
9
9
|
# flags.file.summary
|
|
10
10
|
|
package/package.json
CHANGED
|
@@ -5,27 +5,31 @@
|
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/zaclummys/sf-plugin-permission-sets.git"
|
|
7
7
|
},
|
|
8
|
+
"homepage": "https://github.com/zaclummys/sf-plugin-permission-sets#readme",
|
|
9
|
+
"bugs": {
|
|
10
|
+
"url": "https://github.com/zaclummys/sf-plugin-permission-sets/issues"
|
|
11
|
+
},
|
|
8
12
|
"dependencies": {
|
|
9
13
|
"@oclif/core": "^4",
|
|
10
14
|
"@salesforce/core": "^8",
|
|
11
15
|
"@salesforce/sf-plugins-core": "^12",
|
|
12
|
-
"globby": "^16
|
|
13
|
-
"yaml": "^2
|
|
14
|
-
"zod": "^4
|
|
16
|
+
"globby": "^16",
|
|
17
|
+
"yaml": "^2",
|
|
18
|
+
"zod": "^4"
|
|
15
19
|
},
|
|
16
20
|
"devDependencies": {
|
|
17
|
-
"@eslint/js": "^10
|
|
18
|
-
"eslint": "^10
|
|
19
|
-
"execa": "^9
|
|
20
|
-
"globals": "^17
|
|
21
|
-
"ts-node": "^10
|
|
22
|
-
"typescript": "^6
|
|
23
|
-
"typescript-eslint": "^8
|
|
24
|
-
"vitest": "^4
|
|
25
|
-
"wireit": "^0
|
|
21
|
+
"@eslint/js": "^10",
|
|
22
|
+
"eslint": "^10",
|
|
23
|
+
"execa": "^9",
|
|
24
|
+
"globals": "^17",
|
|
25
|
+
"ts-node": "^10",
|
|
26
|
+
"typescript": "^6",
|
|
27
|
+
"typescript-eslint": "^8",
|
|
28
|
+
"vitest": "^4",
|
|
29
|
+
"wireit": "^0"
|
|
26
30
|
},
|
|
27
31
|
"engines": {
|
|
28
|
-
"node": ">=
|
|
32
|
+
"node": ">=20.0.0"
|
|
29
33
|
},
|
|
30
34
|
"files": [
|
|
31
35
|
"/lib",
|
|
@@ -118,5 +122,5 @@
|
|
|
118
122
|
"exports": "./lib/index.js",
|
|
119
123
|
"type": "module",
|
|
120
124
|
"author": "Isaac Ferreira",
|
|
121
|
-
"version": "0.
|
|
125
|
+
"version": "0.4.0"
|
|
122
126
|
}
|