@simplysf/simply-aep 0.7.0 → 0.9.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.
Files changed (38) hide show
  1. package/README.md +405 -5
  2. package/lib/commands/simply/aep/at4dx/binding/create.d.ts +28 -0
  3. package/lib/commands/simply/aep/at4dx/binding/create.js +116 -0
  4. package/lib/commands/simply/aep/at4dx/binding/create.js.map +1 -0
  5. package/lib/commands/simply/aep/at4dx/binding/list.js +1 -1
  6. package/lib/commands/simply/aep/at4dx/binding/list.js.map +1 -1
  7. package/lib/commands/simply/aep/at4dx/binding/update.d.ts +29 -0
  8. package/lib/commands/simply/aep/at4dx/binding/update.js +119 -0
  9. package/lib/commands/simply/aep/at4dx/binding/update.js.map +1 -0
  10. package/lib/commands/simply/aep/at4dx/binding/validate.d.ts +23 -0
  11. package/lib/commands/simply/aep/at4dx/binding/validate.js +143 -0
  12. package/lib/commands/simply/aep/at4dx/binding/validate.js.map +1 -0
  13. package/lib/commands/simply/aep/at4dx/field-set-inclusion/create.d.ts +26 -0
  14. package/lib/commands/simply/aep/at4dx/field-set-inclusion/create.js +112 -0
  15. package/lib/commands/simply/aep/at4dx/field-set-inclusion/create.js.map +1 -0
  16. package/lib/commands/simply/aep/at4dx/field-set-inclusion/list.d.ts +20 -0
  17. package/lib/commands/simply/aep/at4dx/field-set-inclusion/list.js +110 -0
  18. package/lib/commands/simply/aep/at4dx/field-set-inclusion/list.js.map +1 -0
  19. package/lib/commands/simply/aep/at4dx/field-set-inclusion/update.d.ts +27 -0
  20. package/lib/commands/simply/aep/at4dx/field-set-inclusion/update.js +109 -0
  21. package/lib/commands/simply/aep/at4dx/field-set-inclusion/update.js.map +1 -0
  22. package/lib/commands/simply/aep/at4dx/field-set-inclusion/validate.d.ts +21 -0
  23. package/lib/commands/simply/aep/at4dx/field-set-inclusion/validate.js +129 -0
  24. package/lib/commands/simply/aep/at4dx/field-set-inclusion/validate.js.map +1 -0
  25. package/lib/common/bindingWriteError.d.ts +14 -0
  26. package/lib/common/bindingWriteError.js +58 -0
  27. package/lib/common/bindingWriteError.js.map +1 -0
  28. package/lib/common/fieldSetInclusionWriteError.d.ts +14 -0
  29. package/lib/common/fieldSetInclusionWriteError.js +56 -0
  30. package/lib/common/fieldSetInclusionWriteError.js.map +1 -0
  31. package/messages/simply.aep.at4dx.binding.create.md +123 -0
  32. package/messages/simply.aep.at4dx.binding.update.md +121 -0
  33. package/messages/simply.aep.at4dx.binding.validate.md +65 -0
  34. package/messages/simply.aep.at4dx.field-set-inclusion.create.md +103 -0
  35. package/messages/simply.aep.at4dx.field-set-inclusion.list.md +51 -0
  36. package/messages/simply.aep.at4dx.field-set-inclusion.update.md +105 -0
  37. package/messages/simply.aep.at4dx.field-set-inclusion.validate.md +53 -0
  38. package/package.json +3 -3
