sf-debug-log 0.1.1 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,9 +1,15 @@
1
1
  # sf-debug-log
2
2
 
3
- Commands to manage Salesforce debug logs.
3
+ A Salesforce CLI plugin to make managing debug logs easier.
4
4
 
5
- Create trace flags for any user in the org selecting the debug level and time.
6
- Retrive Apex logs related to a specific user to analyze them locally.
5
+ I built this because I found the official `sf` CLI was missing some commands I regularly need. For example, I wanted to put a specific user under debug and retrieve only their logs, delete logs more easily, or set a new debug level from the command line. This plugin adds those missing pieces and more to make debugging faster.
6
+
7
+ ## Features
8
+
9
+ * Create trace flags for any user in the org, selecting the debug level and time.
10
+ * List all debug levels in the org.
11
+ * Retrieve Apex logs for a specific user or all users in the org.
12
+ * Delete Apex logs for a specific user or all users in the org.
7
13
 
8
14
  ## Install
9
15
 
@@ -12,30 +18,30 @@ sf plugins install sf-debug-log
12
18
  ```
13
19
 
14
20
  ## Commands
15
-
16
21
  <!-- commands -->
17
-
18
22
  - [`sf trace new`](#sf-trace-new)
19
23
  - [`sf debug retrieve`](#sf-debug-retrieve)
24
+ - [`sf debug delete`](#sf-debug-delete)
25
+ - [`sf debuglevel list`](#sf-debuglevel-list)
20
26
  - [`sf debuglevel new`](#sf-debuglevel-new)
21
27
 
22
28
  ## `sf trace new`
23
29
 
30
+ Create a new trace flag.
31
+
24
32
  ```
25
33
  USAGE
26
34
  $ sf trace new -o <value> [-u <value>] [-t <value>]
27
35
 
28
36
  FLAGS
29
- -o, --targetusername=<value> [required] Username or alias of the target Salesforce org.
30
- -t, --time=<value> [default: 60] The number of minutes to trace.
31
- -u, --name=<value> [default: targetusername] Username, Name, or ID of the user for whom you want to retrieve the logs.
37
+ -o, --targetusername=<value> (required) Username or alias of the target Salesforce org.
38
+ -t, --time=<value> [default: 60] The number of minutes to trace.
39
+ -u, --name=<value> Username, Name, or ID of the user for whom you want to retrieve the logs.
32
40
 
33
41
  GLOBAL FLAGS
34
42
  --json Format output as json.
35
43
 
36
44
  DESCRIPTION
37
- Create a new trace flag.
38
-
39
45
  This command is used to create a trace flag for a specific user in the Salesforce org.
40
46
 
41
47
  EXAMPLES
@@ -44,46 +50,106 @@ EXAMPLES
44
50
 
45
51
  ## `sf debug retrieve`
46
52
 
