@jetstreamapp/soql-parser-js 7.4.0 → 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 +122 -181
- 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 +6 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,38 +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
|
+
|
|
7
|
+
## [8.0.0] - 2026-08-16
|
|
8
|
+
|
|
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
|
+
|
|
11
|
+
### Breaking Changes
|
|
12
|
+
|
|
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.
|
|
6
17
|
|
|
7
18
|
### Features
|
|
8
19
|
|
|
9
|
-
- **Added
|
|
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
|
|
10
35
|
|
|
11
|
-
|
|
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
|
|
12
37
|
|
|
13
|
-
|
|
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
|
|
14
55
|
|
|
15
56
|
### Features
|
|
16
57
|
|
|
17
|
-
- **Added
|
|
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.
|
|
18
59
|
|
|
19
|
-
## 7.
|
|
60
|
+
## [7.3.0] - 2026-07-16
|
|
20
61
|
|
|
21
|
-
|
|
62
|
+
### Features
|
|
22
63
|
|
|
23
|
-
-
|
|
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.
|
|
65
|
+
|
|
66
|
+
## [7.2.2] - 2026-06-09
|
|
24
67
|
|
|
25
|
-
|
|
68
|
+
- Updated dependencies to resolve security vulnerabilities
|
|
26
69
|
|
|
27
|
-
|
|
70
|
+
## [7.2.1] - 2026-06-08
|
|
28
71
|
|
|
29
72
|
### Bug Fixes
|
|
30
73
|
|
|
31
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.
|
|
32
75
|
|
|
33
|
-
## 7.2.0
|
|
34
|
-
|
|
35
|
-
May 11, 2026
|
|
76
|
+
## [7.2.0] - 2026-05-11
|
|
36
77
|
|
|
37
78
|
### LWC Distribution
|
|
38
79
|
|
|
@@ -49,15 +90,11 @@ The LWC build now produces two artifacts to support different deployment workflo
|
|
|
49
90
|
- **npm tarball attached to GitHub Releases** — every release now attaches `jetstreamapp-soql-parser-js-<version>.tgz`.
|
|
50
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.
|
|
51
92
|
|
|
52
|
-
## 7.1.1
|
|
53
|
-
|
|
54
|
-
Apr 25, 2026
|
|
93
|
+
## [7.1.1] - 2026-04-25
|
|
55
94
|
|
|
56
95
|
- Upgrade dependencies
|
|
57
96
|
|
|
58
|
-
## 7.1.0
|
|
59
|
-
|
|
60
|
-
Mar 21, 2026
|
|
97
|
+
## [7.1.0] - 2026-03-21
|
|
61
98
|
|
|
62
99
|
### Bug Fixes
|
|
63
100
|
|
|
@@ -69,9 +106,7 @@ Mar 21, 2026
|
|
|
69
106
|
|
|
70
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.
|
|
71
108
|
|
|
72
|
-
## 7.0.0
|
|
73
|
-
|
|
74
|
-
Mar 14, 2026
|
|
109
|
+
## [7.0.0] - 2026-03-14
|
|
75
110
|
|
|
76
111
|
🚀🚀🚀🚀🚀 Performed a complete re-write using a hand-rolled parser, complements of Claude Code which did 100% of the work.
|
|
77
112
|
|
|
@@ -95,65 +130,45 @@ This is very unlikely to impact most users, and if it does, the required changes
|
|
|
95
130
|
export type { CstNode, CstParser, ILexingError, IRecognitionException } from 'chevrotain';
|
|
96
131
|
```
|
|
97
132
|
|
|
98
|
-
## 6.3.1
|
|
99
|
-
|
|
100
|
-
Dec 15, 2025
|
|
133
|
+
## [6.3.1] - 2025-12-15
|
|
101
134
|
|
|
102
135
|
- Fix indent for query format
|
|
103
136
|
|
|
104
|
-
## 6.3.0
|
|
105
|
-
|
|
106
|
-
Nov 27, 2025
|
|
137
|
+
## [6.3.0] - 2025-11-27
|
|
107
138
|
|
|
108
139
|
- Add support for `mru` in `USING SCOPE`. (#268)
|
|
109
140
|
- Thank you @jimmyhogerty
|
|
110
141
|
|
|
111
|
-
## 6.2.4
|
|
112
|
-
|
|
113
|
-
Aug 18, 2025
|
|
142
|
+
## [6.2.4] - 2025-08-18
|
|
114
143
|
|
|
115
144
|
- Ensure all types are emitted during the build process (#266)
|
|
116
145
|
- Some types were missing from the build process which caused build errors for some typescript users
|
|
117
146
|
|
|
118
|
-
## 6.2.2 / 6.2.3
|
|
119
|
-
|
|
120
|
-
July 8, 2025
|
|
147
|
+
## [6.2.2] / [6.2.3] - 2025-07-08
|
|
121
148
|
|
|
122
149
|
- Ensure types are referenced in exports. (#263)
|
|
123
150
|
|
|
124
|
-
## 6.2.1
|
|
125
|
-
|
|
126
|
-
July 7, 2025
|
|
151
|
+
## [6.2.1] - 2025-07-07
|
|
127
152
|
|
|
128
153
|
- Updated build scripts to ensure esm build works correctly. (#259)
|
|
129
154
|
|
|
130
|
-
## 6.2.0
|
|
131
|
-
|
|
132
|
-
May 8, 2025
|
|
155
|
+
## [6.2.0] - 2025-05-08
|
|
133
156
|
|
|
134
157
|
- Updated build tooling and dependencies, no externally facing changes.
|
|
135
158
|
|
|
136
|
-
## 6.1.0
|
|
137
|
-
|
|
138
|
-
June 16, 2024
|
|
159
|
+
## [6.1.0] - 2024-06-16
|
|
139
160
|
|
|
140
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)
|
|
141
162
|
|
|
142
|
-
## 6.0.0
|
|
143
|
-
|
|
144
|
-
June 16, 2024
|
|
163
|
+
## [6.0.0] - 2024-06-16
|
|
145
164
|
|
|
146
165
|
- Package has been moved to `@jetstreamapp` npm organization
|
|
147
166
|
|
|
148
|
-
## 5.0.2
|
|
149
|
-
|
|
150
|
-
Jan 18, 2024
|
|
167
|
+
## [5.0.2] - 2024-01-18
|
|
151
168
|
|
|
152
169
|
- Nested NOT negation WHERE clauses were not properly formed (#242)
|
|
153
170
|
|
|
154
|
-
## 5.0.1
|
|
155
|
-
|
|
156
|
-
Jan 13, 2024
|
|
171
|
+
## [5.0.1] - 2024-01-13
|
|
157
172
|
|
|
158
173
|
💥 Breaking Changes
|
|
159
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.
|
|
@@ -161,69 +176,51 @@ This was always the case, but prior to enabling strict typescript types, this we
|
|
|
161
176
|
|
|
162
177
|
For Typescript consumers that have strict null checks enabled, they may need to make code changes depending on usage.
|
|
163
178
|
|
|
164
|
-
## 5.0.0
|
|
179
|
+
## [5.0.0]
|
|
165
180
|
|
|
166
181
|
💥 Did not publish correct assets - package was marked as deprecated on npm.
|
|
167
182
|
|
|
168
|
-
## 4.10.1
|
|
169
|
-
|
|
170
|
-
Jan 13, 2024
|
|
183
|
+
## [4.10.1] - 2024-01-13
|
|
171
184
|
|
|
172
185
|
Revert accidental breaking change to types. `WhereClause` left can have `null` in the negation case, but the types did not represent this.
|
|
173
186
|
Updating types to match reality is a breaking change for consumers, so worked around issue and will publish version 5 with breaking change.
|
|
174
187
|
|
|
175
|
-
## 4.10.0
|
|
188
|
+
## [4.10.0] - 2024-01-13
|
|
176
189
|
|
|
177
190
|
💥 Use 4.10.1, this version was marked as deprecated because of accidental breaking change with is reverted in 4.10.1
|
|
178
191
|
|
|
179
|
-
Jan 13, 2024
|
|
180
|
-
|
|
181
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`
|
|
182
193
|
- https://github.com/jetstreamapp/jetstream/issues/702
|
|
183
194
|
- Fixed queries that have two consecutive `NOT` operators (#237)
|
|
184
195
|
- Enabled Typescript strict mode and made a number of minor fixes related to this.
|
|
185
196
|
- When using `getField` which return `FieldFunctionExpression` will now always return an empty array even if no parameters are provided.
|
|
186
197
|
|
|
187
|
-
## 4.9.2
|
|
188
|
-
|
|
189
|
-
July 24, 2023
|
|
198
|
+
## [4.9.2] - 2023-07-24
|
|
190
199
|
|
|
191
200
|
Ensure `getFlattenedFields` does not throw exception if query does not have `fields` property.
|
|
192
201
|
|
|
193
|
-
## 4.9.1
|
|
194
|
-
|
|
195
|
-
May 29, 2023
|
|
202
|
+
## [4.9.1] - 2023-05-29
|
|
196
203
|
|
|
197
204
|
Fixed bug with composeQuery when some of the WHERE clause values were not strings.
|
|
198
205
|
|
|
199
|
-
## 4.9.0
|
|
200
|
-
|
|
201
|
-
May 23, 2023
|
|
206
|
+
## [4.9.0] - 2023-05-23
|
|
202
207
|
|
|
203
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.
|
|
204
209
|
|
|
205
|
-
## 4.8.3
|
|
206
|
-
|
|
207
|
-
May 22, 2023
|
|
210
|
+
## [4.8.3] - 2023-05-22
|
|
208
211
|
|
|
209
212
|
- Included `src` folder in npm package
|
|
210
213
|
|
|
211
|
-
## 4.8.2
|
|
212
|
-
|
|
213
|
-
May 22, 2023
|
|
214
|
+
## [4.8.2] - 2023-05-22
|
|
214
215
|
|
|
215
216
|
- Fix output files to ensure sourcemaps are included in npm package for esm_build. (#227)
|
|
216
217
|
- There was a typo in one of the output paths.
|
|
217
218
|
|
|
218
|
-
## 4.8.1
|
|
219
|
-
|
|
220
|
-
April 9, 2023
|
|
219
|
+
## [4.8.1] - 2023-04-09
|
|
221
220
|
|
|
222
221
|
- Fix output files to ensure sourcemaps are included in npm package. (#227)
|
|
223
222
|
|
|
224
|
-
## 4.8.0
|
|
225
|
-
|
|
226
|
-
April 9, 2023
|
|
223
|
+
## [4.8.0] - 2023-04-09
|
|
227
224
|
|
|
228
225
|
- Fix `isAggregateFn` (#228)
|
|
229
226
|
- Date functions, such as `HOUR_IN_DAY(CreatedDate)` did not properly have the `isAggregateFn` property set to true for the field.
|
|
@@ -234,37 +231,29 @@ April 9, 2023
|
|
|
234
231
|
- Removed non-minified version of application which had incorrect path to sourcemaps
|
|
235
232
|
- Ensure webpack generates a sourcemap for the minified code output
|
|
236
233
|
|
|
237
|
-
## 4.7.1
|
|
234
|
+
## [4.7.1]
|
|
238
235
|
|
|
239
236
|
January 23rd, 2023
|
|
240
237
|
|
|
241
238
|
The repository was moved from `paustint` to `jetstreamapp`. No code changes.
|
|
242
239
|
|
|
243
|
-
## 4.7.0
|
|
244
|
-
|
|
245
|
-
October 6, 2022
|
|
240
|
+
## [4.7.0] - 2022-10-06
|
|
246
241
|
|
|
247
242
|
- Ensure the `literalType` is populated on subqueries that are part of a WHERE clause.
|
|
248
243
|
|
|
249
|
-
## 4.6.1
|
|
250
|
-
|
|
251
|
-
July 17, 2022
|
|
244
|
+
## [4.6.1] - 2022-07-17
|
|
252
245
|
|
|
253
246
|
- Ensure boolean return from some utility functions.
|
|
254
247
|
- Re-designed the documentation website.
|
|
255
248
|
|
|
256
|
-
## 4.6
|
|
257
|
-
|
|
258
|
-
July 7, 2022
|
|
249
|
+
## [4.6] - 2022-07-07
|
|
259
250
|
|
|
260
251
|
- Converted test framework from mocha to jest.
|
|
261
252
|
- Fixed bug where non-string values passed in to a where clause would throw an exception. (#121)
|
|
262
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)
|
|
263
254
|
- Added additional test-cases for stand-alone compose functions to test non-standard usage.
|
|
264
255
|
|
|
265
|
-
## 4.5.0 / 4.5.1
|
|
266
|
-
|
|
267
|
-
June 21, 2022
|
|
256
|
+
## [4.5.0] / [4.5.1] - 2022-06-21
|
|
268
257
|
|
|
269
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)
|
|
270
259
|
- Examples:
|
|
@@ -273,16 +262,12 @@ June 21, 2022
|
|
|
273
262
|
- Thank you @ghingis
|
|
274
263
|
- Patch release - changed property from `accessLevel` to `withAccessLevel`
|
|
275
264
|
|
|
276
|
-
## 4.4.1
|
|
277
|
-
|
|
278
|
-
June 11, 2022
|
|
265
|
+
## [4.4.1] - 2022-06-11
|
|
279
266
|
|
|
280
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)
|
|
281
268
|
- Thank you @divijklenty for reporting this.
|
|
282
269
|
|
|
283
|
-
## 4.4
|
|
284
|
-
|
|
285
|
-
March 11, 2022
|
|
270
|
+
## [4.4] - 2022-03-11
|
|
286
271
|
|
|
287
272
|
- Add support for partial parse and compose #182
|
|
288
273
|
- Added support for parsing and composing partial queries. When parsing, the new option `allowPartialQuery` enables this functionality.
|
|
@@ -290,36 +275,26 @@ March 11, 2022
|
|
|
290
275
|
- Some types on the `Query` interface were made optional to support partial queries
|
|
291
276
|
- Updated CLI to include additional commands
|
|
292
277
|
|
|
293
|
-
## 4.3
|
|
294
|
-
|
|
295
|
-
September 19, 2021
|
|
278
|
+
## [4.3] - 2021-09-19
|
|
296
279
|
|
|
297
280
|
- Added cli support, check out the readme for usage details
|
|
298
281
|
|
|
299
|
-
## 4.2.2
|
|
300
|
-
|
|
301
|
-
August 1, 2021
|
|
282
|
+
## [4.2.2] - 2021-08-01
|
|
302
283
|
|
|
303
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`
|
|
304
285
|
|
|
305
|
-
## 4.2.1
|
|
306
|
-
|
|
307
|
-
June 18, 2021
|
|
286
|
+
## [4.2.1] - 2021-06-18
|
|
308
287
|
|
|
309
288
|
#157 - `getFlattenedFields()` Did not return correct results if the aggregate function was nested in another function, such as `FORMAT(MAX(CreatedDate))`.
|
|
310
289
|
This bug only applied if there was not a field alias defined.
|
|
311
290
|
|
|
312
|
-
## 4.2.0
|
|
313
|
-
|
|
314
|
-
June 8, 2021
|
|
291
|
+
## [4.2.0] - 2021-06-08
|
|
315
292
|
|
|
316
293
|
#155 - Apex bind variable support is improved to allow parsing of more complex Apex.
|
|
317
294
|
|
|
318
295
|
Review test cases 112 - 117 for examples of supported apex bind variables.
|
|
319
296
|
|
|
320
|
-
## 4.1.1
|
|
321
|
-
|
|
322
|
-
June 6, 2021
|
|
297
|
+
## [4.1.1] - 2021-06-06
|
|
323
298
|
|
|
324
299
|
#153 - A new parser option has been added named `ignoreParseErrors`, which will remove invalid parts of a query if there are parsing errors.
|
|
325
300
|
|
|
@@ -327,7 +302,7 @@ The general structure of the query must be valid and the `SELECT` and `WHERE` cl
|
|
|
327
302
|
|
|
328
303
|
This option has been added to the documentation application.
|
|
329
304
|
|
|
330
|
-
## 4.0.0
|
|
305
|
+
## [4.0.0]
|
|
331
306
|
|
|
332
307
|
April 13, 20201
|
|
333
308
|
|
|
@@ -465,9 +440,7 @@ Here are a few examples of how the `groupBy` is parsed or expected when composin
|
|
|
465
440
|
}
|
|
466
441
|
```
|
|
467
442
|
|
|
468
|
-
## 3.2.0
|
|
469
|
-
|
|
470
|
-
March 27, 2021
|
|
443
|
+
## [3.2.0] - 2021-03-27
|
|
471
444
|
|
|
472
445
|
A number of improvements to the formatter have been made with this release.
|
|
473
446
|
|
|
@@ -501,15 +474,11 @@ FROM
|
|
|
501
474
|
Event
|
|
502
475
|
```
|
|
503
476
|
|
|
504
|
-
## 3.1.0
|
|
505
|
-
|
|
506
|
-
March 27, 2021
|
|
477
|
+
## [3.1.0] - 2021-03-27
|
|
507
478
|
|
|
508
479
|
1. Added support for the `FIELDS()` function
|
|
509
480
|
|
|
510
|
-
## 3.0.2
|
|
511
|
-
|
|
512
|
-
March 6, 2021
|
|
481
|
+
## [3.0.2] - 2021-03-06
|
|
513
482
|
|
|
514
483
|
1. Date functions were not properly parsed when used in order by clauses. (#139)
|
|
515
484
|
2. Modified names of functions / types (internal)
|
|
@@ -517,15 +486,13 @@ March 6, 2021
|
|
|
517
486
|
|
|
518
487
|
Changes also released to 2.5.6
|
|
519
488
|
|
|
520
|
-
## 3.0.1
|
|
489
|
+
## [3.0.1]
|
|
521
490
|
|
|
522
491
|
January 7, 20201
|
|
523
492
|
|
|
524
493
|
1. `getFlattenedFields` did not properly handle the alias for an aggregate function within an aggregate query. (#131)
|
|
525
494
|
|
|
526
|
-
## 3.0.0
|
|
527
|
-
|
|
528
|
-
October 14, 2020
|
|
495
|
+
## [3.0.0] - 2020-10-14
|
|
529
496
|
|
|
530
497
|
🔥 Breaking Changes 🔥
|
|
531
498
|
|
|
@@ -668,62 +635,44 @@ export type FieldType =
|
|
|
668
635
|
+export type HavingClause = HavingClauseWithoutOperator | HavingClauseWithRightCondition;
|
|
669
636
|
```
|
|
670
637
|
|
|
671
|
-
## 2.5.5
|
|
672
|
-
|
|
673
|
-
Aug 23, 2020
|
|
638
|
+
## [2.5.5] - 2020-08-23
|
|
674
639
|
|
|
675
640
|
1. `getFlattenedFields` ignores `typeof` clauses in query. (#115)
|
|
676
641
|
|
|
677
|
-
## 2.5.4
|
|
678
|
-
|
|
679
|
-
April 12, 2020
|
|
642
|
+
## [2.5.4] - 2020-04-12
|
|
680
643
|
|
|
681
644
|
1. `getFlattenedFields` returns incorrect results if relationship field is grouped and you are grouping for only one field (#113)
|
|
682
645
|
|
|
683
|
-
## 2.5.3
|
|
684
|
-
|
|
685
|
-
April 24, 2020
|
|
646
|
+
## [2.5.3] - 2020-04-24
|
|
686
647
|
|
|
687
648
|
1. Fixed nanoseconds on date (#102)
|
|
688
649
|
|
|
689
|
-
## 2.5.2
|
|
690
|
-
|
|
691
|
-
April 23, 2020
|
|
650
|
+
## [2.5.2] - 2020-04-23
|
|
692
651
|
|
|
693
652
|
1. Added support for dates formatted with nanoseconds, such as `2020-04-15T02:40:03.000+0000`. (#102)
|
|
694
653
|
2. Added support for aggregate function in the `ORDER BY` clause (#103)
|
|
695
654
|
3. Queries would not be properly composed if an order by had a function and also specified ASC or DESC (#104)
|
|
696
655
|
|
|
697
|
-
## 2.5.1
|
|
698
|
-
|
|
699
|
-
April 23, 2020
|
|
656
|
+
## [2.5.1] - 2020-04-23
|
|
700
657
|
|
|
701
658
|
1. Queries with date functions in a WHERE clause would throw an error when parsing. (#100)
|
|
702
659
|
|
|
703
|
-
## 2.5.0
|
|
704
|
-
|
|
705
|
-
April 3, 2020
|
|
660
|
+
## [2.5.0] - 2020-04-03
|
|
706
661
|
|
|
707
662
|
1. Passing in null or undefined to compose query no longer throws an exception, but instead returns an empty string. (#95)
|
|
708
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)
|
|
709
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)
|
|
710
665
|
|
|
711
|
-
## 2.4.1
|
|
712
|
-
|
|
713
|
-
Mar 22, 2020
|
|
666
|
+
## [2.4.1] - 2020-03-22
|
|
714
667
|
|
|
715
668
|
1. Updated dependencies to resolve known security vulnerabilities.
|
|
716
669
|
|
|
717
|
-
## 2.4
|
|
718
|
-
|
|
719
|
-
Feb 25, 2020
|
|
670
|
+
## [2.4] - 2020-02-25
|
|
720
671
|
|
|
721
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)`.
|
|
722
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
|
|
723
674
|
|
|
724
|
-
## 2.3.0
|
|
725
|
-
|
|
726
|
-
Jan 13, 2020
|
|
675
|
+
## [2.3.0] - 2020-01-13
|
|
727
676
|
|
|
728
677
|
1. The `DESC` operator in the `ORDER BY` clause was treated as a case-sensitive field.
|
|
729
678
|
2. The following fields we treated as case-sensitive:
|
|
@@ -732,40 +681,28 @@ Jan 13, 2020
|
|
|
732
681
|
3. Updated the `DISTANCE` function to properly be tagged as `isAggregateFn=true` if used as a field
|
|
733
682
|
1. This fixed an issue where `getFlattenedFields()` would throw an exception
|
|
734
683
|
|
|
735
|
-
## 2.2.3
|
|
736
|
-
|
|
737
|
-
Jan 4, 2020
|
|
684
|
+
## [2.2.3] - 2020-01-04
|
|
738
685
|
|
|
739
686
|
1. Added logo to README and updated docs.
|
|
740
687
|
|
|
741
|
-
## 2.2.2
|
|
742
|
-
|
|
743
|
-
Dec 2, 2019
|
|
688
|
+
## [2.2.2] - 2019-12-02
|
|
744
689
|
|
|
745
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.
|
|
746
691
|
|
|
747
|
-
## 2.2.1
|
|
748
|
-
|
|
749
|
-
Nov 17, 2019
|
|
692
|
+
## [2.2.1] - 2019-11-17
|
|
750
693
|
|
|
751
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.
|
|
752
695
|
|
|
753
|
-
## 2.2.0
|
|
754
|
-
|
|
755
|
-
Nov 6, 2019
|
|
696
|
+
## [2.2.0] - 2019-11-06
|
|
756
697
|
|
|
757
698
|
1. `DISTANCE` and `GEOLOCATION` functions failed to parse when used in a `WHERE` clauses and `ORDER BY` clauses.
|
|
758
699
|
|
|
759
|
-
## 2.1.0
|
|
760
|
-
|
|
761
|
-
Oct 28, 2019
|
|
700
|
+
## [2.1.0] - 2019-10-28
|
|
762
701
|
|
|
763
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.
|
|
764
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()`.
|
|
765
704
|
|
|
766
|
-
## 2.0.0
|
|
767
|
-
|
|
768
|
-
Oct 6, 2019
|
|
705
|
+
## [2.0.0] - 2019-10-06
|
|
769
706
|
|
|
770
707
|
### Summary
|
|
771
708
|
|
|
@@ -1048,35 +985,35 @@ export interface FunctionExp {
|
|
|
1048
985
|
}
|
|
1049
986
|
```
|
|
1050
987
|
|
|
1051
|
-
## 1.2.1
|
|
988
|
+
## [1.2.1]
|
|
1052
989
|
|
|
1053
990
|
- Queries with multiple consecutive left parens in a where clause were not correctly parsed. (#69)
|
|
1054
991
|
- Fixed npm reported security vulnerabilities.
|
|
1055
992
|
|
|
1056
|
-
## 1.2.0
|
|
993
|
+
## [1.2.0]
|
|
1057
994
|
|
|
1058
995
|
- Changed compose methods to public to allow external access (#65)
|
|
1059
996
|
- Fixed lodash security vulnerability
|
|
1060
997
|
- Updated README to reflect new changes and other minor changes
|
|
1061
998
|
|
|
1062
|
-
## 1.1.1
|
|
999
|
+
## [1.1.1]
|
|
1063
1000
|
|
|
1064
1001
|
- Removed files that accidentally got included with release with update of `release-it`
|
|
1065
1002
|
|
|
1066
|
-
## 1.1.0
|
|
1003
|
+
## [1.1.0]
|
|
1067
1004
|
|
|
1068
1005
|
- Updated `Contributing.md` with more detailed instructions on grammar updates
|
|
1069
1006
|
- Added support for `WITH SECURITY_ENFORCED` (#61)
|
|
1070
1007
|
|
|
1071
|
-
## 1.0.2
|
|
1008
|
+
## [1.0.2]
|
|
1072
1009
|
|
|
1073
1010
|
- If a field in a query happened to have a function reserved word, such as `Format`, then parsing the query failed. (#59)
|
|
1074
1011
|
|
|
1075
|
-
## 1.0.1
|
|
1012
|
+
## [1.0.1]
|
|
1076
1013
|
|
|
1077
1014
|
- Ensured that nothing is logged directly to the console unless logging is enabled
|
|
1078
1015
|
|
|
1079
|
-
## 1.0.0
|
|
1016
|
+
## [1.0.0]
|
|
1080
1017
|
|
|
1081
1018
|
### Changed
|
|
1082
1019
|
|
|
@@ -1096,3 +1033,7 @@ export interface FunctionExp {
|
|
|
1096
1033
|
- `function getFlattenedFields(query: Query, isAggregateResult?: boolean): string[]`
|
|
1097
1034
|
- `function isSubquery(query: Query | Subquery): query is Subquery`
|
|
1098
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
|