@simplysf/simply-aep 0.6.1 → 0.8.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.
@@ -0,0 +1,28 @@
1
+ import { SfCommand } from '@salesforce/sf-plugins-core';
2
+ import { type At4dxBindingCreateResult, type WritableBindingTypeFlag } from '@simplysf/simply-aep-core';
3
+ /**
4
+ * Creates a new AT4DX Application Factory binding (Service/Selector/Domain) in local DX source and/or a
5
+ * connected org, validating it against everything already scanned of the same type before writing.
6
+ */
7
+ export default class At4dxBindingCreate extends SfCommand<At4dxBindingCreateResult> {
8
+ static readonly summary: string;
9
+ static readonly description: string;
10
+ static readonly examples: string[];
11
+ static readonly flags: {
12
+ 'source-dir': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
13
+ 'target-org': import("@oclif/core/interfaces").OptionFlag<import("@salesforce/core").Org, import("@oclif/core/interfaces").CustomOptions>;
14
+ 'api-version': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
15
+ wait: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
16
+ type: import("@oclif/core/interfaces").OptionFlag<WritableBindingTypeFlag, 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
+ to: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
20
+ 'binding-interface': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
21
+ sobject: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
22
+ 'sobject-alternate': import("@oclif/core/interfaces").BooleanFlag<boolean>;
23
+ priority: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
24
+ force: import("@oclif/core/interfaces").BooleanFlag<boolean>;
25
+ 'flags-dir': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
26
+ };
27
+ run(): Promise<At4dxBindingCreateResult>;
28
+ }
@@ -0,0 +1,116 @@
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 { createBinding, WRITABLE_BINDING_TYPE_BY_FLAG, } from '@simplysf/simply-aep-core';
20
+ import { toBindingCliError } from '../../../../../common/bindingWriteError.js';
21
+ Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
22
+ const messages = Messages.loadMessages('@simplysf/simply-aep', 'simply.aep.at4dx.binding.create');
23
+ const WRITABLE_TYPE_OPTIONS = ['service', 'selector', 'domain'];
24
+ const ISSUE_TABLE_COLUMNS = [
25
+ { key: 'severity', name: 'SEVERITY' },
26
+ { key: 'rule', name: 'RULE' },
27
+ { key: 'message', name: 'MESSAGE' },
28
+ ];
29
+ function toIssueDisplayRow(issue) {
30
+ return { severity: issue.severity, rule: issue.rule, message: issue.message };
31
+ }
32
+ /**
33
+ * Creates a new AT4DX Application Factory binding (Service/Selector/Domain) in local DX source and/or a
34
+ * connected org, validating it against everything already scanned of the same type before writing.
35
+ */
36
+ export default class At4dxBindingCreate 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
+ }),
46
+ 'target-org': Flags.optionalOrg({
47
+ summary: messages.getMessage('flags.target-org.summary'),
48
+ char: 'o',
49
+ }),
50
+ 'api-version': Flags.orgApiVersion(),
51
+ wait: Flags.string({ summary: messages.getMessage('flags.wait.summary'), default: '33' }),
52
+ type: Flags.custom({ options: WRITABLE_TYPE_OPTIONS })({
53
+ summary: messages.getMessage('flags.type.summary'),
54
+ char: 't',
55
+ required: true,
56
+ }),
57
+ 'developer-name': Flags.string({
58
+ summary: messages.getMessage('flags.developer-name.summary'),
59
+ char: 'n',
60
+ required: true,
61
+ }),
62
+ label: Flags.string({ summary: messages.getMessage('flags.label.summary') }),
63
+ to: Flags.string({ summary: messages.getMessage('flags.to.summary'), char: 'c', required: true }),
64
+ 'binding-interface': Flags.string({ summary: messages.getMessage('flags.binding-interface.summary') }),
65
+ sobject: Flags.string({ summary: messages.getMessage('flags.sobject.summary'), char: 's' }),
66
+ 'sobject-alternate': Flags.boolean({
67
+ summary: messages.getMessage('flags.sobject-alternate.summary'),
68
+ allowNo: true,
69
+ }),
70
+ priority: Flags.string({ summary: messages.getMessage('flags.priority.summary') }),
71
+ force: Flags.boolean({ summary: messages.getMessage('flags.force.summary'), default: false }),
72
+ };
73
+ async run() {
74
+ const { flags } = await this.parse(At4dxBindingCreate);
75
+ const sourceDir = flags['source-dir'];
76
+ const targetOrg = flags['target-org'];
77
+ if (!sourceDir && !targetOrg) {
78
+ throw messages.createError('error.sourceDirOrTargetOrgRequired');
79
+ }
80
+ let priority;
81
+ if (flags.priority !== undefined) {
82
+ priority = Number(flags.priority);
83
+ if (Number.isNaN(priority)) {
84
+ throw messages.createError('error.invalidPriority', [flags.priority]);
85
+ }
86
+ }
87
+ const connection = targetOrg?.getConnection(flags['api-version']);
88
+ try {
89
+ const result = await createBinding({
90
+ bindingType: WRITABLE_BINDING_TYPE_BY_FLAG[flags.type],
91
+ developerName: flags['developer-name'],
92
+ label: flags.label,
93
+ to: flags.to,
94
+ bindingInterface: flags['binding-interface'],
95
+ sobject: flags.sobject,
96
+ sobjectAlternate: flags['sobject-alternate'],
97
+ priority,
98
+ force: flags.force,
99
+ }, { sourceDir, connection, wait: Duration.minutes(Number(flags.wait)) });
100
+ if (result.issues.length > 0) {
101
+ this.table({ data: result.issues.map(toIssueDisplayRow), columns: ISSUE_TABLE_COLUMNS });
102
+ }
103
+ this.info(messages.getMessage(result.filePath ? 'info.created' : 'info.createdInOrg', [result.developerName]));
104
+ if (result.deploy) {
105
+ this.info(messages.getMessage('info.deployed', [result.deploy.id]));
106
+ }
107
+ return result;
108
+ }
109
+ catch (error) {
110
+ throw toBindingCliError(error, messages, (issues) => {
111
+ this.table({ data: issues.map(toIssueDisplayRow), columns: ISSUE_TABLE_COLUMNS });
112
+ });
113
+ }
114
+ }
115
+ }
116
+ //# sourceMappingURL=create.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create.js","sourceRoot":"","sources":["../../../../../../src/commands/simply/aep/at4dx/binding/create.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EACL,aAAa,EACb,6BAA6B,GAI9B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,iBAAiB,EAAE,MAAM,4CAA4C,CAAC;AAE/E,QAAQ,CAAC,kCAAkC,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC7D,MAAM,QAAQ,GAAG,QAAQ,CAAC,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let records;
103
103
  try {
104
- records = scanLocalBindings(sourceDirs, requestedTypes);
104
+ ({ records } = scanLocalBindings(sourceDirs, requestedTypes));
105
105
  }
