@salesforce/plugin-bre-to-cml 1.0.48 → 1.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 +79 -0
- package/lib/commands/cml/convert/surcharge-rules.d.ts +29 -0
- package/lib/commands/cml/convert/surcharge-rules.js +86 -0
- package/lib/commands/cml/convert/surcharge-rules.js.map +1 -0
- package/lib/commands/cml/convert/underwriting-rules.d.ts +32 -0
- package/lib/commands/cml/convert/underwriting-rules.js +136 -0
- package/lib/commands/cml/convert/underwriting-rules.js.map +1 -0
- package/lib/shared/bre-rules-generator.js +1 -57
- package/lib/shared/bre-rules-generator.js.map +1 -1
- package/lib/shared/cml-operators.d.ts +8 -0
- package/lib/shared/cml-operators.js +87 -0
- package/lib/shared/cml-operators.js.map +1 -0
- package/lib/shared/insurance/insurance-org.d.ts +9 -0
- package/lib/shared/insurance/insurance-org.js +40 -0
- package/lib/shared/insurance/insurance-org.js.map +1 -0
- package/lib/shared/insurance/insurance-rule-convert-command.d.ts +38 -0
- package/lib/shared/insurance/insurance-rule-convert-command.js +144 -0
- package/lib/shared/insurance/insurance-rule-convert-command.js.map +1 -0
- package/lib/shared/insurance/insurance-rule-generator.d.ts +26 -0
- package/lib/shared/insurance/insurance-rule-generator.js +144 -0
- package/lib/shared/insurance/insurance-rule-generator.js.map +1 -0
- package/lib/shared/insurance/models.d.ts +44 -0
- package/lib/shared/insurance/models.js +2 -0
- package/lib/shared/insurance/models.js.map +1 -0
- package/messages/cml.convert.insurance-shared.md +11 -0
- package/messages/cml.convert.surcharge-rules.md +17 -0
- package/messages/cml.convert.underwriting-rules.md +17 -0
- package/oclif.lock +352 -130
- package/oclif.manifest.json +199 -1
- package/package.json +7 -7
package/oclif.manifest.json
CHANGED
|
@@ -110,6 +110,204 @@
|
|
|
110
110
|
"prod-cfg-rules:convert:cml"
|
|
111
111
|
]
|
|
112
112
|
},
|
|
113
|
+
"cml:convert:surcharge-rules": {
|
|
114
|
+
"aliases": [],
|
|
115
|
+
"args": {},
|
|
116
|
+
"description": "Reads ProductSurcharge records from the org (or a JSON file), parses their RuleDefinition, and generates CML constraints that evaluate surcharge eligibility. Each surcharge rule becomes a named constraint that returns true/false. The command outputs a .cml file with the constraint model, an \\_Associations.csv file for ExpressionSetConstraintObj records, and a \\_RuleKeyMapping.json with the ProductSurcharge ID to RuleKey mapping for updating records.",
|
|
117
|
+
"examples": [
|
|
118
|
+
"<%= config.bin %> <%= command.id %> --cml-api SURCHARGE_CML --target-org myOrg",
|
|
119
|
+
"<%= config.bin %> <%= command.id %> --cml-api SURCHARGE_CML --surcharge-file path/to/surcharges.json --workspace-dir data --target-org myOrg"
|
|
120
|
+
],
|
|
121
|
+
"flags": {
|
|
122
|
+
"json": {
|
|
123
|
+
"description": "Format output as json.",
|
|
124
|
+
"helpGroup": "GLOBAL",
|
|
125
|
+
"name": "json",
|
|
126
|
+
"allowNo": false,
|
|
127
|
+
"type": "boolean"
|
|
128
|
+
},
|
|
129
|
+
"flags-dir": {
|
|
130
|
+
"helpGroup": "GLOBAL",
|
|
131
|
+
"name": "flags-dir",
|
|
132
|
+
"summary": "Import flag values from a directory.",
|
|
133
|
+
"hasDynamicHelp": false,
|
|
134
|
+
"multiple": false,
|
|
135
|
+
"type": "option"
|
|
136
|
+
},
|
|
137
|
+
"target-org": {
|
|
138
|
+
"char": "o",
|
|
139
|
+
"name": "target-org",
|
|
140
|
+
"noCacheDefault": true,
|
|
141
|
+
"required": true,
|
|
142
|
+
"summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
|
|
143
|
+
"hasDynamicHelp": true,
|
|
144
|
+
"multiple": false,
|
|
145
|
+
"type": "option"
|
|
146
|
+
},
|
|
147
|
+
"api-version": {
|
|
148
|
+
"description": "Override the api version used for api requests made by this command",
|
|
149
|
+
"name": "api-version",
|
|
150
|
+
"hasDynamicHelp": false,
|
|
151
|
+
"multiple": false,
|
|
152
|
+
"type": "option"
|
|
153
|
+
},
|
|
154
|
+
"cml-api": {
|
|
155
|
+
"char": "c",
|
|
156
|
+
"name": "cml-api",
|
|
157
|
+
"summary": "CML API Name. If omitted, auto-discovers an existing CML associated with the same root products.",
|
|
158
|
+
"hasDynamicHelp": false,
|
|
159
|
+
"multiple": false,
|
|
160
|
+
"type": "option"
|
|
161
|
+
},
|
|
162
|
+
"workspace-dir": {
|
|
163
|
+
"char": "d",
|
|
164
|
+
"name": "workspace-dir",
|
|
165
|
+
"summary": "Directory where output files will be written.",
|
|
166
|
+
"hasDynamicHelp": false,
|
|
167
|
+
"multiple": false,
|
|
168
|
+
"type": "option"
|
|
169
|
+
},
|
|
170
|
+
"update-records": {
|
|
171
|
+
"name": "update-records",
|
|
172
|
+
"summary": "Update source records in the org with RuleEngineType=ConstraintEngine.",
|
|
173
|
+
"allowNo": false,
|
|
174
|
+
"type": "boolean"
|
|
175
|
+
},
|
|
176
|
+
"surcharge-file": {
|
|
177
|
+
"char": "f",
|
|
178
|
+
"name": "surcharge-file",
|
|
179
|
+
"summary": "Optional JSON file with pre-exported ProductSurcharge records. If omitted, records are queried from the org.",
|
|
180
|
+
"hasDynamicHelp": false,
|
|
181
|
+
"multiple": false,
|
|
182
|
+
"type": "option"
|
|
183
|
+
}
|
|
184
|
+
},
|
|
185
|
+
"hasDynamicHelp": true,
|
|
186
|
+
"hiddenAliases": [],
|
|
187
|
+
"id": "cml:convert:surcharge-rules",
|
|
188
|
+
"pluginAlias": "@salesforce/plugin-bre-to-cml",
|
|
189
|
+
"pluginName": "@salesforce/plugin-bre-to-cml",
|
|
190
|
+
"pluginType": "core",
|
|
191
|
+
"strict": true,
|
|
192
|
+
"summary": "Converts BRE-based Product Surcharge dynamic rules to CML eligibility constraints.",
|
|
193
|
+
"enableJsonFlag": true,
|
|
194
|
+
"isESM": true,
|
|
195
|
+
"relativePath": [
|
|
196
|
+
"lib",
|
|
197
|
+
"commands",
|
|
198
|
+
"cml",
|
|
199
|
+
"convert",
|
|
200
|
+
"surcharge-rules.js"
|
|
201
|
+
],
|
|
202
|
+
"aliasPermutations": [],
|
|
203
|
+
"permutations": [
|
|
204
|
+
"cml:convert:surcharge-rules",
|
|
205
|
+
"convert:cml:surcharge-rules",
|
|
206
|
+
"convert:surcharge-rules:cml",
|
|
207
|
+
"cml:surcharge-rules:convert",
|
|
208
|
+
"surcharge-rules:cml:convert",
|
|
209
|
+
"surcharge-rules:convert:cml"
|
|
210
|
+
]
|
|
211
|
+
},
|
|
212
|
+
"cml:convert:underwriting-rules": {
|
|
213
|
+
"aliases": [],
|
|
214
|
+
"args": {},
|
|
215
|
+
"description": "Reads UnderwritingRule records from the org (or a JSON file), parses their DynamicRuleDefinition, and generates CML constraints that evaluate underwriting eligibility. Each rule becomes a named constraint that returns true/false. The command outputs a .cml file with the constraint model, an \\_Associations.csv file for ExpressionSetConstraintObj records, and a \\_RuleKeyMapping.json with the UnderwritingRule ID to RuleKey mapping for updating records.",
|
|
216
|
+
"examples": [
|
|
217
|
+
"<%= config.bin %> <%= command.id %> --cml-api UW_CML --target-org myOrg",
|
|
218
|
+
"<%= config.bin %> <%= command.id %> --cml-api UW_CML --uw-file data/underwriting.json --workspace-dir data --target-org myOrg"
|
|
219
|
+
],
|
|
220
|
+
"flags": {
|
|
221
|
+
"json": {
|
|
222
|
+
"description": "Format output as json.",
|
|
223
|
+
"helpGroup": "GLOBAL",
|
|
224
|
+
"name": "json",
|
|
225
|
+
"allowNo": false,
|
|
226
|
+
"type": "boolean"
|
|
227
|
+
},
|
|
228
|
+
"flags-dir": {
|
|
229
|
+
"helpGroup": "GLOBAL",
|
|
230
|
+
"name": "flags-dir",
|
|
231
|
+
"summary": "Import flag values from a directory.",
|
|
232
|
+
"hasDynamicHelp": false,
|
|
233
|
+
"multiple": false,
|
|
234
|
+
"type": "option"
|
|
235
|
+
},
|
|
236
|
+
"target-org": {
|
|
237
|
+
"char": "o",
|
|
238
|
+
"name": "target-org",
|
|
239
|
+
"noCacheDefault": true,
|
|
240
|
+
"required": true,
|
|
241
|
+
"summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
|
|
242
|
+
"hasDynamicHelp": true,
|
|
243
|
+
"multiple": false,
|
|
244
|
+
"type": "option"
|
|
245
|
+
},
|
|
246
|
+
"api-version": {
|
|
247
|
+
"description": "Override the api version used for api requests made by this command",
|
|
248
|
+
"name": "api-version",
|
|
249
|
+
"hasDynamicHelp": false,
|
|
250
|
+
"multiple": false,
|
|
251
|
+
"type": "option"
|
|
252
|
+
},
|
|
253
|
+
"cml-api": {
|
|
254
|
+
"char": "c",
|
|
255
|
+
"name": "cml-api",
|
|
256
|
+
"summary": "CML API Name. If omitted, auto-discovers an existing CML associated with the same root products.",
|
|
257
|
+
"hasDynamicHelp": false,
|
|
258
|
+
"multiple": false,
|
|
259
|
+
"type": "option"
|
|
260
|
+
},
|
|
261
|
+
"workspace-dir": {
|
|
262
|
+
"char": "d",
|
|
263
|
+
"name": "workspace-dir",
|
|
264
|
+
"summary": "Directory where output files will be written.",
|
|
265
|
+
"hasDynamicHelp": false,
|
|
266
|
+
"multiple": false,
|
|
267
|
+
"type": "option"
|
|
268
|
+
},
|
|
269
|
+
"update-records": {
|
|
270
|
+
"name": "update-records",
|
|
271
|
+
"summary": "Update source records in the org with RuleEngineType=ConstraintEngine.",
|
|
272
|
+
"allowNo": false,
|
|
273
|
+
"type": "boolean"
|
|
274
|
+
},
|
|
275
|
+
"uw-file": {
|
|
276
|
+
"char": "f",
|
|
277
|
+
"name": "uw-file",
|
|
278
|
+
"summary": "Optional JSON file with pre-exported UnderwritingRule records. If omitted, records are queried from the org.",
|
|
279
|
+
"hasDynamicHelp": false,
|
|
280
|
+
"multiple": false,
|
|
281
|
+
"type": "option"
|
|
282
|
+
}
|
|
283
|
+
},
|
|
284
|
+
"hasDynamicHelp": true,
|
|
285
|
+
"hiddenAliases": [],
|
|
286
|
+
"id": "cml:convert:underwriting-rules",
|
|
287
|
+
"pluginAlias": "@salesforce/plugin-bre-to-cml",
|
|
288
|
+
"pluginName": "@salesforce/plugin-bre-to-cml",
|
|
289
|
+
"pluginType": "core",
|
|
290
|
+
"strict": true,
|
|
291
|
+
"summary": "Converts BRE-based Insurance Underwriting dynamic rules to CML eligibility constraints.",
|
|
292
|
+
"enableJsonFlag": true,
|
|
293
|
+
"isESM": true,
|
|
294
|
+
"relativePath": [
|
|
295
|
+
"lib",
|
|
296
|
+
"commands",
|
|
297
|
+
"cml",
|
|
298
|
+
"convert",
|
|
299
|
+
"underwriting-rules.js"
|
|
300
|
+
],
|
|
301
|
+
"aliasPermutations": [],
|
|
302
|
+
"permutations": [
|
|
303
|
+
"cml:convert:underwriting-rules",
|
|
304
|
+
"convert:cml:underwriting-rules",
|
|
305
|
+
"convert:underwriting-rules:cml",
|
|
306
|
+
"cml:underwriting-rules:convert",
|
|
307
|
+
"underwriting-rules:cml:convert",
|
|
308
|
+
"underwriting-rules:convert:cml"
|
|
309
|
+
]
|
|
310
|
+
},
|
|
113
311
|
"cml:import:as-expression-set": {
|
|
114
312
|
"aliases": [],
|
|
115
313
|
"args": {},
|
|
@@ -205,5 +403,5 @@
|
|
|
205
403
|
]
|
|
206
404
|
}
|
|
207
405
|
},
|
|
208
|
-
"version": "1.0
|
|
406
|
+
"version": "1.1.0"
|
|
209
407
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforce/plugin-bre-to-cml",
|
|
3
3
|
"description": "Plugin for migrating BRE based configurator rules to CML.",
|
|
4
|
-
"version": "1.0
|
|
4
|
+
"version": "1.1.0",
|
|
5
5
|
"salesforceRelease": "256.11",
|
|
6
6
|
"dependencies": {
|
|
7
7
|
"@oclif/core": "^4",
|
|
@@ -11,15 +11,15 @@
|
|
|
11
11
|
"got": "12"
|
|
12
12
|
},
|
|
13
13
|
"devDependencies": {
|
|
14
|
-
"@oclif/plugin-command-snapshot": "^5.3.
|
|
14
|
+
"@oclif/plugin-command-snapshot": "^5.3.22",
|
|
15
15
|
"@oclif/test": "^4.1.18",
|
|
16
|
-
"@salesforce/cli-plugins-testkit": "^5.3.
|
|
16
|
+
"@salesforce/cli-plugins-testkit": "^5.3.58",
|
|
17
17
|
"@salesforce/dev-scripts": "^11.0.4",
|
|
18
|
-
"@salesforce/plugin-command-reference": "^3.1.
|
|
18
|
+
"@salesforce/plugin-command-reference": "^3.1.106",
|
|
19
19
|
"@types/node": "^22.19.19",
|
|
20
20
|
"eslint-config-salesforce-license": "^1.0.2",
|
|
21
21
|
"eslint-plugin-sf-plugin": "^1.20.33",
|
|
22
|
-
"oclif": "^4.23.
|
|
22
|
+
"oclif": "^4.23.8",
|
|
23
23
|
"ts-node": "^10.9.2",
|
|
24
24
|
"typescript": "^5.9.3"
|
|
25
25
|
},
|
|
@@ -221,7 +221,7 @@
|
|
|
221
221
|
"type": "module",
|
|
222
222
|
"author": "George Kibilov",
|
|
223
223
|
"sfdx": {
|
|
224
|
-
"publicKeyUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-bre-to-cml/1.0.
|
|
225
|
-
"signatureUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-bre-to-cml/1.0.
|
|
224
|
+
"publicKeyUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-bre-to-cml/1.1.0.crt",
|
|
225
|
+
"signatureUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-bre-to-cml/1.1.0.sig"
|
|
226
226
|
}
|
|
227
227
|
}
|