rflib-plugin 0.18.0 → 0.19.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 (33) hide show
  1. package/README.md +116 -0
  2. package/lib/commands/rflib/debug/applicationevents/get.d.ts +17 -0
  3. package/lib/commands/rflib/debug/applicationevents/get.js +63 -0
  4. package/lib/commands/rflib/debug/applicationevents/get.js.map +1 -0
  5. package/lib/commands/rflib/debug/logarchives/get.d.ts +14 -0
  6. package/lib/commands/rflib/debug/logarchives/get.js +43 -0
  7. package/lib/commands/rflib/debug/logarchives/get.js.map +1 -0
  8. package/lib/commands/rflib/debug/loggersettings/get.d.ts +12 -0
  9. package/lib/commands/rflib/debug/loggersettings/get.js +30 -0
  10. package/lib/commands/rflib/debug/loggersettings/get.js.map +1 -0
  11. package/lib/commands/rflib/debug/loggersettings/update.d.ts +16 -0
  12. package/lib/commands/rflib/debug/loggersettings/update.js +57 -0
  13. package/lib/commands/rflib/debug/loggersettings/update.js.map +1 -0
  14. package/lib/commands/rflib/debug/userpermissions/get.d.ts +14 -0
  15. package/lib/commands/rflib/debug/userpermissions/get.js +52 -0
  16. package/lib/commands/rflib/debug/userpermissions/get.js.map +1 -0
  17. package/lib/shared/loggerSettingsRules.d.ts +29 -0
  18. package/lib/shared/loggerSettingsRules.js +157 -0
  19. package/lib/shared/loggerSettingsRules.js.map +1 -0
  20. package/lib/shared/orgClient.d.ts +78 -0
  21. package/lib/shared/orgClient.js +272 -0
  22. package/lib/shared/orgClient.js.map +1 -0
  23. package/lib/shared/permissionAggregator.d.ts +8 -0
  24. package/lib/shared/permissionAggregator.js +143 -0
  25. package/lib/shared/permissionAggregator.js.map +1 -0
  26. package/messages/rflib.debug.applicationevents.get.md +74 -0
  27. package/messages/rflib.debug.logarchives.get.md +45 -0
  28. package/messages/rflib.debug.loggersettings.get.md +27 -0
  29. package/messages/rflib.debug.loggersettings.update.md +63 -0
  30. package/messages/rflib.debug.userpermissions.get.md +63 -0
  31. package/oclif.lock +518 -1315
  32. package/oclif.manifest.json +620 -73
  33. package/package.json +23 -6
