@jetstreamapp/soql-parser-js 7.4.1 → 8.1.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 CHANGED
@@ -1,48 +1,188 @@
1
1
  # Changelog
2
2
 
3
- ## 7.4.1
3
+ All notable changes to this project will be documented in this file.
4
4
 
5
- Aug 6, 2026
5
+ ## [Unreleased]
6
6
 
7
- No changes to the published library — this release updates devDependencies and overhauls the release pipeline.
7
+ ## [8.1.0] - 2026-09-05
8
8
 
9
- ### Dependencies
9
+ ### Added
10
10
 
11
- - Updated devDependencies to latest versions (prettier, release-it, tsx, vitest) and docs site dependencies (Docusaurus 3.10.2, React 19.2.8, TypeScript 6)
11
+ - **Added SOQL `FORMULA()` support in `WHERE` clauses** — arithmetic expressions containing
12
+ two field references joined by `+` or `-` are parsed into a typed nested AST, validated against
13
+ the supported grammar, and reconstructed by both the composer and formatter. `FORMULA()` is
14
+ rejected in unsupported clauses and remains dependency-free. An `isFormulaFunction()` type guard
15
+ narrows a condition's `fn` to `FormulaFunctionExp`, and composing a malformed formula AST throws
16
+ rather than emitting invalid SOQL.
12
17
 
13
- ## 7.4.0
18
+ ### Changed
14
19
 
