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

@apexdevtools/apex-parser

Package Overview
Dependencies
Maintainers
0
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 4.1.0 to 4.2.0

6

CHANGELOG.md
# apex-parser - Changelog
## 4.2.0 - 2024-09-02
- Add support for multiple nested SOQL sub queries
- Add support for `GROUPING` in SOQL query
- Add support for `toLabel` in SOSL query
## 4.1.0 - 2024-05-12

@@ -4,0 +10,0 @@

@@ -72,2 +72,23 @@ "use strict";

});
test("SubQuery", () => {
const [parser, errorCounter] = (0, SyntaxErrorCounter_1.createParser)("SELECT Name, (SELECT Id, (SELECT Id, (SELECT Id, (SELECT Id FROM Child4 ) FROM Child3 ) FROM Child2 ) FROM Child1) FROM Parent");
const context = parser.query();
expect(context).toBeInstanceOf(ApexParser_1.QueryContext);
expect(errorCounter.getNumErrors()).toEqual(0);
});
test("Grouping function", () => {
const [parser, errorCounter] = (0, SyntaxErrorCounter_1.createParser)(`SELECT
OBJ1__c O1,
OBJ2__c O2,
OBJ3__c O3,
SUM(OBJ4__c) O4,
GROUPING(OBJ1__c) O1Group,
GROUPING(OBJ2__c) O2Group,
GROUPING(OBJ3__c) O3Group
FROM OBJ4__c
GROUP BY ROLLUP(OBJ1__c, OBJ2__c, OBJ3__c)`);
const context = parser.query();
expect(context).toBeInstanceOf(ApexParser_1.QueryContext);
expect(errorCounter.getNumErrors()).toEqual(0);
});
//# sourceMappingURL=SOQLParserTest.js.map

18

lib/__tests__/SOSLParserTest.js

@@ -50,12 +50,18 @@ "use strict";

const [parser, errorCounter] = (0, SyntaxErrorCounter_1.createParser)("[Find 'something' RETURNING Account WITH USER_MODE WITH METADATA='Labels']");
const context = parser.soslLiteralAlt();
expect(context).toBeInstanceOf(ApexParser_1.SoslLiteralAltContext);
expect(errorCounter.getNumErrors()).toEqual(1);
const context = parser.soslLiteral();
expect(context).toBeInstanceOf(ApexParser_1.SoslLiteralContext);
expect(errorCounter.getNumErrors()).toEqual(0);
});
test('testWithSystemModeQuery', () => {
const [parser, errorCounter] = (0, SyntaxErrorCounter_1.createParser)("[Find 'something' RETURNING Account WITH METADATA='Labels' WITH SYSTEM_MODE]");
const context = parser.soslLiteralAlt();
expect(context).toBeInstanceOf(ApexParser_1.SoslLiteralAltContext);
expect(errorCounter.getNumErrors()).toEqual(1);
const context = parser.soslLiteral();
expect(context).toBeInstanceOf(ApexParser_1.SoslLiteralContext);
expect(errorCounter.getNumErrors()).toEqual(0);
});
test('testToLabel', () => {
const [parser, errorCounter] = (0, SyntaxErrorCounter_1.createParser)("[FIND :searchTerm IN ALL FIELDS RETURNING Account(Id, toLabel(Name)) LIMIT 10]");
const context = parser.soslLiteral();
expect(context).toBeInstanceOf(ApexParser_1.SoslLiteralContext);
expect(errorCounter.getNumErrors()).toEqual(0);
});
//# sourceMappingURL=SOSLParserTest.js.map

