@simplysf/simply-aep 0.1.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 ADDED
@@ -0,0 +1,82 @@
1
+ # @simplysf/simply-aep
2
+
3
+ [![NPM](https://img.shields.io/npm/v/@simplysf/simply-aep?label=@simplysf/simply-aep)](https://npmjs.com/@simplysf/simply-aep) [![Downloads/week](https://img.shields.io/npm/dw/@simplysf/simply-aep.svg)](https://npmjs.com/@simplysf/simply-aep) [![License: Apache-2.0](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://raw.githubusercontent.com/SimplySF/simply-node/main/LICENSE.txt)
4
+
5
+ Commands for [Apex Enterprise Patterns](https://github.com/apex-enterprise-patterns) tooling (fflib, force-di, AT4DX).
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ sf plugins install @simplysf/simply-aep
11
+ ```
12
+
13
+ ## Issues
14
+
15
+ Please report any issues at https://github.com/SimplySF/simply-node/issues
16
+
17
+ ## Contributing
18
+
19
+ This package is part of the [`@simplysf/simply`](https://github.com/SimplySF/simply-node) monorepo. See the repo's [CONTRIBUTING.md](https://github.com/SimplySF/simply-node/blob/main/CONTRIBUTING.md) for the repo structure, how to set up and build the project, our commit conventions, and how to submit a pull request. Please also read our [Code of Conduct](https://github.com/SimplySF/simply-node/blob/main/CODE_OF_CONDUCT.md).
20
+
21
+ ## Commands
22
+
23
+ <!-- commands -->
24
+
25
+ - [`sf simply aep at4dx binding list`](#sf-simply-aep-at4dx-binding-list)
26
+
27
+ ## `sf simply aep at4dx binding list`
28
+
29
+ List the AT4DX Application Factory bindings configured in an org or local source, resolved to show which record wins for each binding key.
30
+
31
+ ```
32
+ USAGE
33
+ $ sf simply aep at4dx binding list [--json] [--flags-dir <value>] [-o <value>] [--api-version <value>] [-d <value>...] [-t
34
+ service|selector|domain|unit-of-work...] [--effective-only]
35
+
36
+ FLAGS
37
+ -d, --source-dir=<value>... One or more paths to directories containing Salesforce DX source. Use this for
38
+ local-source discovery.
39
+ -o, --target-org=<value> Username or alias of the org to read bindings from. Use this for live-org discovery.
40
+ -t, --type=<option>... Binding type(s) to include: service, selector, domain, unit-of-work.
41
+ <options: service|selector|domain|unit-of-work>
42
+ --api-version=<value> Override the api version used for api requests made by this command
43
+ --effective-only Only show the bindings that actually win for their key; hide shadowed/non-winning
44
+ records.
45
+
46
+ GLOBAL FLAGS
47
+ --flags-dir=<value> Import flag values from a directory.
48
+ --json Format output as json.
49
+
50
+ DESCRIPTION
51
+ List the AT4DX Application Factory bindings configured in an org or local source, resolved to show which record wins
52
+ for each binding key.
53
+
54
+ Reads the four AT4DX Application Factory Custom Metadata Types — `ApplicationFactory_ServiceBinding__mdt`,
55
+ `ApplicationFactory_SelectorBinding__mdt`, `ApplicationFactory_DomainBinding__mdt`, and
56
+ `ApplicationFactory_UnitOfWorkBinding__mdt` — either from a live org or from local Salesforce DX source, and
57
+ reproduces the resolution rules AT4DX applies at runtime so you can see which record actually wins for a given
58
+ interface or SObject, and which ones are shadowed. Exactly one of `--target-org` or `--source-dir` must be specified.
59
+
60
+ Service and Selector bindings resolve deterministically on `Priority__c` (highest wins). Domain bindings have no
61
+ priority field, so a duplicated key is flagged `ambiguous` rather than reporting a guessed winner. UnitOfWork bindings
62
+ have no winner concept at all — every record contributes to one ordered registration list.
63
+
64
+ EXAMPLES
65
+ $ sf simply aep at4dx binding list --target-org myOrg
66
+
67
+ $ sf simply aep at4dx binding list --source-dir sfdx-source/core --source-dir sfdx-source/app
68
+
69
+ $ sf simply aep at4dx binding list --target-org myOrg --type service,selector
70
+
71
+ $ sf simply aep at4dx binding list --target-org myOrg --effective-only --json
72
+
73
+ FLAG DESCRIPTIONS
74
+ -t, --type=service|selector|domain|unit-of-work...
75
+
76
+ Binding type(s) to include: service, selector, domain, unit-of-work.
77
+
78
+ Comma-separated list of binding types to include. If not specified, all four are included.
79
+ ```
80
+
81
+ _See code: [lib/commands/simply/aep/at4dx/binding/list.js](https://github.com/SimplySF/simply-node/blob/@simplysf/simply-aep@0.1.0/packages/simply-aep/lib/commands/simply/aep/at4dx/binding/list.js)_
82
+ <!-- commandsstop -->
@@ -0,0 +1,23 @@
1
+ import { SfCommand } from '@salesforce/sf-plugins-core';
2
+ import { type At4dxBindingListResult, type BindingTypeFlag } from '../../../../../common/at4dxBindingTypes.js';
3
+ /**
4
+ * Lists the AT4DX Application Factory bindings (`ApplicationFactory_ServiceBinding__mdt`,
5
+ * `ApplicationFactory_SelectorBinding__mdt`, `ApplicationFactory_DomainBinding__mdt`,
6
+ * `ApplicationFactory_UnitOfWorkBinding__mdt`) configured in a target org or local DX source,
7
+ * resolved down to which record wins for each binding key.
8
+ */
9
+ export default class At4dxBindingList extends SfCommand<At4dxBindingListResult> {
10
+ static readonly summary: string;
11
+ static readonly description: string;
12
+ static readonly examples: string[];
13
+ static readonly flags: {
14
+ 'target-org': import("@oclif/core/interfaces").OptionFlag<import("@salesforce/core").Org, import("@oclif/core/interfaces").CustomOptions>;
15
+ 'api-version': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
16
+ 'source-dir': import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
17
+ type: import("@oclif/core/interfaces").OptionFlag<BindingTypeFlag[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
18
+ 'effective-only': import("@oclif/core/interfaces").BooleanFlag<boolean>;
19
+ 'flags-dir': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
20
+ };
21
+ /** @returns The resolved bindings for the requested source and type(s). */
22
+ run(): Promise<At4dxBindingListResult>;
23
+ }
@@ -0,0 +1,135 @@
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, } from '../../../../../common/at4dxBindingTypes.js';
19
+ import { scanLocalBindings } from '../../../../../common/at4dxLocalScan.js';
20
+ import { scanOrgBindings } from '../../../../../common/at4dxOrgScan.js';
21
+ import { resolveBindings } from '../../../../../common/at4dxResolve.js';
22
+ Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
23
+ const messages = Messages.loadMessages('@simplysf/simply-aep', 'simply.aep.at4dx.binding.list');
24
+ const BINDING_TYPE_FLAG_OPTIONS = ['service', 'selector', 'domain', 'unit-of-work'];
25
+ function toDisplayRow(row) {
26
+ const order = row.priority ?? row.sequence;
27
+ return {
28
+ bindingType: row.bindingType,
29
+ key: row.key,
30
+ to: row.to ?? '',
31
+ order: order === undefined ? '' : String(order),
32
+ effective: row.ambiguous ? 'ambiguous' : String(row.effective),
33
+ source: row.source,
34
+ };
35
+ }
36
+ /**
37
+ * Lists the AT4DX Application Factory bindings (`ApplicationFactory_ServiceBinding__mdt`,
38
+ * `ApplicationFactory_SelectorBinding__mdt`, `ApplicationFactory_DomainBinding__mdt`,
39
+ * `ApplicationFactory_UnitOfWorkBinding__mdt`) configured in a target org or local DX source,
40
+ * resolved down to which record wins for each binding key.
41
+ */
42
+ export default class At4dxBindingList extends SfCommand {
43
+ static summary = messages.getMessage('summary');
44
+ static description = messages.getMessage('description');
45
+ static examples = messages.getMessages('examples');
46
+ static flags = {
47
+ ...SfCommand.baseFlags,
48
+ 'target-org': Flags.optionalOrg({
49
+ summary: messages.getMessage('flags.target-org.summary'),
50
+ char: 'o',
51
+ }),
52
+ 'api-version': Flags.orgApiVersion(),
53
+ 'source-dir': Flags.directory({
54
+ summary: messages.getMessage('flags.source-dir.summary'),
55
+ char: 'd',
56
+ exists: true,
57
+ multiple: true,
58
+ }),
59
+ type: Flags.custom({ options: BINDING_TYPE_FLAG_OPTIONS })({
60
+ summary: messages.getMessage('flags.type.summary'),
61
+ description: messages.getMessage('flags.type.description'),
62
+ char: 't',
63
+ multiple: true,
64
+ delimiter: ',',
65
+ }),
66
+ 'effective-only': Flags.boolean({
67
+ summary: messages.getMessage('flags.effective-only.summary'),
68
+ default: false,
69
+ }),
70
+ };
71
+ /** @returns The resolved bindings for the requested source and type(s). */
72
+ async run() {
73
+ const { flags } = await this.parse(At4dxBindingList);
74
+ const targetOrg = flags['target-org'];
75
+ const sourceDirs = flags['source-dir'] ?? [];
76
+ if ((targetOrg && sourceDirs.length > 0) || (!targetOrg && sourceDirs.length === 0)) {
77
+ throw messages.createError('error.targetOrgOrSourceDirRequired');
78
+ }
79
+ const requestedTypes = flags.type?.length
80
+ ? [...new Set(flags.type.map((flag) => BINDING_TYPE_BY_FLAG[flag]))]
81
+ : ALL_BINDING_TYPES;
82
+ let source;
83
+ let resolvedRows;
84
+ if (targetOrg) {
85
+ const connection = targetOrg.getConnection(flags['api-version']);
86
+ source = targetOrg.getUsername() ?? 'org';
87
+ this.spinner.start(messages.getMessage('info.queryingOrg', [source]));
88
+ let scanResult;
89
+ try {
90
+ scanResult = await scanOrgBindings(connection, requestedTypes);
91
+ }
92
+ catch (error) {
93
+ this.spinner.stop();
94
+ throw messages.createError('error.orgQueryFailed', [error.message]);
95
+ }
96
+ this.spinner.stop();
97
+ if (scanResult.missingTypes.length === requestedTypes.length) {
98
+ throw messages.createError('error.at4dxNotDetected');
99
+ }
100
+ resolvedRows = resolveBindings(scanResult.records);
101
+ }
102
+ else {
103
+ source = 'local';
104
+ this.spinner.start(messages.getMessage('info.scanningLocalSource'));
105
+ let records;
106
+ try {
107
+ records = scanLocalBindings(sourceDirs, requestedTypes);
108
+ }
109
+ catch (error) {
110
+ this.spinner.stop();
111
+ throw messages.createError('error.localScanFailed', [error.message]);
112
+ }
113
+ this.spinner.stop();
114
+ if (records.length === 0) {
115
+ throw messages.createError('error.at4dxNotDetected');
116
+ }
117
+ resolvedRows = resolveBindings(records);
118
+ }
119
+ const bindings = flags['effective-only'] ? resolvedRows.filter((row) => row.effective) : resolvedRows;
120
+ this.table({
121
+ data: bindings.map(toDisplayRow),
122
+ columns: [
123
+ { key: 'bindingType', name: 'TYPE' },
124
+ { key: 'key', name: 'KEY' },
125
+ { key: 'to', name: 'TO' },
126
+ { key: 'order', name: 'ORDER' },
127
+ { key: 'effective', name: 'EFFECTIVE' },
128
+ { key: 'source', name: 'SOURCE' },
129
+ ],
130
+ });
131
+ this.info(messages.getMessage('info.complete', [bindings.length, source]));
132
+ return { source, bindings };
133
+ }
134
+ }
135
+ //# sourceMappingURL=list.js.map
@@ -0,0 +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,GAKrB,MAAM,4CAA4C,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CAAC;AAC5E,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AACxE,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AAExE,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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four AT4DX Application Factory binding types this command reads. */
2
+ export type BindingType = 'Service' | 'Selector' | 'Domain' | 'UnitOfWork';
3
+ export declare const ALL_BINDING_TYPES: BindingType[];
4
+ /** The `--type` flag's CLI-facing spelling for each binding type. */
5
+ export type BindingTypeFlag = 'service' | 'selector' | 'domain' | 'unit-of-work';
6
+ export declare const BINDING_TYPE_BY_FLAG: Record<BindingTypeFlag, BindingType>;
7
+ /**
8
+ * The Custom Metadata Type API name AT4DX stores each binding type's records in.
9
+ *
10
+ * This is the single source of truth `at4dxOrgScan`, `at4dxLocalScan`, and `at4dxResolve` all key
11
+ * off of, so the four binding types can't drift out of sync with each other.
12
+ */
13
+ export declare const AT4DX_BINDING_OBJECTS: Record<BindingType, string>;
14
+ /**
15
+ * The local-source component name AT4DX's Custom Metadata Type records use — the CMDT API name
16
+ * without its `__mdt` suffix, e.g. `ApplicationFactory_ServiceBinding.CampaignSObjectBinding` is a
17
+ * `CustomMetadata` component named `ApplicationFactory_ServiceBinding.<record>`.
18
+ */
19
+ export declare const AT4DX_BINDING_LOCAL_OBJECT_NAMES: Record<BindingType, string>;
20
+ /** @returns The binding type whose local object name is `localObjectName`, or `undefined` if none matches. */
21
+ export declare function bindingTypeForLocalObjectName(localObjectName: string): BindingType | undefined;
22
+ /**
23
+ * One binding record, normalized from either an org query or local source, before resolution.
24
+ *
25
+ * `key` is the interface name (Service) or SObject API name (Selector/Domain/UnitOfWork) the
26
+ * binding resolves for. `to` is the implementing Apex class — absent for UnitOfWork, which has no
27
+ * `To__c` field (see `at4dxResolve` for why).
28
+ */
29
+ export type RawBindingRecord = {
30
+ bindingType: BindingType;
31
+ developerName: string;
32
+ key: string;
33
+ to?: string;
34
+ priority?: number;
35
+ sequence?: number;
36
+ /** Local package directory name, or the org username when read from `--target-org`. */
37
+ source: string;
38
+ };
39
+ /** A `RawBindingRecord` annotated with the resolution outcome `at4dxResolve` computed for it. */
40
+ export type At4dxBindingRow = RawBindingRecord & {
41
+ /** Whether this row is the one AT4DX actually resolves to for its key. Always `true` for UnitOfWork. */
42
+ effective: boolean;
43
+ /** Domain only: `true` when >1 row shares this key and AT4DX doesn't guarantee which one wins. */
44
+ ambiguous?: boolean;
45
+ };
46
+ export type At4dxBindingListResult = {
47
+ source: string;
48
+ bindings: At4dxBindingRow[];
49
+ };
@@ -0,0 +1,50 @@
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
+ export const ALL_BINDING_TYPES = ['Service', 'Selector', 'Domain', 'UnitOfWork'];
17
+ export const BINDING_TYPE_BY_FLAG = {
18
+ service: 'Service',
19
+ selector: 'Selector',
20
+ domain: 'Domain',
21
+ 'unit-of-work': 'UnitOfWork',
22
+ };
23
+ /**
24
+ * The Custom Metadata Type API name AT4DX stores each binding type's records in.
25
+ *
26
+ * This is the single source of truth `at4dxOrgScan`, `at4dxLocalScan`, and `at4dxResolve` all key
27
+ * off of, so the four binding types can't drift out of sync with each other.
28
+ */
29
+ export const AT4DX_BINDING_OBJECTS = {
30
+ Service: 'ApplicationFactory_ServiceBinding__mdt',
31
+ Selector: 'ApplicationFactory_SelectorBinding__mdt',
32
+ Domain: 'ApplicationFactory_DomainBinding__mdt',
33
+ UnitOfWork: 'ApplicationFactory_UnitOfWorkBinding__mdt',
34
+ };
35
+ /**
36
+ * The local-source component name AT4DX's Custom Metadata Type records use — the CMDT API name
37
+ * without its `__mdt` suffix, e.g. `ApplicationFactory_ServiceBinding.CampaignSObjectBinding` is a
38
+ * `CustomMetadata` component named `ApplicationFactory_ServiceBinding.<record>`.
39
+ */
40
+ export const AT4DX_BINDING_LOCAL_OBJECT_NAMES = {
41
+ Service: 'ApplicationFactory_ServiceBinding',
42
+ Selector: 'ApplicationFactory_SelectorBinding',
43
+ Domain: 'ApplicationFactory_DomainBinding',
44
+ UnitOfWork: 'ApplicationFactory_UnitOfWorkBinding',
45
+ };
46
+ /** @returns The binding type whose local object name is `localObjectName`, or `undefined` if none matches. */
47
+ export function bindingTypeForLocalObjectName(localObjectName) {
48
+ return ALL_BINDING_TYPES.find((type) => AT4DX_BINDING_LOCAL_OBJECT_NAMES[type] === localObjectName);
49
+ }
50
+ //# sourceMappingURL=at4dxBindingTypes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"at4dxBindingTypes.js","sourceRoot":"","sources":["../../src/common/at4dxBindingTypes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAKH,MAAM,CAAC,MAAM,iBAAiB,GAAkB,CAAC,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,YAAY,CAAC,CAAC;AAKhG,MAAM,CAAC,MAAM,oBAAoB,GAAyC;IACxE,OAAO,EAAE,SAAS;IAClB,QAAQ,EAAE,UAAU;IACpB,MAAM,EAAE,QAAQ;IAChB,cAAc,EAAE,YAAY;CAC7B,CAAC;AAEF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAgC;IAChE,OAAO,EAAE,wCAAwC;IACjD,QAAQ,EAAE,yCAAyC;IACnD,MAAM,EAAE,uCAAuC;IAC/C,UAAU,EAAE,2CAA2C;CACxD,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,gCAAgC,GAAgC;IAC3E,OAAO,EAAE,mCAAmC;IAC5C,QAAQ,EAAE,oCAAoC;IAC9C,MAAM,EAAE,kCAAkC;IAC1C,UAAU,EAAE,sCAAsC;CACnD,CAAC;AAEF,8GAA8G;AAC9G,MAAM,UAAU,6BAA6B,CAAC,eAAuB;IACnE,OAAO,iBAAiB,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,gCAAgC,CAAC,IAAI,CAAC,KAAK,eAAe,CAAC,CAAC;AACtG,CAAC"}
@@ -0,0 +1,17 @@
1
+ import { type BindingType, type RawBindingRecord } from './at4dxBindingTypes.js';
2
+ /**
3
+ * Scan local Salesforce DX source directories for AT4DX Application Factory binding records,
4
+ * parsing each `CustomMetadata` component's `<values>` pairs directly — the same "read the
5
+ * metadata XML" approach `simply schema visualize`'s local scan uses for `CustomField`/
6
+ * `CustomObject`.
7
+ *
8
+ * Unlike an org (see `at4dxOrgScan`), local source gives no signal for "this Custom Metadata Type
9
+ * doesn't exist" independent of "zero records exist for it" — a missing `customMetadata` folder
10
+ * and an empty one look identical to `ComponentSet.fromSource`. Callers treat a fully empty result
11
+ * across every requested type as "AT4DX not detected here."
12
+ *
13
+ * @param sourceDirs - The source directories to scan.
14
+ * @param types - Which binding types to include.
15
+ * @returns The discovered bindings.
16
+ */
17
+ export declare function scanLocalBindings(sourceDirs: string[], types: BindingType[]): RawBindingRecord[];
@@ -0,0 +1,113 @@
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 path from 'node:path';
17
+ import { ComponentSet } from '@salesforce/source-deploy-retrieve';
18
+ import { bindingTypeForLocalObjectName } from './at4dxBindingTypes.js';
19
+ /** @returns The plain-text value for `field` in `values`, or `undefined` if the field is absent or explicitly nil. */
20
+ function fieldValue(values, field) {
21
+ const entry = values.find((value) => value.field === field);
22
+ if (!entry?.value || entry.value['@_xsi:nil'] === 'true') {
23
+ return undefined;
24
+ }
25
+ return entry.value['#text'];
26
+ }
27
+ /** @returns `value` parsed as a number, or `undefined` if `value` is absent or not numeric. */
28
+ function toNumber(value) {
29
+ if (value === undefined) {
30
+ return undefined;
31
+ }
32
+ const parsed = Number(value);
33
+ return Number.isNaN(parsed) ? undefined : parsed;
34
+ }
35
+ /**
36
+ * @returns The source-format package/project directory name a metadata file belongs to (the
37
+ * directory containing `customMetadata`) — the same convention `simply schema visualize` uses for
38
+ * `objects`.
39
+ */
40
+ function deriveProjectName(filePath) {
41
+ if (!filePath) {
42
+ return 'local';
43
+ }
44
+ const normalized = filePath.replace(/\\/g, '/');
45
+ const index = normalized.indexOf('/customMetadata/');
46
+ if (index === -1) {
47
+ return 'local';
48
+ }
49
+ return path.basename(normalized.slice(0, index));
50
+ }
51
+ /** @returns The normalized binding record for one `CustomMetadata` component, or `undefined` if it has no resolvable key. */
52
+ function toRawRecord(bindingType, component, developerName) {
53
+ const xml = component.parseXmlSync();
54
+ const rawValues = xml.CustomMetadata?.values;
55
+ const values = rawValues === undefined ? [] : Array.isArray(rawValues) ? rawValues : [rawValues];
56
+ const bindingSObject = fieldValue(values, 'BindingSObject__c');
57
+ const bindingSObjectAlternate = fieldValue(values, 'BindingSObjectAlternate__c');
58
+ const key = bindingType === 'Service' ? fieldValue(values, 'BindingInterface__c') : (bindingSObject ?? bindingSObjectAlternate);
59
+ if (!key) {
60
+ return undefined;
61
+ }
62
+ return {
63
+ bindingType,
64
+ developerName,
65
+ key,
66
+ to: fieldValue(values, 'To__c'),
67
+ priority: toNumber(fieldValue(values, 'Priority__c')),
68
+ sequence: toNumber(fieldValue(values, 'BindingSequence__c')),
69
+ source: deriveProjectName(component.xml),
70
+ };
71
+ }
72
+ /**
73
+ * Scan local Salesforce DX source directories for AT4DX Application Factory binding records,
74
+ * parsing each `CustomMetadata` component's `<values>` pairs directly — the same "read the
75
+ * metadata XML" approach `simply schema visualize`'s local scan uses for `CustomField`/
76
+ * `CustomObject`.
77
+ *
78
+ * Unlike an org (see `at4dxOrgScan`), local source gives no signal for "this Custom Metadata Type
79
+ * doesn't exist" independent of "zero records exist for it" — a missing `customMetadata` folder
80
+ * and an empty one look identical to `ComponentSet.fromSource`. Callers treat a fully empty result
81
+ * across every requested type as "AT4DX not detected here."
82
+ *
83
+ * @param sourceDirs - The source directories to scan.
84
+ * @param types - Which binding types to include.
85
+ * @returns The discovered bindings.
86
+ */
87
+ export function scanLocalBindings(sourceDirs, types) {
88
+ const requestedTypes = new Set(types);
89
+ const records = [];
90
+ const components = ComponentSet.fromSource(sourceDirs);
91
+ for (const rawComponent of components) {
92
+ const component = rawComponent;
93
+ if (component.type.id !== 'custommetadata') {
94
+ continue;
95
+ }
96
+ const separatorIndex = component.name.indexOf('.');
97
+ if (separatorIndex === -1) {
98
+ continue;
99
+ }
100
+ const localObjectName = component.name.slice(0, separatorIndex);
101
+ const developerName = component.name.slice(separatorIndex + 1);
102
+ const bindingType = bindingTypeForLocalObjectName(localObjectName);
103
+ if (!bindingType || !requestedTypes.has(bindingType)) {
104
+ continue;
105
+ }
106
+ const record = toRawRecord(bindingType, component, developerName);
107
+ if (record) {
108
+ records.push(record);
109
+ }
110
+ }
111
+ return records;
112
+ }
113
+ //# sourceMappingURL=at4dxLocalScan.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"at4dxLocalScan.js","sourceRoot":"","sources":["../../src/common/at4dxLocalScan.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,YAAY,EAAwB,MAAM,oCAAoC,CAAC;AACxF,OAAO,EAAE,6BAA6B,EAA2C,MAAM,wBAAwB,CAAC;AAkBhH,sHAAsH;AACtH,SAAS,UAAU,CAAC,MAA0B,EAAE,KAAa;IAC3D,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC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EAAE,CAAC;YAC3C,SAAS;QACX,CAAC;QAED,MAAM,cAAc,GAAG,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QACnD,IAAI,cAAc,KAAK,CAAC,CAAC,EAAE,CAAC;YAC1B,SAAS;QACX,CAAC;QACD,MAAM,eAAe,GAAG,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,cAAc,CAAC,CAAC;QAChE,MAAM,aAAa,GAAG,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,cAAc,GAAG,CAAC,CAAC,CAAC;QAE/D,MAAM,WAAW,GAAG,6BAA6B,CAAC,eAAe,CAAC,CAAC;QACnE,IAAI,CAAC,WAAW,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE,CAAC;YACrD,SAAS;QACX,CAAC;QAED,MAAM,MAAM,GAAG,WAAW,CAAC,WAAW,EAAE,SAAS,EAAE,aAAa,CAAC,CAAC;QAClE,IAAI,MAAM,EAAE,CAAC;YACX,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACvB,CAAC;IACH,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC"}
@@ -0,0 +1,22 @@
1
+ import { type Connection } from '@salesforce/core';
2
+ import { type BindingType, type RawBindingRecord } from './at4dxBindingTypes.js';
3
+ export type OrgScanResult = {
4
+ records: RawBindingRecord[];
5
+ /** Binding types whose query failed with `INVALID_TYPE` — the Custom Metadata Type doesn't exist in this org. */
6
+ missingTypes: BindingType[];
7
+ };
8
+ /**
9
+ * Query the target org for AT4DX Application Factory bindings, one SOQL query per requested
10
+ * binding type, run in parallel. These are ordinary queryable Custom Metadata records — plain
11
+ * REST (`connection.autoFetchQuery`), no Tooling API, no chunking (row counts are inherently
12
+ * small).
13
+ *
14
+ * A type whose Custom Metadata Type doesn't exist in this org fails with `INVALID_TYPE`; that's
15
+ * reported via `missingTypes` rather than thrown, so the caller can distinguish "AT4DX isn't here
16
+ * at all" from "AT4DX is here, this type just has no records configured yet."
17
+ *
18
+ * @param connection - The org connection to query against.
19
+ * @param types - Which binding types to query for.
20
+ * @returns The discovered bindings and which requested types don't exist in this org.
21
+ */
22
+ export declare function scanOrgBindings(connection: Connection, types: BindingType[]): Promise<OrgScanResult>;
@@ -0,0 +1,87 @@
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 { AT4DX_BINDING_OBJECTS } from './at4dxBindingTypes.js';
17
+ /**
18
+ * SOQL per binding type, mirroring the exact queries AT4DX's own `di_Module` subclasses run
19
+ * (`ApplicationServiceDIModule`, `ApplicationSObjectSelectorDIModule`,
20
+ * `ApplicationSObjectDomainDIModule`, `ApplicationSObjectUnitOfWorkDIProvider`) — including the
21
+ * `BindingSObject__r.QualifiedApiName` relationship traversal, since `BindingSObject__c` alone
22
+ * holds an EntityDefinition reference, not a usable API name.
23
+ */
24
+ const SOQL_BY_TYPE = {
25
+ Service: `SELECT DeveloperName, To__c, BindingInterface__c, Priority__c FROM ${AT4DX_BINDING_OBJECTS.Service}`,
26
+ Selector: `SELECT DeveloperName, To__c, BindingSObject__c, BindingSObject__r.QualifiedApiName, BindingSObjectAlternate__c, Priority__c FROM ${AT4DX_BINDING_OBJECTS.Selector}`,
27
+ Domain: `SELECT DeveloperName, To__c, BindingSObject__c, BindingSObject__r.QualifiedApiName, BindingSObjectAlternate__c FROM ${AT4DX_BINDING_OBJECTS.Domain}`,
28
+ UnitOfWork: `SELECT DeveloperName, BindingSequence__c, BindingSObject__c, BindingSObject__r.QualifiedApiName, BindingSObjectAlternate__c FROM ${AT4DX_BINDING_OBJECTS.UnitOfWork}`,
29
+ };
30
+ /** @returns The SObject key for a Selector/Domain/UnitOfWork record, preferring `BindingSObject__c`'s resolved API name and falling back to `BindingSObjectAlternate__c`, matching AT4DX's own fallback order. */
31
+ function resolveSObjectKey(record) {
32
+ if (record.BindingSObject__c) {
33
+ return record.BindingSObject__r?.QualifiedApiName ?? undefined;
34
+ }
35
+ return record.BindingSObjectAlternate__c ?? undefined;
36
+ }
37
+ /** @returns The normalized binding record, or `undefined` if the record has no resolvable key (and so can't be bound to anything). */
38
+ function toRawRecord(bindingType, record, source) {
39
+ const key = bindingType === 'Service' ? (record.BindingInterface__c ?? undefined) : resolveSObjectKey(record);
40
+ if (!key) {
41
+ return undefined;
42
+ }
43
+ return {
44
+ bindingType,
45
+ developerName: record.DeveloperName,
46
+ key,
47
+ to: record.To__c ?? undefined,
48
+ priority: record.Priority__c ?? undefined,
49
+ sequence: record.BindingSequence__c ?? undefined,
50
+ source,
51
+ };
52
+ }
53
+ /**
54
+ * Query the target org for AT4DX Application Factory bindings, one SOQL query per requested
55
+ * binding type, run in parallel. These are ordinary queryable Custom Metadata records — plain
56
+ * REST (`connection.autoFetchQuery`), no Tooling API, no chunking (row counts are inherently
57
+ * small).
58
+ *
59
+ * A type whose Custom Metadata Type doesn't exist in this org fails with `INVALID_TYPE`; that's
60
+ * reported via `missingTypes` rather than thrown, so the caller can distinguish "AT4DX isn't here
61
+ * at all" from "AT4DX is here, this type just has no records configured yet."
62
+ *
63
+ * @param connection - The org connection to query against.
64
+ * @param types - Which binding types to query for.
65
+ * @returns The discovered bindings and which requested types don't exist in this org.
66
+ */
67
+ export async function scanOrgBindings(connection, types) {
68
+ const source = connection.getUsername() ?? 'org';
69
+ const missingTypes = [];
70
+ const perType = await Promise.all(types.map(async (bindingType) => {
71
+ try {
72
+ const result = await connection.autoFetchQuery(SOQL_BY_TYPE[bindingType]);
73
+ return result.records
74
+ .map((record) => toRawRecord(bindingType, record, source))
75
+ .filter((record) => record !== undefined);
76
+ }
77
+ catch (error) {
78
+ if (error.name === 'INVALID_TYPE') {
79
+ missingTypes.push(bindingType);
80
+ return [];
81
+ }
82
+ throw error;
83
+ }
84
+ }));
85
+ return { records: perType.flat(), missingTypes };
86
+ }
87
+ //# sourceMappingURL=at4dxOrgScan.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"at4dxOrgScan.js","sourceRoot":"","sources":["../../src/common/at4dxOrgScan.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,EAAE,qBAAqB,EAA2C,MAAM,wBAAwB,CAAC;AAcxG;;;;;;GAMG;AACH,MAAM,YAAY,GAAgC;IAChD,OAAO,EAAE,sEAAsE,qBAAqB,CAAC,OAAO,EAAE;IAC9G,QAAQ,EAAE,oIAAoI,qBAAqB,CAAC,QAAQ,EAAE;IAC9K,MAAM,EAAE,uHAAuH,qBAAqB,CAAC,MAAM,EAAE;IAC7J,UAAU,EAAE,oIAAoI,qBAAqB,CAAC,UAAU,EAAE;CACnL,CAAC;AAEF,kNAAkN;AAClN,SAAS,iBAAiB,CAAC,MAAwB;IACjD,IAAI,MAAM,CAAC,iBAAiB,EAAE,CAAC;QAC7B,OAAO,MAAM,CAAC,iBAAiB,EAAE,gBAAgB,IAAI,SAAS,CAAC;IACjE,CAAC;IACD,OAAO,MAAM,CAAC,0BAA0B,IAAI,SAAS,CAAC;AACxD,CAAC;AAED,sIAAsI;AACtI,SAAS,WAAW,CAAC,WAAwB,EAAE,MAAwB,EAAE,MAAc;IACrF,MAAM,GAAG,GAAG,WAAW,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,mBAAmB,IAAI,SAAS,CAAC,CAAC,CAAC,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC;IAC9G,IAAI,CAAC,GAAG,EAAE,CAAC;QACT,OAAO,SAAS,CAAC;IACnB,CAA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 +1,9 @@
1
+ import { type At4dxBindingRow, type RawBindingRecord } from './at4dxBindingTypes.js';
2
+ /**
3
+ * Resolve raw binding records into rows annotated with which one AT4DX actually resolves to for
4
+ * each key, applying the per-binding-type rules documented on {@link resolveByType}.
5
+ *
6
+ * @param records - The raw binding records to resolve, as returned by `scanOrgBindings`/`scanLocalBindings`.
7
+ * @returns The resolved rows, grouped by binding type in `ALL_BINDING_TYPES` order.
8
+ */
9
+ export declare function resolveBindings(records: RawBindingRecord[]): At4dxBindingRow[];
@@ -0,0 +1,92 @@
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 { ALL_BINDING_TYPES, } from './at4dxBindingTypes.js';
17
+ /**
18
+ * Resolve one binding type's records, keyed by `record.key`.
19
+ *
20
+ * **UnitOfWork** has no winner concept at all: `ApplicationSObjectUnitOfWorkDIProvider` builds one
21
+ * ordered SObjectType list for the shared Unit of Work, ordered by `BindingSequence__c` ascending
22
+ * (nulls last, SOQL's default). Every record contributes.
23
+ *
24
+ * **Domain** has no `Priority__c` field and no `ORDER BY` in AT4DX's query — a key with more than
25
+ * one record resolves in an org-defined order this command can't predict, so every record for that
26
+ * key is flagged `ambiguous` rather than one being asserted as the winner.
27
+ *
28
+ * **Service/Selector** resolve deterministically: AT4DX orders its query
29
+ * `Priority__c DESC NULLS FIRST` and overwrites a map keyed by the binding key, so the
30
+ * *highest*-priority record (nulls treated as lowest) is written last and wins.
31
+ */
32
+ function resolveByType(bindingType, records) {
33
+ if (bindingType === 'UnitOfWork') {
34
+ return [...records]
35
+ .sort((a, b) => (a.sequence ?? Number.POSITIVE_INFINITY) - (b.sequence ?? Number.POSITIVE_INFINITY))
36
+ .map((record) => ({ ...record, effective: true }));
37
+ }
38
+ const byKey = new Map();
39
+ for (const record of records) {
40
+ const group = byKey.get(record.key) ?? [];
41
+ group.push(record);
42
+ byKey.set(record.key, group);
43
+ }
44
+ const rows = [];
45
+ for (const group of byKey.values()) {
46
+ if (bindingType === 'Domain') {
47
+ const isAmbiguous = group.length > 1;
48
+ for (const record of group) {
49
+ rows.push({ ...record, effective: !isAmbiguous, ...(isAmbiguous ? { ambiguous: true } : {}) });
50
+ }
51
+ continue;
52
+ }
53
+ // Service/Selector: the record with the highest Priority__c wins; undefined/null sorts lowest.
54
+ // A genuine tie is exactly as indeterminate here as it is in AT4DX's own map-overwrite (see
55
+ // ApplicationServiceDIModule's `prioritizeBindings` comment) — this picks the last record
56
+ // encountered among the tied maximum, which is as valid a choice as any other.
57
+ let winner = group[0];
58
+ for (const record of group) {
59
+ if ((record.priority ?? Number.NEGATIVE_INFINITY) >= (winner.priority ?? Number.NEGATIVE_INFINITY)) {
60
+ winner = record;
61
+ }
62
+ }
63
+ for (const record of group) {
64
+ rows.push({ ...record, effective: record === winner });
65
+ }
66
+ }
67
+ return rows;
68
+ }
69
+ /**
70
+ * Resolve raw binding records into rows annotated with which one AT4DX actually resolves to for
71
+ * each key, applying the per-binding-type rules documented on {@link resolveByType}.
72
+ *
73
+ * @param records - The raw binding records to resolve, as returned by `scanOrgBindings`/`scanLocalBindings`.
74
+ * @returns The resolved rows, grouped by binding type in `ALL_BINDING_TYPES` order.
75
+ */
76
+ export function resolveBindings(records) {
77
+ const byType = new Map();
78
+ for (const record of records) {
79
+ const group = byType.get(record.bindingType) ?? [];
80
+ group.push(record);
81
+ byType.set(record.bindingType, group);
82
+ }
83
+ const rows = [];
84
+ for (const bindingType of ALL_BINDING_TYPES) {
85
+ const typeRecords = byType.get(bindingType);
86
+ if (typeRecords) {
87
+ rows.push(...resolveByType(bindingType, typeRecords));
88
+ }
89
+ }
90
+ return rows;
91
+ }
92
+ //# sourceMappingURL=at4dxResolve.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"at4dxResolve.js","sourceRoot":"","sources":["../../src/common/at4dxResolve.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,iBAAiB,GAIlB,MAAM,wBAAwB,CAAC;AAEhC;;;;;;;;;;;;;;GAcG;AACH,SAAS,aAAa,CAAC,WAAwB,EAAE,OAA2B;IAC1E,IAAI,WAAW,KAAK,YAAY,EAAE,CAAC;QACjC,OAAO,CAAC,GAAG,OAAO,CAAC;aAChB,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,QAAQ,IAAI,MAAM,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC,CAAC,QAAQ,IAAI,MAAM,CAAC,iBAAiB,CAAC,CAAC;aACnG,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;IACvD,CAAC;IAED,MAAM,KAAK,GAAG,IAAI,GAAG,EAA8B,CAAC;IACpD,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;QAC7B,MAAM,KAAK,GAAG,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC;QAC1C,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACnB,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IAC/B,CAAC;IAED,MAAM,IAAI,GAAsB,EAAE,CAAC;IAEnC,KAAK,MAAM,KAAK,IAAI,KAAK,CAAC,MAAM,EAAE,EAAE,CAAC;QACnC,IAAI,WAAW,KAAK,QAAQ,EAAE,CAAC;YAC7B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AAM,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC;IACxC,CAAC;IAED,MAAM,IAAI,GAAsB,EAAE,CAAC;IACnC,KAAK,MAAM,WAAW,IAAI,iBAAiB,EAAE,CAAC;QAC5C,MAAM,WAAW,GAAG,MAAM,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;QAC5C,IAAI,WAAW,EAAE,CAAC;YAChB,IAAI,CAAC,IAAI,CAAC,GAAG,aAAa,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC,CAAC;QACxD,CAAC;IACH,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC"}
package/lib/index.d.ts ADDED
@@ -0,0 +1,4 @@
1
+ export { ALL_BINDING_TYPES, AT4DX_BINDING_OBJECTS, AT4DX_BINDING_LOCAL_OBJECT_NAMES, BINDING_TYPE_BY_FLAG, bindingTypeForLocalObjectName, type At4dxBindingListResult, type At4dxBindingRow, type BindingType, type BindingTypeFlag, type RawBindingRecord, } from './common/at4dxBindingTypes.js';
2
+ export { scanLocalBindings } from './common/at4dxLocalScan.js';
3
+ export { scanOrgBindings, type OrgScanResult } from './common/at4dxOrgScan.js';
4
+ export { resolveBindings } from './common/at4dxResolve.js';
package/lib/index.js ADDED
@@ -0,0 +1,24 @@
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
+ // Unlike other `simply-*` command packages, this barrel isn't an empty oclif-plugin stub — the
17
+ // binding scan/resolve logic is meant to be consumed directly by a future VS Code extension, not
18
+ // just by this package's own command. See docs/design/0007-at4dx-binding-list.md's "Decision"
19
+ // section for why.
20
+ export { ALL_BINDING_TYPES, AT4DX_BINDING_OBJECTS, AT4DX_BINDING_LOCAL_OBJECT_NAMES, BINDING_TYPE_BY_FLAG, bindingTypeForLocalObjectName, } from './common/at4dxBindingTypes.js';
21
+ export { scanLocalBindings } from './common/at4dxLocalScan.js';
22
+ export { scanOrgBindings } from './common/at4dxOrgScan.js';
23
+ export { resolveBindings } from './common/at4dxResolve.js';
24
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,+FAA+F;AAC/F,iGAAiG;AACjG,8FAA8F;AAC9F,mBAAmB;AAEnB,OAAO,EACL,iBAAiB,EACjB,qBAAqB,EACrB,gCAAgC,EAChC,oBAAoB,EACpB,6BAA6B,GAM9B,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAsB,MAAM,0BAA0B,CAAC;AAC/E,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC"}
@@ -0,0 +1,67 @@
1
+ # summary
2
+
3
+ List the AT4DX Application Factory bindings configured in an org or local source, resolved to show which record wins for each binding key.
4
+
5
+ # description
6
+
7
+ Reads the four AT4DX Application Factory Custom Metadata Types — `ApplicationFactory_ServiceBinding__mdt`, `ApplicationFactory_SelectorBinding__mdt`, `ApplicationFactory_DomainBinding__mdt`, and `ApplicationFactory_UnitOfWorkBinding__mdt` — either from a live org or from local Salesforce DX source, and reproduces the resolution rules AT4DX applies at runtime so you can see which record actually wins for a given interface or SObject, and which ones are shadowed. Exactly one of `--target-org` or `--source-dir` must be specified.
8
+
9
+ Service and Selector bindings resolve deterministically on `Priority__c` (highest wins). Domain bindings have no priority field, so a duplicated key is flagged `ambiguous` rather than reporting a guessed winner. UnitOfWork bindings have no winner concept at all — every record contributes to one ordered registration list.
10
+
11
+ # flags.target-org.summary
12
+
13
+ Username or alias of the org to read bindings from. Use this for live-org discovery.
14
+
15
+ # flags.source-dir.summary
16
+
17
+ One or more paths to directories containing Salesforce DX source. Use this for local-source discovery.
18
+
19
+ # flags.type.summary
20
+
21
+ Binding type(s) to include: service, selector, domain, unit-of-work.
22
+
23
+ # flags.type.description
24
+
25
+ Comma-separated list of binding types to include. If not specified, all four are included.
26
+
27
+ # flags.effective-only.summary
28
+
29
+ Only show the bindings that actually win for their key; hide shadowed/non-winning records.
30
+
31
+ # examples
32
+
33
+ - <%= config.bin %> <%= command.id %> --target-org myOrg
34
+
35
+ - <%= config.bin %> <%= command.id %> --source-dir sfdx-source/core --source-dir sfdx-source/app
36
+
37
+ - <%= config.bin %> <%= command.id %> --target-org myOrg --type service,selector
38
+
39
+ - <%= config.bin %> <%= command.id %> --target-org myOrg --effective-only --json
40
+
41
+ # error.targetOrgOrSourceDirRequired
42
+
43
+ You must specify either --target-org or --source-dir, but not both.
44
+
45
+ # error.at4dxNotDetected
46
+
47
+ AT4DX doesn't appear to be present in this source: none of the Application Factory binding Custom Metadata Types were found.
48
+
49
+ # error.localScanFailed
50
+
51
+ Failed to scan the project directory: %s
52
+
53
+ # error.orgQueryFailed
54
+
55
+ Failed to query bindings from the org: %s
56
+
57
+ # info.queryingOrg
58
+
59
+ Querying bindings from %s...
60
+
61
+ # info.scanningLocalSource
62
+
63
+ Scanning local source for bindings...
64
+
65
+ # info.complete
66
+
67
+ Found %s binding(s) in %s
package/package.json ADDED
@@ -0,0 +1,209 @@
1
+ {
2
+ "name": "@simplysf/simply-aep",
3
+ "description": "Commands for Apex Enterprise Patterns tooling (fflib, force-di, AT4DX)",
4
+ "version": "0.1.0",
5
+ "author": "@ClayChipps",
6
+ "homepage": "https://github.com/SimplySF/simply-node",
7
+ "bugs": "https://github.com/SimplySF/simply-node/issues",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "https://github.com/SimplySF/simply-node",
11
+ "directory": "packages/simply-aep"
12
+ },
13
+ "engines": {
14
+ "node": ">=22.0.0"
15
+ },
16
+ "files": [
17
+ "/lib",
18
+ "/messages",
19
+ "/npm-shrinkwrap.json",
20
+ "/oclif.lock",
21
+ "/oclif.manifest.json"
22
+ ],
23
+ "keywords": [
24
+ "force",
25
+ "salesforce",
26
+ "sfdx",
27
+ "salesforcedx",
28
+ "sfdx-plugin",
29
+ "sf-plugin",
30
+ "sf"
31
+ ],
32
+ "license": "Apache-2.0",
33
+ "exports": "./lib/index.js",
34
+ "type": "module",
35
+ "oclif": {
36
+ "bin": "sf",
37
+ "commands": "./lib/commands",
38
+ "devPlugins": [
39
+ "@oclif/plugin-command-snapshot",
40
+ "@oclif/plugin-help",
41
+ "@salesforce/plugin-command-reference"
42
+ ],
43
+ "flexibleTaxonomy": true,
44
+ "plugins": [],
45
+ "repositoryPrefix": "<%- repo %>/blob/@simplysf/simply-aep@<%- version %>/packages/simply-aep/<%- commandPath %>",
46
+ "topics": {
47
+ "simply": {
48
+ "description": "Commands for simplifying Salesforce",
49
+ "subtopics": {
50
+ "aep": {
51
+ "description": "Commands for Apex Enterprise Patterns tooling (fflib, force-di, AT4DX)"
52
+ }
53
+ }
54
+ }
55
+ },
56
+ "topicSeparator": " "
57
+ },
58
+ "dependencies": {
59
+ "@oclif/core": "^4.11.2",
60
+ "@salesforce/core": "^8.30.0",
61
+ "@salesforce/sf-plugins-core": "^12.2.16",
62
+ "@salesforce/source-deploy-retrieve": "^12.37.2",
63
+ "@simplysf/simply-core": "workspace:^1.4.0"
64
+ },
65
+ "devDependencies": {
66
+ "@oclif/plugin-command-snapshot": "^5.3.19",
67
+ "@salesforce/plugin-command-reference": "^3.1.99",
68
+ "@vitest/coverage-v8": "^4.1.10",
69
+ "vitest": "^4.1.10"
70
+ },
71
+ "publishConfig": {
72
+ "access": "public"
73
+ },
74
+ "scripts": {
75
+ "build": "wireit",
76
+ "compile": "wireit",
77
+ "fix-license": "eslint src test --fix --rule \"header/header: [2]\"",
78
+ "format": "wireit",
79
+ "link-check": "wireit",
80
+ "lint": "wireit",
81
+ "readme": "oclif readme --no-aliases",
82
+ "test": "wireit",
83
+ "test:coverage": "vitest run --coverage --project simply-aep",
84
+ "test:nuts": "vitest run --config ../../vitest.nuts.config.ts --project simply-aep",
85
+ "test:only": "wireit",
86
+ "test:watch": "vitest watch --project simply-aep"
87
+ },
88
+ "wireit": {
89
+ "build": {
90
+ "dependencies": [
91
+ "command-snapshot",
92
+ "compile",
93
+ "lint"
94
+ ]
95
+ },
96
+ "compile": {
97
+ "command": "tsc -p . --pretty --incremental",
98
+ "files": [
99
+ "src/**/*.ts",
100
+ "**/tsconfig.json",
101
+ "../../tsconfig.json",
102
+ "messages/**"
103
+ ],
104
+ "output": [
105
+ "lib/**",
106
+ "*.tsbuildinfo"
107
+ ],
108
+ "clean": "if-file-deleted"
109
+ },
110
+ "format": {
111
+ "command": "prettier --write \"+(src|test|schemas)/**/*.+(ts|js|json)|command-snapshot.json\"",
112
+ "files": [
113
+ "src/**/*.ts",
114
+ "test/**/*.ts",
115
+ "schemas/**/*.json",
116
+ "command-snapshot.json",
117
+ ".prettier*"
118
+ ],
119
+ "output": []
120
+ },
121
+ "lint": {
122
+ "command": "eslint src test --color --cache --cache-location .eslintcache",
123
+ "files": [
124
+ "src/**/*.ts",
125
+ "test/**/*.ts",
126
+ "messages/**",
127
+ "**/.eslint*",
128
+ "**/tsconfig.json",
129
+ "../../eslint.config.mjs",
130
+ "../../tsconfig.json"
131
+ ],
132
+ "output": []
133
+ },
134
+ "test": {
135
+ "dependencies": [
136
+ "test:compile",
137
+ "test:only",
138
+ "test:command-reference",
139
+ "lint",
140
+ "test:json-schema",
141
+ "link-check"
142
+ ]
143
+ },
144
+ "test:command-reference": {
145
+ "command": "node --loader ts-node/esm --no-warnings=ExperimentalWarning \"./bin/dev.js\" commandreference:generate --erroronwarnings",
146
+ "files": [
147
+ "src/**/*.ts",
148
+ "messages/**",
149
+ "package.json"
150
+ ],
151
+ "output": [
152
+ "tmp/root"
153
+ ]
154
+ },
155
+ "command-snapshot": {
156
+ "command": "node --loader ts-node/esm --no-warnings=ExperimentalWarning \"./bin/dev.js\" snapshot:generate && prettier --write command-snapshot.json",
157
+ "files": [
158
+ "src/**/*.ts"
159
+ ],
160
+ "output": [
161
+ "command-snapshot.json"
162
+ ],
163
+ "dependencies": [
164
+ "compile"
165
+ ]
166
+ },
167
+ "test:json-schema": {
168
+ "command": "node --loader ts-node/esm --no-warnings=ExperimentalWarning \"./bin/dev.js\" schema:compare",
169
+ "files": [
170
+ "src/**/*.ts",
171
+ "schemas"
172
+ ],
173
+ "output": []
174
+ },
175
+ "test:compile": {
176
+ "command": "tsc -p \"./test\" --pretty",
177
+ "files": [
178
+ "test/**/*.ts",
179
+ "**/tsconfig.json",
180
+ "../../tsconfig.json"
181
+ ],
182
+ "output": []
183
+ },
184
+ "test:only": {
185
+ "command": "vitest run --project simply-aep",
186
+ "env": {
187
+ "FORCE_COLOR": "2"
188
+ },
189
+ "files": [
190
+ "test/**/*.ts",
191
+ "src/**/*.ts",
192
+ "**/tsconfig.json",
193
+ "../../tsconfig.json",
194
+ "vitest.config.ts",
195
+ "!*.nut.ts"
196
+ ],
197
+ "output": []
198
+ },
199
+ "link-check": {
200
+ "command": "node -e \"process.exit(process.env.CI ? 0 : 1)\" || linkinator \"**/*.md\" --skip \"CHANGELOG.md|node_modules|test/|confluence.internal.salesforce.com|my.salesforce.com|localhost|example\\.(com|org|net)|github\\.com/SimplySF/simply-node|raw\\.githubusercontent\\.com/SimplySF/simply-node|blob/.*/lib/|%s\" --markdown --retry --directory-listing --verbosity error",
201
+ "files": [
202
+ "./*.md",
203
+ "./!(CHANGELOG).md",
204
+ "messages/**/*.md"
205
+ ],
206
+ "output": []
207
+ }
208
+ }
209
+ }