sf-debug-log 0.0.21 → 0.0.23

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
@@ -2,6 +2,9 @@
2
2
 
3
3
  Commands to manage Salesforce debug logs.
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.
7
+
5
8
  ## Install
6
9
 
7
10
  ```bash
@@ -14,19 +17,18 @@ sf plugins install sf-debug-log
14
17
 
15
18
  - [`sf trace new`](#sf-trace-new)
16
19
  - [`sf debug retrieve`](#sf-debug-retrieve)
20
+ - [`sf debuglevel new`](#sf-debuglevel-new)
17
21
 
18
22
  ## `sf trace new`
19
23
 
20
- Create a new trace flag.
21
-
22
24
  ```
23
25
  USAGE
24
- $ sf trace new
26
+ $ sf trace new -o <value> [-u <value>] [-t <value>]
25
27
 
26
28
  FLAGS
27
- -o, --targetusername=<value> [required] A username or alias for the target org.
28
- -u, --name=<value> The name of the user to trace.
29
+ -o, --targetusername=<value> [required] Username or alias of the target Salesforce org.
29
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.
30
32
 
31
33
  GLOBAL FLAGS
32
34
  --json Format output as json.
@@ -34,29 +36,54 @@ GLOBAL FLAGS
34
36
  DESCRIPTION
35
37
  Create a new trace flag.
36
38
 
39
+ This command is used to create a trace flag for a specific user in the Salesforce org.
40
+
37
41
  EXAMPLES
38
42
  sf trace new -o DeveloperEdition -u "Raffaele Preziosi" -t 10
39
43
  ```
40
44
 
41
45
  ## `sf debug retrieve`
42
46
 
43
- Retrieve apex log files.
44
-
45
47
  ```
46
48
  USAGE
47
- $ sf debug retrieve
49
+ $ sf debug retrieve -o <value> [-u <value>] [-t <value>] [-d <value>]
48
50
 
49
51
  FLAGS
50
- -o, --targetusername=<value> [required] A username or alias for the target org.
51
- -u, --name=<value> The name of the user to trace.
52
- -t, --time=<value> [default: 60] Minutes to retrieve logs for.
52
+ -d, --folder=<value> [default: .sfdx/tools/debug/logs] The folder where the retrieved log files will be stored.
53
+ -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.
53
56
 
54
57
  GLOBAL FLAGS
55
58
  --json Format output as json.
56
59
 
57
60
  DESCRIPTION
58
- Retrieves apex log files from the Salesforce platform.
61
+ Retrieve Apex log files from the Salesforce platform.
62
+
63
+ This command allows you to retrieve Apex log files from a Salesforce org.
59
64
 
60
65
  EXAMPLES
61
66
  sf debug retrieve -o DeveloperEdition -u "Raffaele Preziosi" -t 10