package/README.md CHANGED
@@ -10,6 +10,7 @@ Plugin for Salesforce CLI to help with the adoption of [RFLIB](https://github.co
10
10
  - Automatically instruments LWC components with RFLIB logging statements
11
11
  - Automatically instruments Aura components with RFLIB logging statements
12
12
  - Automatically instruments Salesforce Flows with RFLIB logging actions
13
+ - Debug commands that read RFLIB log archives, application events, and logger settings, and tune logger settings — useful as a tool surface for AI agents driving a debugging session
13
14
 
14
15
  ## Installation
15
16
 
@@ -132,6 +133,121 @@ sf rflib logging flow instrument --sourcepath force-app --skip-instrumented
132
133
  - Handles both free-form and auto-layout flows, converting all to auto-layout
133
134
  - Supports both standard Flows (processType="Flow") and Auto-Launched Flows (processType="AutoLaunchedFlow")
134
135
 
136
+ ## RFLIB Debug Commands
137
+
138
+ These commands query and tune RFLIB-instrumented data directly via the Salesforce REST API. The only prerequisite is that the [RFLIB](https://github.com/j-fischer/rflib) package is installed in the target org and the running user is assigned the `rflib_Ops_Center_Access` permission set (or has equivalent read access to `rflib_Logs_Archive__b`, `rflib_Application_Event__c`, and `rflib_Logger_Settings__c`, plus update access on Logger Settings to use the `update` command).
139
+
140
+ These commands are designed to be invoked by an LLM agent (via a Claude skill or equivalent) to drive a debugging session: trigger code in the org, then read the resulting logs and adjust verbosity as needed.
141
+
142
+ ### `sf rflib debug applicationevents get`
143
+
144
+ Query RFLIB Application Events from a Salesforce org.
145
+
146
+ ```bash
147
+ # Get all recent application events
148
+ sf rflib debug applicationevents get --target-org myOrg
149
+
150
+ # Filter by event name with wildcard
151
+ sf rflib debug applicationevents get --target-org myOrg --event-name "order-%"
152
+
153
+ # Filter by date range
154
+ sf rflib debug applicationevents get --target-org myOrg --start-date 2024-01-01T00:00:00Z --end-date 2024-12-31T23:59:59Z
155
+
156
+ # Filter by related record and limit results
157
+ sf rflib debug applicationevents get --target-org myOrg --related-record-id 001abc --record-limit 50
158
+ ```
159
+
160
+ #### Command Options
161
+
162
+ - `--target-org (-o)`: Username or alias of the target org *(required)*
163
+ - `--event-name (-e)`: Filter by Event_Name__c. Use `%` as a wildcard
164
+ - `--start-date (-s)`: Filter events on or after this ISO 8601 datetime
165
+ - `--end-date (-d)`: Filter events on or before this ISO 8601 datetime
166
+ - `--related-record-id (-r)`: Filter by Related_Record_ID__c (exact match)
167
+ - `--record-limit (-l)`: Maximum number of records to return (default 200, max 2000)
168
+
169
+ ---
170
+
171
+ ### `sf rflib debug logarchives get`
172
+
173
+ Query RFLIB log archives from the `rflib_Logs_Archive__b` big object.
174
+
175
+ ```bash
176
+ # Get log archives from the last 24 hours
177
+ sf rflib debug logarchives get --target-org myOrg
178
+
179
+ # Get archives for a specific date range
180
+ sf rflib debug logarchives get --target-org myOrg --start-date 2024-01-01T00:00:00Z --end-date 2024-01-02T00:00:00Z
181
+ ```
182
+
183
+ #### Command Options
184
+
185
+ - `--target-org (-o)`: Username or alias of the target org *(required)*
186
+ - `--start-date (-s)`: Start of date range in ISO 8601 format (defaults to 24 hours ago)
187
+ - `--end-date (-d)`: End of date range in ISO 8601 format (defaults to now)
188
+
189
+ ---
190
+
191
+ ### `sf rflib debug loggersettings get`
192
+
193
+ Read all RFLIB Logger Settings from the target org.
194
+
195
+ ```bash
196
+ sf rflib debug loggersettings get --target-org myOrg
197
+ ```
198
+
199
+ #### Command Options
200
+
201
+ - `--target-org (-o)`: Username or alias of the target org *(required)*
202
+
203
+ ---
204
+
205
+ ### `sf rflib debug loggersettings update`
206
+
207
+ Create or update an RFLIB Logger Setting in the target org.
208
+
209
+ ```bash
210
+ # Update an existing setting record
211
+ sf rflib debug loggersettings update --target-org myOrg --record-id a01abc --field-name Log_Event_Reporting_Level__c --field-value WARN
212
+
213
+ # Create a new org-wide setting
214
+ sf rflib debug loggersettings update --target-org myOrg --setup-owner-id 00D000000000001 --field-name Log_Event_Reporting_Level__c --field-value WARN
215
+ ```
216
+
217
+ #### Command Options
218
+
219
+ - `--target-org (-o)`: Username or alias of the target org *(required)*
220
+ - `--field-name (-f)`: API name of the field to update, e.g. `Log_Event_Reporting_Level__c` *(required)*
221
+ - `--field-value (-v)`: New value for the field (e.g. TRACE, DEBUG, INFO, WARN, ERROR, FATAL, NONE) *(required)*
222
+ - `--record-id (-r)`: ID of an existing `rflib_Logger_Settings__c` record to update
223
+ - `--setup-owner-id (-s)`: Org ID, Profile ID, or User ID for creating a new setting record
224
+
225
+ ---
226
+
227
+ ### `sf rflib debug userpermissions get`
228
+
229
+ Check Salesforce user permissions (FLS, OLS, Apex access) aggregated across profile, permission sets, and permission set groups.
230
+
231
+ ```bash
232
+ # Check all permissions for a user
233
+ sf rflib debug userpermissions get --target-org myOrg --user-id 0057000000XXXXXX --permission-type ALL
234
+
235
+ # Check FLS for a specific SObject
236
+ sf rflib debug userpermissions get --target-org myOrg --user-id 0057000000XXXXXX --permission-type FLS --sobject-type Account
237
+
238
+ # Check Apex class/page access
239
+ sf rflib debug userpermissions get --target-org myOrg --user-id 0057000000XXXXXX --permission-type APEX
240
+ ```
241
+
242
+ #### Command Options
243
+
244
+ - `--target-org (-o)`: Username or alias of the target org *(required)*
245
+ - `--user-id (-u)`: Salesforce User ID (15 or 18 character) *(required)*
246
+ - `--permission-type (-t)`: Type of permissions: `FLS`, `OLS`, `APEX`, or `ALL` *(required)*
247
+ - `--sobject-type (-b)`: Optional SObject API name to filter FLS or OLS results (e.g. `Account`)
248
+
249
+ ---
250
+
135
251
  ## Contributing
136
252
 
137
253
  1. Fork the repository
@@ -0,0 +1,17 @@
1
+ import { SfCommand } from '@salesforce/sf-plugins-core';
2
+ import { type ApplicationEventsResult } from '../../../../shared/orgClient.js';
3
+ export type RflibDebugApplicationEventsGetResult = ApplicationEventsResult;
4
+ export default class RflibDebugApplicationEventsGet extends SfCommand<RflibDebugApplicationEventsGetResult> {
5
+ static readonly summary: string;
6
+ static readonly description: string;
7
+ static readonly examples: string[];
8
+ static readonly flags: {
9
+ 'target-org': import("@oclif/core/interfaces").OptionFlag<import("@salesforce/core").Org, import("@oclif/core/interfaces").CustomOptions>;
10
+ 'event-name': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
11
+ 'start-date': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
12
+ 'end-date': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
13
+ 'related-record-id': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
14
+ 'record-limit': import("@oclif/core/interfaces").OptionFlag<number | undefined, import("@oclif/core/interfaces").CustomOptions>;
15
+ };
16
+ run(): Promise<RflibDebugApplicationEventsGetResult>;
17
+ }
@@ -0,0 +1,63 @@
1
+ import { SfCommand, Flags } from '@salesforce/sf-plugins-core';
2
+ import { Messages } from '@salesforce/core';
3
+ import { getApplicationEvents } from '../../../../shared/orgClient.js';
4
+ Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
5
+ const messages = Messages.loadMessages('rflib-plugin', 'rflib.debug.applicationevents.get');
6
+ export default class RflibDebugApplicationEventsGet extends SfCommand {
7
+ static summary = messages.getMessage('summary');
8
+ static description = messages.getMessage('description');
9
+ static examples = messages.getMessages('examples');
10
+ static flags = {
11
+ 'target-org': Flags.requiredOrg({
12
+ summary: messages.getMessage('flags.target-org.summary'),
13
+ description: messages.getMessage('flags.target-org.description'),
14
+ char: 'o',
15
+ required: true,
16
+ }),
17
+ 'event-name': Flags.string({
18
+ summary: messages.getMessage('flags.event-name.summary'),
19
+ description: messages.getMessage('flags.event-name.description'),
20
+ char: 'e',
21
+ }),
22
+ 'start-date': Flags.string({
23
+ summary: messages.getMessage('flags.start-date.summary'),
24
+ description: messages.getMessage('flags.start-date.description'),
25
+ char: 's',
26
+ }),
27
+ 'end-date': Flags.string({
28
+ summary: messages.getMessage('flags.end-date.summary'),
29
+ description: messages.getMessage('flags.end-date.description'),
30
+ char: 'd',
31
+ }),
32
+ 'related-record-id': Flags.string({
33
+ summary: messages.getMessage('flags.related-record-id.summary'),
34
+ description: messages.getMessage('flags.related-record-id.description'),
35
+ char: 'r',
36
+ }),
37
+ 'record-limit': Flags.integer({
38
+ summary: messages.getMessage('flags.record-limit.summary'),
39
+ description: messages.getMessage('flags.record-limit.description'),
40
+ char: 'l',
41
+ min: 1,
42
+ max: 2000,
43
+ }),
44
+ };
45
+ async run() {
46
+ const { flags } = await this.parse(RflibDebugApplicationEventsGet);
47
+ const conn = flags['target-org'].getConnection(undefined);
48
+ this.spinner.start('Querying application events...');
49
+ const payload = await getApplicationEvents(conn, {
50
+ eventName: flags['event-name'],
51
+ startDate: flags['start-date'],
52
+ endDate: flags['end-date'],
53
+ relatedRecordId: flags['related-record-id'],
54
+ recordLimit: flags['record-limit'],
55
+ });
56
+ this.spinner.stop();
57
+ // For human invocations, render the payload as JSON. Under --json, SfCommand
58
+ // suppresses log output and wraps this method's return value directly.
59
+ this.log(JSON.stringify(payload));
60
+ return payload;
61
+ }
62
+ }
63
+ //# sourceMappingURL=get.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get.js","sourceRoot":"","sources":["../../../../../src/commands/rflib/debug/applicationevents/get.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,oBAAoB,EAAgC,MAAM,iCAAiC,CAAC;AAIrG,QAAQ,CAAC,kCAAkC,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC7D,MAAM,QAAQ,GAAG,QAAQ,CAAC,YAAY,CAAC,cAAc,EAAE,mCAAmC,CAAC,CAAC;AAE5F,MAAM,CAAC,OAAO,OAAO,8BAA+B,SAAQ,SAA+C;IAClG,MAAM,CAAU,OAAO,GAAG,QAAQ,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC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AQ,CAAC,UAAU,CAAC,4BAA4B,CAAC;YAC1D,WAAW,EAAE,QAAQ,CAAC,UAAU,CAAC,gCAAgC,CAAC;YAClE,IAAI,EAAE,GAAG;YACT,GAAG,EAAE,CAAC;YACN,GAAG,EAAE,IAAI;SACV,CAAC;KACH,CAAC;IAEK,KAAK,CAAC,GAAG;QACd,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,8BAA8B,CAAC,CAAC;QACnE,MAAM,IAAI,GAAG,KAAK,CAAC,YAAY,CAAC,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC;QAE1D,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,gCAAgC,CAAC,CAAC;QACrD,MAAM,OAAO,GAAG,MAAM,oBAAoB,CAAC,IAAI,EAAE;YAC/C,SAAS,EAAE,KAAK,CAAC,YAAY,CAAC;YAC9B,SAAS,EAAE,KAAK,CAAC,YAAY,CAAC;YAC9B,OAAO,EAAE,KAAK,CAAC,UAAU,CAAC;YAC1B,eAAe,EAAE,KAAK,CAAC,mBAAmB,CAAC;YAC3C,WAAW,EAAE,KAAK,CAAC,cAAc,CAAC;SACnC,CAAC,CAAC;QACH,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;QAEpB,6EAA6E;QAC7E,uEAAuE;QACvE,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC;QAClC,OAAO,OAAO,CAAC;IACjB,CAAC","sourcesContent":["import { SfCommand, Flags } from '@salesforce/sf-plugins-core';\nimport { Messages } from '@salesforce/core';\nimport { getApplicationEvents, type ApplicationEventsResult } from '../../../../shared/orgClient.js';\n\nexport type RflibDebugApplicationEventsGetResult = ApplicationEventsResult;\n\nMessages.importMessagesDirectoryFromMetaUrl(import.meta.url);\nconst messages = Messages.loadMessages('rflib-plugin', 'rflib.debug.applicationevents.get');\n\nexport default class RflibDebugApplicationEventsGet extends SfCommand<RflibDebugApplicationEventsGetResult> {\n public static readonly summary = messages.getMessage('summary');\n public static readonly description = messages.getMessage('description');\n public static readonly examples = messages.getMessages('examples');\n\n public static readonly flags = {\n 'target-org': Flags.requiredOrg({\n summary: messages.getMessage('flags.target-org.summary'),\n description: messages.getMessage('flags.target-org.description'),\n char: 'o',\n required: true,\n }),\n 'event-name': Flags.string({\n summary: messages.getMessage('flags.event-name.summary'),\n description: messages.getMessage('flags.event-name.description'),\n char: 'e',\n }),\n 'start-date': Flags.string({\n summary: messages.getMessage('flags.start-date.summary'),\n description: messages.getMessage('flags.start-date.description'),\n char: 's',\n }),\n 'end-date': Flags.string({\n summary: messages.getMessage('flags.end-date.summary'),\n description: messages.getMessage('flags.end-date.description'),\n char: 'd',\n }),\n 'related-record-id': Flags.string({\n summary: messages.getMessage('flags.related-record-id.summary'),\n description: messages.getMessage('flags.related-record-id.description'),\n char: 'r',\n }),\n 'record-limit': Flags.integer({\n summary: messages.getMessage('flags.record-limit.summary'),\n description: messages.getMessage('flags.record-limit.description'),\n char: 'l',\n min: 1,\n max: 2000,\n }),\n };\n\n public async run(): Promise<RflibDebugApplicationEventsGetResult> {\n const { flags } = await this.parse(RflibDebugApplicationEventsGet);\n const conn = flags['target-org'].getConnection(undefined);\n\n this.spinner.start('Querying application events...');\n const payload = await getApplicationEvents(conn, {\n eventName: flags['event-name'],\n startDate: flags['start-date'],\n endDate: flags['end-date'],\n relatedRecordId: flags['related-record-id'],\n recordLimit: flags['record-limit'],\n });\n this.spinner.stop();\n\n // For human invocations, render the payload as JSON. Under --json, SfCommand\n // suppresses log output and wraps this method's return value directly.\n this.log(JSON.stringify(payload));\n return payload;\n }\n}\n"]}
@@ -0,0 +1,14 @@
1
+ import { SfCommand } from '@salesforce/sf-plugins-core';
2
+ import { type LogArchivesResult } from '../../../../shared/orgClient.js';
3
+ export type RflibDebugLogArchivesGetResult = LogArchivesResult;
4
+ export default class RflibDebugLogArchivesGet extends SfCommand<RflibDebugLogArchivesGetResult> {
5
+ static readonly summary: string;
6
+ static readonly description: string;
7
+ static readonly examples: string[];
8
+ static readonly flags: {
9
+ 'target-org': import("@oclif/core/interfaces").OptionFlag<import("@salesforce/core").Org, import("@oclif/core/interfaces").CustomOptions>;
10
+ 'start-date': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
11
+ 'end-date': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
12
+ };
13
+ run(): Promise<RflibDebugLogArchivesGetResult>;
14
+ }
@@ -0,0 +1,43 @@
1
+ import { SfCommand, Flags } from '@salesforce/sf-plugins-core';
2
+ import { Messages } from '@salesforce/core';
3
+ import { queryLogArchives } from '../../../../shared/orgClient.js';
4
+ Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
5
+ const messages = Messages.loadMessages('rflib-plugin', 'rflib.debug.logarchives.get');
6
+ export default class RflibDebugLogArchivesGet extends SfCommand {
7
+ static summary = messages.getMessage('summary');
8
+ static description = messages.getMessage('description');
9
+ static examples = messages.getMessages('examples');
10
+ static flags = {
11
+ 'target-org': Flags.requiredOrg({
12
+ summary: messages.getMessage('flags.target-org.summary'),
13
+ description: messages.getMessage('flags.target-org.description'),
14
+ char: 'o',
15
+ required: true,
16
+ }),
17
+ 'start-date': Flags.string({
18
+ summary: messages.getMessage('flags.start-date.summary'),
19
+ description: messages.getMessage('flags.start-date.description'),
20
+ char: 's',
21
+ }),
22
+ 'end-date': Flags.string({
23
+ summary: messages.getMessage('flags.end-date.summary'),
24
+ description: messages.getMessage('flags.end-date.description'),
25
+ char: 'd',
26
+ }),
27
+ };
28
+ async run() {
29
+ const { flags } = await this.parse(RflibDebugLogArchivesGet);
30
+ const conn = flags['target-org'].getConnection(undefined);
31
+ this.spinner.start('Querying log archives...');
32
+ const payload = await queryLogArchives(conn, {
33
+ startDate: flags['start-date'],
34
+ endDate: flags['end-date'],
35
+ });
36
+ this.spinner.stop();
37
+ // For human invocations, render the payload as JSON. Under --json, SfCommand
38
+ // suppresses log output and wraps this method's return value directly.
39
+ this.log(JSON.stringify(payload));
40
+ return payload;
41
+ }
42
+ }
43
+ //# sourceMappingURL=get.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get.js","sourceRoot":"","sources":["../../../../../src/commands/rflib/debug/logarchives/get.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAA0B,MAAM,iCAAiC,CAAC;AAI3F,QAAQ,CAAC,kCAAkC,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC7D,MAAM,QAAQ,GAAG,QAAQ,CAAC,YAAY,CAAC,cAAc,EAAE,6BAA6B,CAAC,CAAC;AAEtF,MAAM,CAAC,OAAO,OAAO,wBAAyB,SAAQ,SAAyC;IACtF,MAAM,CAAU,OAAO,GAAG,QAAQ,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;IACzD,MAAM,CAAU,WAAW,GAAG,QAAQ,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;IACjE,MAAM,CAAU,QAAQ,GAAG,QAAQ,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;IAE5D,MAAM,CAAU,KAAK,GAAG;QAC7B,YAAY,EAAE,KAAK,CAAC,WAAW,CAAC;YAC9B,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,0BAA0B,CAAC;YACxD,WAAW,EAAE,QAAQ,CAAC,UAAU,CAAC,8BAA8B,CAAC;YAChE,IAAI,EAAE,GAAG;YACT,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,YAAY,EAAE,KAAK,CAAC,MAAM,CAAC;YACzB,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,0BAA0B,CAAC;YACxD,WAAW,EAAE,QAAQ,CAAC,UAAU,CAAC,8BAA8B,CAAC;YAChE,IAAI,EAAE,GAAG;SACV,CAAC;QACF,UAAU,EAAE,KAAK,CAAC,MAAM,CAAC;YACvB,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,wBAAwB,CAAC;YACtD,WAAW,EAAE,QAAQ,CAAC,UAAU,CAAC,4BAA4B,CAAC;YAC9D,IAAI,EAAE,GAAG;SACV,CAAC;KACH,CAAC;IAEK,KAAK,CAAC,GAAG;QACd,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,wBAAwB,CAAC,CAAC;QAC7D,MAAM,IAAI,GAAG,KAAK,CAAC,YAAY,CAAC,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC;QAE1D,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,0BAA0B,CAAC,CAAC;QAC/C,MAAM,OAAO,GAAG,MAAM,gBAAgB,CAAC,IAAI,EAAE;YAC3C,SAAS,EAAE,KAAK,CAAC,YAAY,CAAC;YAC9B,OAAO,EAAE,KAAK,CAAC,UAAU,CAAC;SAC3B,CAAC,CAAC;QACH,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;QAEpB,6EAA6E;QAC7E,uEAAuE;QACvE,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC;QAClC,OAAO,OAAO,CAAC;IACjB,CAAC","sourcesContent":["import { SfCommand, Flags } from '@salesforce/sf-plugins-core';\nimport { Messages } from '@salesforce/core';\nimport { queryLogArchives, type LogArchivesResult } from '../../../../shared/orgClient.js';\n\nexport type RflibDebugLogArchivesGetResult = LogArchivesResult;\n\nMessages.importMessagesDirectoryFromMetaUrl(import.meta.url);\nconst messages = Messages.loadMessages('rflib-plugin', 'rflib.debug.logarchives.get');\n\nexport default class RflibDebugLogArchivesGet extends SfCommand<RflibDebugLogArchivesGetResult> {\n public static readonly summary = messages.getMessage('summary');\n public static readonly description = messages.getMessage('description');\n public static readonly examples = messages.getMessages('examples');\n\n public static readonly flags = {\n 'target-org': Flags.requiredOrg({\n summary: messages.getMessage('flags.target-org.summary'),\n description: messages.getMessage('flags.target-org.description'),\n char: 'o',\n required: true,\n }),\n 'start-date': Flags.string({\n summary: messages.getMessage('flags.start-date.summary'),\n description: messages.getMessage('flags.start-date.description'),\n char: 's',\n }),\n 'end-date': Flags.string({\n summary: messages.getMessage('flags.end-date.summary'),\n description: messages.getMessage('flags.end-date.description'),\n char: 'd',\n }),\n };\n\n public async run(): Promise<RflibDebugLogArchivesGetResult> {\n const { flags } = await this.parse(RflibDebugLogArchivesGet);\n const conn = flags['target-org'].getConnection(undefined);\n\n this.spinner.start('Querying log archives...');\n const payload = await queryLogArchives(conn, {\n startDate: flags['start-date'],\n endDate: flags['end-date'],\n });\n this.spinner.stop();\n\n // For human invocations, render the payload as JSON. Under --json, SfCommand\n // suppresses log output and wraps this method's return value directly.\n this.log(JSON.stringify(payload));\n return payload;\n }\n}\n"]}
@@ -0,0 +1,12 @@
1
+ import { SfCommand } from '@salesforce/sf-plugins-core';
2
+ import { type LoggerSettingsResult } from '../../../../shared/orgClient.js';
3
+ export type RflibDebugLoggerSettingsGetResult = LoggerSettingsResult;
4
+ export default class RflibDebugLoggerSettingsGet extends SfCommand<RflibDebugLoggerSettingsGetResult> {
5
+ static readonly summary: string;
6
+ static readonly description: string;
7
+ static readonly examples: string[];
8
+ static readonly flags: {
9
+ 'target-org': import("@oclif/core/interfaces").OptionFlag<import("@salesforce/core").Org, import("@oclif/core/interfaces").CustomOptions>;
10
+ };
11
+ run(): Promise<RflibDebugLoggerSettingsGetResult>;
12
+ }
@@ -0,0 +1,30 @@
1
+ import { SfCommand, Flags } from '@salesforce/sf-plugins-core';
2
+ import { Messages } from '@salesforce/core';
3
+ import { getLoggerSettings } from '../../../../shared/orgClient.js';
4
+ Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
5
+ const messages = Messages.loadMessages('rflib-plugin', 'rflib.debug.loggersettings.get');
6
+ export default class RflibDebugLoggerSettingsGet extends SfCommand {
7
+ static summary = messages.getMessage('summary');
8
+ static description = messages.getMessage('description');
9
+ static examples = messages.getMessages('examples');
10
+ static flags = {
11
+ 'target-org': Flags.requiredOrg({
12
+ summary: messages.getMessage('flags.target-org.summary'),
13
+ description: messages.getMessage('flags.target-org.description'),
14
+ char: 'o',
15
+ required: true,
16
+ }),
17
+ };
18
+ async run() {
19
+ const { flags } = await this.parse(RflibDebugLoggerSettingsGet);
20
+ const conn = flags['target-org'].getConnection(undefined);
21
+ this.spinner.start('Reading logger settings...');
22
+ const payload = await getLoggerSettings(conn);
23
+ this.spinner.stop();
24
+ // For human invocations, render the payload as JSON. Under --json, SfCommand
25
+ // suppresses log output and wraps this method's return value directly.
26
+ this.log(JSON.stringify(payload));
27
+ return payload;
28
+ }
29
+ }
30
+ //# sourceMappingURL=get.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get.js","sourceRoot":"","sources":["../../../../../src/commands/rflib/debug/loggersettings/get.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAA6B,MAAM,iCAAiC,CAAC;AAI/F,QAAQ,CAAC,kCAAkC,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC7D,MAAM,QAAQ,GAAG,QAAQ,CAAC,YAAY,CAAC,cAAc,EAAE,gCAAgC,CAAC,CAAC;AAEzF,MAAM,CAAC,OAAO,OAAO,2BAA4B,SAAQ,SAA4C;IAC5F,MAAM,CAAU,OAAO,GAAG,QAAQ,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;IACzD,MAAM,CAAU,WAAW,GAAG,QAAQ,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;IACjE,MAAM,CAAU,QAAQ,GAAG,QAAQ,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;IAE5D,MAAM,CAAU,KAAK,GAAG;QAC7B,YAAY,EAAE,KAAK,CAAC,WAAW,CAAC;YAC9B,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,0BAA0B,CAAC;YACxD,WAAW,EAAE,QAAQ,CAAC,UAAU,CAAC,8BAA8B,CAAC;YAChE,IAAI,EAAE,GAAG;YACT,QAAQ,EAAE,IAAI;SACf,CAAC;KACH,CAAC;IAEK,KAAK,CAAC,GAAG;QACd,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,2BAA2B,CAAC,CAAC;QAChE,MAAM,IAAI,GAAG,KAAK,CAAC,YAAY,CAAC,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC;QAE1D,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,4BAA4B,CAAC,CAAC;QACjD,MAAM,OAAO,GAAG,MAAM,iBAAiB,CAAC,IAAI,CAAC,CAAC;QAC9C,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;QAEpB,6EAA6E;QAC7E,uEAAuE;QACvE,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC;QAClC,OAAO,OAAO,CAAC;IACjB,CAAC","sourcesContent":["import { SfCommand, Flags } from '@salesforce/sf-plugins-core';\nimport { Messages } from '@salesforce/core';\nimport { getLoggerSettings, type LoggerSettingsResult } from '../../../../shared/orgClient.js';\n\nexport type RflibDebugLoggerSettingsGetResult = LoggerSettingsResult;\n\nMessages.importMessagesDirectoryFromMetaUrl(import.meta.url);\nconst messages = Messages.loadMessages('rflib-plugin', 'rflib.debug.loggersettings.get');\n\nexport default class RflibDebugLoggerSettingsGet extends SfCommand<RflibDebugLoggerSettingsGetResult> {\n public static readonly summary = messages.getMessage('summary');\n public static readonly description = messages.getMessage('description');\n public static readonly examples = messages.getMessages('examples');\n\n public static readonly flags = {\n 'target-org': Flags.requiredOrg({\n summary: messages.getMessage('flags.target-org.summary'),\n description: messages.getMessage('flags.target-org.description'),\n char: 'o',\n required: true,\n }),\n };\n\n public async run(): Promise<RflibDebugLoggerSettingsGetResult> {\n const { flags } = await this.parse(RflibDebugLoggerSettingsGet);\n const conn = flags['target-org'].getConnection(undefined);\n\n this.spinner.start('Reading logger settings...');\n const payload = await getLoggerSettings(conn);\n this.spinner.stop();\n\n // For human invocations, render the payload as JSON. Under --json, SfCommand\n // suppresses log output and wraps this method's return value directly.\n this.log(JSON.stringify(payload));\n return payload;\n }\n}\n"]}
@@ -0,0 +1,16 @@
1
+ import { SfCommand } from '@salesforce/sf-plugins-core';
2
+ import { type UpdateLoggerSettingResult } from '../../../../shared/orgClient.js';
3
+ export type RflibDebugLoggerSettingsUpdateResult = UpdateLoggerSettingResult;
4
+ export default class RflibDebugLoggerSettingsUpdate extends SfCommand<RflibDebugLoggerSettingsUpdateResult> {
5
+ static readonly summary: string;
6
+ static readonly description: string;
7
+ static readonly examples: string[];
8
+ static readonly flags: {
9
+ 'target-org': import("@oclif/core/interfaces").OptionFlag<import("@salesforce/core").Org, import("@oclif/core/interfaces").CustomOptions>;
10
+ 'field-name': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
11
+ 'field-value': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
12
+ 'record-id': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
13
+ 'setup-owner-id': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
14
+ };
15
+ run(): Promise<RflibDebugLoggerSettingsUpdateResult>;
16
+ }
@@ -0,0 +1,57 @@
1
+ import { SfCommand, Flags } from '@salesforce/sf-plugins-core';
2
+ import { Messages } from '@salesforce/core';
3
+ import { updateLoggerSetting } from '../../../../shared/orgClient.js';
4
+ Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
5
+ const messages = Messages.loadMessages('rflib-plugin', 'rflib.debug.loggersettings.update');
6
+ export default class RflibDebugLoggerSettingsUpdate extends SfCommand {
7
+ static summary = messages.getMessage('summary');
8
+ static description = messages.getMessage('description');
9
+ static examples = messages.getMessages('examples');
10
+ static flags = {
11
+ 'target-org': Flags.requiredOrg({
12
+ summary: messages.getMessage('flags.target-org.summary'),
13
+ description: messages.getMessage('flags.target-org.description'),
14
+ char: 'o',
15
+ required: true,
16
+ }),
17
+ 'field-name': Flags.string({
18
+ summary: messages.getMessage('flags.field-name.summary'),
19
+ description: messages.getMessage('flags.field-name.description'),
20
+ char: 'f',
21
+ required: true,
22
+ }),
23
+ 'field-value': Flags.string({
24
+ summary: messages.getMessage('flags.field-value.summary'),
25
+ description: messages.getMessage('flags.field-value.description'),
26
+ char: 'v',
27
+ required: true,
28
+ }),
29
+ 'record-id': Flags.string({
30
+ summary: messages.getMessage('flags.record-id.summary'),
31
+ description: messages.getMessage('flags.record-id.description'),
32
+ char: 'r',
33
+ }),
34
+ 'setup-owner-id': Flags.string({
35
+ summary: messages.getMessage('flags.setup-owner-id.summary'),
36
+ description: messages.getMessage('flags.setup-owner-id.description'),
37
+ char: 's',
38
+ }),
39
+ };
40
+ async run() {
41
+ const { flags } = await this.parse(RflibDebugLoggerSettingsUpdate);
42
+ const conn = flags['target-org'].getConnection(undefined);
43
+ this.spinner.start('Updating logger setting...');
44
+ const payload = await updateLoggerSetting(conn, {
45
+ recordId: flags['record-id'],
46
+ setupOwnerId: flags['setup-owner-id'],
47
+ fieldName: flags['field-name'],
48
+ fieldValue: flags['field-value'],
49
+ });
50
+ this.spinner.stop();
51
+ // For human invocations, render the payload as JSON. Under --json, SfCommand
52
+ // suppresses log output and wraps this method's return value directly.
53
+ this.log(JSON.stringify(payload));
54
+ return payload;
55
+ }
56
+ }
57
+ //# sourceMappingURL=update.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update.js","sourceRoot":"","sources":["../../../../../src/commands/rflib/debug/loggersettings/update.ts"],"names":[],"mappings":"AAAA,OAAO,E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E,GAAG;YACT,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,WAAW,EAAE,KAAK,CAAC,MAAM,CAAC;YACxB,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,yBAAyB,CAAC;YACvD,WAAW,EAAE,QAAQ,CAAC,UAAU,CAAC,6BAA6B,CAAC;YAC/D,IAAI,EAAE,GAAG;SACV,CAAC;QACF,gBAAgB,EAAE,KAAK,CAAC,MAAM,CAAC;YAC7B,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,8BAA8B,CAAC;YAC5D,WAAW,EAAE,QAAQ,CAAC,UAAU,CAAC,kCAAkC,CAAC;YACpE,IAAI,EAAE,GAAG;SACV,CAAC;KACH,CAAC;IAEK,KAAK,CAAC,GAAG;QACd,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,8BAA8B,CAAC,CAAC;QACnE,MAAM,IAAI,GAAG,KAAK,CAAC,YAAY,CAAC,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC;QAE1D,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,4BAA4B,CAAC,CAAC;QACjD,MAAM,OAAO,GAAG,MAAM,mBAAmB,CAAC,IAAI,EAAE;YAC9C,QAAQ,EAAE,KAAK,CAAC,WAAW,CAAC;YAC5B,YAAY,EAAE,KAAK,CAAC,gBAAgB,CAAC;YACrC,SAAS,EAAE,KAAK,CAAC,YAAY,CAAC;YAC9B,UAAU,EAAE,KAAK,CAAC,aAAa,CAAC;SACjC,CAAC,CAAC;QACH,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;QAEpB,6EAA6E;QAC7E,uEAAuE;QACvE,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC;QAClC,OAAO,OAAO,CAAC;IACjB,CAAC","sourcesContent":["import { SfCommand, Flags } from '@salesforce/sf-plugins-core';\nimport { Messages } from '@salesforce/core';\nimport { updateLoggerSetting, type UpdateLoggerSettingResult } from '../../../../shared/orgClient.js';\n\nexport type RflibDebugLoggerSettingsUpdateResult = UpdateLoggerSettingResult;\n\nMessages.importMessagesDirectoryFromMetaUrl(import.meta.url);\nconst messages = Messages.loadMessages('rflib-plugin', 'rflib.debug.loggersettings.update');\n\nexport default class RflibDebugLoggerSettingsUpdate extends SfCommand<RflibDebugLoggerSettingsUpdateResult> {\n public static readonly summary = messages.getMessage('summary');\n public static readonly description = messages.getMessage('description');\n public static readonly examples = messages.getMessages('examples');\n\n public static readonly flags = {\n 'target-org': Flags.requiredOrg({\n summary: messages.getMessage('flags.target-org.summary'),\n description: messages.getMessage('flags.target-org.description'),\n char: 'o',\n required: true,\n }),\n 'field-name': Flags.string({\n summary: messages.getMessage('flags.field-name.summary'),\n description: messages.getMessage('flags.field-name.description'),\n char: 'f',\n required: true,\n }),\n 'field-value': Flags.string({\n summary: messages.getMessage('flags.field-value.summary'),\n description: messages.getMessage('flags.field-value.description'),\n char: 'v',\n required: true,\n }),\n 'record-id': Flags.string({\n summary: messages.getMessage('flags.record-id.summary'),\n description: messages.getMessage('flags.record-id.description'),\n char: 'r',\n }),\n 'setup-owner-id': Flags.string({\n summary: messages.getMessage('flags.setup-owner-id.summary'),\n description: messages.getMessage('flags.setup-owner-id.description'),\n char: 's',\n }),\n };\n\n public async run(): Promise<RflibDebugLoggerSettingsUpdateResult> {\n const { flags } = await this.parse(RflibDebugLoggerSettingsUpdate);\n const conn = flags['target-org'].getConnection(undefined);\n\n this.spinner.start('Updating logger setting...');\n const payload = await updateLoggerSetting(conn, {\n recordId: flags['record-id'],\n setupOwnerId: flags['setup-owner-id'],\n fieldName: flags['field-name'],\n fieldValue: flags['field-value'],\n });\n this.spinner.stop();\n\n // For human invocations, render the payload as JSON. Under --json, SfCommand\n // suppresses log output and wraps this method's return value directly.\n this.log(JSON.stringify(payload));\n return payload;\n }\n}\n"]}
@@ -0,0 +1,14 @@
1
+ import { SfCommand } from '@salesforce/sf-plugins-core';
2
+ export type RflibDebugUserPermissionsGetResult = Record<string, unknown>;
3
+ export default class RflibDebugUserPermissionsGet extends SfCommand<RflibDebugUserPermissionsGetResult> {
4
+ static readonly summary: string;
5
+ static readonly description: string;
6
+ static readonly examples: string[];
7
+ static readonly flags: {
8
+ 'target-org': import("@oclif/core/interfaces").OptionFlag<import("@salesforce/core").Org, import("@oclif/core/interfaces").CustomOptions>;
9
+ 'user-id': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
10
+ 'permission-type': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
11
+ 'sobject-type': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
12
+ };
13
+ run(): Promise<RflibDebugUserPermissionsGetResult>;
14
+ }
@@ -0,0 +1,52 @@
1
+ import { SfCommand, Flags } from '@salesforce/sf-plugins-core';
2
+ import { Messages } from '@salesforce/core';
3
+ import { getUserPermissions } from '../../../../shared/orgClient.js';
4
+ Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
5
+ const messages = Messages.loadMessages('rflib-plugin', 'rflib.debug.userpermissions.get');
6
+ export default class RflibDebugUserPermissionsGet extends SfCommand {
7
+ static summary = messages.getMessage('summary');
8
+ static description = messages.getMessage('description');
9
+ static examples = messages.getMessages('examples');
10
+ static flags = {
11
+ 'target-org': Flags.requiredOrg({
12
+ summary: messages.getMessage('flags.target-org.summary'),
13
+ description: messages.getMessage('flags.target-org.description'),
14
+ char: 'o',
15
+ required: true,
16
+ }),
17
+ 'user-id': Flags.string({
18
+ summary: messages.getMessage('flags.user-id.summary'),
19
+ description: messages.getMessage('flags.user-id.description'),
20
+ char: 'u',
21
+ required: true,
22
+ }),
23
+ 'permission-type': Flags.string({
24
+ summary: messages.getMessage('flags.permission-type.summary'),
25
+ description: messages.getMessage('flags.permission-type.description'),
26
+ char: 't',
27
+ required: true,
28
+ options: ['FLS', 'OLS', 'APEX', 'ALL'],
29
+ }),
30
+ 'sobject-type': Flags.string({
31
+ summary: messages.getMessage('flags.sobject-type.summary'),
32
+ description: messages.getMessage('flags.sobject-type.description'),
33
+ char: 'b',
34
+ }),
35
+ };
36
+ async run() {
37
+ const { flags } = await this.parse(RflibDebugUserPermissionsGet);
38
+ const conn = flags['target-org'].getConnection(undefined);
39
+ this.spinner.start('Retrieving user permissions...');
40
+ const payload = await getUserPermissions(conn, {
41
+ userId: flags['user-id'],
42
+ permissionType: flags['permission-type'],
43
+ sobjectType: flags['sobject-type'],
44
+ });
45
+ this.spinner.stop();
46
+ // For human invocations, render the payload as JSON. Under --json, SfCommand
47
+ // suppresses log output and wraps this method's return value directly.
48
+ this.log(JSON.stringify(payload));
49
+ return payload;
50
+ }
51
+ }
52
+ //# sourceMappingURL=get.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get.js","sourceRoot":"","sources":["../../../../../src/commands/rflib/debug/userpermissions/get.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,kBAAkB,EAAuB,MAAM,iCAAiC,CAAC;AAI1F,QAAQ,CAAC,kCAAkC,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC7D,MAAM,QAAQ,GAAG,QAAQ,CAAC,YAAY,CAAC,cAAc,EAAE,iCAAiC,CAAC,CAAC;AAE1F,MAAM,CAAC,OAAO,OAAO,4BAA6B,SAAQ,SAA6C;IAC9F,MAAM,CAAU,OAAO,GAAG,QAAQ,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;IACzD,MAAM,CAAU,WAAW,GAAG,QAAQ,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;IACjE,MAAM,CAAU,QAAQ,GAAG,QAAQ,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;IAE5D,MAAM,CAAU,KAAK,GAA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AAC,IAAI,EAAE;YAC7C,MAAM,EAAE,KAAK,CAAC,SAAS,CAAC;YACxB,cAAc,EAAE,KAAK,CAAC,iBAAiB,CAAmB;YAC1D,WAAW,EAAE,KAAK,CAAC,cAAc,CAAC;SACnC,CAAC,CAAC;QACH,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;QAEpB,6EAA6E;QAC7E,uEAAuE;QACvE,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC;QAClC,OAAO,OAAO,CAAC;IACjB,CAAC","sourcesContent":["import { SfCommand, Flags } from '@salesforce/sf-plugins-core';\nimport { Messages } from '@salesforce/core';\nimport { getUserPermissions, type PermissionType } from '../../../../shared/orgClient.js';\n\nexport type RflibDebugUserPermissionsGetResult = Record<string, unknown>;\n\nMessages.importMessagesDirectoryFromMetaUrl(import.meta.url);\nconst messages = Messages.loadMessages('rflib-plugin', 'rflib.debug.userpermissions.get');\n\nexport default class RflibDebugUserPermissionsGet extends SfCommand<RflibDebugUserPermissionsGetResult> {\n public static readonly summary = messages.getMessage('summary');\n public static readonly description = messages.getMessage('description');\n public static readonly examples = messages.getMessages('examples');\n\n public static readonly flags = {\n 'target-org': Flags.requiredOrg({\n summary: messages.getMessage('flags.target-org.summary'),\n description: messages.getMessage('flags.target-org.description'),\n char: 'o',\n required: true,\n }),\n 'user-id': Flags.string({\n summary: messages.getMessage('flags.user-id.summary'),\n description: messages.getMessage('flags.user-id.description'),\n char: 'u',\n required: true,\n }),\n 'permission-type': Flags.string({\n summary: messages.getMessage('flags.permission-type.summary'),\n description: messages.getMessage('flags.permission-type.description'),\n char: 't',\n required: true,\n options: ['FLS', 'OLS', 'APEX', 'ALL'],\n }),\n 'sobject-type': Flags.string({\n summary: messages.getMessage('flags.sobject-type.summary'),\n description: messages.getMessage('flags.sobject-type.description'),\n char: 'b',\n }),\n };\n\n public async run(): Promise<RflibDebugUserPermissionsGetResult> {\n const { flags } = await this.parse(RflibDebugUserPermissionsGet);\n const conn = flags['target-org'].getConnection(undefined);\n\n this.spinner.start('Retrieving user permissions...');\n const payload = await getUserPermissions(conn, {\n userId: flags['user-id'],\n permissionType: flags['permission-type'] as PermissionType,\n sobjectType: flags['sobject-type'],\n });\n this.spinner.stop();\n\n // For human invocations, render the payload as JSON. Under --json, SfCommand\n // suppresses log output and wraps this method's return value directly.\n this.log(JSON.stringify(payload));\n return payload;\n }\n}\n"]}
@@ -0,0 +1,29 @@
1
+ export declare const ALL_LOG_LEVELS: readonly string[];
2
+ export declare const RESTRICTED_LEVELS: readonly string[];
3
+ export declare const RESTRICTED_LEVEL_FIELDS: readonly string[];
4
+ export declare const LOG_LEVEL_FIELDS: readonly string[];
5
+ export declare const WARN_IF_BELOW_WARN_AT_ORG: readonly string[];
6
+ export declare const LEVELS_BELOW_WARN: readonly string[];
7
+ export declare const SETTINGS_NOTES: readonly string[];
8
+ export type ScopeInfo = {
9
+ scopeType: 'Organization' | 'Profile' | 'User';
10
+ scopeName: string;
11
+ };
12
+ export declare function detectScope(setupOwnerId: string | undefined | null, profileNameLookup: (id: string) => string | undefined, userOwnerName: string | undefined): ScopeInfo;
13
+ export declare function validateFieldName(fieldName: string, knownFieldNamesLowercased: ReadonlySet<string>): void;
14
+ /**
15
+ * Reject any attempt to write a non-custom field. Hierarchy custom-setting payloads
16
+ * may only carry user-editable custom (__c) fields — overwriting Id, SetupOwnerId,
17
+ * CreatedDate, or any other system column via this command would either silently
18
+ * retarget the DML to a different record or fail at the API layer with a confusing
19
+ * error. Block it here with a clear message instead.
20
+ */
21
+ export declare function validateWritableField(fieldName: string, customFieldNamesLowercased: ReadonlySet<string>): void;
22
+ export declare function validateFieldValue(fieldName: string, fieldValue: string): void;
23
+ export declare function collectWarnings(args: {
24
+ fieldName: string;
25
+ fieldValue: string;
26
+ setupOwnerId?: string | null;
27
+ existingSetupOwnerId?: string | null;
28
+ }): string[];
29
+ export declare function getBestPractices(): Record<string, Record<string, unknown>>;