@@ -0,0 +1,110 @@
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 { scanLocalFieldSetInclusions, scanOrgFieldSetInclusions, } from '@simplysf/simply-aep-core';
19
+ Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
20
+ const messages = Messages.loadMessages('@simplysf/simply-aep', 'simply.aep.at4dx.field-set-inclusion.list');
21
+ function toDisplayRow(record) {
22
+ return {
23
+ developerName: record.developerName,
24
+ sobject: record.sobject,
25
+ fieldsetName: record.fieldsetName,
26
+ active: String(record.isActive),
27
+ source: record.source,
28
+ };
29
+ }
30
+ /**
31
+ * Lists the AT4DX Selector field set inclusions (`SelectorConfig_FieldSetInclusion__mdt`) configured
32
+ * in a target org or local DX source. Unlike `binding list`, there's no priority/winner concept — every
33
+ * active record contributes its field set to its SObject's selector.
34
+ */
35
+ export default class At4dxFieldSetInclusionList extends SfCommand {
36
+ static summary = messages.getMessage('summary');
37
+ static description = messages.getMessage('description');
38
+ static examples = messages.getMessages('examples');
39
+ static flags = {
40
+ ...SfCommand.baseFlags,
41
+ 'target-org': Flags.optionalOrg({
42
+ summary: messages.getMessage('flags.target-org.summary'),
43
+ char: 'o',
44
+ }),
45
+ 'api-version': Flags.orgApiVersion(),
46
+ 'source-dir': Flags.directory({
47
+ summary: messages.getMessage('flags.source-dir.summary'),
48
+ char: 'd',
49
+ exists: true,
50
+ multiple: true,
51
+ }),
52
+ };
53
+ /** @returns The field set inclusion records found for the requested source. */
54
+ async run() {
55
+ const { flags } = await this.parse(At4dxFieldSetInclusionList);
56
+ const targetOrg = flags['target-org'];
57
+ const sourceDirs = flags['source-dir'] ?? [];
58
+ if ((targetOrg && sourceDirs.length > 0) || (!targetOrg && sourceDirs.length === 0)) {
59
+ throw messages.createError('error.targetOrgOrSourceDirRequired');
60
+ }
61
+ let source;
62
+ let records;
63
+ if (targetOrg) {
64
+ const connection = targetOrg.getConnection(flags['api-version']);
65
+ source = targetOrg.getUsername() ?? 'org';
66
+ this.spinner.start(messages.getMessage('info.queryingOrg', [source]));
67
+ let scanResult;
68
+ try {
69
+ scanResult = await scanOrgFieldSetInclusions(connection);
70
+ }
71
+ catch (error) {
72
+ this.spinner.stop();
73
+ throw messages.createError('error.orgQueryFailed', [error.message]);
74
+ }
75
+ this.spinner.stop();
76
+ if (scanResult.missing) {
77
+ throw messages.createError('error.at4dxNotDetected');
78
+ }
79
+ records = scanResult.records;
80
+ }
81
+ else {
82
+ source = 'local';
83
+ this.spinner.start(messages.getMessage('info.scanningLocalSource'));
84
+ try {
85
+ ({ records } = scanLocalFieldSetInclusions(sourceDirs));
86
+ }
87
+ catch (error) {
88
+ this.spinner.stop();
89
+ throw messages.createError('error.localScanFailed', [error.message]);
90
+ }
91
+ this.spinner.stop();
92
+ if (records.length === 0) {
93
+ throw messages.createError('error.at4dxNotDetected');
94
+ }
95
+ }
96
+ this.table({
97
+ data: records.map(toDisplayRow),
98
+ columns: [
99
+ { key: 'developerName', name: 'DEVELOPER NAME' },
100
+ { key: 'sobject', name: 'SOBJECT' },
101
+ { key: 'fieldsetName', name: 'FIELDSET NAME' },
102
+ { key: 'active', name: 'ACTIVE' },
103
+ { key: 'source', name: 'SOURCE' },
104
+ ],
105
+ });
106
+ this.info(messages.getMessage('info.complete', [records.length, source]));
107
+ return { source, records };
108
+ }
109
+ }
110
+ //# sourceMappingURL=list.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list.js","sourceRoot":"","sources":["../../../../../../src/commands/simply/aep/at4dx/field-set-inclusion/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,2BAA2B,EAC3B,yBAAyB,GAG1B,MAAM,2BAA2B,CAAC;AAEnC,QAAQ,CAAC,kCAAkC,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC7D,MAAM,QAAQ,GAAG,QAAQ,CAAC,YAAY,CAAC,sBAAsB,EAAE,2CAA2C,CAAC,CAAC;AAW5G,SAAS,YAAY,CAAC,MAAkC;IACtD,OAAO;QACL,aAAa,EAAE,MAAM,CAAC,aAAa;QACnC,OAAO,EAAE,MAAM,CAAC,OAAO;QACvB,YAAY,EAAE,MAAM,CAAC,YAAY;QACjC,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC;QAC/B,MAAM,EAAE,MAAM,CAAC,MAAM;KACtB,CA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CAAC;YAClF,CAAC;YACD,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;YAEpB,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBACzB,MAAM,QAAQ,CAAC,WAAW,CAAC,wBAAwB,CAAC,CAAC;YACvD,CAAC;QACH,CAAC;QAED,IAAI,CAAC,KAAK,CAAC;YACT,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC;YAC/B,OAAO,EAAE;gBACP,EAAE,GAAG,EAAE,eAAe,EAAE,IAAI,EAAE,gBAAgB,EAAE;gBAChD,EAAE,GAAG,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE;gBACnC,EAAE,GAAG,EAAE,cAAc,EAAE,IAAI,EAAE,eAAe,EAAE;gBAC9C,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,27 @@
1
+ import { SfCommand } from '@salesforce/sf-plugins-core';
2
+ import { type At4dxFieldSetInclusionUpdateResult } from '@simplysf/simply-aep-core';
3
+ /**
4
+ * Updates an existing AT4DX Selector field set inclusion (`SelectorConfig_FieldSetInclusion__mdt`) in
5
+ * local DX source and/or a connected org — only the fields given change; everything else, including
6
+ * which SObject reference field it uses, is preserved from the found record.
7
+ */
8
+ export default class At4dxFieldSetInclusionUpdate extends SfCommand<At4dxFieldSetInclusionUpdateResult> {
9
+ static readonly summary: string;
10
+ static readonly description: string;
11
+ static readonly examples: string[];
12
+ static readonly flags: {
13
+ 'source-dir': import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
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
+ wait: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
17
+ 'developer-name': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
18
+ label: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
19
+ sobject: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
20
+ 'sobject-alternate': import("@oclif/core/interfaces").BooleanFlag<boolean>;
21
+ 'fieldset-name': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
22
+ active: import("@oclif/core/interfaces").BooleanFlag<boolean>;
23
+ force: import("@oclif/core/interfaces").BooleanFlag<boolean>;
24
+ 'flags-dir': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
25
+ };
26
+ run(): Promise<At4dxFieldSetInclusionUpdateResult>;
27
+ }
@@ -0,0 +1,109 @@
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 { Duration } from '@salesforce/kit';
17
+ import { Messages } from '@salesforce/core';
18
+ import { SfCommand, Flags } from '@salesforce/sf-plugins-core';
19
+ import { updateFieldSetInclusion, } from '@simplysf/simply-aep-core';
20
+ import { toFieldSetInclusionCliError } from '../../../../../common/fieldSetInclusionWriteError.js';
21
+ Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
22
+ const messages = Messages.loadMessages('@simplysf/simply-aep', 'simply.aep.at4dx.field-set-inclusion.update');
23
+ const ISSUE_TABLE_COLUMNS = [
24
+ { key: 'severity', name: 'SEVERITY' },
25
+ { key: 'rule', name: 'RULE' },
26
+ { key: 'message', name: 'MESSAGE' },
27
+ ];
28
+ function toIssueDisplayRow(issue) {
29
+ return { severity: issue.severity, rule: issue.rule, message: issue.message };
30
+ }
31
+ /**
32
+ * Updates an existing AT4DX Selector field set inclusion (`SelectorConfig_FieldSetInclusion__mdt`) in
33
+ * local DX source and/or a connected org — only the fields given change; everything else, including
34
+ * which SObject reference field it uses, is preserved from the found record.
35
+ */
36
+ export default class At4dxFieldSetInclusionUpdate extends SfCommand {
37
+ static summary = messages.getMessage('summary');
38
+ static description = messages.getMessage('description');
39
+ static examples = messages.getMessages('examples');
40
+ static flags = {
41
+ ...SfCommand.baseFlags,
42
+ 'source-dir': Flags.directory({
43
+ summary: messages.getMessage('flags.source-dir.summary'),
44
+ char: 'd',
45
+ exists: true,
46
+ multiple: true,
47
+ }),
48
+ 'target-org': Flags.optionalOrg({
49
+ summary: messages.getMessage('flags.target-org.summary'),
50
+ char: 'o',
51
+ }),
52
+ 'api-version': Flags.orgApiVersion(),
53
+ wait: Flags.string({ summary: messages.getMessage('flags.wait.summary'), default: '33' }),
54
+ 'developer-name': Flags.string({
55
+ summary: messages.getMessage('flags.developer-name.summary'),
56
+ char: 'n',
57
+ required: true,
58
+ }),
59
+ label: Flags.string({ summary: messages.getMessage('flags.label.summary') }),
60
+ sobject: Flags.string({ summary: messages.getMessage('flags.sobject.summary'), char: 's' }),
61
+ 'sobject-alternate': Flags.boolean({
62
+ summary: messages.getMessage('flags.sobject-alternate.summary'),
63
+ allowNo: true,
64
+ }),
65
+ 'fieldset-name': Flags.string({
66
+ summary: messages.getMessage('flags.fieldset-name.summary'),
67
+ char: 'f',
68
+ }),
69
+ active: Flags.boolean({
70
+ summary: messages.getMessage('flags.active.summary'),
71
+ allowNo: true,
72
+ }),
73
+ force: Flags.boolean({ summary: messages.getMessage('flags.force.summary'), default: false }),
74
+ };
75
+ async run() {
76
+ const { flags } = await this.parse(At4dxFieldSetInclusionUpdate);
77
+ const sourceDirs = flags['source-dir'] ?? [];
78
+ const targetOrg = flags['target-org'];
79
+ if (sourceDirs.length === 0 && !targetOrg) {
80
+ throw messages.createError('error.sourceDirOrTargetOrgRequired');
81
+ }
82
+ const connection = targetOrg?.getConnection(flags['api-version']);
83
+ try {
84
+ const result = await updateFieldSetInclusion({
85
+ developerName: flags['developer-name'],
86
+ label: flags.label,
87
+ sobject: flags.sobject,
88
+ sobjectAlternate: flags['sobject-alternate'],
89
+ fieldsetName: flags['fieldset-name'],
90
+ isActive: flags.active,
91
+ force: flags.force,
92
+ }, { sourceDirs, connection, wait: Duration.minutes(Number(flags.wait)) });
93
+ if (result.issues.length > 0) {
94
+ this.table({ data: result.issues.map(toIssueDisplayRow), columns: ISSUE_TABLE_COLUMNS });
95
+ }
96
+ this.info(messages.getMessage(result.filePath ? 'info.updated' : 'info.updatedInOrg', [result.developerName]));
97
+ if (result.deploy) {
98
+ this.info(messages.getMessage('info.deployed', [result.deploy.id]));
99
+ }
100
+ return result;
101
+ }
102
+ catch (error) {
103
+ throw toFieldSetInclusionCliError(error, messages, (issues) => {
104
+ this.table({ data: issues.map(toIssueDisplayRow), columns: ISSUE_TABLE_COLUMNS });
105
+ });
106
+ }
107
+ }
108
+ }
109
+ //# sourceMappingURL=update.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update.js","sourceRoot":"","sources":["../../../../../../src/commands/simply/aep/at4dx/field-set-inclusion/update.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAc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AAK,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,iBAAiB,CAAC,EAAE,OAAO,EAAE,mBAAmB,EAAE,CAAC,CAAC;YAC3F,CAAC;YACD,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,mBAAmB,EAAE,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;YAC/G,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC;gBAClB,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,eAAe,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;YACtE,CAAC;YAED,OAAO,MAAM,CAAC;QAChB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,2BAA2B,CAAC,KAAK,EAAE,QAAQ,EAAE,CAAC,MAAM,EAAE,EAAE;gBAC5D,IAAI,CAAC,KAAK,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,GAAG,CAAC,iBAAiB,CAAC,EAAE,OAAO,EAAE,mBAAmB,EAAE,CAAC,CAAC;YACpF,CAAC,CAAC,CAAC;QACL,CAAC;IACH,CAAC"}
@@ -0,0 +1,21 @@
1
+ import { SfCommand } from '@salesforce/sf-plugins-core';
2
+ import { type At4dxFieldSetInclusionValidateResult } from '@simplysf/simply-aep-core';
3
+ /**
4
+ * Validates the AT4DX Selector field set inclusions (`SelectorConfig_FieldSetInclusion__mdt`)
5
+ * configured in a target org or local DX source — wiring problems that are invisible to
6
+ * `field-set-inclusion list` — and fails (non-zero exit) when any of them is a real bug, for use as a
7
+ * CI gate.
8
+ */
9
+ export default class At4dxFieldSetInclusionValidate extends SfCommand<At4dxFieldSetInclusionValidateResult> {
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 validation issues found for the requested source. Sets `process.exitCode = 1` when any issue is severity `error`. */
20
+ run(): Promise<At4dxFieldSetInclusionValidateResult>;
21
+ }
@@ -0,0 +1,129 @@
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 { scanLocalFieldSetInclusions, scanOrgFieldSetInclusions, validateFieldSetInclusions, } from '@simplysf/simply-aep-core';
19
+ Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
20
+ const messages = Messages.loadMessages('@simplysf/simply-aep', 'simply.aep.at4dx.field-set-inclusion.validate');
21
+ function toDisplayRow(issue) {
22
+ return {
23
+ severity: issue.severity,
24
+ rule: issue.rule,
25
+ sobject: issue.sobject ?? '',
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: 'sobject', name: 'SOBJECT' },
35
+ { key: 'developerName', name: 'DEVELOPER NAME' },
36
+ { key: 'source', name: 'SOURCE' },
37
+ { key: 'message', name: 'MESSAGE' },
38
+ ];
39
+ /**
40
+ * Validates the AT4DX Selector field set inclusions (`SelectorConfig_FieldSetInclusion__mdt`)
41
+ * configured in a target org or local DX source — wiring problems that are invisible to
42
+ * `field-set-inclusion list` — and fails (non-zero exit) when any of them is a real bug, for use as a
43
+ * CI gate.
44
+ */
45
+ export default class At4dxFieldSetInclusionValidate extends SfCommand {
46
+ static summary = messages.getMessage('summary');
47
+ static description = messages.getMessage('description');
48
+ static examples = messages.getMessages('examples');
49
+ static flags = {
50
+ ...SfCommand.baseFlags,
51
+ 'target-org': Flags.optionalOrg({
52
+ summary: messages.getMessage('flags.target-org.summary'),
53
+ char: 'o',
54
+ }),
55
+ 'api-version': Flags.orgApiVersion(),
56
+ 'source-dir': Flags.directory({
57
+ summary: messages.getMessage('flags.source-dir.summary'),
58
+ char: 'd',
59
+ exists: true,
60
+ multiple: true,
61
+ }),
62
+ };
63
+ /** @returns The validation issues found for the requested source. Sets `process.exitCode = 1` when any issue is severity `error`. */
64
+ async run() {
65
+ const { flags } = await this.parse(At4dxFieldSetInclusionValidate);
66
+ const targetOrg = flags['target-org'];
67
+ const sourceDirs = flags['source-dir'] ?? [];
68
+ if ((targetOrg && sourceDirs.length > 0) || (!targetOrg && sourceDirs.length === 0)) {
69
+ throw messages.createError('error.targetOrgOrSourceDirRequired');
70
+ }
71
+ let source;
72
+ let recordCount;
73
+ let issues;
74
+ if (targetOrg) {
75
+ const connection = targetOrg.getConnection(flags['api-version']);
76
+ source = targetOrg.getUsername() ?? 'org';
77
+ this.spinner.start(messages.getMessage('info.queryingOrg', [source]));
78
+ let scanResult;
79
+ try {
80
+ scanResult = await scanOrgFieldSetInclusions(connection);
81
+ }
82
+ catch (error) {
83
+ this.spinner.stop();
84
+ throw messages.createError('error.orgQueryFailed', [error.message]);
85
+ }
86
+ this.spinner.stop();
87
+ if (scanResult.missing) {
88
+ throw messages.createError('error.at4dxNotDetected');
89
+ }
90
+ recordCount = scanResult.records.length;
91
+ issues = validateFieldSetInclusions(scanResult.records, {
92
+ malformed: scanResult.malformed,
93
+ ambiguous: scanResult.ambiguous,
94
+ });
95
+ }
96
+ else {
97
+ source = 'local';
98
+ this.spinner.start(messages.getMessage('info.scanningLocalSource'));
99
+ let scanResult;
100
+ try {
101
+ scanResult = scanLocalFieldSetInclusions(sourceDirs);
102
+ }
103
+ catch (error) {
104
+ this.spinner.stop();
105
+ throw messages.createError('error.localScanFailed', [error.message]);
106
+ }
107
+ this.spinner.stop();
108
+ if (scanResult.records.length === 0 && scanResult.malformed.length === 0) {
109
+ throw messages.createError('error.at4dxNotDetected');
110
+ }
111
+ recordCount = scanResult.records.length;
112
+ issues = validateFieldSetInclusions(scanResult.records, {
113
+ malformed: scanResult.malformed,
114
+ ambiguous: scanResult.ambiguous,
115
+ });
116
+ }
117
+ if (issues.length > 0) {
118
+ this.table({ data: issues.map(toDisplayRow), columns: ISSUE_TABLE_COLUMNS });
119
+ }
120
+ else {
121
+ this.info(messages.getMessage('info.valid', [recordCount, source]));
122
+ }
123
+ if (issues.some((issue) => issue.severity === 'error')) {
124
+ process.exitCode = 1;
125
+ }
126
+ return { source, recordCount, issues };
127
+ }
128
+ }
129
+ //# sourceMappingURL=validate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validate.js","sourceRoot":"","sources":["../../../../../../src/commands/simply/aep/at4dx/field-set-inclusion/validate.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,2BAA2B,EAC3B,yBAAyB,EACzB,0BAA0B,GAG3B,MAAM,2BAA2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AAE,CAAC;gBACzE,MAAM,QAAQ,CAAC,WAAW,CAAC,wBAAwB,CAAC,CAAC;YACvD,CAAC;YAED,WAAW,GAAG,UAAU,CAAC,OAAO,CAAC,MAAM,CAAC;YACxC,MAAM,GAAG,0BAA0B,CAAC,UAAU,CAAC,OAAO,EAAE;gBACtD,SAAS,EAAE,UAAU,CAAC,SAAS;gBAC/B,SAAS,EAAE,UAAU,CAAC,SAAS;aAChC,CAAC,CAAC;QACL,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,14 @@
1
+ import type { Messages } from '@salesforce/core';
2
+ import { type BindingIssue } from '@simplysf/simply-aep-core';
3
+ /**
4
+ * Maps a `BindingWriteError` thrown by `createBinding`/`updateBinding` onto the calling command's own
5
+ * `error.*` message keys, shared by `create.ts`/`update.ts` since both throw the same error type for the
6
+ * same set of codes. Mirrors `domainProcessBindingWriteError.ts`'s `toDomainProcessBindingCliError` —
7
+ * see docs/design/0015-at4dx-binding-validate-create-set.md.
8
+ *
9
+ * @param error - Whatever `createBinding`/`updateBinding` rejected with.
10
+ * @param messages - The calling command's own loaded message catalog.
11
+ * @param printIssues - Renders a validation issue table (the command's own `this.table`-based printer).
12
+ * @returns An `Error` ready to throw from the command's `run()` — an `SfError` built from a message key when `error` is a recognized `BindingWriteError`, or `error` itself (coerced to `Error`) otherwise.
13
+ */
14
+ export declare function toBindingCliError(error: unknown, messages: Messages<string>, printIssues: (issues: BindingIssue[]) => void): Error;
@@ -0,0 +1,58 @@
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 { BindingWriteError } from '@simplysf/simply-aep-core';
17
+ /**
18
+ * Maps a `BindingWriteError` thrown by `createBinding`/`updateBinding` onto the calling command's own
19
+ * `error.*` message keys, shared by `create.ts`/`update.ts` since both throw the same error type for the
20
+ * same set of codes. Mirrors `domainProcessBindingWriteError.ts`'s `toDomainProcessBindingCliError` —
21
+ * see docs/design/0015-at4dx-binding-validate-create-set.md.
22
+ *
23
+ * @param error - Whatever `createBinding`/`updateBinding` rejected with.
24
+ * @param messages - The calling command's own loaded message catalog.
25
+ * @param printIssues - Renders a validation issue table (the command's own `this.table`-based printer).
26
+ * @returns An `Error` ready to throw from the command's `run()` — an `SfError` built from a message key when `error` is a recognized `BindingWriteError`, or `error` itself (coerced to `Error`) otherwise.
27
+ */
28
+ export function toBindingCliError(error, messages, printIssues) {
29
+ if (!(error instanceof BindingWriteError)) {
30
+ return error instanceof Error ? error : new Error(String(error));
31
+ }
32
+ switch (error.code) {
33
+ case 'source-or-target-required':
34
+ return messages.createError('error.sourceDirOrTargetOrgRequired');
35
+ case 'type-field-mismatch':
36
+ return messages.createError('error.typeFieldMismatch', [error.message]);
37
+ case 'invalid-developer-name':
38
+ return messages.createError('error.invalidDeveloperName', [error.message]);
39
+ case 'label-too-long':
40
+ return messages.createError('error.labelTooLong', [error.message]);
41
+ case 'developer-name-already-exists':
42
+ return messages.createError('error.developerNameAlreadyExists', [error.message]);
43
+ case 'developer-name-not-found':
44
+ return messages.createError('error.developerNameNotFound', [error.message]);
45
+ case 'no-fields-to-update':
46
+ return messages.createError('error.noFieldsToUpdate');
47
+ case 'at4dx-not-detected':
48
+ return messages.createError('error.at4dxNotDetected', [error.message]);
49
+ case 'validation-failed':
50
+ printIssues(error.issues ?? []);
51
+ return messages.createError('error.validationFailed');
52
+ case 'deploy-failed':
53
+ return messages.createError('error.deployFailed', [error.message]);
54
+ default:
55
+ return error;
56
+ }
57
+ }
58
+ //# sourceMappingURL=bindingWriteError.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bindingWriteError.js","sourceRoot":"","sources":["../../src/common/bindingWriteError.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,EAAE,iBAAiB,EAAqB,MAAM,2BAA2B,CAAC;AAEjF;;;;;;;;;;GAUG;AACH,MAAM,UAAU,iBAAiB,CAC/B,KAAc,EACd,QAA0B,EAC1B,WAA6C;IAE7C,IAAI,CAAC,CAAC,KAAK,YAAY,iBAAiB,CAAC,EAAE,CAAC;QAC1C,OAAO,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;IACnE,CAAC;IAED,QAAQ,KAAK,CAAC,IAAI,EAAE,CAAC;QACnB,KAAK,2BAA2B;YAC9B,OAAO,QAAQ,CAAC,WAAW,CAAC,oCAAoC,CAAC,CAAC;QACpE,KAAK,qBAAqB;YACxB,OAAO,QAAQ,CAAC,WAAW,CAAC,yBAAyB,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;QAC1E,KAAK,wBAAwB;YAC3B,OAAO,QAAQ,CAAC,WAAW,CAAC,4BAA4B,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;QAC7E,KAAK,gBAAgB;YACnB,OAAO,QAAQ,CAAC,WAAW,CAAC,oBAAoB,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;QACrE,KAAK,+BAA+B;YAClC,OAAO,QAAQ,CAAC,WAAW,CAAC,kCAAkC,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;QACnF,KAAK,0BAA0B;YAC7B,OAAO,QAAQ,CAAC,WAAW,CAAC,6BAA6B,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;QAC9E,KAAK,qBAAqB;YACxB,OAAO,QAAQ,CAAC,WAAW,CAAC,wBAAwB,CAAC,CAAC;QACxD,KAAK,oBAAoB;YACvB,OAAO,QAAQ,CAAC,WAAW,CAAC,wBAAwB,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;QACzE,KAAK,mBAAmB;YACtB,WAAW,CAAC,KAAK,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC;YAChC,OAAO,QAAQ,CAAC,WAAW,CAAC,wBAAwB,CAAC,CAAC;QACxD,KAAK,eAAe;YAClB,OAAO,QAAQ,CAAC,WAAW,CAAC,oBAAoB,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;QACrE;YACE,OAAO,KAAK,CAAC;IACjB,CAAC;AACH,CAAC"}
@@ -0,0 +1,14 @@
1
+ import type { Messages } from '@salesforce/core';
2
+ import { type FieldSetInclusionIssue } from '@simplysf/simply-aep-core';
3
+ /**
4
+ * Maps a `FieldSetInclusionWriteError` thrown by `createFieldSetInclusion`/`updateFieldSetInclusion`
5
+ * onto the calling command's own `error.*` message keys, shared by `create.ts`/`update.ts` since both
6
+ * throw the same error type for the same set of codes. Mirrors `bindingWriteError.ts`'s
7
+ * `toBindingCliError` — see docs/design/0016-at4dx-selector-config-field-set-inclusion.md.
8
+ *
9
+ * @param error - Whatever `createFieldSetInclusion`/`updateFieldSetInclusion` rejected with.
10
+ * @param messages - The calling command's own loaded message catalog.
11
+ * @param printIssues - Renders a validation issue table (the command's own `this.table`-based printer).
12
+ * @returns An `Error` ready to throw from the command's `run()` — an `SfError` built from a message key when `error` is a recognized `FieldSetInclusionWriteError`, or `error` itself (coerced to `Error`) otherwise.
13
+ */
14
+ export declare function toFieldSetInclusionCliError(error: unknown, messages: Messages<string>, printIssues: (issues: FieldSetInclusionIssue[]) => void): Error;
@@ -0,0 +1,56 @@
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 { FieldSetInclusionWriteError } from '@simplysf/simply-aep-core';
17
+ /**
18
+ * Maps a `FieldSetInclusionWriteError` thrown by `createFieldSetInclusion`/`updateFieldSetInclusion`
19
+ * onto the calling command's own `error.*` message keys, shared by `create.ts`/`update.ts` since both
20
+ * throw the same error type for the same set of codes. Mirrors `bindingWriteError.ts`'s
21
+ * `toBindingCliError` — see docs/design/0016-at4dx-selector-config-field-set-inclusion.md.
22
+ *
23
+ * @param error - Whatever `createFieldSetInclusion`/`updateFieldSetInclusion` rejected with.
24
+ * @param messages - The calling command's own loaded message catalog.
25
+ * @param printIssues - Renders a validation issue table (the command's own `this.table`-based printer).
26
+ * @returns An `Error` ready to throw from the command's `run()` — an `SfError` built from a message key when `error` is a recognized `FieldSetInclusionWriteError`, or `error` itself (coerced to `Error`) otherwise.
27
+ */
28
+ export function toFieldSetInclusionCliError(error, messages, printIssues) {
29
+ if (!(error instanceof FieldSetInclusionWriteError)) {
30
+ return error instanceof Error ? error : new Error(String(error));
31
+ }
32
+ switch (error.code) {
33
+ case 'source-or-target-required':
34
+ return messages.createError('error.sourceDirOrTargetOrgRequired');
35
+ case 'invalid-developer-name':
36
+ return messages.createError('error.invalidDeveloperName', [error.message]);
37
+ case 'label-too-long':
38
+ return messages.createError('error.labelTooLong', [error.message]);
39
+ case 'developer-name-already-exists':
40
+ return messages.createError('error.developerNameAlreadyExists', [error.message]);
41
+ case 'developer-name-not-found':
42
+ return messages.createError('error.developerNameNotFound', [error.message]);
43
+ case 'no-fields-to-update':
44
+ return messages.createError('error.noFieldsToUpdate');
45
+ case 'at4dx-not-detected':
46
+ return messages.createError('error.at4dxNotDetected', [error.message]);
47
+ case 'validation-failed':
48
+ printIssues(error.issues ?? []);
49
+ return messages.createError('error.validationFailed');
50
+ case 'deploy-failed':
51
+ return messages.createError('error.deployFailed', [error.message]);
52
+ default:
53
+ return error;
54
+ }
55
+ }
56
+ //# sourceMappingURL=fieldSetInclusionWriteError.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fieldSetInclusionWriteError.js","sourceRoot":"","sources":["../../src/common/fieldSetInclusionWriteError.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,EAAE,2BAA2B,EAA+B,MAAM,2BAA2B,CAAC;AAErG;;;;;;;;;;GAUG;AACH,MAAM,UAAU,2BAA2B,CACzC,KAAc,EACd,QAA0B,EAC1B,WAAuD;IAEvD,IAAI,CAAC,CAAC,KAAK,YAAY,2BAA2B,CAAC,EAAE,CAAC;QACpD,OAAO,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;IACnE,CAAC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