62
67
  ```
68
+
69
+ ## `sf debuglevel new`
70
+
71
+ ```
72
+ USAGE
73
+ $ sf debuglevel new -o <value> [-n <value>]
74
+
75
+ 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.
78
+
79
+ GLOBAL FLAGS
80
+ --json Format output as json.
81
+
82
+ DESCRIPTION
83
+ Create a new DebugLevel.
84
+
85
+ Create a new DebugLevel assigning level for each category.
86
+
87
+ EXAMPLES
88
+ sf debuglevel new -o DeveloperEdition -n "DebugLevel"
89
+ ```
@@ -0,0 +1,16 @@
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> {
7
+ static readonly summary: string;
8
+ static readonly description: string;
9
+ static readonly examples: string[];
10
+ 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
+ };
15
+ run(): Promise<DebugDeleteResult>;
16
+ }
@@ -0,0 +1,52 @@
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 {
9
+ async run() {
10
+ const { flags } = await this.parse(DebugDelete);
11
+ const conn = flags.targetusername.getConnection();
12
+ let result;
13
+ try {
14
+ this.spinner.start('Deleting debug logs...');
15
+ 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);
18
+ await (0, utils_1.deleteLogs)(conn, logs);
19
+ this.log(`${logs.length} logs deleted successfully`);
20
+ this.spinner.stop();
21
+ return { isSuccess: true };
22
+ }
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]);
29
+ }
30
+ }
31
+ }
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
+ default: 60,
49
+ }),
50
+ };
51
+ exports.default = DebugDelete;
52
+ //# sourceMappingURL=delete.js.map
@@ -0,0 +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;IAsB5D,KAAK,CAAC,GAAG;QACd,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;QAChD,MAAM,IAAI,GAAe,KAAK,CAAC,cAAc,CAAC,aAAa,EAAE,CAAC;QAC9D,IAAI,MAAyB,CAAC;QAC9B,IAAI;YACF,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,wBAAwB,CAAC,CAAC;YAC7C,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,GAAa,MAAM,IAAA,eAAO,EAAC,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;YAC/D,MAAM,IAAA,kBAAU,EAAC,IAAI,EAAE,IAAI,CAAC,CAAC;YAC7B,IAAI,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,MAAM,4BAA4B,CAAC,CAAC;YACrD,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;gBAChB,KAAK,EAAE,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC;aACxD,CAAC;YACF,MAAM,QAAQ,CAAC,WAAW,CAAC,kBAAkB,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;SAChE;IACH,CAAC;;AAzCsB,mBAAO,GAAG,QAAQ,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;AACzC,uBAAW,GAAG,QAAQ,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;AACjD,oBAAQ,GAAG,QAAQ,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;AAE5C,iBAAK,GAAG;IAC7B,cAAc,EAAE,uBAAK,CAAC,WAAW,CAAC;QAChC,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,8BAA8B,CAAC;QAC5D,IAAI,EAAE,GAAG;QACT,QAAQ,EAAE,IAAI;KACf,CAAC;IACF,IAAI,EAAE,uBAAK,CAAC,MAAM,CAAC;QACjB,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,oBAAoB,CAAC;QAClD,IAAI,EAAE,GAAG;KACV,CAAC;IACF,IAAI,EAAE,uBAAK,CAAC,OAAO,CAAC;QAClB,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,oBAAoB,CAAC;QAClD,IAAI,EAAE,GAAG;QACT,OAAO,EAAE,EAAE;KACZ,CAAC;CACH,CAAC;kBApBiB,WAAW"}
@@ -19,7 +19,7 @@ class Retrieve extends sf_plugins_core_1.SfCommand {
19
19
  this.spinner.start('Retriving debug logs...');
20
20
  const user = flags.user ? flags.user : conn.getUsername();
21
21
  const userId = await (0, utils_1.getUserId)(conn, user);
22
- const logs = await getLogs(conn, userId, flags.time);
22
+ const logs = await (0, utils_1.getLogs)(conn, userId, flags.time);
23
23
  await saveLogs(conn, logs, flags.folder);
24
24
  this.spinner.stop();
25
25
  return { isSuccess: true };
@@ -58,22 +58,6 @@ Retrieve.flags = {
58
58
  }),
59
59
  };
60
60
  exports.default = Retrieve;
61
- async function getLogs(conn, userId, time) {
62
- const dateTime = new Date(Date.now());
63
- dateTime.setMinutes(dateTime.getMinutes() - time);
64
- const startTime = dateTime.toISOString();
65
- const queryResult = await conn.query(`SELECT Id, LogUser.Name, LogLength, Request, Operation,
66
- Application, Status, DurationMilliseconds,
67
- SystemModstamp, RequestIdentifier
68
- FROM ApexLog
69
- WHERE SystemModstamp > ${startTime}
70
- AND LogUserId = '${userId}'
71
- ORDER BY SystemModstamp DESC`);
72
- if (queryResult.records.length === 0) {
73
- throw new Error('No debug logs found');
74
- }
75
- return queryResult.records;
76
- }
77
61
  async function saveLogs(conn, logs, directory) {
78
62
  // Use Promise.all to parallelize the download and save operations
79
63
  await Promise.all(logs.map(async (log) => {
@@ -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,uCAAoD;AAEpD,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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AAG,CAAC,oBAAoB,MAAM,GAAG,CAAC,OAAO,IAAI,GAAG,CAAC,SAAS,IAAI,GAAG,CAAC,MAAM,MAAM,CAAC;QACpI,6DAA6D;QAC7D,MAAM,iBAAiB,GAAG,IAAA,2BAAQ,EAAC,QAAQ,CAAC,CAAC;QAC7C,wHAAwH;QACxH,MAAM,QAAQ,GAAG,GAAG,SAAS,IAAI,GAAG,CAAC,OAAO,CAAC,IAAI,IAAI,iBAAiB,EAAE,CAAC;QACzE,IAAI;YACF,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;YACrC,MAAM,IAAA,kBAAU,EAAC,QAAQ,EAAE,IAAc,CAAC,CAAC;SAC5C;QAAC,OAAO,GAAG,EAAE;YACZ,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;SAC5C;IACH,CAAC,CAAC,CACH,CAAC;AACJ,CAAC"}
@@ -0,0 +1,17 @@
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> {
7
+ static readonly summary: string;
8
+ static readonly description: string;
9
+ static readonly examples: string[];
10
+ 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>;
13
+ };
14
+ run(): Promise<DebuglevelNewResult>;
15
+ private createDebugLevelRecord;
16
+ private selectDebugLevel;
17
+ }
@@ -0,0 +1,85 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ /* eslint-disable class-methods-use-this */
4
+ const sf_plugins_core_1 = require("@salesforce/sf-plugins-core");
5
+ const core_1 = require("@salesforce/core");
6
+ const utils_1 = require("../../utils");
7
+ core_1.Messages.importMessagesDirectory(__dirname);
8
+ const messages = core_1.Messages.loadMessages('sf-debug-log', 'debuglevel.new');
9
+ const DEBUG_CATEGORIES = [
10
+ 'Database',
11
+ 'Workflow',
12
+ 'Validation',
13
+ 'Callout',
14
+ 'ApexCode',
15
+ 'ApexProfiling',
16
+ 'Visualforce',
17
+ 'System',
18
+ 'Wave',
19
+ 'Nba',
20
+ ];
21
+ const DEBUG_LEVELS = ['NONE', 'INTERNAL', 'FINEST', 'FINER', 'FINE', 'DEBUG', 'INFO', 'WARN', 'ERROR'];
22
+ class DebuglevelNew extends sf_plugins_core_1.SfCommand {
23
+ async run() {
24
+ const { flags } = await this.parse(DebuglevelNew);
25
+ const conn = flags.targetusername.getConnection();
26
+ try {
27
+ const debugLevel = this.createDebugLevelRecord(flags.developername);
28
+ for (const category of DEBUG_CATEGORIES) {
29
+ // eslint-disable-next-line no-await-in-loop
30
+ const level = await this.selectDebugLevel(category);
31
+ debugLevel[category] = level;
32
+ }
33
+ const result = await (0, utils_1.createDebugLevel)(conn, debugLevel);
34
+ if (!result.isSuccess) {
35
+ this.error(`Error to create Debug Level: ${result.error}`);
36
+ }
37
+ else {
38
+ this.log(`Debug Level ${flags.developername} created successfully.`);
39
+ }
40
+ return result;
41
+ }
42
+ catch (exception) {
43
+ const err = exception instanceof Error ? exception.message : String(exception);
44
+ this.log(`Error to create Debug Level: ${err}`);
45
+ return {
46
+ isSuccess: false,
47
+ error: err,
48
+ };
49
+ }
50
+ }
51
+ createDebugLevelRecord(developerName) {
52
+ return {
53
+ DeveloperName: developerName,
54
+ MasterLabel: developerName,
55
+ };
56
+ }
57
+ async selectDebugLevel(category) {
58
+ const levels = DEBUG_LEVELS;
59
+ const level = await this.prompt({
60
+ type: 'list',
61
+ name: 'level',
62
+ message: `Select ${category} debug level`,
63
+ loop: false,
64
+ choices: levels,
65
+ });
66
+ return level.level;
67
+ }
68
+ }
69
+ DebuglevelNew.summary = messages.getMessage('summary');
70
+ DebuglevelNew.description = messages.getMessage('description');
71
+ DebuglevelNew.examples = messages.getMessages('examples');
72
+ DebuglevelNew.flags = {
73
+ targetusername: sf_plugins_core_1.Flags.requiredOrg({
74
+ summary: messages.getMessage('flags.targetusername.summary'),
75
+ char: 'o',
76
+ required: true,
77
+ }),
78
+ developername: sf_plugins_core_1.Flags.string({
79
+ summary: messages.getMessage('flags.developerName.summary'),
80
+ char: 'n',
81
+ required: true,
82
+ }),
83
+ };
84
+ exports.default = DebuglevelNew;
85
+ //# sourceMappingURL=new.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"new.js","sourceRoot":"","sources":["../../../src/commands/debuglevel/new.ts"],"names":[],"mappings":";;AAAA,2CAA2C;AAC3C,iEAA+D;AAC/D,2CAAwD;AACxD,uCAA+C;AAE/C,eAAQ,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC;AAC5C,MAAM,QAAQ,GAAG,eAAQ,CAAC,YAAY,CAAC,cAAc,EAAE,gBAAgB,CAAC,CAAC;AAEzE,MAAM,gBAAgB,GAAG;IACvB,UAAU;IACV,UAAU;IACV,YAAY;IACZ,SAAS;IACT,UAAU;IACV,eAAe;IACf,aAAa;IACb,QAAQ;IACR,MAAM;IACN,KAAK;CACN,CAAC;AAEF,MAAM,YAAY,GAAG,CAAC,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;AAavG,MAAqB,aAAc,SAAQ,2BAA8B;IAkBhE,KAAK,CAAC,GAAG;QACd,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;QAClD,MAAM,IAAI,GAAe,KAAK,CAAC,cAAc,CAAC,aAAa,EAAE,CAAC;QAE9D,IAAI;YACF,MAAM,UAAU,GAAG,IAAI,CAAC,sBAAsB,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;YAEpE,KAAK,M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AAC;IACrB,CAAC;;AAhEsB,qBAAO,GAAG,QAAQ,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;AACzC,yBAAW,GAAG,QAAQ,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;AACjD,sBAAQ,GAAG,QAAQ,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;AAE5C,mBAAK,GAAG;IAC7B,cAAc,EAAE,uBAAK,CAAC,WAAW,CAAC;QAChC,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,8BAA8B,CAAC;QAC5D,IAAI,EAAE,GAAG;QACT,QAAQ,EAAE,IAAI;KACf,CAAC;IACF,aAAa,EAAE,uBAAK,CAAC,MAAM,CAAC;QAC1B,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,6BAA6B,CAAC;QAC3D,IAAI,EAAE,GAAG;QACT,QAAQ,EAAE,IAAI;KACf,CAAC;CACH,CAAC;kBAhBiB,aAAa"}
package/lib/utils.d.ts CHANGED
@@ -1,8 +1,12 @@
1
1
  import { Connection } from '@salesforce/core';
2
2
  import { Record } from 'jsforce';
3
3
  import { TraceNewResult } from './commands/trace/new';
4
+ import { DebuglevelNewResult } from './commands/debuglevel/new';
4
5
  export declare function createFile(path: string, contents: string): Promise<void>;
5
6
  export declare function getUserId(connection: Connection, inputUser: string): Promise<string>;
6
7
  export declare function getActiveTraceFlag(conn: Connection, userId: string): Promise<Record | undefined>;
7
8
  export declare function getDebugLevels(conn: Connection): Promise<Record[]>;
8
9
  export declare function createTraceFlag(conn: Connection, userId: string, debugLevelId: string, time: number): Promise<TraceNewResult>;
10
+ export declare function createDebugLevel(conn: Connection, debugLevel: Record): Promise<DebuglevelNewResult>;
11
+ export declare function getLogs(conn: Connection, userId: string, time: number): Promise<Record[]>;
12
+ export declare function deleteLogs(conn: Connection, logs: Record[]): Promise<void>;
package/lib/utils.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createTraceFlag = exports.getDebugLevels = exports.getActiveTraceFlag = exports.getUserId = exports.createFile = void 0;
3
+ exports.deleteLogs = exports.getLogs = exports.createDebugLevel = exports.createTraceFlag = exports.getDebugLevels = exports.getActiveTraceFlag = exports.getUserId = exports.createFile = void 0;
4
4
  const path_1 = require("path");
5
5
  const util_1 = require("util");
6
6
  const fs_1 = require("fs");
@@ -73,4 +73,36 @@ async function createTraceFlag(conn, userId, debugLevelId, time) {
73
73
  };
74
74
  }
75
75
  exports.createTraceFlag = createTraceFlag;
76
+ async function createDebugLevel(conn, debugLevel) {
77
+ const result = await conn.tooling.sobject('DebugLevel').create(debugLevel);
78
+ return {
79
+ isSuccess: result.success,
80
+ error: result.success ? undefined : result.errors[0].message,
81
+ };
82
+ }
83
+ exports.createDebugLevel = createDebugLevel;
84
+ async function getLogs(conn, userId, time) {
85
+ const dateTime = new Date(Date.now());
86
+ dateTime.setMinutes(dateTime.getMinutes() - time);
87
+ const startTime = dateTime.toISOString();
88
+ const queryResult = await conn.query(`SELECT Id, LogUser.Name, LogLength, Request, Operation,
89
+ Application, Status, DurationMilliseconds,
90
+ SystemModstamp, RequestIdentifier
91
+ FROM ApexLog
92
+ WHERE SystemModstamp > ${startTime}
93
+ AND LogUserId = '${userId}'
94
+ ORDER BY SystemModstamp DESC`);
95
+ if (queryResult.records.length === 0) {
96
+ throw new Error('No debug logs found');
97
+ }
98
+ return queryResult.records;
99
+ }
100
+ exports.getLogs = getLogs;
101
+ async function deleteLogs(conn, logs) {
102
+ if (logs && logs.length > 0) {
103
+ const ids = logs.map((log) => log.Id).filter((id) => id !== undefined);
104
+ await conn.sobject('ApexLog').del(ids);
105
+ }
106
+ }
107
+ exports.deleteLogs = deleteLogs;
76
108
  //# sourceMappingURL=utils.js.map
package/lib/utils.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":";;;AAAA,+BAA+B;AAC/B,+BAAiC;AACjC,2BA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I,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;IACtC,QAAQ,CAAC,UAAU,CAAC,QAAQ,CAAC,UAAU,EAAE,GAAG,IAAI,CAAC,CAAC;IAElD,MAAM,SAAS,GAAG,QAAQ,CAAC,WAAW,EAAE,CAAC;IACzC,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC;;;;yDAIkB,SAAS;mDACf,MAAM;6DACI,CAAC,CAAC;IAE7D,IAAI,WAAW,CAAC,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE;QACpC,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAC;KACxC;IAED,OAAO,WAAW,CAAC,OAAO,CAAC;AAC7B,CAAC;AAlBD,0BAkBC;AAEM,KAAK,UAAU,UAAU,CAAC,IAAgB,EAAE,IAAc;IAC/D,IAAI,IAAI,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE;QAC3B,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,EAAgB,EAAE,CAAC,EAAE,KAAK,SAAS,CAAC,CAAC;QACrF,MAAM,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;KACxC;AACH,CAAC;AALD,gCAKC"}
@@ -0,0 +1,27 @@
1
+ # summary
2
+
3
+ Delete Apex log files from a Salesforce org.
4
+
5
+ # description
6
+
7
+ Deletes Apex log files from a Salesforce org.
8
+
9
+ # flags.user.summary
10
+
11
+ [default: targetusername] Username, Name, or ID of the user for whom you want to retrieve the logs.
12
+
13
+ # flags.targetusername.summary
14
+
15
+ Username or alias of the target Salesforce org.
16
+
17
+ # flags.time.summary
18
+
19
+ The number of minutes to retrieve log files for.
20
+
21
+ # error.deleteLogs
22
+
23
+ Failed to delete logs: %s.
24
+
25
+ # examples
26
+
27
+ sf debug delete -u "Raffaele Preziosi" -t 60
@@ -1,26 +1,26 @@
1
1
  # summary
2
2
 
3
- Retrieve apex log files.
3
+ Retrieve Apex log files from the Salesforce platform.
4
4
 
5
5
  # description
6
6
 
7
- Retrieves apex log files from the Salesforce platform.
7
+ This command allows you to retrieve Apex log files from a Salesforce org.
8
8
 
9
9
  # flags.user.summary
10
10
 
11
- Username or alias to retrieve logs for.
11
+ [default: targetusername] Username, Name, or ID of the user for whom you want to retrieve the logs.
12
12
 
13
13
  # flags.targetusername.summary
14
14
 
15
- Username or alias to retrieve logs for.
15
+ Username or alias of the target Salesforce org.
16
16
 
17
17
  # flags.time.summary
18
18
 
19
- Minutes to retrieve logs for.
19
+ The number of minutes to retrieve log files for.
20
20
 
21
21
  # flags.folder.summary
22
22
 
23
- Folder where the logs are stored.
23
+ The folder where the retrieved log files will be stored.
24
24
 
25
25
  # error.saveLogs
26
26
 
@@ -28,4 +28,4 @@ Failed to save logs: %s.
28
28
 
29
29
  # examples
30
30
 
31
- - <%= config.bin %> <%= command.id %>
31
+ sf debug retrieve -o MyDeveloperEdition -u "Raffaele Preziosi" -t 10
@@ -0,0 +1,19 @@
1
+ # summary
2
+
3
+ Create a new DebugLevel.
4
+
5
+ # description
6
+
7
+ Create a new DebugLevel assigning level for each category.
8
+
9
+ # flags.targetusername.summary
10
+
11
+ Username or alias of the target Salesforce org.
12
+
13
+ # flags.developerName.summary
14
+
15
+ The developer name of the new DebugLevel.
16
+
17
+ # examples
18
+
19
+ - <%= config.bin %> <%= command.id %>
@@ -2,13 +2,17 @@
2
2
 
3
3
  Create a trace flag for a user.
4
4
 
5
+ # description
6
+
7
+ This command is used to create a trace flag for a specific user in the Salesforce org.
8
+
5
9
  # flags.targetusername.summary
6
10
 
7
- A username or alias for the target org.
11
+ Username or alias of the target Salesforce org.
8
12
 
9
13
  # flags.user.summary
10
14
 
11
- The username of the user to create the trace flag for.
15
+ [default: targetusername] Username, Name, or ID of the user for whom you want to retrieve the logs.
12
16
 
13
17
  # flags.time.summary
14
18
 
@@ -20,4 +24,4 @@ Create User Trace Flag failed: %s.
20
24
 
21
25
  # examples
22
26
 
23
- example
27
+ sf trace new -o MyDeveloperEdition -u "Raffaele Preziosi" -t 10
@@ -1,17 +1,64 @@
1
1
  {
2
- "version": "0.0.21",
2
+ "version": "0.0.23",
3
3
  "commands": {
4
+ "debug:delete": {
5
+ "id": "debug:delete",
6
+ "summary": "Delete Apex log files from a Salesforce org.",
7
+ "description": "Deletes Apex log files from a Salesforce org.",
8
+ "strict": true,
9
+ "pluginName": "sf-debug-log",
10
+ "pluginAlias": "sf-debug-log",
11
+ "pluginType": "core",
12
+ "aliases": [],
13
+ "examples": [
14
+ "sf debug delete -u \"Raffaele Preziosi\" -t 60"
15
+ ],
16
+ "flags": {
17
+ "json": {
18
+ "name": "json",
19
+ "type": "boolean",
20
+ "description": "Format output as json.",
21
+ "helpGroup": "GLOBAL",
22
+ "allowNo": false
23
+ },
24
+ "targetusername": {
25
+ "name": "targetusername",
26
+ "type": "option",
27
+ "char": "o",
28
+ "summary": "Username or alias of the target Salesforce org.",
29
+ "required": true,
30
+ "multiple": false
31
+ },
32
+ "user": {
33
+ "name": "user",
34
+ "type": "option",
35
+ "char": "u",
36
+ "summary": "[default: targetusername] Username, Name, or ID of the user for whom you want to retrieve the logs.",
37
+ "multiple": false
38
+ },
39
+ "time": {
40
+ "name": "time",
41
+ "type": "option",
42
+ "char": "t",
43
+ "summary": "The number of minutes to retrieve log files for.",
44
+ "multiple": false,
45
+ "default": 60
46
+ }
47
+ },
48
+ "args": {},
49
+ "hasDynamicHelp": true
50
+ },
4
51
  "debug:retrieve": {
5
52
  "id": "debug:retrieve",
6
- "summary": "Retrieve apex log files.",
7
- "description": "Retrieves apex log files from the Salesforce platform.",
53
+ "summary": "Retrieve Apex log files from the Salesforce platform.",
54
+ "description": "This command allows you to retrieve Apex log files from a Salesforce org.",
8
55
  "strict": true,
9
56
  "pluginName": "sf-debug-log",
10
57
  "pluginAlias": "sf-debug-log",
11
58
  "pluginType": "core",
12
59
  "aliases": [],
13
60
  "examples": [
14
- "<%= config.bin %> <%= command.id %>"
61
+ "sf debug retrieve -o MyDeveloperEdition -u \"Raffaele Preziosi\" -t 10"
15
62
  ],
16
63
  "flags": {
17
64
  "json": {
@@ -25,7 +72,7 @@
25
72
  "name": "targetusername",
26
73
  "type": "option",
27
74
  "char": "o",
28
- "summary": "Username or alias to retrieve logs for.",
75
+ "summary": "Username or alias of the target Salesforce org.",
29
76
  "required": true,
30
77
  "multiple": false
31
78
  },
@@ -33,14 +80,14 @@
33
80
  "name": "user",
34
81
  "type": "option",
35
82
  "char": "u",
36
- "summary": "Username or alias to retrieve logs for.",
83
+ "summary": "[default: targetusername] Username, Name, or ID of the user for whom you want to retrieve the logs.",
37
84
  "multiple": false
38
85
  },
39
86
  "time": {
40
87
  "name": "time",
41
88
  "type": "option",
42
89
  "char": "t",
43
- "summary": "Minutes to retrieve logs for.",
90
+ "summary": "The number of minutes to retrieve log files for.",
44
91
  "multiple": false,
45
92
  "default": 60
46
93
  },
@@ -48,7 +95,7 @@
48
95
  "name": "folder",
49
96
  "type": "option",
50
97
  "char": "d",
51
- "summary": "Folder where the logs are stored.",
98
+ "summary": "The folder where the retrieved log files will be stored.",
52
99
  "multiple": false,
53
100
  "default": ".sfdx/tools/debug/logs"
54
101
  }
@@ -56,6 +103,46 @@
56
103
  "args": {},
57
104
  "hasDynamicHelp": true
58
105
  },
106
+ "debuglevel:new": {
107
+ "id": "debuglevel:new",
108
+ "summary": "Create a new DebugLevel.",
109
+ "description": "Create a new DebugLevel assigning level for each category.",
110
+ "strict": true,
111
+ "pluginName": "sf-debug-log",
112
+ "pluginAlias": "sf-debug-log",
113
+ "pluginType": "core",
114
+ "aliases": [],
115
+ "examples": [
116
+ "<%= config.bin %> <%= command.id %>"
117
+ ],
118
+ "flags": {
119
+ "json": {
120
+ "name": "json",
121
+ "type": "boolean",
122
+ "description": "Format output as json.",
123
+ "helpGroup": "GLOBAL",
124
+ "allowNo": false
125
+ },
126
+ "targetusername": {
127
+ "name": "targetusername",
128
+ "type": "option",
129
+ "char": "o",
130
+ "summary": "Username or alias of the target Salesforce org.",
131
+ "required": true,
132
+ "multiple": false
133
+ },
134
+ "developername": {
135
+ "name": "developername",
136
+ "type": "option",
137
+ "char": "n",
138
+ "summary": "The developer name of the new DebugLevel.",
139
+ "required": true,
140
+ "multiple": false
141
+ }
142
+ },
143
+ "args": {},
144
+ "hasDynamicHelp": true
145
+ },
59
146
  "trace:new": {
60
147
  "id": "trace:new",
61
148
  "summary": "Create a trace flag for a user.",
@@ -65,7 +152,7 @@
65
152
  "pluginType": "core",
66
153
  "aliases": [],
67
154
  "examples": [
68
- "example"
155
+ "sf trace new -o MyDeveloperEdition -u \"Raffaele Preziosi\" -t 10"
69
156
  ],
70
157
  "flags": {
71
158
  "json": {
@@ -79,7 +166,7 @@
79
166
  "name": "targetusername",
80
167
  "type": "option",
81
168
  "char": "o",
82
- "summary": "A username or alias for the target org.",
169
+ "summary": "Username or alias of the target Salesforce org.",
83
170
  "required": true,
84
171
  "multiple": false
85
172
  },
@@ -87,7 +174,7 @@
87
174
  "name": "user",
88
175
  "type": "option",
89
176
  "char": "u",
90
- "summary": "The username of the user to create the trace flag for.",
177
+ "summary": "[default: targetusername] Username, Name, or ID of the user for whom you want to retrieve the logs.",
91
178
  "multiple": false
92
179
  },
93
180
  "time": {
package/package.json CHANGED
@@ -1,199 +1,202 @@
1
- {
2
- "name": "sf-debug-log",
3
- "description": "Manage Salesforce Debug Logs",
4
- "version": "0.0.21",
5
- "dependencies": {
6
- "@oclif/core": "^2.11.8",
7
- "@salesforce/core": "^5.2.0",
8
- "@salesforce/kit": "^3.0.8",
9
- "@salesforce/sf-plugins-core": "^3.1.14",
10
- "sanitize-filename": "^1.6.3",
11
- "tslib": "^2"
12
- },
13
- "devDependencies": {
14
- "@salesforce/cli-plugins-testkit": "^4.3.0",
15
- "@salesforce/dev-config": "^4.0.1",
16
- "@salesforce/dev-scripts": "^5.7.0",
17
- "@salesforce/prettier-config": "^0.0.3",
18
- "@salesforce/ts-sinon": "^1.4.14",
19
- "@swc/core": "^1.3.19",
20
- "@types/inquirer": "^9.0.3",
21
- "@typescript-eslint/eslint-plugin": "^5.59.8",
22
- "@typescript-eslint/parser": "^5.62.0",
23
- "chai": "^4.3.6",
24
- "eslint": "^8.47.0",
25
- "eslint-config-prettier": "^8.5.0",
26
- "eslint-config-salesforce": "^2.0.2",
27
- "eslint-config-salesforce-typescript": "^1.1.2",
28
- "eslint-plugin-import": "2.28.1",
29
- "eslint-plugin-jsdoc": "^46.4.6",
30
- "eslint-plugin-sf-plugin": "^1.16.2",
31
- "husky": "^8.0.0",
32
- "mocha": "^9.2.2",
33
- "nyc": "^15.1.0",
34
- "oclif": "^3.9.1",
35
- "prettier": "^2.8.8",
36
- "pretty-quick": "^3.1.3",
37
- "shx": "0.3.4",
38
- "sinon": "10.0.0",
39
- "ts-node": "^10.9.1",
40
- "typescript": "^5.1.6",
41
- "wireit": "^0.10.0"
42
- },
43
- "engines": {
44
- "node": ">=16.0.0"
45
- },
46
- "files": [
47
- "/lib",
48
- "/messages",
49
- "/oclif.manifest.json"
50
- ],
51
- "keywords": [
52
- "force",
53
- "salesforce",
54
- "sfdx",
55
- "salesforcedx",
56
- "sfdx-plugin",
57
- "sf-plugin",
58
- "sf"
59
- ],
60
- "license": "BSD-3-Clause",
61
- "main": "lib/index.js",
62
- "oclif": {
63
- "commands": "./lib/commands",
64
- "bin": "sf",
65
- "topicSeparator": " ",
66
- "devPlugins": [
67
- "@oclif/plugin-help"
68
- ],
69
- "topics": {
70
- "trace": {
71
- "description": "Manage Salesforce Trace Flags"
72
- },
73
- "debug": {
74
- "description": "Manage Salesforce Debug Logs"
75
- }
76
- }
77
- },
78
- "scripts": {
79
- "build": "wireit",
80
- "clean": "sf-clean",
81
- "clean-all": "sf-clean all",
82
- "clean:lib": "shx rm -rf lib && shx rm -rf coverage && shx rm -rf .nyc_output && shx rm -f oclif.manifest.json",
83
- "compile": "wireit",
84
- "docs": "sf-docs",
85
- "format": "wireit",
86
- "lint": "wireit",
87
- "postpack": "shx rm -f oclif.manifest.json",
88
- "prepack": "sf-prepack",
89
- "test": "wireit",
90
- "test:only": "wireit",
91
- "version": "oclif readme"
92
- },
93
- "publishConfig": {
94
- "access": "public"
95
- },
96
- "wireit": {
97
- "build": {
98
- "dependencies": [
99
- "compile",
100
- "lint"
101
- ]
102
- },
103
- "compile": {
104
- "command": "tsc -p . --pretty --incremental",
105
- "files": [
106
- "src/**/*.ts",
107
- "**/tsconfig.json",
108
- "messages/**"
109
- ],
110
- "output": [
111
- "lib/**",
112
- "*.tsbuildinfo"
113
- ],
114
- "clean": "if-file-deleted"
115
- },
116
- "format": {
117
- "command": "prettier --write \"+(src|test|schemas)/**/*.+(ts|js|json)|command-snapshot.json\"",
118
- "files": [
119
- "src/**/*.ts",
120
- "test/**/*.ts",
121
- "schemas/**/*.json",
122
- "command-snapshot.json",
123
- ".prettier*"
124
- ],
125
- "output": []
126
- },
127
- "lint": {
128
- "command": "eslint src test --color --cache --cache-location .eslintcache",
129
- "files": [
130
- "src/**/*.ts",
131
- "test/**/*.ts",
132
- "messages/**",
133
- "**/.eslint*",
134
- "**/tsconfig.json"
135
- ],
136
- "output": []
137
- },
138
- "test:compile": {
139
- "command": "tsc -p \"./test\" --pretty",
140
- "files": [
141
- "test/**/*.ts",
142
- "**/tsconfig.json"
143
- ],
144
- "output": []
145
- },
146
- "test": {
147
- "dependencies": [
148
- "test:compile",
149
- "test:only",
150
- "lint"
151
- ]
152
- },
153
- "test:only": {
154
- "command": "nyc mocha \"test/**/*.test.ts\"",
155
- "env": {
156
- "FORCE_COLOR": "2"
157
- },
158
- "files": [
159
- "test/**/*.ts",
160
- "src/**/*.ts",
161
- "**/tsconfig.json",
162
- ".mocha*",
163
- "!*.nut.ts",
164
- ".nycrc"
165
- ],
166
- "output": []
167
- },
168
- "test:command-reference": {
169
- "command": "\"./bin/dev\" commandreference:generate --erroronwarnings",
170
- "files": [
171
- "src/**/*.ts",
172
- "messages/**",
173
- "package.json"
174
- ],
175
- "output": [
176
- "tmp/root"
177
- ]
178
- },
179
- "test:deprecation-policy": {
180
- "command": "\"./bin/dev\" snapshot:compare",
181
- "files": [
182
- "src/**/*.ts"
183
- ],
184
- "output": [],
185
- "dependencies": [
186
- "compile"
187
- ]
188
- },
189
- "test:json-schema": {
190
- "command": "\"./bin/dev\" schema:compare",
191
- "files": [
192
- "src/**/*.ts",
193
- "schemas"
194
- ],
195
- "output": []
196
- }
197
- },
198
- "author": "Raffaele Preziosi"
199
- }
1
+ {
2
+ "name": "sf-debug-log",
3
+ "description": "Manage Salesforce Debug Logs",
4
+ "version": "0.0.23",
5
+ "dependencies": {
6
+ "@oclif/core": "^2.11.8",
7
+ "@salesforce/core": "^5.2.0",
8
+ "@salesforce/kit": "^3.0.8",
9
+ "@salesforce/sf-plugins-core": "^3.1.14",
10
+ "sanitize-filename": "^1.6.3",
11
+ "tslib": "^2"
12
+ },
13
+ "devDependencies": {
14
+ "@salesforce/cli-plugins-testkit": "^4.3.0",
15
+ "@salesforce/dev-config": "^4.0.1",
16
+ "@salesforce/dev-scripts": "^5.7.0",
17
+ "@salesforce/prettier-config": "^0.0.3",
18
+ "@salesforce/ts-sinon": "^1.4.14",
19
+ "@swc/core": "^1.3.19",
20
+ "@types/inquirer": "^9.0.3",
21
+ "@typescript-eslint/eslint-plugin": "^5.59.8",
22
+ "@typescript-eslint/parser": "^5.62.0",
23
+ "chai": "^4.3.6",
24
+ "eslint": "^8.47.0",
25
+ "eslint-config-prettier": "^8.5.0",
26
+ "eslint-config-salesforce": "^2.0.2",
27
+ "eslint-config-salesforce-typescript": "^1.1.2",
28
+ "eslint-plugin-import": "2.28.1",
29
+ "eslint-plugin-jsdoc": "^46.4.6",
30
+ "eslint-plugin-sf-plugin": "^1.16.2",
31
+ "husky": "^8.0.0",
32
+ "mocha": "^9.2.2",
33
+ "nyc": "^15.1.0",
34
+ "oclif": "^3.9.1",
35
+ "prettier": "^2.8.8",
36
+ "pretty-quick": "^3.1.3",
37
+ "shx": "0.3.4",
38
+ "sinon": "10.0.0",
39
+ "ts-node": "^10.9.1",
40
+ "typescript": "^5.1.6",
41
+ "wireit": "^0.10.0"
42
+ },
43
+ "engines": {
44
+ "node": ">=16.0.0"
45
+ },
46
+ "files": [
47
+ "/lib",
48
+ "/messages",
49
+ "/oclif.manifest.json"
50
+ ],
51
+ "keywords": [
52
+ "force",
53
+ "salesforce",
54
+ "sfdx",
55
+ "salesforcedx",
56
+ "sfdx-plugin",
57
+ "sf-plugin",
58
+ "sf"
59
+ ],
60
+ "license": "BSD-3-Clause",
61
+ "main": "lib/index.js",
62
+ "oclif": {
63
+ "commands": "./lib/commands",
64
+ "bin": "sf",
65
+ "topicSeparator": " ",
66
+ "devPlugins": [
67
+ "@oclif/plugin-help"
68
+ ],
69
+ "topics": {
70
+ "trace": {
71
+ "description": "Manage Salesforce Trace Flags"
72
+ },
73
+ "debug": {
74
+ "description": "Manage Salesforce Debug Logs"
75
+ },
76
+ "debuglevel": {
77
+ "description": "Manage Salesforce Debug Levels"
78
+ }
79
+ }
80
+ },
81
+ "scripts": {
82
+ "build": "wireit",
83
+ "clean": "sf-clean",
84
+ "clean-all": "sf-clean all",
85
+ "clean:lib": "shx rm -rf lib && shx rm -rf coverage && shx rm -rf .nyc_output && shx rm -f oclif.manifest.json",
86
+ "compile": "wireit",
87
+ "docs": "sf-docs",
88
+ "format": "wireit",
89
+ "lint": "wireit",
90
+ "postpack": "shx rm -f oclif.manifest.json",
91
+ "prepack": "sf-prepack",
92
+ "test": "wireit",
93
+ "test:only": "wireit",
94
+ "version": "oclif readme"
95
+ },
96
+ "publishConfig": {
97
+ "access": "public"
98
+ },
99
+ "wireit": {
100
+ "build": {
101
+ "dependencies": [
102
+ "compile",
103
+ "lint"
104
+ ]
105
+ },
106
+ "compile": {
107
+ "command": "tsc -p . --pretty --incremental",
108
+ "files": [
109
+ "src/**/*.ts",
110
+ "**/tsconfig.json",
111
+ "messages/**"
112
+ ],
113
+ "output": [
114
+ "lib/**",
115
+ "*.tsbuildinfo"
116
+ ],
117
+ "clean": "if-file-deleted"
118
+ },
119
+ "format": {
120
+ "command": "prettier --write \"+(src|test|schemas)/**/*.+(ts|js|json)|command-snapshot.json\"",
121
+ "files": [
122
+ "src/**/*.ts",
123
+ "test/**/*.ts",
124
+ "schemas/**/*.json",
125
+ "command-snapshot.json",
126
+ ".prettier*"
127
+ ],
128
+ "output": []
129
+ },
130
+ "lint": {
131
+ "command": "eslint src test --color --cache --cache-location .eslintcache",
132
+ "files": [
133
+ "src/**/*.ts",
134
+ "test/**/*.ts",
135
+ "messages/**",
136
+ "**/.eslint*",
137
+ "**/tsconfig.json"
138
+ ],
139
+ "output": []
140
+ },
141
+ "test:compile": {
142
+ "command": "tsc -p \"./test\" --pretty",
143
+ "files": [
144
+ "test/**/*.ts",
145
+ "**/tsconfig.json"
146
+ ],
147
+ "output": []
148
+ },
149
+ "test": {
150
+ "dependencies": [
151
+ "test:compile",
152
+ "test:only",
153
+ "lint"
154
+ ]
155
+ },
156
+ "test:only": {
157
+ "command": "nyc mocha \"test/**/*.test.ts\"",
158
+ "env": {
159
+ "FORCE_COLOR": "2"
160
+ },
161
+ "files": [
162
+ "test/**/*.ts",
163
+ "src/**/*.ts",
164
+ "**/tsconfig.json",
165
+ ".mocha*",
166
+ "!*.nut.ts",
167
+ ".nycrc"
168
+ ],
169
+ "output": []
170
+ },
171
+ "test:command-reference": {
172
+ "command": "\"./bin/dev\" commandreference:generate --erroronwarnings",
173
+ "files": [
174
+ "src/**/*.ts",
175
+ "messages/**",
176
+ "package.json"
177
+ ],
178
+ "output": [
179
+ "tmp/root"
180
+ ]
181
+ },
182
+ "test:deprecation-policy": {
183
+ "command": "\"./bin/dev\" snapshot:compare",
184
+ "files": [
185
+ "src/**/*.ts"
186
+ ],
187
+ "output": [],
188
+ "dependencies": [
189
+ "compile"
190
+ ]
191
+ },
192
+ "test:json-schema": {
193
+ "command": "\"./bin/dev\" schema:compare",
194
+ "files": [
195
+ "src/**/*.ts",
196
+ "schemas"
197
+ ],
198
+ "output": []
199
+ }
200
+ },
201
+ "author": "Raffaele Preziosi"
202
+ }