@@ -120,136 +120,137 @@ import { ATN } from "antlr4ts/atn/ATN";

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 COAL = 222;
static readonly INC = 223;
static readonly DEC = 224;
static readonly ADD = 225;
static readonly SUB = 226;
static readonly MUL = 227;
static readonly DIV = 228;
static readonly BITAND = 229;
static readonly BITOR = 230;
static readonly CARET = 231;
static readonly MAPTO = 232;
static readonly ADD_ASSIGN = 233;
static readonly SUB_ASSIGN = 234;
static readonly MUL_ASSIGN = 235;
static readonly DIV_ASSIGN = 236;
static readonly AND_ASSIGN = 237;
static readonly OR_ASSIGN = 238;
static readonly XOR_ASSIGN = 239;
static readonly LSHIFT_ASSIGN = 240;
static readonly RSHIFT_ASSIGN = 241;
static readonly URSHIFT_ASSIGN = 242;
static readonly ATSIGN = 243;
static readonly Identifier = 244;
static readonly WS = 245;
static readonly DOC_COMMENT = 246;
static readonly COMMENT = 247;
static readonly LINE_COMMENT = 248;
static readonly GROUPING = 115;
static readonly CALENDAR_MONTH = 116;
static readonly CALENDAR_QUARTER = 117;
static readonly CALENDAR_YEAR = 118;
static readonly DAY_IN_MONTH = 119;
static readonly DAY_IN_WEEK = 120;
static readonly DAY_IN_YEAR = 121;
static readonly DAY_ONLY = 122;
static readonly FISCAL_MONTH = 123;
static readonly FISCAL_QUARTER = 124;
static readonly FISCAL_YEAR = 125;
static readonly HOUR_IN_DAY = 126;
static readonly WEEK_IN_MONTH = 127;
static readonly WEEK_IN_YEAR = 128;
static readonly CONVERT_TIMEZONE = 129;
static readonly YESTERDAY = 130;
static readonly TODAY = 131;
static readonly TOMORROW = 132;
static readonly LAST_WEEK = 133;
static readonly THIS_WEEK = 134;
static readonly NEXT_WEEK = 135;
static readonly LAST_MONTH = 136;
static readonly THIS_MONTH = 137;
static readonly NEXT_MONTH = 138;
static readonly LAST_90_DAYS = 139;
static readonly NEXT_90_DAYS = 140;
static readonly LAST_N_DAYS_N = 141;
static readonly NEXT_N_DAYS_N = 142;
static readonly N_DAYS_AGO_N = 143;
static readonly NEXT_N_WEEKS_N = 144;
static readonly LAST_N_WEEKS_N = 145;
static readonly N_WEEKS_AGO_N = 146;
static readonly NEXT_N_MONTHS_N = 147;
static readonly LAST_N_MONTHS_N = 148;
static readonly N_MONTHS_AGO_N = 149;
static readonly THIS_QUARTER = 150;
static readonly LAST_QUARTER = 151;
static readonly NEXT_QUARTER = 152;
static readonly NEXT_N_QUARTERS_N = 153;
static readonly LAST_N_QUARTERS_N = 154;
static readonly N_QUARTERS_AGO_N = 155;
static readonly THIS_YEAR = 156;
static readonly LAST_YEAR = 157;
static readonly NEXT_YEAR = 158;
static readonly NEXT_N_YEARS_N = 159;
static readonly LAST_N_YEARS_N = 160;
static readonly N_YEARS_AGO_N = 161;
static readonly THIS_FISCAL_QUARTER = 162;
static readonly LAST_FISCAL_QUARTER = 163;
static readonly NEXT_FISCAL_QUARTER = 164;
static readonly NEXT_N_FISCAL_QUARTERS_N = 165;
static readonly LAST_N_FISCAL_QUARTERS_N = 166;
static readonly N_FISCAL_QUARTERS_AGO_N = 167;
static readonly THIS_FISCAL_YEAR = 168;
static readonly LAST_FISCAL_YEAR = 169;
static readonly NEXT_FISCAL_YEAR = 170;
static readonly NEXT_N_FISCAL_YEARS_N = 171;
static readonly LAST_N_FISCAL_YEARS_N = 172;
static readonly N_FISCAL_YEARS_AGO_N = 173;
static readonly DateLiteral = 174;
static readonly DateTimeLiteral = 175;
static readonly IntegralCurrencyLiteral = 176;
static readonly FIND = 177;
static readonly EMAIL = 178;
static readonly NAME = 179;
static readonly PHONE = 180;
static readonly SIDEBAR = 181;
static readonly FIELDS = 182;
static readonly METADATA = 183;
static readonly PRICEBOOKID = 184;
static readonly NETWORK = 185;
static readonly SNIPPET = 186;
static readonly TARGET_LENGTH = 187;
static readonly DIVISION = 188;
static readonly RETURNING = 189;
static readonly LISTVIEW = 190;
static readonly FindLiteral = 191;
static readonly FindLiteralAlt = 192;
static readonly IntegerLiteral = 193;
static readonly LongLiteral = 194;
static readonly NumberLiteral = 195;
static readonly BooleanLiteral = 196;
static readonly StringLiteral = 197;
static readonly NullLiteral = 198;
static readonly LPAREN = 199;
static readonly RPAREN = 200;
static readonly LBRACE = 201;
static readonly RBRACE = 202;
static readonly LBRACK = 203;
static readonly RBRACK = 204;
static readonly SEMI = 205;
static readonly COMMA = 206;
static readonly DOT = 207;
static readonly ASSIGN = 208;
static readonly GT = 209;
static readonly LT = 210;
static readonly BANG = 211;
static readonly TILDE = 212;
static readonly QUESTIONDOT = 213;
static readonly QUESTION = 214;
static readonly COLON = 215;
static readonly EQUAL = 216;
static readonly TRIPLEEQUAL = 217;
static readonly NOTEQUAL = 218;
static readonly LESSANDGREATER = 219;
static readonly TRIPLENOTEQUAL = 220;
static readonly AND = 221;
static readonly OR = 222;
static readonly COAL = 223;
static readonly INC = 224;
static readonly DEC = 225;
static readonly ADD = 226;
static readonly SUB = 227;
static readonly MUL = 228;
static readonly DIV = 229;
static readonly BITAND = 230;
static readonly BITOR = 231;
static readonly CARET = 232;
static readonly MAPTO = 233;
static readonly ADD_ASSIGN = 234;
static readonly SUB_ASSIGN = 235;
static readonly MUL_ASSIGN = 236;
static readonly DIV_ASSIGN = 237;
static readonly AND_ASSIGN = 238;
static readonly OR_ASSIGN = 239;
static readonly XOR_ASSIGN = 240;
static readonly LSHIFT_ASSIGN = 241;
static readonly RSHIFT_ASSIGN = 242;
static readonly URSHIFT_ASSIGN = 243;
static readonly ATSIGN = 244;
static readonly Identifier = 245;
static readonly WS = 246;
static readonly DOC_COMMENT = 247;
static readonly COMMENT = 248;
static readonly LINE_COMMENT = 249;
static readonly WHITESPACE_CHANNEL = 2;

@@ -256,0 +257,0 @@ static readonly COMMENT_CHANNEL = 3;

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

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

"antlr4ts": "npm run antlr-build && npm run antlr-patch",
"antlr-build": "(cd antlr; antlr4ts -visitor -o ../src ApexLexer.g4 ApexParser.g4)",
"antlr-build": "cd antlr && antlr4ts -visitor -o ../src ApexLexer.g4 ApexParser.g4",
"antlr-patch": "node patch",

@@ -14,0 +14,0 @@ "build": "npm run clean && npm run antlr4ts && cp ../*.md . && tsc",

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

<artifactId>apex-parser</artifactId>
<version>4.1.0</version>
<version>4.2.0</version>
</dependency>

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

"@apexdevtools/apex-parser": "^4.1.0"
"@apexdevtools/apex-parser": "^4.2.0"

@@ -60,0 +60,0 @@ ## Building

Sorry, the diff of this file is not supported yet

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

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