@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.
@@ -1,42 +1,160 @@
1
- import { FieldTypeOfCondition } from '../api/api-models';
2
- export interface FieldData {
3
- fields: {
4
- text: string;
5
- typeOfClause?: string[];
6
- isSubquery: boolean;
7
- prefix: string;
8
- suffix: string;
9
- }[];
10
- isSubquery: boolean;
11
- lineBreaks: number[];
12
- }
1
+ import { HavingClause, Query, Subquery, WhereClause } from '../api/api-models';
13
2
  export interface FormatOptions {
3
+ /**
4
+ * @default 1
5
+ *
6
+ * Number of times `indentString` is repeated for each level of indentation.
7
+ */
14
8
  numIndent?: number;
9
+ /**
10
+ * @default '\t'
11
+ *
12
+ * The string used for one unit of indentation. Combined with `numIndent` to produce each indentation level.
13
+ * For example `{ indentString: ' ', numIndent: 2 }` indents with two spaces per level.
14
+ * Must be whitespace only (spaces and/or tabs) - any other value would produce invalid SOQL and is ignored.
15
+ */
16
+ indentString?: string;
17
+ /**
18
+ * @default 60
19
+ *
20
+ * Number of characters before wrapping to a new line.
21
+ * Set to 0 or 1 to force every field on a new line.
22
+ * TYPEOF fields do not honor this setting, they will always be on one line unless `newLineAfterKeywords` is true,
23
+ * in which case it will span multiple lines.
24
+ * This also applies to the items of GROUP BY and ORDER BY clauses.
25
+ */
15
26
  fieldMaxLineLength?: number;
27
+ /**
28
+ * @default true
29
+ *
30
+ * Set to true to have a subquery parentheses start and end on a new line.
31
+ * This will be set to true if `newLineAfterKeywords` is true, in which case this property can be omitted
32
+ */
16
33
  fieldSubqueryParensOnOwnLine?: boolean;
34
+ /** @deprecated as of 3.3.0 - this is always true and will be removed in future version */
17
35
  whereClauseOperatorsIndented?: boolean;
36
+ /**
37
+ * @default false
38
+ *
39
+ * Adds a new line and indent after all keywords (such as SELECT, FROM, WHERE, ORDER BY, etc..)
40
+ * Setting this to true will add new lines in other places as well, such as complex WHERE clauses
41
+ */
18
42
  newLineAfterKeywords?: boolean;
43
+ /** @deprecated as of 8.0.0 - this is ignored and will be removed in a future version */
19
44
  logging?: boolean;
20
45
  }
