@simplysf/simply-aep 0.6.1 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +208 -579
- package/lib/commands/simply/aep/at4dx/binding/create.d.ts +28 -0
- package/lib/commands/simply/aep/at4dx/binding/create.js +116 -0
- package/lib/commands/simply/aep/at4dx/binding/create.js.map +1 -0
- package/lib/commands/simply/aep/at4dx/binding/list.js +1 -1
- package/lib/commands/simply/aep/at4dx/binding/list.js.map +1 -1
- package/lib/commands/simply/aep/at4dx/binding/update.d.ts +29 -0
- package/lib/commands/simply/aep/at4dx/binding/update.js +119 -0
- package/lib/commands/simply/aep/at4dx/binding/update.js.map +1 -0
- package/lib/commands/simply/aep/at4dx/binding/validate.d.ts +23 -0
- package/lib/commands/simply/aep/at4dx/binding/validate.js +143 -0
- package/lib/commands/simply/aep/at4dx/binding/validate.js.map +1 -0
- package/lib/common/bindingWriteError.d.ts +14 -0
- package/lib/common/bindingWriteError.js +58 -0
- package/lib/common/bindingWriteError.js.map +1 -0
- package/messages/simply.aep.at4dx.binding.create.md +123 -0
- package/messages/simply.aep.at4dx.binding.update.md +121 -0
- package/messages/simply.aep.at4dx.binding.validate.md +65 -0
- package/messages/simply.aep.at4dx.domain-process-binding.validate.md +1 -1
- package/package.json +3 -3
|
@@ -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
|
|
@@ -4,7 +4,7 @@ Validate the AT4DX Trigger Action Framework bindings configured in an org or loc
|
|
|
4
4
|
|
|
5
5
|
# description
|
|
6
6
|
|
|
7
|
-
Reads AT4DX's Trigger Action Framework Custom Metadata Type — `DomainProcessBinding__mdt` — either from a live org or from local Salesforce DX source, and checks it for problems `simply aep at4dx domain-process-binding list` doesn't fail on: two active records silently fighting over the same execution slot, a binding with no resolvable SObject, a binding whose declared process context doesn't match the field that's actually populated (so it never runs), the same DeveloperName defined more than once,
|
|
7
|
+
Reads AT4DX's Trigger Action Framework Custom Metadata Type — `DomainProcessBinding__mdt` — either from a live org or from local Salesforce DX source, and checks it for problems `simply aep at4dx domain-process-binding list` doesn't fail on: two active records silently fighting over the same execution slot, a binding with no resolvable SObject, a binding whose declared process context doesn't match the field that's actually populated (so it never runs), the same DeveloperName defined more than once, an ambiguous SObject reference, RelatedDomainBindingSObject__c set to a standard object that can't actually go through an EntityDefinition relationship, and RelatedDomainBindingSObjectAlternate__c set to an object that didn't need the Alternate field. Exactly one of `--target-org` or `--source-dir` must be specified.
|
|
8
8
|
|
|
9
9
|
Prints a table of every issue found. When --sobject is specified, scan-wide issues (a duplicate DeveloperName, or a binding with no resolvable SObject) print in their own section below the filtered table, since they can't be attributed to one SObject. 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 wiring problems before they reach an org.
|
|
10
10
|
|
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.
|
|
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.
|
|
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": "
|
|
211
|
+
"gitHead": "4c25233b2880738c9ce91617035ba40ccabad061"
|
|
212
212
|
}
|