@simplysf/simply-apex 1.0.3 → 1.1.1
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 +172 -0
- package/package.json +16 -12
package/README.md
ADDED
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
# @simplysf/simply-apex
|
|
2
|
+
|
|
3
|
+
[](https://npmjs.com/@simplysf/simply-apex) [](https://npmjs.com/@simplysf/simply-apex) [](https://raw.githubusercontent.com/SimplySF/simply/main/LICENSE.txt)
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
sf plugins install @simplysf/simply-apex
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Issues
|
|
12
|
+
|
|
13
|
+
Please report any issues at https://github.com/SimplySF/simply/issues
|
|
14
|
+
|
|
15
|
+
## Contributing
|
|
16
|
+
|
|
17
|
+
This package is part of the [`@simplysf/simply`](https://github.com/SimplySF/simply) monorepo. See the repo's [CONTRIBUTING.md](https://github.com/SimplySF/simply/blob/main/CONTRIBUTING.md) for the repo structure, how to set up and build the project, our commit conventions, and how to submit a pull request. Please also read our [Code of Conduct](https://github.com/SimplySF/simply/blob/main/CODE_OF_CONDUCT.md).
|
|
18
|
+
|
|
19
|
+
## Commands
|
|
20
|
+
|
|
21
|
+
<!-- commands -->
|
|
22
|
+
|
|
23
|
+
- [`sf simply apex execute`](#sf-simply-apex-execute)
|
|
24
|
+
- [`sf simply apex logs purge`](#sf-simply-apex-logs-purge)
|
|
25
|
+
- [`sf simply apex trace setup`](#sf-simply-apex-trace-setup)
|
|
26
|
+
- [`sf simply apex trace silence`](#sf-simply-apex-trace-silence)
|
|
27
|
+
|
|
28
|
+
## `sf simply apex execute`
|
|
29
|
+
|
|
30
|
+
Execute anonymous Apex code.
|
|
31
|
+
|
|
32
|
+
```
|
|
33
|
+
USAGE
|
|
34
|
+
$ sf simply apex execute -f <value> -o <value> [--json] [--flags-dir <value>] [--api-version <value>]
|
|
35
|
+
|
|
36
|
+
FLAGS
|
|
37
|
+
-f, --file=<value> (required) Path to Apex file
|
|
38
|
+
-o, --target-org=<value> (required) Username or alias of the target org. Not required if the `target-org`
|
|
39
|
+
configuration variable is already set.
|
|
40
|
+
--api-version=<value> Override the api version used for api requests made by this command
|
|
41
|
+
|
|
42
|
+
GLOBAL FLAGS
|
|
43
|
+
--flags-dir=<value> Import flag values from a directory.
|
|
44
|
+
--json Format output as json.
|
|
45
|
+
|
|
46
|
+
DESCRIPTION
|
|
47
|
+
Execute anonymous Apex code.
|
|
48
|
+
|
|
49
|
+
Executes an anonymous block of Apex code from a local .apex file against a target org and reports the compile and
|
|
50
|
+
execution results, including any debug logs produced.
|
|
51
|
+
|
|
52
|
+
EXAMPLES
|
|
53
|
+
$ sf simply apex execute --target-org myOrg --file scripts/apex/data-fix.apex
|
|
54
|
+
|
|
55
|
+
FLAG DESCRIPTIONS
|
|
56
|
+
-f, --file=<value> Path to Apex file
|
|
57
|
+
|
|
58
|
+
The path to the local .apex file containing the anonymous Apex code to execute.
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
_See code: [lib/commands/simply/apex/execute.js](https://github.com/SimplySF/simply/blob/@simplysf/simply-apex@1.0.3/packages/simply-apex/lib/commands/simply/apex/execute.js)_
|
|
62
|
+
|
|
63
|
+
## `sf simply apex logs purge`
|
|
64
|
+
|
|
65
|
+
Purge Apex debug logs.
|
|
66
|
+
|
|
67
|
+
```
|
|
68
|
+
USAGE
|
|
69
|
+
$ sf simply apex logs purge -o <value> [--json] [--flags-dir <value>] [--api-version <value>] [-w <value>]
|
|
70
|
+
|
|
71
|
+
FLAGS
|
|
72
|
+
-o, --target-org=<value> (required) Username or alias of the target org. Not required if the `target-org`
|
|
73
|
+
configuration variable is already set.
|
|
74
|
+
-w, --where=<value> SOQL WHERE clause
|
|
75
|
+
--api-version=<value> Override the api version used for api requests made by this command
|
|
76
|
+
|
|
77
|
+
GLOBAL FLAGS
|
|
78
|
+
--flags-dir=<value> Import flag values from a directory.
|
|
79
|
+
--json Format output as json.
|
|
80
|
+
|
|
81
|
+
DESCRIPTION
|
|
82
|
+
Purge Apex debug logs.
|
|
83
|
+
|
|
84
|
+
Deletes ApexLog records from the target org. By default all logs are purged; use --where to scope the deletion to a
|
|
85
|
+
subset of logs.
|
|
86
|
+
|
|
87
|
+
EXAMPLES
|
|
88
|
+
$ sf simply apex logs purge --target-org myOrg
|
|
89
|
+
|
|
90
|
+
$ sf simply apex logs purge --target-org myOrg --where "Status = 'Success'"
|
|
91
|
+
|
|
92
|
+
FLAG DESCRIPTIONS
|
|
93
|
+
-w, --where=<value> SOQL WHERE clause
|
|
94
|
+
|
|
95
|
+
A WHERE clause used to filter which ApexLog records are purged (e.g. "Status = 'Success'").
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
_See code: [lib/commands/simply/apex/logs/purge.js](https://github.com/SimplySF/simply/blob/@simplysf/simply-apex@1.0.3/packages/simply-apex/lib/commands/simply/apex/logs/purge.js)_
|
|
99
|
+
|
|
100
|
+
## `sf simply apex trace setup`
|
|
101
|
+
|
|
102
|
+
Configure a debug log trace flag for the current user.
|
|
103
|
+
|
|
104
|
+
```
|
|
105
|
+
USAGE
|
|
106
|
+
$ sf simply apex trace setup -o <value> [--json] [--flags-dir <value>] [--api-version <value>]
|
|
107
|
+
|
|
108
|
+
FLAGS
|
|
109
|
+
-o, --target-org=<value> (required) Username or alias of the target org. Not required if the `target-org`
|
|
110
|
+
configuration variable is already set.
|
|
111
|
+
--api-version=<value> Override the api version used for api requests made by this command
|
|
112
|
+
|
|
113
|
+
GLOBAL FLAGS
|
|
114
|
+
--flags-dir=<value> Import flag values from a directory.
|
|
115
|
+
--json Format output as json.
|
|
116
|
+
|
|
117
|
+
DESCRIPTION
|
|
118
|
+
Configure a debug log trace flag for the current user.
|
|
119
|
+
|
|
120
|
+
Creates or updates a 24-hour DEVELOPER_LOG trace flag for the user running the command, using a FINEST/FINER debug
|
|
121
|
+
level suitable for the Apex Replay Debugger.
|
|
122
|
+
|
|
123
|
+
EXAMPLES
|
|
124
|
+
$ sf simply apex trace setup --target-org myOrg
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
_See code: [lib/commands/simply/apex/trace/setup.js](https://github.com/SimplySF/simply/blob/@simplysf/simply-apex@1.0.3/packages/simply-apex/lib/commands/simply/apex/trace/setup.js)_
|
|
128
|
+
|
|
129
|
+
## `sf simply apex trace silence`
|
|
130
|
+
|
|
131
|
+
Silence debug logs for specific Apex classes.
|
|
132
|
+
|
|
133
|
+
```
|
|
134
|
+
USAGE
|
|
135
|
+
$ sf simply apex trace silence -o <value> [--json] [--flags-dir <value>] [--api-version <value>] [-c <value> | --classes-file
|
|
136
|
+
<value>]
|
|
137
|
+
|
|
138
|
+
FLAGS
|
|
139
|
+
-c, --classes=<value> Comma-separated Apex class names
|
|
140
|
+
-o, --target-org=<value> (required) Username or alias of the target org. Not required if the `target-org`
|
|
141
|
+
configuration variable is already set.
|
|
142
|
+
--api-version=<value> Override the api version used for api requests made by this command
|
|
143
|
+
--classes-file=<value> Path to a JSON file listing classes to silence
|
|
144
|
+
|
|
145
|
+
GLOBAL FLAGS
|
|
146
|
+
--flags-dir=<value> Import flag values from a directory.
|
|
147
|
+
--json Format output as json.
|
|
148
|
+
|
|
149
|
+
DESCRIPTION
|
|
150
|
+
Silence debug logs for specific Apex classes.
|
|
151
|
+
|
|
152
|
+
Creates a 24-hour CLASS_TRACING trace flag with a fully suppressed (NONE) debug level for each specified Apex class,
|
|
153
|
+
preventing those classes from generating debug log output.
|
|
154
|
+
|
|
155
|
+
EXAMPLES
|
|
156
|
+
$ sf simply apex trace silence --target-org myOrg --classes NoisyClass,ChattyTrigger
|
|
157
|
+
|
|
158
|
+
$ sf simply apex trace silence --target-org myOrg --classes-file classesToSilence.json
|
|
159
|
+
|
|
160
|
+
FLAG DESCRIPTIONS
|
|
161
|
+
-c, --classes=<value> Comma-separated Apex class names
|
|
162
|
+
|
|
163
|
+
A comma-separated list of Apex class names to silence.
|
|
164
|
+
|
|
165
|
+
--classes-file=<value> Path to a JSON file listing classes to silence
|
|
166
|
+
|
|
167
|
+
The path to a JSON file with the shape { "classes": ["ClassOne", "ClassTwo"] } listing the Apex class names to
|
|
168
|
+
silence.
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
_See code: [lib/commands/simply/apex/trace/silence.js](https://github.com/SimplySF/simply/blob/@simplysf/simply-apex@1.0.3/packages/simply-apex/lib/commands/simply/apex/trace/silence.js)_
|
|
172
|
+
<!-- commandsstop -->
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@simplysf/simply-apex",
|
|
3
3
|
"description": "Utilities for working with Apex",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.1.1",
|
|
5
5
|
"author": "@ClayChipps",
|
|
6
6
|
"homepage": "https://github.com/SimplySF/simply",
|
|
7
7
|
"bugs": "https://github.com/SimplySF/simply/issues",
|
|
@@ -73,7 +73,9 @@
|
|
|
73
73
|
},
|
|
74
74
|
"devDependencies": {
|
|
75
75
|
"@oclif/plugin-command-snapshot": "^5.3.19",
|
|
76
|
-
"@salesforce/plugin-command-reference": "^3.1.99"
|
|
76
|
+
"@salesforce/plugin-command-reference": "^3.1.99",
|
|
77
|
+
"@vitest/coverage-v8": "^4.1.10",
|
|
78
|
+
"vitest": "^4.1.10"
|
|
77
79
|
},
|
|
78
80
|
"publishConfig": {
|
|
79
81
|
"access": "public"
|
|
@@ -87,13 +89,15 @@
|
|
|
87
89
|
"lint": "wireit",
|
|
88
90
|
"readme": "oclif readme --no-aliases",
|
|
89
91
|
"test": "wireit",
|
|
92
|
+
"test:coverage": "vitest run --coverage",
|
|
90
93
|
"test:nuts": "nyc mocha \"**/*.nut.ts\" --slow 4500 --timeout 1200000 --parallel --jobs 5",
|
|
91
94
|
"test:only": "wireit",
|
|
92
|
-
"test:watch": "
|
|
95
|
+
"test:watch": "vitest watch"
|
|
93
96
|
},
|
|
94
97
|
"wireit": {
|
|
95
98
|
"build": {
|
|
96
99
|
"dependencies": [
|
|
100
|
+
"command-snapshot",
|
|
97
101
|
"compile",
|
|
98
102
|
"lint"
|
|
99
103
|
]
|
|
@@ -138,7 +142,6 @@
|
|
|
138
142
|
"test:compile",
|
|
139
143
|
"test:only",
|
|
140
144
|
"test:command-reference",
|
|
141
|
-
"test:deprecation-policy",
|
|
142
145
|
"lint",
|
|
143
146
|
"test:json-schema",
|
|
144
147
|
"link-check"
|
|
@@ -155,12 +158,14 @@
|
|
|
155
158
|
"tmp/root"
|
|
156
159
|
]
|
|
157
160
|
},
|
|
158
|
-
"
|
|
159
|
-
"command": "node --loader ts-node/esm --no-warnings=ExperimentalWarning \"./bin/dev.js\" snapshot:
|
|
161
|
+
"command-snapshot": {
|
|
162
|
+
"command": "node --loader ts-node/esm --no-warnings=ExperimentalWarning \"./bin/dev.js\" snapshot:generate && prettier --write command-snapshot.json",
|
|
160
163
|
"files": [
|
|
161
164
|
"src/**/*.ts"
|
|
162
165
|
],
|
|
163
|
-
"output": [
|
|
166
|
+
"output": [
|
|
167
|
+
"command-snapshot.json"
|
|
168
|
+
],
|
|
164
169
|
"dependencies": [
|
|
165
170
|
"compile"
|
|
166
171
|
]
|
|
@@ -182,7 +187,7 @@
|
|
|
182
187
|
"output": []
|
|
183
188
|
},
|
|
184
189
|
"test:only": {
|
|
185
|
-
"command": "
|
|
190
|
+
"command": "vitest run",
|
|
186
191
|
"env": {
|
|
187
192
|
"FORCE_COLOR": "2"
|
|
188
193
|
},
|
|
@@ -190,9 +195,8 @@
|
|
|
190
195
|
"test/**/*.ts",
|
|
191
196
|
"src/**/*.ts",
|
|
192
197
|
"**/tsconfig.json",
|
|
193
|
-
".
|
|
194
|
-
"!*.nut.ts"
|
|
195
|
-
".nycrc"
|
|
198
|
+
"vitest.config.ts",
|
|
199
|
+
"!*.nut.ts"
|
|
196
200
|
],
|
|
197
201
|
"output": []
|
|
198
202
|
},
|
|
@@ -206,5 +210,5 @@
|
|
|
206
210
|
"output": []
|
|
207
211
|
}
|
|
208
212
|
},
|
|
209
|
-
"gitHead": "
|
|
213
|
+
"gitHead": "723fbef6eeeda978ccdacd5c3ae6cab521c83c49"
|
|
210
214
|
}
|