46
+ export type ResolvedFormatOptions = Required<Pick<FormatOptions, 'numIndent' | 'indentString' | 'fieldMaxLineLength' | 'fieldSubqueryParensOnOwnLine' | 'newLineAfterKeywords'>>;
47
+ /**
48
+ * Applies defaults to the provided format options
49
+ */
50
+ export declare function resolveFormatOptions(options?: FormatOptions): ResolvedFormatOptions;
51
+ /**
52
+ * Formatter
53
+ * Turns a parsed query into a formatted, multi-line SOQL string based on the provided `FormatOptions`.
54
+ *
55
+ * The formatter walks the query and produces a list of `Line`s, where every line carries its absolute
56
+ * indentation level. Nested structures (subqueries, parenthesized WHERE conditions) simply pass a deeper
57
+ * base indentation to their children, so indentation is always known when a line is created and never
58
+ * needs to be fixed up after the fact. Rendering the lines to a string is the final step.
59
+ *
60
+ * Indentation rules (`b` is the indentation level of the query's keywords):
61
+ * - Clause keywords (SELECT, FROM, WHERE, ...) are at `b`. Values are on the same line, or at `b + 1` if `newLineAfterKeywords` is true.
62
+ * - SELECT fields wrap at `fieldMaxLineLength` onto lines at `b + 1`. Subquery and TYPEOF fields are always on their own line(s).
63
+ * - Subqueries in the SELECT clause: parens at `b + 1` and the subquery at `b + 2` (or the subquery at `b + 1` with the parens hugging the first and last line if `fieldSubqueryParensOnOwnLine` is false).
64
+ * - WHERE/HAVING conditions: the first condition is on the keyword line, each subsequent condition starts a new line prefixed with its AND/OR operator.
65
+ * Every open parenthesis increases the indentation of the following conditions by one level; a closing parenthesis is on its own line at the level of the group it closes.
66
+ * The exception is `(NOT <condition>)`, which is kept inline as a single unit.
67
+ * - Subqueries in WHERE conditions (`Id IN (SELECT ...)`) are one level deeper than the condition they belong to, with the closing paren at the level of the condition.
68
+ * - GROUP BY / ORDER BY items wrap at `fieldMaxLineLength` (or one per line if `newLineAfterKeywords` is true) onto lines at `b + 1`.
69
+ */
21
70
  export declare class Formatter {
22
- enabled: boolean;
23
- private options;
24
- private currIndent;
25
- constructor(enabled: boolean, options: FormatOptions);
26
- private log;
27
- private getIndent;
28
- private repeatChar;
29
- setSubquery(isSubquery: boolean): void;
30
- stepCurrIndex(num: number): void;
31
- formatFields(fieldData: FieldData): void;
32
- formatTyeOfField(text: string, typeOfClause: string[]): string;
33
- formatTypeofFieldCondition(condition: FieldTypeOfCondition): string;
34
- formatSubquery(queryStr: string, numTabs?: number, incrementTabsWhereClauseOpIndent?: boolean): string;
35
- formatClause(clause: string): string;
36
- formatText(text: string): string;
37
- formatWithIndent(text: string): string;
38
- formatOrderByArray(groupBy: string[]): string;
39
- formatParens(count: number | undefined, character: '(' | ')', leadingParenInline?: boolean): string;
40
- formatWhereClauseOperators(operator: string, whereClause: string, additionalIndent?: number): string;
41
- formatAddNewLine(alt?: string, skipNewLineAndIndent?: boolean): string;
71
+ readonly options: ResolvedFormatOptions;
72
+ constructor(options?: FormatOptions);
73
+ /**
74
+ * Formats a query (or subquery) into a multi-line SOQL string
75
+ */
76
+ formatQuery(query: Query | Subquery): string;
77
+ /**
78
+ * Formats a WHERE or HAVING clause (without the keyword).
79
+ * The first line is not indented, so the result can be placed directly after a keyword.
80
+ */
81
+ formatWhereOrHavingClause(whereOrHaving: WhereClause | HavingClause, base?: number): string;
82
+ /**
83
+ * Formats a subquery from the SELECT clause, including the surrounding parentheses
84
+ */
85
+ formatSubqueryField(subquery: Subquery): string;
86
+ /**
87
+ * Formats a comma separated list of items (e.g. GROUP BY or ORDER BY items), wrapping based on the format options.
88
+ * The first line is not indented, so the result can be placed directly after a keyword.
89
+ */
90
+ formatList(items: string[]): string;
91
+ /**
92
+ * Renders lines to a string, applying the configured indentation
93
+ */
94
+ private render;
95
+ /**
96
+ * Renders lines to a string, but without indenting the first line
97
+ */
98
+ private renderFragment;
99
+ private indent;
100
+ /**
101
+ * Produces the lines for a query (or subquery), with all keywords at indentation level `base`
102
+ */
103
+ private query;
104
+ /**
105
+ * `KEYWORD value` on one line, or `KEYWORD` followed by the value on the next line if `newLineAfterKeywords` is true
106
+ */
107
+ private clause;
108
+ /**
109
+ * Adds a keyword followed by pre-built lines.
110
+ * The first line continues on the keyword line, unless `newLineAfterKeywords` is true, in which case all lines are on their own line.
111
+ */
112
+ private keywordThen;
113
+ /**
114
+ * SELECT clause - wraps fields based on `fieldMaxLineLength`, subqueries and TYPEOF fields are always on their own line(s)
115
+ */
116
+ private selectClause;
117
+ /**
118
+ * The shared wrapping budget for comma separated items, used by the SELECT clause and by GROUP BY / ORDER BY
119
+ * so that `fieldMaxLineLength` means the same thing everywhere.
120
+ *
121
+ * `startsNewRow` is called once per item, in order, and returns true when that item has to start a new row.
122
+ * The `", "` separator that follows every item except the last counts towards the budget, and an item that
123
+ * wraps carries its own length onto the new row, so a row never exceeds `fieldMaxLineLength` unless a
124
+ * single item is longer than the whole budget. This is also what makes `fieldMaxLineLength` of 0 or 1 put
125
+ * every item on its own line.
126
+ */
127
+ private wrapper;
128
+ /**
129
+ * Subquery in the SELECT clause. `indent` is the level of the parentheses.
130
+ */
131
+ private selectSubquery;
132
+ /**
133
+ * TYPEOF field. On one line, or split by keyword if `newLineAfterKeywords` is true.
134
+ */
135
+ private typeOfField;
136
+ /**
137
+ * GROUP BY / ORDER BY - comma separated items that wrap at `fieldMaxLineLength` (or one per line if `newLineAfterKeywords` is true)
138
+ */
139
+ private listClause;
140
+ private listRows;
141
+ /**
142
+ * WHERE / HAVING conditions.
143
+ * The clause is a linked list of `left` condition + `operator` + `right` (the rest of the list), where parentheses are
144
+ * stored as open/close counts on the conditions themselves.
145
+ *
146
+ * Every open paren adds a level to the `parens` stack and indents the conditions that follow.
147
+ * A `NOT` that is immediately preceded by an open paren and immediately followed by the matching close paren
148
+ * (`(NOT Name = 'a')`) is kept together on one line - the stack tracks these "hugging" parens so the close paren stays inline too.
149
+ */
150
+ private conditions;
151
+ /**
152
+ * True if the condition following a NOT is a single condition that closes the paren the NOT is in, e.g. `(NOT Id = '1')`.
153
+ * In this case the negation is kept inline instead of splitting the parens onto their own lines.
154
+ */
155
+ private isSelfContainedNegation;
156
+ /**
157
+ * A single condition, e.g. `Name = 'foo'` or `Id IN (SELECT ...)`, appended to the current line
158
+ */
159
+ private condition;
42
160
  }
