Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@apexdevtools/apex-parser

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@apexdevtools/apex-parser - npm Package Compare versions

Comparing version 3.1.0 to 3.2.0

3

CHANGELOG.md
# apex-parser - Changelog
## 3.2.0 - 2023-01-24
* Adds user/system mode on DML and within SOQL queries
## 3.1.0 - 2022-11-17

@@ -4,0 +7,0 @@

@@ -102,2 +102,20 @@ "use strict";

});
test('testSoqlModeKeywords', () => {
const MODES = ["USER_MODE", "SYSTEM_MODE"];
for (const mode of MODES) {
const [parser, errorCounter] = (0, SyntaxErrorCounter_1.createParser)(`SELECT Id FROM Account WITH ${mode}`);
const context = parser.query();
expect(context).toBeInstanceOf(ApexParser_1.QueryContext);
expect(errorCounter.getNumErrors()).toEqual(0);
}
});
test('testDmlModeKeywords', () => {
const MODES = ["USER", "SYSTEM"];
for (const mode of MODES) {
const [parser, errorCounter] = (0, SyntaxErrorCounter_1.createParser)(`insert as ${mode} contact;`);
const context = parser.statement();
expect(context).toBeInstanceOf(ApexParser_1.StatementContext);
expect(errorCounter.getNumErrors()).toEqual(0);
}
});
//# sourceMappingURL=ApexParserTest.js.map

378

lib/ApexLexer.d.ts

@@ -62,189 +62,193 @@ import { ATN } from "antlr4ts/atn/ATN";

