sf-debug-log 0.0.8 → 0.0.9

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,145 +1,62 @@
1
- # debug-log
1
+ # sf-debug-log
2
2
 
3
- [![NPM](https://img.shields.io/npm/v/debug-log.svg?label=debug-log)](https://www.npmjs.com/package/debug-log) [![Downloads/week](https://img.shields.io/npm/dw/debug-log.svg)](https://npmjs.org/package/debug-log) [![License](https://img.shields.io/badge/License-BSD%203--Clause-brightgreen.svg)](https://raw.githubusercontent.com/salesforcecli/debug-log/main/LICENSE.txt)
4
-
5
- ## Using the template
6
-
7
- This repository provides a template for creating a plugin for the Salesforce CLI. To convert this template to a working plugin:
8
-
9
- 1. Please get in touch with the Platform CLI team. We want to help you develop your plugin.
10
- 2. Generate your plugin:
11
-
12
- ```
13
- sf plugins install dev
14
- sf dev generate plugin
15
-
16
- git init -b main
17
- git add . && git commit -m "chore: initial commit"
18
- ```
19
-
20
- 3. Create your plugin's repo in the salesforcecli github org
21
- 4. When you're ready, replace the contents of this README with the information you want.
22
-
23
- ## Learn about `sf` plugins
24
-
25
- Salesforce CLI plugins are based on the [oclif plugin framework](<(https://oclif.io/docs/introduction.html)>). Read the [plugin developer guide](https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_plugins.meta/sfdx_cli_plugins/cli_plugins_architecture_sf_cli.htm) to learn about Salesforce CLI plugin development.
26
-
27
- This repository contains a lot of additional scripts and tools to help with general Salesforce node development and enforce coding standards. You should familiarize yourself with some of the [node developer packages](#tooling) used by Salesforce.
28
-
29
- Additionally, there are some additional tests that the Salesforce CLI will enforce if this plugin is ever bundled with the CLI. These test are included by default under the `posttest` script and it is required to keep these tests active in your plugin if you plan to have it bundled.
30
-
31
- ### Tooling
32
-
33
- - [@salesforce/core](https://github.com/forcedotcom/sfdx-core)
34
- - [@salesforce/kit](https://github.com/forcedotcom/kit)
35
- - [@salesforce/sf-plugins-core](https://github.com/salesforcecli/sf-plugins-core)
36
- - [@salesforce/ts-types](https://github.com/forcedotcom/ts-types)
37
- - [@salesforce/ts-sinon](https://github.com/forcedotcom/ts-sinon)
38
- - [@salesforce/dev-config](https://github.com/forcedotcom/dev-config)
39
- - [@salesforce/dev-scripts](https://github.com/forcedotcom/dev-scripts)
40
-
41
- ### Hooks
42
-
43
- For cross clouds commands, e.g. `sf env list`, we utilize [oclif hooks](https://oclif.io/docs/hooks) to get the relevant information from installed plugins.
44
-
45
- This plugin includes sample hooks in the [src/hooks directory](src/hooks). You'll just need to add the appropriate logic. You can also delete any of the hooks if they aren't required for your plugin.
46
-
47
- # Everything past here is only a suggestion as to what should be in your specific plugin's description
48
-
49
- This plugin is bundled with the [Salesforce CLI](https://developer.salesforce.com/tools/sfdxcli). For more information on the CLI, read the [getting started guide](https://developer.salesforce.com/docs/atlas.en-us.sfdx_setup.meta/sfdx_setup/sfdx_setup_intro.htm).
50
-
51
- We always recommend using the latest version of these commands bundled with the CLI, however, you can install a specific version or tag if needed.
3
+ Commands to manage Salesforce debug logs.
52
4
 
53
5
  ## Install
54
6
 
55
7
  ```bash
56
- sf plugins install debug-log@x.y.z
8
+ sf plugins install sf-debug-log
57
9
  ```
58
10
 
59
- ## Issues
60
-
61
- Please report any issues at https://github.com/forcedotcom/cli/issues
62
-
63
- ## Contributing
64
-
65
- 1. Please read our [Code of Conduct](CODE_OF_CONDUCT.md)
66
- 2. Create a new issue before starting your project so that we can keep track of
67
- what you are trying to add/fix. That way, we can also offer suggestions or
68
- let you know if there is already an effort in progress.
69
- 3. Fork this repository.
70
- 4. [Build the plugin locally](#build)
71
- 5. Create a _topic_ branch in your fork. Note, this step is recommended but technically not required if contributing using a fork.
72
- 6. Edit the code in your fork.
73
- 7. Write appropriate tests for your changes. Try to achieve at least 95% code coverage on any new code. No pull request will be accepted without unit tests.
74
- 8. Sign CLA (see [CLA](#cla) below).
75
- 9. Send us a pull request when you are done. We'll review your code, suggest any needed changes, and merge it in.
76
-
77
- ### CLA
11
+ ## Commands
78
12
 
79
- External contributors will be required to sign a Contributor's License
80
- Agreement. You can do so by going to https://cla.salesforce.com/sign-cla.
13
+ <!-- commands -->
81
14
 
82
- ### Build
15
+ - [`sf trace new`](#sf-trace-new)
16
+ - [`sf debug retrieve`](#sf-debug-retrieve)
83
17
 
84
- To build the plugin locally, make sure to have yarn installed and run the following commands:
18
+ ## `sf trace new`
85
19
 
86
- ```bash
87
- # Clone the repository
88
- git clone git@github.com:salesforcecli/debug-log
20
+ Create a new trace flag.
89
21
 
90
- # Install the dependencies and compile
91
- yarn && yarn build
92
22
  ```
23
+ USAGE
24
+ $ sf trace new
93
25
 
94
- To use your plugin, run using the local `./bin/dev` or `./bin/dev.cmd` file.
26
+ 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
+ -t, --time=<value> [default: 60] The number of minutes to trace.
95
30
 
96
- ```bash
97
- # Run using local run file.
98
- ./bin/dev hello world
99
- ```
31
+ GLOBAL FLAGS
32
+ --json Format output as json.
100
33
 
101
- There should be no differences when running via the Salesforce CLI or using the local run file. However, it can be useful to link the plugin to do some additional testing or run your commands from anywhere on your machine.
34
+ DESCRIPTION
35
+ Create a new trace flag.
102
36
 
103
- ```bash
104
- # Link your plugin to the sf cli
105
- sf plugins link .
106
- # To verify
107
- sf plugins
37
+ EXAMPLES
38
+ sf trace new -o DeveloperEdition -u "Raffaele Preziosi" -t 10
108
39
  ```
109
40
 
110
- ## Commands
111
-
112
- <!-- commands -->
113
-
114
- - [`sf hello world`](#sf-hello-world)
115
-
116
- ## `sf hello world`
41
+ ## `sf debug retrieve`
117
42
 
118
- Say hello either to the world or someone you know.
43
+ Retrieve apex log files.
119
44
 
120
45
  ```
121
46
  USAGE
122
- $ sf hello world [--json] [-n <value>]
47
+ $ sf debug retrieve
123
48
 
124
49
  FLAGS
125
- -n, --name=<value> [default: World] The name of the person you'd like to say hello to.
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.
126
53
 
127
54
  GLOBAL FLAGS
128
55
  --json Format output as json.
129
56
 
130
57
  DESCRIPTION
131
- Say hello either to the world or someone you know.
132
-
133
- Say hello either to the world or someone you know.
58
+ Retrieves apex log files from the Salesforce platform.
134
59
 
135
60
  EXAMPLES
136
- Say hello to the world:
137
-
138
- $ sf hello world
139
-
140
- Say hello to someone you know:
141
-
142
- $ sf hello world --name Astro
61
+ sf debug retrieve -o DeveloperEdition -u "Raffaele Preziosi" -t 10
143
62
  ```
144
-
145
- <!-- commandsstop -->
@@ -16,7 +16,7 @@ Username or alias to retrieve logs for.
16
16
 
17
17
  # flags.time.summary
18
18
 
19
- Start time for the logs to retrieve.
19
+ Minutes to retrieve logs for.
20
20
 
21
21
  # flags.folder.summary
22
22
 
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.0.8",
2
+ "version": "0.0.9",
3
3
  "commands": {
4
4
  "debug:retrieve": {
5
5
  "id": "debug:retrieve",
@@ -40,7 +40,7 @@
40
40
  "name": "time",
41
41
  "type": "option",
42
42
  "char": "t",
43
- "summary": "Start time for the logs to retrieve.",
43
+ "summary": "Minutes to retrieve logs for.",
44
44
  "multiple": false,
45
45
  "default": 60
46
46
  },
package/package.json CHANGED
@@ -1,199 +1,202 @@
1
- {
2
- "name": "sf-debug-log",
3
- "description": "Manage Salesforce Debug Logs",
4
- "version": "0.0.8",
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": "description for trace"
72
- },
73
- "debug": {
74
- "description": "description for debug"
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.9",
5
+ "dependencies": {
6
+ "@oclif/core": "^2.11.8",
7
+ "@salesforce/cli": "^2.13.9",
8
+ "@salesforce/core": "^5.2.0",
9
+ "@salesforce/kit": "^3.0.8",
10
+ "@salesforce/sf-plugins-core": "^3.1.14",
11
+ "sanitize-filename": "^1.6.3",
12
+ "tslib": "^2"
13
+ },
14
+ "devDependencies": {
15
+ "@salesforce/cli-plugins-testkit": "^4.3.0",
16
+ "@salesforce/dev-config": "^4.0.1",
17
+ "@salesforce/dev-scripts": "^5.7.0",
18
+ "@salesforce/prettier-config": "^0.0.3",
19
+ "@salesforce/ts-sinon": "^1.4.14",
20
+ "@swc/core": "^1.3.19",
21
+ "@types/inquirer": "^9.0.3",
22
+ "@typescript-eslint/eslint-plugin": "^5.59.8",
23
+ "@typescript-eslint/parser": "^5.62.0",
24
+ "chai": "^4.3.6",
25
+ "eslint": "^8.47.0",
26
+ "eslint-config-prettier": "^8.5.0",
27
+ "eslint-config-salesforce": "^2.0.2",
28
+ "eslint-config-salesforce-typescript": "^1.1.2",
29
+ "eslint-plugin-import": "2.28.1",
30
+ "eslint-plugin-jsdoc": "^46.4.6",
31
+ "eslint-plugin-sf-plugin": "^1.16.2",
32
+ "husky": "^8.0.0",
33
+ "mocha": "^9.2.2",
34
+ "nyc": "^15.1.0",
35
+ "oclif": "^3.9.1",
36
+ "prettier": "^2.8.8",
37
+ "pretty-quick": "^3.1.3",
38
+ "shx": "0.3.4",
39
+ "sinon": "10.0.0",
40
+ "ts-node": "^10.9.1",
41
+ "typescript": "^5.1.6",
42
+ "wireit": "^0.10.0"
43
+ },
44
+ "engines": {
45
+ "node": ">=16.0.0"
46
+ },
47
+ "files": [
48
+ "/lib",
49
+ "/messages",
50
+ "/oclif.manifest.json"
51
+ ],
52
+ "keywords": [
53
+ "force",
54
+ "salesforce",
55
+ "sfdx",
56
+ "salesforcedx",
57
+ "sfdx-plugin",
58
+ "sf-plugin",
59
+ "sf"
60
+ ],
61
+ "license": "BSD-3-Clause",
62
+ "main": "lib/index.js",
63
+ "oclif": {
64
+ "commands": "./lib/commands",
65
+ "bin": "sf",
66
+ "topicSeparator": " ",
67
+ "devPlugins": [
68
+ "@oclif/plugin-help"
69
+ ],
70
+ "topics": {
71
+ "trace": {
72
+ "description": "Manage Salesforce Trace Flags"
73
+ },
74
+ "debug": {
75
+ "description": "Manage Salesforce Debug Logs"
76
+ }
77
+ }
78
+ },
79
+ "scripts": {
80
+ "build": "wireit",
81
+ "clean": "sf-clean",
82
+ "clean-all": "sf-clean all",
83
+ "clean:lib": "shx rm -rf lib && shx rm -rf coverage && shx rm -rf .nyc_output && shx rm -f oclif.manifest.json",
84
+ "compile": "wireit",
85
+ "docs": "sf-docs",
86
+ "format": "wireit",
87
+ "lint": "wireit",
88
+ "postinstall": "yarn husky install",
89
+ "postpack": "shx rm -f oclif.manifest.json",
90
+ "prepack": "sf-prepack",
91
+ "test": "wireit",
92
+ "test:only": "wireit",
93
+ "version": "oclif readme",
94
+ "prepare": "husky install"
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
+ }