@jetstreamapp/soql-parser-js 6.0.0 → 6.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.
- package/CHANGELOG.md +7 -1
- package/README.md +8 -8
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/index.js.LICENSE.txt +1 -1
- package/dist/cjs/src/parser/lexer.js +1 -1
- package/dist/esm/parser/lexer.js +1 -1
- package/dist/src/parser/lexer.js +1 -1
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 6.1.0
|
|
4
|
+
|
|
5
|
+
June 16, 2024
|
|
6
|
+
|
|
7
|
+
- Add support for [negative currency values](https://help.salesforce.com/s/articleView?id=release-notes.rn_api_soql.htm&release=250&type=5) (#244)
|
|
8
|
+
|
|
3
9
|
## 6.0.0
|
|
4
10
|
|
|
5
11
|
June 16, 2024
|
|
@@ -644,7 +650,7 @@ Minified, uncompressed:
|
|
|
644
650
|
- Version 2.0: **207kb**
|
|
645
651
|
|
|
646
652
|
```javascript
|
|
647
|
-
var soqlParser = require('soql-parser-js');
|
|
653
|
+
var soqlParser = require('@jetstreamapp/soql-parser-js');
|
|
648
654
|
|
|
649
655
|
const query = soqlParser.parseQuery(`SELECT Id FROM Account WHERE Id = 'FOO'`);
|
|
650
656
|
console.log('query', query);
|
package/README.md
CHANGED
|
@@ -41,7 +41,7 @@ The **commander** dependency is only required for the cli, the other two depende
|
|
|
41
41
|
## Quick Start
|
|
42
42
|
|
|
43
43
|
```javascript
|
|
44
|
-
import { parseQuery, composeQuery, isQueryValid } from 'soql-parser-js';
|
|
44
|
+
import { parseQuery, composeQuery, isQueryValid } from '@jetstreamapp/soql-parser-js';
|
|
45
45
|
|
|
46
46
|
const query = parseQuery(`SELECT Id FROM Account WHERE Id = 'FOO'`);
|
|
47
47
|
console.log('query', query);
|
|
@@ -125,7 +125,7 @@ Many of hte utility functions are provided to easily determine the shape of spec
|
|
|
125
125
|
Parsing a SOQL query can be completed by calling `parseQuery(soqlQueryString)`. A `Query` data structure will be returned.
|
|
126
126
|
|
|
127
127
|
```typescript
|
|
128
|
-
import { parseQuery } from 'soql-parser-js';
|
|
128
|
+
import { parseQuery } from '@jetstreamapp/soql-parser-js';
|
|
129
129
|
|
|
130
130
|
const soql = `
|
|
131
131
|
SELECT UserId, COUNT(Id)
|
|
@@ -189,7 +189,7 @@ console.log(JSON.stringify(soqlQuery, null, 2));
|
|
|
189
189
|
Added support for `allowPartialQuery` in version `4.4.0`
|
|
190
190
|
|
|
191
191
|
```typescript
|
|
192
|
-
import { parseQuery } from 'soql-parser-js';
|
|
192
|
+
import { parseQuery } from '@jetstreamapp/soql-parser-js';
|
|
193
193
|
|
|
194
194
|
const soql = `
|
|
195
195
|
WHERE LoginTime > 2010-09-20T22:16:30.000Z
|
|
@@ -235,7 +235,7 @@ console.log(JSON.stringify(soqlQuery, null, 2));
|
|
|
235
235
|
### Validating Queries
|
|
236
236
|
|
|
237
237
|
```typescript
|
|
238
|
-
import { isQueryValid } from 'soql-parser-js';
|
|
238
|
+
import { isQueryValid } from '@jetstreamapp/soql-parser-js';
|
|
239
239
|
|
|
240
240
|
const invalidSoql = `SELECT UserId, COUNT(Id) Account`;
|
|
241
241
|
const validSoql = `SELECT UserId, COUNT(Id) Account`;
|
|
@@ -259,7 +259,7 @@ Some utility methods have been provided to make it easier to build the field dat
|
|
|
259
259
|
**Note:** There are a number of fields populated on the Query object when `parseQuery()` is called that are not required to compose a query. Look at the examples below and the comments in the data model for more information.
|
|
260
260
|
|
|
261
261
|
```typescript
|
|
262
|
-
import { composeQuery, getField, Query } from 'soql-parser-js';
|
|
262
|
+
import { composeQuery, getField, Query } from '@jetstreamapp/soql-parser-js';
|
|
263
263
|
|
|
264
264
|
// Build a subquery
|
|
265
265
|
const oppLineItemsSubquery = {
|
|
@@ -339,7 +339,7 @@ Starting in version `4.4`, compose will not fail if there are missing `SELECT` a
|
|
|
339
339
|
Partial compose support it supported without any additional steps.
|
|
340
340
|
|
|
341
341
|
```typescript
|
|
342
|
-
import { Compose, parseQuery } from 'soql-parser-js';
|
|
342
|
+
import { Compose, parseQuery } from '@jetstreamapp/soql-parser-js';
|
|
343
343
|
|
|
344
344
|
const soql = `WHERE Name LIKE 'A%' AND MailingCity = 'California`;
|
|
345
345
|
const parsedQuery = parseQuery(soql, { allowPartialQuery: true });
|
|
@@ -374,7 +374,7 @@ If you need to compose just a part of a query instead of the entire query, you c
|
|
|
374
374
|
For example, if you just need the `WHERE` clause from a query as a string, you can do the following:
|
|
375
375
|
|
|
376
376
|
```typescript
|
|
377
|
-
import { Compose, parseQuery } from 'soql-parser-js';
|
|
377
|
+
import { Compose, parseQuery } from '@jetstreamapp/soql-parser-js';
|
|
378
378
|
|
|
379
379
|
const soql = `SELECT Id FROM Account WHERE Name = 'Foo'`;
|
|
380
380
|
const parsedQuery = parseQuery(soql);
|
|
@@ -430,7 +430,7 @@ This function is provided as a convenience and just calls parse and compose.
|
|
|
430
430
|
[Check out the demo](https://jetstreamapp.github.io/soql-parser-js/) to see the outcome of the various format options.
|
|
431
431
|
|
|
432
432
|
```typescript
|
|
433
|
-
import { formatQuery } from 'soql-parser-js';
|
|
433
|
+
import { formatQuery } from '@jetstreamapp/soql-parser-js';
|
|
434
434
|
|
|
435
435
|
const query = `SELECT Id, Name, AccountNumber, AccountSource, AnnualRevenue, BillingAddress, BillingCity, BillingCountry, BillingGeocodeAccuracy, ShippingStreet, Sic, SicDesc, Site, SystemModstamp, TickerSymbol, Type, Website, (SELECT Id, Name, AccountId, Amount, CampaignId, CloseDate, CreatedById, Type FROM Opportunities), (SELECT Id, Name, AccountNumber, AccountSource, AnnualRevenue, BillingAddress, Website FROM ChildAccounts) FROM Account WHERE Name LIKE 'a%' OR Name LIKE 'b%' OR Name LIKE 'c%'`;
|
|
436
436
|
|