@@ -0,0 +1,15 @@
1
+ import { FormulaBinaryExpression, FormulaFunctionExp } from './api/api-models';
2
+ export declare function isFormulaFunction(value: any): value is FormulaFunctionExp;
3
+ /**
4
+ * Parses the quoted body of a `FORMULA()` call into a nested AST.
5
+ * Returns `undefined` when the source does not match the supported grammar (two field references joined by `+` or `-`)
6
+ * so the caller can report the error through the parser's normal error handling.
7
+ */
8
+ export declare function parseFormulaExpression(source: string): FormulaBinaryExpression | undefined;
9
+ /**
10
+ * Renders a formula AST back to its normalized source form, e.g. `Amount - ExpectedRevenue`.
11
+ * Used by the composer and to populate `parameters` when parsing.
12
+ * Throws when a hand-built AST does not describe two field references joined by `+` or `-`,
13
+ * so a malformed formula never composes to invalid SOQL silently.
14
+ */
15
+ export declare function renderFormulaExpression(formula: FormulaBinaryExpression): string;
@@ -1,9 +1,46 @@
1
+ /**
2
+ * Comment utilities that operate on the raw query string without parsing it.
3
+ *
4
+ * These intentionally do NOT share the lexer's scanner: the lexer is strict
5
+ * (it throws on unterminated comments and unexpected characters), while these
6
+ * utilities are lenient so they can be safely applied to any string - including
7
+ * invalid SOQL - without throwing. Only two constructs are recognized:
8
+ * string literals ('...' with backslash escapes, so comment markers inside
9
+ * strings are never treated as comments) and the two comment forms.
10
+ */
1
11
  export interface SoqlComment {
2
12
  type: 'line' | 'block';
13
+ /** Full comment text, including the `//` or `/* *\/` delimiters */
3
14
  text: string;
15
+ /** Index of the first character of the comment in the input string */
4
16
  start: number;
17
+ /** Index just past the last character of the comment (exclusive) */
5
18
  end: number;
6
19
  }
20
+ /**
21
+ * Returns all comments found in a query string, in order of appearance.
22
+ * Does not parse or validate the query and never throws.
23
+ * @param soql raw query string (does not need to be valid SOQL)
24
+ * @returns comments with their type, text (including delimiters), and position
25
+ */
7
26
  export declare function getComments(soql: string): SoqlComment[];
