@jetstreamapp/soql-parser-js 7.4.1 → 8.0.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/CHANGELOG.md +117 -186
- package/README.md +83 -46
- package/dist/cjs/index.js +4 -24
- package/dist/cli/index.js +9 -27
- package/dist/esm/index.mjs +4 -24
- package/dist/lwc/soqlParserJs.js +4 -24
- package/dist/types/composer/composer.d.ts +2 -3
- package/dist/types/composer/leaf.d.ts +38 -0
- package/dist/types/composer/plain.d.ts +3 -0
- package/dist/types/formatter/formatter.d.ts +25 -32
- package/package.json +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,48 +1,79 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## [Unreleased]
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
## [8.0.0] - 2026-08-16
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
This is a major release. The composed and formatted output changes in the cases listed under Bug Fixes, and the internals of the formatter were rewritten. `composeQuery`, `formatQuery`, `parseQuery` and the `FormatOptions` type are source compatible - see Breaking Changes for the two exceptions.
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
### Breaking Changes
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
- **The `Formatter` class has an entirely new shape.** It is not exported from the package root, but it is reachable as the type of `Compose.formatter`, so it appears in the emitted type declarations. Its constructor is now `new Formatter(options?: FormatOptions)` (previously `new Formatter(enabled: boolean, options: FormatOptions)`), and the previous methods (`formatFields`, `formatSubquery`, `formatClause`, `formatText`, `formatOrderByArray`, `formatParens`, and the rest) along with the `FieldData` interface no longer exist. Code that only uses `composeQuery`, `formatQuery`, or the documented `Compose.parse*` methods is unaffected.
|
|
14
|
+
- **`Compose.parseWhereOrHavingClause` lost its third parameter.** The signature is now `parseWhereOrHavingClause(whereOrHaving, indent = 0)`. The removed `priorConditionIsNegation` parameter was only ever used internally. The second parameter also changed meaning: it was `tabOffset` (a number of tabs) and is now `indent` (an indentation level, only used when formatting), so a caller passing a number other than `0` will get different output.
|
|
15
|
+
- **`SELECT`, `GROUP BY` and `ORDER BY` items now all wrap using one shared rule.** Two things changed. `fieldMaxLineLength` previously ignored the `", "` separators when wrapping `ORDER BY` items, so those lines ran a few characters longer than the same setting produced for `SELECT`. Separately, a wrapped item's own width was discarded when starting a new row, so every continuation row began with an empty budget and overran `fieldMaxLineLength` by the width of its first item. All three clauses now count separators, and a wrapped item carries its own width onto the new row, so a row never exceeds `fieldMaxLineLength` unless a single item is longer than the whole budget. **This changes `SELECT` field wrapping at the default `fieldMaxLineLength` of 60**, not only at unusual values — continuation rows are now slightly shorter. Expect diffs if you commit formatted SOQL to source control.
|
|
16
|
+
- **`FormatOptions.logging` is deprecated and ignored.** The rewritten formatter has no per-field intermediate state to log. The option remains in the type for source compatibility and will be removed in a future version. `SoqlComposeConfig.logging` (the `Compose`-level option) still works, but now logs only the final composed query instead of emitting a line after each clause as it was built.
|
|
14
17
|
|
|
15
|
-
|
|
18
|
+
### Features
|
|
19
|
+
|
|
20
|
+
- **Added `indentString` format option** — Controls the string used for one unit of indentation (default `'\t'`). Combined with `numIndent`, this allows indenting with spaces, e.g. `formatQuery(soql, { indentString: ' ', numIndent: 2 })` indents each level with two spaces. The CLI `format` and `compose --format` commands accept the equivalent `-t, --indent-string <string>` flag.
|
|
21
|
+
|
|
22
|
+
### Bug Fixes
|
|
23
|
+
|
|
24
|
+
- **`numIndent` is now honored everywhere** — With `numIndent` greater than 1, subquery bodies and closing parens (in both the SELECT and WHERE clauses), TYPEOF fields, and ORDER BY continuation lines were indented by a hard-coded single tab, producing misaligned output. Every line is now indented consistently. (Completes the fix started in #272)
|
|
25
|
+
- **No more blank or whitespace-only lines with `newLineAfterKeywords`** — A blank line containing a tab was emitted when the first SELECT field was a subquery or TYPEOF, and a whitespace-only line was emitted after `WITH SECURITY_ENFORCED` / `WITH USER_MODE` / `WITH SYSTEM_MODE` when another clause followed.
|
|
26
|
+
- **Subqueries inside parenthesized WHERE conditions are indented relative to their condition** — e.g. `WHERE (Name = 'a' OR Id IN (SELECT ...))` previously rendered the subquery at the same level as the condition and its closing paren one level too far to the left.
|
|
27
|
+
- **`GROUP BY` items now wrap like `ORDER BY` items** — at `fieldMaxLineLength`, or one per line when `newLineAfterKeywords` is true. Previously the GROUP BY clause was always emitted on a single line.
|
|
28
|
+
- **Negations inside parenthesized groups are indented correctly** — Conditions such as `WHERE ((NOT A > 0) AND B < 2)`, `WHERE (NOT A = 'a' AND B = '1')`, or `WHERE NOT ((NOT (x)) AND y)` emitted lines at column 0 inside an indented group. `(NOT <condition>)` is kept inline as a single unit; every other paren group is now consistently indented with its closing paren on its own line.
|
|
29
|
+
- **An empty `groupBy` array no longer emits a dangling `GROUP BY`** — `composeQuery({ ..., groupBy: [] })` produced `SELECT Id FROM Account GROUP BY`, which Salesforce rejects. Empty `groupBy` arrays are now skipped, matching how empty `orderBy` arrays were already handled.
|
|
30
|
+
- **A non-whitespace `indentString` is ignored instead of producing invalid SOQL** — `formatQuery(soql, { indentString: 'XX' })` emitted `XX` into the query itself. Values that are not made up of spaces and/or tabs now fall back to the default tab.
|
|
31
|
+
- **`composeQuery` no longer mutates the provided query** — Composing the same parsed query twice previously corrupted the `sObjectPrefix` of subqueries (e.g. `Account.Contacts` became `Account.Contacts.Contacts` on the second call).
|
|
32
|
+
- **`WITH SECURITY_ENFORCED`, `WITH USER_MODE` / `WITH SYSTEM_MODE`, and `WITH DATA CATEGORY` are now composed in the correct position** — Between the `WHERE` and `GROUP BY` clauses, as required by SOQL. Previously they were emitted after `LIMIT` / `OFFSET`, which produced invalid SOQL when combined with `GROUP BY`, `ORDER BY`, `LIMIT`, or `OFFSET`. This applies to both `composeQuery` and `formatQuery`.
|
|
33
|
+
|
|
34
|
+
### Changed
|
|
35
|
+
|
|
36
|
+
- Changelog now follows the [Keep a Changelog](https://keepachangelog.com/) format — entries are added to the Unreleased section and stamped with a version and date automatically at release time, and GitHub release notes are generated from that content
|
|
37
|
+
|
|
38
|
+
### Internal
|
|
39
|
+
|
|
40
|
+
- **The formatter was rewritten** as a line-based printer that tracks indentation explicitly (`src/formatter/formatter.ts`), with the single-line composer (`src/composer/plain.ts`) and the formatter sharing the same leaf renderers (`src/composer/leaf.ts`). Apart from the wrapping and layout changes listed under Bug Fixes and Breaking Changes — which include a change to `SELECT` field wrapping at the default `fieldMaxLineLength` — previous formatted output is unchanged.
|
|
41
|
+
- **Clause order lives in one place.** `queryClauses()` in `src/composer/leaf.ts` yields the clauses of a query in the order SOQL requires, and both the plain composer and the formatter walk that sequence - they only decide layout. Previously each maintained its own copy of the clause ordering and presence checks, which is what allowed the `WITH SECURITY_ENFORCED` positioning bug above. Supporting a new clause is now a single edit.
|
|
42
|
+
- Added a format round-trip test suite that asserts every formatted query is valid, idempotent, parses to the same AST as the input, and contains no whitespace-only lines or trailing whitespace, across a representative matrix of format options.
|
|
43
|
+
|
|
44
|
+
## [7.4.1] - 2026-08-06
|
|
45
|
+
|
|
46
|
+
### Changed
|
|
47
|
+
|
|
48
|
+
- Updated devDependencies to latest versions (prettier, release-it, tsx, vitest) and docs site dependencies (Docusaurus 3.10.2, React 19.2.8, TypeScript 6) — no changes to the published library
|
|
49
|
+
|
|
50
|
+
### Removed
|
|
51
|
+
|
|
52
|
+
- Removed the docs deployment from the release pipeline — documentation at https://soql-parser-js.getjetstream.app is now built and hosted by Cloudflare Pages
|
|
53
|
+
|
|
54
|
+
## [7.4.0] - 2026-07-16
|
|
16
55
|
|
|
17
56
|
### Features
|
|
18
57
|
|
|
19
58
|
- **Added comment utilities: `stripComments`, `hasComments`, and `getComments`** — These operate on the raw query string without parsing it, so they work on any input (including invalid SOQL) and never throw. `stripComments` removes comments without otherwise modifying the query — no reformatting, no whitespace or keyword normalization — making it safe for proxying user-authored queries to the Salesforce API, which does not accept comments. When the query contains no comments, the original string is returned as-is, so it can be called unconditionally. A single space is inserted where removing a comment would otherwise merge adjacent tokens (`SELECT Id/*c*/FROM Account` → `SELECT Id FROM Account`). Comment markers inside string literals are treated as literal text, and an unterminated `/*` is stripped through the end of the input rather than throwing. `hasComments` returns whether a query contains any comments, and `getComments` returns each comment's type (`line` | `block`), text, and position.
|
|
20
59
|
|
|
21
|
-
## 7.3.0
|
|
22
|
-
|
|
23
|
-
Jul 16, 2026
|
|
60
|
+
## [7.3.0] - 2026-07-16
|
|
24
61
|
|
|
25
62
|
### Features
|
|
26
63
|
|
|
27
64
|
- **Added support for line-level and block-level comments** — Queries may now contain comments, which are ignored during parsing: `//` runs to the end of the line and `/* ... */` may span multiple lines (non-nesting; an unterminated `/*` throws `Unterminated comment at position N`). Comment markers inside string literals (e.g. `WHERE Url = 'https://example.com'`) are treated as literal text. Comments are not represented in the parsed `Query`, so they are not preserved by `composeQuery`/`formatQuery`. Applies to all entry points (`parseQuery`, `isQueryValid`, partial parsing, and the CLI). Note that Salesforce itself does not accept comments in SOQL, so compose the parsed query before sending it to the Salesforce API.
|
|
28
65
|
|
|
29
|
-
## 7.2.2
|
|
30
|
-
|
|
31
|
-
Jun 9, 2026
|
|
66
|
+
## [7.2.2] - 2026-06-09
|
|
32
67
|
|
|
33
68
|
- Updated dependencies to resolve security vulnerabilities
|
|
34
69
|
|
|
35
|
-
## 7.2.1
|
|
36
|
-
|
|
37
|
-
Jun 8, 2026
|
|
70
|
+
## [7.2.1] - 2026-06-08
|
|
38
71
|
|
|
39
72
|
### Bug Fixes
|
|
40
73
|
|
|
41
74
|
- **Escape single quotes and lone backslashes in composed `STRING` values** — `composeQuery` previously wrapped `STRING` literal values in single quotes without escaping their contents, so a value like `med'ia` produced invalid SOQL (`Industry = 'med'ia'`). String values are now escaped before being wrapped: bare single quotes become `\'` and lone backslashes become `\\`. Backslash sequences that are already valid SOQL escapes (`\n`, `\r`, `\t`, `\b`, `\f`, `\"`, `\'`, `\\`, `\_`, `\%`, `\uXXXX`, including their uppercase variants) are left unchanged so callers can pre-escape values themselves. Values that are already wrapped in single quotes (e.g. round-tripped through `parseQuery`) are passed through unchanged.
|
|
42
75
|
|
|
43
|
-
## 7.2.0
|
|
44
|
-
|
|
45
|
-
May 11, 2026
|
|
76
|
+
## [7.2.0] - 2026-05-11
|
|
46
77
|
|
|
47
78
|
### LWC Distribution
|
|
48
79
|
|
|
@@ -59,15 +90,11 @@ The LWC build now produces two artifacts to support different deployment workflo
|
|
|
59
90
|
- **npm tarball attached to GitHub Releases** — every release now attaches `jetstreamapp-soql-parser-js-<version>.tgz`.
|
|
60
91
|
- **Version banner on all bundles** — `esm`, `cjs`, `cli`, and `lwc` bundles all start with a `/*! ... */` header listing the package name, version, repository URL, and license. Banner values are sourced from `package.json`, so they stay in sync automatically with each release.
|
|
61
92
|
|
|
62
|
-
## 7.1.1
|
|
63
|
-
|
|
64
|
-
Apr 25, 2026
|
|
93
|
+
## [7.1.1] - 2026-04-25
|
|
65
94
|
|
|
66
95
|
- Upgrade dependencies
|
|
67
96
|
|
|
68
|
-
## 7.1.0
|
|
69
|
-
|
|
70
|
-
Mar 21, 2026
|
|
97
|
+
## [7.1.0] - 2026-03-21
|
|
71
98
|
|
|
72
99
|
### Bug Fixes
|
|
73
100
|
|
|
@@ -79,9 +106,7 @@ Mar 21, 2026
|
|
|
79
106
|
|
|
80
107
|
- Removed singleton parser pattern — `parseQuery` now creates a fresh parser instance per call, eliminating shared mutable state and making the parser safe for concurrent use in worker threads.
|
|
81
108
|
|
|
82
|
-
## 7.0.0
|
|
83
|
-
|
|
84
|
-
Mar 14, 2026
|
|
109
|
+
## [7.0.0] - 2026-03-14
|
|
85
110
|
|
|
86
111
|
🚀🚀🚀🚀🚀 Performed a complete re-write using a hand-rolled parser, complements of Claude Code which did 100% of the work.
|
|
87
112
|
|
|
@@ -105,65 +130,45 @@ This is very unlikely to impact most users, and if it does, the required changes
|
|
|
105
130
|
export type { CstNode, CstParser, ILexingError, IRecognitionException } from 'chevrotain';
|
|
106
131
|
```
|
|
107
132
|
|
|
108
|
-
## 6.3.1
|
|
109
|
-
|
|
110
|
-
Dec 15, 2025
|
|
133
|
+
## [6.3.1] - 2025-12-15
|
|
111
134
|
|
|
112
135
|
- Fix indent for query format
|
|
113
136
|
|
|
114
|
-
## 6.3.0
|
|
115
|
-
|
|
116
|
-
Nov 27, 2025
|
|
137
|
+
## [6.3.0] - 2025-11-27
|
|
117
138
|
|
|
118
139
|
- Add support for `mru` in `USING SCOPE`. (#268)
|
|
119
140
|
- Thank you @jimmyhogerty
|
|
120
141
|
|
|
121
|
-
## 6.2.4
|
|
122
|
-
|
|
123
|
-
Aug 18, 2025
|
|
142
|
+
## [6.2.4] - 2025-08-18
|
|
124
143
|
|
|
125
144
|
- Ensure all types are emitted during the build process (#266)
|
|
126
145
|
- Some types were missing from the build process which caused build errors for some typescript users
|
|
127
146
|
|
|
128
|
-
## 6.2.2 / 6.2.3
|
|
129
|
-
|
|
130
|
-
July 8, 2025
|
|
147
|
+
## [6.2.2] / [6.2.3] - 2025-07-08
|
|
131
148
|
|
|
132
149
|
- Ensure types are referenced in exports. (#263)
|
|
133
150
|
|
|
134
|
-
## 6.2.1
|
|
135
|
-
|
|
136
|
-
July 7, 2025
|
|
151
|
+
## [6.2.1] - 2025-07-07
|
|
137
152
|
|
|
138
153
|
- Updated build scripts to ensure esm build works correctly. (#259)
|
|
139
154
|
|
|
140
|
-
## 6.2.0
|
|
141
|
-
|
|
142
|
-
May 8, 2025
|
|
155
|
+
## [6.2.0] - 2025-05-08
|
|
143
156
|
|
|
144
157
|
- Updated build tooling and dependencies, no externally facing changes.
|
|
145
158
|
|
|
146
|
-
## 6.1.0
|
|
147
|
-
|
|
148
|
-
June 16, 2024
|
|
159
|
+
## [6.1.0] - 2024-06-16
|
|
149
160
|
|
|
150
161
|
- Add support for [negative currency values](https://help.salesforce.com/s/articleView?id=release-notes.rn_api_soql.htm&release=250&type=5) (#244)
|
|
151
162
|
|
|
152
|
-
## 6.0.0
|
|
153
|
-
|
|
154
|
-
June 16, 2024
|
|
163
|
+
## [6.0.0] - 2024-06-16
|
|
155
164
|
|
|
156
165
|
- Package has been moved to `@jetstreamapp` npm organization
|
|
157
166
|
|
|
158
|
-
## 5.0.2
|
|
159
|
-
|
|
160
|
-
Jan 18, 2024
|
|
167
|
+
## [5.0.2] - 2024-01-18
|
|
161
168
|
|
|
162
169
|
- Nested NOT negation WHERE clauses were not properly formed (#242)
|
|
163
170
|
|
|
164
|
-
## 5.0.1
|
|
165
|
-
|
|
166
|
-
Jan 13, 2024
|
|
171
|
+
## [5.0.1] - 2024-01-13
|
|
167
172
|
|
|
168
173
|
💥 Breaking Changes
|
|
169
174
|
Fixed a bug where with typescript types to properly represent that `WhereClause` can have a null value for `left` in the case of a negation operator.
|
|
@@ -171,69 +176,51 @@ This was always the case, but prior to enabling strict typescript types, this we
|
|
|
171
176
|
|
|
172
177
|
For Typescript consumers that have strict null checks enabled, they may need to make code changes depending on usage.
|
|
173
178
|
|
|
174
|
-
## 5.0.0
|
|
179
|
+
## [5.0.0]
|
|
175
180
|
|
|
176
181
|
💥 Did not publish correct assets - package was marked as deprecated on npm.
|
|
177
182
|
|
|
178
|
-
## 4.10.1
|
|
179
|
-
|
|
180
|
-
Jan 13, 2024
|
|
183
|
+
## [4.10.1] - 2024-01-13
|
|
181
184
|
|
|
182
185
|
Revert accidental breaking change to types. `WhereClause` left can have `null` in the negation case, but the types did not represent this.
|
|
183
186
|
Updating types to match reality is a breaking change for consumers, so worked around issue and will publish version 5 with breaking change.
|
|
184
187
|
|
|
185
|
-
## 4.10.0
|
|
188
|
+
## [4.10.0] - 2024-01-13
|
|
186
189
|
|
|
187
190
|
💥 Use 4.10.1, this version was marked as deprecated because of accidental breaking change with is reverted in 4.10.1
|
|
188
191
|
|
|
189
|
-
Jan 13, 2024
|
|
190
|
-
|
|
191
192
|
- Fixed where clause's that have a field name beginning with `In` preceded by the `NOT` operator. These were parsed as `NOT IN` instead of `NOT` followed by a field name, example: `NOT Invoice__c`
|
|
192
193
|
- https://github.com/jetstreamapp/jetstream/issues/702
|
|
193
194
|
- Fixed queries that have two consecutive `NOT` operators (#237)
|
|
194
195
|
- Enabled Typescript strict mode and made a number of minor fixes related to this.
|
|
195
196
|
- When using `getField` which return `FieldFunctionExpression` will now always return an empty array even if no parameters are provided.
|
|
196
197
|
|
|
197
|
-
## 4.9.2
|
|
198
|
-
|
|
199
|
-
July 24, 2023
|
|
198
|
+
## [4.9.2] - 2023-07-24
|
|
200
199
|
|
|
201
200
|
Ensure `getFlattenedFields` does not throw exception if query does not have `fields` property.
|
|
202
201
|
|
|
203
|
-
## 4.9.1
|
|
204
|
-
|
|
205
|
-
May 29, 2023
|
|
202
|
+
## [4.9.1] - 2023-05-29
|
|
206
203
|
|
|
207
204
|
Fixed bug with composeQuery when some of the WHERE clause values were not strings.
|
|
208
205
|
|
|
209
|
-
## 4.9.0
|
|
210
|
-
|
|
211
|
-
May 23, 2023
|
|
206
|
+
## [4.9.0] - 2023-05-23
|
|
212
207
|
|
|
213
208
|
Upgraded Chevrotain to version 10. Chevrotain dropped support for older browsers, but since this library has a build step, the target output from the processed build should remain in the same target format that was previously available.
|
|
214
209
|
|
|
215
|
-
## 4.8.3
|
|
216
|
-
|
|
217
|
-
May 22, 2023
|
|
210
|
+
## [4.8.3] - 2023-05-22
|
|
218
211
|
|
|
219
212
|
- Included `src` folder in npm package
|
|
220
213
|
|
|
221
|
-
## 4.8.2
|
|
222
|
-
|
|
223
|
-
May 22, 2023
|
|
214
|
+
## [4.8.2] - 2023-05-22
|
|
224
215
|
|
|
225
216
|
- Fix output files to ensure sourcemaps are included in npm package for esm_build. (#227)
|
|
226
217
|
- There was a typo in one of the output paths.
|
|
227
218
|
|
|
228
|
-
## 4.8.1
|
|
229
|
-
|
|
230
|
-
April 9, 2023
|
|
219
|
+
## [4.8.1] - 2023-04-09
|
|
231
220
|
|
|
232
221
|
- Fix output files to ensure sourcemaps are included in npm package. (#227)
|
|
233
222
|
|
|
234
|
-
## 4.8.0
|
|
235
|
-
|
|
236
|
-
April 9, 2023
|
|
223
|
+
## [4.8.0] - 2023-04-09
|
|
237
224
|
|
|
238
225
|
- Fix `isAggregateFn` (#228)
|
|
239
226
|
- Date functions, such as `HOUR_IN_DAY(CreatedDate)` did not properly have the `isAggregateFn` property set to true for the field.
|
|
@@ -244,37 +231,29 @@ April 9, 2023
|
|
|
244
231
|
- Removed non-minified version of application which had incorrect path to sourcemaps
|
|
245
232
|
- Ensure webpack generates a sourcemap for the minified code output
|
|
246
233
|
|
|
247
|
-
## 4.7.1
|
|
234
|
+
## [4.7.1]
|
|
248
235
|
|
|
249
236
|
January 23rd, 2023
|
|
250
237
|
|
|
251
238
|
The repository was moved from `paustint` to `jetstreamapp`. No code changes.
|
|
252
239
|
|
|
253
|
-
## 4.7.0
|
|
254
|
-
|
|
255
|
-
October 6, 2022
|
|
240
|
+
## [4.7.0] - 2022-10-06
|
|
256
241
|
|
|
257
242
|
- Ensure the `literalType` is populated on subqueries that are part of a WHERE clause.
|
|
258
243
|
|
|
259
|
-
## 4.6.1
|
|
260
|
-
|
|
261
|
-
July 17, 2022
|
|
244
|
+
## [4.6.1] - 2022-07-17
|
|
262
245
|
|
|
263
246
|
- Ensure boolean return from some utility functions.
|
|
264
247
|
- Re-designed the documentation website.
|
|
265
248
|
|
|
266
|
-
## 4.6
|
|
267
|
-
|
|
268
|
-
July 7, 2022
|
|
249
|
+
## [4.6] - 2022-07-07
|
|
269
250
|
|
|
270
251
|
- Converted test framework from mocha to jest.
|
|
271
252
|
- Fixed bug where non-string values passed in to a where clause would throw an exception. (#121)
|
|
272
253
|
- Fixed bug where in some cases a soql query would be improperly formed if the operator was an array type, such as `IN`, but the value and literal types were not arrays. (#107)
|
|
273
254
|
- Added additional test-cases for stand-alone compose functions to test non-standard usage.
|
|
274
255
|
|
|
275
|
-
## 4.5.0 / 4.5.1
|
|
276
|
-
|
|
277
|
-
June 21, 2022
|
|
256
|
+
## [4.5.0] / [4.5.1] - 2022-06-21
|
|
278
257
|
|
|
279
258
|
- Added support for [accessLevel parameters](https://developer.salesforce.com/docs/atlas.en-us.238.0.apexcode.meta/apexcode/apex_classes_enforce_usermode.htm) in a `WITH` clause (#193)
|
|
280
259
|
- Examples:
|
|
@@ -283,16 +262,12 @@ June 21, 2022
|
|
|
283
262
|
- Thank you @ghingis
|
|
284
263
|
- Patch release - changed property from `accessLevel` to `withAccessLevel`
|
|
285
264
|
|
|
286
|
-
## 4.4.1
|
|
287
|
-
|
|
288
|
-
June 11, 2022
|
|
265
|
+
## [4.4.1] - 2022-06-11
|
|
289
266
|
|
|
290
267
|
- Fixed parser error where `'mi'` and `'km'` could not be used in a WHERE clause because they were being parsed as a GeoLocationUnit (#188)
|
|
291
268
|
- Thank you @divijklenty for reporting this.
|
|
292
269
|
|
|
293
|
-
## 4.4
|
|
294
|
-
|
|
295
|
-
March 11, 2022
|
|
270
|
+
## [4.4] - 2022-03-11
|
|
296
271
|
|
|
297
272
|
- Add support for partial parse and compose #182
|
|
298
273
|
- Added support for parsing and composing partial queries. When parsing, the new option `allowPartialQuery` enables this functionality.
|
|
@@ -300,36 +275,26 @@ March 11, 2022
|
|
|
300
275
|
- Some types on the `Query` interface were made optional to support partial queries
|
|
301
276
|
- Updated CLI to include additional commands
|
|
302
277
|
|
|
303
|
-
## 4.3
|
|
304
|
-
|
|
305
|
-
September 19, 2021
|
|
278
|
+
## [4.3] - 2021-09-19
|
|
306
279
|
|
|
307
280
|
- Added cli support, check out the readme for usage details
|
|
308
281
|
|
|
309
|
-
## 4.2.2
|
|
310
|
-
|
|
311
|
-
August 1, 2021
|
|
282
|
+
## [4.2.2] - 2021-08-01
|
|
312
283
|
|
|
313
284
|
#160 - `getFlattenedFields()` Did not return correct results if a normal field used an alias, such as `SELECT Count(Id), Name account_name FROM Account GROUP BY Name`
|
|
314
285
|
|
|
315
|
-
## 4.2.1
|
|
316
|
-
|
|
317
|
-
June 18, 2021
|
|
286
|
+
## [4.2.1] - 2021-06-18
|
|
318
287
|
|
|
319
288
|
#157 - `getFlattenedFields()` Did not return correct results if the aggregate function was nested in another function, such as `FORMAT(MAX(CreatedDate))`.
|
|
320
289
|
This bug only applied if there was not a field alias defined.
|
|
321
290
|
|
|
322
|
-
## 4.2.0
|
|
323
|
-
|
|
324
|
-
June 8, 2021
|
|
291
|
+
## [4.2.0] - 2021-06-08
|
|
325
292
|
|
|
326
293
|
#155 - Apex bind variable support is improved to allow parsing of more complex Apex.
|
|
327
294
|
|
|
328
295
|
Review test cases 112 - 117 for examples of supported apex bind variables.
|
|
329
296
|
|
|
330
|
-
## 4.1.1
|
|
331
|
-
|
|
332
|
-
June 6, 2021
|
|
297
|
+
## [4.1.1] - 2021-06-06
|
|
333
298
|
|
|
334
299
|
#153 - A new parser option has been added named `ignoreParseErrors`, which will remove invalid parts of a query if there are parsing errors.
|
|
335
300
|
|
|
@@ -337,7 +302,7 @@ The general structure of the query must be valid and the `SELECT` and `WHERE` cl
|
|
|
337
302
|
|
|
338
303
|
This option has been added to the documentation application.
|
|
339
304
|
|
|
340
|
-
## 4.0.0
|
|
305
|
+
## [4.0.0]
|
|
341
306
|
|
|
342
307
|
April 13, 20201
|
|
343
308
|
|
|
@@ -475,9 +440,7 @@ Here are a few examples of how the `groupBy` is parsed or expected when composin
|
|
|
475
440
|
}
|
|
476
441
|
```
|
|
477
442
|
|
|
478
|
-
## 3.2.0
|
|
479
|
-
|
|
480
|
-
March 27, 2021
|
|
443
|
+
## [3.2.0] - 2021-03-27
|
|
481
444
|
|
|
482
445
|
A number of improvements to the formatter have been made with this release.
|
|
483
446
|
|
|
@@ -511,15 +474,11 @@ FROM
|
|
|
511
474
|
Event
|
|
512
475
|
```
|
|
513
476
|
|
|
514
|
-
## 3.1.0
|
|
515
|
-
|
|
516
|
-
March 27, 2021
|
|
477
|
+
## [3.1.0] - 2021-03-27
|
|
517
478
|
|
|
518
479
|
1. Added support for the `FIELDS()` function
|
|
519
480
|
|
|
520
|
-
## 3.0.2
|
|
521
|
-
|
|
522
|
-
March 6, 2021
|
|
481
|
+
## [3.0.2] - 2021-03-06
|
|
523
482
|
|
|
524
483
|
1. Date functions were not properly parsed when used in order by clauses. (#139)
|
|
525
484
|
2. Modified names of functions / types (internal)
|
|
@@ -527,15 +486,13 @@ March 6, 2021
|
|
|
527
486
|
|
|
528
487
|
Changes also released to 2.5.6
|
|
529
488
|
|
|
530
|
-
## 3.0.1
|
|
489
|
+
## [3.0.1]
|
|
531
490
|
|
|
532
491
|
January 7, 20201
|
|
533
492
|
|
|
534
493
|
1. `getFlattenedFields` did not properly handle the alias for an aggregate function within an aggregate query. (#131)
|
|
535
494
|
|
|
536
|
-
## 3.0.0
|
|
537
|
-
|
|
538
|
-
October 14, 2020
|
|
495
|
+
## [3.0.0] - 2020-10-14
|
|
539
496
|
|
|
540
497
|
🔥 Breaking Changes 🔥
|
|
541
498
|
|
|
@@ -678,62 +635,44 @@ export type FieldType =
|
|
|
678
635
|
+export type HavingClause = HavingClauseWithoutOperator | HavingClauseWithRightCondition;
|
|
679
636
|
```
|
|
680
637
|
|
|
681
|
-
## 2.5.5
|
|
682
|
-
|
|
683
|
-
Aug 23, 2020
|
|
638
|
+
## [2.5.5] - 2020-08-23
|
|
684
639
|
|
|
685
640
|
1. `getFlattenedFields` ignores `typeof` clauses in query. (#115)
|
|
686
641
|
|
|
687
|
-
## 2.5.4
|
|
688
|
-
|
|
689
|
-
April 12, 2020
|
|
642
|
+
## [2.5.4] - 2020-04-12
|
|
690
643
|
|
|
691
644
|
1. `getFlattenedFields` returns incorrect results if relationship field is grouped and you are grouping for only one field (#113)
|
|
692
645
|
|
|
693
|
-
## 2.5.3
|
|
694
|
-
|
|
695
|
-
April 24, 2020
|
|
646
|
+
## [2.5.3] - 2020-04-24
|
|
696
647
|
|
|
697
648
|
1. Fixed nanoseconds on date (#102)
|
|
698
649
|
|
|
699
|
-
## 2.5.2
|
|
700
|
-
|
|
701
|
-
April 23, 2020
|
|
650
|
+
## [2.5.2] - 2020-04-23
|
|
702
651
|
|
|
703
652
|
1. Added support for dates formatted with nanoseconds, such as `2020-04-15T02:40:03.000+0000`. (#102)
|
|
704
653
|
2. Added support for aggregate function in the `ORDER BY` clause (#103)
|
|
705
654
|
3. Queries would not be properly composed if an order by had a function and also specified ASC or DESC (#104)
|
|
706
655
|
|
|
707
|
-
## 2.5.1
|
|
708
|
-
|
|
709
|
-
April 23, 2020
|
|
656
|
+
## [2.5.1] - 2020-04-23
|
|
710
657
|
|
|
711
658
|
1. Queries with date functions in a WHERE clause would throw an error when parsing. (#100)
|
|
712
659
|
|
|
713
|
-
## 2.5.0
|
|
714
|
-
|
|
715
|
-
April 3, 2020
|
|
660
|
+
## [2.5.0] - 2020-04-03
|
|
716
661
|
|
|
717
662
|
1. Passing in null or undefined to compose query no longer throws an exception, but instead returns an empty string. (#95)
|
|
718
663
|
2. Regular fields in a select clause now allow aliases because this is allowed if the field is used as part of a group by clause. (#97)
|
|
719
664
|
3. `getFlattenedFields()` now considers if a relationship field was used as part of a group by, and if so it returns just the field name instead of the entire field path, as this is how Salesforce will return the records. (#98)
|
|
720
665
|
|
|
721
|
-
## 2.4.1
|
|
722
|
-
|
|
723
|
-
Mar 22, 2020
|
|
666
|
+
## [2.4.1] - 2020-03-22
|
|
724
667
|
|
|
725
668
|
1. Updated dependencies to resolve known security vulnerabilities.
|
|
726
669
|
|
|
727
|
-
## 2.4
|
|
728
|
-
|
|
729
|
-
Feb 25, 2020
|
|
670
|
+
## [2.4] - 2020-02-25
|
|
730
671
|
|
|
731
672
|
1. Date literals were not properly parsed if they were included as part of a SET within a WHERE clause, such as `WHERE IN (TODAY, LAST_N_DAYS:5)`.
|
|
732
673
|
1. As part of this change, the `dateLiteralVariable` property in the `Condition` will be an array if a variable date literal is included in a SET where clause. Refer to test cases `93` through `98` for examples
|
|
733
674
|
|
|
734
|
-
## 2.3.0
|
|
735
|
-
|
|
736
|
-
Jan 13, 2020
|
|
675
|
+
## [2.3.0] - 2020-01-13
|
|
737
676
|
|
|
738
677
|
1. The `DESC` operator in the `ORDER BY` clause was treated as a case-sensitive field.
|
|
739
678
|
2. The following fields we treated as case-sensitive:
|
|
@@ -742,40 +681,28 @@ Jan 13, 2020
|
|
|
742
681
|
3. Updated the `DISTANCE` function to properly be tagged as `isAggregateFn=true` if used as a field
|
|
743
682
|
1. This fixed an issue where `getFlattenedFields()` would throw an exception
|
|
744
683
|
|
|
745
|
-
## 2.2.3
|
|
746
|
-
|
|
747
|
-
Jan 4, 2020
|
|
684
|
+
## [2.2.3] - 2020-01-04
|
|
748
685
|
|
|
749
686
|
1. Added logo to README and updated docs.
|
|
750
687
|
|
|
751
|
-
## 2.2.2
|
|
752
|
-
|
|
753
|
-
Dec 2, 2019
|
|
688
|
+
## [2.2.2] - 2019-12-02
|
|
754
689
|
|
|
755
690
|
1. When composing a query, if an empty OrderBy array was provided, the composed query would still include the `ORDER BY` clause in the composed query.
|
|
756
691
|
|
|
757
|
-
## 2.2.1
|
|
758
|
-
|
|
759
|
-
Nov 17, 2019
|
|
692
|
+
## [2.2.1] - 2019-11-17
|
|
760
693
|
|
|
761
694
|
1. `GROUP BY` did not allow multiple fields to be listed, for example: `SELECT BillingState, BillingStreet, COUNT(Id) FROM Account GROUP BY BillingState, BillingStreet` would fail to parse.
|
|
762
695
|
|
|
763
|
-
## 2.2.0
|
|
764
|
-
|
|
765
|
-
Nov 6, 2019
|
|
696
|
+
## [2.2.0] - 2019-11-06
|
|
766
697
|
|
|
767
698
|
1. `DISTANCE` and `GEOLOCATION` functions failed to parse when used in a `WHERE` clauses and `ORDER BY` clauses.
|
|
768
699
|
|
|
769
|
-
## 2.1.0
|
|
770
|
-
|
|
771
|
-
Oct 28, 2019
|
|
700
|
+
## [2.1.0] - 2019-10-28
|
|
772
701
|
|
|
773
702
|
1. The method signature for `getFlattenedFields` has changed to allow `Query | Subquery | FieldSubquery` to be passed in. this is not being considered a breaking change because it is fully backwards compatible.
|
|
774
703
|
2. A new helper method `isFieldSubquery(value: any)` was added to allow determining if a Field is a FieldSubquery. This is used internally for `getFlattenedFields()`.
|
|
775
704
|
|
|
776
|
-
## 2.0.0
|
|
777
|
-
|
|
778
|
-
Oct 6, 2019
|
|
705
|
+
## [2.0.0] - 2019-10-06
|
|
779
706
|
|
|
780
707
|
### Summary
|
|
781
708
|
|
|
@@ -1058,35 +985,35 @@ export interface FunctionExp {
|
|
|
1058
985
|
}
|
|
1059
986
|
```
|
|
1060
987
|
|
|
1061
|
-
## 1.2.1
|
|
988
|
+
## [1.2.1]
|
|
1062
989
|
|
|
1063
990
|
- Queries with multiple consecutive left parens in a where clause were not correctly parsed. (#69)
|
|
1064
991
|
- Fixed npm reported security vulnerabilities.
|
|
1065
992
|
|
|
1066
|
-
## 1.2.0
|
|
993
|
+
## [1.2.0]
|
|
1067
994
|
|
|
1068
995
|
- Changed compose methods to public to allow external access (#65)
|
|
1069
996
|
- Fixed lodash security vulnerability
|
|
1070
997
|
- Updated README to reflect new changes and other minor changes
|
|
1071
998
|
|
|
1072
|
-
## 1.1.1
|
|
999
|
+
## [1.1.1]
|
|
1073
1000
|
|
|
1074
1001
|
- Removed files that accidentally got included with release with update of `release-it`
|
|
1075
1002
|
|
|
1076
|
-
## 1.1.0
|
|
1003
|
+
## [1.1.0]
|
|
1077
1004
|
|
|
1078
1005
|
- Updated `Contributing.md` with more detailed instructions on grammar updates
|
|
1079
1006
|
- Added support for `WITH SECURITY_ENFORCED` (#61)
|
|
1080
1007
|
|
|
1081
|
-
## 1.0.2
|
|
1008
|
+
## [1.0.2]
|
|
1082
1009
|
|
|
1083
1010
|
- If a field in a query happened to have a function reserved word, such as `Format`, then parsing the query failed. (#59)
|
|
1084
1011
|
|
|
1085
|
-
## 1.0.1
|
|
1012
|
+
## [1.0.1]
|
|
1086
1013
|
|
|
1087
1014
|
- Ensured that nothing is logged directly to the console unless logging is enabled
|
|
1088
1015
|
|
|
1089
|
-
## 1.0.0
|
|
1016
|
+
## [1.0.0]
|
|
1090
1017
|
|
|
1091
1018
|
### Changed
|
|
1092
1019
|
|
|
@@ -1106,3 +1033,7 @@ export interface FunctionExp {
|
|
|
1106
1033
|
- `function getFlattenedFields(query: Query, isAggregateResult?: boolean): string[]`
|
|
1107
1034
|
- `function isSubquery(query: Query | Subquery): query is Subquery`
|
|
1108
1035
|
- Look at the README and refer to the unit tests for example usage.
|
|
1036
|
+
|
|
1037
|
+
[Unreleased]: https://github.com/jetstreamapp/soql-parser-js/compare/8.0.0...HEAD
|
|
1038
|
+
[8.0.0]: https://github.com/jetstreamapp/soql-parser-js/compare/7.4.1...8.0.0
|
|
1039
|
+
[7.4.1]: https://github.com/jetstreamapp/soql-parser-js/compare/7.4.0...7.4.1
|