static readonly MAP = 56;
static readonly SELECT = 57;
static readonly COUNT = 58;
static readonly FROM = 59;
static readonly AS = 60;
static readonly USING = 61;
static readonly SCOPE = 62;
static readonly WHERE = 63;
static readonly ORDER = 64;
static readonly BY = 65;
static readonly LIMIT = 66;
static readonly SOQLAND = 67;
static readonly SOQLOR = 68;
static readonly NOT = 69;
static readonly AVG = 70;
static readonly COUNT_DISTINCT = 71;
static readonly MIN = 72;
static readonly MAX = 73;
static readonly SUM = 74;
static readonly TYPEOF = 75;
static readonly END = 76;
static readonly THEN = 77;
static readonly LIKE = 78;
static readonly IN = 79;
static readonly INCLUDES = 80;
static readonly EXCLUDES = 81;
static readonly ASC = 82;
static readonly DESC = 83;
static readonly NULLS = 84;
static readonly FIRST = 85;
static readonly LAST = 86;
static readonly GROUP = 87;
static readonly ALL = 88;
static readonly ROWS = 89;
static readonly VIEW = 90;
static readonly HAVING = 91;
static readonly ROLLUP = 92;
static readonly TOLABEL = 93;
static readonly OFFSET = 94;
static readonly DATA = 95;
static readonly CATEGORY = 96;
static readonly AT = 97;
static readonly ABOVE = 98;
static readonly BELOW = 99;
static readonly ABOVE_OR_BELOW = 100;
static readonly SECURITY_ENFORCED = 101;
static readonly REFERENCE = 102;
static readonly CUBE = 103;
static readonly FORMAT = 104;
static readonly TRACKING = 105;
static readonly VIEWSTAT = 106;
static readonly CUSTOM = 107;
static readonly STANDARD = 108;
static readonly DISTANCE = 109;
static readonly GEOLOCATION = 110;
static readonly CALENDAR_MONTH = 111;
static readonly CALENDAR_QUARTER = 112;
static readonly CALENDAR_YEAR = 113;
static readonly DAY_IN_MONTH = 114;
static readonly DAY_IN_WEEK = 115;
static readonly DAY_IN_YEAR = 116;
static readonly DAY_ONLY = 117;
static readonly FISCAL_MONTH = 118;
static readonly FISCAL_QUARTER = 119;
static readonly FISCAL_YEAR = 120;
static readonly HOUR_IN_DAY = 121;
static readonly WEEK_IN_MONTH = 122;
static readonly WEEK_IN_YEAR = 123;
static readonly CONVERT_TIMEZONE = 124;
static readonly YESTERDAY = 125;
static readonly TODAY = 126;
static readonly TOMORROW = 127;
static readonly LAST_WEEK = 128;
static readonly THIS_WEEK = 129;
static readonly NEXT_WEEK = 130;
static readonly LAST_MONTH = 131;
static readonly THIS_MONTH = 132;
static readonly NEXT_MONTH = 133;
static readonly LAST_90_DAYS = 134;
static readonly NEXT_90_DAYS = 135;
static readonly LAST_N_DAYS_N = 136;
static readonly NEXT_N_DAYS_N = 137;
static readonly N_DAYS_AGO_N = 138;
static readonly NEXT_N_WEEKS_N = 139;
static readonly LAST_N_WEEKS_N = 140;
static readonly N_WEEKS_AGO_N = 141;
static readonly NEXT_N_MONTHS_N = 142;
static readonly LAST_N_MONTHS_N = 143;
static readonly N_MONTHS_AGO_N = 144;
static readonly THIS_QUARTER = 145;
static readonly LAST_QUARTER = 146;
static readonly NEXT_QUARTER = 147;
static readonly NEXT_N_QUARTERS_N = 148;
static readonly LAST_N_QUARTERS_N = 149;
static readonly N_QUARTERS_AGO_N = 150;
static readonly THIS_YEAR = 151;
static readonly LAST_YEAR = 152;
static readonly NEXT_YEAR = 153;
static readonly NEXT_N_YEARS_N = 154;
static readonly LAST_N_YEARS_N = 155;
static readonly N_YEARS_AGO_N = 156;
static readonly THIS_FISCAL_QUARTER = 157;
static readonly LAST_FISCAL_QUARTER = 158;
static readonly NEXT_FISCAL_QUARTER = 159;
static readonly NEXT_N_FISCAL_QUARTERS_N = 160;
static readonly LAST_N_FISCAL_QUARTERS_N = 161;
static readonly N_FISCAL_QUARTERS_AGO_N = 162;
static readonly THIS_FISCAL_YEAR = 163;
static readonly LAST_FISCAL_YEAR = 164;
static readonly NEXT_FISCAL_YEAR = 165;
static readonly NEXT_N_FISCAL_YEARS_N = 166;
static readonly LAST_N_FISCAL_YEARS_N = 167;
static readonly N_FISCAL_YEARS_AGO_N = 168;
static readonly DateLiteral = 169;
static readonly DateTimeLiteral = 170;
static readonly IntegralCurrencyLiteral = 171;
static readonly FIND = 172;
static readonly EMAIL = 173;
static readonly NAME = 174;
static readonly PHONE = 175;
static readonly SIDEBAR = 176;
static readonly FIELDS = 177;
static readonly METADATA = 178;
static readonly PRICEBOOKID = 179;
static readonly NETWORK = 180;
static readonly SNIPPET = 181;
static readonly TARGET_LENGTH = 182;
static readonly DIVISION = 183;
static readonly RETURNING = 184;
static readonly LISTVIEW = 185;
static readonly FindLiteral = 186;
static readonly FindLiteralAlt = 187;
static readonly IntegerLiteral = 188;
static readonly LongLiteral = 189;
static readonly NumberLiteral = 190;
static readonly BooleanLiteral = 191;
static readonly StringLiteral = 192;
static readonly NullLiteral = 193;
static readonly LPAREN = 194;
static readonly RPAREN = 195;
static readonly LBRACE = 196;
static readonly RBRACE = 197;
static readonly LBRACK = 198;
static readonly RBRACK = 199;
static readonly SEMI = 200;
static readonly COMMA = 201;
static readonly DOT = 202;
static readonly ASSIGN = 203;
static readonly GT = 204;
static readonly LT = 205;
static readonly BANG = 206;
static readonly TILDE = 207;
static readonly QUESTIONDOT = 208;
static readonly QUESTION = 209;
static readonly COLON = 210;
static readonly EQUAL = 211;
static readonly TRIPLEEQUAL = 212;
static readonly NOTEQUAL = 213;
static readonly LESSANDGREATER = 214;
static readonly TRIPLENOTEQUAL = 215;
static readonly AND = 216;
static readonly OR = 217;
static readonly INC = 218;
static readonly DEC = 219;
static readonly ADD = 220;
static readonly SUB = 221;
static readonly MUL = 222;
static readonly DIV = 223;
static readonly BITAND = 224;
static readonly BITOR = 225;
static readonly CARET = 226;
static readonly MAPTO = 227;
static readonly ADD_ASSIGN = 228;
static readonly SUB_ASSIGN = 229;
static readonly MUL_ASSIGN = 230;
static readonly DIV_ASSIGN = 231;
static readonly AND_ASSIGN = 232;
static readonly OR_ASSIGN = 233;
static readonly XOR_ASSIGN = 234;
static readonly LSHIFT_ASSIGN = 235;
static readonly RSHIFT_ASSIGN = 236;
static readonly URSHIFT_ASSIGN = 237;
static readonly ATSIGN = 238;
static readonly Identifier = 239;
static readonly WS = 240;
static readonly DOC_COMMENT = 241;
static readonly COMMENT = 242;
static readonly LINE_COMMENT = 243;
static readonly SYSTEM = 57;
static readonly USER = 58;
static readonly SELECT = 59;
static readonly COUNT = 60;
static readonly FROM = 61;
static readonly AS = 62;
static readonly USING = 63;
static readonly SCOPE = 64;
static readonly WHERE = 65;
static readonly ORDER = 66;
static readonly BY = 67;
static readonly LIMIT = 68;
static readonly SOQLAND = 69;
static readonly SOQLOR = 70;
static readonly NOT = 71;
static readonly AVG = 72;
static readonly COUNT_DISTINCT = 73;
static readonly MIN = 74;
static readonly MAX = 75;
static readonly SUM = 76;
static readonly TYPEOF = 77;
static readonly END = 78;
static readonly THEN = 79;
static readonly LIKE = 80;
static readonly IN = 81;
static readonly INCLUDES = 82;
static readonly EXCLUDES = 83;
static readonly ASC = 84;
static readonly DESC = 85;
static readonly NULLS = 86;
static readonly FIRST = 87;
static readonly LAST = 88;
static readonly GROUP = 89;
static readonly ALL = 90;
static readonly ROWS = 91;
static readonly VIEW = 92;
static readonly HAVING = 93;
static readonly ROLLUP = 94;
static readonly TOLABEL = 95;
static readonly OFFSET = 96;
static readonly DATA = 97;
static readonly CATEGORY = 98;
static readonly AT = 99;
static readonly ABOVE = 100;
static readonly BELOW = 101;
static readonly ABOVE_OR_BELOW = 102;
static readonly SECURITY_ENFORCED = 103;
static readonly SYSTEM_MODE = 104;
static readonly USER_MODE = 105;
static readonly REFERENCE = 106;
static readonly CUBE = 107;
static readonly FORMAT = 108;
static readonly TRACKING = 109;
static readonly VIEWSTAT = 110;
static readonly CUSTOM = 111;
static readonly STANDARD = 112;
static readonly DISTANCE = 113;
static readonly GEOLOCATION = 114;
static readonly CALENDAR_MONTH = 115;
static readonly CALENDAR_QUARTER = 116;
static readonly CALENDAR_YEAR = 117;
static readonly DAY_IN_MONTH = 118;
static readonly DAY_IN_WEEK = 119;
static readonly DAY_IN_YEAR = 120;
static readonly DAY_ONLY = 121;
static readonly FISCAL_MONTH = 122;
static readonly FISCAL_QUARTER = 123;
static readonly FISCAL_YEAR = 124;
static readonly HOUR_IN_DAY = 125;
static readonly WEEK_IN_MONTH = 126;
static readonly WEEK_IN_YEAR = 127;
static readonly CONVERT_TIMEZONE = 128;
static readonly YESTERDAY = 129;
static readonly TODAY = 130;
static readonly TOMORROW = 131;
static readonly LAST_WEEK = 132;
static readonly THIS_WEEK = 133;
static readonly NEXT_WEEK = 134;
static readonly LAST_MONTH = 135;
static readonly THIS_MONTH = 136;
static readonly NEXT_MONTH = 137;
static readonly LAST_90_DAYS = 138;
static readonly NEXT_90_DAYS = 139;
static readonly LAST_N_DAYS_N = 140;
static readonly NEXT_N_DAYS_N = 141;
static readonly N_DAYS_AGO_N = 142;
static readonly NEXT_N_WEEKS_N = 143;
static readonly LAST_N_WEEKS_N = 144;
static readonly N_WEEKS_AGO_N = 145;
static readonly NEXT_N_MONTHS_N = 146;
static readonly LAST_N_MONTHS_N = 147;
static readonly N_MONTHS_AGO_N = 148;
static readonly THIS_QUARTER = 149;
static readonly LAST_QUARTER = 150;
static readonly NEXT_QUARTER = 151;
static readonly NEXT_N_QUARTERS_N = 152;
static readonly LAST_N_QUARTERS_N = 153;
static readonly N_QUARTERS_AGO_N = 154;
static readonly THIS_YEAR = 155;
static readonly LAST_YEAR = 156;
static readonly NEXT_YEAR = 157;
static readonly NEXT_N_YEARS_N = 158;
static readonly LAST_N_YEARS_N = 159;
static readonly N_YEARS_AGO_N = 160;
static readonly THIS_FISCAL_QUARTER = 161;
static readonly LAST_FISCAL_QUARTER = 162;
static readonly NEXT_FISCAL_QUARTER = 163;
static readonly NEXT_N_FISCAL_QUARTERS_N = 164;
static readonly LAST_N_FISCAL_QUARTERS_N = 165;
static readonly N_FISCAL_QUARTERS_AGO_N = 166;
static readonly THIS_FISCAL_YEAR = 167;
static readonly LAST_FISCAL_YEAR = 168;
static readonly NEXT_FISCAL_YEAR = 169;
static readonly NEXT_N_FISCAL_YEARS_N = 170;
static readonly LAST_N_FISCAL_YEARS_N = 171;
static readonly N_FISCAL_YEARS_AGO_N = 172;
static readonly DateLiteral = 173;
static readonly DateTimeLiteral = 174;
static readonly IntegralCurrencyLiteral = 175;
static readonly FIND = 176;
static readonly EMAIL = 177;
static readonly NAME = 178;
static readonly PHONE = 179;
static readonly SIDEBAR = 180;
static readonly FIELDS = 181;
static readonly METADATA = 182;
static readonly PRICEBOOKID = 183;
static readonly NETWORK = 184;
static readonly SNIPPET = 185;
static readonly TARGET_LENGTH = 186;
static readonly DIVISION = 187;
static readonly RETURNING = 188;
static readonly LISTVIEW = 189;
static readonly FindLiteral = 190;
static readonly FindLiteralAlt = 191;
static readonly IntegerLiteral = 192;
static readonly LongLiteral = 193;
static readonly NumberLiteral = 194;
static readonly BooleanLiteral = 195;
static readonly StringLiteral = 196;
static readonly NullLiteral = 197;
static readonly LPAREN = 198;
static readonly RPAREN = 199;
static readonly LBRACE = 200;
static readonly RBRACE = 201;
static readonly LBRACK = 202;
static readonly RBRACK = 203;
static readonly SEMI = 204;
static readonly COMMA = 205;
static readonly DOT = 206;
static readonly ASSIGN = 207;
static readonly GT = 208;
static readonly LT = 209;
static readonly BANG = 210;
static readonly TILDE = 211;
static readonly QUESTIONDOT = 212;
static readonly QUESTION = 213;
static readonly COLON = 214;
static readonly EQUAL = 215;
static readonly TRIPLEEQUAL = 216;
static readonly NOTEQUAL = 217;
static readonly LESSANDGREATER = 218;
static readonly TRIPLENOTEQUAL = 219;
static readonly AND = 220;
static readonly OR = 221;
static readonly INC = 222;
static readonly DEC = 223;
static readonly ADD = 224;
static readonly SUB = 225;
static readonly MUL = 226;
static readonly DIV = 227;
static readonly BITAND = 228;
static readonly BITOR = 229;
static readonly CARET = 230;
static readonly MAPTO = 231;
static readonly ADD_ASSIGN = 232;
static readonly SUB_ASSIGN = 233;
static readonly MUL_ASSIGN = 234;
static readonly DIV_ASSIGN = 235;
static readonly AND_ASSIGN = 236;
static readonly OR_ASSIGN = 237;
static readonly XOR_ASSIGN = 238;
static readonly LSHIFT_ASSIGN = 239;
static readonly RSHIFT_ASSIGN = 240;
static readonly URSHIFT_ASSIGN = 241;
static readonly ATSIGN = 242;
static readonly Identifier = 243;
static readonly WS = 244;
static readonly DOC_COMMENT = 245;
static readonly COMMENT = 246;
static readonly LINE_COMMENT = 247;
static readonly WHITESPACE_CHANNEL = 2;