27
+ /**
28
+ * Returns `true` if the query string contains at least one comment.
29
+ * Does not parse or validate the query and never throws.
30
+ * @param soql raw query string (does not need to be valid SOQL)
31
+ */
8
32
  export declare function hasComments(soql: string): boolean;
33
+ /**
34
+ * Removes all comments from a query string without otherwise modifying it -
35
+ * no parsing, no reformatting, no whitespace or keyword normalization.
36
+ * If the string contains no comments, the original string is returned as-is,
37
+ * so this is safe to call unconditionally on every query.
38
+ *
39
+ * A single space is inserted in place of a removed comment when it directly
40
+ * touched non-whitespace on both sides (e.g. `SELECT Id/*c*\/FROM` becomes
41
+ * `SELECT Id FROM`) so adjacent tokens are never merged. Whitespace that
42
+ * surrounded a comment is left as-is.
43
+ * @param soql raw query string (does not need to be valid SOQL)
44
+ * @returns the query with comments removed, or the original string if there were none
45
+ */
9
46
  export declare function stripComments(soql: string): string;
@@ -75,91 +75,92 @@ export declare enum TokenKind {
75
75
  CONVERT_TIMEZONE = 73,
76
76
  CONVERT_CURRENCY = 74,
77
77
  GROUPING = 75,
78
- ALL = 76,
79
- CUSTOM = 77,
80
- STANDARD = 78,
81
- YESTERDAY = 79,
82
- TODAY = 80,
83
- TOMORROW = 81,
84
- LAST_WEEK = 82,
85
- THIS_WEEK = 83,
86
- NEXT_WEEK = 84,
87
- LAST_MONTH = 85,
88
- THIS_MONTH = 86,
89
- NEXT_MONTH = 87,
90
- LAST_90_DAYS = 88,
91
- NEXT_90_DAYS = 89,
92
- THIS_QUARTER = 90,
93
- LAST_QUARTER = 91,
94
- NEXT_QUARTER = 92,
95
- THIS_YEAR = 93,
96
- LAST_YEAR = 94,
97
- NEXT_YEAR = 95,
98
- THIS_FISCAL_QUARTER = 96,
99
- LAST_FISCAL_QUARTER = 97,
100
- NEXT_FISCAL_QUARTER = 98,
101
- THIS_FISCAL_YEAR = 99,
102
- LAST_FISCAL_YEAR = 100,
103
- NEXT_FISCAL_YEAR = 101,
104
- NEXT_N_DAYS = 102,
105
- LAST_N_DAYS = 103,
106
- N_DAYS_AGO = 104,
107
- NEXT_N_WEEKS = 105,
108
- LAST_N_WEEKS = 106,
109
- N_WEEKS_AGO = 107,
110
- NEXT_N_MONTHS = 108,
111
- LAST_N_MONTHS = 109,
112
- N_MONTHS_AGO = 110,
113
- NEXT_N_QUARTERS = 111,
114
- LAST_N_QUARTERS = 112,
115
- N_QUARTERS_AGO = 113,
116
- NEXT_N_YEARS = 114,
117
- LAST_N_YEARS = 115,
118
- N_YEARS_AGO = 116,
119
- NEXT_N_FISCAL_QUARTERS = 117,
120
- LAST_N_FISCAL_QUARTERS = 118,
121
- N_FISCAL_QUARTERS_AGO = 119,
122
- NEXT_N_FISCAL_YEARS = 120,
123
- LAST_N_FISCAL_YEARS = 121,
124
- N_FISCAL_YEARS_AGO = 122,
125
- DELEGATED = 123,
126
- EVERYTHING = 124,
127
- MINE_AND_MY_GROUPS = 125,
128
- MINE = 126,
129
- MY_TERRITORY = 127,
130
- MY_TEAM_TERRITORY = 128,
131
- TEAM = 129,
132
- ALL_PRIVATE = 130,
133
- MRU = 131,
134
- EQUAL = 132,
135
- NOT_EQUAL = 133,
136
- LESS_THAN = 134,
137
- LESS_THAN_OR_EQUAL = 135,
138
- GREATER_THAN = 136,
139
- GREATER_THAN_OR_EQUAL = 137,
140
- L_PAREN = 138,
141
- R_PAREN = 139,
142
- L_SQUARE_BRACKET = 140,
143
- R_SQUARE_BRACKET = 141,
144
- DOT = 142,
145
- COMMA = 143,
146
- COLON = 144,
147
- SEMICOLON = 145,
148
- ASTERISK = 146,
149
- PLUS = 147,
150
- MINUS = 148,
151
- DATETIME = 149,
152
- DATE_TOKEN = 150,
153
- CURRENCY_PREFIXED_DECIMAL = 151,
154
- CURRENCY_PREFIXED_INTEGER = 152,
155
- SIGNED_DECIMAL = 153,
156
- UNSIGNED_DECIMAL = 154,
157
- SIGNED_INTEGER = 155,
158
- UNSIGNED_INTEGER = 156,
159
- STRING_LITERAL = 157,
160
- GEOLOCATION_UNIT = 158,
161
- IDENTIFIER = 159,
162
- EOF = 160
78
+ FORMULA = 76,
79
+ ALL = 77,
80
+ CUSTOM = 78,
81
+ STANDARD = 79,
82
+ YESTERDAY = 80,
83
+ TODAY = 81,
84
+ TOMORROW = 82,
85
+ LAST_WEEK = 83,
86
+ THIS_WEEK = 84,
87
+ NEXT_WEEK = 85,
88
+ LAST_MONTH = 86,
89
+ THIS_MONTH = 87,
90
+ NEXT_MONTH = 88,
91
+ LAST_90_DAYS = 89,
92
+ NEXT_90_DAYS = 90,
93
+ THIS_QUARTER = 91,
94
+ LAST_QUARTER = 92,
95
+ NEXT_QUARTER = 93,
96
+ THIS_YEAR = 94,
97
+ LAST_YEAR = 95,
98
+ NEXT_YEAR = 96,
99
+ THIS_FISCAL_QUARTER = 97,
100
+ LAST_FISCAL_QUARTER = 98,
101
+ NEXT_FISCAL_QUARTER = 99,
102
+ THIS_FISCAL_YEAR = 100,
103
+ LAST_FISCAL_YEAR = 101,
104
+ NEXT_FISCAL_YEAR = 102,
105
+ NEXT_N_DAYS = 103,
106
+ LAST_N_DAYS = 104,
107
+ N_DAYS_AGO = 105,
108
+ NEXT_N_WEEKS = 106,
109
+ LAST_N_WEEKS = 107,
110
+ N_WEEKS_AGO = 108,
111
+ NEXT_N_MONTHS = 109,
112
+ LAST_N_MONTHS = 110,
113
+ N_MONTHS_AGO = 111,
114
+ NEXT_N_QUARTERS = 112,
115
+ LAST_N_QUARTERS = 113,
116
+ N_QUARTERS_AGO = 114,
117
+ NEXT_N_YEARS = 115,
118
+ LAST_N_YEARS = 116,
119
+ N_YEARS_AGO = 117,
120
+ NEXT_N_FISCAL_QUARTERS = 118,
121
+ LAST_N_FISCAL_QUARTERS = 119,
122
+ N_FISCAL_QUARTERS_AGO = 120,
123
+ NEXT_N_FISCAL_YEARS = 121,
124
+ LAST_N_FISCAL_YEARS = 122,
125
+ N_FISCAL_YEARS_AGO = 123,
126
+ DELEGATED = 124,
127
+ EVERYTHING = 125,
128
+ MINE_AND_MY_GROUPS = 126,
129
+ MINE = 127,
130
+ MY_TERRITORY = 128,
131
+ MY_TEAM_TERRITORY = 129,
132
+ TEAM = 130,
133
+ ALL_PRIVATE = 131,
134
+ MRU = 132,
135
+ EQUAL = 133,
136
+ NOT_EQUAL = 134,
137
+ LESS_THAN = 135,
138
+ LESS_THAN_OR_EQUAL = 136,
139
+ GREATER_THAN = 137,
140
+ GREATER_THAN_OR_EQUAL = 138,
141
+ L_PAREN = 139,
142
+ R_PAREN = 140,
143
+ L_SQUARE_BRACKET = 141,
144
+ R_SQUARE_BRACKET = 142,
145
+ DOT = 143,
146
+ COMMA = 144,
147
+ COLON = 145,
148
+ SEMICOLON = 146,
149
+ ASTERISK = 147,
150
+ PLUS = 148,
151
+ MINUS = 149,
152
+ DATETIME = 150,
153
+ DATE_TOKEN = 151,
154
+ CURRENCY_PREFIXED_DECIMAL = 152,
155
+ CURRENCY_PREFIXED_INTEGER = 153,
156
+ SIGNED_DECIMAL = 154,
157
+ UNSIGNED_DECIMAL = 155,
158
+ SIGNED_INTEGER = 156,
159
+ UNSIGNED_INTEGER = 157,
160
+ STRING_LITERAL = 158,
161
+ GEOLOCATION_UNIT = 159,
162
+ IDENTIFIER = 160,
163
+ EOF = 161
163
164
  }