106
106
  catch (error) {
107
107
  this.spinner.stop();
@@ -1 +1 @@
1
- {"version":3,"file":"list.js","sourceRoot":"","sources":["../../../../../../src/commands/simply/aep/at4dx/binding/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,iBAAiB,EACjB,oBAAoB,EACpB,eAAe,EACf,iBAAiB,EACjB,eAAe,GAKhB,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,+BAA+B,CAAC,CAAC;AAEhG,MAAM,yBAAyB,GAAsB,CAAC,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,cAAc,CAAC,CAAC;AAYvG,SAAS,YAAY,CAAC,GAAoB;IACxC,MAAM,KAAK,GAAG,GAAG,CAAC,QAAQ,IAAI,GAAG,CAAC,QAAQ,CAAC;IAE3C,OAAO;QACL,WAAW,EAAE,GAAG,CAAC,WAAW;QAC5B,GAAG,EAAE,GAAG,CAAC,GAAG;QACZ,EAAE,EAAE,GAAG,CAAC,EAAE,IAAI,EAAE;QAChB,KAAK,EAAE,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;QAC/C,SAAS,EAAE,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,SAAS,CAAC;QAC9D,MAAM,EAAE,GAAG,CAAC,MAAM;K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At4dxBindingUpdateResult, type WritableBindingTypeFlag } from '@simplysf/simply-aep-core';
3
+ /**
4
+ * Updates an existing AT4DX Application Factory binding (Service/Selector/Domain) in local DX source
5
+ * and/or a connected org — only the fields given change; everything else, including which SObject
6
+ * reference field a Selector/Domain binding uses, is preserved from the found record.
7
+ */
8
+ export default class At4dxBindingUpdate extends SfCommand<At4dxBindingUpdateResult> {
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
+ type: import("@oclif/core/interfaces").OptionFlag<WritableBindingTypeFlag, import("@oclif/core/interfaces").CustomOptions>;
18
+ 'developer-name': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
19
+ label: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
20
+ to: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
21
+ 'binding-interface': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
22
+ sobject: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
23
+ 'sobject-alternate': import("@oclif/core/interfaces").BooleanFlag<boolean>;
24
+ priority: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
25
+ force: import("@oclif/core/interfaces").BooleanFlag<boolean>;
26
+ 'flags-dir': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
27
+ };
28
+ run(): Promise<At4dxBindingUpdateResult>;
29
+ }
@@ -0,0 +1,119 @@
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 { updateBinding, WRITABLE_BINDING_TYPE_BY_FLAG, } from '@simplysf/simply-aep-core';
20
+ import { toBindingCliError } from '../../../../../common/bindingWriteError.js';
21
+ Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
22
+ const messages = Messages.loadMessages('@simplysf/simply-aep', 'simply.aep.at4dx.binding.update');
23
+ const WRITABLE_TYPE_OPTIONS = ['service', 'selector', 'domain'];
24
+ const ISSUE_TABLE_COLUMNS = [
25
+ { key: 'severity', name: 'SEVERITY' },
26
+ { key: 'rule', name: 'RULE' },
27
+ { key: 'message', name: 'MESSAGE' },
28
+ ];
29
+ function toIssueDisplayRow(issue) {
30
+ return { severity: issue.severity, rule: issue.rule, message: issue.message };
31
+ }
32
+ /**
33
+ * Updates an existing AT4DX Application Factory binding (Service/Selector/Domain) in local DX source
34
+ * and/or a connected org — only the fields given change; everything else, including which SObject
35
+ * reference field a Selector/Domain binding uses, is preserved from the found record.
36
+ */
37
+ export default class At4dxBindingUpdate extends SfCommand {
38
+ static summary = messages.getMessage('summary');
39
+ static description = messages.getMessage('description');
40
+ static examples = messages.getMessages('examples');
41
+ static flags = {
42
+ ...SfCommand.baseFlags,
43
+ 'source-dir': Flags.directory({
44
+ summary: messages.getMessage('flags.source-dir.summary'),
45
+ char: 'd',
46
+ exists: true,
47
+ multiple: true,
48
+ }),
49
+ 'target-org': Flags.optionalOrg({
50
+ summary: messages.getMessage('flags.target-org.summary'),
51
+ char: 'o',
52
+ }),
53
+ 'api-version': Flags.orgApiVersion(),
54
+ wait: Flags.string({ summary: messages.getMessage('flags.wait.summary'), default: '33' }),
55
+ type: Flags.custom({ options: WRITABLE_TYPE_OPTIONS })({
56
+ summary: messages.getMessage('flags.type.summary'),
57
+ char: 't',
58
+ required: true,
59
+ }),
60
+ 'developer-name': Flags.string({
61
+ summary: messages.getMessage('flags.developer-name.summary'),
62
+ char: 'n',
63
+ required: true,
64
+ }),
65
+ label: Flags.string({ summary: messages.getMessage('flags.label.summary') }),
66
+ to: Flags.string({ summary: messages.getMessage('flags.to.summary'), char: 'c' }),
67
+ 'binding-interface': Flags.string({ summary: messages.getMessage('flags.binding-interface.summary') }),
68
+ sobject: Flags.string({ summary: messages.getMessage('flags.sobject.summary'), char: 's' }),
69
+ 'sobject-alternate': Flags.boolean({
70
+ summary: messages.getMessage('flags.sobject-alternate.summary'),
71
+ allowNo: true,
72
+ }),
73
+ priority: Flags.string({ summary: messages.getMessage('flags.priority.summary') }),
74
+ force: Flags.boolean({ summary: messages.getMessage('flags.force.summary'), default: false }),
75
+ };
76
+ async run() {
77
+ const { flags } = await this.parse(At4dxBindingUpdate);
78
+ const sourceDirs = flags['source-dir'] ?? [];
79
+ const targetOrg = flags['target-org'];
80
+ if (sourceDirs.length === 0 && !targetOrg) {
81
+ throw messages.createError('error.sourceDirOrTargetOrgRequired');
82
+ }
83
+ let priority;
84
+ if (flags.priority !== undefined) {
85
+ priority = Number(flags.priority);
86
+ if (Number.isNaN(priority)) {
87
+ throw messages.createError('error.invalidPriority', [flags.priority]);
88
+ }
89
+ }
90
+ const connection = targetOrg?.getConnection(flags['api-version']);
91
+ try {
92
+ const result = await updateBinding({
93
+ bindingType: WRITABLE_BINDING_TYPE_BY_FLAG[flags.type],
94
+ developerName: flags['developer-name'],
95
+ label: flags.label,
96
+ to: flags.to,
97
+ bindingInterface: flags['binding-interface'],
98
+ sobject: flags.sobject,
99
+ sobjectAlternate: flags['sobject-alternate'],
100
+ priority,
101
+ force: flags.force,
102
+ }, { sourceDirs, connection, wait: Duration.minutes(Number(flags.wait)) });
103
+ if (result.issues.length > 0) {
104
+ this.table({ data: result.issues.map(toIssueDisplayRow), columns: ISSUE_TABLE_COLUMNS });
105
+ }
106
+ this.info(messages.getMessage(result.filePath ? 'info.updated' : 'info.updatedInOrg', [result.developerName]));
107
+ if (result.deploy) {
108
+ this.info(messages.getMessage('info.deployed', [result.deploy.id]));
109
+ }
110
+ return result;
111
+ }
112
+ catch (error) {
113
+ throw toBindingCliError(error, messages, (issues) => {
114
+ this.table({ data: issues.map(toIssueDisplayRow), columns: ISSUE_TABLE_COLUMNS });
115
+ });
116
+ }
117
+ }
118
+ }
119
+ //# sourceMappingURL=update.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update.js","sourceRoot":"","sources":["../../../../../../src/commands/simply/aep/at4dx/binding/update.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EACL,aAAa,EACb,6BAA6B,GAI9B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,iBAAiB,EAAE,MAAM,4CAA4C,CAAC;AAE/E,QAAQ,CAAC,kCAAkC,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC7D,MAAM,QAAQ,GAAG,QAAQ,CAAC,YAAY,CAAC,sBAAsB,EAAE,iCAAiC,CAAC,CAAC;AA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TypeFlag } from '@simplysf/simply-aep-core';
3
+ /**
4
+ * Validates the AT4DX Application Factory bindings (Service/Selector/Domain) configured in a target org
5
+ * or local DX source — wiring problems that are invisible to `binding list` — and fails (non-zero exit)
6
+ * when any of them is a real bug, for use as a CI gate. `UnitOfWork` records are scanned when requested
7
+ * (to keep `--type`'s meaning consistent with `list`) but never contribute issues — see
8
+ * docs/design/0015-at4dx-binding-validate-create-set.md's Problem section for why.
9
+ */
10
+ export default class At4dxBindingValidate extends SfCommand<At4dxBindingValidateResult> {
11
+ static readonly summary: string;
12
+ static readonly description: string;
13
+ static readonly examples: string[];
14
+ static readonly flags: {
15
+ 'target-org': import("@oclif/core/interfaces").OptionFlag<import("@salesforce/core").Org, import("@oclif/core/interfaces").CustomOptions>;
16
+ 'api-version': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
17
+ 'source-dir': import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
18
+ type: import("@oclif/core/interfaces").OptionFlag<BindingTypeFlag[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
19
+ 'flags-dir': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
20
+ };
21
+ /** @returns The validation issues found for the requested source and type(s). Sets `process.exitCode = 1` when any issue is severity `error`. */
22
+ run(): Promise<At4dxBindingValidateResult>;
23
+ }
@@ -0,0 +1,143 @@
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 { ALL_BINDING_TYPES, BINDING_TYPE_BY_FLAG, scanLocalBindings, scanOrgBindings, validateBindings, } from '@simplysf/simply-aep-core';
19
+ Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
20
+ const messages = Messages.loadMessages('@simplysf/simply-aep', 'simply.aep.at4dx.binding.validate');
21
+ const BINDING_TYPE_FLAG_OPTIONS = ['service', 'selector', 'domain', 'unit-of-work'];
22
+ function toDisplayRow(issue) {
23
+ return {
24
+ bindingType: issue.bindingType,
25
+ severity: issue.severity,
26
+ rule: issue.rule,
27
+ key: issue.key ?? '',
28
+ developerName: issue.developerName ?? '',
29
+ source: issue.source,
30
+ message: issue.message,
31
+ };
32
+ }
33
+ const ISSUE_TABLE_COLUMNS = [
34
+ { key: 'bindingType', name: 'TYPE' },
35
+ { key: 'severity', name: 'SEVERITY' },
36
+ { key: 'rule', name: 'RULE' },
37
+ { key: 'key', name: 'KEY' },
38
+ { key: 'developerName', name: 'DEVELOPER NAME' },
39
+ { key: 'source', name: 'SOURCE' },
40
+ { key: 'message', name: 'MESSAGE' },
41
+ ];
42
+ /**
43
+ * Validates the AT4DX Application Factory bindings (Service/Selector/Domain) configured in a target org
44
+ * or local DX source — wiring problems that are invisible to `binding list` — and fails (non-zero exit)
45
+ * when any of them is a real bug, for use as a CI gate. `UnitOfWork` records are scanned when requested
46
+ * (to keep `--type`'s meaning consistent with `list`) but never contribute issues — see
47
+ * docs/design/0015-at4dx-binding-validate-create-set.md's Problem section for why.
48
+ */
49
+ export default class At4dxBindingValidate extends SfCommand {
50
+ static summary = messages.getMessage('summary');
51
+ static description = messages.getMessage('description');
52
+ static examples = messages.getMessages('examples');
53
+ static flags = {
54
+ ...SfCommand.baseFlags,
55
+ 'target-org': Flags.optionalOrg({
56
+ summary: messages.getMessage('flags.target-org.summary'),
57
+ char: 'o',
58
+ }),
59
+ 'api-version': Flags.orgApiVersion(),
60
+ 'source-dir': Flags.directory({
61
+ summary: messages.getMessage('flags.source-dir.summary'),
62
+ char: 'd',
63
+ exists: true,
64
+ multiple: true,
65
+ }),
66
+ type: Flags.custom({ options: BINDING_TYPE_FLAG_OPTIONS })({
67
+ summary: messages.getMessage('flags.type.summary'),
68
+ description: messages.getMessage('flags.type.description'),
69
+ char: 't',
70
+ multiple: true,
71
+ delimiter: ',',
72
+ }),
73
+ };
74
+ /** @returns The validation issues found for the requested source and type(s). Sets `process.exitCode = 1` when any issue is severity `error`. */
75
+ async run() {
76
+ const { flags } = await this.parse(At4dxBindingValidate);
77
+ const targetOrg = flags['target-org'];
78
+ const sourceDirs = flags['source-dir'] ?? [];
79
+ if ((targetOrg && sourceDirs.length > 0) || (!targetOrg && sourceDirs.length === 0)) {
80
+ throw messages.createError('error.targetOrgOrSourceDirRequired');
81
+ }
82
+ const requestedTypes = flags.type?.length
83
+ ? [...new Set(flags.type.map((flag) => BINDING_TYPE_BY_FLAG[flag]))]
84
+ : ALL_BINDING_TYPES;
85
+ let source;
86
+ let issues;
87
+ let bindingCount;
88
+ if (targetOrg) {
89
+ const connection = targetOrg.getConnection(flags['api-version']);
90
+ source = targetOrg.getUsername() ?? 'org';
91
+ this.spinner.start(messages.getMessage('info.queryingOrg', [source]));
92
+ let scanResult;
93
+ try {
94
+ scanResult = await scanOrgBindings(connection, requestedTypes);
95
+ }
96
+ catch (error) {
97
+ this.spinner.stop();
98
+ throw messages.createError('error.orgQueryFailed', [error.message]);
99
+ }
100
+ this.spinner.stop();
101
+ if (scanResult.missingTypes.length === requestedTypes.length) {
102
+ throw messages.createError('error.at4dxNotDetected');
103
+ }
104
+ bindingCount = scanResult.records.length;
105
+ issues = validateBindings(scanResult.records, {
106
+ malformed: scanResult.malformed,
107
+ ambiguous: scanResult.ambiguous,
108
+ });
109
+ }
110
+ else {
111
+ source = 'local';
112
+ this.spinner.start(messages.getMessage('info.scanningLocalSource'));
113
+ let scanResult;
114
+ try {
115
+ scanResult = scanLocalBindings(sourceDirs, requestedTypes);
116
+ }
117
+ catch (error) {
118
+ this.spinner.stop();
119
+ throw messages.createError('error.localScanFailed', [error.message]);
120
+ }
121
+ this.spinner.stop();
122
+ if (scanResult.records.length === 0 && scanResult.malformed.length === 0) {
123
+ throw messages.createError('error.at4dxNotDetected');
124
+ }
125
+ bindingCount = scanResult.records.length;
126
+ issues = validateBindings(scanResult.records, {
127
+ malformed: scanResult.malformed,
128
+ ambiguous: scanResult.ambiguous,
129
+ });
130
+ }
131
+ if (issues.length > 0) {
132
+ this.table({ data: issues.map(toDisplayRow), columns: ISSUE_TABLE_COLUMNS });
133
+ }
134
+ else {
135
+ this.info(messages.getMessage('info.valid', [bindingCount, source]));
136
+ }
137
+ if (issues.some((issue) => issue.severity === 'error')) {
138
+ process.exitCode = 1;
139
+ }
140
+ return { source, bindingCount, issues };
141
+ }
142
+ }
143
+ //# sourceMappingURL=validate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validate.js","sourceRoot":"","sources":["../../../../../../src/commands/simply/aep/at4dx/binding/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,iBAAiB,EACjB,oBAAoB,EACpB,iBAAiB,EACjB,eAAe,EACf,gBAAgB,GAKjB,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,mCAAmC,CAAC,CAAC;AAEpG,MAAM,yBAAyB,GAAsB,CAAC,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,cAAc,CAAC,CAAC;AAavG,SAAS,YAAY,CAAC,KA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AAE,CAAC;YACvD,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;QACvB,CAAC;QAED,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,CAAC;IAC1C,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,2BAA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