@@ -251,0 +255,0 @@ static readonly COMMENT_CHANNEL = 3;

@@ -86,2 +86,3 @@ import { ParseTreeVisitor } from "antlr4ts/tree/ParseTreeVisitor";

import { ContinueStatementContext } from "./ApexParser";
import { AccessLevelContext } from "./ApexParser";
import { InsertStatementContext } from "./ApexParser";

@@ -721,2 +722,8 @@ import { UpdateStatementContext } from "./ApexParser";

/**
* Visit a parse tree produced by `ApexParser.accessLevel`.
* @param ctx the parse tree
* @return the visitor result
*/
visitAccessLevel?: (ctx: AccessLevelContext) => Result;
/**
* Visit a parse tree produced by `ApexParser.insertStatement`.

@@ -723,0 +730,0 @@ * @param ctx the parse tree

{
"name": "@apexdevtools/apex-parser",
"version": "3.1.0",
"version": "3.2.0",
"author": "Apex Dev Tools Team <apexdevtools@gmail.com> (https://github.com/apex-dev-tools)",

@@ -5,0 +5,0 @@ "bugs": "https://github.com/apex-dev-tools/apex-parser/issues",

@@ -51,3 +51,3 @@ # apex-parser

<artifactId>apex-parser</artifactId>
<version>3.0.0</version>
<version>3.2.0</version>
</dependency>

@@ -57,3 +57,3 @@

"@apexdevtools/apex-parser": "^3.0.0"
"@apexdevtools/apex-parser": "^3.2.0"

@@ -68,3 +68,3 @@ ## Building

Unit tests are executed during the respective package builds. The system tests require both packages to be built, as the js test also spawns the jar version. They use a collection of sample projects located in the [apex-samples](https://github.com/apex-dev-tools/apex-samples) repository. Follow the README instructions in apex-samples to checkout the submodules or use `git clone --recurse-submodules <repo-url>`. To run the tests:
Unit tests are executed during the respective package builds. The system tests require both packages to be built, as the js test also spawns the jar version. They use a collection of sample projects located in the [apex-samples](https://github.com/apex-dev-tools/apex-samples) repository. Follow the README instructions in apex-samples to checkout the submodules. To run the tests:

@@ -79,28 +79,6 @@ # Set SAMPLES env var to samples repo location

## History
The tag version of apex-samples used by builds is set in the [build file](.github/workflows/Build.yml).
3.0.0 - Move to @apexdevtools/apex-parser
2.14.0 - Change npm api to replace ANTLRInputStream with CharStream, for Unicode char positions
2.13.0 - Fixes for negative numerics & Currency literals in SOQL
2.12.0 - Replace deprecated ANTLRInputStream, DateTime & Currency literals fixes (contrib Aaron Hurst)
2.11.0 - Fix for SOQL UPDATE VIEWSTAT/TRACKING & removal of class type arguments
2.10.0 - Allow type arguments on Classes (non-standard!)
2.9.2 - Generate .d.ts files
2.9.1 - JVM build and npm dependency updates
2.9.0 - Add SOQL Fields function
2.8.0 - Apex cast priority fix, SOSL & SOQL query format fixes, Added SOQL Date functions
2.7.1 - Bugfix for 'Network' identifier
2.7.0 - Support inline SOSL queries
2.6.1 - Dependency security fixes
2.6.0 - Add SOQL parsing support
2.5.0 - Allow safe navigation operator ?.
2.4.0 - Enable Listener & Visitor use
2.3.0 - Removed modifers from enhanced for loop
2.2.1 - Dependency security fixes
2.2.0 - Parser performance improvements
2.1.0 - Supports trigger parsing and switch statement parsing syntax was corrected
1.0.0 - Initial version
## Source & Licenses
All the source code included uses a 3-clause BSD license. The only third-party component included is the Apex Antlr4 grammar originally from [Tooling-force.com](https://github.com/neowit/tooling-force.com), although this version used is now markedly different from the original.

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc