@jetstreamapp/soql-parser-js 6.3.0 → 7.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.
@@ -1,20 +1,20 @@
1
- export declare type LogicalOperatorAnd = 'AND';
2
- export declare type LogicalOperatorOr = 'OR';
3
- export declare type LogicalOperatorNot = 'NOT';
4
- export declare type LogicalOperator = LogicalOperatorAnd | LogicalOperatorOr | LogicalOperatorNot;
5
- export declare type Operator = '=' | '!=' | '<=' | '>=' | '>' | '<' | 'LIKE' | 'IN' | 'NOT IN' | 'INCLUDES' | 'EXCLUDES';
6
- export declare type FieldTypeOfConditionType = 'WHEN' | 'ELSE';
7
- export declare type GroupSelector = 'ABOVE' | 'AT' | 'BELOW' | 'ABOVE_OR_BELOW';
8
- export declare type ForClause = 'VIEW' | 'UPDATE' | 'REFERENCE';
9
- export declare type UpdateClause = 'TRACKING' | 'VIEWSTAT';
10
- export declare type LiteralType = 'STRING' | 'INTEGER' | 'DECIMAL' | 'INTEGER_WITH_CURRENCY_PREFIX' | 'DECIMAL_WITH_CURRENCY_PREFIX' | 'BOOLEAN' | 'NULL' | 'DATETIME' | 'DATE' | 'DATE_LITERAL' | 'DATE_N_LITERAL' | 'APEX_BIND_VARIABLE' | 'SUBQUERY';
11
- export declare type FieldType = Field | FieldWithAlias | FieldFunctionExpression | FieldRelationship | FieldRelationshipWithAlias | FieldSubquery | FieldTypeOf;
12
- export declare type OrderByCriterion = 'ASC' | 'DESC';
13
- export declare type NullsOrder = 'FIRST' | 'LAST';
14
- export declare type GroupByType = 'CUBE' | 'ROLLUP';
15
- export declare type AccessLevel = 'USER_MODE' | 'SYSTEM_MODE';
16
- export declare type DateLiteral = 'YESTERDAY' | 'TODAY' | 'TOMORROW' | 'LAST_WEEK' | 'THIS_WEEK' | 'NEXT_WEEK' | 'LAST_MONTH' | 'THIS_MONTH' | 'NEXT_MONTH' | 'LAST_90_DAYS' | 'NEXT_90_DAYS' | 'THIS_QUARTER' | 'LAST_QUARTER' | 'NEXT_QUARTER' | 'THIS_YEAR' | 'LAST_YEAR' | 'NEXT_YEAR' | 'THIS_FISCAL_QUARTER' | 'LAST_FISCAL_QUARTER' | 'NEXT_FISCAL_QUARTER' | 'THIS_FISCAL_YEAR' | 'LAST_FISCAL_YEAR' | 'NEXT_FISCAL_YEAR';
17
- export declare type DateNLiteral = 'YESTERDAY' | 'NEXT_N_DAYS' | 'LAST_N_DAYS' | 'N_DAYS_AGO' | 'NEXT_N_WEEKS' | 'LAST_N_WEEKS' | 'N_WEEKS_AGO' | 'NEXT_N_MONTHS' | 'LAST_N_MONTHS' | 'N_MONTHS_AGO' | 'NEXT_N_QUARTERS' | 'LAST_N_QUARTERS' | 'N_QUARTERS_AGO' | 'NEXT_N_YEARS' | 'LAST_N_YEARS' | 'N_YEARS_AGO' | 'NEXT_N_FISCAL_QUARTERS' | 'LAST_N_FISCAL_QUARTERS' | 'N_FISCAL_QUARTERS_AGO' | 'NEXT_N_FISCAL_YEARS' | 'LAST_N_FISCAL_YEARS' | 'N_FISCAL_YEARS_AGO';
1
+ export type LogicalOperatorAnd = 'AND';
2
+ export type LogicalOperatorOr = 'OR';
3
+ export type LogicalOperatorNot = 'NOT';
4
+ export type LogicalOperator = LogicalOperatorAnd | LogicalOperatorOr | LogicalOperatorNot;
5
+ export type Operator = '=' | '!=' | '<=' | '>=' | '>' | '<' | 'LIKE' | 'IN' | 'NOT IN' | 'INCLUDES' | 'EXCLUDES';
6
+ export type FieldTypeOfConditionType = 'WHEN' | 'ELSE';
7
+ export type GroupSelector = 'ABOVE' | 'AT' | 'BELOW' | 'ABOVE_OR_BELOW';
8
+ export type ForClause = 'VIEW' | 'UPDATE' | 'REFERENCE';
9
+ export type UpdateClause = 'TRACKING' | 'VIEWSTAT';
10
+ export type LiteralType = 'STRING' | 'INTEGER' | 'DECIMAL' | 'INTEGER_WITH_CURRENCY_PREFIX' | 'DECIMAL_WITH_CURRENCY_PREFIX' | 'BOOLEAN' | 'NULL' | 'DATETIME' | 'DATE' | 'DATE_LITERAL' | 'DATE_N_LITERAL' | 'APEX_BIND_VARIABLE' | 'SUBQUERY';
11
+ export type FieldType = Field | FieldWithAlias | FieldFunctionExpression | FieldRelationship | FieldRelationshipWithAlias | FieldSubquery | FieldTypeOf;
12
+ export type OrderByCriterion = 'ASC' | 'DESC';
13
+ export type NullsOrder = 'FIRST' | 'LAST';
14
+ export type GroupByType = 'CUBE' | 'ROLLUP';
15
+ export type AccessLevel = 'USER_MODE' | 'SYSTEM_MODE';
16
+ export type DateLiteral = 'YESTERDAY' | 'TODAY' | 'TOMORROW' | 'LAST_WEEK' | 'THIS_WEEK' | 'NEXT_WEEK' | 'LAST_MONTH' | 'THIS_MONTH' | 'NEXT_MONTH' | 'LAST_90_DAYS' | 'NEXT_90_DAYS' | 'THIS_QUARTER' | 'LAST_QUARTER' | 'NEXT_QUARTER' | 'THIS_YEAR' | 'LAST_YEAR' | 'NEXT_YEAR' | 'THIS_FISCAL_QUARTER' | 'LAST_FISCAL_QUARTER' | 'NEXT_FISCAL_QUARTER' | 'THIS_FISCAL_YEAR' | 'LAST_FISCAL_YEAR' | 'NEXT_FISCAL_YEAR';
17
+ export type DateNLiteral = 'YESTERDAY' | 'NEXT_N_DAYS' | 'LAST_N_DAYS' | 'N_DAYS_AGO' | 'NEXT_N_WEEKS' | 'LAST_N_WEEKS' | 'N_WEEKS_AGO' | 'NEXT_N_MONTHS' | 'LAST_N_MONTHS' | 'N_MONTHS_AGO' | 'NEXT_N_QUARTERS' | 'LAST_N_QUARTERS' | 'N_QUARTERS_AGO' | 'NEXT_N_YEARS' | 'LAST_N_YEARS' | 'N_YEARS_AGO' | 'NEXT_N_FISCAL_QUARTERS' | 'LAST_N_FISCAL_QUARTERS' | 'N_FISCAL_QUARTERS_AGO' | 'NEXT_N_FISCAL_YEARS' | 'LAST_N_FISCAL_YEARS' | 'N_FISCAL_YEARS_AGO';
18
18
  export interface Field {
19
19
  type: 'Field';
20
20
  field: string;
@@ -79,7 +79,7 @@ export interface Subquery extends QueryBase {
79
79
  relationshipName: string;
80
80
  sObjectPrefix?: string[];
81
81
  }
82
- export declare type WhereClause = WhereClauseWithoutOperator | WhereClauseWithoutNegationOperator | WhereClauseWithRightCondition;
82
+ export type WhereClause = WhereClauseWithoutOperator | WhereClauseWithoutNegationOperator | WhereClauseWithRightCondition;
83
83
  export interface WhereClauseWithoutOperator {
84
84
  left: ConditionWithValueQuery;
85
85
  }
@@ -92,8 +92,8 @@ export interface WhereClauseWithoutNegationOperator {
92
92
  operator: LogicalOperatorNot;
93
93
  right: WhereClause;
94
94
  }
95
- export declare type Condition = ValueCondition | ValueWithDateLiteralCondition | ValueWithDateNLiteralCondition | ValueFunctionCondition | NegationCondition;
96
- export declare type ConditionWithValueQuery = Condition | ValueQueryCondition;
95
+ export type Condition = ValueCondition | ValueWithDateLiteralCondition | ValueWithDateNLiteralCondition | ValueFunctionCondition | NegationCondition;
96
+ export type ConditionWithValueQuery = Condition | ValueQueryCondition;
97
97
  export interface OptionalParentheses {
98
98
  openParen?: number;
99
99
  closeParen?: number;
@@ -132,7 +132,7 @@ export interface ValueFunctionCondition extends OptionalParentheses {
132
132
  export interface NegationCondition {
133
133
  openParen: number;
134
134
  }
135
- export declare type OrderByClause = OrderByFieldClause | OrderByFnClause;
135
+ export type OrderByClause = OrderByFieldClause | OrderByFnClause;
136
136
  export interface OrderByOptionalFieldsClause {
137
137
  order?: OrderByCriterion;
138
138
  nulls?: NullsOrder;
@@ -143,14 +143,14 @@ export interface OrderByFieldClause extends OrderByOptionalFieldsClause {
143
143
  export interface OrderByFnClause extends OrderByOptionalFieldsClause {
144
144
  fn: FunctionExp;
145
145
  }
146
- export declare type GroupByClause = GroupByFieldClause | GroupByFnClause;
146
+ export type GroupByClause = GroupByFieldClause | GroupByFnClause;
147
147
  export interface GroupByFieldClause {
148
148
  field: string;
149
149
  }
150
150
  export interface GroupByFnClause {
151
151
  fn: FunctionExp;
152
152
  }
153
- export declare type HavingClause = HavingClauseWithoutOperator | HavingClauseWithRightCondition;
153
+ export type HavingClause = HavingClauseWithoutOperator | HavingClauseWithRightCondition;
154
154
  export interface HavingClauseWithoutOperator {
155
155
  left: Condition;
156
156
  }
@@ -1,7 +1,7 @@
1
1
  import { hasAlias, isFieldSubquery, isGroupByField, isGroupByFn, isHavingClauseWithRightCondition, isNegationCondition, isOrderByField, isOrderByFn, isString, isSubquery, isValueCondition, isValueFunctionCondition, isValueQueryCondition, isValueWithDateLiteralCondition, isValueWithDateNLiteralCondition, isWhereClauseWithRightCondition, isWhereOrHavingClauseWithRightCondition } from '../utils';
2
2
  import * as SoqlModels from './api-models';
3
3
  export { hasAlias, isFieldSubquery, isGroupByField, isGroupByFn, isHavingClauseWithRightCondition, isNegationCondition, isOrderByField, isOrderByFn, isString, isSubquery, isValueCondition, isValueFunctionCondition, isValueQueryCondition, isValueWithDateLiteralCondition, isValueWithDateNLiteralCondition, isWhereClauseWithRightCondition, isWhereOrHavingClauseWithRightCondition, };
4
- export declare type ComposeFieldInput = ComposeField | ComposeFieldFunction | ComposeFieldRelationship | ComposeFieldSubquery | ComposeFieldTypeof;
4
+ export type ComposeFieldInput = ComposeField | ComposeFieldFunction | ComposeFieldRelationship | ComposeFieldSubquery | ComposeFieldTypeof;
5
5
  export interface ComposeField {
6
6
  field: string;
7
7
  objectPrefix?: string;
@@ -1,7 +1,6 @@
1
- export { parseQuery, isQueryValid } from './parser/visitor';
1
+ export { parseQuery, isQueryValid } from './parser/parser';
2
2
  export * from './api/api-models';
3
3
  export * from './api/public-utils';
4
4
  export * from './composer/composer';
5
5
  export type { FormatOptions } from './formatter/formatter';
6
6
  export type { ParseQueryConfig } from './parser/parser';
7
- export type { CstNode, CstParser, ILexingError, IRecognitionException } from 'chevrotain';
@@ -1,187 +1,184 @@
1
- import { TokenType } from 'chevrotain';
2
- export interface TokenVocabulary {
3
- [vocab: string]: TokenType;
1
+ export declare enum TokenKind {
2
+ AND = 0,
3
+ AS = 1,
4
+ ASC = 2,
5
+ DESC = 3,
6
+ CUBE = 4,
7
+ ELSE = 5,
8
+ EXCLUDES = 6,
9
+ FALSE = 7,
10
+ FIRST = 8,
11
+ FROM = 9,
12
+ GROUP_BY = 10,
13
+ HAVING = 11,
14
+ IN = 12,
15
+ INCLUDES = 13,
16
+ LAST = 14,
17
+ LIKE = 15,
18
+ LIMIT = 16,
19
+ NOT = 17,
20
+ NULL = 18,
21
+ NULLS = 19,
22
+ OR = 20,
23
+ ORDER_BY = 21,
24
+ ROLLUP = 22,
25
+ SELECT = 23,
26
+ TRUE = 24,
27
+ USING = 25,
28
+ WHERE = 26,
29
+ WITH = 27,
30
+ FOR = 28,
31
+ UPDATE = 29,
32
+ ABOVE = 30,
33
+ ABOVE_OR_BELOW = 31,
34
+ APEX_NEW = 32,
35
+ AT = 33,
36
+ BELOW = 34,
37
+ DATA_CATEGORY = 35,
38
+ END = 36,
39
+ OFFSET = 37,
40
+ REFERENCE = 38,
41
+ SCOPE = 39,
42
+ TRACKING = 40,
43
+ THEN = 41,
44
+ TYPEOF = 42,
45
+ VIEW = 43,
46
+ VIEWSTAT = 44,
47
+ WHEN = 45,
48
+ SECURITY_ENFORCED = 46,
49
+ SYSTEM_MODE = 47,
50
+ USER_MODE = 48,
51
+ CALENDAR_MONTH = 49,
52
+ CALENDAR_QUARTER = 50,
53
+ CALENDAR_YEAR = 51,
54
+ DAY_IN_MONTH = 52,
55
+ DAY_IN_WEEK = 53,
56
+ DAY_IN_YEAR = 54,
57
+ DAY_ONLY = 55,
58
+ FISCAL_MONTH = 56,
59
+ FISCAL_QUARTER = 57,
60
+ FISCAL_YEAR = 58,
61
+ HOUR_IN_DAY = 59,
62
+ WEEK_IN_MONTH = 60,
63
+ WEEK_IN_YEAR = 61,
64
+ AVG = 62,
65
+ COUNT = 63,
66
+ COUNT_DISTINCT = 64,
67
+ MIN = 65,
68
+ MAX = 66,
69
+ SUM = 67,
70
+ DISTANCE = 68,
71
+ GEOLOCATION = 69,
72
+ FIELDS = 70,
73
+ FORMAT = 71,
74
+ TOLABEL = 72,
75
+ CONVERT_TIMEZONE = 73,
76
+ CONVERT_CURRENCY = 74,
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
4
163
  }
5
- export declare const ReservedKeyword: TokenType;
6
- export declare const Keyword: TokenType;
7
- export declare const DateFunction: TokenType;
8
- export declare const AggregateFunction: TokenType;
9
- export declare const LocationFunction: TokenType;
10
- export declare const FieldsFunction: TokenType;
11
- export declare const FieldsFunctionParamIdentifier: TokenType;
12
- export declare const OtherFunction: TokenType;
13
- export declare const DateLiteral: TokenType;
14
- export declare const DateLiteralNotIdentifier: TokenType;
15
- export declare const DateNLiteral: TokenType;
16
- export declare const RelationalOperator: TokenType;
17
- export declare const SymbolIdentifier: TokenType;
18
- export declare const DateIdentifier: TokenType;
19
- export declare const NumberIdentifier: TokenType;
20
- export declare const DecimalNumberIdentifier: TokenType;
21
- export declare const IntegerNumberIdentifier: TokenType;
22
- export declare const IdentifierNotKeyword: TokenType;
23
- export declare const UsingScopeEnumeration: TokenType;
24
- export declare const RParenMismatch: TokenType;
25
- export declare const Identifier: TokenType;
26
- export declare const StringIdentifier: TokenType;
27
- export declare const WhiteSpace: TokenType;
28
- export declare const And: TokenType;
29
- export declare const As: TokenType;
30
- export declare const Desc: TokenType;
31
- export declare const Asc: TokenType;
32
- export declare const OrderBy: TokenType;
33
- export declare const Cube: TokenType;
34
- export declare const Else: TokenType;
35
- export declare const Excludes: TokenType;
36
- export declare const False: TokenType;
37
- export declare const First: TokenType;
38
- export declare const From: TokenType;
39
- export declare const GroupBy: TokenType;
40
- export declare const Having: TokenType;
41
- export declare const In: TokenType;
42
- export declare const Includes: TokenType;
43
- export declare const Last: TokenType;
44
- export declare const Like: TokenType;
45
- export declare const Limit: TokenType;
46
- export declare const Not: TokenType;
47
- export declare const Null: TokenType;
48
- export declare const Nulls: TokenType;
49
- export declare const Or: TokenType;
50
- export declare const Rollup: TokenType;
51
- export declare const Select: TokenType;
52
- export declare const True: TokenType;
53
- export declare const Using: TokenType;
54
- export declare const Where: TokenType;
55
- export declare const With: TokenType;
56
- export declare const For: TokenType;
57
- export declare const Update: TokenType;
58
- export declare const Above: TokenType;
59
- export declare const AboveOrBelow: TokenType;
60
- export declare const ApexNew: TokenType;
61
- export declare const At: TokenType;
62
- export declare const Below: TokenType;
63
- export declare const DataCategory: TokenType;
64
- export declare const End: TokenType;
65
- export declare const Offset: TokenType;
66
- export declare const Reference: TokenType;
67
- export declare const Scope: TokenType;
68
- export declare const Tracking: TokenType;
69
- export declare const Then: TokenType;
70
- export declare const Typeof: TokenType;
71
- export declare const View: TokenType;
72
- export declare const Viewstat: TokenType;
73
- export declare const When: TokenType;
74
- export declare const SecurityEnforced: TokenType;
75
- export declare const SystemMode: TokenType;
76
- export declare const UserMode: TokenType;
77
- export declare const CalendarMonth: TokenType;
78
- export declare const CalendarQuarter: TokenType;
79
- export declare const CalendarYear: TokenType;
80
- export declare const DayInMonth: TokenType;
81
- export declare const DayInWeek: TokenType;
82
- export declare const DayInYear: TokenType;
83
- export declare const DayOnly: TokenType;
84
- export declare const FiscalMonth: TokenType;
85
- export declare const FiscalQuarter: TokenType;
86
- export declare const FiscalYear: TokenType;
87
- export declare const HourInDay: TokenType;
88
- export declare const WeekInMonth: TokenType;
89
- export declare const WeekInYear: TokenType;
90
- export declare const Avg: TokenType;
91
- export declare const Count: TokenType;
92
- export declare const CountDistinct: TokenType;
93
- export declare const Min: TokenType;
94
- export declare const Max: TokenType;
95
- export declare const Sum: TokenType;
96
- export declare const Distance: TokenType;
97
- export declare const Geolocation: TokenType;
98
- export declare const Fields: TokenType;
99
- export declare const Format: TokenType;
100
- export declare const Tolabel: TokenType;
101
- export declare const ConvertTimeZone: TokenType;
102
- export declare const ConvertCurrency: TokenType;
103
- export declare const Grouping: TokenType;
104
- export declare const All: TokenType;
105
- export declare const Custom: TokenType;
106
- export declare const Standard: TokenType;
107
- export declare const Yesterday: TokenType;
108
- export declare const Today: TokenType;
109
- export declare const Tomorrow: TokenType;
110
- export declare const LastWeek: TokenType;
111
- export declare const ThisWeek: TokenType;
112
- export declare const NextWeek: TokenType;
113
- export declare const LastMonth: TokenType;
114
- export declare const ThisMonth: TokenType;
115
- export declare const NextMonth: TokenType;
116
- export declare const Last90_days: TokenType;
117
- export declare const Next90_days: TokenType;
118
- export declare const ThisQuarter: TokenType;
119
- export declare const LastQuarter: TokenType;
120
- export declare const NextQuarter: TokenType;
121
- export declare const ThisYear: TokenType;
122
- export declare const LastYear: TokenType;
123
- export declare const NextYear: TokenType;
124
- export declare const ThisFiscalQuarter: TokenType;
125
- export declare const LastFiscalQuarter: TokenType;
126
- export declare const NextFiscalQuarter: TokenType;
127
- export declare const ThisFiscalYear: TokenType;
128
- export declare const LastFiscalYear: TokenType;
129
- export declare const NextFiscalYear: TokenType;
130
- export declare const NextNDays: TokenType;
131
- export declare const LastNDays: TokenType;
132
- export declare const NDaysAgo: TokenType;
133
- export declare const NextNWeeks: TokenType;
134
- export declare const LastNWeeks: TokenType;
135
- export declare const NWeeksAgo: TokenType;
136
- export declare const NextNMonths: TokenType;
137
- export declare const LastNMonths: TokenType;
138
- export declare const NMonthsAgo: TokenType;
139
- export declare const NextNQuarters: TokenType;
140
- export declare const LastNQuarters: TokenType;
141
- export declare const NQuartersAgo: TokenType;
142
- export declare const NextNYears: TokenType;
143
- export declare const LastNYears: TokenType;
144
- export declare const NYearsAgo: TokenType;
145
- export declare const NextNFiscalQuarters: TokenType;
146
- export declare const LastNFiscalQuarters: TokenType;
147
- export declare const NFiscalQuartersAgo: TokenType;
148
- export declare const NextNFiscalYears: TokenType;
149
- export declare const LastNFiscalYears: TokenType;
150
- export declare const NFiscalYearsAgo: TokenType;
151
- export declare const Equal: TokenType;
152
- export declare const NotEqual: TokenType;
153
- export declare const LessThan: TokenType;
154
- export declare const LessThanOrEqual: TokenType;
155
- export declare const GreaterThan: TokenType;
156
- export declare const GreaterThanOrEqual: TokenType;
157
- export declare const Decimal: TokenType;
158
- export declare const Colon: TokenType;
159
- export declare const Semicolon: TokenType;
160
- export declare const Comma: TokenType;
161
- export declare const Asterisk: TokenType;
162
- export declare const LParen: TokenType;
163
- export declare const RParen: TokenType;
164
- export declare const LSquareBracket: TokenType;
165
- export declare const RSquareBracket: TokenType;
166
- export declare const Plus: TokenType;
167
- export declare const Minus: TokenType;
168
- export declare const DateTime: TokenType;
169
- export declare const DateToken: TokenType;
170
- export declare const CurrencyPrefixedDecimal: TokenType;
171
- export declare const SignedDecimal: TokenType;
172
- export declare const UnsignedDecimal: TokenType;
173
- export declare const CurrencyPrefixedInteger: TokenType;
174
- export declare const SignedInteger: TokenType;
175
- export declare const GeolocationUnit: TokenType;
176
- export declare const UnsignedInteger: TokenType;
177
- export declare const Delegated: TokenType;
178
- export declare const Everything: TokenType;
179
- export declare const MineAndMyGroups: TokenType;
180
- export declare const Mine: TokenType;
181
- export declare const MyTerritory: TokenType;
182
- export declare const MyTeamTerritory: TokenType;
183
- export declare const Team: TokenType;
184
- export declare const AllPrivate: TokenType;
185
- export declare const Mru: TokenType;
186
- export declare const allTokens: TokenType[];
187
- export declare function lex(soql: string): import("chevrotain").ILexingResult;
164
+ export interface Token {
165
+ kind: TokenKind;
166
+ text: string;
167
+ start: number;
168
+ }
169
+ export declare function isDateFunction(kind: TokenKind): boolean;
170
+ export declare function isAggregateFunction(kind: TokenKind): boolean;
171
+ export declare function isLocationFunction(kind: TokenKind): boolean;
172
+ export declare function isFieldsFunction(kind: TokenKind): boolean;
173
+ export declare function isOtherFunction(kind: TokenKind): boolean;
174
+ export declare function isFieldsFunctionParam(kind: TokenKind): boolean;
175
+ export declare function isDateLiteral(kind: TokenKind): boolean;
176
+ export declare function isDateNLiteral(kind: TokenKind): boolean;
177
+ export declare function isUsingScopeEnumeration(kind: TokenKind): boolean;
178
+ export declare function isIdentifierLike(kind: TokenKind): boolean;
179
+ export declare function isNumberLiteral(kind: TokenKind): boolean;
180
+ export declare function isDecimalNumberLiteral(kind: TokenKind): boolean;
181
+ export declare function isIntegerNumberLiteral(kind: TokenKind): boolean;
182
+ export declare function isRelationalOperator(kind: TokenKind): boolean;
183
+ export declare function tokenTypeName(kind: TokenKind): string;
184
+ export declare function tokenize(input: string): Token[];
@@ -1,89 +1,9 @@
1
- import { CstNode, CstParser, IRecognitionException } from 'chevrotain';
1
+ import { Query } from '../api/api-models';
2
2
  export interface ParseQueryConfig {
3
3
  allowPartialQuery?: boolean;
4
4
  allowApexBindVariables?: boolean;
5
5
  ignoreParseErrors?: boolean;
6
6
  logErrors?: boolean;
7
7
  }
8
- declare class ParsingError extends Error {
9
- constructor(parsingError: IRecognitionException);
10
- }
11
- export declare class SoqlParser extends CstParser {
12
- private $_dateFunctionOr;
13
- private $_aggregateFunction;
14
- private $_otherFunction;
15
- private $_atomicExpression;
16
- private $_apexBindVariableExpression;
17
- private $_arrayExpression;
18
- private $_relationalOperator;
19
- private $_selectClause;
20
- private $_selectClauseFunctionIdentifier;
21
- private $_withDataCategoryArr;
22
- allowApexBindVariables: boolean;
23
- ignoreParseErrors: boolean;
24
- constructor({ ignoreParseErrors }?: {
25
- ignoreParseErrors?: boolean | null;
26
- });
27
- selectStatement: import("chevrotain").ParserMethod<[], CstNode>;
28
- selectStatementPartial: import("chevrotain").ParserMethod<[], CstNode>;
29
- clauseStatements: import("chevrotain").ParserMethod<[], CstNode>;
30
- private $_checkBalancedParens;
31
- private selectClause;
32
- private selectClauseFunctionIdentifier;
33
- private selectClauseSubqueryIdentifier;
34
- private selectClauseTypeOf;
35
- private selectClauseIdentifier;
36
- private selectClauseTypeOfThen;
37
- private selectClauseTypeOfElse;
38
- private fromClause;
39
- private usingScopeClause;
40
- private whereClause;
41
- private whereClauseSubqueryIdentifier;
42
- private conditionExpression;
43
- private withClause;
44
- private withDataCategory;
45
- private withDataCategoryArr;
46
- private groupByClause;
47
- private havingClause;
48
- private orderByClause;
49
- private orderByExpression;
50
- private orderByGroupingFunctionExpression;
51
- private orderBySpecialFunctionExpression;
52
- private limitClause;
53
- private offsetClause;
54
- private dateFunction;
55
- private aggregateFunction;
56
- private fieldsFunction;
57
- private otherFunction;
58
- private cubeFunction;
59
- private rollupFunction;
60
- private functionExpression;
61
- private locationFunction;
62
- private geolocationFunction;
63
- private expressionPartWithNegation;
64
- private expression;
65
- private expressionWithRelationalOperator;
66
- private expressionWithSetOperator;
67
- private atomicExpression;
68
- private apexBindVariableExpression;
69
- private apexBindVariableIdentifier;
70
- private apexBindVariableNewInstantiation;
71
- private apexBindVariableFunctionCall;
72
- private apexBindVariableGeneric;
73
- private apexBindVariableFunctionParams;
74
- private apexBindVariableFunctionArrayAccessor;
75
- private arrayExpression;
76
- private relationalOperator;
77
- private setOperator;
78
- private notInOperator;
79
- private booleanValue;
80
- private dateNLiteral;
81
- private forViewOrReference;
82
- private updateTrackingViewstat;
83
- private getParenCount;
84
- }
85
- export declare function parse(soql: string, options?: ParseQueryConfig): {
86
- cst: CstNode;
87
- parseErrors: ParsingError[];
88
- };
89
- export {};
8
+ export declare function parseQuery(soql: string, options?: ParseQueryConfig): Query;
9
+ export declare function isQueryValid(soql: string, options?: ParseQueryConfig): boolean;
@@ -1,7 +1,5 @@
1
- import { IToken } from 'chevrotain';
2
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';
3
2
  import { ComposeField, ComposeFieldFunction, ComposeFieldRelationship, ComposeFieldSubquery, ComposeFieldTypeof } from './api/public-utils';
4
- export declare function isToken(val: any): val is IToken[] | IToken;
5
3
  export declare function isSubqueryFromFlag(val: any, isSubquery: boolean): val is Subquery;
6
4
  export declare function isString(val: any): val is string;
7
5
  export declare function isStringArray(val: any[]): val is string[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jetstreamapp/soql-parser-js",
3
- "version": "6.3.0",
3
+ "version": "7.0.0",
4
4
  "description": "Salesforce.com SOQL parser and composer",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.mjs",
@@ -45,24 +45,15 @@
45
45
  "package.json",
46
46
  "README.md"
47
47
  ],
48
- "dependencies": {
49
- "chevrotain": "^11.0.3",
50
- "commander": "^2.20.3",
51
- "lodash.get": "^4.4.2"
52
- },
53
48
  "devDependencies": {
54
- "@types/lodash.get": "^4.4.9",
55
- "@types/node": "^20.14.2",
56
- "@vitest/ui": "^3.1.3",
57
- "chalk": "^4.1.2",
58
- "esbuild": "0.25.4",
59
- "license-webpack-plugin": "^4.0.2",
49
+ "@types/node": "^25.5.0",
50
+ "esbuild": "^0.27.4",
51
+ "lodash.get": "^4.4.2",
60
52
  "npm-run-all": "^4.1.5",
61
- "prettier": "^3.3.2",
62
- "release-it": "^17.0.1",
63
- "tsx": "^4.19.4",
64
- "typescript": "^4.2.3",
65
- "vitest": "^3.1.3"
53
+ "prettier": "^3.8.1",
54
+ "release-it": "^19.2.4",
55
+ "typescript": "^5.9.3",
56
+ "vitest": "^4.1.0"
66
57
  },
67
58
  "keywords": [
68
59
  "soql",