15
- Jul 16, 2026
20
+ - **Replaced Prettier with [oxfmt](https://oxc.rs/docs/guide/usage/formatter.html) and added
21
+ [oxlint](https://oxc.rs/docs/guide/usage/linter.html) as the project linter** — the repository had
22
+ no linter at all. Config moved from `.prettierrc` to `.oxfmtrc.json` (every option carried over
23
+ except the no-op `insertPragma`), with `.oxlintrc.json` alongside it and `npm run format`,
24
+ `format:check`, `lint` and `lint:fix`. oxlint runs the `correctness`, `suspicious` and `perf`
25
+ categories as errors; `style` and `pedantic` stay off because on a hand-written recursive-descent
26
+ parser they ask for the code to be restructured — function length, inline comments, negated
27
+ conditions — rather than pointing at defects. Individually disabled rules each carry their reason
28
+ inline, including two genuine false positives: `no-unmodified-loop-condition` does not see that
29
+ the parser's paren-matching loops mutate `parenCount.right`, and `no-await-in-loop` flags polling
30
+ loops whose iterations are sequential by design. The repository was reformatted in the process,
31
+ and the result is byte identical to what Prettier produced for the files it flagged
32
+ - **The `pre-commit` hook blocks a commit when staged files are unformatted or fail lint**, running
33
+ both checks so one attempt reports everything to fix. `npm install` wires it up by pointing
34
+ `core.hooksPath` at `.githooks/`
35
+ - **CI now gates on `format:check`, `lint` and `typecheck`** alongside the tests and build, since the
36
+ hook can be bypassed with `--no-verify`. CI installs with `npm ci` rather than `npm install`, and
37
+ runs on pushes to `main` and on pull requests instead of on every push
38
+ - **A `Changelog` workflow requires an `[Unreleased]` entry on pull requests that touch published
39
+ code.** That section decides the version, so a change nobody wrote down was previously only
40
+ noticed at release time, after the bump had been derived. It fails when `CHANGELOG.md` is
41
+ untouched, then runs `scripts/derive-increment.mjs` so a file edited without a real entry fails
42
+ too. The `skip-changelog` label opts out
43
+ - **The release version is derived from the changelog headings alone.** `scripts/derive-increment.mjs`
44
+ maps `Breaking Changes` to a major, `Added`/`Deprecated` to a minor and
45
+ `Changed`/`Removed`/`Fixed`/`Security` to a patch. Only headings are read, never the entry text —
46
+ scanning the body for a word like "BREAKING" fires on ordinary prose, and an entry that merely
47
+ mentions a breaking change would silently turn a patch into a major. An unrecognized heading is an
48
+ error rather than a guess, so an unclassified change cannot ship as a patch. `npm run release`
49
+ starts a release from the terminal, verifying that `main` is clean and matches origin, printing the
50
+ plan for confirmation, then dispatching the workflow and tailing the run. The release still runs
51
+ entirely in CI, which holds the publish credentials; `release-it` moved behind `npm run release:ci`
52
+ - **The release workflow now matches the one in the Jetstream monorepo.** It authenticates with
53
+ `client-id` rather than `app-id`, which the action marks deprecated. Release commits are no longer
54
+ authored by `Release Workflow <support@getjetstream.app>`, which is not an account GitHub can
55
+ resolve: the identity is derived from the token, with `app-slug` naming the committer and the App's
56
+ numeric user id forming the `<id>+<slug>[bot]@users.noreply.github.com` address that links commits
57
+ back to the App, so they carry the bot's avatar. Every action is pinned to a commit SHA with the
58
+ version in a trailing comment, because a tag can be repointed at new code and a SHA cannot
59
+ - **Tooling is now shared with [sf-formula-parser](https://github.com/jetstreamapp/sf-formula-parser)** —
60
+ `scripts/derive-increment.mjs`, `scripts/release.mjs`, `.githooks/pre-commit` and the `ci`,
61
+ `release` and `changelog` workflows are identical in both repositories, as are `.oxfmtrc.json` and
62
+ `.claude/settings.json`. `tasks/` was renamed to `scripts/` to match, and `CLAUDE.md` became
63
+ `AGENTS.md`, which records the formatter and linter workflow, the release rules, and the two
64
+ constraints that are not obvious from the code: `"type": "module"` must not be added to the root
65
+ package.json, and `docs/` is a separate npm project. `npm test` is now `vitest run` rather than
66
+ bare `vitest`, which started a watch session; `test:watch` ran `jest --watch` long after jest
67
+ stopped being a dependency; `test:coverage` was added along with `@vitest/coverage-v8` so it runs
68
+ without prompting for a provider; and the `--testTimeout 10000` that lived in the test script moved
69
+ into `vitest.config.mts`
70
+ - **Upgraded dependencies** — TypeScript 7 in both the library and the docs site, plus the latest
71
+ esbuild, release-it and tsx. `npm-run-all` and `lodash.get` were dropped: the build chains its
72
+ steps with `&&`, and the single test that used `lodash.get` now resolves the dot separated path
73
+ locally. `vitest.config.ts` became `vitest.config.mts`, since it is ESM while the root package is
74
+ CommonJS, which Vite warned about under its upcoming native config loader
75
+ - **Enabled `isolatedDeclarations` and raised the TypeScript target to ES2022.** The target only
76
+ affects the emitted declarations, and esbuild was already producing es2020/es2022 bundles, so
77
+ nothing about the shipped JavaScript changes. Two exported functions in `src/utils.ts` needed
78
+ explicit return types. `npm run typecheck` covers tests, scripts and the cli via
79
+ `tsconfig.typecheck.json`, which the build's declaration-only `tsconfig.json` excludes
80
+ - **Removed `.npmignore`** — `package.json` `files` takes precedence over it, so it had no effect:
81
+ `npm pack --dry-run` produces a byte identical 21 file tarball without it. It had also drifted,
82
+ listing `CHANGELOG.md` and `AUTHORS.md` as excluded while `files` ships both. `files` is an
83
+ allowlist, which is the safer default — a new top-level directory is excluded unless it is named,
84
+ where a denylist would have published it
85
+ - **Documentation** — the playground's parse, compose and utility function output, and the install
86
+ command on the home page, now reveal a copy to clipboard button on hover, matching the one
87
+ Docusaurus already renders on markdown code blocks. The site publishes `llms.txt` and
88
+ `llms-full.txt` via `docusaurus-plugin-llms`, with links in the footer
89
+
90
+ ### Fixed
91
+
92
+ - **Doc comments are no longer stripped from the published type declarations** — `tsconfig.json` set
93
+ `removeComments`, so every JSDoc block was dropped from `dist/types` and editors showed no
94
+ documentation on hover for any exported symbol. Removing it restores them for 12 KB of declaration
95
+ output, and leaves the JavaScript bundles untouched since esbuild builds those
96
+ - **Corrected the dependency note in the README** — it still described `commander`, `chevrotain` and
97
+ `lodash.get` as dependencies of the library. Those were removed in 8.0.0; the package has no
98
+ runtime dependencies
99
+ - **Corrected the Node compatibility claim in the README** — it advertised Node 11 or higher with an
100
+ [Array.flat](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/flat)
101
+ polyfill, which stopped being true once the parser started using `??` and `?.`. Those are ES2020
102
+ syntax and esbuild's `es2022` target leaves them in the published bundles, so Node 11 cannot run
103
+ them whatever is polyfilled. The stated minimum is now Node 20, the oldest release still in
104
+ maintenance, rather than the bare syntax floor of Node 14 — the library is only ever tested on
105
+ supported releases
106
+ - **`CONTRIBUTING.md` sent contributors to a `master` branch that does not exist** — it asked them to
107
+ branch from and open pull requests against `master`, where the default branch is `main`. The
108
+ contribution guidelines link in the README pointed at the same dead branch
109
+ - **Everything oxlint flagged, with no behavior change to the published library.** A redundant double
110
+ negation, a `? true : false` ternary, an unused local and an unused catch binding were removed;
111
+ `new Array(n).fill(' ').join('')` in `pad()` became `' '.repeat(n)`; and three shadowed variables
112
+ were renamed. In the tests, the performance benchmark had no assertion and now checks that every
113
+ iteration actually parsed, two `toThrow()` calls gained the message matcher their neighbours
114
+ already used, and unused imports were dropped
115
+
116
+ ## [8.0.0] - 2026-08-16
117
+
118
+ 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.
119
+
120
+ ### Breaking Changes
121
+
122
+ - **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.
123
+ - **`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.
124
+ - **`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.
125
+ - **`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.
16
126
 
17
127
  ### Features
18
128
 
19
- - **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.
129
+ - **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.
130
+
131
+ ### Bug Fixes
132
+
133
+ - **`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)
134
+ - **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.
135
+ - **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.
136
+ - **`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.
137
+ - **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.
138
+ - **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.
139
+ - **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.
140
+ - **`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).
141
+ - **`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`.
142
+
143
+ ### Changed
144
+
145
+ - 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
146
+
147
+ ### Internal
20
148
 
21
- ## 7.3.0
149
+ - **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.
150
+ - **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.
151
+ - 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.
22
152
 
23
- Jul 16, 2026
153
+ ## [7.4.1] - 2026-08-06
154
+
155
+ ### Changed
156
+
157
+ - 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
158
+
159
+ ### Removed
160
+
161
+ - Removed the docs deployment from the release pipeline — documentation at https://soql-parser-js.getjetstream.app is now built and hosted by Cloudflare Pages
162
+
163
+ ## [7.4.0] - 2026-07-16
24
164
 
25
165
  ### Features
26
166
 
27
- - **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.
167
+ - **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.
28
168
 
29
- ## 7.2.2
169
+ ## [7.3.0] - 2026-07-16
30
170
 
31
- Jun 9, 2026
171
+ ### Features
32
172
 
33
- - Updated dependencies to resolve security vulnerabilities
173
+ - **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.
174
+
175
+ ## [7.2.2] - 2026-06-09
34
176
 
35
- ## 7.2.1
177
+ - Updated dependencies to resolve security vulnerabilities
36
178
 
37
- Jun 8, 2026
179
+ ## [7.2.1] - 2026-06-08
38
180
 
39
181
  ### Bug Fixes
40
182
 
41
183
  - **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
184
 
43
- ## 7.2.0
44
-
45
- May 11, 2026
185
+ ## [7.2.0] - 2026-05-11
46
186
 
47
187
  ### LWC Distribution
48
188
 
@@ -59,15 +199,11 @@ The LWC build now produces two artifacts to support different deployment workflo
59
199
  - **npm tarball attached to GitHub Releases** — every release now attaches `jetstreamapp-soql-parser-js-<version>.tgz`.
60
200
  - **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
201
 
62
- ## 7.1.1
63
-
64
- Apr 25, 2026
202
+ ## [7.1.1] - 2026-04-25
65
203
 
66
204
  - Upgrade dependencies
67
205
 
68
- ## 7.1.0
69
-
70
- Mar 21, 2026
206
+ ## [7.1.0] - 2026-03-21
71
207
 
72
208
  ### Bug Fixes
73
209
 
@@ -79,9 +215,7 @@ Mar 21, 2026
79
215
 
80
216
  - 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
217
 
82
- ## 7.0.0
83
-
84
- Mar 14, 2026
218
+ ## [7.0.0] - 2026-03-14
85
219
 
86
220
  🚀🚀🚀🚀🚀 Performed a complete re-write using a hand-rolled parser, complements of Claude Code which did 100% of the work.
87
221
 
@@ -105,65 +239,45 @@ This is very unlikely to impact most users, and if it does, the required changes
105
239
  export type { CstNode, CstParser, ILexingError, IRecognitionException } from 'chevrotain';
106
240
  ```
107
241
 
108
- ## 6.3.1
109
-
110
- Dec 15, 2025
242
+ ## [6.3.1] - 2025-12-15
111
243
 
112
244
  - Fix indent for query format
113
245
 
114
- ## 6.3.0
115
-
116
- Nov 27, 2025
246
+ ## [6.3.0] - 2025-11-27
117
247
 
118
248
  - Add support for `mru` in `USING SCOPE`. (#268)
119
249
  - Thank you @jimmyhogerty
120
250
 
121
- ## 6.2.4
122
-
123
- Aug 18, 2025
251
+ ## [6.2.4] - 2025-08-18
124
252
 
125
253
  - Ensure all types are emitted during the build process (#266)
126
254
  - Some types were missing from the build process which caused build errors for some typescript users
127
255
 
128
- ## 6.2.2 / 6.2.3
129
-
130
- July 8, 2025
256
+ ## [6.2.2] / [6.2.3] - 2025-07-08
131
257
 
132
258
  - Ensure types are referenced in exports. (#263)
133
259
 
134
- ## 6.2.1
135
-
136
- July 7, 2025
260
+ ## [6.2.1] - 2025-07-07
137
261
 
138
262
  - Updated build scripts to ensure esm build works correctly. (#259)
139
263
 
140
- ## 6.2.0
141
-
142
- May 8, 2025
264
+ ## [6.2.0] - 2025-05-08
143
265
 
144
266
  - Updated build tooling and dependencies, no externally facing changes.
145
267
 
146
- ## 6.1.0
147
-
148
- June 16, 2024
268
+ ## [6.1.0] - 2024-06-16
149
269
 
150
270
  - 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
271
 
152
- ## 6.0.0
153
-
154
- June 16, 2024
272
+ ## [6.0.0] - 2024-06-16
155
273
 
156
274
  - Package has been moved to `@jetstreamapp` npm organization
157
275
 
158
- ## 5.0.2
159
-
160
- Jan 18, 2024
276
+ ## [5.0.2] - 2024-01-18
161
277
 
162
278
  - Nested NOT negation WHERE clauses were not properly formed (#242)
163
279
 
164
- ## 5.0.1
165
-
166
- Jan 13, 2024
280
+ ## [5.0.1] - 2024-01-13
167
281
 
168
282
  💥 Breaking Changes
169
283
  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 +285,51 @@ This was always the case, but prior to enabling strict typescript types, this we
171
285
 
172
286
  For Typescript consumers that have strict null checks enabled, they may need to make code changes depending on usage.
173
287
 
174
- ## 5.0.0
288
+ ## [5.0.0]
175
289
 
176
290
  💥 Did not publish correct assets - package was marked as deprecated on npm.
177
291
 
178
- ## 4.10.1
179
-
180
- Jan 13, 2024
292
+ ## [4.10.1] - 2024-01-13
181
293
 
182
294
  Revert accidental breaking change to types. `WhereClause` left can have `null` in the negation case, but the types did not represent this.
183
295
  Updating types to match reality is a breaking change for consumers, so worked around issue and will publish version 5 with breaking change.
184
296
 
185
- ## 4.10.0
297
+ ## [4.10.0] - 2024-01-13
186
298
 
187
299
  💥 Use 4.10.1, this version was marked as deprecated because of accidental breaking change with is reverted in 4.10.1
188
300
 
189
- Jan 13, 2024
190
-
191
301
  - 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
302
  - https://github.com/jetstreamapp/jetstream/issues/702
193
303
  - Fixed queries that have two consecutive `NOT` operators (#237)
194
304
  - Enabled Typescript strict mode and made a number of minor fixes related to this.
195
305
  - When using `getField` which return `FieldFunctionExpression` will now always return an empty array even if no parameters are provided.
196
306
 
197
- ## 4.9.2
198
-
199
- July 24, 2023
307
+ ## [4.9.2] - 2023-07-24
200
308
 
201
309
  Ensure `getFlattenedFields` does not throw exception if query does not have `fields` property.
202
310
 
203
- ## 4.9.1
204
-
205
- May 29, 2023
311
+ ## [4.9.1] - 2023-05-29
206
312
 
207
313
  Fixed bug with composeQuery when some of the WHERE clause values were not strings.
208
314
 
209
- ## 4.9.0
210
-
211
- May 23, 2023
315
+ ## [4.9.0] - 2023-05-23
212
316
 
213
317
  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
318
 
215
- ## 4.8.3
216
-
217
- May 22, 2023
319
+ ## [4.8.3] - 2023-05-22
218
320
 
219
321
  - Included `src` folder in npm package
220
322
 
221
- ## 4.8.2
222
-
223
- May 22, 2023
323
+ ## [4.8.2] - 2023-05-22
224
324
 
225
325
  - Fix output files to ensure sourcemaps are included in npm package for esm_build. (#227)
226
326
  - There was a typo in one of the output paths.
227
327
 
228
- ## 4.8.1
229
-
230
- April 9, 2023
328
+ ## [4.8.1] - 2023-04-09
231
329
 
232
330
  - Fix output files to ensure sourcemaps are included in npm package. (#227)
233
331
 
234
- ## 4.8.0
235
-
236
- April 9, 2023
332
+ ## [4.8.0] - 2023-04-09
237
333
 
238
334
  - Fix `isAggregateFn` (#228)
239
335
  - Date functions, such as `HOUR_IN_DAY(CreatedDate)` did not properly have the `isAggregateFn` property set to true for the field.
@@ -244,37 +340,29 @@ April 9, 2023
244
340
  - Removed non-minified version of application which had incorrect path to sourcemaps
245
341
  - Ensure webpack generates a sourcemap for the minified code output
246
342
 
247
- ## 4.7.1
343
+ ## [4.7.1]
248
344
 
249
345
  January 23rd, 2023
250
346
 
251
347
  The repository was moved from `paustint` to `jetstreamapp`. No code changes.
252
348
 
253
- ## 4.7.0
254
-
255
- October 6, 2022
349
+ ## [4.7.0] - 2022-10-06
256
350
 
257
351
  - Ensure the `literalType` is populated on subqueries that are part of a WHERE clause.
258
352
 
259
- ## 4.6.1
260
-
261
- July 17, 2022
353
+ ## [4.6.1] - 2022-07-17
262
354
 
263
355
  - Ensure boolean return from some utility functions.
264
356
  - Re-designed the documentation website.
265
357
 
266
- ## 4.6
267
-
268
- July 7, 2022
358
+ ## [4.6] - 2022-07-07
269
359
 
270
360
  - Converted test framework from mocha to jest.
271
361
  - Fixed bug where non-string values passed in to a where clause would throw an exception. (#121)
272
362
  - 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
363
  - Added additional test-cases for stand-alone compose functions to test non-standard usage.
274
364
 
275
- ## 4.5.0 / 4.5.1
276
-
277
- June 21, 2022
365
+ ## [4.5.0] / [4.5.1] - 2022-06-21
278
366
 
279
367
  - 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
368
  - Examples:
@@ -283,16 +371,12 @@ June 21, 2022
283
371
  - Thank you @ghingis
284
372
  - Patch release - changed property from `accessLevel` to `withAccessLevel`
285
373
 
286
- ## 4.4.1
287
-
288
- June 11, 2022
374
+ ## [4.4.1] - 2022-06-11
289
375
 
290
376
  - 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
377
  - Thank you @divijklenty for reporting this.
292
378
 
293
- ## 4.4
294
-
295
- March 11, 2022
379
+ ## [4.4] - 2022-03-11
296
380
 
297
381
  - Add support for partial parse and compose #182
298
382
  - Added support for parsing and composing partial queries. When parsing, the new option `allowPartialQuery` enables this functionality.
@@ -300,36 +384,26 @@ March 11, 2022
300
384
  - Some types on the `Query` interface were made optional to support partial queries
301
385
  - Updated CLI to include additional commands
302
386
 
303
- ## 4.3
304
-
305
- September 19, 2021
387
+ ## [4.3] - 2021-09-19
306
388
 
307
389
  - Added cli support, check out the readme for usage details
308
390
 
309
- ## 4.2.2
310
-
311
- August 1, 2021
391
+ ## [4.2.2] - 2021-08-01
312
392
 
313
393
  #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
394
 
315
- ## 4.2.1
316
-
317
- June 18, 2021
395
+ ## [4.2.1] - 2021-06-18
318
396
 
319
397
  #157 - `getFlattenedFields()` Did not return correct results if the aggregate function was nested in another function, such as `FORMAT(MAX(CreatedDate))`.
320
398
  This bug only applied if there was not a field alias defined.
321
399
 
322
- ## 4.2.0
323
-
324
- June 8, 2021
400
+ ## [4.2.0] - 2021-06-08
325
401
 
326
402
  #155 - Apex bind variable support is improved to allow parsing of more complex Apex.
327
403
 
328
404
  Review test cases 112 - 117 for examples of supported apex bind variables.
329
405
 
330
- ## 4.1.1
331
-
332
- June 6, 2021
406
+ ## [4.1.1] - 2021-06-06
333
407
 
334
408
  #153 - A new parser option has been added named `ignoreParseErrors`, which will remove invalid parts of a query if there are parsing errors.
335
409
 
@@ -337,7 +411,7 @@ The general structure of the query must be valid and the `SELECT` and `WHERE` cl
337
411
 
338
412
  This option has been added to the documentation application.
339
413
 
340
- ## 4.0.0
414
+ ## [4.0.0]
341
415
 
342
416
  April 13, 20201
343
417
 
@@ -475,9 +549,7 @@ Here are a few examples of how the `groupBy` is parsed or expected when composin
475
549
  }
476
550
  ```
477
551
 
478
- ## 3.2.0
479
-
480
- March 27, 2021
552
+ ## [3.2.0] - 2021-03-27
481
553
 
482
554
  A number of improvements to the formatter have been made with this release.
483
555
 
@@ -511,15 +583,11 @@ FROM
511
583
  Event
512
584
  ```
513
585
 
514
- ## 3.1.0
515
-
516
- March 27, 2021
586
+ ## [3.1.0] - 2021-03-27
517
587
 
518
588
  1. Added support for the `FIELDS()` function
519
589
 
520
- ## 3.0.2
521
-
522
- March 6, 2021
590
+ ## [3.0.2] - 2021-03-06
523
591
 
524
592
  1. Date functions were not properly parsed when used in order by clauses. (#139)
525
593
  2. Modified names of functions / types (internal)
@@ -527,15 +595,13 @@ March 6, 2021
527
595
 
528
596
  Changes also released to 2.5.6
529
597
 
530
- ## 3.0.1
598
+ ## [3.0.1]
531
599
 
532
600
  January 7, 20201
533
601
 
534
602
  1. `getFlattenedFields` did not properly handle the alias for an aggregate function within an aggregate query. (#131)
535
603
 
536
- ## 3.0.0
537
-
538
- October 14, 2020
604
+ ## [3.0.0] - 2020-10-14
539
605
 
540
606
  🔥 Breaking Changes 🔥
541
607
 
@@ -678,62 +744,44 @@ export type FieldType =
678
744
  +export type HavingClause = HavingClauseWithoutOperator | HavingClauseWithRightCondition;
679
745
  ```
680
746
 
681
- ## 2.5.5
682
-
683
- Aug 23, 2020
747
+ ## [2.5.5] - 2020-08-23
684
748
 
685
749
  1. `getFlattenedFields` ignores `typeof` clauses in query. (#115)
686
750
 
687
- ## 2.5.4
688
-
689
- April 12, 2020
751
+ ## [2.5.4] - 2020-04-12
690
752
 
691
753
  1. `getFlattenedFields` returns incorrect results if relationship field is grouped and you are grouping for only one field (#113)
692
754
 
693
- ## 2.5.3
694
-
695
- April 24, 2020
755
+ ## [2.5.3] - 2020-04-24
696
756
 
697
757
  1. Fixed nanoseconds on date (#102)
698
758
 
699
- ## 2.5.2
700
-
701
- April 23, 2020
759
+ ## [2.5.2] - 2020-04-23
702
760
 
703
761
  1. Added support for dates formatted with nanoseconds, such as `2020-04-15T02:40:03.000+0000`. (#102)
704
762
  2. Added support for aggregate function in the `ORDER BY` clause (#103)
705
763
  3. Queries would not be properly composed if an order by had a function and also specified ASC or DESC (#104)
706
764
 
707
- ## 2.5.1
708
-
709
- April 23, 2020
765
+ ## [2.5.1] - 2020-04-23
710
766
 
711
767
  1. Queries with date functions in a WHERE clause would throw an error when parsing. (#100)
712
768
 
713
- ## 2.5.0
714
-
715
- April 3, 2020
769
+ ## [2.5.0] - 2020-04-03
716
770
 
717
771
  1. Passing in null or undefined to compose query no longer throws an exception, but instead returns an empty string. (#95)
718
772
  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
773
  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
774
 
721
- ## 2.4.1
722
-
723
- Mar 22, 2020
775
+ ## [2.4.1] - 2020-03-22
724
776
 
725
777
  1. Updated dependencies to resolve known security vulnerabilities.
726
778
 
727
- ## 2.4
728
-
729
- Feb 25, 2020
779
+ ## [2.4] - 2020-02-25
730
780
 
731
781
  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
782
  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
783
 
734
- ## 2.3.0
735
-
736
- Jan 13, 2020
784
+ ## [2.3.0] - 2020-01-13
737
785
 
738
786
  1. The `DESC` operator in the `ORDER BY` clause was treated as a case-sensitive field.
739
787
  2. The following fields we treated as case-sensitive:
@@ -742,40 +790,28 @@ Jan 13, 2020
742
790
  3. Updated the `DISTANCE` function to properly be tagged as `isAggregateFn=true` if used as a field
743
791
  1. This fixed an issue where `getFlattenedFields()` would throw an exception
744
792
 
745
- ## 2.2.3
746
-
747
- Jan 4, 2020
793
+ ## [2.2.3] - 2020-01-04
748
794
 
749
795
  1. Added logo to README and updated docs.
750
796
 
751
- ## 2.2.2
752
-
753
- Dec 2, 2019
797
+ ## [2.2.2] - 2019-12-02
754
798
 
755
799
  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
800
 
757
- ## 2.2.1
758
-
759
- Nov 17, 2019
801
+ ## [2.2.1] - 2019-11-17
760
802
 
761
803
  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
804
 
763
- ## 2.2.0
764
-
765
- Nov 6, 2019
805
+ ## [2.2.0] - 2019-11-06
766
806
 
767
807
  1. `DISTANCE` and `GEOLOCATION` functions failed to parse when used in a `WHERE` clauses and `ORDER BY` clauses.
768
808
 
769
- ## 2.1.0
770
-
771
- Oct 28, 2019
809
+ ## [2.1.0] - 2019-10-28
772
810
 
773
811
  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
812
  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
813
 
776
- ## 2.0.0
777
-
778
- Oct 6, 2019
814
+ ## [2.0.0] - 2019-10-06
779
815
 
780
816
  ### Summary
781
817
 
@@ -1058,35 +1094,35 @@ export interface FunctionExp {
1058
1094
  }
1059
1095
  ```
1060
1096
 
1061
- ## 1.2.1
1097
+ ## [1.2.1]
1062
1098
 
1063
1099
  - Queries with multiple consecutive left parens in a where clause were not correctly parsed. (#69)
1064
1100
  - Fixed npm reported security vulnerabilities.
1065
1101
 
1066
- ## 1.2.0
1102
+ ## [1.2.0]
1067
1103
 
1068
1104
  - Changed compose methods to public to allow external access (#65)
1069
1105
  - Fixed lodash security vulnerability
1070
1106
  - Updated README to reflect new changes and other minor changes
1071
1107
 
1072
- ## 1.1.1
1108
+ ## [1.1.1]
1073
1109
 
1074
1110
  - Removed files that accidentally got included with release with update of `release-it`
1075
1111
 
1076
- ## 1.1.0
1112
+ ## [1.1.0]
1077
1113
 
1078
1114
  - Updated `Contributing.md` with more detailed instructions on grammar updates
1079
1115
  - Added support for `WITH SECURITY_ENFORCED` (#61)
1080
1116
 
1081
- ## 1.0.2
1117
+ ## [1.0.2]
1082
1118
 
1083
1119
  - If a field in a query happened to have a function reserved word, such as `Format`, then parsing the query failed. (#59)
1084
1120
 
1085
- ## 1.0.1
1121
+ ## [1.0.1]
1086
1122
 
1087
1123
  - Ensured that nothing is logged directly to the console unless logging is enabled
1088
1124
 
1089
- ## 1.0.0
1125
+ ## [1.0.0]
1090
1126
 
1091
1127
  ### Changed
1092
1128
 
@@ -1106,3 +1142,8 @@ export interface FunctionExp {
1106
1142
  - `function getFlattenedFields(query: Query, isAggregateResult?: boolean): string[]`
1107
1143
  - `function isSubquery(query: Query | Subquery): query is Subquery`
1108
1144
  - Look at the README and refer to the unit tests for example usage.
1145
+
1146
+ [Unreleased]: https://github.com/jetstreamapp/soql-parser-js/compare/8.1.0...HEAD
1147
+ [8.1.0]: https://github.com/jetstreamapp/soql-parser-js/compare/8.0.0...8.1.0
1148
+ [8.0.0]: https://github.com/jetstreamapp/soql-parser-js/compare/7.4.1...8.0.0
1149
+ [7.4.1]: https://github.com/jetstreamapp/soql-parser-js/compare/7.4.0...7.4.1