53
+ Retrieve Apex log files from the Salesforce platform.
54
+
47
55
  ```
48
56
  USAGE
49
- $ sf debug retrieve -o <value> [-u <value>] [-t <value>] [-d <value>]
57
+ $ sf debug retrieve -o <value> [-u <value>] [-t <value>] [-d <value>] [-a]
50
58
 
51
59
  FLAGS
60
+ -a, --all-users Retrieve log files for all users.
52
61
  -d, --folder=<value> [default: .sfdx/tools/debug/logs] The folder where the retrieved log files will be stored.
53
62
  -o, --targetusername=<value> (required) Username or alias of the target Salesforce org.
54
- -t, --time=<value> [default: 60] The number of minutes to retrieve log files for.
55
- -u, --user=<value> [default: targetusername] Username, Name, or ID of the user for whom you want to retrieve the logs.
63
+ -t, --time=<value> The number of minutes to retrieve log files for.
64
+ -u, --user=<value> Username, Name, or ID of the user for whom you want to retrieve the logs.
56
65
 
57
66
  GLOBAL FLAGS
58
67
  --json Format output as json.
59
68
 
60
- DESCRIPTION
61
- Retrieve Apex log files from the Salesforce platform.
69
+ EXAMPLES
70
+ sf debug retrieve -o DeveloperEdition -u "Raffaele Preziosi" -t 10
71
+ ```
72
+
73
+ ## `sf debug delete`
74
+
75
+ Delete Apex log files from a Salesforce org.
76
+
77
+ ```
78
+ USAGE
79
+ $ sf debug delete -o <value> [--json] [-u <value>] [-t <value>] [-a]
80
+
81
+ FLAGS
82
+ -a, --all-users Delete log files for all users.
83
+ -o, --targetusername=<value> (required) Username or alias of the target Salesforce org.
84
+ -t, --time=<value> The number of minutes to retrieve log files for.
85
+ -u, --user=<value> Username, Name, or ID of the user for whom you want to delete the logs.
62
86
 
63
- This command allows you to retrieve Apex log files from a Salesforce org.
87
+ GLOBAL FLAGS
88
+ --json Format output as json.
64
89
 
65
90
  EXAMPLES
66
- sf debug retrieve -o DeveloperEdition -u "Raffaele Preziosi" -t 10
91
+ sf debug delete -o DeveloperEdition -u "Raffaele Preziosi" -t 10
92
+ ```
93
+
94
+ ## `sf debuglevel list`
95
+
96
+ List all DebugLevels in the org.
97
+
98
+ ```
99
+ USAGE
100
+ $ sf debuglevel list -o <value>
101
+
102
+ FLAGS
103
+ -o, --targetusername=<value> (required) Username or alias of the target Salesforce org.
104
+
105
+ GLOBAL FLAGS
106
+ --json Format output as json.
107
+
108
+ EXAMPLES
109
+ sf debuglevel list -o DeveloperEdition
67
110
  ```
68
111
 
69
112
  ## `sf debuglevel new`
70
113
 
114
+ Create a new DebugLevel.
115
+
71
116
  ```
72
117
  USAGE
73
118
  $ sf debuglevel new -o <value> [-n <value>]
74
119
 
75
120
  FLAGS
76
- -o, --targetusername=<value> [required] Username or alias of the target Salesforce org.
77
- -n, --name=<value> [required] The developer name of the new DebugLevel.
121
+ -n, --name=<value> (required) The developer name of the new DebugLevel.
122
+ -o, --targetusername=<value> (required) Username or alias of the target Salesforce org.
78
123
 
79
124
  GLOBAL FLAGS
80
125
  --json Format output as json.
81
126
 
82
127
  DESCRIPTION
83
- Create a new DebugLevel.
84
-
85
128
  Create a new DebugLevel assigning level for each category.
86
129
 
87
130
  EXAMPLES
88
131
  sf debuglevel new -o DeveloperEdition -n "DebugLevel"
89
132
  ```
133
+
134
+ ## `sf trace new`
135
+
136
+ Create a new trace flag.
137
+
138
+ ```
139
+ USAGE
140
+ $ sf trace new -o <value> [-u <value>] [-t <value>]
141
+
142
+ FLAGS
143
+ -o, --targetusername=<value> (required) Username or alias of the target Salesforce org.
144
+ -t, --time=<value> [default: 60] The number of minutes to trace.
145
+ -u, --name=<value> Username, Name, or ID of the user for whom you want to retrieve the logs.
146
+
147
+ GLOBAL FLAGS
148
+ --json Format output as json.
149
+
150
+ DESCRIPTION
151
+ This command is used to create a trace flag for a specific user in the Salesforce org.
152
+
153
+ EXAMPLES
154
+ sf trace new -o DeveloperEdition -u "Raffaele Preziosi" -t 10
155
+ ```
@@ -1,17 +1,14 @@
1
1
  import { SfCommand } from '@salesforce/sf-plugins-core';
