rflib-plugin 0.23.1 → 0.23.3

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.
Files changed (2) hide show
  1. package/oclif.manifest.json +973 -973
  2. package/package.json +1 -1
@@ -93,14 +93,12 @@
93
93
  "upgrade:packages:rflib"
94
94
  ]
95
95
  },
96
- "rflib:debug:applicationevents:get": {
96
+ "rflib:logging:apex:instrument": {
97
97
  "aliases": [],
98
98
  "args": {},
99
- "description": "Retrieves rflib_Application_Event__c records from the target org via the Salesforce REST API.\nApplication Events are business-level events used to track feature adoption, user actions, and domain-specific milestones.\nResults are ordered by Occurred_On__c descending (most recent first).\n\nRequires the RFLIB base package to be installed in the target org and the running user to be assigned the rflib_Ops_Center_Access permission set (or have equivalent read access to rflib_Application_Event__c).\nFor installation instructions, visit: https://github.com/j-fischer/rflib",
99
+ "description": "Analyzes Apex classes and adds RFLIB logging statements for method entry and error handling. Adds class-level logger initialization if not already present. \nFor Apex Test classes, the `@TestSetup` method will be updated to include `rflib_TestUtil.prepareLoggerForUnitTests();` to avoid test failures caused by the logging framework.",
100
100
  "examples": [
101
- "Get all application events from the default org:\n$ sf rflib debug applicationevents get --target-org myOrg",
102
- "Get events filtered by name and date range:\n$ sf rflib debug applicationevents get --target-org myOrg --event-name \"order-%\" --start-date 2024-01-01T00:00:00Z",
103
- "Get events related to a specific record with a custom limit:\n$ sf rflib debug applicationevents get --target-org myOrg --related-record-id 0017000000XXXXXX --record-limit 50"
101
+ "- Add logging statements to all Apex classes in a directory:\n\n$ sf rflib logging apex instrument --sourcepath force-app/main/default/classes\n\n- Preview changes without modifying files:\n\n$ sf rflib logging apex instrument --sourcepath force-app/main/default/classes --dryrun\n\n- Add logging statements and format code:\n\n$ sf rflib logging apex instrument --sourcepath force-app/main/default/classes --prettier"
104
102
  ],
105
103
  "flags": {
106
104
  "json": {
@@ -118,116 +116,133 @@
118
116
  "multiple": false,
119
117
  "type": "option"
120
118
  },
121
- "target-org": {
122
- "char": "o",
123
- "description": "The username or alias of the Salesforce org containing the RFLIB base package.",
124
- "name": "target-org",
125
- "noCacheDefault": true,
126
- "required": true,
127
- "summary": "Username or alias of the target org.",
128
- "hasDynamicHelp": true,
129
- "multiple": false,
130
- "type": "option"
131
- },
132
- "event-name": {
133
- "char": "e",
134
- "description": "Filter Application Events by their Event_Name__c field. Use the % character as a wildcard for partial matches, for example \"order-%\".",
135
- "name": "event-name",
136
- "summary": "Filter by event name. Use % as a wildcard.",
137
- "hasDynamicHelp": false,
138
- "multiple": false,
139
- "type": "option"
140
- },
141
- "start-date": {
119
+ "sourcepath": {
142
120
  "char": "s",
143
- "description": "Only return events where Occurred_On__c is on or after this date. Must be in ISO 8601 format, e.g. 2024-01-01T00:00:00Z.",
144
- "name": "start-date",
145
- "summary": "Filter events on or after this ISO 8601 date.",
121
+ "description": "Path to the source directory containing Apex classes that should be instrumented with RFLIB logging statements. Test classes (ending with 'Test.cls') are automatically excluded.",
122
+ "name": "sourcepath",
123
+ "required": true,
124
+ "summary": "Directory containing Apex classes to instrument with logging.",
146
125
  "hasDynamicHelp": false,
147
126
  "multiple": false,
148
127
  "type": "option"
149
128
  },
150
- "end-date": {
129
+ "dryrun": {
151
130
  "char": "d",
152
- "description": "Only return events where Occurred_On__c is on or before this date. Must be in ISO 8601 format, e.g. 2024-12-31T23:59:59Z.",
153
- "name": "end-date",
154
- "summary": "Filter events on or before this ISO 8601 date.",
155
- "hasDynamicHelp": false,
156
- "multiple": false,
157
- "type": "option"
131
+ "description": "When enabled, shows which files would be modified without making actual changes. Useful for reviewing the impact before applying changes.",
132
+ "name": "dryrun",
133
+ "summary": "Preview changes without modifying files.",
134
+ "allowNo": false,
135
+ "type": "boolean"
158
136
  },
159
- "related-record-id": {
160
- "char": "r",
161
- "description": "Only return events associated with this specific record ID.",
162
- "name": "related-record-id",
163
- "summary": "Filter by Related_Record_ID__c (exact match).",
137
+ "prettier": {
138
+ "char": "p",
139
+ "description": "When enabled, formats the modified Apex files using prettier-plugin-apex after adding logging statements. Maintains consistent code style with:\n\n- 120 character line width\n- 4 space indentation\n- Single quotes for strings\n- No tabs",
140
+ "name": "prettier",
141
+ "summary": "Format modified files using Prettier.",
142
+ "allowNo": false,
143
+ "type": "boolean"
144
+ },
145
+ "no-if": {
146
+ "description": "When provided, the command will not add log statements inside of `if` and `else` blocks.",
147
+ "name": "no-if",
148
+ "summary": "Exclude the instrumentation of if-else statements.",
149
+ "allowNo": false,
150
+ "type": "boolean"
151
+ },
152
+ "no-catch": {
153
+ "description": "When provided, the command will not add error log statements inside of `catch` blocks.",
154
+ "name": "no-catch",
155
+ "summary": "Exclude the instrumentation of catch blocks.",
156
+ "allowNo": false,
157
+ "type": "boolean"
158
+ },
159
+ "skip-instrumented": {
160
+ "description": "When provided, the command will not add log statements to any Apex class that contains the `rflib_Logger` reference.",
161
+ "name": "skip-instrumented",
162
+ "summary": "Skips any files where a logger is already present.",
163
+ "allowNo": false,
164
+ "type": "boolean"
165
+ },
166
+ "verbose": {
167
+ "char": "v",
168
+ "description": "When provided with --dryrun, prints the paths of the files that would be modified.",
169
+ "name": "verbose",
170
+ "summary": "Enable verbose output.",
171
+ "allowNo": false,
172
+ "type": "boolean"
173
+ },
174
+ "exclude": {
175
+ "char": "e",
176
+ "description": "Exclude specific files or directories that match the provided glob pattern. For example, use --exclude \"**/Generated_*.cls\" to skip auto-generated classes.",
177
+ "name": "exclude",
178
+ "summary": "Exclude files or directories from instrumentation based on a glob pattern.",
164
179
  "hasDynamicHelp": false,
165
180
  "multiple": false,
166
181
  "type": "option"
167
182
  },
168
- "record-limit": {
169
- "char": "l",
170
- "description": "Controls how many Application Event records are returned. Defaults to 200. Maximum allowed value is 2000.",
171
- "name": "record-limit",
172
- "summary": "Maximum number of records to return (default 200, max 2000).",
183
+ "concurrency": {
184
+ "char": "c",
185
+ "description": "Controls the maximum number of files to process at the same time. This is useful in very large codebases to prevent excessive memory usage or file descriptor exhaustion. Defaults to 10.",
186
+ "name": "concurrency",
187
+ "summary": "Limits the number of files processed concurrently.",
188
+ "default": 10,
173
189
  "hasDynamicHelp": false,
174
190
  "multiple": false,
175
191
  "type": "option"
176
192
  }
177
193
  },
178
- "hasDynamicHelp": true,
194
+ "hasDynamicHelp": false,
179
195
  "hiddenAliases": [],
180
- "id": "rflib:debug:applicationevents:get",
196
+ "id": "rflib:logging:apex:instrument",
181
197
  "pluginAlias": "rflib-plugin",
182
198
  "pluginName": "rflib-plugin",
183
199
  "pluginType": "core",
184
200
  "strict": true,
185
- "summary": "Query RFLIB Application Events from a Salesforce org.",
201
+ "summary": "Instrument Apex classes with RFLIB logging statements automatically.",
186
202
  "enableJsonFlag": true,
187
203
  "isESM": true,
188
204
  "relativePath": [
189
205
  "lib",
190
206
  "commands",
191
207
  "rflib",
192
- "debug",
193
- "applicationevents",
194
- "get.js"
208
+ "logging",
209
+ "apex",
210
+ "instrument.js"
195
211
  ],
196
212
  "aliasPermutations": [],
197
213
  "permutations": [
198
- "rflib:debug:applicationevents:get",
199
- "debug:rflib:applicationevents:get",
200
- "debug:applicationevents:rflib:get",
201
- "debug:applicationevents:get:rflib",
202
- "rflib:applicationevents:debug:get",
203
- "applicationevents:rflib:debug:get",
204
- "applicationevents:debug:rflib:get",
205
- "applicationevents:debug:get:rflib",
206
- "rflib:applicationevents:get:debug",
207
- "applicationevents:rflib:get:debug",
208
- "applicationevents:get:rflib:debug",
209
- "applicationevents:get:debug:rflib",
210
- "rflib:debug:get:applicationevents",
211
- "debug:rflib:get:applicationevents",
212
- "debug:get:rflib:applicationevents",
213
- "debug:get:applicationevents:rflib",
214
- "rflib:get:debug:applicationevents",
215
- "get:rflib:debug:applicationevents",
216
- "get:debug:rflib:applicationevents",
217
- "get:debug:applicationevents:rflib",
218
- "rflib:get:applicationevents:debug",
219
- "get:rflib:applicationevents:debug",
220
- "get:applicationevents:rflib:debug",
221
- "get:applicationevents:debug:rflib"
214
+ "rflib:logging:apex:instrument",
215
+ "logging:rflib:apex:instrument",
216
+ "logging:apex:rflib:instrument",
217
+ "logging:apex:instrument:rflib",
218
+ "rflib:apex:logging:instrument",
219
+ "apex:rflib:logging:instrument",
220
+ "apex:logging:rflib:instrument",
221
+ "apex:logging:instrument:rflib",
222
+ "rflib:apex:instrument:logging",
223
+ "apex:rflib:instrument:logging",
224
+ "apex:instrument:rflib:logging",
225
+ "apex:instrument:logging:rflib",
226
+ "rflib:logging:instrument:apex",
227
+ "logging:rflib:instrument:apex",
228
+ "logging:instrument:rflib:apex",
229
+ "logging:instrument:apex:rflib",
230
+ "rflib:instrument:logging:apex",
231
+ "instrument:rflib:logging:apex",
232
+ "instrument:logging:rflib:apex",
233
+ "instrument:logging:apex:rflib",
234
+ "rflib:instrument:apex:logging",
235
+ "instrument:rflib:apex:logging",
236
+ "instrument:apex:rflib:logging",
237
+ "instrument:apex:logging:rflib"
222
238
  ]
223
239
  },
224
- "rflib:debug:logarchives:get": {
240
+ "rflib:logging:aura:instrument": {
225
241
  "aliases": [],
226
242
  "args": {},
227
- "description": "Retrieves rflib_Logs_Archive__b records from the target org's big object store via the Salesforce REST API.\nEach log record contains log level, context, request ID, and full log messages in the format: [timestamp]|[LEVEL]|[TRACE_ID]|[CONTEXT]|[MESSAGE].\n\nRequires the RFLIB base package to be installed in the target org and the running user to be assigned the rflib_Ops_Center_Access permission set (or have equivalent read access to rflib_Logs_Archive__b).\nFor installation instructions, visit: https://github.com/j-fischer/rflib",
243
+ "description": "Analyzes Aura Component files and adds RFLIB logging statements for:\n- Method entry logging with parameter values in Controller, Helper, and Renderer files\n- Error logging in try-catch blocks\n- Error logging in Promise catch handlers\n- Adds rflibLoggerCmp component if not present\n- Replaces console.log and similar method invocations\n- Formats modified files using Prettier (optional)\n\nThe command processes:\n- Component (.cmp) files to add the logger component\n- Controller (.js) files for method instrumentation\n- Helper (.js) files for method instrumentation\n- Renderer (.js) files for method instrumentation",
228
244
  "examples": [
229
- "Get log archives from the last 24 hours:\n$ sf rflib debug logarchives get --target-org myOrg",
230
- "Get log archives for a specific date range:\n$ sf rflib debug logarchives get --target-org myOrg --start-date 2024-01-01T00:00:00Z --end-date 2024-01-02T00:00:00Z"
245
+ "- Add logging to all aura files:\n$ sf rflib logging aura instrument --sourcepath force-app\n\n- Preview changes:\n$ sf rflib logging aura instrument --sourcepath force-app --dryrun\n\n- Add logging and format code:\n$ sf rflib logging aura instrument --sourcepath force-app --prettier\n\n- Process specific component:\n$ sf rflib logging aura instrument --sourcepath force-app/main/default/aura/myComponent"
231
246
  ],
232
247
  "flags": {
233
248
  "json": {
@@ -245,89 +260,129 @@
245
260
  "multiple": false,
246
261
  "type": "option"
247
262
  },
248
- "target-org": {
249
- "char": "o",
250
- "description": "The username or alias of the Salesforce org containing the RFLIB base package.",
251
- "name": "target-org",
252
- "noCacheDefault": true,
263
+ "sourcepath": {
264
+ "char": "s",
265
+ "description": "Path to the source directory containing Aura components that should be instrumented with RFLIB logging statements. The command will:\n- Scan for 'aura' directories recursively\n- Process all Aura components found\n- Add <c:rflibLoggerCmp> to component files\n- Add logging statements to JavaScript files\n- Initialize logger in methods using component.find()",
266
+ "name": "sourcepath",
253
267
  "required": true,
254
- "summary": "Username or alias of the target org.",
255
- "hasDynamicHelp": true,
268
+ "summary": "Directory containing Aura components to instrument with logging.",
269
+ "hasDynamicHelp": false,
256
270
  "multiple": false,
257
271
  "type": "option"
258
272
  },
259
- "start-date": {
260
- "char": "s",
261
- "description": "Only return log archives created on or after this date. Must be in ISO 8601 format, e.g. 2024-01-01T00:00:00Z. Defaults to 24 hours ago if omitted.",
262
- "name": "start-date",
263
- "summary": "Start of the date range in ISO 8601 format. Defaults to 24 hours ago.",
273
+ "dryrun": {
274
+ "char": "d",
275
+ "description": "When enabled, shows which files would be modified without making actual changes. Useful for reviewing the impact before applying changes. Shows:\n- Files that would be modified\n- Number of processed files\n- Number of modified files\n- Number of formatted files",
276
+ "name": "dryrun",
277
+ "summary": "Preview changes without modifying files.",
278
+ "allowNo": false,
279
+ "type": "boolean"
280
+ },
281
+ "prettier": {
282
+ "char": "p",
283
+ "description": "When enabled, formats the modified JavaScript files using Prettier after adding logging statements. Maintains consistent code style with:\n- 120 character line width\n- 4 space indentation\n- Single quotes for strings\n- No tabs\n- No trailing commas",
284
+ "name": "prettier",
285
+ "summary": "Format modified files using Prettier.",
286
+ "allowNo": false,
287
+ "type": "boolean"
288
+ },
289
+ "no-if": {
290
+ "description": "When provided, the command will not add log statements inside of `if` and `else` blocks.",
291
+ "name": "no-if",
292
+ "summary": "Exclude the instrumentation of if-else statements.",
293
+ "allowNo": false,
294
+ "type": "boolean"
295
+ },
296
+ "skip-instrumented": {
297
+ "description": "When provided, the command will not add log statements to any Aura component that contains the `` component.",
298
+ "name": "skip-instrumented",
299
+ "summary": "Skips any files where a logger is already present.",
300
+ "allowNo": false,
301
+ "type": "boolean"
302
+ },
303
+ "verbose": {
304
+ "char": "v",
305
+ "description": "When provided with --dryrun, prints the paths of the files that would be modified.",
306
+ "name": "verbose",
307
+ "summary": "Enable verbose output.",
308
+ "allowNo": false,
309
+ "type": "boolean"
310
+ },
311
+ "exclude": {
312
+ "char": "e",
313
+ "description": "Exclude specific files or directories that match the provided glob pattern. For example, use --exclude \"**/Generated_*.cmp\" to skip auto-generated components.",
314
+ "name": "exclude",
315
+ "summary": "Exclude files or directories from instrumentation based on a glob pattern.",
264
316
  "hasDynamicHelp": false,
265
317
  "multiple": false,
266
318
  "type": "option"
267
319
  },
268
- "end-date": {
269
- "char": "d",
270
- "description": "Only return log archives created on or before this date. Must be in ISO 8601 format, e.g. 2024-12-31T23:59:59Z. Defaults to the current time if omitted.",
271
- "name": "end-date",
272
- "summary": "End of the date range in ISO 8601 format. Defaults to now.",
320
+ "concurrency": {
321
+ "char": "c",
322
+ "description": "Controls the maximum number of files to process at the same time. This is useful in very large codebases to prevent excessive memory usage or file descriptor exhaustion. Defaults to 10.",
323
+ "name": "concurrency",
324
+ "summary": "Limits the number of files processed concurrently.",
325
+ "default": 10,
273
326
  "hasDynamicHelp": false,
274
327
  "multiple": false,
275
328
  "type": "option"
276
329
  }
277
330
  },
278
- "hasDynamicHelp": true,
331
+ "hasDynamicHelp": false,
279
332
  "hiddenAliases": [],
280
- "id": "rflib:debug:logarchives:get",
333
+ "id": "rflib:logging:aura:instrument",
281
334
  "pluginAlias": "rflib-plugin",
282
335
  "pluginName": "rflib-plugin",
283
336
  "pluginType": "core",
284
337
  "strict": true,
285
- "summary": "Query RFLIB log archives from a Salesforce org.",
338
+ "summary": "Instrument Aura Components with RFLIB logging statements automatically.",
286
339
  "enableJsonFlag": true,
287
340
  "isESM": true,
288
341
  "relativePath": [
289
342
  "lib",
290
343
  "commands",
291
344
  "rflib",
292
- "debug",
293
- "logarchives",
294
- "get.js"
345
+ "logging",
346
+ "aura",
347
+ "instrument.js"
295
348
  ],
296
349
  "aliasPermutations": [],
297
350
  "permutations": [
298
- "rflib:debug:logarchives:get",
299
- "debug:rflib:logarchives:get",
300
- "debug:logarchives:rflib:get",
301
- "debug:logarchives:get:rflib",
302
- "rflib:logarchives:debug:get",
303
- "logarchives:rflib:debug:get",
304
- "logarchives:debug:rflib:get",
305
- "logarchives:debug:get:rflib",
306
- "rflib:logarchives:get:debug",
307
- "logarchives:rflib:get:debug",
308
- "logarchives:get:rflib:debug",
309
- "logarchives:get:debug:rflib",
310
- "rflib:debug:get:logarchives",
311
- "debug:rflib:get:logarchives",
312
- "debug:get:rflib:logarchives",
313
- "debug:get:logarchives:rflib",
314
- "rflib:get:debug:logarchives",
315
- "get:rflib:debug:logarchives",
316
- "get:debug:rflib:logarchives",
317
- "get:debug:logarchives:rflib",
318
- "rflib:get:logarchives:debug",
319
- "get:rflib:logarchives:debug",
320
- "get:logarchives:rflib:debug",
321
- "get:logarchives:debug:rflib"
351
+ "rflib:logging:aura:instrument",
352
+ "logging:rflib:aura:instrument",
353
+ "logging:aura:rflib:instrument",
354
+ "logging:aura:instrument:rflib",
355
+ "rflib:aura:logging:instrument",
356
+ "aura:rflib:logging:instrument",
357
+ "aura:logging:rflib:instrument",
358
+ "aura:logging:instrument:rflib",
359
+ "rflib:aura:instrument:logging",
360
+ "aura:rflib:instrument:logging",
361
+ "aura:instrument:rflib:logging",
362
+ "aura:instrument:logging:rflib",
363
+ "rflib:logging:instrument:aura",
364
+ "logging:rflib:instrument:aura",
365
+ "logging:instrument:rflib:aura",
366
+ "logging:instrument:aura:rflib",
367
+ "rflib:instrument:logging:aura",
368
+ "instrument:rflib:logging:aura",
369
+ "instrument:logging:rflib:aura",
370
+ "instrument:logging:aura:rflib",
371
+ "rflib:instrument:aura:logging",
372
+ "instrument:rflib:aura:logging",
373
+ "instrument:aura:rflib:logging",
374
+ "instrument:aura:logging:rflib"
322
375
  ]
323
376
  },
324
- "rflib:debug:recordaccess:get": {
377
+ "rflib:logging:flow:instrument": {
325
378
  "aliases": [],
326
379
  "args": {},
327
- "description": "Answers questions such as \"Why can't this user see this record?\". For each record, the command returns the user's access from UserRecordAccess (read, edit, delete, transfer, and full access), which includes sharing: the org-wide default, the role hierarchy, sharing rules, teams, and manual shares.\n\nThe result also contains the user's object permissions on each record's object, and notes that tell apart missing object permissions from missing sharing. Use userpermissions check to find out which profile or permission set grants an object permission.\n\nYou can check up to 200 records at a time.\n\nThe command only reads standard objects, so the RFLIB package doesn't need to be installed.",
380
+ "description": "Automatically adds RFLIB logging statements to Salesforce Flows to provide enhanced tracking and debugging capabilities. Works with both standard Flows and Auto-Launched Flows. Instruments flow invocations and decision paths with logging actions, and logs an error on the fault path of every element that can fail. Existing fault paths continue after the error is logged. Elements without a fault path get one that logs the error and then terminates the transaction, so the Flow still fails as before; this requires the Terminate Transaction option of the RFLIB Log Message action, which was added in RFLIB 11.4.0. The command checks the RFLIB version in the target org, using the installed RFLIB package or, if RFLIB was deployed as source, its RFLIB_Version custom label, and skips the fault paths if the org runs an older version, RFLIB is not found, or the version cannot be determined. Also sets the CanvasMode to AUTO_LAYOUT_CANVAS for better flow visualization while preserving the original processType.",
328
381
  "examples": [
329
- "Check a user's access to a record:\n$ sf rflib debug recordaccess get --target-org myOrg --user jane@example.com --record-id 001XXXXXXXXXXXXXXX",
330
- "Check several records at once:\n$ sf rflib debug recordaccess get --target-org myOrg --user 0057000000XXXXXX --record-id 001XXXXXXXXXXXXXXX --record-id 006XXXXXXXXXXXXXXX"
382
+ "<%= config.bin %> <%= command.id %> --target-org myOrg --sourcepath force-app",
383
+ "<%= config.bin %> <%= command.id %> --target-org myOrg --sourcepath force-app --dryrun",
384
+ "<%= config.bin %> <%= command.id %> --target-org myOrg --sourcepath force-app --skip-instrumented",
385
+ "<%= config.bin %> <%= command.id %> --target-org myOrg --sourcepath force-app --skip-fault-paths"
331
386
  ],
332
387
  "flags": {
333
388
  "json": {
@@ -347,7 +402,7 @@
347
402
  },
348
403
  "target-org": {
349
404
  "char": "o",
350
- "description": "The username or alias of the Salesforce org that contains the records.",
405
+ "description": "The Salesforce org the instrumented Flows will be deployed to. The fault paths this command creates use the Terminate Transaction option of the RFLIB Log Message action, which was added in RFLIB 11.4.0, so Flows that use it fail to deploy to an org running an older RFLIB version. Before changing any files, the command runs a read-only Tooling API query for the packages installed in this org. If RFLIB is not installed as a package, for example because it was deployed as source, a second query reads the RFLIB_Version custom label instead. If the org runs RFLIB 11.4.0 or later, fault paths are instrumented; if it runs an older version, RFLIB is not found, or a query fails, they are skipped with a warning. Nothing in the org is changed. The flag is required even with --skip-fault-paths, although the org is not queried in that case.",
351
406
  "name": "target-org",
352
407
  "noCacheDefault": true,
353
408
  "required": true,
@@ -356,79 +411,118 @@
356
411
  "multiple": false,
357
412
  "type": "option"
358
413
  },
359
- "user": {
360
- "char": "u",
361
- "description": "The Salesforce User ID (15 or 18 characters) or the username of the user whose record access should be checked.",
362
- "name": "user",
414
+ "sourcepath": {
415
+ "char": "s",
416
+ "description": "Path to the source directory containing Flow files that should be instrumented with RFLIB logging statements. Processes .flow-meta.xml files with processType=\"Flow\" or \"AutoLaunchedFlow\".",
417
+ "name": "sourcepath",
363
418
  "required": true,
364
- "summary": "User ID (15 or 18 characters) or username of the user to check.",
419
+ "summary": "Directory containing Flow files to instrument with logging.",
365
420
  "hasDynamicHelp": false,
366
421
  "multiple": false,
367
422
  "type": "option"
368
423
  },
369
- "record-id": {
370
- "char": "r",
371
- "description": "The 15 or 18 character ID of a record to check. Specify --record-id up to 200 times.",
372
- "name": "record-id",
373
- "required": true,
374
- "summary": "ID of a record to check. Specify the flag multiple times to check several records.",
424
+ "dryrun": {
425
+ "char": "d",
426
+ "description": "When enabled, shows which files would be modified without making actual changes. Useful for reviewing the impact before applying changes.",
427
+ "name": "dryrun",
428
+ "summary": "Preview changes without modifying files.",
429
+ "allowNo": false,
430
+ "type": "boolean"
431
+ },
432
+ "skip-instrumented": {
433
+ "description": "When provided, the command will not add log statements to any Flows that already contain RFLIB logging actions.",
434
+ "name": "skip-instrumented",
435
+ "summary": "Skips any files where a logger is already present.",
436
+ "allowNo": false,
437
+ "type": "boolean"
438
+ },
439
+ "skip-fault-paths": {
440
+ "description": "When provided, the command will not add error logging to fault paths and will not create fault paths for elements that have none, regardless of the RFLIB version installed in the target org.",
441
+ "name": "skip-fault-paths",
442
+ "summary": "Skips logging errors on fault paths.",
443
+ "allowNo": false,
444
+ "type": "boolean"
445
+ },
446
+ "verbose": {
447
+ "char": "v",
448
+ "description": "When provided with --dryrun, prints the paths of the files that would be modified.",
449
+ "name": "verbose",
450
+ "summary": "Enable verbose output.",
451
+ "allowNo": false,
452
+ "type": "boolean"
453
+ },
454
+ "exclude": {
455
+ "char": "e",
456
+ "description": "Exclude specific files or directories that match the provided glob pattern. For example, use --exclude \"**/Test_*.flow-meta.xml\" to skip certain flows.",
457
+ "name": "exclude",
458
+ "summary": "Exclude files or directories from instrumentation based on a glob pattern.",
375
459
  "hasDynamicHelp": false,
376
- "multiple": true,
460
+ "multiple": false,
461
+ "type": "option"
462
+ },
463
+ "concurrency": {
464
+ "char": "c",
465
+ "description": "Controls the maximum number of files to process at the same time. This is useful in very large codebases to prevent excessive memory usage or file descriptor exhaustion. Defaults to 10.",
466
+ "name": "concurrency",
467
+ "summary": "Limits the number of files processed concurrently.",
468
+ "default": 10,
469
+ "hasDynamicHelp": false,
470
+ "multiple": false,
377
471
  "type": "option"
378
472
  }
379
473
  },
380
474
  "hasDynamicHelp": true,
381
475
  "hiddenAliases": [],
382
- "id": "rflib:debug:recordaccess:get",
476
+ "id": "rflib:logging:flow:instrument",
383
477
  "pluginAlias": "rflib-plugin",
384
478
  "pluginName": "rflib-plugin",
385
479
  "pluginType": "core",
386
480
  "strict": true,
387
- "summary": "Check a user's access to specific records, including sharing.",
481
+ "summary": "Adds RFLIB logging statements to Salesforce Flows.",
388
482
  "enableJsonFlag": true,
389
483
  "isESM": true,
390
484
  "relativePath": [
391
485
  "lib",
392
486
  "commands",
393
487
  "rflib",
394
- "debug",
395
- "recordaccess",
396
- "get.js"
488
+ "logging",
489
+ "flow",
490
+ "instrument.js"
397
491
  ],
398
492
  "aliasPermutations": [],
399
493
  "permutations": [
400
- "rflib:debug:recordaccess:get",
401
- "debug:rflib:recordaccess:get",
402
- "debug:recordaccess:rflib:get",
403
- "debug:recordaccess:get:rflib",
404
- "rflib:recordaccess:debug:get",
405
- "recordaccess:rflib:debug:get",
406
- "recordaccess:debug:rflib:get",
407
- "recordaccess:debug:get:rflib",
408
- "rflib:recordaccess:get:debug",
409
- "recordaccess:rflib:get:debug",
410
- "recordaccess:get:rflib:debug",
411
- "recordaccess:get:debug:rflib",
412
- "rflib:debug:get:recordaccess",
413
- "debug:rflib:get:recordaccess",
414
- "debug:get:rflib:recordaccess",
415
- "debug:get:recordaccess:rflib",
416
- "rflib:get:debug:recordaccess",
417
- "get:rflib:debug:recordaccess",
418
- "get:debug:rflib:recordaccess",
419
- "get:debug:recordaccess:rflib",
420
- "rflib:get:recordaccess:debug",
421
- "get:rflib:recordaccess:debug",
422
- "get:recordaccess:rflib:debug",
423
- "get:recordaccess:debug:rflib"
494
+ "rflib:logging:flow:instrument",
495
+ "logging:rflib:flow:instrument",
496
+ "logging:flow:rflib:instrument",
497
+ "logging:flow:instrument:rflib",
498
+ "rflib:flow:logging:instrument",
499
+ "flow:rflib:logging:instrument",
500
+ "flow:logging:rflib:instrument",
501
+ "flow:logging:instrument:rflib",
502
+ "rflib:flow:instrument:logging",
503
+ "flow:rflib:instrument:logging",
504
+ "flow:instrument:rflib:logging",
505
+ "flow:instrument:logging:rflib",
506
+ "rflib:logging:instrument:flow",
507
+ "logging:rflib:instrument:flow",
508
+ "logging:instrument:rflib:flow",
509
+ "logging:instrument:flow:rflib",
510
+ "rflib:instrument:logging:flow",
511
+ "instrument:rflib:logging:flow",
512
+ "instrument:logging:rflib:flow",
513
+ "instrument:logging:flow:rflib",
514
+ "rflib:instrument:flow:logging",
515
+ "instrument:rflib:flow:logging",
516
+ "instrument:flow:rflib:logging",
517
+ "instrument:flow:logging:rflib"
424
518
  ]
425
519
  },
426
- "rflib:debug:loggersettings:get": {
520
+ "rflib:logging:lwc:instrument": {
427
521
  "aliases": [],
428
522
  "args": {},
429
- "description": "Retrieves all rflib_Logger_Settings__c hierarchy custom setting records from the target org via the Salesforce REST API.\nReturns settings across org-wide defaults, profile overrides, and user overrides, along with embedded best-practice recommendations.\n\nUse \"sf rflib debug loggersettings update\" to apply changes.\n\nRequires the RFLIB base package to be installed in the target org and the running user to be assigned the rflib_Ops_Center_Access permission set (or have equivalent read access to rflib_Logger_Settings__c).\nFor installation instructions, visit: https://github.com/j-fischer/rflib",
523
+ "description": "Analyzes Lightning Web Component JavaScript files and adds RFLIB logging statements for:\n- Method entry logging with parameter values\n- Error logging in try-catch blocks\n- Error logging in Promise catch handlers\n- Condition logging in if/else blocks\n- Adds logger import if not present\n- Adds logger initialization if not present\n- Replaces console.log and similar method invocations\n- Formats modified files using Prettier (optional)",
430
524
  "examples": [
431
- "Read all logger settings from the target org:\n$ sf rflib debug loggersettings get --target-org myOrg"
525
+ "- Add logging to all LWC files:\n$ sf rflib logging lwc instrument --sourcepath force-app/main/default/lwc\n\n- Preview changes:\n$ sf rflib logging lwc instrument --sourcepath force-app/main/default/lwc --dryrun\n\n- Add logging and format code:\n$ sf rflib logging lwc instrument --sourcepath force-app/main/default/lwc --prettier\n\n- Process specific component:\n$ sf rflib logging lwc instrument --sourcepath force-app/main/default/lwc/myComponent"
432
526
  ],
433
527
  "flags": {
434
528
  "json": {
@@ -446,71 +540,128 @@
446
540
  "multiple": false,
447
541
  "type": "option"
448
542
  },
449
- "target-org": {
450
- "char": "o",
451
- "description": "The username or alias of the Salesforce org containing the RFLIB base package.",
452
- "name": "target-org",
453
- "noCacheDefault": true,
543
+ "sourcepath": {
544
+ "char": "s",
545
+ "description": "Path to the source directory containing Lightning Web Component JavaScript files that should be instrumented with RFLIB logging statements. Aura component files are automatically excluded. The command will:\n- Process all .js files in the directory and subdirectories\n- Skip files in 'aura' directories\n- Add import statement: import { createLogger } from 'c/rflibLogger'\n- Add logger initialization: const logger = createLogger('ComponentName')",
546
+ "name": "sourcepath",
454
547
  "required": true,
455
- "summary": "Username or alias of the target org.",
456
- "hasDynamicHelp": true,
548
+ "summary": "Directory containing LWC JavaScript files to instrument with logging.",
549
+ "hasDynamicHelp": false,
457
550
  "multiple": false,
458
551
  "type": "option"
459
- }
460
- },
461
- "hasDynamicHelp": true,
462
- "hiddenAliases": [],
463
- "id": "rflib:debug:loggersettings:get",
464
- "pluginAlias": "rflib-plugin",
465
- "pluginName": "rflib-plugin",
466
- "pluginType": "core",
467
- "strict": true,
468
- "summary": "Read all RFLIB Logger Settings from a Salesforce org.",
469
- "enableJsonFlag": true,
470
- "isESM": true,
471
- "relativePath": [
472
- "lib",
473
- "commands",
474
- "rflib",
475
- "debug",
476
- "loggersettings",
477
- "get.js"
478
- ],
479
- "aliasPermutations": [],
480
- "permutations": [
481
- "rflib:debug:loggersettings:get",
482
- "debug:rflib:loggersettings:get",
483
- "debug:loggersettings:rflib:get",
484
- "debug:loggersettings:get:rflib",
485
- "rflib:loggersettings:debug:get",
486
- "loggersettings:rflib:debug:get",
487
- "loggersettings:debug:rflib:get",
488
- "loggersettings:debug:get:rflib",
489
- "rflib:loggersettings:get:debug",
490
- "loggersettings:rflib:get:debug",
491
- "loggersettings:get:rflib:debug",
492
- "loggersettings:get:debug:rflib",
493
- "rflib:debug:get:loggersettings",
494
- "debug:rflib:get:loggersettings",
495
- "debug:get:rflib:loggersettings",
496
- "debug:get:loggersettings:rflib",
497
- "rflib:get:debug:loggersettings",
498
- "get:rflib:debug:loggersettings",
499
- "get:debug:rflib:loggersettings",
500
- "get:debug:loggersettings:rflib",
501
- "rflib:get:loggersettings:debug",
502
- "get:rflib:loggersettings:debug",
503
- "get:loggersettings:rflib:debug",
504
- "get:loggersettings:debug:rflib"
505
- ]
506
- },
507
- "rflib:debug:loggersettings:update": {
508
- "aliases": [],
509
- "args": {},
510
- "description": "Creates or updates a single field on an rflib_Logger_Settings__c record in the target org via the Salesforce REST API.\nValidates field values and warns about best-practice violations.\n\nTo update an existing record, provide --record-id. To create a new record, provide --setup-owner-id with an org ID (00D...), profile ID (00E...), or user ID.\n\nRequires the RFLIB base package to be installed in the target org and the running user to be assigned the rflib_Ops_Center_Access permission set (or have equivalent update access to rflib_Logger_Settings__c).\nFor installation instructions, visit: https://github.com/j-fischer/rflib",
511
- "examples": [
512
- "Update the Log_Event_Reporting_Level__c field on an existing record:\n$ sf rflib debug loggersettings update --target-org myOrg --record-id a0A000000001234 --field-name Log_Event_Reporting_Level__c --field-value WARN",
513
- "Create a new org-wide Logger Setting:\n$ sf rflib debug loggersettings update --target-org myOrg --setup-owner-id 00D000000000001 --field-name Log_Event_Reporting_Level__c --field-value WARN"
552
+ },
553
+ "dryrun": {
554
+ "char": "d",
555
+ "description": "When enabled, shows which files would be modified without making actual changes. Useful for reviewing the impact before applying changes. Shows:\n- Files that would be modified\n- Number of processed files\n- Number of modified files\n- Number of formatted files",
556
+ "name": "dryrun",
557
+ "summary": "Preview changes without modifying files.",
558
+ "allowNo": false,
559
+ "type": "boolean"
560
+ },
561
+ "prettier": {
562
+ "char": "p",
563
+ "description": "When enabled, formats the modified JavaScript files using Prettier after adding logging statements. Maintains consistent code style with:\n- 120 character line width\n- 4 space indentation\n- Single quotes for strings\n- No tabs",
564
+ "name": "prettier",
565
+ "summary": "Format modified files using Prettier.",
566
+ "allowNo": false,
567
+ "type": "boolean"
568
+ },
569
+ "no-if": {
570
+ "description": "When provided, the command will not add log statements inside of `if` and `else` blocks.",
571
+ "name": "no-if",
572
+ "summary": "Exclude the instrumentation of if-else statements.",
573
+ "allowNo": false,
574
+ "type": "boolean"
575
+ },
576
+ "skip-instrumented": {
577
+ "description": "When provided, the command will not add log statements to any Apex class that contains the `rflib` import statement.",
578
+ "name": "skip-instrumented",
579
+ "summary": "Skips any files where a logger is already present.",
580
+ "allowNo": false,
581
+ "type": "boolean"
582
+ },
583
+ "verbose": {
584
+ "char": "v",
585
+ "description": "When provided with --dryrun, prints the paths of the files that would be modified.",
586
+ "name": "verbose",
587
+ "summary": "Enable verbose output.",
588
+ "allowNo": false,
589
+ "type": "boolean"
590
+ },
591
+ "exclude": {
592
+ "char": "e",
593
+ "description": "Exclude specific files or directories that match the provided glob pattern. For example, use --exclude \"**/Generated_*.js\" to skip auto-generated components.",
594
+ "name": "exclude",
595
+ "summary": "Exclude files or directories from instrumentation based on a glob pattern.",
596
+ "hasDynamicHelp": false,
597
+ "multiple": false,
598
+ "type": "option"
599
+ },
600
+ "concurrency": {
601
+ "char": "c",
602
+ "description": "Controls the maximum number of files to process at the same time. This is useful in very large codebases to prevent excessive memory usage or file descriptor exhaustion. Defaults to 10.",
603
+ "name": "concurrency",
604
+ "summary": "Limits the number of files processed concurrently.",
605
+ "default": 10,
606
+ "hasDynamicHelp": false,
607
+ "multiple": false,
608
+ "type": "option"
609
+ }
610
+ },
611
+ "hasDynamicHelp": false,
612
+ "hiddenAliases": [],
613
+ "id": "rflib:logging:lwc:instrument",
614
+ "pluginAlias": "rflib-plugin",
615
+ "pluginName": "rflib-plugin",
616
+ "pluginType": "core",
617
+ "strict": true,
618
+ "summary": "Instrument Lightning Web Components with RFLIB logging statements automatically.",
619
+ "enableJsonFlag": true,
620
+ "isESM": true,
621
+ "relativePath": [
622
+ "lib",
623
+ "commands",
624
+ "rflib",
625
+ "logging",
626
+ "lwc",
627
+ "instrument.js"
628
+ ],
629
+ "aliasPermutations": [],
630
+ "permutations": [
631
+ "rflib:logging:lwc:instrument",
632
+ "logging:rflib:lwc:instrument",
633
+ "logging:lwc:rflib:instrument",
634
+ "logging:lwc:instrument:rflib",
635
+ "rflib:lwc:logging:instrument",
636
+ "lwc:rflib:logging:instrument",
637
+ "lwc:logging:rflib:instrument",
638
+ "lwc:logging:instrument:rflib",
639
+ "rflib:lwc:instrument:logging",
640
+ "lwc:rflib:instrument:logging",
641
+ "lwc:instrument:rflib:logging",
642
+ "lwc:instrument:logging:rflib",
643
+ "rflib:logging:instrument:lwc",
644
+ "logging:rflib:instrument:lwc",
645
+ "logging:instrument:rflib:lwc",
646
+ "logging:instrument:lwc:rflib",
647
+ "rflib:instrument:logging:lwc",
648
+ "instrument:rflib:logging:lwc",
649
+ "instrument:logging:rflib:lwc",
650
+ "instrument:logging:lwc:rflib",
651
+ "rflib:instrument:lwc:logging",
652
+ "instrument:rflib:lwc:logging",
653
+ "instrument:lwc:rflib:logging",
654
+ "instrument:lwc:logging:rflib"
655
+ ]
656
+ },
657
+ "rflib:debug:applicationevents:get": {
658
+ "aliases": [],
659
+ "args": {},
660
+ "description": "Retrieves rflib_Application_Event__c records from the target org via the Salesforce REST API.\nApplication Events are business-level events used to track feature adoption, user actions, and domain-specific milestones.\nResults are ordered by Occurred_On__c descending (most recent first).\n\nRequires the RFLIB base package to be installed in the target org and the running user to be assigned the rflib_Ops_Center_Access permission set (or have equivalent read access to rflib_Application_Event__c).\nFor installation instructions, visit: https://github.com/j-fischer/rflib",
661
+ "examples": [
662
+ "Get all application events from the default org:\n$ sf rflib debug applicationevents get --target-org myOrg",
663
+ "Get events filtered by name and date range:\n$ sf rflib debug applicationevents get --target-org myOrg --event-name \"order-%\" --start-date 2024-01-01T00:00:00Z",
664
+ "Get events related to a specific record with a custom limit:\n$ sf rflib debug applicationevents get --target-org myOrg --related-record-id 0017000000XXXXXX --record-limit 50"
514
665
  ],
515
666
  "flags": {
516
667
  "json": {
@@ -539,40 +690,47 @@
539
690
  "multiple": false,
540
691
  "type": "option"
541
692
  },
542
- "field-name": {
543
- "char": "f",
544
- "description": "The API name of the field to create or update, e.g. Log_Event_Reporting_Level__c. For log level fields, valid values are: TRACE, DEBUG, INFO, WARN, ERROR, FATAL, NONE.",
545
- "name": "field-name",
546
- "required": true,
547
- "summary": "API name of the rflib_Logger_Settings__c field to update.",
693
+ "event-name": {
694
+ "char": "e",
695
+ "description": "Filter Application Events by their Event_Name__c field. Use the % character as a wildcard for partial matches, for example \"order-%\".",
696
+ "name": "event-name",
697
+ "summary": "Filter by event name. Use % as a wildcard.",
548
698
  "hasDynamicHelp": false,
549
699
  "multiple": false,
550
700
  "type": "option"
551
701
  },
552
- "field-value": {
553
- "char": "v",
554
- "description": "The new value to set on the specified field. For log level fields, valid values are: TRACE, DEBUG, INFO, WARN, ERROR, FATAL, NONE.",
555
- "name": "field-value",
556
- "required": true,
557
- "summary": "New value for the specified field.",
702
+ "start-date": {
703
+ "char": "s",
704
+ "description": "Only return events where Occurred_On__c is on or after this date. Must be in ISO 8601 format, e.g. 2024-01-01T00:00:00Z.",
705
+ "name": "start-date",
706
+ "summary": "Filter events on or after this ISO 8601 date.",
558
707
  "hasDynamicHelp": false,
559
708
  "multiple": false,
560
709
  "type": "option"
561
710
  },
562
- "record-id": {
711
+ "end-date": {
712
+ "char": "d",
713
+ "description": "Only return events where Occurred_On__c is on or before this date. Must be in ISO 8601 format, e.g. 2024-12-31T23:59:59Z.",
714
+ "name": "end-date",
715
+ "summary": "Filter events on or before this ISO 8601 date.",
716
+ "hasDynamicHelp": false,
717
+ "multiple": false,
718
+ "type": "option"
719
+ },
720
+ "related-record-id": {
563
721
  "char": "r",
564
- "description": "The Salesforce record ID of an existing rflib_Logger_Settings__c record to update. Omit this flag to create a new record (requires --setup-owner-id).",
565
- "name": "record-id",
566
- "summary": "ID of an existing rflib_Logger_Settings__c record to update.",
722
+ "description": "Only return events associated with this specific record ID.",
723
+ "name": "related-record-id",
724
+ "summary": "Filter by Related_Record_ID__c (exact match).",
567
725
  "hasDynamicHelp": false,
568
726
  "multiple": false,
569
727
  "type": "option"
570
728
  },
571
- "setup-owner-id": {
572
- "char": "s",
573
- "description": "Required when creating a new Logger Setting record. Accepts an org ID (00D...), profile ID (00E...), or user ID. Read existing record IDs using \"sf rflib debug loggersettings get\".",
574
- "name": "setup-owner-id",
575
- "summary": "Setup owner ID for creating a new Logger Setting record.",
729
+ "record-limit": {
730
+ "char": "l",
731
+ "description": "Controls how many Application Event records are returned. Defaults to 200. Maximum allowed value is 2000.",
732
+ "name": "record-limit",
733
+ "summary": "Maximum number of records to return (default 200, max 2000).",
576
734
  "hasDynamicHelp": false,
577
735
  "multiple": false,
578
736
  "type": "option"
@@ -580,12 +738,12 @@
580
738
  },
581
739
  "hasDynamicHelp": true,
582
740
  "hiddenAliases": [],
583
- "id": "rflib:debug:loggersettings:update",
741
+ "id": "rflib:debug:applicationevents:get",
584
742
  "pluginAlias": "rflib-plugin",
585
743
  "pluginName": "rflib-plugin",
586
744
  "pluginType": "core",
587
745
  "strict": true,
588
- "summary": "Create or update an RFLIB Logger Setting in a Salesforce org.",
746
+ "summary": "Query RFLIB Application Events from a Salesforce org.",
589
747
  "enableJsonFlag": true,
590
748
  "isESM": true,
591
749
  "relativePath": [
@@ -593,47 +751,44 @@
593
751
  "commands",
594
752
  "rflib",
595
753
  "debug",
596
- "loggersettings",
597
- "update.js"
754
+ "applicationevents",
755
+ "get.js"
598
756
  ],
599
757
  "aliasPermutations": [],
600
758
  "permutations": [
601
- "rflib:debug:loggersettings:update",
602
- "debug:rflib:loggersettings:update",
603
- "debug:loggersettings:rflib:update",
604
- "debug:loggersettings:update:rflib",
605
- "rflib:loggersettings:debug:update",
606
- "loggersettings:rflib:debug:update",
607
- "loggersettings:debug:rflib:update",
608
- "loggersettings:debug:update:rflib",
609
- "rflib:loggersettings:update:debug",
610
- "loggersettings:rflib:update:debug",
611
- "loggersettings:update:rflib:debug",
612
- "loggersettings:update:debug:rflib",
613
- "rflib:debug:update:loggersettings",
614
- "debug:rflib:update:loggersettings",
615
- "debug:update:rflib:loggersettings",
616
- "debug:update:loggersettings:rflib",
617
- "rflib:update:debug:loggersettings",
618
- "update:rflib:debug:loggersettings",
619
- "update:debug:rflib:loggersettings",
620
- "update:debug:loggersettings:rflib",
621
- "rflib:update:loggersettings:debug",
622
- "update:rflib:loggersettings:debug",
623
- "update:loggersettings:rflib:debug",
624
- "update:loggersettings:debug:rflib"
759
+ "rflib:debug:applicationevents:get",
760
+ "debug:rflib:applicationevents:get",
761
+ "debug:applicationevents:rflib:get",
762
+ "debug:applicationevents:get:rflib",
763
+ "rflib:applicationevents:debug:get",
764
+ "applicationevents:rflib:debug:get",
765
+ "applicationevents:debug:rflib:get",
766
+ "applicationevents:debug:get:rflib",
767
+ "rflib:applicationevents:get:debug",
768
+ "applicationevents:rflib:get:debug",
769
+ "applicationevents:get:rflib:debug",
770
+ "applicationevents:get:debug:rflib",
771
+ "rflib:debug:get:applicationevents",
772
+ "debug:rflib:get:applicationevents",
773
+ "debug:get:rflib:applicationevents",
774
+ "debug:get:applicationevents:rflib",
775
+ "rflib:get:debug:applicationevents",
776
+ "get:rflib:debug:applicationevents",
777
+ "get:debug:rflib:applicationevents",
778
+ "get:debug:applicationevents:rflib",
779
+ "rflib:get:applicationevents:debug",
780
+ "get:rflib:applicationevents:debug",
781
+ "get:applicationevents:rflib:debug",
782
+ "get:applicationevents:debug:rflib"
625
783
  ]
626
784
  },
627
- "rflib:debug:userpermissions:check": {
785
+ "rflib:debug:logarchives:get": {
628
786
  "aliases": [],
629
787
  "args": {},
630
- "description": "Answers questions such as \"Can this user edit Account.AnnualRevenue?\" or \"Does this user have Modify All Data?\". The command checks the user's profile, permission sets, and permission set groups, and returns whether the permission is granted and which of them grant it.\n\nCheck exactly one of the following:\n - An object permission (--object, with --access read, create, edit, delete, viewall, modifyall, or viewallfields)\n - A field permission (--field, with --access read or edit)\n - Access to an Apex class (--apex-class) or a Visualforce page (--apex-page)\n - A custom permission (--custom-permission)\n - A system permission (--system-permission), e.g. ModifyAllData or ViewSetup\n\nField checks take the object permissions into account: a field is only accessible when the user also has Read (or Edit) on the object. View All Fields on the object grants Read on all of its fields. Apex class and Visualforce page checks include access granted by the Author Apex and Customize Application system permissions.\n\nSharing and record-level access aren't checked.\n\nThe command only reads standard setup objects, so the RFLIB package doesn't need to be installed. The running user needs the View Setup and Configuration permission.",
788
+ "description": "Retrieves rflib_Logs_Archive__b records from the target org's big object store via the Salesforce REST API.\nEach log record contains log level, context, request ID, and full log messages in the format: [timestamp]|[LEVEL]|[TRACE_ID]|[CONTEXT]|[MESSAGE].\n\nRequires the RFLIB base package to be installed in the target org and the running user to be assigned the rflib_Ops_Center_Access permission set (or have equivalent read access to rflib_Logs_Archive__b).\nFor installation instructions, visit: https://github.com/j-fischer/rflib",
631
789
  "examples": [
632
- "Check whether a user can edit a field:\n$ sf rflib debug userpermissions check --target-org myOrg --user jane@example.com --field Account.AnnualRevenue --access edit",
633
- "Check whether a user can delete Opportunity records:\n$ sf rflib debug userpermissions check --target-org myOrg --user 0057000000XXXXXX --object Opportunity --access delete",
634
- "Check access to an Apex class:\n$ sf rflib debug userpermissions check --target-org myOrg --user jane@example.com --apex-class OrderController",
635
- "Check a custom permission:\n$ sf rflib debug userpermissions check --target-org myOrg --user jane@example.com --custom-permission Approve_Discounts",
636
- "Check a system permission:\n$ sf rflib debug userpermissions check --target-org myOrg --user jane@example.com --system-permission ModifyAllData"
790
+ "Get log archives from the last 24 hours:\n$ sf rflib debug logarchives get --target-org myOrg",
791
+ "Get log archives for a specific date range:\n$ sf rflib debug logarchives get --target-org myOrg --start-date 2024-01-01T00:00:00Z --end-date 2024-01-02T00:00:00Z"
637
792
  ],
638
793
  "flags": {
639
794
  "json": {
@@ -653,7 +808,7 @@
653
808
  },
654
809
  "target-org": {
655
810
  "char": "o",
656
- "description": "The username or alias of the Salesforce org to check the permission in.",
811
+ "description": "The username or alias of the Salesforce org containing the RFLIB base package.",
657
812
  "name": "target-org",
658
813
  "noCacheDefault": true,
659
814
  "required": true,
@@ -662,80 +817,20 @@
662
817
  "multiple": false,
663
818
  "type": "option"
664
819
  },
665
- "user": {
666
- "char": "u",
667
- "description": "The Salesforce User ID (15 or 18 characters) or the username of the user whose permission should be checked.",
668
- "name": "user",
669
- "required": true,
670
- "summary": "User ID (15 or 18 characters) or username of the user to check.",
820
+ "start-date": {
821
+ "char": "s",
822
+ "description": "Only return log archives created on or after this date. Must be in ISO 8601 format, e.g. 2024-01-01T00:00:00Z. Defaults to 24 hours ago if omitted.",
823
+ "name": "start-date",
824
+ "summary": "Start of the date range in ISO 8601 format. Defaults to 24 hours ago.",
671
825
  "hasDynamicHelp": false,
672
826
  "multiple": false,
673
827
  "type": "option"
674
828
  },
675
- "object": {
676
- "char": "b",
677
- "description": "Checks an object permission. Use --access to choose which one; the default is read.",
678
- "name": "object",
679
- "summary": "API name of the object to check object permissions for, e.g. Account.",
680
- "hasDynamicHelp": false,
681
- "multiple": false,
682
- "type": "option"
683
- },
684
- "field": {
685
- "char": "f",
686
- "description": "Checks field-level security for a field. Use --access read (default) or --access edit.",
687
- "name": "field",
688
- "summary": "Field to check field-level security for, in the form Object.Field, e.g. Account.AnnualRevenue.",
689
- "hasDynamicHelp": false,
690
- "multiple": false,
691
- "type": "option"
692
- },
693
- "access": {
694
- "char": "a",
695
- "description": "The access level to check:\n - read, edit: for objects and fields\n - create, delete, viewall (View All Records), modifyall (Modify All Records), viewallfields (View All Fields): for objects only",
696
- "name": "access",
697
- "summary": "Access level to check for --object or --field. Default: read.",
698
- "hasDynamicHelp": false,
699
- "multiple": false,
700
- "options": [
701
- "read",
702
- "create",
703
- "edit",
704
- "delete",
705
- "viewall",
706
- "modifyall",
707
- "viewallfields"
708
- ],
709
- "type": "option"
710
- },
711
- "apex-class": {
712
- "description": "Checks whether the user can access an Apex class. Use namespace__Name or namespace.Name for a class in a managed package.",
713
- "name": "apex-class",
714
- "summary": "Name of the Apex class to check access for.",
715
- "hasDynamicHelp": false,
716
- "multiple": false,
717
- "type": "option"
718
- },
719
- "apex-page": {
720
- "description": "Checks whether the user can access a Visualforce page. Use namespace__Name for a page in a managed package.",
721
- "name": "apex-page",
722
- "summary": "Name of the Visualforce page to check access for.",
723
- "hasDynamicHelp": false,
724
- "multiple": false,
725
- "type": "option"
726
- },
727
- "custom-permission": {
728
- "description": "Checks whether the user has a custom permission. Use namespace__Name for a custom permission in a managed package.",
729
- "name": "custom-permission",
730
- "summary": "API name of the custom permission to check.",
731
- "hasDynamicHelp": false,
732
- "multiple": false,
733
- "type": "option"
734
- },
735
- "system-permission": {
736
- "description": "Checks a system (user) permission. Use the name of the permission field on the PermissionSet object, with or without the \"Permissions\" prefix, e.g. ModifyAllData, ViewAllData, ApiEnabled, or PermissionsAuthorApex.",
737
- "name": "system-permission",
738
- "summary": "API name of the system permission to check, e.g. ModifyAllData or ViewSetup.",
829
+ "end-date": {
830
+ "char": "d",
831
+ "description": "Only return log archives created on or before this date. Must be in ISO 8601 format, e.g. 2024-12-31T23:59:59Z. Defaults to the current time if omitted.",
832
+ "name": "end-date",
833
+ "summary": "End of the date range in ISO 8601 format. Defaults to now.",
739
834
  "hasDynamicHelp": false,
740
835
  "multiple": false,
741
836
  "type": "option"
@@ -743,12 +838,12 @@
743
838
  },
744
839
  "hasDynamicHelp": true,
745
840
  "hiddenAliases": [],
746
- "id": "rflib:debug:userpermissions:check",
841
+ "id": "rflib:debug:logarchives:get",
747
842
  "pluginAlias": "rflib-plugin",
748
843
  "pluginName": "rflib-plugin",
749
844
  "pluginType": "core",
750
845
  "strict": true,
751
- "summary": "Check whether a user has a specific permission, and where it comes from.",
846
+ "summary": "Query RFLIB log archives from a Salesforce org.",
752
847
  "enableJsonFlag": true,
753
848
  "isESM": true,
754
849
  "relativePath": [
@@ -756,44 +851,43 @@
756
851
  "commands",
757
852
  "rflib",
758
853
  "debug",
759
- "userpermissions",
760
- "check.js"
854
+ "logarchives",
855
+ "get.js"
761
856
  ],
762
857
  "aliasPermutations": [],
763
858
  "permutations": [
764
- "rflib:debug:userpermissions:check",
765
- "debug:rflib:userpermissions:check",
766
- "debug:userpermissions:rflib:check",
767
- "debug:userpermissions:check:rflib",
768
- "rflib:userpermissions:debug:check",
769
- "userpermissions:rflib:debug:check",
770
- "userpermissions:debug:rflib:check",
771
- "userpermissions:debug:check:rflib",
772
- "rflib:userpermissions:check:debug",
773
- "userpermissions:rflib:check:debug",
774
- "userpermissions:check:rflib:debug",
775
- "userpermissions:check:debug:rflib",
776
- "rflib:debug:check:userpermissions",
777
- "debug:rflib:check:userpermissions",
778
- "debug:check:rflib:userpermissions",
779
- "debug:check:userpermissions:rflib",
780
- "rflib:check:debug:userpermissions",
781
- "check:rflib:debug:userpermissions",
782
- "check:debug:rflib:userpermissions",
783
- "check:debug:userpermissions:rflib",
784
- "rflib:check:userpermissions:debug",
785
- "check:rflib:userpermissions:debug",
786
- "check:userpermissions:rflib:debug",
787
- "check:userpermissions:debug:rflib"
859
+ "rflib:debug:logarchives:get",
860
+ "debug:rflib:logarchives:get",
861
+ "debug:logarchives:rflib:get",
862
+ "debug:logarchives:get:rflib",
863
+ "rflib:logarchives:debug:get",
864
+ "logarchives:rflib:debug:get",
865
+ "logarchives:debug:rflib:get",
866
+ "logarchives:debug:get:rflib",
867
+ "rflib:logarchives:get:debug",
868
+ "logarchives:rflib:get:debug",
869
+ "logarchives:get:rflib:debug",
870
+ "logarchives:get:debug:rflib",
871
+ "rflib:debug:get:logarchives",
872
+ "debug:rflib:get:logarchives",
873
+ "debug:get:rflib:logarchives",
874
+ "debug:get:logarchives:rflib",
875
+ "rflib:get:debug:logarchives",
876
+ "get:rflib:debug:logarchives",
877
+ "get:debug:rflib:logarchives",
878
+ "get:debug:logarchives:rflib",
879
+ "rflib:get:logarchives:debug",
880
+ "get:rflib:logarchives:debug",
881
+ "get:logarchives:rflib:debug",
882
+ "get:logarchives:debug:rflib"
788
883
  ]
789
884
  },
790
- "rflib:debug:userpermissions:compare": {
885
+ "rflib:debug:loggersettings:get": {
791
886
  "aliases": [],
792
887
  "args": {},
793
- "description": "Finds out why something works for one user but not for another. The command combines each user's permissions across their profile, permission sets, and permission set groups, and returns only the permissions that one of the users has and the other doesn't.\n\nUse --permission-type to choose what to compare (default: ALL) and --sobject-type to limit the object and field comparison to one object. ALL compares object and field access, Apex classes, Visualforce pages, custom permissions, and system permissions.\n\nField access only counts where the user also has the matching access on the object. Sharing and record-level access aren't compared.\n\nThe command only reads standard setup objects, so the RFLIB package doesn't need to be installed. The running user needs the View Setup and Configuration permission.",
888
+ "description": "Retrieves all rflib_Logger_Settings__c hierarchy custom setting records from the target org via the Salesforce REST API.\nReturns settings across org-wide defaults, profile overrides, and user overrides, along with embedded best-practice recommendations.\n\nUse \"sf rflib debug loggersettings update\" to apply changes.\n\nRequires the RFLIB base package to be installed in the target org and the running user to be assigned the rflib_Ops_Center_Access permission set (or have equivalent read access to rflib_Logger_Settings__c).\nFor installation instructions, visit: https://github.com/j-fischer/rflib",
794
889
  "examples": [
795
- "Compare all permissions of two users:\n$ sf rflib debug userpermissions compare --target-org myOrg --user jane@example.com --other-user bob@example.com",
796
- "Compare object and field access on Account:\n$ sf rflib debug userpermissions compare --target-org myOrg --user jane@example.com --other-user bob@example.com --permission-type FLS --sobject-type Account"
890
+ "Read all logger settings from the target org:\n$ sf rflib debug loggersettings get --target-org myOrg"
797
891
  ],
798
892
  "flags": {
799
893
  "json": {
@@ -813,7 +907,7 @@
813
907
  },
814
908
  "target-org": {
815
909
  "char": "o",
816
- "description": "The username or alias of the Salesforce org to compare the users in.",
910
+ "description": "The username or alias of the Salesforce org containing the RFLIB base package.",
817
911
  "name": "target-org",
818
912
  "noCacheDefault": true,
819
913
  "required": true,
@@ -821,61 +915,16 @@
821
915
  "hasDynamicHelp": true,
822
916
  "multiple": false,
823
917
  "type": "option"
824
- },
825
- "user": {
826
- "char": "u",
827
- "description": "The first user to compare, typically the user for whom something doesn't work.",
828
- "name": "user",
829
- "required": true,
830
- "summary": "User ID (15 or 18 characters) or username of the first user.",
831
- "hasDynamicHelp": false,
832
- "multiple": false,
833
- "type": "option"
834
- },
835
- "other-user": {
836
- "char": "w",
837
- "description": "The second user to compare, typically the user for whom it works.",
838
- "name": "other-user",
839
- "required": true,
840
- "summary": "User ID (15 or 18 characters) or username of the second user.",
841
- "hasDynamicHelp": false,
842
- "multiple": false,
843
- "type": "option"
844
- },
845
- "permission-type": {
846
- "char": "t",
847
- "description": "Controls which permissions are compared:\n - FLS: Field access\n - OLS: Object access\n - APEX: Apex class and Visualforce page access\n - ALL: All of the above, plus custom permissions and system permissions",
848
- "name": "permission-type",
849
- "summary": "Permissions to compare: FLS, OLS, APEX, or ALL. Default: ALL.",
850
- "default": "ALL",
851
- "hasDynamicHelp": false,
852
- "multiple": false,
853
- "options": [
854
- "FLS",
855
- "OLS",
856
- "APEX",
857
- "ALL"
858
- ],
859
- "type": "option"
860
- },
861
- "sobject-type": {
862
- "char": "b",
863
- "description": "Limits the object and field comparison to one SObject type, e.g. Account. Recommended in large orgs, where the full field comparison can reach the query row limit.",
864
- "name": "sobject-type",
865
- "summary": "Optional SObject API name to limit the object and field comparison to.",
866
- "hasDynamicHelp": false,
867
- "multiple": false,
868
- "type": "option"
869
918
  }
870
919
  },
871
920
  "hasDynamicHelp": true,
872
921
  "hiddenAliases": [],
873
- "id": "rflib:debug:userpermissions:compare",
922
+ "id": "rflib:debug:loggersettings:get",
874
923
  "pluginAlias": "rflib-plugin",
875
924
  "pluginName": "rflib-plugin",
876
925
  "pluginType": "core",
877
926
  "strict": true,
878
- "summary": "Compare the permissions of two users and show only the differences.",
927
+ "summary": "Read all RFLIB Logger Settings from a Salesforce org.",
879
928
  "enableJsonFlag": true,
880
929
  "isESM": true,
881
930
  "relativePath": [
@@ -883,46 +932,44 @@
883
932
  "commands",
884
933
  "rflib",
885
934
  "debug",
886
- "userpermissions",
887
- "compare.js"
935
+ "loggersettings",
936
+ "get.js"
888
937
  ],
889
938
  "aliasPermutations": [],
890
939
  "permutations": [
891
- "rflib:debug:userpermissions:compare",
892
- "debug:rflib:userpermissions:compare",
893
- "debug:userpermissions:rflib:compare",
894
- "debug:userpermissions:compare:rflib",
895
- "rflib:userpermissions:debug:compare",
896
- "userpermissions:rflib:debug:compare",
897
- "userpermissions:debug:rflib:compare",
898
- "userpermissions:debug:compare:rflib",
899
- "rflib:userpermissions:compare:debug",
900
- "userpermissions:rflib:compare:debug",
901
- "userpermissions:compare:rflib:debug",
902
- "userpermissions:compare:debug:rflib",
903
- "rflib:debug:compare:userpermissions",
904
- "debug:rflib:compare:userpermissions",
905
- "debug:compare:rflib:userpermissions",
906
- "debug:compare:userpermissions:rflib",
907
- "rflib:compare:debug:userpermissions",
908
- "compare:rflib:debug:userpermissions",
909
- "compare:debug:rflib:userpermissions",
910
- "compare:debug:userpermissions:rflib",
911
- "rflib:compare:userpermissions:debug",
912
- "compare:rflib:userpermissions:debug",
913
- "compare:userpermissions:rflib:debug",
914
- "compare:userpermissions:debug:rflib"
940
+ "rflib:debug:loggersettings:get",
941
+ "debug:rflib:loggersettings:get",
942
+ "debug:loggersettings:rflib:get",
943
+ "debug:loggersettings:get:rflib",
944
+ "rflib:loggersettings:debug:get",
945
+ "loggersettings:rflib:debug:get",
946
+ "loggersettings:debug:rflib:get",
947
+ "loggersettings:debug:get:rflib",
948
+ "rflib:loggersettings:get:debug",
949
+ "loggersettings:rflib:get:debug",
950
+ "loggersettings:get:rflib:debug",
951
+ "loggersettings:get:debug:rflib",
952
+ "rflib:debug:get:loggersettings",
953
+ "debug:rflib:get:loggersettings",
954
+ "debug:get:rflib:loggersettings",
955
+ "debug:get:loggersettings:rflib",
956
+ "rflib:get:debug:loggersettings",
957
+ "get:rflib:debug:loggersettings",
958
+ "get:debug:rflib:loggersettings",
959
+ "get:debug:loggersettings:rflib",
960
+ "rflib:get:loggersettings:debug",
961
+ "get:rflib:loggersettings:debug",
962
+ "get:loggersettings:rflib:debug",
963
+ "get:loggersettings:debug:rflib"
915
964
  ]
916
965
  },
917
- "rflib:debug:userpermissions:get": {
966
+ "rflib:debug:loggersettings:update": {
918
967
  "aliases": [],
919
968
  "args": {},
920
- "description": "Retrieves FLS (Field-Level Security), OLS (Object-Level Security), and Apex class/page permissions for a specific user\nvia the Salesforce REST API. Permissions are aggregated across the user's profile, permission sets, and permission set groups.\n\nUse --sobject-type to narrow FLS or OLS results to a specific SObject.\n\nUse --effective to get the user's combined permissions instead of the raw permission records: one entry per object with its access levels, one entry per field with read and edit (only where the user also has that access on the object), and the names of the accessible Apex classes and Visualforce pages. With --permission-type ALL, the result also lists the user's custom permissions and system permissions.\n\nRequires the RFLIB base package to be installed in the target org and the running user to be assigned the rflib_Ops_Center_Access permission set (or have equivalent read access to the relevant permission objects).\nFor installation instructions, visit: https://github.com/j-fischer/rflib",
969
+ "description": "Creates or updates a single field on an rflib_Logger_Settings__c record in the target org via the Salesforce REST API.\nValidates field values and warns about best-practice violations.\n\nTo update an existing record, provide --record-id. To create a new record, provide --setup-owner-id with an org ID (00D...), profile ID (00E...), or user ID.\n\nRequires the RFLIB base package to be installed in the target org and the running user to be assigned the rflib_Ops_Center_Access permission set (or have equivalent update access to rflib_Logger_Settings__c).\nFor installation instructions, visit: https://github.com/j-fischer/rflib",
921
970
  "examples": [
922
- "Check all permissions for a user:\n$ sf rflib debug userpermissions get --target-org myOrg --user-id 0057000000XXXXXX --permission-type ALL",
923
- "Check FLS for a specific object:\n$ sf rflib debug userpermissions get --target-org myOrg --user-id 0057000000XXXXXX --permission-type FLS --sobject-type Account",
924
- "Check Apex access:\n$ sf rflib debug userpermissions get --target-org myOrg --user-id 0057000000XXXXXX --permission-type APEX",
925
- "Get the combined permissions of a user, including custom and system permissions:\n$ sf rflib debug userpermissions get --target-org myOrg --user-id 0057000000XXXXXX --permission-type ALL --effective"
971
+ "Update the Log_Event_Reporting_Level__c field on an existing record:\n$ sf rflib debug loggersettings update --target-org myOrg --record-id a0A000000001234 --field-name Log_Event_Reporting_Level__c --field-value WARN",
972
+ "Create a new org-wide Logger Setting:\n$ sf rflib debug loggersettings update --target-org myOrg --setup-owner-id 00D000000000001 --field-name Log_Event_Reporting_Level__c --field-value WARN"
926
973
  ],
927
974
  "flags": {
928
975
  "json": {
@@ -951,58 +998,155 @@
951
998
  "multiple": false,
952
999
  "type": "option"
953
1000
  },
954
- "user-id": {
955
- "char": "u",
956
- "description": "The Salesforce User ID (15 or 18 characters) of the user whose permissions should be retrieved.",
957
- "name": "user-id",
1001
+ "field-name": {
1002
+ "char": "f",
1003
+ "description": "The API name of the field to create or update, e.g. Log_Event_Reporting_Level__c. For log level fields, valid values are: TRACE, DEBUG, INFO, WARN, ERROR, FATAL, NONE.",
1004
+ "name": "field-name",
958
1005
  "required": true,
959
- "summary": "Salesforce User ID (15 or 18 character) to check permissions for.",
1006
+ "summary": "API name of the rflib_Logger_Settings__c field to update.",
960
1007
  "hasDynamicHelp": false,
961
1008
  "multiple": false,
962
1009
  "type": "option"
963
1010
  },
964
- "permission-type": {
965
- "char": "t",
966
- "description": "Controls which permission types are returned:\n - FLS: Field-Level Security only\n - OLS: Object-Level Security only\n - APEX: Apex class and page access only\n - ALL: All three permission types",
967
- "name": "permission-type",
1011
+ "field-value": {
1012
+ "char": "v",
1013
+ "description": "The new value to set on the specified field. For log level fields, valid values are: TRACE, DEBUG, INFO, WARN, ERROR, FATAL, NONE.",
1014
+ "name": "field-value",
968
1015
  "required": true,
969
- "summary": "Type of permissions to retrieve: FLS, OLS, APEX, or ALL.",
1016
+ "summary": "New value for the specified field.",
970
1017
  "hasDynamicHelp": false,
971
1018
  "multiple": false,
972
- "options": [
973
- "FLS",
974
- "OLS",
975
- "APEX",
976
- "ALL"
977
- ],
978
1019
  "type": "option"
979
1020
  },
980
- "sobject-type": {
981
- "char": "b",
982
- "description": "Filters Field-Level Security or Object-Level Security results to a specific SObject type, e.g. Account, Contact, Opportunity.",
983
- "name": "sobject-type",
984
- "summary": "Optional SObject API name to filter FLS or OLS results.",
1021
+ "record-id": {
1022
+ "char": "r",
1023
+ "description": "The Salesforce record ID of an existing rflib_Logger_Settings__c record to update. Omit this flag to create a new record (requires --setup-owner-id).",
1024
+ "name": "record-id",
1025
+ "summary": "ID of an existing rflib_Logger_Settings__c record to update.",
985
1026
  "hasDynamicHelp": false,
986
1027
  "multiple": false,
987
1028
  "type": "option"
988
1029
  },
989
- "effective": {
990
- "char": "e",
991
- "description": "Merges the permissions from the profile, permission sets, and permission set groups. Objects list their access levels (read, create, edit, delete, viewall, modifyall, viewallfields), fields list read and edit, and Apex classes, Visualforce pages, and custom permissions are listed by name. System permissions are included for --permission-type ALL. With --effective, --user-id also accepts a username.",
992
- "name": "effective",
993
- "summary": "Return the user's combined permissions instead of the raw permission records.",
1030
+ "setup-owner-id": {
1031
+ "char": "s",
1032
+ "description": "Required when creating a new Logger Setting record. Accepts an org ID (00D...), profile ID (00E...), or user ID. Read existing record IDs using \"sf rflib debug loggersettings get\".",
1033
+ "name": "setup-owner-id",
1034
+ "summary": "Setup owner ID for creating a new Logger Setting record.",
1035
+ "hasDynamicHelp": false,
1036
+ "multiple": false,
1037
+ "type": "option"
1038
+ }
1039
+ },
1040
+ "hasDynamicHelp": true,
1041
+ "hiddenAliases": [],
1042
+ "id": "rflib:debug:loggersettings:update",
1043
+ "pluginAlias": "rflib-plugin",
1044
+ "pluginName": "rflib-plugin",
1045
+ "pluginType": "core",
1046
+ "strict": true,
1047
+ "summary": "Create or update an RFLIB Logger Setting in a Salesforce org.",
1048
+ "enableJsonFlag": true,
1049
+ "isESM": true,
1050
+ "relativePath": [
1051
+ "lib",
1052
+ "commands",
1053
+ "rflib",
1054
+ "debug",
1055
+ "loggersettings",
1056
+ "update.js"
1057
+ ],
1058
+ "aliasPermutations": [],
1059
+ "permutations": [
1060
+ "rflib:debug:loggersettings:update",
1061
+ "debug:rflib:loggersettings:update",
1062
+ "debug:loggersettings:rflib:update",
1063
+ "debug:loggersettings:update:rflib",
1064
+ "rflib:loggersettings:debug:update",
1065
+ "loggersettings:rflib:debug:update",
1066
+ "loggersettings:debug:rflib:update",
1067
+ "loggersettings:debug:update:rflib",
1068
+ "rflib:loggersettings:update:debug",
1069
+ "loggersettings:rflib:update:debug",
1070
+ "loggersettings:update:rflib:debug",
1071
+ "loggersettings:update:debug:rflib",
1072
+ "rflib:debug:update:loggersettings",
1073
+ "debug:rflib:update:loggersettings",
1074
+ "debug:update:rflib:loggersettings",
1075
+ "debug:update:loggersettings:rflib",
1076
+ "rflib:update:debug:loggersettings",
1077
+ "update:rflib:debug:loggersettings",
1078
+ "update:debug:rflib:loggersettings",
1079
+ "update:debug:loggersettings:rflib",
1080
+ "rflib:update:loggersettings:debug",
1081
+ "update:rflib:loggersettings:debug",
1082
+ "update:loggersettings:rflib:debug",
1083
+ "update:loggersettings:debug:rflib"
1084
+ ]
1085
+ },
1086
+ "rflib:debug:recordaccess:get": {
1087
+ "aliases": [],
1088
+ "args": {},
1089
+ "description": "Answers questions such as \"Why can't this user see this record?\". For each record, the command returns the user's access from UserRecordAccess (read, edit, delete, transfer, and full access), which includes sharing: the org-wide default, the role hierarchy, sharing rules, teams, and manual shares.\n\nThe result also contains the user's object permissions on each record's object, and notes that tell apart missing object permissions from missing sharing. Use userpermissions check to find out which profile or permission set grants an object permission.\n\nYou can check up to 200 records at a time.\n\nThe command only reads standard objects, so the RFLIB package doesn't need to be installed.",
1090
+ "examples": [
1091
+ "Check a user's access to a record:\n$ sf rflib debug recordaccess get --target-org myOrg --user jane@example.com --record-id 001XXXXXXXXXXXXXXX",
1092
+ "Check several records at once:\n$ sf rflib debug recordaccess get --target-org myOrg --user 0057000000XXXXXX --record-id 001XXXXXXXXXXXXXXX --record-id 006XXXXXXXXXXXXXXX"
1093
+ ],
1094
+ "flags": {
1095
+ "json": {
1096
+ "description": "Format output as json.",
1097
+ "helpGroup": "GLOBAL",
1098
+ "name": "json",
994
1099
  "allowNo": false,
995
1100
  "type": "boolean"
1101
+ },
1102
+ "flags-dir": {
1103
+ "helpGroup": "GLOBAL",
1104
+ "name": "flags-dir",
1105
+ "summary": "Import flag values from a directory.",
1106
+ "hasDynamicHelp": false,
1107
+ "multiple": false,
1108
+ "type": "option"
1109
+ },
1110
+ "target-org": {
1111
+ "char": "o",
1112
+ "description": "The username or alias of the Salesforce org that contains the records.",
1113
+ "name": "target-org",
1114
+ "noCacheDefault": true,
1115
+ "required": true,
1116
+ "summary": "Username or alias of the target org.",
1117
+ "hasDynamicHelp": true,
1118
+ "multiple": false,
1119
+ "type": "option"
1120
+ },
1121
+ "user": {
1122
+ "char": "u",
1123
+ "description": "The Salesforce User ID (15 or 18 characters) or the username of the user whose record access should be checked.",
1124
+ "name": "user",
1125
+ "required": true,
1126
+ "summary": "User ID (15 or 18 characters) or username of the user to check.",
1127
+ "hasDynamicHelp": false,
1128
+ "multiple": false,
1129
+ "type": "option"
1130
+ },
1131
+ "record-id": {
1132
+ "char": "r",
1133
+ "description": "The 15 or 18 character ID of a record to check. Specify --record-id up to 200 times.",
1134
+ "name": "record-id",
1135
+ "required": true,
1136
+ "summary": "ID of a record to check. Specify the flag multiple times to check several records.",
1137
+ "hasDynamicHelp": false,
1138
+ "multiple": true,
1139
+ "type": "option"
996
1140
  }
997
1141
  },
998
1142
  "hasDynamicHelp": true,
999
1143
  "hiddenAliases": [],
1000
- "id": "rflib:debug:userpermissions:get",
1144
+ "id": "rflib:debug:recordaccess:get",
1001
1145
  "pluginAlias": "rflib-plugin",
1002
1146
  "pluginName": "rflib-plugin",
1003
1147
  "pluginType": "core",
1004
1148
  "strict": true,
1005
- "summary": "Check Salesforce permissions for a user in the target org.",
1149
+ "summary": "Check a user's access to specific records, including sharing.",
1006
1150
  "enableJsonFlag": true,
1007
1151
  "isESM": true,
1008
1152
  "relativePath": [
@@ -1010,45 +1154,47 @@
1010
1154
  "commands",
1011
1155
  "rflib",
1012
1156
  "debug",
1013
- "userpermissions",
1157
+ "recordaccess",
1014
1158
  "get.js"
1015
1159
  ],
1016
1160
  "aliasPermutations": [],
1017
1161
  "permutations": [
1018
- "rflib:debug:userpermissions:get",
1019
- "debug:rflib:userpermissions:get",
1020
- "debug:userpermissions:rflib:get",
1021
- "debug:userpermissions:get:rflib",
1022
- "rflib:userpermissions:debug:get",
1023
- "userpermissions:rflib:debug:get",
1024
- "userpermissions:debug:rflib:get",
1025
- "userpermissions:debug:get:rflib",
1026
- "rflib:userpermissions:get:debug",
1027
- "userpermissions:rflib:get:debug",
1028
- "userpermissions:get:rflib:debug",
1029
- "userpermissions:get:debug:rflib",
1030
- "rflib:debug:get:userpermissions",
1031
- "debug:rflib:get:userpermissions",
1032
- "debug:get:rflib:userpermissions",
1033
- "debug:get:userpermissions:rflib",
1034
- "rflib:get:debug:userpermissions",
1035
- "get:rflib:debug:userpermissions",
1036
- "get:debug:rflib:userpermissions",
1037
- "get:debug:userpermissions:rflib",
1038
- "rflib:get:userpermissions:debug",
1039
- "get:rflib:userpermissions:debug",
1040
- "get:userpermissions:rflib:debug",
1041
- "get:userpermissions:debug:rflib"
1162
+ "rflib:debug:recordaccess:get",
1163
+ "debug:rflib:recordaccess:get",
1164
+ "debug:recordaccess:rflib:get",
1165
+ "debug:recordaccess:get:rflib",
1166
+ "rflib:recordaccess:debug:get",
1167
+ "recordaccess:rflib:debug:get",
1168
+ "recordaccess:debug:rflib:get",
1169
+ "recordaccess:debug:get:rflib",
1170
+ "rflib:recordaccess:get:debug",
1171
+ "recordaccess:rflib:get:debug",
1172
+ "recordaccess:get:rflib:debug",
1173
+ "recordaccess:get:debug:rflib",
1174
+ "rflib:debug:get:recordaccess",
1175
+ "debug:rflib:get:recordaccess",
1176
+ "debug:get:rflib:recordaccess",
1177
+ "debug:get:recordaccess:rflib",
1178
+ "rflib:get:debug:recordaccess",
1179
+ "get:rflib:debug:recordaccess",
1180
+ "get:debug:rflib:recordaccess",
1181
+ "get:debug:recordaccess:rflib",
1182
+ "rflib:get:recordaccess:debug",
1183
+ "get:rflib:recordaccess:debug",
1184
+ "get:recordaccess:rflib:debug",
1185
+ "get:recordaccess:debug:rflib"
1042
1186
  ]
1043
1187
  },
1044
- "rflib:debug:userpermissions:whohas": {
1188
+ "rflib:debug:userpermissions:check": {
1045
1189
  "aliases": [],
1046
1190
  "args": {},
1047
- "description": "The reverse of userpermissions check. Answers questions such as \"Who can edit Account.AnnualRevenue?\" or \"Who has Modify All Data?\". The command finds every profile, permission set, and permission set group that grants the permission, and the users who are assigned to them.\n\nCheck exactly one of the following:\n - An object permission (--object, with --access read, create, edit, delete, viewall, modifyall, or viewallfields)\n - A field permission (--field, with --access read or edit)\n - Access to an Apex class (--apex-class) or a Visualforce page (--apex-page)\n - A custom permission (--custom-permission)\n - A system permission (--system-permission), e.g. ModifyAllData or ViewSetup\n\nThe same permission rules as userpermissions check apply: for field checks, only users who also have the matching access on the object are included, and View All Fields grants Read on all fields. Apex class and Visualforce page checks include access granted by the Author Apex and Customize Application system permissions.\n\nInactive users are excluded unless you specify --include-inactive. The result lists up to --user-limit users; the total count is always returned.\n\nThe command only reads standard setup objects, so the RFLIB package doesn't need to be installed. The running user needs the View Setup and Configuration permission.",
1191
+ "description": "Answers questions such as \"Can this user edit Account.AnnualRevenue?\" or \"Does this user have Modify All Data?\". The command checks the user's profile, permission sets, and permission set groups, and returns whether the permission is granted and which of them grant it.\n\nCheck exactly one of the following:\n - An object permission (--object, with --access read, create, edit, delete, viewall, modifyall, or viewallfields)\n - A field permission (--field, with --access read or edit)\n - Access to an Apex class (--apex-class) or a Visualforce page (--apex-page)\n - A custom permission (--custom-permission)\n - A system permission (--system-permission), e.g. ModifyAllData or ViewSetup\n\nField checks take the object permissions into account: a field is only accessible when the user also has Read (or Edit) on the object. View All Fields on the object grants Read on all of its fields. Apex class and Visualforce page checks include access granted by the Author Apex and Customize Application system permissions.\n\nSharing and record-level access aren't checked.\n\nThe command only reads standard setup objects, so the RFLIB package doesn't need to be installed. The running user needs the View Setup and Configuration permission.",
1048
1192
  "examples": [
1049
- "Find the users who can edit a field:\n$ sf rflib debug userpermissions whohas --target-org myOrg --field Account.AnnualRevenue --access edit",
1050
- "Find the users who have Modify All Data:\n$ sf rflib debug userpermissions whohas --target-org myOrg --system-permission ModifyAllData",
1051
- "Find the users who can access an Apex class, including inactive users:\n$ sf rflib debug userpermissions whohas --target-org myOrg --apex-class OrderController --include-inactive"
1193
+ "Check whether a user can edit a field:\n$ sf rflib debug userpermissions check --target-org myOrg --user jane@example.com --field Account.AnnualRevenue --access edit",
1194
+ "Check whether a user can delete Opportunity records:\n$ sf rflib debug userpermissions check --target-org myOrg --user 0057000000XXXXXX --object Opportunity --access delete",
1195
+ "Check access to an Apex class:\n$ sf rflib debug userpermissions check --target-org myOrg --user jane@example.com --apex-class OrderController",
1196
+ "Check a custom permission:\n$ sf rflib debug userpermissions check --target-org myOrg --user jane@example.com --custom-permission Approve_Discounts",
1197
+ "Check a system permission:\n$ sf rflib debug userpermissions check --target-org myOrg --user jane@example.com --system-permission ModifyAllData"
1052
1198
  ],
1053
1199
  "flags": {
1054
1200
  "json": {
@@ -1068,7 +1214,7 @@
1068
1214
  },
1069
1215
  "target-org": {
1070
1216
  "char": "o",
1071
- "description": "The username or alias of the Salesforce org to search.",
1217
+ "description": "The username or alias of the Salesforce org to check the permission in.",
1072
1218
  "name": "target-org",
1073
1219
  "noCacheDefault": true,
1074
1220
  "required": true,
@@ -1077,9 +1223,19 @@
1077
1223
  "multiple": false,
1078
1224
  "type": "option"
1079
1225
  },
1226
+ "user": {
1227
+ "char": "u",
1228
+ "description": "The Salesforce User ID (15 or 18 characters) or the username of the user whose permission should be checked.",
1229
+ "name": "user",
1230
+ "required": true,
1231
+ "summary": "User ID (15 or 18 characters) or username of the user to check.",
1232
+ "hasDynamicHelp": false,
1233
+ "multiple": false,
1234
+ "type": "option"
1235
+ },
1080
1236
  "object": {
1081
1237
  "char": "b",
1082
- "description": "Finds users with an object permission. Use --access to choose which one; the default is read.",
1238
+ "description": "Checks an object permission. Use --access to choose which one; the default is read.",
1083
1239
  "name": "object",
1084
1240
  "summary": "API name of the object to check object permissions for, e.g. Account.",
1085
1241
  "hasDynamicHelp": false,
@@ -1088,7 +1244,7 @@
1088
1244
  },
1089
1245
  "field": {
1090
1246
  "char": "f",
1091
- "description": "Finds users with access to a field. Use --access read (default) or --access edit.",
1247
+ "description": "Checks field-level security for a field. Use --access read (default) or --access edit.",
1092
1248
  "name": "field",
1093
1249
  "summary": "Field to check field-level security for, in the form Object.Field, e.g. Account.AnnualRevenue.",
1094
1250
  "hasDynamicHelp": false,
@@ -1114,7 +1270,7 @@
1114
1270
  "type": "option"
1115
1271
  },
1116
1272
  "apex-class": {
1117
- "description": "Finds users who can access an Apex class. Use namespace__Name or namespace.Name for a class in a managed package.",
1273
+ "description": "Checks whether the user can access an Apex class. Use namespace__Name or namespace.Name for a class in a managed package.",
1118
1274
  "name": "apex-class",
1119
1275
  "summary": "Name of the Apex class to check access for.",
1120
1276
  "hasDynamicHelp": false,
@@ -1122,7 +1278,7 @@
1122
1278
  "type": "option"
1123
1279
  },
1124
1280
  "apex-page": {
1125
- "description": "Finds users who can access a Visualforce page. Use namespace__Name for a page in a managed package.",
1281
+ "description": "Checks whether the user can access a Visualforce page. Use namespace__Name for a page in a managed package.",
1126
1282
  "name": "apex-page",
1127
1283
  "summary": "Name of the Visualforce page to check access for.",
1128
1284
  "hasDynamicHelp": false,
@@ -1130,7 +1286,7 @@
1130
1286
  "type": "option"
1131
1287
  },
1132
1288
  "custom-permission": {
1133
- "description": "Finds users who have a custom permission. Use namespace__Name for a custom permission in a managed package.",
1289
+ "description": "Checks whether the user has a custom permission. Use namespace__Name for a custom permission in a managed package.",
1134
1290
  "name": "custom-permission",
1135
1291
  "summary": "API name of the custom permission to check.",
1136
1292
  "hasDynamicHelp": false,
@@ -1138,39 +1294,22 @@
1138
1294
  "type": "option"
1139
1295
  },
1140
1296
  "system-permission": {
1141
- "description": "Finds users who have a system (user) permission. Use the name of the permission field on the PermissionSet object, with or without the \"Permissions\" prefix.",
1297
+ "description": "Checks a system (user) permission. Use the name of the permission field on the PermissionSet object, with or without the \"Permissions\" prefix, e.g. ModifyAllData, ViewAllData, ApiEnabled, or PermissionsAuthorApex.",
1142
1298
  "name": "system-permission",
1143
1299
  "summary": "API name of the system permission to check, e.g. ModifyAllData or ViewSetup.",
1144
1300
  "hasDynamicHelp": false,
1145
1301
  "multiple": false,
1146
1302
  "type": "option"
1147
- },
1148
- "include-inactive": {
1149
- "description": "By default, only active users are returned. Specify this flag to include inactive users as well.",
1150
- "name": "include-inactive",
1151
- "summary": "Include inactive users.",
1152
- "allowNo": false,
1153
- "type": "boolean"
1154
- },
1155
- "user-limit": {
1156
- "char": "l",
1157
- "description": "Limits the number of users in the result. The total number of matching users is always returned in userCount.",
1158
- "name": "user-limit",
1159
- "summary": "Maximum number of users to return. Default: 200, maximum: 2000.",
1160
- "default": 200,
1161
- "hasDynamicHelp": false,
1162
- "multiple": false,
1163
- "type": "option"
1164
1303
  }
1165
1304
  },
1166
1305
  "hasDynamicHelp": true,
1167
1306
  "hiddenAliases": [],
1168
- "id": "rflib:debug:userpermissions:whohas",
1307
+ "id": "rflib:debug:userpermissions:check",
1169
1308
  "pluginAlias": "rflib-plugin",
1170
1309
  "pluginName": "rflib-plugin",
1171
1310
  "pluginType": "core",
1172
1311
  "strict": true,
1173
- "summary": "Find the users who have a specific permission, and what grants it.",
1312
+ "summary": "Check whether a user has a specific permission, and where it comes from.",
1174
1313
  "enableJsonFlag": true,
1175
1314
  "isESM": true,
1176
1315
  "relativePath": [
@@ -1179,42 +1318,43 @@
1179
1318
  "rflib",
1180
1319
  "debug",
1181
1320
  "userpermissions",
1182
- "whohas.js"
1321
+ "check.js"
1183
1322
  ],
1184
1323
  "aliasPermutations": [],
1185
1324
  "permutations": [
1186
- "rflib:debug:userpermissions:whohas",
1187
- "debug:rflib:userpermissions:whohas",
1188
- "debug:userpermissions:rflib:whohas",
1189
- "debug:userpermissions:whohas:rflib",
1190
- "rflib:userpermissions:debug:whohas",
1191
- "userpermissions:rflib:debug:whohas",
1192
- "userpermissions:debug:rflib:whohas",
1193
- "userpermissions:debug:whohas:rflib",
1194
- "rflib:userpermissions:whohas:debug",
1195
- "userpermissions:rflib:whohas:debug",
1196
- "userpermissions:whohas:rflib:debug",
1197
- "userpermissions:whohas:debug:rflib",
1198
- "rflib:debug:whohas:userpermissions",
1199
- "debug:rflib:whohas:userpermissions",
1200
- "debug:whohas:rflib:userpermissions",
1201
- "debug:whohas:userpermissions:rflib",
1202
- "rflib:whohas:debug:userpermissions",
1203
- "whohas:rflib:debug:userpermissions",
1204
- "whohas:debug:rflib:userpermissions",
1205
- "whohas:debug:userpermissions:rflib",
1206
- "rflib:whohas:userpermissions:debug",
1207
- "whohas:rflib:userpermissions:debug",
1208
- "whohas:userpermissions:rflib:debug",
1209
- "whohas:userpermissions:debug:rflib"
1325
+ "rflib:debug:userpermissions:check",
1326
+ "debug:rflib:userpermissions:check",
1327
+ "debug:userpermissions:rflib:check",
1328
+ "debug:userpermissions:check:rflib",
1329
+ "rflib:userpermissions:debug:check",
1330
+ "userpermissions:rflib:debug:check",
1331
+ "userpermissions:debug:rflib:check",
1332
+ "userpermissions:debug:check:rflib",
1333
+ "rflib:userpermissions:check:debug",
1334
+ "userpermissions:rflib:check:debug",
1335
+ "userpermissions:check:rflib:debug",
1336
+ "userpermissions:check:debug:rflib",
1337
+ "rflib:debug:check:userpermissions",
1338
+ "debug:rflib:check:userpermissions",
1339
+ "debug:check:rflib:userpermissions",
1340
+ "debug:check:userpermissions:rflib",
1341
+ "rflib:check:debug:userpermissions",
1342
+ "check:rflib:debug:userpermissions",
1343
+ "check:debug:rflib:userpermissions",
1344
+ "check:debug:userpermissions:rflib",
1345
+ "rflib:check:userpermissions:debug",
1346
+ "check:rflib:userpermissions:debug",
1347
+ "check:userpermissions:rflib:debug",
1348
+ "check:userpermissions:debug:rflib"
1210
1349
  ]
1211
1350
  },
1212
- "rflib:logging:apex:instrument": {
1351
+ "rflib:debug:userpermissions:compare": {
1213
1352
  "aliases": [],
1214
1353
  "args": {},
1215
- "description": "Analyzes Apex classes and adds RFLIB logging statements for method entry and error handling. Adds class-level logger initialization if not already present. \nFor Apex Test classes, the `@TestSetup` method will be updated to include `rflib_TestUtil.prepareLoggerForUnitTests();` to avoid test failures caused by the logging framework.",
1354
+ "description": "Finds out why something works for one user but not for another. The command combines each user's permissions across their profile, permission sets, and permission set groups, and returns only the permissions that one of the users has and the other doesn't.\n\nUse --permission-type to choose what to compare (default: ALL) and --sobject-type to limit the object and field comparison to one object. ALL compares object and field access, Apex classes, Visualforce pages, custom permissions, and system permissions.\n\nField access only counts where the user also has the matching access on the object. Sharing and record-level access aren't compared.\n\nThe command only reads standard setup objects, so the RFLIB package doesn't need to be installed. The running user needs the View Setup and Configuration permission.",
1216
1355
  "examples": [
1217
- "- Add logging statements to all Apex classes in a directory:\n\n$ sf rflib logging apex instrument --sourcepath force-app/main/default/classes\n\n- Preview changes without modifying files:\n\n$ sf rflib logging apex instrument --sourcepath force-app/main/default/classes --dryrun\n\n- Add logging statements and format code:\n\n$ sf rflib logging apex instrument --sourcepath force-app/main/default/classes --prettier"
1356
+ "Compare all permissions of two users:\n$ sf rflib debug userpermissions compare --target-org myOrg --user jane@example.com --other-user bob@example.com",
1357
+ "Compare object and field access on Account:\n$ sf rflib debug userpermissions compare --target-org myOrg --user jane@example.com --other-user bob@example.com --permission-type FLS --sobject-type Account"
1218
1358
  ],
1219
1359
  "flags": {
1220
1360
  "json": {
@@ -1232,133 +1372,118 @@
1232
1372
  "multiple": false,
1233
1373
  "type": "option"
1234
1374
  },
1235
- "sourcepath": {
1236
- "char": "s",
1237
- "description": "Path to the source directory containing Apex classes that should be instrumented with RFLIB logging statements. Test classes (ending with 'Test.cls') are automatically excluded.",
1238
- "name": "sourcepath",
1375
+ "target-org": {
1376
+ "char": "o",
1377
+ "description": "The username or alias of the Salesforce org to compare the users in.",
1378
+ "name": "target-org",
1379
+ "noCacheDefault": true,
1239
1380
  "required": true,
1240
- "summary": "Directory containing Apex classes to instrument with logging.",
1241
- "hasDynamicHelp": false,
1381
+ "summary": "Username or alias of the target org.",
1382
+ "hasDynamicHelp": true,
1242
1383
  "multiple": false,
1243
1384
  "type": "option"
1244
1385
  },
1245
- "dryrun": {
1246
- "char": "d",
1247
- "description": "When enabled, shows which files would be modified without making actual changes. Useful for reviewing the impact before applying changes.",
1248
- "name": "dryrun",
1249
- "summary": "Preview changes without modifying files.",
1250
- "allowNo": false,
1251
- "type": "boolean"
1252
- },
1253
- "prettier": {
1254
- "char": "p",
1255
- "description": "When enabled, formats the modified Apex files using prettier-plugin-apex after adding logging statements. Maintains consistent code style with:\n\n- 120 character line width\n- 4 space indentation\n- Single quotes for strings\n- No tabs",
1256
- "name": "prettier",
1257
- "summary": "Format modified files using Prettier.",
1258
- "allowNo": false,
1259
- "type": "boolean"
1260
- },
1261
- "no-if": {
1262
- "description": "When provided, the command will not add log statements inside of `if` and `else` blocks.",
1263
- "name": "no-if",
1264
- "summary": "Exclude the instrumentation of if-else statements.",
1265
- "allowNo": false,
1266
- "type": "boolean"
1267
- },
1268
- "no-catch": {
1269
- "description": "When provided, the command will not add error log statements inside of `catch` blocks.",
1270
- "name": "no-catch",
1271
- "summary": "Exclude the instrumentation of catch blocks.",
1272
- "allowNo": false,
1273
- "type": "boolean"
1274
- },
1275
- "skip-instrumented": {
1276
- "description": "When provided, the command will not add log statements to any Apex class that contains the `rflib_Logger` reference.",
1277
- "name": "skip-instrumented",
1278
- "summary": "Skips any files where a logger is already present.",
1279
- "allowNo": false,
1280
- "type": "boolean"
1386
+ "user": {
1387
+ "char": "u",
1388
+ "description": "The first user to compare, typically the user for whom something doesn't work.",
1389
+ "name": "user",
1390
+ "required": true,
1391
+ "summary": "User ID (15 or 18 characters) or username of the first user.",
1392
+ "hasDynamicHelp": false,
1393
+ "multiple": false,
1394
+ "type": "option"
1281
1395
  },
1282
- "verbose": {
1283
- "char": "v",
1284
- "description": "When provided with --dryrun, prints the paths of the files that would be modified.",
1285
- "name": "verbose",
1286
- "summary": "Enable verbose output.",
1287
- "allowNo": false,
1288
- "type": "boolean"
1396
+ "other-user": {
1397
+ "char": "w",
1398
+ "description": "The second user to compare, typically the user for whom it works.",
1399
+ "name": "other-user",
1400
+ "required": true,
1401
+ "summary": "User ID (15 or 18 characters) or username of the second user.",
1402
+ "hasDynamicHelp": false,
1403
+ "multiple": false,
1404
+ "type": "option"
1289
1405
  },
1290
- "exclude": {
1291
- "char": "e",
1292
- "description": "Exclude specific files or directories that match the provided glob pattern. For example, use --exclude \"**/Generated_*.cls\" to skip auto-generated classes.",
1293
- "name": "exclude",
1294
- "summary": "Exclude files or directories from instrumentation based on a glob pattern.",
1406
+ "permission-type": {
1407
+ "char": "t",
1408
+ "description": "Controls which permissions are compared:\n - FLS: Field access\n - OLS: Object access\n - APEX: Apex class and Visualforce page access\n - ALL: All of the above, plus custom permissions and system permissions",
1409
+ "name": "permission-type",
1410
+ "summary": "Permissions to compare: FLS, OLS, APEX, or ALL. Default: ALL.",
1411
+ "default": "ALL",
1295
1412
  "hasDynamicHelp": false,
1296
1413
  "multiple": false,
1414
+ "options": [
1415
+ "FLS",
1416
+ "OLS",
1417
+ "APEX",
1418
+ "ALL"
1419
+ ],
1297
1420
  "type": "option"
1298
1421
  },
1299
- "concurrency": {
1300
- "char": "c",
1301
- "description": "Controls the maximum number of files to process at the same time. This is useful in very large codebases to prevent excessive memory usage or file descriptor exhaustion. Defaults to 10.",
1302
- "name": "concurrency",
1303
- "summary": "Limits the number of files processed concurrently.",
1304
- "default": 10,
1422
+ "sobject-type": {
1423
+ "char": "b",
1424
+ "description": "Limits the object and field comparison to one SObject type, e.g. Account. Recommended in large orgs, where the full field comparison can reach the query row limit.",
1425
+ "name": "sobject-type",
1426
+ "summary": "Optional SObject API name to limit the object and field comparison to.",
1305
1427
  "hasDynamicHelp": false,
1306
1428
  "multiple": false,
1307
1429
  "type": "option"
1308
1430
  }
1309
1431
  },
1310
- "hasDynamicHelp": false,
1432
+ "hasDynamicHelp": true,
1311
1433
  "hiddenAliases": [],
1312
- "id": "rflib:logging:apex:instrument",
1434
+ "id": "rflib:debug:userpermissions:compare",
1313
1435
  "pluginAlias": "rflib-plugin",
1314
1436
  "pluginName": "rflib-plugin",
1315
1437
  "pluginType": "core",
1316
1438
  "strict": true,
1317
- "summary": "Instrument Apex classes with RFLIB logging statements automatically.",
1439
+ "summary": "Compare the permissions of two users and show only the differences.",
1318
1440
  "enableJsonFlag": true,
1319
1441
  "isESM": true,
1320
1442
  "relativePath": [
1321
1443
  "lib",
1322
1444
  "commands",
1323
1445
  "rflib",
1324
- "logging",
1325
- "apex",
1326
- "instrument.js"
1446
+ "debug",
1447
+ "userpermissions",
1448
+ "compare.js"
1327
1449
  ],
1328
1450
  "aliasPermutations": [],
1329
1451
  "permutations": [
1330
- "rflib:logging:apex:instrument",
1331
- "logging:rflib:apex:instrument",
1332
- "logging:apex:rflib:instrument",
1333
- "logging:apex:instrument:rflib",
1334
- "rflib:apex:logging:instrument",
1335
- "apex:rflib:logging:instrument",
1336
- "apex:logging:rflib:instrument",
1337
- "apex:logging:instrument:rflib",
1338
- "rflib:apex:instrument:logging",
1339
- "apex:rflib:instrument:logging",
1340
- "apex:instrument:rflib:logging",
1341
- "apex:instrument:logging:rflib",
1342
- "rflib:logging:instrument:apex",
1343
- "logging:rflib:instrument:apex",
1344
- "logging:instrument:rflib:apex",
1345
- "logging:instrument:apex:rflib",
1346
- "rflib:instrument:logging:apex",
1347
- "instrument:rflib:logging:apex",
1348
- "instrument:logging:rflib:apex",
1349
- "instrument:logging:apex:rflib",
1350
- "rflib:instrument:apex:logging",
1351
- "instrument:rflib:apex:logging",
1352
- "instrument:apex:rflib:logging",
1353
- "instrument:apex:logging:rflib"
1452
+ "rflib:debug:userpermissions:compare",
1453
+ "debug:rflib:userpermissions:compare",
1454
+ "debug:userpermissions:rflib:compare",
1455
+ "debug:userpermissions:compare:rflib",
1456
+ "rflib:userpermissions:debug:compare",
1457
+ "userpermissions:rflib:debug:compare",
1458
+ "userpermissions:debug:rflib:compare",
1459
+ "userpermissions:debug:compare:rflib",
1460
+ "rflib:userpermissions:compare:debug",
1461
+ "userpermissions:rflib:compare:debug",
1462
+ "userpermissions:compare:rflib:debug",
1463
+ "userpermissions:compare:debug:rflib",
1464
+ "rflib:debug:compare:userpermissions",
1465
+ "debug:rflib:compare:userpermissions",
1466
+ "debug:compare:rflib:userpermissions",
1467
+ "debug:compare:userpermissions:rflib",
1468
+ "rflib:compare:debug:userpermissions",
1469
+ "compare:rflib:debug:userpermissions",
1470
+ "compare:debug:rflib:userpermissions",
1471
+ "compare:debug:userpermissions:rflib",
1472
+ "rflib:compare:userpermissions:debug",
1473
+ "compare:rflib:userpermissions:debug",
1474
+ "compare:userpermissions:rflib:debug",
1475
+ "compare:userpermissions:debug:rflib"
1354
1476
  ]
1355
1477
  },
1356
- "rflib:logging:aura:instrument": {
1478
+ "rflib:debug:userpermissions:get": {
1357
1479
  "aliases": [],
1358
1480
  "args": {},
1359
- "description": "Analyzes Aura Component files and adds RFLIB logging statements for:\n- Method entry logging with parameter values in Controller, Helper, and Renderer files\n- Error logging in try-catch blocks\n- Error logging in Promise catch handlers\n- Adds rflibLoggerCmp component if not present\n- Replaces console.log and similar method invocations\n- Formats modified files using Prettier (optional)\n\nThe command processes:\n- Component (.cmp) files to add the logger component\n- Controller (.js) files for method instrumentation\n- Helper (.js) files for method instrumentation\n- Renderer (.js) files for method instrumentation",
1481
+ "description": "Retrieves FLS (Field-Level Security), OLS (Object-Level Security), and Apex class/page permissions for a specific user\nvia the Salesforce REST API. Permissions are aggregated across the user's profile, permission sets, and permission set groups.\n\nUse --sobject-type to narrow FLS or OLS results to a specific SObject.\n\nUse --effective to get the user's combined permissions instead of the raw permission records: one entry per object with its access levels, one entry per field with read and edit (only where the user also has that access on the object), and the names of the accessible Apex classes and Visualforce pages. With --permission-type ALL, the result also lists the user's custom permissions and system permissions.\n\nRequires the RFLIB base package to be installed in the target org and the running user to be assigned the rflib_Ops_Center_Access permission set (or have equivalent read access to the relevant permission objects).\nFor installation instructions, visit: https://github.com/j-fischer/rflib",
1360
1482
  "examples": [
1361
- "- Add logging to all aura files:\n$ sf rflib logging aura instrument --sourcepath force-app\n\n- Preview changes:\n$ sf rflib logging aura instrument --sourcepath force-app --dryrun\n\n- Add logging and format code:\n$ sf rflib logging aura instrument --sourcepath force-app --prettier\n\n- Process specific component:\n$ sf rflib logging aura instrument --sourcepath force-app/main/default/aura/myComponent"
1483
+ "Check all permissions for a user:\n$ sf rflib debug userpermissions get --target-org myOrg --user-id 0057000000XXXXXX --permission-type ALL",
1484
+ "Check FLS for a specific object:\n$ sf rflib debug userpermissions get --target-org myOrg --user-id 0057000000XXXXXX --permission-type FLS --sobject-type Account",
1485
+ "Check Apex access:\n$ sf rflib debug userpermissions get --target-org myOrg --user-id 0057000000XXXXXX --permission-type APEX",
1486
+ "Get the combined permissions of a user, including custom and system permissions:\n$ sf rflib debug userpermissions get --target-org myOrg --user-id 0057000000XXXXXX --permission-type ALL --effective"
1362
1487
  ],
1363
1488
  "flags": {
1364
1489
  "json": {
@@ -1376,129 +1501,115 @@
1376
1501
  "multiple": false,
1377
1502
  "type": "option"
1378
1503
  },
1379
- "sourcepath": {
1380
- "char": "s",
1381
- "description": "Path to the source directory containing Aura components that should be instrumented with RFLIB logging statements. The command will:\n- Scan for 'aura' directories recursively\n- Process all Aura components found\n- Add <c:rflibLoggerCmp> to component files\n- Add logging statements to JavaScript files\n- Initialize logger in methods using component.find()",
1382
- "name": "sourcepath",
1504
+ "target-org": {
1505
+ "char": "o",
1506
+ "description": "The username or alias of the Salesforce org containing the RFLIB base package.",
1507
+ "name": "target-org",
1508
+ "noCacheDefault": true,
1383
1509
  "required": true,
1384
- "summary": "Directory containing Aura components to instrument with logging.",
1510
+ "summary": "Username or alias of the target org.",
1511
+ "hasDynamicHelp": true,
1512
+ "multiple": false,
1513
+ "type": "option"
1514
+ },
1515
+ "user-id": {
1516
+ "char": "u",
1517
+ "description": "The Salesforce User ID (15 or 18 characters) of the user whose permissions should be retrieved.",
1518
+ "name": "user-id",
1519
+ "required": true,
1520
+ "summary": "Salesforce User ID (15 or 18 character) to check permissions for.",
1385
1521
  "hasDynamicHelp": false,
1386
1522
  "multiple": false,
1387
1523
  "type": "option"
1388
1524
  },
1389
- "dryrun": {
1390
- "char": "d",
1391
- "description": "When enabled, shows which files would be modified without making actual changes. Useful for reviewing the impact before applying changes. Shows:\n- Files that would be modified\n- Number of processed files\n- Number of modified files\n- Number of formatted files",
1392
- "name": "dryrun",
1393
- "summary": "Preview changes without modifying files.",
1394
- "allowNo": false,
1395
- "type": "boolean"
1525
+ "permission-type": {
1526
+ "char": "t",
1527
+ "description": "Controls which permission types are returned:\n - FLS: Field-Level Security only\n - OLS: Object-Level Security only\n - APEX: Apex class and page access only\n - ALL: All three permission types",
1528
+ "name": "permission-type",
1529
+ "required": true,
1530
+ "summary": "Type of permissions to retrieve: FLS, OLS, APEX, or ALL.",
1531
+ "hasDynamicHelp": false,
1532
+ "multiple": false,
1533
+ "options": [
1534
+ "FLS",
1535
+ "OLS",
1536
+ "APEX",
1537
+ "ALL"
1538
+ ],
1539
+ "type": "option"
1396
1540
  },
1397
- "prettier": {
1398
- "char": "p",
1399
- "description": "When enabled, formats the modified JavaScript files using Prettier after adding logging statements. Maintains consistent code style with:\n- 120 character line width\n- 4 space indentation\n- Single quotes for strings\n- No tabs\n- No trailing commas",
1400
- "name": "prettier",
1401
- "summary": "Format modified files using Prettier.",
1402
- "allowNo": false,
1403
- "type": "boolean"
1404
- },
1405
- "no-if": {
1406
- "description": "When provided, the command will not add log statements inside of `if` and `else` blocks.",
1407
- "name": "no-if",
1408
- "summary": "Exclude the instrumentation of if-else statements.",
1409
- "allowNo": false,
1410
- "type": "boolean"
1411
- },
1412
- "skip-instrumented": {
1413
- "description": "When provided, the command will not add log statements to any Aura component that contains the `` component.",
1414
- "name": "skip-instrumented",
1415
- "summary": "Skips any files where a logger is already present.",
1416
- "allowNo": false,
1417
- "type": "boolean"
1418
- },
1419
- "verbose": {
1420
- "char": "v",
1421
- "description": "When provided with --dryrun, prints the paths of the files that would be modified.",
1422
- "name": "verbose",
1423
- "summary": "Enable verbose output.",
1424
- "allowNo": false,
1425
- "type": "boolean"
1426
- },
1427
- "exclude": {
1428
- "char": "e",
1429
- "description": "Exclude specific files or directories that match the provided glob pattern. For example, use --exclude \"**/Generated_*.cmp\" to skip auto-generated components.",
1430
- "name": "exclude",
1431
- "summary": "Exclude files or directories from instrumentation based on a glob pattern.",
1541
+ "sobject-type": {
1542
+ "char": "b",
1543
+ "description": "Filters Field-Level Security or Object-Level Security results to a specific SObject type, e.g. Account, Contact, Opportunity.",
1544
+ "name": "sobject-type",
1545
+ "summary": "Optional SObject API name to filter FLS or OLS results.",
1432
1546
  "hasDynamicHelp": false,
1433
1547
  "multiple": false,
1434
1548
  "type": "option"
1435
1549
  },
1436
- "concurrency": {
1437
- "char": "c",
1438
- "description": "Controls the maximum number of files to process at the same time. This is useful in very large codebases to prevent excessive memory usage or file descriptor exhaustion. Defaults to 10.",
1439
- "name": "concurrency",
1440
- "summary": "Limits the number of files processed concurrently.",
1441
- "default": 10,
1442
- "hasDynamicHelp": false,
1443
- "multiple": false,
1444
- "type": "option"
1550
+ "effective": {
1551
+ "char": "e",
1552
+ "description": "Merges the permissions from the profile, permission sets, and permission set groups. Objects list their access levels (read, create, edit, delete, viewall, modifyall, viewallfields), fields list read and edit, and Apex classes, Visualforce pages, and custom permissions are listed by name. System permissions are included for --permission-type ALL. With --effective, --user-id also accepts a username.",
1553
+ "name": "effective",
1554
+ "summary": "Return the user's combined permissions instead of the raw permission records.",
1555
+ "allowNo": false,
1556
+ "type": "boolean"
1445
1557
  }
1446
1558
  },
1447
- "hasDynamicHelp": false,
1559
+ "hasDynamicHelp": true,
1448
1560
  "hiddenAliases": [],
1449
- "id": "rflib:logging:aura:instrument",
1561
+ "id": "rflib:debug:userpermissions:get",
1450
1562
  "pluginAlias": "rflib-plugin",
1451
1563
  "pluginName": "rflib-plugin",
1452
1564
  "pluginType": "core",
1453
1565
  "strict": true,
1454
- "summary": "Instrument Aura Components with RFLIB logging statements automatically.",
1566
+ "summary": "Check Salesforce permissions for a user in the target org.",
1455
1567
  "enableJsonFlag": true,
1456
1568
  "isESM": true,
1457
1569
  "relativePath": [
1458
1570
  "lib",
1459
1571
  "commands",
1460
1572
  "rflib",
1461
- "logging",
1462
- "aura",
1463
- "instrument.js"
1573
+ "debug",
1574
+ "userpermissions",
1575
+ "get.js"
1464
1576
  ],
1465
1577
  "aliasPermutations": [],
1466
1578
  "permutations": [
1467
- "rflib:logging:aura:instrument",
1468
- "logging:rflib:aura:instrument",
1469
- "logging:aura:rflib:instrument",
1470
- "logging:aura:instrument:rflib",
1471
- "rflib:aura:logging:instrument",
1472
- "aura:rflib:logging:instrument",
1473
- "aura:logging:rflib:instrument",
1474
- "aura:logging:instrument:rflib",
1475
- "rflib:aura:instrument:logging",
1476
- "aura:rflib:instrument:logging",
1477
- "aura:instrument:rflib:logging",
1478
- "aura:instrument:logging:rflib",
1479
- "rflib:logging:instrument:aura",
1480
- "logging:rflib:instrument:aura",
1481
- "logging:instrument:rflib:aura",
1482
- "logging:instrument:aura:rflib",
1483
- "rflib:instrument:logging:aura",
1484
- "instrument:rflib:logging:aura",
1485
- "instrument:logging:rflib:aura",
1486
- "instrument:logging:aura:rflib",
1487
- "rflib:instrument:aura:logging",
1488
- "instrument:rflib:aura:logging",
1489
- "instrument:aura:rflib:logging",
1490
- "instrument:aura:logging:rflib"
1579
+ "rflib:debug:userpermissions:get",
1580
+ "debug:rflib:userpermissions:get",
1581
+ "debug:userpermissions:rflib:get",
1582
+ "debug:userpermissions:get:rflib",
1583
+ "rflib:userpermissions:debug:get",
1584
+ "userpermissions:rflib:debug:get",
1585
+ "userpermissions:debug:rflib:get",
1586
+ "userpermissions:debug:get:rflib",
1587
+ "rflib:userpermissions:get:debug",
1588
+ "userpermissions:rflib:get:debug",
1589
+ "userpermissions:get:rflib:debug",
1590
+ "userpermissions:get:debug:rflib",
1591
+ "rflib:debug:get:userpermissions",
1592
+ "debug:rflib:get:userpermissions",
1593
+ "debug:get:rflib:userpermissions",
1594
+ "debug:get:userpermissions:rflib",
1595
+ "rflib:get:debug:userpermissions",
1596
+ "get:rflib:debug:userpermissions",
1597
+ "get:debug:rflib:userpermissions",
1598
+ "get:debug:userpermissions:rflib",
1599
+ "rflib:get:userpermissions:debug",
1600
+ "get:rflib:userpermissions:debug",
1601
+ "get:userpermissions:rflib:debug",
1602
+ "get:userpermissions:debug:rflib"
1491
1603
  ]
1492
1604
  },
1493
- "rflib:logging:flow:instrument": {
1605
+ "rflib:debug:userpermissions:whohas": {
1494
1606
  "aliases": [],
1495
1607
  "args": {},
1496
- "description": "Automatically adds RFLIB logging statements to Salesforce Flows to provide enhanced tracking and debugging capabilities. Works with both standard Flows and Auto-Launched Flows. Instruments flow invocations and decision paths with logging actions, and logs an error on the fault path of every element that can fail. Existing fault paths continue after the error is logged. Elements without a fault path get one that logs the error and then terminates the transaction, so the Flow still fails as before; this requires the Terminate Transaction option of the RFLIB Log Message action, which was added in RFLIB 11.4.0. The command checks the RFLIB version in the target org, using the installed RFLIB package or, if RFLIB was deployed as source, its RFLIB_Version custom label, and skips the fault paths if the org runs an older version, RFLIB is not found, or the version cannot be determined. Also sets the CanvasMode to AUTO_LAYOUT_CANVAS for better flow visualization while preserving the original processType.",
1608
+ "description": "The reverse of userpermissions check. Answers questions such as \"Who can edit Account.AnnualRevenue?\" or \"Who has Modify All Data?\". The command finds every profile, permission set, and permission set group that grants the permission, and the users who are assigned to them.\n\nCheck exactly one of the following:\n - An object permission (--object, with --access read, create, edit, delete, viewall, modifyall, or viewallfields)\n - A field permission (--field, with --access read or edit)\n - Access to an Apex class (--apex-class) or a Visualforce page (--apex-page)\n - A custom permission (--custom-permission)\n - A system permission (--system-permission), e.g. ModifyAllData or ViewSetup\n\nThe same permission rules as userpermissions check apply: for field checks, only users who also have the matching access on the object are included, and View All Fields grants Read on all fields. Apex class and Visualforce page checks include access granted by the Author Apex and Customize Application system permissions.\n\nInactive users are excluded unless you specify --include-inactive. The result lists up to --user-limit users; the total count is always returned.\n\nThe command only reads standard setup objects, so the RFLIB package doesn't need to be installed. The running user needs the View Setup and Configuration permission.",
1497
1609
  "examples": [
1498
- "<%= config.bin %> <%= command.id %> --target-org myOrg --sourcepath force-app",
1499
- "<%= config.bin %> <%= command.id %> --target-org myOrg --sourcepath force-app --dryrun",
1500
- "<%= config.bin %> <%= command.id %> --target-org myOrg --sourcepath force-app --skip-instrumented",
1501
- "<%= config.bin %> <%= command.id %> --target-org myOrg --sourcepath force-app --skip-fault-paths"
1610
+ "Find the users who can edit a field:\n$ sf rflib debug userpermissions whohas --target-org myOrg --field Account.AnnualRevenue --access edit",
1611
+ "Find the users who have Modify All Data:\n$ sf rflib debug userpermissions whohas --target-org myOrg --system-permission ModifyAllData",
1612
+ "Find the users who can access an Apex class, including inactive users:\n$ sf rflib debug userpermissions whohas --target-org myOrg --apex-class OrderController --include-inactive"
1502
1613
  ],
1503
1614
  "flags": {
1504
1615
  "json": {
@@ -1518,7 +1629,7 @@
1518
1629
  },
1519
1630
  "target-org": {
1520
1631
  "char": "o",
1521
- "description": "The Salesforce org the instrumented Flows will be deployed to. The fault paths this command creates use the Terminate Transaction option of the RFLIB Log Message action, which was added in RFLIB 11.4.0, so Flows that use it fail to deploy to an org running an older RFLIB version. Before changing any files, the command runs a read-only Tooling API query for the packages installed in this org. If RFLIB is not installed as a package, for example because it was deployed as source, a second query reads the RFLIB_Version custom label instead. If the org runs RFLIB 11.4.0 or later, fault paths are instrumented; if it runs an older version, RFLIB is not found, or a query fails, they are skipped with a warning. Nothing in the org is changed. The flag is required even with --skip-fault-paths, although the org is not queried in that case.",
1632
+ "description": "The username or alias of the Salesforce org to search.",
1522
1633
  "name": "target-org",
1523
1634
  "noCacheDefault": true,
1524
1635
  "required": true,
@@ -1527,249 +1638,138 @@
1527
1638
  "multiple": false,
1528
1639
  "type": "option"
1529
1640
  },
1530
- "sourcepath": {
1531
- "char": "s",
1532
- "description": "Path to the source directory containing Flow files that should be instrumented with RFLIB logging statements. Processes .flow-meta.xml files with processType=\"Flow\" or \"AutoLaunchedFlow\".",
1533
- "name": "sourcepath",
1534
- "required": true,
1535
- "summary": "Directory containing Flow files to instrument with logging.",
1641
+ "object": {
1642
+ "char": "b",
1643
+ "description": "Finds users with an object permission. Use --access to choose which one; the default is read.",
1644
+ "name": "object",
1645
+ "summary": "API name of the object to check object permissions for, e.g. Account.",
1536
1646
  "hasDynamicHelp": false,
1537
1647
  "multiple": false,
1538
1648
  "type": "option"
1539
1649
  },
1540
- "dryrun": {
1541
- "char": "d",
1542
- "description": "When enabled, shows which files would be modified without making actual changes. Useful for reviewing the impact before applying changes.",
1543
- "name": "dryrun",
1544
- "summary": "Preview changes without modifying files.",
1545
- "allowNo": false,
1546
- "type": "boolean"
1547
- },
1548
- "skip-instrumented": {
1549
- "description": "When provided, the command will not add log statements to any Flows that already contain RFLIB logging actions.",
1550
- "name": "skip-instrumented",
1551
- "summary": "Skips any files where a logger is already present.",
1552
- "allowNo": false,
1553
- "type": "boolean"
1554
- },
1555
- "skip-fault-paths": {
1556
- "description": "When provided, the command will not add error logging to fault paths and will not create fault paths for elements that have none, regardless of the RFLIB version installed in the target org.",
1557
- "name": "skip-fault-paths",
1558
- "summary": "Skips logging errors on fault paths.",
1559
- "allowNo": false,
1560
- "type": "boolean"
1561
- },
1562
- "verbose": {
1563
- "char": "v",
1564
- "description": "When provided with --dryrun, prints the paths of the files that would be modified.",
1565
- "name": "verbose",
1566
- "summary": "Enable verbose output.",
1567
- "allowNo": false,
1568
- "type": "boolean"
1569
- },
1570
- "exclude": {
1571
- "char": "e",
1572
- "description": "Exclude specific files or directories that match the provided glob pattern. For example, use --exclude \"**/Test_*.flow-meta.xml\" to skip certain flows.",
1573
- "name": "exclude",
1574
- "summary": "Exclude files or directories from instrumentation based on a glob pattern.",
1650
+ "field": {
1651
+ "char": "f",
1652
+ "description": "Finds users with access to a field. Use --access read (default) or --access edit.",
1653
+ "name": "field",
1654
+ "summary": "Field to check field-level security for, in the form Object.Field, e.g. Account.AnnualRevenue.",
1575
1655
  "hasDynamicHelp": false,
1576
1656
  "multiple": false,
1577
1657
  "type": "option"
1578
1658
  },
1579
- "concurrency": {
1580
- "char": "c",
1581
- "description": "Controls the maximum number of files to process at the same time. This is useful in very large codebases to prevent excessive memory usage or file descriptor exhaustion. Defaults to 10.",
1582
- "name": "concurrency",
1583
- "summary": "Limits the number of files processed concurrently.",
1584
- "default": 10,
1659
+ "access": {
1660
+ "char": "a",
1661
+ "description": "The access level to check:\n - read, edit: for objects and fields\n - create, delete, viewall (View All Records), modifyall (Modify All Records), viewallfields (View All Fields): for objects only",
1662
+ "name": "access",
1663
+ "summary": "Access level to check for --object or --field. Default: read.",
1585
1664
  "hasDynamicHelp": false,
1586
1665
  "multiple": false,
1666
+ "options": [
1667
+ "read",
1668
+ "create",
1669
+ "edit",
1670
+ "delete",
1671
+ "viewall",
1672
+ "modifyall",
1673
+ "viewallfields"
1674
+ ],
1587
1675
  "type": "option"
1588
- }
1589
- },
1590
- "hasDynamicHelp": true,
1591
- "hiddenAliases": [],
1592
- "id": "rflib:logging:flow:instrument",
1593
- "pluginAlias": "rflib-plugin",
1594
- "pluginName": "rflib-plugin",
1595
- "pluginType": "core",
1596
- "strict": true,
1597
- "summary": "Adds RFLIB logging statements to Salesforce Flows.",
1598
- "enableJsonFlag": true,
1599
- "isESM": true,
1600
- "relativePath": [
1601
- "lib",
1602
- "commands",
1603
- "rflib",
1604
- "logging",
1605
- "flow",
1606
- "instrument.js"
1607
- ],
1608
- "aliasPermutations": [],
1609
- "permutations": [
1610
- "rflib:logging:flow:instrument",
1611
- "logging:rflib:flow:instrument",
1612
- "logging:flow:rflib:instrument",
1613
- "logging:flow:instrument:rflib",
1614
- "rflib:flow:logging:instrument",
1615
- "flow:rflib:logging:instrument",
1616
- "flow:logging:rflib:instrument",
1617
- "flow:logging:instrument:rflib",
1618
- "rflib:flow:instrument:logging",
1619
- "flow:rflib:instrument:logging",
1620
- "flow:instrument:rflib:logging",
1621
- "flow:instrument:logging:rflib",
1622
- "rflib:logging:instrument:flow",
1623
- "logging:rflib:instrument:flow",
1624
- "logging:instrument:rflib:flow",
1625
- "logging:instrument:flow:rflib",
1626
- "rflib:instrument:logging:flow",
1627
- "instrument:rflib:logging:flow",
1628
- "instrument:logging:rflib:flow",
1629
- "instrument:logging:flow:rflib",
1630
- "rflib:instrument:flow:logging",
1631
- "instrument:rflib:flow:logging",
1632
- "instrument:flow:rflib:logging",
1633
- "instrument:flow:logging:rflib"
1634
- ]
1635
- },
1636
- "rflib:logging:lwc:instrument": {
1637
- "aliases": [],
1638
- "args": {},
1639
- "description": "Analyzes Lightning Web Component JavaScript files and adds RFLIB logging statements for:\n- Method entry logging with parameter values\n- Error logging in try-catch blocks\n- Error logging in Promise catch handlers\n- Condition logging in if/else blocks\n- Adds logger import if not present\n- Adds logger initialization if not present\n- Replaces console.log and similar method invocations\n- Formats modified files using Prettier (optional)",
1640
- "examples": [
1641
- "- Add logging to all LWC files:\n$ sf rflib logging lwc instrument --sourcepath force-app/main/default/lwc\n\n- Preview changes:\n$ sf rflib logging lwc instrument --sourcepath force-app/main/default/lwc --dryrun\n\n- Add logging and format code:\n$ sf rflib logging lwc instrument --sourcepath force-app/main/default/lwc --prettier\n\n- Process specific component:\n$ sf rflib logging lwc instrument --sourcepath force-app/main/default/lwc/myComponent"
1642
- ],
1643
- "flags": {
1644
- "json": {
1645
- "description": "Format output as json.",
1646
- "helpGroup": "GLOBAL",
1647
- "name": "json",
1648
- "allowNo": false,
1649
- "type": "boolean"
1650
1676
  },
1651
- "flags-dir": {
1652
- "helpGroup": "GLOBAL",
1653
- "name": "flags-dir",
1654
- "summary": "Import flag values from a directory.",
1677
+ "apex-class": {
1678
+ "description": "Finds users who can access an Apex class. Use namespace__Name or namespace.Name for a class in a managed package.",
1679
+ "name": "apex-class",
1680
+ "summary": "Name of the Apex class to check access for.",
1655
1681
  "hasDynamicHelp": false,
1656
1682
  "multiple": false,
1657
1683
  "type": "option"
1658
1684
  },
1659
- "sourcepath": {
1660
- "char": "s",
1661
- "description": "Path to the source directory containing Lightning Web Component JavaScript files that should be instrumented with RFLIB logging statements. Aura component files are automatically excluded. The command will:\n- Process all .js files in the directory and subdirectories\n- Skip files in 'aura' directories\n- Add import statement: import { createLogger } from 'c/rflibLogger'\n- Add logger initialization: const logger = createLogger('ComponentName')",
1662
- "name": "sourcepath",
1663
- "required": true,
1664
- "summary": "Directory containing LWC JavaScript files to instrument with logging.",
1685
+ "apex-page": {
1686
+ "description": "Finds users who can access a Visualforce page. Use namespace__Name for a page in a managed package.",
1687
+ "name": "apex-page",
1688
+ "summary": "Name of the Visualforce page to check access for.",
1665
1689
  "hasDynamicHelp": false,
1666
1690
  "multiple": false,
1667
1691
  "type": "option"
1668
1692
  },
1669
- "dryrun": {
1670
- "char": "d",
1671
- "description": "When enabled, shows which files would be modified without making actual changes. Useful for reviewing the impact before applying changes. Shows:\n- Files that would be modified\n- Number of processed files\n- Number of modified files\n- Number of formatted files",
1672
- "name": "dryrun",
1673
- "summary": "Preview changes without modifying files.",
1674
- "allowNo": false,
1675
- "type": "boolean"
1676
- },
1677
- "prettier": {
1678
- "char": "p",
1679
- "description": "When enabled, formats the modified JavaScript files using Prettier after adding logging statements. Maintains consistent code style with:\n- 120 character line width\n- 4 space indentation\n- Single quotes for strings\n- No tabs",
1680
- "name": "prettier",
1681
- "summary": "Format modified files using Prettier.",
1682
- "allowNo": false,
1683
- "type": "boolean"
1684
- },
1685
- "no-if": {
1686
- "description": "When provided, the command will not add log statements inside of `if` and `else` blocks.",
1687
- "name": "no-if",
1688
- "summary": "Exclude the instrumentation of if-else statements.",
1689
- "allowNo": false,
1690
- "type": "boolean"
1691
- },
1692
- "skip-instrumented": {
1693
- "description": "When provided, the command will not add log statements to any Apex class that contains the `rflib` import statement.",
1694
- "name": "skip-instrumented",
1695
- "summary": "Skips any files where a logger is already present.",
1696
- "allowNo": false,
1697
- "type": "boolean"
1698
- },
1699
- "verbose": {
1700
- "char": "v",
1701
- "description": "When provided with --dryrun, prints the paths of the files that would be modified.",
1702
- "name": "verbose",
1703
- "summary": "Enable verbose output.",
1704
- "allowNo": false,
1705
- "type": "boolean"
1693
+ "custom-permission": {
1694
+ "description": "Finds users who have a custom permission. Use namespace__Name for a custom permission in a managed package.",
1695
+ "name": "custom-permission",
1696
+ "summary": "API name of the custom permission to check.",
1697
+ "hasDynamicHelp": false,
1698
+ "multiple": false,
1699
+ "type": "option"
1706
1700
  },
1707
- "exclude": {
1708
- "char": "e",
1709
- "description": "Exclude specific files or directories that match the provided glob pattern. For example, use --exclude \"**/Generated_*.js\" to skip auto-generated components.",
1710
- "name": "exclude",
1711
- "summary": "Exclude files or directories from instrumentation based on a glob pattern.",
1701
+ "system-permission": {
1702
+ "description": "Finds users who have a system (user) permission. Use the name of the permission field on the PermissionSet object, with or without the \"Permissions\" prefix.",
1703
+ "name": "system-permission",
1704
+ "summary": "API name of the system permission to check, e.g. ModifyAllData or ViewSetup.",
1712
1705
  "hasDynamicHelp": false,
1713
1706
  "multiple": false,
1714
1707
  "type": "option"
1715
1708
  },
1716
- "concurrency": {
1717
- "char": "c",
1718
- "description": "Controls the maximum number of files to process at the same time. This is useful in very large codebases to prevent excessive memory usage or file descriptor exhaustion. Defaults to 10.",
1719
- "name": "concurrency",
1720
- "summary": "Limits the number of files processed concurrently.",
1721
- "default": 10,
1709
+ "include-inactive": {
1710
+ "description": "By default, only active users are returned. Specify this flag to include inactive users as well.",
1711
+ "name": "include-inactive",
1712
+ "summary": "Include inactive users.",
1713
+ "allowNo": false,
1714
+ "type": "boolean"
1715
+ },
1716
+ "user-limit": {
1717
+ "char": "l",
1718
+ "description": "Limits the number of users in the result. The total number of matching users is always returned in userCount.",
1719
+ "name": "user-limit",
1720
+ "summary": "Maximum number of users to return. Default: 200, maximum: 2000.",
1721
+ "default": 200,
1722
1722
  "hasDynamicHelp": false,
1723
1723
  "multiple": false,
1724
1724
  "type": "option"
1725
1725
  }
1726
1726
  },
1727
- "hasDynamicHelp": false,
1727
+ "hasDynamicHelp": true,
1728
1728
  "hiddenAliases": [],
1729
- "id": "rflib:logging:lwc:instrument",
1729
+ "id": "rflib:debug:userpermissions:whohas",
1730
1730
  "pluginAlias": "rflib-plugin",
1731
1731
  "pluginName": "rflib-plugin",
1732
1732
  "pluginType": "core",
1733
1733
  "strict": true,
1734
- "summary": "Instrument Lightning Web Components with RFLIB logging statements automatically.",
1734
+ "summary": "Find the users who have a specific permission, and what grants it.",
1735
1735
  "enableJsonFlag": true,
1736
1736
  "isESM": true,
1737
1737
  "relativePath": [
1738
1738
  "lib",
1739
1739
  "commands",
1740
1740
  "rflib",
1741
- "logging",
1742
- "lwc",
1743
- "instrument.js"
1741
+ "debug",
1742
+ "userpermissions",
1743
+ "whohas.js"
1744
1744
  ],
1745
1745
  "aliasPermutations": [],
1746
1746
  "permutations": [
1747
- "rflib:logging:lwc:instrument",
1748
- "logging:rflib:lwc:instrument",
1749
- "logging:lwc:rflib:instrument",
1750
- "logging:lwc:instrument:rflib",
1751
- "rflib:lwc:logging:instrument",
1752
- "lwc:rflib:logging:instrument",
1753
- "lwc:logging:rflib:instrument",
1754
- "lwc:logging:instrument:rflib",
1755
- "rflib:lwc:instrument:logging",
1756
- "lwc:rflib:instrument:logging",
1757
- "lwc:instrument:rflib:logging",
1758
- "lwc:instrument:logging:rflib",
1759
- "rflib:logging:instrument:lwc",
1760
- "logging:rflib:instrument:lwc",
1761
- "logging:instrument:rflib:lwc",
1762
- "logging:instrument:lwc:rflib",
1763
- "rflib:instrument:logging:lwc",
1764
- "instrument:rflib:logging:lwc",
1765
- "instrument:logging:rflib:lwc",
1766
- "instrument:logging:lwc:rflib",
1767
- "rflib:instrument:lwc:logging",
1768
- "instrument:rflib:lwc:logging",
1769
- "instrument:lwc:rflib:logging",
1770
- "instrument:lwc:logging:rflib"
1747
+ "rflib:debug:userpermissions:whohas",
1748
+ "debug:rflib:userpermissions:whohas",
1749
+ "debug:userpermissions:rflib:whohas",
1750
+ "debug:userpermissions:whohas:rflib",
1751
+ "rflib:userpermissions:debug:whohas",
1752
+ "userpermissions:rflib:debug:whohas",
1753
+ "userpermissions:debug:rflib:whohas",
1754
+ "userpermissions:debug:whohas:rflib",
1755
+ "rflib:userpermissions:whohas:debug",
1756
+ "userpermissions:rflib:whohas:debug",
1757
+ "userpermissions:whohas:rflib:debug",
1758
+ "userpermissions:whohas:debug:rflib",
1759
+ "rflib:debug:whohas:userpermissions",
1760
+ "debug:rflib:whohas:userpermissions",
1761
+ "debug:whohas:rflib:userpermissions",
1762
+ "debug:whohas:userpermissions:rflib",
1763
+ "rflib:whohas:debug:userpermissions",
1764
+ "whohas:rflib:debug:userpermissions",
1765
+ "whohas:debug:rflib:userpermissions",
1766
+ "whohas:debug:userpermissions:rflib",
1767
+ "rflib:whohas:userpermissions:debug",
1768
+ "whohas:rflib:userpermissions:debug",
1769
+ "whohas:userpermissions:rflib:debug",
1770
+ "whohas:userpermissions:debug:rflib"
1771
1771
  ]
1772
1772
  }
1773
1773
  },
1774
- "version": "0.23.1"
1774
+ "version": "0.23.3"
1775
1775
  }