sf-plugin-preflight 0.8.0 → 0.10.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 +12 -0
- package/README.md +2 -1
- package/dist/commands/preflight/monitor.js +19 -0
- package/oclif.manifest.json +79 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.10.0]
|
|
4
|
+
|
|
5
|
+
- Same version as the CLI; the new checks come through `sf preflight analyze` and the other commands.
|
|
6
|
+
|
|
7
|
+
## [0.9.1]
|
|
8
|
+
|
|
9
|
+
- Same as 0.9.0, which was never published.
|
|
10
|
+
|
|
11
|
+
## [0.9.0]
|
|
12
|
+
|
|
13
|
+
- Adds `sf preflight monitor`.
|
|
14
|
+
|
|
3
15
|
## [0.8.0]
|
|
4
16
|
|
|
5
17
|
- First release (the plugin shares the CLI version): `sf preflight analyze | tests | agents | agent-tests | incidents | rollback | explain | evidence`, passing `--target-org` and `--json` through to the sf-preflight CLI.
|
package/README.md
CHANGED
|
@@ -25,6 +25,7 @@ sf preflight analyze --base origin/main --json # same as --format json
|
|
|
25
25
|
sf preflight tests --base origin/main --validate --target-org my-sandbox
|
|
26
26
|
sf preflight agents Sales_Agent
|
|
27
27
|
sf preflight incidents --target-org prod --since 7d
|
|
28
|
+
sf preflight monitor --target-org prod --since 1h --notify-on high # risky changes made in the org
|
|
28
29
|
sf preflight rollback a1b2c3d
|
|
29
30
|
sf preflight explain Opportunity
|
|
30
31
|
sf preflight evidence --base origin/main --out preflight-evidence.json
|
|
@@ -41,7 +42,7 @@ listed or not (for example `--md-out`, `--sarif-out`, `--config`); see the
|
|
|
41
42
|
| `-o <org>`, `--target-org <org>` | `--org <org>` |
|
|
42
43
|
| `--json` | `--format json` (commands without formats ignore it) |
|
|
43
44
|
|
|
44
|
-
On commands that read an org (`analyze`, `tests`, `agent-tests`, `incidents`, `rollback`), `-o` is
|
|
45
|
+
On commands that read an org (`analyze`, `tests`, `agent-tests`, `incidents`, `monitor`, `rollback`), `-o` is
|
|
45
46
|
the org, as everywhere in `sf`. The CLI's own output file flag is spelled `--out` there. On
|
|
46
47
|
`evidence` and `explain`, which never read an org, `-o` stays the CLI's `--out`.
|
|
47
48
|
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
import { Flags } from "@oclif/core";
|
|
3
|
+
import { preflightCommand } from "../../command.js";
|
|
4
|
+
export default preflightCommand({
|
|
5
|
+
cli: "monitor",
|
|
6
|
+
summary: "Watch an org's Setup Audit Trail for risky changes and alert Slack or Teams.",
|
|
7
|
+
description: "Reads the Setup Audit Trail of the target org (read-only; production is fine) and reports validation rules or flows switched off, broad permissions, Apex, sharing and security changes. Set PREFLIGHT_WEBHOOK_URL and use --notify-on to send an alert.",
|
|
8
|
+
examples: [
|
|
9
|
+
"<%= config.bin %> <%= command.id %> --target-org prod --since 24h",
|
|
10
|
+
"<%= config.bin %> <%= command.id %> --target-org prod --since 1h --notify-on high",
|
|
11
|
+
],
|
|
12
|
+
org: true,
|
|
13
|
+
hasFormat: true,
|
|
14
|
+
flags: {
|
|
15
|
+
since: Flags.string({ summary: "Changes since a duration (1h, 24h, 7d) or a date." }),
|
|
16
|
+
"notify-on": Flags.string({ summary: "Send an alert at this risk or higher.", options: ["medium", "high"] }),
|
|
17
|
+
format: Flags.string({ summary: "Output format.", options: ["md", "json"] }),
|
|
18
|
+
},
|
|
19
|
+
});
|
package/oclif.manifest.json
CHANGED
|
@@ -405,6 +405,84 @@
|
|
|
405
405
|
"incidents.js"
|
|
406
406
|
]
|
|
407
407
|
},
|
|
408
|
+
"preflight:monitor": {
|
|
409
|
+
"aliases": [],
|
|
410
|
+
"args": {},
|
|
411
|
+
"description": "Reads the Setup Audit Trail of the target org (read-only; production is fine) and reports validation rules or flows switched off, broad permissions, Apex, sharing and security changes. Set PREFLIGHT_WEBHOOK_URL and use --notify-on to send an alert.",
|
|
412
|
+
"examples": [
|
|
413
|
+
"<%= config.bin %> <%= command.id %> --target-org prod --since 24h",
|
|
414
|
+
"<%= config.bin %> <%= command.id %> --target-org prod --since 1h --notify-on high"
|
|
415
|
+
],
|
|
416
|
+
"flags": {
|
|
417
|
+
"project": {
|
|
418
|
+
"char": "p",
|
|
419
|
+
"name": "project",
|
|
420
|
+
"summary": "SFDX project directory (default: the current directory).",
|
|
421
|
+
"hasDynamicHelp": false,
|
|
422
|
+
"multiple": false,
|
|
423
|
+
"type": "option"
|
|
424
|
+
},
|
|
425
|
+
"target-org": {
|
|
426
|
+
"char": "o",
|
|
427
|
+
"name": "target-org",
|
|
428
|
+
"summary": "Org to read from, by username or alias (an `sf org login` org).",
|
|
429
|
+
"hasDynamicHelp": false,
|
|
430
|
+
"multiple": false,
|
|
431
|
+
"type": "option"
|
|
432
|
+
},
|
|
433
|
+
"since": {
|
|
434
|
+
"name": "since",
|
|
435
|
+
"summary": "Changes since a duration (1h, 24h, 7d) or a date.",
|
|
436
|
+
"hasDynamicHelp": false,
|
|
437
|
+
"multiple": false,
|
|
438
|
+
"type": "option"
|
|
439
|
+
},
|
|
440
|
+
"notify-on": {
|
|
441
|
+
"name": "notify-on",
|
|
442
|
+
"summary": "Send an alert at this risk or higher.",
|
|
443
|
+
"hasDynamicHelp": false,
|
|
444
|
+
"multiple": false,
|
|
445
|
+
"options": [
|
|
446
|
+
"medium",
|
|
447
|
+
"high"
|
|
448
|
+
],
|
|
449
|
+
"type": "option"
|
|
450
|
+
},
|
|
451
|
+
"format": {
|
|
452
|
+
"name": "format",
|
|
453
|
+
"summary": "Output format.",
|
|
454
|
+
"hasDynamicHelp": false,
|
|
455
|
+
"multiple": false,
|
|
456
|
+
"options": [
|
|
457
|
+
"md",
|
|
458
|
+
"json"
|
|
459
|
+
],
|
|
460
|
+
"type": "option"
|
|
461
|
+
},
|
|
462
|
+
"json": {
|
|
463
|
+
"name": "json",
|
|
464
|
+
"summary": "Print JSON (same as --format json).",
|
|
465
|
+
"allowNo": false,
|
|
466
|
+
"type": "boolean"
|
|
467
|
+
}
|
|
468
|
+
},
|
|
469
|
+
"hasDynamicHelp": false,
|
|
470
|
+
"hiddenAliases": [],
|
|
471
|
+
"id": "preflight:monitor",
|
|
472
|
+
"pluginAlias": "sf-plugin-preflight",
|
|
473
|
+
"pluginName": "sf-plugin-preflight",
|
|
474
|
+
"pluginType": "core",
|
|
475
|
+
"strict": false,
|
|
476
|
+
"summary": "Watch an org's Setup Audit Trail for risky changes and alert Slack or Teams.",
|
|
477
|
+
"enableJsonFlag": false,
|
|
478
|
+
"isESM": true,
|
|
479
|
+
"relativePath": [
|
|
480
|
+
"dist",
|
|
481
|
+
"commands",
|
|
482
|
+
"preflight",
|
|
483
|
+
"monitor.js"
|
|
484
|
+
]
|
|
485
|
+
},
|
|
408
486
|
"preflight:rollback": {
|
|
409
487
|
"aliases": [],
|
|
410
488
|
"args": {},
|
|
@@ -566,5 +644,5 @@
|
|
|
566
644
|
]
|
|
567
645
|
}
|
|
568
646
|
},
|
|
569
|
-
"version": "0.
|
|
647
|
+
"version": "0.10.0"
|
|
570
648
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sf-plugin-preflight",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Salesforce CLI plugin for sf-preflight: see what a Salesforce change sets off before it ships. Adds `sf preflight analyze`, `tests`, `agents`, `incidents`, `rollback` and more.",
|
|
3
|
+
"version": "0.10.0",
|
|
4
|
+
"description": "Salesforce CLI plugin for sf-preflight: see what a Salesforce change sets off before it ships. Adds `sf preflight analyze`, `tests`, `agents`, `incidents`, `monitor`, `rollback` and more.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "sf-preflight contributors",
|
|
7
7
|
"homepage": "https://visparashar.github.io/sf-preflight/",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
},
|
|
56
56
|
"dependencies": {
|
|
57
57
|
"@oclif/core": "^4.0.0",
|
|
58
|
-
"sf-preflight": "^0.
|
|
58
|
+
"sf-preflight": "^0.10.0"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
61
|
"@types/node": "^26.6.4",
|