From dde988f1acbb662233ddffe6a4186e9c65dec465 Mon Sep 17 00:00:00 2001 From: Austin Turner Date: Sat, 13 Jan 2024 11:03:58 -0700 Subject: [PATCH 1/3] Revert breaking change type WhereClauseWithoutOperator left is null in some cases but this is not represented in the type definitions - but representing there is a breaking change for consumers even though it truly could be null and cause bugs. reverting change, then will release breaking package. --- src/api/api-models.ts | 2 +- src/parser/visitor.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/api/api-models.ts b/src/api/api-models.ts index f96bf06..dac7bda 100644 --- a/src/api/api-models.ts +++ b/src/api/api-models.ts @@ -157,7 +157,7 @@ export interface Subquery extends QueryBase { export type WhereClause = WhereClauseWithoutOperator | WhereClauseWithRightCondition; export interface WhereClauseWithoutOperator { - left: ConditionWithValueQuery | null; + left: ConditionWithValueQuery; } export interface WhereClauseWithRightCondition extends WhereClauseWithoutOperator { diff --git a/src/parser/visitor.ts b/src/parser/visitor.ts index a2aa8b6..ad658f5 100644 --- a/src/parser/visitor.ts +++ b/src/parser/visitor.ts @@ -733,7 +733,7 @@ class SOQLVisitor extends BaseSoqlVisitor { expressionPartWithNegation(ctx: any) { const output: Partial = { - left: ctx.L_PAREN ? { openParen: ctx.L_PAREN.length } : null, + left: ctx.L_PAREN ? { openParen: ctx.L_PAREN.length } : (null as any), // FIXME: type does not allow null, but changing is a breaking change operator: 'NOT', right: { left: {} as ValueCondition, From fd244fcf4c43f4be0bab7ea954071619f9ca5646 Mon Sep 17 00:00:00 2001 From: Austin Turner Date: Sat, 13 Jan 2024 11:06:23 -0700 Subject: [PATCH 2/3] changelog --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3237a55..6c0768e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## 4.10.1 + +Jan 13, 2024 + +Revert accidental breaking change to types. `WhereClause` left can have `null` in the negation case, but the types did not represent this. +Updating types to match reality is a breaking change for consumers, so worked around issue and will publish version 5 with breaking change. + ## 4.10.0 Jan 13, 2024 From 70a0f9d2f9b0fc08ec3b9416a3aa76d099ac7a2a Mon Sep 17 00:00:00 2001 From: Austin Turner Date: Sat, 13 Jan 2024 11:07:03 -0700 Subject: [PATCH 3/3] chore: release v4.10.1 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index aab84e7..21d42b7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,11 +1,11 @@ { "name": "soql-parser-js", - "version": "4.10.0", + "version": "4.10.1", "lockfileVersion": 2, "requires": true, "packages": { "": { - "version": "4.10.0", + "version": "4.10.1", "license": "MIT", "dependencies": { "chevrotain": "^10.5.0", diff --git a/package.json b/package.json index d585a35..783f787 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "soql-parser-js", - "version": "4.10.0", + "version": "4.10.1", "description": "Salesforce.com SOQL parser and composer", "main": "dist/index.js", "module": "dist_esm/index.js",