@simplysf/simply-aep 0.11.3 → 0.12.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/README.md CHANGED
@@ -34,6 +34,8 @@ This package is part of the [`@simplysf/simply`](https://github.com/SimplySF/sim
34
34
  - [`sf simply aep at4dx field-set-inclusion list`](#sf-simply-aep-at4dx-field-set-inclusion-list)
35
35
  - [`sf simply aep at4dx field-set-inclusion update`](#sf-simply-aep-at4dx-field-set-inclusion-update)
36
36
  - [`sf simply aep at4dx field-set-inclusion validate`](#sf-simply-aep-at4dx-field-set-inclusion-validate)
37
+ - [`sf simply aep at4dx platform-event-subscription list`](#sf-simply-aep-at4dx-platform-event-subscription-list)
38
+ - [`sf simply aep at4dx platform-event-subscription validate`](#sf-simply-aep-at4dx-platform-event-subscription-validate)
37
39
 
38
40
  ## `sf simply aep at4dx binding create`
39
41
 
@@ -112,7 +114,7 @@ EXAMPLES
112
114
  $ sf simply aep at4dx binding create --source-dir sfdx-source/core --type unit-of-work --developer-name Account_UOW --sobject Account --sequence 10
113
115
  ```
114
116
 
115
- _See code: [lib/commands/simply/aep/at4dx/binding/create.js](https://github.com/SimplySF/simply-node/blob/@simplysf/simply-aep@0.10.0/packages/simply-aep/lib/commands/simply/aep/at4dx/binding/create.js)_
117
+ _See code: [lib/commands/simply/aep/at4dx/binding/create.js](https://github.com/SimplySF/simply-node/blob/@simplysf/simply-aep@0.11.3/packages/simply-aep/lib/commands/simply/aep/at4dx/binding/create.js)_
116
118
 
117
119
  ## `sf simply aep at4dx binding list`
118
120
 
@@ -168,7 +170,7 @@ FLAG DESCRIPTIONS
168
170
  Comma-separated list of binding types to include. If not specified, all four are included.
169
171
  ```
170
172
 
171
- _See code: [lib/commands/simply/aep/at4dx/binding/list.js](https://github.com/SimplySF/simply-node/blob/@simplysf/simply-aep@0.10.0/packages/simply-aep/lib/commands/simply/aep/at4dx/binding/list.js)_
173
+ _See code: [lib/commands/simply/aep/at4dx/binding/list.js](https://github.com/SimplySF/simply-node/blob/@simplysf/simply-aep@0.11.3/packages/simply-aep/lib/commands/simply/aep/at4dx/binding/list.js)_
172
174
 
173
175
  ## `sf simply aep at4dx binding update`
174
176
 
@@ -241,7 +243,7 @@ EXAMPLES
241
243
  $ sf simply aep at4dx binding update --target-org myOrg --type unit-of-work --developer-name Account_UOW --sequence 20
242
244
  ```
243
245
 
244
- _See code: [lib/commands/simply/aep/at4dx/binding/update.js](https://github.com/SimplySF/simply-node/blob/@simplysf/simply-aep@0.10.0/packages/simply-aep/lib/commands/simply/aep/at4dx/binding/update.js)_
246
+ _See code: [lib/commands/simply/aep/at4dx/binding/update.js](https://github.com/SimplySF/simply-node/blob/@simplysf/simply-aep@0.11.3/packages/simply-aep/lib/commands/simply/aep/at4dx/binding/update.js)_
245
247
 
246
248
  ## `sf simply aep at4dx binding validate`
247
249
 
@@ -297,7 +299,7 @@ FLAG DESCRIPTIONS
297
299
  Comma-separated list of binding types to include. If not specified, all four are included.
298
300
  ```
299
301
 
300
- _See code: [lib/commands/simply/aep/at4dx/binding/validate.js](https://github.com/SimplySF/simply-node/blob/@simplysf/simply-aep@0.10.0/packages/simply-aep/lib/commands/simply/aep/at4dx/binding/validate.js)_
302
+ _See code: [lib/commands/simply/aep/at4dx/binding/validate.js](https://github.com/SimplySF/simply-node/blob/@simplysf/simply-aep@0.11.3/packages/simply-aep/lib/commands/simply/aep/at4dx/binding/validate.js)_
301
303
 
302
304
  ## `sf simply aep at4dx domain-process-binding create`
303
305
 
@@ -378,7 +380,7 @@ EXAMPLES
378
380
  $ sf simply aep at4dx domain-process-binding create --source-dir sfdx-source/core --developer-name ServiceResource_Before_Update_Sync --sobject ServiceResource --sobject-alternate --process-context TriggerExecution --trigger-operation Before_Update --type Action --class-to-inject ServiceResourceSyncAction --order 10
379
381
  ```
380
382
 
381
- _See code: [lib/commands/simply/aep/at4dx/domain-process-binding/create.js](https://github.com/SimplySF/simply-node/blob/@simplysf/simply-aep@0.10.0/packages/simply-aep/lib/commands/simply/aep/at4dx/domain-process-binding/create.js)_
383
+ _See code: [lib/commands/simply/aep/at4dx/domain-process-binding/create.js](https://github.com/SimplySF/simply-node/blob/@simplysf/simply-aep@0.11.3/packages/simply-aep/lib/commands/simply/aep/at4dx/domain-process-binding/create.js)_
382
384
 
383
385
  ## `sf simply aep at4dx domain-process-binding list`
384
386
 
@@ -424,7 +426,7 @@ EXAMPLES
424
426
  $ sf simply aep at4dx domain-process-binding list --target-org myOrg --active-only --json
425
427
  ```
426
428
 
427
- _See code: [lib/commands/simply/aep/at4dx/domain-process-binding/list.js](https://github.com/SimplySF/simply-node/blob/@simplysf/simply-aep@0.10.0/packages/simply-aep/lib/commands/simply/aep/at4dx/domain-process-binding/list.js)_
429
+ _See code: [lib/commands/simply/aep/at4dx/domain-process-binding/list.js](https://github.com/SimplySF/simply-node/blob/@simplysf/simply-aep@0.11.3/packages/simply-aep/lib/commands/simply/aep/at4dx/domain-process-binding/list.js)_
428
430
 
429
431
  ## `sf simply aep at4dx domain-process-binding update`
430
432
 
@@ -503,7 +505,7 @@ EXAMPLES
503
505
  $ sf simply aep at4dx domain-process-binding update --target-org myOrg --developer-name Account_Before_Insert_Assign_Owner --class-to-inject AccountAssignOwnerActionV2
504
506
  ```
505
507
 
506
- _See code: [lib/commands/simply/aep/at4dx/domain-process-binding/update.js](https://github.com/SimplySF/simply-node/blob/@simplysf/simply-aep@0.10.0/packages/simply-aep/lib/commands/simply/aep/at4dx/domain-process-binding/update.js)_
508
+ _See code: [lib/commands/simply/aep/at4dx/domain-process-binding/update.js](https://github.com/SimplySF/simply-node/blob/@simplysf/simply-aep@0.11.3/packages/simply-aep/lib/commands/simply/aep/at4dx/domain-process-binding/update.js)_
507
509
 
508
510
  ## `sf simply aep at4dx domain-process-binding validate`
509
511
 
@@ -556,7 +558,7 @@ EXAMPLES
556
558
  $ sf simply aep at4dx domain-process-binding validate --target-org myOrg --json
557
559
  ```
558
560
 
559
- _See code: [lib/commands/simply/aep/at4dx/domain-process-binding/validate.js](https://github.com/SimplySF/simply-node/blob/@simplysf/simply-aep@0.10.0/packages/simply-aep/lib/commands/simply/aep/at4dx/domain-process-binding/validate.js)_
561
+ _See code: [lib/commands/simply/aep/at4dx/domain-process-binding/validate.js](https://github.com/SimplySF/simply-node/blob/@simplysf/simply-aep@0.11.3/packages/simply-aep/lib/commands/simply/aep/at4dx/domain-process-binding/validate.js)_
560
562
 
561
563
  ## `sf simply aep at4dx field-set-inclusion create`
562
564
 
@@ -614,7 +616,7 @@ EXAMPLES
614
616
  $ sf simply aep at4dx field-set-inclusion create --target-org myOrg --developer-name ServiceResource_Skills --sobject ServiceResource --sobject-alternate --fieldset-name SkillFields
615
617
  ```
616
618
 
617
- _See code: [lib/commands/simply/aep/at4dx/field-set-inclusion/create.js](https://github.com/SimplySF/simply-node/blob/@simplysf/simply-aep@0.10.0/packages/simply-aep/lib/commands/simply/aep/at4dx/field-set-inclusion/create.js)_
619
+ _See code: [lib/commands/simply/aep/at4dx/field-set-inclusion/create.js](https://github.com/SimplySF/simply-node/blob/@simplysf/simply-aep@0.11.3/packages/simply-aep/lib/commands/simply/aep/at4dx/field-set-inclusion/create.js)_
618
620
 
619
621
  ## `sf simply aep at4dx field-set-inclusion list`
620
622
 
@@ -652,7 +654,7 @@ EXAMPLES
652
654
  $ sf simply aep at4dx field-set-inclusion list --target-org myOrg --json
653
655
  ```
654
656
 
655
- _See code: [lib/commands/simply/aep/at4dx/field-set-inclusion/list.js](https://github.com/SimplySF/simply-node/blob/@simplysf/simply-aep@0.10.0/packages/simply-aep/lib/commands/simply/aep/at4dx/field-set-inclusion/list.js)_
657
+ _See code: [lib/commands/simply/aep/at4dx/field-set-inclusion/list.js](https://github.com/SimplySF/simply-node/blob/@simplysf/simply-aep@0.11.3/packages/simply-aep/lib/commands/simply/aep/at4dx/field-set-inclusion/list.js)_
656
658
 
657
659
  ## `sf simply aep at4dx field-set-inclusion update`
658
660
 
@@ -709,7 +711,7 @@ EXAMPLES
709
711
  $ sf simply aep at4dx field-set-inclusion update --target-org myOrg --developer-name Account_Contact_Fields --fieldset-name ContactRelatedFieldsV2
710
712
  ```
711
713
 
712
- _See code: [lib/commands/simply/aep/at4dx/field-set-inclusion/update.js](https://github.com/SimplySF/simply-node/blob/@simplysf/simply-aep@0.10.0/packages/simply-aep/lib/commands/simply/aep/at4dx/field-set-inclusion/update.js)_
714
+ _See code: [lib/commands/simply/aep/at4dx/field-set-inclusion/update.js](https://github.com/SimplySF/simply-node/blob/@simplysf/simply-aep@0.11.3/packages/simply-aep/lib/commands/simply/aep/at4dx/field-set-inclusion/update.js)_
713
715
 
714
716
  ## `sf simply aep at4dx field-set-inclusion validate`
715
717
 
@@ -753,5 +755,92 @@ EXAMPLES
753
755
  $ sf simply aep at4dx field-set-inclusion validate --target-org myOrg --json
754
756
  ```
755
757
 
756
- _See code: [lib/commands/simply/aep/at4dx/field-set-inclusion/validate.js](https://github.com/SimplySF/simply-node/blob/@simplysf/simply-aep@0.10.0/packages/simply-aep/lib/commands/simply/aep/at4dx/field-set-inclusion/validate.js)_
758
+ _See code: [lib/commands/simply/aep/at4dx/field-set-inclusion/validate.js](https://github.com/SimplySF/simply-node/blob/@simplysf/simply-aep@0.11.3/packages/simply-aep/lib/commands/simply/aep/at4dx/field-set-inclusion/validate.js)_
759
+
760
+ ## `sf simply aep at4dx platform-event-subscription list`
761
+
762
+ List the AT4DX Platform Event Distributor subscriptions configured in an org or local source.
763
+
764
+ ```
765
+ USAGE
766
+ $ sf simply aep at4dx platform-event-subscription list [--json] [--flags-dir <value>] [-o <value>] [--api-version
767
+ <value>] [-d <value>...]
768
+
769
+ FLAGS
770
+ -d, --source-dir=<value>... One or more paths to directories containing Salesforce DX source. Use this for
771
+ local-source discovery.
772
+ -o, --target-org=<value> Username or alias of the org to read platform event subscriptions from. Use this for
773
+ live-org discovery.
774
+ --api-version=<value> Override the api version used for api requests made by this command
775
+
776
+ GLOBAL FLAGS
777
+ --flags-dir=<value> Import flag values from a directory.
778
+ --json Format output as json.
779
+
780
+ DESCRIPTION
781
+ List the AT4DX Platform Event Distributor subscriptions configured in an org or local source.
782
+
783
+ Reads `PlatformEvents_Subscription__mdt` — either from a live org or from local Salesforce DX source — and lists every
784
+ record found, grouped by event bus then category. Unlike `simply aep at4dx binding list`, there's no priority/winner
785
+ concept: every `IsActive__c: true` subscription for a matching event is invoked by the distributor, so this is a flat
786
+ table, not a resolved one. Exactly one of `--target-org` or `--source-dir` must be specified.
787
+
788
+ EXAMPLES
789
+ $ sf simply aep at4dx platform-event-subscription list --target-org myOrg
790
+
791
+ $ sf simply aep at4dx platform-event-subscription list --source-dir sfdx-source/core --source-dir sfdx-source/app
792
+
793
+ $ sf simply aep at4dx platform-event-subscription list --target-org myOrg --json
794
+ ```
795
+
796
+ _See code: [lib/commands/simply/aep/at4dx/platform-event-subscription/list.js](https://github.com/SimplySF/simply-node/blob/@simplysf/simply-aep@0.11.3/packages/simply-aep/lib/commands/simply/aep/at4dx/platform-event-subscription/list.js)_
797
+
798
+ ## `sf simply aep at4dx platform-event-subscription validate`
799
+
800
+ Validate the AT4DX Platform Event Distributor subscriptions configured in an org or local source, failing when a wiring problem is found.
801
+
802
+ ```
803
+ USAGE
804
+ $ sf simply aep at4dx platform-event-subscription validate [--json] [--flags-dir <value>] [-o <value>] [--api-version
805
+ <value>] [-d <value>...]
806
+
807
+ FLAGS
808
+ -d, --source-dir=<value>... One or more paths to directories containing Salesforce DX source. Use this for
809
+ local-source discovery.
810
+ -o, --target-org=<value> Username or alias of the org to read platform event subscriptions from. Use this for
811
+ live-org discovery.
812
+ --api-version=<value> Override the api version used for api requests made by this command
813
+
814
+ GLOBAL FLAGS
815
+ --flags-dir=<value> Import flag values from a directory.
816
+ --json Format output as json.
817
+
818
+ DESCRIPTION
819
+ Validate the AT4DX Platform Event Distributor subscriptions configured in an org or local source, failing when a
820
+ wiring problem is found.
821
+
822
+ Reads `PlatformEvents_Subscription__mdt` — either from a live org or from local Salesforce DX source — and checks them
823
+ for problems `simply aep at4dx platform-event-subscription list` doesn't fail on: a blank or unrecognized
824
+ EventBus__c/Consumer__c/MatcherRule__c, a matcher rule that dereferences a blank match field (a real
825
+ NullPointerException risk at runtime), a MatchEventBus record the distributor's own pre-filter can never admit, an
826
+ event bus missing fields the distributor reads (only checked for a bus this command can see the field list of), two
827
+ records sharing a Consumer__c value (unique org-wide), and the same DeveloperName defined more than once. Exactly one
828
+ of `--target-org` or `--source-dir` must be specified.
829
+
830
+ Several of these problems fail silently at runtime in a real org — PlatformEventDistributor's consumer construction
831
+ only logs to System.debug on failure, and one malformed record can take down every subscription's DI module. Catching
832
+ them here, before deploy, is the whole point of this command.
833
+
834
+ Prints a table of every issue found. Exits non-zero when any issue is an error (a warning alone doesn't fail the
835
+ command) — use this in CI to gate on AT4DX platform event subscription wiring problems before they reach an org.
836
+
837
+ EXAMPLES
838
+ $ sf simply aep at4dx platform-event-subscription validate --target-org myOrg
839
+
840
+ $ sf simply aep at4dx platform-event-subscription validate --source-dir sfdx-source/core --source-dir sfdx-source/app
841
+
842
+ $ sf simply aep at4dx platform-event-subscription validate --target-org myOrg --json
843
+ ```
844
+
845
+ _See code: [lib/commands/simply/aep/at4dx/platform-event-subscription/validate.js](https://github.com/SimplySF/simply-node/blob/@simplysf/simply-aep@0.11.3/packages/simply-aep/lib/commands/simply/aep/at4dx/platform-event-subscription/validate.js)_
757
846
  <!-- commandsstop -->
@@ -0,0 +1,21 @@
1
+ import { SfCommand } from '@salesforce/sf-plugins-core';
2
+ import { type At4dxPlatformEventSubscriptionListResult } from '@simplysf/simply-aep-core';
3
+ /**
4
+ * Lists the AT4DX Platform Event Distributor subscriptions (`PlatformEvents_Subscription__mdt`)
5
+ * configured in a target org or local DX source, grouped by event bus then category to match how
6
+ * `PlatformEventDistributor` itself scopes a subscription. Unlike `binding list`, there's no
7
+ * priority/winner concept — every active subscription for a matching event is invoked.
8
+ */
9
+ export default class At4dxPlatformEventSubscriptionList extends SfCommand<At4dxPlatformEventSubscriptionListResult> {
10
+ static readonly summary: string;
11
+ static readonly description: string;
12
+ static readonly examples: string[];
13
+ static readonly flags: {
14
+ 'target-org': import("@oclif/core/interfaces").OptionFlag<import("@salesforce/core").Org, import("@oclif/core/interfaces").CustomOptions>;
15
+ 'api-version': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
16
+ 'source-dir': import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
17
+ 'flags-dir': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
18
+ };
19
+ /** @returns The platform event subscription records found for the requested source, grouped by event bus then category. */
20
+ run(): Promise<At4dxPlatformEventSubscriptionListResult>;
21
+ }
@@ -0,0 +1,120 @@
1
+ /*
2
+ * Copyright (c) 2026, Clay Chipps.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import { Messages } from '@salesforce/core';
17
+ import { SfCommand, Flags } from '@salesforce/sf-plugins-core';
18
+ import { scanLocalPlatformEventSubscriptions, scanOrgPlatformEventSubscriptions, } from '@simplysf/simply-aep-core';
19
+ Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
20
+ const messages = Messages.loadMessages('@simplysf/simply-aep', 'simply.aep.at4dx.platform-event-subscription.list');
21
+ function toDisplayRow(record) {
22
+ return {
23
+ eventBus: record.eventBus,
24
+ eventCategory: record.eventCategory ?? '(no category)',
25
+ developerName: record.developerName,
26
+ consumer: record.consumer,
27
+ matcherRule: record.matcherRule,
28
+ active: String(record.isActive),
29
+ source: record.source,
30
+ };
31
+ }
32
+ /**
33
+ * Lists the AT4DX Platform Event Distributor subscriptions (`PlatformEvents_Subscription__mdt`)
34
+ * configured in a target org or local DX source, grouped by event bus then category to match how
35
+ * `PlatformEventDistributor` itself scopes a subscription. Unlike `binding list`, there's no
36
+ * priority/winner concept — every active subscription for a matching event is invoked.
37
+ */
38
+ export default class At4dxPlatformEventSubscriptionList extends SfCommand {
39
+ static summary = messages.getMessage('summary');
40
+ static description = messages.getMessage('description');
41
+ static examples = messages.getMessages('examples');
42
+ static flags = {
43
+ ...SfCommand.baseFlags,
44
+ 'target-org': Flags.optionalOrg({
45
+ summary: messages.getMessage('flags.target-org.summary'),
46
+ char: 'o',
47
+ }),
48
+ 'api-version': Flags.orgApiVersion(),
49
+ 'source-dir': Flags.directory({
50
+ summary: messages.getMessage('flags.source-dir.summary'),
51
+ char: 'd',
52
+ exists: true,
53
+ multiple: true,
54
+ }),
55
+ };
56
+ /** @returns The platform event subscription records found for the requested source, grouped by event bus then category. */
57
+ async run() {
58
+ const { flags } = await this.parse(At4dxPlatformEventSubscriptionList);
59
+ const targetOrg = flags['target-org'];
60
+ const sourceDirs = flags['source-dir'] ?? [];
61
+ if ((targetOrg && sourceDirs.length > 0) || (!targetOrg && sourceDirs.length === 0)) {
62
+ throw messages.createError('error.targetOrgOrSourceDirRequired');
63
+ }
64
+ let source;
65
+ let records;
66
+ if (targetOrg) {
67
+ const connection = targetOrg.getConnection(flags['api-version']);
68
+ source = targetOrg.getUsername() ?? 'org';
69
+ this.spinner.start(messages.getMessage('info.queryingOrg', [source]));
70
+ let scanResult;
71
+ try {
72
+ scanResult = await scanOrgPlatformEventSubscriptions(connection);
73
+ }
74
+ catch (error) {
75
+ this.spinner.stop();
76
+ throw messages.createError('error.orgQueryFailed', [error.message]);
77
+ }
78
+ this.spinner.stop();
79
+ if (scanResult.missing) {
80
+ throw messages.createError('error.at4dxNotDetected');
81
+ }
82
+ records = scanResult.records;
83
+ }
84
+ else {
85
+ source = 'local';
86
+ this.spinner.start(messages.getMessage('info.scanningLocalSource'));
87
+ let scanResult;
88
+ try {
89
+ scanResult = scanLocalPlatformEventSubscriptions(sourceDirs);
90
+ }
91
+ catch (error) {
92
+ this.spinner.stop();
93
+ throw messages.createError('error.localScanFailed', [error.message]);
94
+ }
95
+ this.spinner.stop();
96
+ if (scanResult.records.length === 0 && scanResult.malformed.length === 0) {
97
+ throw messages.createError('error.at4dxNotDetected');
98
+ }
99
+ records = scanResult.records;
100
+ }
101
+ const sorted = [...records].sort((a, b) => a.eventBus.localeCompare(b.eventBus) ||
102
+ (a.eventCategory ?? '').localeCompare(b.eventCategory ?? '') ||
103
+ a.developerName.localeCompare(b.developerName));
104
+ this.table({
105
+ data: sorted.map(toDisplayRow),
106
+ columns: [
107
+ { key: 'eventBus', name: 'EVENT BUS' },
108
+ { key: 'eventCategory', name: 'CATEGORY' },
109
+ { key: 'developerName', name: 'DEVELOPER NAME' },
110
+ { key: 'consumer', name: 'CONSUMER' },
111
+ { key: 'matcherRule', name: 'MATCHER RULE' },
112
+ { key: 'active', name: 'ACTIVE' },
113
+ { key: 'source', name: 'SOURCE' },
114
+ ],
115
+ });
116
+ this.info(messages.getMessage('info.complete', [records.length, source]));
117
+ return { source, records };
118
+ }
119
+ }
120
+ //# sourceMappingURL=list.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list.js","sourceRoot":"","sources":["../../../../../../src/commands/simply/aep/at4dx/platform-event-subscription/list.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EACL,mCAAmC,EACnC,iCAAiC,GAGlC,MAAM,2BAA2B,CAAC;AAEnC,QAAQ,CAAC,kCAAkC,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,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EAAE,IAAI,EAAE,WAAW,EAAE;gBACtC,EAAE,GAAG,EAAE,eAAe,EAAE,IAAI,EAAE,UAAU,EAAE;gBAC1C,EAAE,GAAG,EAAE,eAAe,EAAE,IAAI,EAAE,gBAAgB,EAAE;gBAChD,EAAE,GAAG,EAAE,UAAU,EAAE,IAAI,EAAE,UAAU,EAAE;gBACrC,EAAE,GAAG,EAAE,aAAa,EAAE,IAAI,EAAE,cAAc,EAAE;gBAC5C,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE;gBACjC,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE;aAClC;SACF,CAAC,CAAC;QAEH,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,eAAe,EAAE,CAAC,OAAO,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;QAE1E,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC;IAC7B,CAAC"}
@@ -0,0 +1,26 @@
1
+ import { SfCommand } from '@salesforce/sf-plugins-core';
2
+ import { type At4dxPlatformEventSubscriptionValidateResult } from '@simplysf/simply-aep-core';
3
+ /**
4
+ * Validates the AT4DX Platform Event Distributor subscriptions (`PlatformEvents_Subscription__mdt`)
5
+ * configured in a target org or local DX source — wiring problems that are invisible to
6
+ * `platform-event-subscription list`, several of which fail silently at runtime by design (see
7
+ * docs/design/0025's Problem section) — and fails (non-zero exit) when any of them is a real bug, for
8
+ * use as a CI gate.
9
+ *
10
+ * `non-conforming-event-bus` only fires for an event bus this command can actually see the field list
11
+ * of (a `<Bus>__e` object in the same `--source-dir` scope, for a local run) — a bus it can't see is
12
+ * treated as "not looked at", not "broken".
13
+ */
14
+ export default class At4dxPlatformEventSubscriptionValidate extends SfCommand<At4dxPlatformEventSubscriptionValidateResult> {
15
+ static readonly summary: string;
16
+ static readonly description: string;
17
+ static readonly examples: string[];
18
+ static readonly flags: {
19
+ 'target-org': import("@oclif/core/interfaces").OptionFlag<import("@salesforce/core").Org, import("@oclif/core/interfaces").CustomOptions>;
20
+ 'api-version': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
21
+ 'source-dir': import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
22
+ 'flags-dir': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
23
+ };
24
+ /** @returns The validation issues found for the requested source. Sets `process.exitCode = 1` when any issue is severity `error`. */
25
+ run(): Promise<At4dxPlatformEventSubscriptionValidateResult>;
26
+ }
@@ -0,0 +1,132 @@
1
+ /*
2
+ * Copyright (c) 2026, Clay Chipps.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import { Messages } from '@salesforce/core';
17
+ import { SfCommand, Flags } from '@salesforce/sf-plugins-core';
18
+ import { scanLocalPlatformEventSubscriptions, scanOrgPlatformEventSubscriptions, validatePlatformEventSubscriptions, } from '@simplysf/simply-aep-core';
19
+ Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
20
+ const messages = Messages.loadMessages('@simplysf/simply-aep', 'simply.aep.at4dx.platform-event-subscription.validate');
21
+ function toDisplayRow(issue) {
22
+ return {
23
+ severity: issue.severity,
24
+ rule: issue.rule,
25
+ eventBus: issue.eventBus ?? '',
26
+ developerName: issue.developerName ?? '',
27
+ source: issue.source,
28
+ message: issue.message,
29
+ };
30
+ }
31
+ const ISSUE_TABLE_COLUMNS = [
32
+ { key: 'severity', name: 'SEVERITY' },
33
+ { key: 'rule', name: 'RULE' },
34
+ { key: 'eventBus', name: 'EVENT BUS' },
35
+ { key: 'developerName', name: 'DEVELOPER NAME' },
36
+ { key: 'source', name: 'SOURCE' },
37
+ { key: 'message', name: 'MESSAGE' },
38
+ ];
39
+ /**
40
+ * Validates the AT4DX Platform Event Distributor subscriptions (`PlatformEvents_Subscription__mdt`)
41
+ * configured in a target org or local DX source — wiring problems that are invisible to
42
+ * `platform-event-subscription list`, several of which fail silently at runtime by design (see
43
+ * docs/design/0025's Problem section) — and fails (non-zero exit) when any of them is a real bug, for
44
+ * use as a CI gate.
45
+ *
46
+ * `non-conforming-event-bus` only fires for an event bus this command can actually see the field list
47
+ * of (a `<Bus>__e` object in the same `--source-dir` scope, for a local run) — a bus it can't see is
48
+ * treated as "not looked at", not "broken".
49
+ */
50
+ export default class At4dxPlatformEventSubscriptionValidate extends SfCommand {
51
+ static summary = messages.getMessage('summary');
52
+ static description = messages.getMessage('description');
53
+ static examples = messages.getMessages('examples');
54
+ static flags = {
55
+ ...SfCommand.baseFlags,
56
+ 'target-org': Flags.optionalOrg({
57
+ summary: messages.getMessage('flags.target-org.summary'),
58
+ char: 'o',
59
+ }),
60
+ 'api-version': Flags.orgApiVersion(),
61
+ 'source-dir': Flags.directory({
62
+ summary: messages.getMessage('flags.source-dir.summary'),
63
+ char: 'd',
64
+ exists: true,
65
+ multiple: true,
66
+ }),
67
+ };
68
+ /** @returns The validation issues found for the requested source. Sets `process.exitCode = 1` when any issue is severity `error`. */
69
+ async run() {
70
+ const { flags } = await this.parse(At4dxPlatformEventSubscriptionValidate);
71
+ const targetOrg = flags['target-org'];
72
+ const sourceDirs = flags['source-dir'] ?? [];
73
+ if ((targetOrg && sourceDirs.length > 0) || (!targetOrg && sourceDirs.length === 0)) {
74
+ throw messages.createError('error.targetOrgOrSourceDirRequired');
75
+ }
76
+ let source;
77
+ let recordCount;
78
+ let issues;
79
+ if (targetOrg) {
80
+ const connection = targetOrg.getConnection(flags['api-version']);
81
+ source = targetOrg.getUsername() ?? 'org';
82
+ this.spinner.start(messages.getMessage('info.queryingOrg', [source]));
83
+ let scanResult;
84
+ try {
85
+ scanResult = await scanOrgPlatformEventSubscriptions(connection);
86
+ }
87
+ catch (error) {
88
+ this.spinner.stop();
89
+ throw messages.createError('error.orgQueryFailed', [error.message]);
90
+ }
91
+ this.spinner.stop();
92
+ if (scanResult.missing) {
93
+ throw messages.createError('error.at4dxNotDetected');
94
+ }
95
+ recordCount = scanResult.records.length;
96
+ // Org-side event-bus-field discovery (describe) isn't wired up in this stage — non-conforming-event-bus
97
+ // is silent for every bus on an org-connected run until that lands. See docs/design/0025.
98
+ issues = validatePlatformEventSubscriptions(scanResult);
99
+ }
100
+ else {
101
+ source = 'local';
102
+ this.spinner.start(messages.getMessage('info.scanningLocalSource'));
103
+ let scanResult;
104
+ try {
105
+ scanResult = scanLocalPlatformEventSubscriptions(sourceDirs);
106
+ }
107
+ catch (error) {
108
+ this.spinner.stop();
109
+ throw messages.createError('error.localScanFailed', [error.message]);
110
+ }
111
+ this.spinner.stop();
112
+ if (scanResult.records.length === 0 && scanResult.malformed.length === 0) {
113
+ throw messages.createError('error.at4dxNotDetected');
114
+ }
115
+ recordCount = scanResult.records.length;
116
+ // Local event-bus-field discovery (reading objects/<Bus>__e/fields/) isn't wired up in this
117
+ // stage either — same caveat as the org path above.
118
+ issues = validatePlatformEventSubscriptions(scanResult);
119
+ }
120
+ if (issues.length > 0) {
121
+ this.table({ data: issues.map(toDisplayRow), columns: ISSUE_TABLE_COLUMNS });
122
+ }
123
+ else {
124
+ this.info(messages.getMessage('info.valid', [recordCount, source]));
125
+ }
126
+ if (issues.some((issue) => issue.severity === 'error')) {
127
+ process.exitCode = 1;
128
+ }
129
+ return { source, recordCount, issues };
130
+ }
131
+ }
132
+ //# sourceMappingURL=validate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validate.js","sourceRoot":"","sources":["../../../../../../src/commands/simply/aep/at4dx/platform-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,OAAO,CAAC,CAAC,CAAC;YAClF,CAAC;YACD,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;YAEpB,IAAI,UAAU,CAAC,OAAO,CAAC,MAAM,KAAK,CAAC,IAAI,UAAU,CAAC,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBACzE,MAAM,QAAQ,CAAC,WAAW,CAAC,wBAAwB,CAAC,CAAC;YACvD,CAAC;YAED,WAAW,GAAG,UAAU,CAAC,OAAO,CAAC,MAAM,CAAC;YACxC,4FAA4F;YAC5F,oDAAoD;YACpD,MAAM,GAAG,kCAAkC,CAAC,UAAU,CAAC,CAAC;QAC1D,CAAC;QAED,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACtB,IAAI,CAAC,KAAK,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,GAAG,CAAC,YAAY,CAAC,EAAE,OAAO,EAAE,mBAAmB,EAAE,CAAC,CAAC;QAC/E,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,YAAY,EAAE,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;QACtE,CAAC;QAED,IAAI,MAAM,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,QAAQ,KAAK,OAAO,CAAC,EAAE,CAAC;YACvD,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;QACvB,CAAC;QAED,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,CAAC;IACzC,CAAC"}
@@ -0,0 +1,51 @@
1
+ # summary
2
+
3
+ List the AT4DX Platform Event Distributor subscriptions configured in an org or local source.
4
+
5
+ # description
6
+
7
+ Reads `PlatformEvents_Subscription__mdt` — either from a live org or from local Salesforce DX source — and lists every record found, grouped by event bus then category. Unlike `simply aep at4dx binding list`, there's no priority/winner concept: every `IsActive__c: true` subscription for a matching event is invoked by the distributor, so this is a flat table, not a resolved one. Exactly one of `--target-org` or `--source-dir` must be specified.
8
+
9
+ # flags.target-org.summary
10
+
11
+ Username or alias of the org to read platform event subscriptions from. Use this for live-org discovery.
12
+
13
+ # flags.source-dir.summary
14
+
15
+ One or more paths to directories containing Salesforce DX source. Use this for local-source discovery.
16
+
17
+ # examples
18
+
19
+ - <%= config.bin %> <%= command.id %> --target-org myOrg
20
+
21
+ - <%= config.bin %> <%= command.id %> --source-dir sfdx-source/core --source-dir sfdx-source/app
22
+
23
+ - <%= config.bin %> <%= command.id %> --target-org myOrg --json
24
+
25
+ # error.targetOrgOrSourceDirRequired
26
+
27
+ You must specify either --target-org or --source-dir, but not both.
28
+
29
+ # error.at4dxNotDetected
30
+
31
+ AT4DX doesn't appear to be present in this source: the PlatformEvents_Subscription__mdt Custom Metadata Type wasn't found.
32
+
33
+ # error.localScanFailed
34
+
35
+ Failed to scan the project directory: %s
36
+
37
+ # error.orgQueryFailed
38
+
39
+ Failed to query platform event subscriptions from the org: %s
40
+
41
+ # info.queryingOrg
42
+
43
+ Querying platform event subscriptions from %s...
44
+
45
+ # info.scanningLocalSource
46
+
47
+ Scanning local source for platform event subscriptions...
48
+
49
+ # info.complete
50
+
51
+ Found %s platform event subscription(s) in %s
@@ -0,0 +1,55 @@
1
+ # summary
2
+
3
+ Validate the AT4DX Platform Event Distributor subscriptions configured in an org or local source, failing when a wiring problem is found.
4
+
5
+ # description
6
+
7
+ Reads `PlatformEvents_Subscription__mdt` — either from a live org or from local Salesforce DX source — and checks them for problems `simply aep at4dx platform-event-subscription list` doesn't fail on: a blank or unrecognized EventBus__c/Consumer__c/MatcherRule__c, a matcher rule that dereferences a blank match field (a real NullPointerException risk at runtime), a MatchEventBus record the distributor's own pre-filter can never admit, an event bus missing fields the distributor reads (only checked for a bus this command can see the field list of), two records sharing a Consumer__c value (unique org-wide), and the same DeveloperName defined more than once. Exactly one of `--target-org` or `--source-dir` must be specified.
8
+
9
+ Several of these problems fail silently at runtime in a real org — PlatformEventDistributor's consumer construction only logs to System.debug on failure, and one malformed record can take down every subscription's DI module. Catching them here, before deploy, is the whole point of this command.
10
+
11
+ Prints a table of every issue found. Exits non-zero when any issue is an error (a warning alone doesn't fail the command) — use this in CI to gate on AT4DX platform event subscription wiring problems before they reach an org.
12
+
13
+ # flags.target-org.summary
14
+
15
+ Username or alias of the org to read platform event subscriptions from. Use this for live-org discovery.
16
+
17
+ # flags.source-dir.summary
18
+
19
+ One or more paths to directories containing Salesforce DX source. Use this for local-source discovery.
20
+
21
+ # examples
22
+
23
+ - <%= config.bin %> <%= command.id %> --target-org myOrg
24
+
25
+ - <%= config.bin %> <%= command.id %> --source-dir sfdx-source/core --source-dir sfdx-source/app
26
+
27
+ - <%= config.bin %> <%= command.id %> --target-org myOrg --json
28
+
29
+ # error.targetOrgOrSourceDirRequired
30
+
31
+ You must specify either --target-org or --source-dir, but not both.
32
+
33
+ # error.at4dxNotDetected
34
+
35
+ AT4DX doesn't appear to be present in this source: the PlatformEvents_Subscription__mdt Custom Metadata Type wasn't found.
36
+
37
+ # error.localScanFailed
38
+
39
+ Failed to scan the project directory: %s
40
+
41
+ # error.orgQueryFailed
42
+
43
+ Failed to query platform event subscriptions from the org: %s
44
+
45
+ # info.queryingOrg
46
+
47
+ Querying platform event subscriptions from %s...
48
+
49
+ # info.scanningLocalSource
50
+
51
+ Scanning local source for platform event subscriptions...
52
+
53
+ # info.valid
54
+
55
+ No issues found across %s platform event subscription(s) in %s
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@simplysf/simply-aep",
3
3
  "description": "Commands for Apex Enterprise Patterns tooling (fflib, force-di, AT4DX)",
4
- "version": "0.11.3",
4
+ "version": "0.12.0",
5
5
  "author": "@ClayChipps",
6
6
  "homepage": "https://github.com/SimplySF/simply-node",
7
7
  "bugs": "https://github.com/SimplySF/simply-node/issues",
@@ -60,7 +60,7 @@
60
60
  "@salesforce/core": "^8.30.0",
61
61
  "@salesforce/kit": "^3.2.6",
62
62
  "@salesforce/sf-plugins-core": "^12.2.16",
63
- "@simplysf/simply-aep-core": "^0.10.1",
63
+ "@simplysf/simply-aep-core": "^0.11.0",
64
64
  "@simplysf/simply-core": "^1.5.1"
65
65
  },
66
66
  "devDependencies": {
@@ -197,5 +197,5 @@
197
197
  "output": []
198
198
  }
199
199
  },
200
- "gitHead": "ef77fc513b79e035f6583eae3e9414ae29fbcac0"
200
+ "gitHead": "35ce5dcb8e289fe36a5deb87cfd0d4f19d2e3374"
201
201
  }