164
165
  export interface Token {
165
166
  kind: TokenKind;
@@ -5,5 +5,11 @@ export interface ParseQueryConfig {
5
5
  ignoreParseErrors?: boolean;
6
6
  logErrors?: boolean;
7
7
  }
8
+ /**
9
+ * Parse a SOQL query string into a Query AST.
10
+ */
8
11
  export declare function parseQuery(soql: string, options?: ParseQueryConfig): Query;
12
+ /**
13
+ * Check if a SOQL query string is valid (parseable without errors).
14
+ */
9
15
  export declare function isQueryValid(soql: string, options?: ParseQueryConfig): boolean;
@@ -1,6 +1,6 @@
1
1
  import { FieldFunctionExpression, FieldRelationshipWithAlias, FieldSubquery, FieldWithAlias, GroupByFieldClause, GroupByFnClause, HavingClauseWithRightCondition, LiteralType, NegationCondition, Operator, OrderByFieldClause, OrderByFnClause, Query, Subquery, ValueCondition, ValueFunctionCondition, ValueQueryCondition, ValueWithDateLiteralCondition, ValueWithDateNLiteralCondition, WhereClauseWithRightCondition } from './api/api-models';
2
2
  import { ComposeField, ComposeFieldFunction, ComposeFieldRelationship, ComposeFieldSubquery, ComposeFieldTypeof } from './api/public-utils';
3
- export declare function isSubqueryFromFlag(val: any, isSubquery: boolean): val is Subquery;
3
+ export declare function isSubqueryFromFlag(val: any, isSubqueryFlag: boolean): val is Subquery;
4
4
  export declare function isString(val: any): val is string;
5
5
  export declare function isStringArray(val: any[]): val is string[];
6
6
  export declare function isNumber(val: any): val is number;
@@ -13,6 +13,12 @@ export declare function getLastItem<T>(arr: T[]): T;
13
13
  export declare function getAsArrayStr(val: string | string[], alwaysParens?: boolean): string;
14
14
  export declare function pad(val: string, len: number, left?: number): string;
15
15
  export declare function generateParens(count: number, character: '(' | ')', joinCharacter?: string): string;
16
+ /**
17
+ * Gets params from a FieldFunctionExpression. If there are multiple nested functions as multiple parameters
18
+ * within another function, only the first argument will be considered.
19
+ * @param functionFieldExp
20
+ * @returns params
21
+ */
16
22
  export declare function getParams(functionFieldExp: FieldFunctionExpression): string[];
17
23
  export declare function isNestedParamAggregateFunction(functionFieldExp: FieldFunctionExpression): boolean;
18
24
  export declare function hasAlias(value: any): value is FieldWithAlias | FieldRelationshipWithAlias;
@@ -38,4 +44,13 @@ export declare function isGroupByField(value: any): value is GroupByFieldClause;
38
44
  export declare function isGroupByFn(value: any): value is GroupByFnClause;
39
45
  export declare function isArrayOperator(operator: Operator): boolean;
40
46
  export declare function getWhereValue(value: any | any[], literalType?: LiteralType | LiteralType[], operator?: Operator): any;
47
+ /**
48
+ * Escapes characters that would otherwise break a SOQL string literal.
49
+ *
50
+ * - A single quote (`'`) is escaped to `\'`.
51
+ * - A backslash followed by a known SOQL escape character is left as-is so
52
+ * users can supply already-escaped values (e.g. `\n`, `\%`, `\uXXXX`).
53
+ * - A lone backslash (one not part of a known escape sequence) is escaped to
54
+ * `\\`.
55
+ */
41
56
  export declare function escapeStringLiteral(value: string): string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jetstreamapp/soql-parser-js",
3
- "version": "7.4.1",
3
+ "version": "8.1.0",
4
4
  "salesforceApiVersion": "66.0",
5
5
  "description": "Salesforce.com SOQL parser and composer",
6
6
  "main": "dist/cjs/index.js",
@@ -16,22 +16,31 @@
16
16
  "scripts": {
17
17
  "clean": "rm -rf ./dist/*",
18
18
  "prebuild": "npm run clean",
19
- "build": "npm-run-all build:bundles build:declarations",
20
- "build:bundles": "node tasks/build.mjs",
21
- "build:esm": "node tasks/build.mjs esm",
22
- "build:lwc": "node tasks/build.mjs lwc",
23
- "build:cjs": "node tasks/build.mjs cjs",
24
- "build:cli": "node tasks/build.mjs cli",
19
+ "build": "npm run build:bundles && npm run build:declarations",
20
+ "build:bundles": "node scripts/build.mjs",
21
+ "build:esm": "node scripts/build.mjs esm",
22
+ "build:lwc": "node scripts/build.mjs lwc",
23
+ "build:cjs": "node scripts/build.mjs cjs",
24
+ "build:cli": "node scripts/build.mjs cli",
25
25
  "build:declarations": "tsc --project tsconfig.json",
26
- "tsc": "tsc",
27
- "release": "release-it",
28
- "copy-tc-to-docs": "tsx ./tasks/copy-test-cases-to-docs.ts",
29
- "test": "vitest --passWithNoTests --testTimeout 10000",
30
- "test:watch": "jest --watch",
31
- "soql-parser-js": "node ./bin"
26
+ "format": "oxfmt",
27
+ "format:check": "oxfmt --check",
28
+ "lint": "oxlint",
29
+ "lint:fix": "oxlint --fix",
30
+ "release": "node scripts/release.mjs",
31
+ "release:ci": "release-it",
32
+ "release:increment": "node scripts/derive-increment.mjs --explain",
33
+ "typecheck": "tsc --noEmit -p tsconfig.typecheck.json",
34
+ "copy-tc-to-docs": "tsx ./scripts/copy-test-cases-to-docs.ts",
35
+ "test": "vitest run",
36
+ "test:watch": "vitest",
37
+ "test:coverage": "vitest run --coverage",
38
+ "soql-parser-js": "node ./bin",
39
+ "prepare": "git config core.hooksPath .githooks || true"
32
40
  },
33
41
  "author": "Austin Turner <paustint@gmail.com>",
34
42
  "license": "MIT",
43
+ "sideEffects": false,
35
44
  "bin": {
36
45
  "soql-parser-js": "bin/soql-parser-js"
37
46
  },
@@ -52,14 +61,15 @@
52
61
  "README.md"
53
62
  ],
54
63
  "devDependencies": {
64
+ "@release-it/keep-a-changelog": "^8.0.0",
55
65
  "@types/node": "^25.5.0",
56
- "esbuild": "^0.28.0",
57
- "lodash.get": "^4.4.2",
58
- "npm-run-all": "^4.1.5",
59
- "prettier": "^3.9.6",
60
- "release-it": "^21.0.1",
61
- "tsx": "^4.23.9",
62
- "typescript": "^6.0.3",
66
+ "@vitest/coverage-v8": "^4.1.10",
67
+ "esbuild": "^0.28.2",
68
+ "oxfmt": "^0.63.0",
69
+ "oxlint": "^1.78.0",
70
+ "release-it": "^21.0.2",
71
+ "tsx": "^4.23.12",
72
+ "typescript": "^7.0.2",
63
73
  "vitest": "^4.1.10"
64
74
  },
65
75
  "keywords": [
@@ -72,5 +82,9 @@
72
82
  "repository": {
73
83
  "type": "git",
74
84
  "url": "git+https://github.com/jetstreamapp/soql-parser-js.git"
85
+ },
86
+ "allowScripts": {
87
+ "esbuild@0.28.2": true,
88
+ "fsevents@2.3.3": true
75
89
  }
76
90
  }