@simplysf/simply-aep 0.7.0 → 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.
package/README.md CHANGED
@@ -22,12 +22,85 @@ This package is part of the [`@simplysf/simply`](https://github.com/SimplySF/sim
22
22
 
23
23
  <!-- commands -->
24
24
 
25
+ - [`sf simply aep at4dx binding create`](#sf-simply-aep-at4dx-binding-create)
25
26
  - [`sf simply aep at4dx binding list`](#sf-simply-aep-at4dx-binding-list)
27
+ - [`sf simply aep at4dx binding update`](#sf-simply-aep-at4dx-binding-update)
28
+ - [`sf simply aep at4dx binding validate`](#sf-simply-aep-at4dx-binding-validate)
26
29
  - [`sf simply aep at4dx domain-process-binding create`](#sf-simply-aep-at4dx-domain-process-binding-create)
27
30
  - [`sf simply aep at4dx domain-process-binding list`](#sf-simply-aep-at4dx-domain-process-binding-list)
28
31
  - [`sf simply aep at4dx domain-process-binding set`](#sf-simply-aep-at4dx-domain-process-binding-set)
29
32
  - [`sf simply aep at4dx domain-process-binding validate`](#sf-simply-aep-at4dx-domain-process-binding-validate)
30
33
 
34
+ ## `sf simply aep at4dx binding create`
35
+
36
+ Create a new AT4DX Application Factory binding (Service, Selector, or Domain) in local source and/or a connected org.
37
+
38
+ ```
39
+ USAGE
40
+ $ sf simply aep at4dx binding create -t service|selector|domain -n <value> -c <value> [--json] [--flags-dir <value>] [-d <value>]
41
+ [-o <value>] [--api-version <value>] [--wait <value>] [--label <value>] [--binding-interface <value>] [-s <value>]
42
+ [--sobject-alternate] [--priority <value>] [--force]
43
+
44
+ FLAGS
45
+ -c, --to=<value> (required) The interface/SObject's implementing Apex class (To__c).
46
+ -d, --source-dir=<value> The package directory to create the binding's .md-meta.xml under. Created if the
47
+ customMetadata folder doesn't exist yet.
48
+ -n, --developer-name=<value> (required) The binding's DeveloperName. Must start with a letter, contain only
49
+ letters, numbers, and single underscores, not end with an underscore, and be 40
50
+ characters or fewer.
51
+ -o, --target-org=<value> Deploy the generated binding to this org after writing it.
52
+ -s, --sobject=<value> The SObject API name to bind against (BindingSObject__c, or
53
+ BindingSObjectAlternate__c with --sobject-alternate). Required, and only allowed,
54
+ when --type is selector or domain.
55
+ -t, --type=<option> (required) Which Application Factory binding type to create: service, selector, or
56
+ domain.
57
+ <options: service|selector|domain>
58
+ --api-version=<value> Override the api version used for api requests made by this command
59
+ --binding-interface=<value> BindingInterface__c — the Apex interface this binding maps to. Required, and only
60
+ allowed, when --type is service.
61
+ --force Write (and deploy) even if validation finds an error-severity issue. Validation still
62
+ runs and its issues are still printed and returned.
63
+ --label=<value> The binding's label. Defaults to --developer-name. Must be 40 characters or fewer.
64
+ --priority=<value> Priority__c. Higher numbers are higher priority; omit for least priority. Only
65
+ allowed when --type is service or selector — Domain has no Priority__c field.
66
+ --[no-]sobject-alternate Write --sobject to BindingSObjectAlternate__c instead of BindingSObject__c. Use this
67
+ for a SObject that can't be referenced through an EntityDefinition field at all (for
68
+ example ServiceResource and other Setup objects). Only allowed when --type is
69
+ selector or domain.
70
+ --wait=<value> [default: 33] Deploy poll timeout, in minutes. Only meaningful with --target-org.
71
+
72
+ GLOBAL FLAGS
73
+ --flags-dir=<value> Import flag values from a directory.
74
+ --json Format output as json.
75
+
76
+ DESCRIPTION
77
+ Create a new AT4DX Application Factory binding (Service, Selector, or Domain) in local source and/or a connected org.
78
+
79
+ Generates a `<LocalObjectName>.<DeveloperName>.md-meta.xml` file from the given flags and writes it under
80
+ --source-dir, deploys it to --target-org, or both. Validates the resulting binding — alongside everything else of the
81
+ same --type already in scope — with the same rules `simply aep at4dx binding validate` uses, and refuses to write if
82
+ that introduces an error-severity issue unless --force is passed. At least one of --source-dir/--target-org is
83
+ required; both may be given at once (write to source and deploy it live in the same run). Given --target-org alone,
84
+ the file is written to a temporary directory, deployed, and discarded — no working-tree footprint.
85
+
86
+ `--type service` uses --binding-interface (BindingInterface__c) and rejects --sobject/--sobject-alternate; `--type
87
+ selector`/`domain` use --sobject and write it to BindingSObject__c by default (pass --sobject-alternate to write
88
+ BindingSObjectAlternate__c instead, for a SObject — such as ServiceResource and other Setup objects — that can't be
89
+ referenced through an EntityDefinition field at all). `--priority` is accepted for `--type service`/`selector` only;
90
+ Domain has no such field.
91
+
92
+ EXAMPLES
93
+ $ sf simply aep at4dx binding create --source-dir sfdx-source/core --type service --developer-name My_Service_Binding --binding-interface IMyService --to MyServiceImpl
94
+
95
+ $ sf simply aep at4dx binding create --target-org myOrg --type selector --developer-name Account_Selector --sobject Account --to AccountsSelector --priority 1
96
+
97
+ $ sf simply aep at4dx binding create --source-dir sfdx-source/core --type domain --developer-name Account_Domain --sobject Account --to AccountDomain
98
+
99
+ $ sf simply aep at4dx binding create --source-dir sfdx-source/core --type selector --developer-name ServiceResource_Selector --sobject ServiceResource --sobject-alternate --to ServiceResourceSelector
100
+ ```
101
+
102
+ _See code: [lib/commands/simply/aep/at4dx/binding/create.js](https://github.com/SimplySF/simply-node/blob/@simplysf/simply-aep@0.7.0/packages/simply-aep/lib/commands/simply/aep/at4dx/binding/create.js)_
103
+
31
104
  ## `sf simply aep at4dx binding list`
32
105
 
33
106
  List the AT4DX Application Factory bindings configured in an org or local source, resolved to show which record wins for each binding key.
@@ -82,7 +155,133 @@ FLAG DESCRIPTIONS
82
155
  Comma-separated list of binding types to include. If not specified, all four are included.
83
156
  ```
84
157
 
85
- _See code: [lib/commands/simply/aep/at4dx/binding/list.js](https://github.com/SimplySF/simply-node/blob/@simplysf/simply-aep@0.6.1/packages/simply-aep/lib/commands/simply/aep/at4dx/binding/list.js)_
158
+ _See code: [lib/commands/simply/aep/at4dx/binding/list.js](https://github.com/SimplySF/simply-node/blob/@simplysf/simply-aep@0.7.0/packages/simply-aep/lib/commands/simply/aep/at4dx/binding/list.js)_
159
+
160
+ ## `sf simply aep at4dx binding update`
161
+
162
+ Update an existing AT4DX Application Factory binding (Service, Selector, or Domain) in local source and/or a connected org.
163
+
164
+ ```
165
+ USAGE
166
+ $ sf simply aep at4dx binding update -t service|selector|domain -n <value> [--json] [--flags-dir <value>] [-d <value>...] [-o
167
+ <value>] [--api-version <value>] [--wait <value>] [--label <value>] [-c <value>] [--binding-interface <value>] [-s
168
+ <value>] [--sobject-alternate] [--priority <value>] [--force]
169
+
170
+ FLAGS
171
+ -c, --to=<value> The interface/SObject's implementing Apex class (To__c). If not given, the existing
172
+ value is kept.
173
+ -d, --source-dir=<value>... One or more paths to directories containing Salesforce DX source, searched for the
174
+ binding to update.
175
+ -n, --developer-name=<value> (required) The DeveloperName of the binding to update.
176
+ -o, --target-org=<value> Locate (when --source-dir isn't given) and/or deploy the binding to this org.
177
+ -s, --sobject=<value> The SObject API name to bind against. Only allowed when --type is selector or domain.
178
+ If not given, the existing value is kept.
179
+ -t, --type=<option> (required) Which Application Factory binding type to look in: service, selector, or
180
+ domain.
181
+ <options: service|selector|domain>
182
+ --api-version=<value> Override the api version used for api requests made by this command
183
+ --binding-interface=<value> BindingInterface__c — the Apex interface this binding maps to. Only allowed when
184
+ --type is service. If not given, the existing value is kept.
185
+ --force Write (and deploy) even if validation finds an error-severity issue. Validation still
186
+ runs and its issues are still printed and returned.
187
+ --label=<value> The binding's label. If not given, the existing label is kept.
188
+ --priority=<value> Priority__c. Only allowed when --type is service or selector — Domain has no
189
+ Priority__c field. If not given, the existing value is kept.
190
+ --[no-]sobject-alternate Write --sobject to BindingSObjectAlternate__c instead of BindingSObject__c, for a
191
+ SObject that can't be referenced through an EntityDefinition field at all (for
192
+ example ServiceResource and other Setup objects). Only allowed when --type is
193
+ selector or domain. If not given, the binding keeps whichever field it already uses —
194
+ this flag only needs to be passed to change it.
195
+ --wait=<value> [default: 33] Deploy poll timeout, in minutes. Only meaningful with --target-org.
196
+
197
+ GLOBAL FLAGS
198
+ --flags-dir=<value> Import flag values from a directory.
199
+ --json Format output as json.
200
+
201
+ DESCRIPTION
202
+ Update an existing AT4DX Application Factory binding (Service, Selector, or Domain) in local source and/or a connected
203
+ org.
204
+
205
+ Finds the binding named --developer-name (of the given --type) in local source and/or a connected org, applies only
206
+ the fields given as flags — everything else, including which SObject reference field a Selector/Domain binding uses,
207
+ is preserved from the found record — and rewrites its `.md-meta.xml` file. Validates the resulting binding — alongside
208
+ everything else of the same --type already in scope — with the same rules `simply aep at4dx binding validate` uses,
209
+ and refuses to write if that introduces an error-severity issue unless --force is passed.
210
+
211
+ When --source-dir is given, the binding is located there (searched across every directory given, same as
212
+ `list`/`validate`) and that exact file is rewritten; the found file is also deployed if --target-org is given. When
213
+ only --target-org is given, the binding is located and updated directly in the org via a temporary file, deployed,
214
+ then discarded — no working-tree footprint.
215
+
216
+ --developer-name identifies the binding to update and can't itself be changed by this command. --type identifies which
217
+ Application Factory Custom Metadata Type to look in and can't be changed either — bindings don't move between types.
218
+
219
+ EXAMPLES
220
+ $ sf simply aep at4dx binding update --source-dir sfdx-source/core --source-dir sfdx-source/app --type selector --developer-name Account_Selector --priority 5
221
+
222
+ $ sf simply aep at4dx binding update --target-org myOrg --type domain --developer-name Account_Domain --to AccountDomainV2
223
+ ```
224
+
225
+ _See code: [lib/commands/simply/aep/at4dx/binding/update.js](https://github.com/SimplySF/simply-node/blob/@simplysf/simply-aep@0.7.0/packages/simply-aep/lib/commands/simply/aep/at4dx/binding/update.js)_
226
+
227
+ ## `sf simply aep at4dx binding validate`
228
+
229
+ Validate the AT4DX Application Factory bindings configured in an org or local source, failing when a wiring problem is found.
230
+
231
+ ```
232
+ USAGE
233
+ $ sf simply aep at4dx binding validate [--json] [--flags-dir <value>] [-o <value>] [--api-version <value>] [-d <value>...] [-t
234
+ service|selector|domain|unit-of-work...]
235
+
236
+ FLAGS
237
+ -d, --source-dir=<value>... One or more paths to directories containing Salesforce DX source. Use this for
238
+ local-source discovery.
239
+ -o, --target-org=<value> Username or alias of the org to read bindings from. Use this for live-org discovery.
240
+ -t, --type=<option>... Binding type(s) to include: service, selector, domain, unit-of-work.
241
+ <options: service|selector|domain|unit-of-work>
242
+ --api-version=<value> Override the api version used for api requests made by this command
243
+
244
+ GLOBAL FLAGS
245
+ --flags-dir=<value> Import flag values from a directory.
246
+ --json Format output as json.
247
+
248
+ DESCRIPTION
249
+ Validate the AT4DX Application Factory bindings configured in an org or local source, failing when a wiring problem is
250
+ found.
251
+
252
+ Reads `ApplicationFactory_ServiceBinding__mdt`, `ApplicationFactory_SelectorBinding__mdt`, and
253
+ `ApplicationFactory_DomainBinding__mdt` — either from a live org or from local Salesforce DX source — and checks them
254
+ for problems `simply aep at4dx binding list` doesn't fail on: a binding with no resolvable key, a Selector/Domain
255
+ binding whose SObject reference is ambiguous or names a standard object that can't actually go through an
256
+ EntityDefinition metadata relationship, two records sharing a platform-unique `To__c`, two Domain records resolving to
257
+ the same SObject, and the same DeveloperName defined more than once within one binding type. Exactly one of
258
+ `--target-org` or `--source-dir` must be specified.
259
+
260
+ `ApplicationFactory_UnitOfWorkBinding__mdt` records are scanned when `--type` includes `unit-of-work` (to keep
261
+ `--type`'s meaning consistent with `binding list`) but never contribute an issue — every record contributes to one
262
+ ordered registration list with no possible wiring conflict.
263
+
264
+ Prints a table of every issue found. Exits non-zero when any issue is an error (a warning alone doesn't fail the
265
+ command) — use this in CI to gate on AT4DX Application Factory wiring problems before they reach an org.
266
+
267
+ EXAMPLES
268
+ $ sf simply aep at4dx binding validate --target-org myOrg
269
+
270
+ $ sf simply aep at4dx binding validate --source-dir sfdx-source/core --source-dir sfdx-source/app
271
+
272
+ $ sf simply aep at4dx binding validate --target-org myOrg --type service,selector
273
+
274
+ $ sf simply aep at4dx binding validate --target-org myOrg --json
275
+
276
+ FLAG DESCRIPTIONS
277
+ -t, --type=service|selector|domain|unit-of-work...
278
+
279
+ Binding type(s) to include: service, selector, domain, unit-of-work.
280
+
281
+ Comma-separated list of binding types to include. If not specified, all four are included.
282
+ ```
283
+
284
+ _See code: [lib/commands/simply/aep/at4dx/binding/validate.js](https://github.com/SimplySF/simply-node/blob/@simplysf/simply-aep@0.7.0/packages/simply-aep/lib/commands/simply/aep/at4dx/binding/validate.js)_
86
285
 
87
286
  ## `sf simply aep at4dx domain-process-binding create`
88
287
 
@@ -163,7 +362,7 @@ EXAMPLES
163
362
  $ 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
164
363
  ```
165
364
 
166
- _See code: [lib/commands/simply/aep/at4dx/domain-process-binding/create.js](https://github.com/SimplySF/simply-node/blob/@simplysf/simply-aep@0.6.1/packages/simply-aep/lib/commands/simply/aep/at4dx/domain-process-binding/create.js)_
365
+ _See code: [lib/commands/simply/aep/at4dx/domain-process-binding/create.js](https://github.com/SimplySF/simply-node/blob/@simplysf/simply-aep@0.7.0/packages/simply-aep/lib/commands/simply/aep/at4dx/domain-process-binding/create.js)_
167
366
 
168
367
  ## `sf simply aep at4dx domain-process-binding list`
169
368
 
@@ -209,7 +408,7 @@ EXAMPLES
209
408
  $ sf simply aep at4dx domain-process-binding list --target-org myOrg --active-only --json
210
409
  ```
211
410
 
212
- _See code: [lib/commands/simply/aep/at4dx/domain-process-binding/list.js](https://github.com/SimplySF/simply-node/blob/@simplysf/simply-aep@0.6.1/packages/simply-aep/lib/commands/simply/aep/at4dx/domain-process-binding/list.js)_
411
+ _See code: [lib/commands/simply/aep/at4dx/domain-process-binding/list.js](https://github.com/SimplySF/simply-node/blob/@simplysf/simply-aep@0.7.0/packages/simply-aep/lib/commands/simply/aep/at4dx/domain-process-binding/list.js)_
213
412
 
214
413
  ## `sf simply aep at4dx domain-process-binding set`
215
414
 
@@ -288,7 +487,7 @@ EXAMPLES
288
487
  $ sf simply aep at4dx domain-process-binding set --target-org myOrg --developer-name Account_Before_Insert_Assign_Owner --class-to-inject AccountAssignOwnerActionV2
289
488
  ```
290
489
 
291
- _See code: [lib/commands/simply/aep/at4dx/domain-process-binding/set.js](https://github.com/SimplySF/simply-node/blob/@simplysf/simply-aep@0.6.1/packages/simply-aep/lib/commands/simply/aep/at4dx/domain-process-binding/set.js)_
490
+ _See code: [lib/commands/simply/aep/at4dx/domain-process-binding/set.js](https://github.com/SimplySF/simply-node/blob/@simplysf/simply-aep@0.7.0/packages/simply-aep/lib/commands/simply/aep/at4dx/domain-process-binding/set.js)_
292
491
 
293
492
  ## `sf simply aep at4dx domain-process-binding validate`
294
493
 
@@ -341,5 +540,5 @@ EXAMPLES
341
540
  $ sf simply aep at4dx domain-process-binding validate --target-org myOrg --json
342
541
  ```
343
542
 
344
- _See code: [lib/commands/simply/aep/at4dx/domain-process-binding/validate.js](https://github.com/SimplySF/simply-node/blob/@simplysf/simply-aep@0.6.1/packages/simply-aep/lib/commands/simply/aep/at4dx/domain-process-binding/validate.js)_
543
+ _See code: [lib/commands/simply/aep/at4dx/domain-process-binding/validate.js](https://github.com/SimplySF/simply-node/blob/@simplysf/simply-aep@0.7.0/packages/simply-aep/lib/commands/simply/aep/at4dx/domain-process-binding/validate.js)_
345
544
  <!-- commandsstop -->
@@ -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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AC,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,iBAAiB,CAAC,KAAK,EAAE,QAAQ,EAAE,CAAC,MAAM,EAAE,EAAE;gBAClD,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"}
@@ -101,7 +101,7 @@ export default class At4dxBindingList extends SfCommand {
101
101
  this.spinner.start(messages.getMessage('info.scanningLocalSource'));
102
102
  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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AAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE;gBACzB,EAAE,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE;gBAC/B,EAAE,GAAG,EAAE,WAAW,EAAE,IAAI,EAAE,WAAW,EAAE;gBACvC,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,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;QAE3E,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC;IAC9B,CAAC"}
@@ -0,0 +1,29 @@
1
+ import { SfCommand } from '@salesforce/sf-plugins-core';
2
+ import { type 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/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Q,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,iBAAiB,CAAC,KAAK,EAAE,QAAQ,EAAE,CAAC,MAAM,EAAE,EAAE;gBAClD,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,23 @@
1
+ import { SfCommand } from '@salesforce/sf-plugins-core';
2
+ import { type At4dxBindingValidateResult, type BindingTypeFlag } 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;;;;;;;;;;;;;;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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,YAAY,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;QACvE,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,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,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,123 @@
1
+ # summary
2
+
3
+ Create a new AT4DX Application Factory binding (Service, Selector, or Domain) in local source and/or a connected org.
4
+
5
+ # description
6
+
7
+ Generates a `<LocalObjectName>.<DeveloperName>.md-meta.xml` file from the given flags and writes it under --source-dir, deploys it to --target-org, or both. Validates the resulting binding — alongside everything else of the same --type already in scope — with the same rules `simply aep at4dx binding validate` uses, and refuses to write if that introduces an error-severity issue unless --force is passed. At least one of --source-dir/--target-org is required; both may be given at once (write to source and deploy it live in the same run). Given --target-org alone, the file is written to a temporary directory, deployed, and discarded — no working-tree footprint.
8
+
9
+ `--type service` uses --binding-interface (BindingInterface__c) and rejects --sobject/--sobject-alternate; `--type selector`/`domain` use --sobject and write it to BindingSObject__c by default (pass --sobject-alternate to write BindingSObjectAlternate__c instead, for a SObject — such as ServiceResource and other Setup objects — that can't be referenced through an EntityDefinition field at all). `--priority` is accepted for `--type service`/`selector` only; Domain has no such field.
10
+
11
+ # flags.source-dir.summary
12
+
13
+ The package directory to create the binding's .md-meta.xml under. Created if the customMetadata folder doesn't exist yet.
14
+
15
+ # flags.target-org.summary
16
+
17
+ Deploy the generated binding to this org after writing it.
18
+
19
+ # flags.wait.summary
20
+
21
+ Deploy poll timeout, in minutes. Only meaningful with --target-org.
22
+
23
+ # flags.type.summary
24
+
25
+ Which Application Factory binding type to create: service, selector, or domain.
26
+
27
+ # flags.developer-name.summary
28
+
29
+ The binding's DeveloperName. Must start with a letter, contain only letters, numbers, and single underscores, not end with an underscore, and be 40 characters or fewer.
30
+
31
+ # flags.label.summary
32
+
33
+ The binding's label. Defaults to --developer-name. Must be 40 characters or fewer.
34
+
35
+ # flags.to.summary
36
+
37
+ The interface/SObject's implementing Apex class (To__c).
38
+
39
+ # flags.binding-interface.summary
40
+
41
+ BindingInterface__c — the Apex interface this binding maps to. Required, and only allowed, when --type is service.
42
+
43
+ # flags.sobject.summary
44
+
45
+ The SObject API name to bind against (BindingSObject__c, or BindingSObjectAlternate__c with --sobject-alternate). Required, and only allowed, when --type is selector or domain.
46
+
47
+ # flags.sobject-alternate.summary
48
+
49
+ Write --sobject to BindingSObjectAlternate__c instead of BindingSObject__c. Use this for a SObject that can't be referenced through an EntityDefinition field at all (for example ServiceResource and other Setup objects). Only allowed when --type is selector or domain.
50
+
51
+ # flags.priority.summary
52
+
53
+ Priority__c. Higher numbers are higher priority; omit for least priority. Only allowed when --type is service or selector — Domain has no Priority__c field.
54
+
55
+ # flags.force.summary
56
+
57
+ Write (and deploy) even if validation finds an error-severity issue. Validation still runs and its issues are still printed and returned.
58
+
59
+ # examples
60
+
61
+ - <%= config.bin %> <%= command.id %> --source-dir sfdx-source/core --type service --developer-name My_Service_Binding --binding-interface IMyService --to MyServiceImpl
62
+
63
+ - <%= config.bin %> <%= command.id %> --target-org myOrg --type selector --developer-name Account_Selector --sobject Account --to AccountsSelector --priority 1
64
+
65
+ - <%= config.bin %> <%= command.id %> --source-dir sfdx-source/core --type domain --developer-name Account_Domain --sobject Account --to AccountDomain
66
+
67
+ - <%= config.bin %> <%= command.id %> --source-dir sfdx-source/core --type selector --developer-name ServiceResource_Selector --sobject ServiceResource --sobject-alternate --to ServiceResourceSelector
68
+
69
+ # error.sourceDirOrTargetOrgRequired
70
+
71
+ You must specify at least one of --source-dir or --target-org.
72
+
73
+ # error.invalidPriority
74
+
75
+ "%s" is not a valid --priority: it must be a number.
76
+
77
+ # error.typeFieldMismatch
78
+
79
+ %s
80
+
81
+ # error.invalidDeveloperName
82
+
83
+ %s
84
+
85
+ # error.labelTooLong
86
+
87
+ %s
88
+
89
+ # error.developerNameAlreadyExists
90
+
91
+ %s
92
+
93
+ # error.developerNameNotFound
94
+
95
+ %s
96
+
97
+ # error.noFieldsToUpdate
98
+
99
+ At least one field besides --developer-name must be given to update.
100
+
101
+ # error.at4dxNotDetected
102
+
103
+ %s
104
+
105
+ # error.validationFailed
106
+
107
+ Writing this binding would introduce a wiring problem AT4DX validation already knows how to catch. Pass --force to write anyway.
108
+
109
+ # error.deployFailed
110
+
111
+ %s
112
+
113
+ # info.created
114
+
115
+ Created %s
116
+
117
+ # info.createdInOrg
118
+
119
+ Created %s in the org
120
+
121
+ # info.deployed
122
+
123
+ Deployed (id: %s)
@@ -0,0 +1,121 @@
1
+ # summary
2
+
3
+ Update an existing AT4DX Application Factory binding (Service, Selector, or Domain) in local source and/or a connected org.
4
+
5
+ # description
6
+
7
+ Finds the binding named --developer-name (of the given --type) in local source and/or a connected org, applies only the fields given as flags — everything else, including which SObject reference field a Selector/Domain binding uses, is preserved from the found record — and rewrites its `.md-meta.xml` file. Validates the resulting binding — alongside everything else of the same --type already in scope — with the same rules `simply aep at4dx binding validate` uses, and refuses to write if that introduces an error-severity issue unless --force is passed.
8
+
9
+ When --source-dir is given, the binding is located there (searched across every directory given, same as `list`/`validate`) and that exact file is rewritten; the found file is also deployed if --target-org is given. When only --target-org is given, the binding is located and updated directly in the org via a temporary file, deployed, then discarded — no working-tree footprint.
10
+
11
+ --developer-name identifies the binding to update and can't itself be changed by this command. --type identifies which Application Factory Custom Metadata Type to look in and can't be changed either — bindings don't move between types.
12
+
13
+ # flags.source-dir.summary
14
+
15
+ One or more paths to directories containing Salesforce DX source, searched for the binding to update.
16
+
17
+ # flags.target-org.summary
18
+
19
+ Locate (when --source-dir isn't given) and/or deploy the binding to this org.
20
+
21
+ # flags.wait.summary
22
+
23
+ Deploy poll timeout, in minutes. Only meaningful with --target-org.
24
+
25
+ # flags.type.summary
26
+
27
+ Which Application Factory binding type to look in: service, selector, or domain.
28
+
29
+ # flags.developer-name.summary
30
+
31
+ The DeveloperName of the binding to update.
32
+
33
+ # flags.label.summary
34
+
35
+ The binding's label. If not given, the existing label is kept.
36
+
37
+ # flags.to.summary
38
+
39
+ The interface/SObject's implementing Apex class (To__c). If not given, the existing value is kept.
40
+
41
+ # flags.binding-interface.summary
42
+
43
+ BindingInterface__c — the Apex interface this binding maps to. Only allowed when --type is service. If not given, the existing value is kept.
44
+
45
+ # flags.sobject.summary
46
+
47
+ The SObject API name to bind against. Only allowed when --type is selector or domain. If not given, the existing value is kept.
48
+
49
+ # flags.sobject-alternate.summary
50
+
51
+ Write --sobject to BindingSObjectAlternate__c instead of BindingSObject__c, for a SObject that can't be referenced through an EntityDefinition field at all (for example ServiceResource and other Setup objects). Only allowed when --type is selector or domain. If not given, the binding keeps whichever field it already uses — this flag only needs to be passed to change it.
52
+
53
+ # flags.priority.summary
54
+
55
+ Priority__c. Only allowed when --type is service or selector — Domain has no Priority__c field. If not given, the existing value is kept.
56
+
57
+ # flags.force.summary
58
+
59
+ Write (and deploy) even if validation finds an error-severity issue. Validation still runs and its issues are still printed and returned.
60
+
61
+ # examples
62
+
63
+ - <%= config.bin %> <%= command.id %> --source-dir sfdx-source/core --source-dir sfdx-source/app --type selector --developer-name Account_Selector --priority 5
64
+
65
+ - <%= config.bin %> <%= command.id %> --target-org myOrg --type domain --developer-name Account_Domain --to AccountDomainV2
66
+
67
+ # error.sourceDirOrTargetOrgRequired
68
+
69
+ You must specify at least one of --source-dir or --target-org.
70
+
71
+ # error.invalidPriority
72
+
73
+ "%s" is not a valid --priority: it must be a number.
74
+
75
+ # error.typeFieldMismatch
76
+
77
+ %s
78
+
79
+ # error.invalidDeveloperName
80
+
81
+ %s
82
+
83
+ # error.labelTooLong
84
+
85
+ %s
86
+
87
+ # error.developerNameAlreadyExists
88
+
89
+ %s
90
+
91
+ # error.developerNameNotFound
92
+
93
+ %s
94
+
95
+ # error.noFieldsToUpdate
96
+
97
+ At least one field besides --developer-name must be given to update.
98
+
99
+ # error.at4dxNotDetected
100
+
101
+ %s
102
+
103
+ # error.validationFailed
104
+
105
+ Writing this binding would introduce a wiring problem AT4DX validation already knows how to catch. Pass --force to write anyway.
106
+
107
+ # error.deployFailed
108
+
109
+ %s
110
+
111
+ # info.updated
112
+
113
+ Updated %s
114
+
115
+ # info.updatedInOrg
116
+
117
+ Updated %s in the org
118
+
119
+ # info.deployed
120
+
121
+ Deployed (id: %s)
@@ -0,0 +1,65 @@
1
+ # summary
2
+
3
+ Validate the AT4DX Application Factory bindings configured in an org or local source, failing when a wiring problem is found.
4
+
5
+ # description
6
+
7
+ Reads `ApplicationFactory_ServiceBinding__mdt`, `ApplicationFactory_SelectorBinding__mdt`, and `ApplicationFactory_DomainBinding__mdt` — either from a live org or from local Salesforce DX source — and checks them for problems `simply aep at4dx binding list` doesn't fail on: a binding with no resolvable key, a Selector/Domain binding whose SObject reference is ambiguous or names a standard object that can't actually go through an EntityDefinition metadata relationship, two records sharing a platform-unique `To__c`, two Domain records resolving to the same SObject, and the same DeveloperName defined more than once within one binding type. Exactly one of `--target-org` or `--source-dir` must be specified.
8
+
9
+ `ApplicationFactory_UnitOfWorkBinding__mdt` records are scanned when `--type` includes `unit-of-work` (to keep `--type`'s meaning consistent with `binding list`) but never contribute an issue — every record contributes to one ordered registration list with no possible wiring conflict.
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 Application Factory wiring problems before they reach an org.
12
+
13
+ # flags.target-org.summary
14
+
15
+ Username or alias of the org to read bindings 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
+ # flags.type.summary
22
+
23
+ Binding type(s) to include: service, selector, domain, unit-of-work.
24
+
25
+ # flags.type.description
26
+
27
+ Comma-separated list of binding types to include. If not specified, all four are included.
28
+
29
+ # examples
30
+
31
+ - <%= config.bin %> <%= command.id %> --target-org myOrg
32
+
33
+ - <%= config.bin %> <%= command.id %> --source-dir sfdx-source/core --source-dir sfdx-source/app
34
+
35
+ - <%= config.bin %> <%= command.id %> --target-org myOrg --type service,selector
36
+
37
+ - <%= config.bin %> <%= command.id %> --target-org myOrg --json
38
+
39
+ # error.targetOrgOrSourceDirRequired
40
+
41
+ You must specify either --target-org or --source-dir, but not both.
42
+
43
+ # error.at4dxNotDetected
44
+
45
+ AT4DX doesn't appear to be present in this source: none of the requested Application Factory binding Custom Metadata Types were found.
46
+
47
+ # error.localScanFailed
48
+
49
+ Failed to scan the project directory: %s
50
+
51
+ # error.orgQueryFailed
52
+
53
+ Failed to query bindings from the org: %s
54
+
55
+ # info.queryingOrg
56
+
57
+ Querying bindings from %s...
58
+
59
+ # info.scanningLocalSource
60
+
61
+ Scanning local source for bindings...
62
+
63
+ # info.valid
64
+
65
+ No issues found across %s binding(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.7.0",
4
+ "version": "0.8.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.6.0",
63
+ "@simplysf/simply-aep-core": "^0.7.0",
64
64
  "@simplysf/simply-core": "^1.5.0"
65
65
  },
66
66
  "devDependencies": {
@@ -208,5 +208,5 @@
208
208
  "output": []
209
209
  }
210
210
  },
211
- "gitHead": "d2a9919f27df257491f324840fcfbbaa3a3a56c0"
211
+ "gitHead": "4c25233b2880738c9ce91617035ba40ccabad061"
212
212
  }