2
- export type DebugDeleteResult = {
3
- isSuccess: boolean;
4
- error?: string;
5
- };
6
- export default class DebugDelete extends SfCommand<DebugDeleteResult> {
2
+ export default class DebugDelete extends SfCommand<void> {
7
3
  static readonly summary: string;
8
4
  static readonly description: string;
9
5
  static readonly examples: string[];
10
6
  static readonly flags: {
11
- targetusername: import("@oclif/core/lib/interfaces").OptionFlag<import("@salesforce/core").Org, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
12
- user: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
13
- time: import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
14
- all: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
7
+ 'api-version': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
8
+ targetusername: import("@oclif/core/interfaces").OptionFlag<import("@salesforce/core").Org, import("@oclif/core/interfaces").CustomOptions>;
9
+ user: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
10
+ time: import("@oclif/core/interfaces").OptionFlag<number | undefined, import("@oclif/core/interfaces").CustomOptions>;
11
+ 'all-users': import("@oclif/core/interfaces").BooleanFlag<boolean>;
15
12
  };
16
- run(): Promise<DebugDeleteResult>;
13
+ run(): Promise<void>;
17
14
  }
@@ -1,56 +1,56 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const sf_plugins_core_1 = require("@salesforce/sf-plugins-core");
4
- const core_1 = require("@salesforce/core");
5
- const utils_1 = require("../../utils");
6
- core_1.Messages.importMessagesDirectory(__dirname);
7
- const messages = core_1.Messages.loadMessages('sf-debug-log', 'debug.delete');
8
- class DebugDelete extends sf_plugins_core_1.SfCommand {
1
+ import { SfCommand, Flags } from '@salesforce/sf-plugins-core';
2
+ import { Messages } from '@salesforce/core';
3
+ import { getUserId, getLogs, deleteLogs } from '../../utils.js';
4
+ Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
5
+ const messages = Messages.loadMessages('sf-debug-log', 'debug.delete');
6
+ export default class DebugDelete extends SfCommand {
7
+ static summary = messages.getMessage('summary');
8
+ static description = messages.getMessage('description');
9
+ static examples = messages.getMessages('examples');
10
+ static flags = {
11
+ 'api-version': Flags.orgApiVersion({
12
+ summary: messages.getMessage('flags.api-version.summary'),
13
+ }),
14
+ targetusername: Flags.requiredOrg({
15
+ summary: messages.getMessage('flags.targetusername.summary'),
16
+ char: 'o',
17
+ required: true,
18
+ }),
19
+ user: Flags.string({
20
+ summary: messages.getMessage('flags.user.summary'),
21
+ char: 'u',
22
+ }),
23
+ time: Flags.integer({
24
+ summary: messages.getMessage('flags.time.summary'),
25
+ char: 't',
26
+ }),
27
+ 'all-users': Flags.boolean({
28
+ summary: messages.getMessage('flags.all-users.summary'),
29
+ char: 'a',
30
+ default: false,
31
+ }),
32
+ };
9
33
  async run() {
10
34
  const { flags } = await this.parse(DebugDelete);
11
- const conn = flags.targetusername.getConnection();
12
- let result;
13
- try {
14
- this.spinner.start('Deleting debug logs...');
35
+ if (flags['all-users'] && flags.user) {
36
+ this.error('Cannot use --all-users and --user flags together');
37
+ }
38
+ const conn = flags.targetusername.getConnection(flags['api-version']);
39
+ const getLogsOptions = {};
40
+ if (!flags['all-users']) {
15
41
  const user = flags.user ? flags.user : conn.getUsername();
16
- const userId = await (0, utils_1.getUserId)(conn, user);
17
- const logs = await (0, utils_1.getLogs)(conn, userId, flags.time, flags.all);
18
- await (0, utils_1.deleteLogs)(conn, logs);
19
- this.log(`${logs.length} logs deleted successfully`);
20
- this.spinner.stop();
21
- return { isSuccess: true };
42
+ const userId = await getUserId(conn, user);
43
+ if (!userId) {
44
+ this.error(`User ${user} not found`);
45
+ }
46
+ getLogsOptions.userId = userId;
22
47
  }
23
- catch (err) {
24
- result = {
25
- isSuccess: false,
26
- error: err instanceof Error ? err.message : String(err),
27
- };
28
- throw messages.createError('error.deleteLogs', [result.error]);
48
+ if (flags.time) {
49
+ getLogsOptions.timeLimit = flags.time;
29
50
  }
51
+ const logs = await getLogs(conn, getLogsOptions);
52
+ await deleteLogs(conn, logs);
53
+ this.log(`deleted\t${logs.length}`);
30
54
  }
31
55
  }
32
- DebugDelete.summary = messages.getMessage('summary');
33
- DebugDelete.description = messages.getMessage('description');
34
- DebugDelete.examples = messages.getMessages('examples');
35
- DebugDelete.flags = {
36
- targetusername: sf_plugins_core_1.Flags.requiredOrg({
37
- summary: messages.getMessage('flags.targetusername.summary'),
38
- char: 'o',
39
- required: true,
40
- }),
41
- user: sf_plugins_core_1.Flags.string({
42
- summary: messages.getMessage('flags.user.summary'),
43
- char: 'u',
44
- }),
45
- time: sf_plugins_core_1.Flags.integer({
46
- summary: messages.getMessage('flags.time.summary'),
47
- char: 't',
48
- }),
49
- all: sf_plugins_core_1.Flags.boolean({
50
- summary: messages.getMessage('flags.all.summary'),
51
- char: 'a',
52
- default: false
53
- })
54
- };
55
- exports.default = DebugDelete;
56
56
  //# sourceMappingURL=delete.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"delete.js","sourceRoot":"","sources":["../../../src/commands/debug/delete.ts"],"names":[],"mappings":";;AAAA,iEAA+D;AAC/D,2CAAwD;AAExD,uCAA6D;AAE7D,eAAQ,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC;AAC5C,MAAM,QAAQ,GAAG,eAAQ,CAAC,YAAY,CAAC,cAAc,EAAE,cAAc,CAAC,CAAC;AAOvE,MAAqB,WAAY,SAAQ,2BAA4B;IA0B5D,KAAK,CAAC,GAAG;QACd,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;QAChD,MAAM,IAAI,GAAe,KAAK,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CAAC,EAAE,CAAC;YACxB,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAE,IAAI,CAAC,WAAW,EAAa,CAAC;YACtE,MAAM,MAAM,GAAG,MAAM,SAAS,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;YAC3C,IAAI,CAAC,MAAM,EAAE,CAAC;gBACZ,IAAI,CAAC,KAAK,CAAC,QAAQ,IAAI,YAAY,CAAC,CAAC;YACvC,CAAC;YACD,cAAc,CAAC,MAAM,GAAG,MAAM,CAAC;QACjC,CAAC;QAED,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC;YACf,cAAc,CAAC,SAAS,GAAG,KAAK,CAAC,IAAI,CAAC;QACxC,CAAC;QAED,MAAM,IAAI,GAAc,MAAM,OAAO,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC;QAC5D,MAAM,UAAU,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAC7B,IAAI,CAAC,GAAG,CAAC,YAAY,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;IACtC,CAAC"}
@@ -1,17 +1,15 @@
1
1
  import { SfCommand } from '@salesforce/sf-plugins-core';
2
- export type RetrieveResult = {
3
- isSuccess: boolean;
4
- error?: string;
5
- };
6
- export default class Retrieve extends SfCommand<RetrieveResult> {
2
+ export default class Retrieve extends SfCommand<void> {
7
3
  static readonly summary: string;
8
4
  static readonly description: string;
9
5
  static readonly examples: string[];
10
6
  static readonly flags: {
11
- targetusername: import("@oclif/core/lib/interfaces").OptionFlag<import("@salesforce/core").Org, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
12
- user: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
13
- time: import("@oclif/core/lib/interfaces").OptionFlag<number, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
14
- folder: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
7
+ 'api-version': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
8
+ targetusername: import("@oclif/core/interfaces").OptionFlag<import("@salesforce/core").Org, import("@oclif/core/interfaces").CustomOptions>;
9
+ user: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
10
+ time: import("@oclif/core/interfaces").OptionFlag<number | undefined, import("@oclif/core/interfaces").CustomOptions>;
11
+ folder: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
12
+ 'all-users': import("@oclif/core/interfaces").BooleanFlag<boolean>;
15
13
  };
16
- run(): Promise<RetrieveResult>;
14
+ run(): Promise<void>;
17
15
  }
@@ -1,81 +1,72 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- /* eslint-disable @typescript-eslint/no-unsafe-assignment */
7
- const sf_plugins_core_1 = require("@salesforce/sf-plugins-core");
8
- const core_1 = require("@salesforce/core");
9
- const sanitize_filename_1 = __importDefault(require("sanitize-filename"));
10
- const utils_1 = require("../../utils");
11
- core_1.Messages.importMessagesDirectory(__dirname);
12
- const messages = core_1.Messages.loadMessages('sf-debug-log', 'debug.retrieve');
13
- class Retrieve extends sf_plugins_core_1.SfCommand {
1
+ import path from 'path';
2
+ import { SfCommand, Flags } from '@salesforce/sf-plugins-core';
3
+ import { Messages } from '@salesforce/core';
4
+ import { getUserId, createFile, getLogs } from '../../utils.js';
5
+ Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
6
+ const messages = Messages.loadMessages('sf-debug-log', 'debug.retrieve');
7
+ export default class Retrieve extends SfCommand {
8
+ static summary = messages.getMessage('summary');
9
+ static description = messages.getMessage('description');
10
+ static examples = messages.getMessages('examples');
11
+ static flags = {
12
+ 'api-version': Flags.orgApiVersion(),
13
+ targetusername: Flags.requiredOrg({
14
+ summary: messages.getMessage('flags.targetusername.summary'),
15
+ char: 'o',
16
+ required: true,
17
+ }),
18
+ user: Flags.string({
19
+ summary: messages.getMessage('flags.user.summary'),
20
+ char: 'u',
21
+ }),
22
+ time: Flags.integer({
23
+ summary: messages.getMessage('flags.time.summary'),
24
+ char: 't',
25
+ }),
26
+ folder: Flags.directory({
27
+ summary: messages.getMessage('flags.folder.summary'),
28
+ char: 'd',
29
+ default: '.sfdx/tools/debug/logs',
30
+ }),
31
+ 'all-users': Flags.boolean({
32
+ summary: messages.getMessage('flags.all-users.summary'),
33
+ char: 'a',
34
+ default: false,
35
+ }),
36
+ };
14
37
  async run() {
15
38
  const { flags } = await this.parse(Retrieve);
16
- const conn = flags.targetusername.getConnection();
17
- let result;
18
- try {
19
- this.spinner.start('Retriving debug logs...');
39
+ if (flags['all-users'] && flags.user) {
40
+ this.error('Cannot use --all-users and --user flags together');
41
+ }
42
+ const conn = flags.targetusername.getConnection(flags['api-version']);
43
+ const getLogsOptions = {};
44
+ if (!flags['all-users']) {
45
+ // Default to the current user if no user is specified
20
46
  const user = flags.user ? flags.user : conn.getUsername();
21
- const userId = await (0, utils_1.getUserId)(conn, user);
22
- const logs = await (0, utils_1.getLogs)(conn, userId, flags.time, false);
23
- await saveLogs(conn, logs, flags.folder);
24
- this.spinner.stop();
25
- return { isSuccess: true };
47
+ const userId = await getUserId(conn, user);
48
+ if (!userId) {
49
+ this.error(`User ${user} not found`);
50
+ }
51
+ getLogsOptions.userId = userId;
26
52
  }
27
- catch (err) {
28
- result = {
29
- isSuccess: false,
30
- error: err instanceof Error ? err.message : String(err),
31
- };
32
- throw messages.createError('error.saveLogs', [result.error]);
53
+ if (flags.time) {
54
+ getLogsOptions.timeLimit = flags.time;
33
55
  }
56
+ const logs = await getLogs(conn, getLogsOptions);
57
+ await saveLogs(conn, logs, flags.folder);
58
+ this.log(`saved\t${logs.length}`);
34
59
  }
35
60
  }
36
- Retrieve.summary = messages.getMessage('summary');
37
- Retrieve.description = messages.getMessage('description');
38
- Retrieve.examples = messages.getMessages('examples');
39
- Retrieve.flags = {
40
- targetusername: sf_plugins_core_1.Flags.requiredOrg({
41
- summary: messages.getMessage('flags.targetusername.summary'),
42
- char: 'o',
43
- required: true,
44
- }),
45
- user: sf_plugins_core_1.Flags.string({
46
- summary: messages.getMessage('flags.user.summary'),
47
- char: 'u',
48
- }),
49
- time: sf_plugins_core_1.Flags.integer({
50
- summary: messages.getMessage('flags.time.summary'),
51
- char: 't',
52
- default: 60,
53
- }),
54
- folder: sf_plugins_core_1.Flags.directory({
55
- summary: messages.getMessage('flags.folder.summary'),
56
- char: 'd',
57
- default: '.sfdx/tools/debug/logs',
58
- }),
59
- };
60
- exports.default = Retrieve;
61
61
  async function saveLogs(conn, logs, directory) {
62
62
  // Use Promise.all to parallelize the download and save operations
63
63
  await Promise.all(logs.map(async (log) => {
64
64
  const url = `${conn.instanceUrl}/apexdebug/traceDownload.apexp?id=${log.Id}`;
65
- // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
66
- const date = new Date(log.SystemModstamp);
67
- const hours = date.getHours();
68
- const minutes = date.getMinutes();
69
- const seconds = date.getSeconds();
70
- // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/restrict-template-expressions
71
- const fileName = `(${hours}-${minutes}-${seconds}) ${log.DurationMilliseconds}ms ${log.Request} ${log.Operation} ${log.Status}.log`;
72
- // eslint-disable-next-line @typescript-eslint/no-unsafe-call
73
- const sanitizedFileName = (0, sanitize_filename_1.default)(fileName);
74
- // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/restrict-template-expressions
75
- const filePath = `${directory}/${log.LogUser.Name}/${sanitizedFileName}`;
65
+ const fileName = `${log.Id}.log`;
66
+ const filePath = path.join(directory, fileName);
76
67
  try {
77
68
  const body = await conn.request(url);
78
- await (0, utils_1.createFile)(filePath, body);
69
+ await createFile(filePath, body);
79
70
  }
80
71
  catch (err) {
81
72
  throw new Error('Error saving debug logs');
@@ -1 +1 @@
1
- {"version":3,"file":"retrieve.js","sourceRoot":"","sources":["../../../src/commands/debug/retrieve.ts"],"names":[],"mappings":";;;;;AAAA,4DAA4D;AAC5D,iEAA+D;AAC/D,2CAAwD;AAExD,0EAAyC;AACzC,uCAA6D;AAE7D,eAAQ,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC;AAC5C,MAAM,QAAQ,GAAG,eAAQ,CAAC,YAAY,CAAC,cAAc,EAAE,gBAAgB,CAAC,CAAC;AAOzE,MAAqB,QAAS,SAAQ,2BAAyB;IA2BtD,KAAK,CAAC,GAAG;QACd,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;QAC7C,MAAM,IAAI,GAAe,KAAK,CAAC,cAAc,CAAC,aAAa,EAAE,CAAC;QAC9D,IAAI,MAAsB,CAAC;QAC3B,IAAI;YACF,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,yBAAyB,CAAC,CAAC;YAC9C,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAE,IAAI,CAAC,WAAW,EAAa,CAAC;YACtE,MAAM,MAAM,GAAG,MAAM,IAAA,iBAAS,EAAC,IAAI,EAAE,IAAI,CAAC,CAAC;YAC3C,MAAM,IAAI,GAAG,MAAM,IAAA,eAAO,EAAC,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;YAC5D,MAAM,QAAQ,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;YACzC,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;YACpB,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;SAC5B;QAAC,OAAO,GAAG,EAAE;YACZ,MAAM,GAAG;gBACP,SAAS,EAAE,KAAK;gBA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AU,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;IACpC,CAAC;;AAGH,KAAK,UAAU,QAAQ,CAAC,IAAgB,EAAE,IAAe,EAAE,SAAiB;IAC1E,kEAAkE;IAClE,MAAM,OAAO,CAAC,GAAG,CACf,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;QACrB,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,WAAW,qCAAqC,GAAG,CAAC,EAAE,EAAE,CAAC;QAC7E,MAAM,QAAQ,GAAG,GAAG,GAAG,CAAC,EAAE,MAAM,CAAC;QACjC,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;QAChD,IAAI,CAAC;YACH,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;YACrC,MAAM,UAAU,CAAC,QAAQ,EAAE,IAAc,CAAC,CAAC;QAC7C,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;QAC7C,CAAC;IACH,CAAC,CAAC,CACH,CAAC;AACJ,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { SfCommand } from '@salesforce/sf-plugins-core';
2
+ export default class List extends SfCommand<void> {
3
+ static readonly summary: string;
4
+ static readonly description: string;
5
+ static readonly examples: string[];
6
+ static readonly flags: {
7
+ 'api-version': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
8
+ targetusername: import("@oclif/core/interfaces").OptionFlag<import("@salesforce/core").Org, import("@oclif/core/interfaces").CustomOptions>;
9
+ };
10
+ run(): Promise<void>;
11
+ }
@@ -0,0 +1,38 @@
1
+ import { SfCommand, Flags } from '@salesforce/sf-plugins-core';
2
+ import { Messages } from '@salesforce/core';
3
+ import { getDebugLevels } from '../../utils.js';
4
+ Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
5
+ const messages = Messages.loadMessages('sf-debug-log', 'debuglevel.list');
6
+ export default class List extends SfCommand {
7
+ static summary = messages.getMessage('summary');
8
+ static description = messages.getMessage('description');
9
+ static examples = messages.getMessages('examples');
10
+ static flags = {
11
+ 'api-version': Flags.orgApiVersion(),
12
+ targetusername: Flags.requiredOrg({
13
+ summary: messages.getMessage('flags.targetusername.summary'),
14
+ char: 'o',
15
+ required: true,
16
+ }),
17
+ };
18
+ async run() {
19
+ const { flags } = await this.parse(List);
20
+ const conn = flags.targetusername.getConnection(flags['api-version']);
21
+ const debugLevels = await getDebugLevels(conn);
22
+ const data = debugLevels.map((level) => ({
23
+ DeveloperName: level.DeveloperName,
24
+ Workflow: level.Workflow,
25
+ Validation: level.Validation,
26
+ Callout: level.Callout,
27
+ ApexCode: level.ApexCode,
28
+ ApexProfiling: level.ApexProfiling,
29
+ Visualforce: level.Visualforce,
30
+ System: level.System,
31
+ Database: level.Database,
32
+ Wave: level.Wave,
33
+ Nba: level.Nba
34
+ }));
35
+ this.table({ data });
36
+ }
37
+ }
38
+ //# sourceMappingURL=list.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list.js","sourceRoot":"","sources":["../../../src/commands/debuglevel/list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAc,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAEhD,QAAQ,CAAC,kCAAkC,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC7D,MAAM,QAAQ,GAAG,QAAQ,CAAC,YAAY,CAAC,cAAc,EAAE,iBAAiB,CAAC,CAAC;AAE1E,MAAM,CAAC,OAAO,OAAO,IAAK,SAAQ,SAAe;IACxC,MAAM,CAAU,OAAO,GAAG,QAAQ,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;IACzD,MAAM,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}
@@ -1,17 +1,14 @@
1
1
  import { SfCommand } from '@salesforce/sf-plugins-core';
2
- export type DebuglevelNewResult = {
3
- isSuccess: boolean;
4
- error?: string;
5
- };
6
- export default class DebuglevelNew extends SfCommand<DebuglevelNewResult> {
2
+ export default class DebuglevelNew extends SfCommand<void> {
7
3
  static readonly summary: string;
8
4
  static readonly description: string;
9
5
  static readonly examples: string[];
10
6
  static readonly flags: {
11
- targetusername: import("@oclif/core/lib/interfaces").OptionFlag<import("@salesforce/core").Org, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
12
- developername: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
7
+ 'api-version': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
8
+ targetusername: import("@oclif/core/interfaces").OptionFlag<import("@salesforce/core").Org, import("@oclif/core/interfaces").CustomOptions>;
9
+ developername: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
13
10
  };
14
- run(): Promise<DebuglevelNewResult>;
11
+ run(): Promise<void>;
15
12
  private createDebugLevelRecord;
16
13
  private selectDebugLevel;
17
14
  }