Skip to content

Commit

Permalink
Merge pull request #246 from jetstreamapp/bug/fix-docs-for-new-import…
Browse files Browse the repository at this point in the history
…-path

Bug/fix docs for new import path
  • Loading branch information
paustint authored Jun 16, 2024
2 parents f5bc8d0 + dfb8689 commit 5136a96
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 24 deletions.
2 changes: 1 addition & 1 deletion .release-it.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
"hooks": {
"before:init": ["npm test"],
"after:bump": "npm run build",
"after:release": "npm run copy-tc-to-docs && cd docs && npm install soql-parser-js@${version} && git add package*.json && git add static/sample-queries-json.json && git commit -m \"Updated docs version\" && git push && npm run deploy"
"after:release": "npm run copy-tc-to-docs && cd docs && npm install @jetstreamapp/soql-parser-js@${version} && git add package*.json && git add static/sample-queries-json.json && git commit -m \"Updated docs version\" && git push && npm run deploy"
}
}
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,7 @@ Minified, uncompressed:
- Version 2.0: **207kb**

```javascript
var soqlParser = require('soql-parser-js');
var soqlParser = require('@jetstreamapp/soql-parser-js');

const query = soqlParser.parseQuery(`SELECT Id FROM Account WHERE Id = 'FOO'`);
console.log('query', query);
Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ The **commander** dependency is only required for the cli, the other two depende
## Quick Start

```javascript
import { parseQuery, composeQuery, isQueryValid } from 'soql-parser-js';
import { parseQuery, composeQuery, isQueryValid } from '@jetstreamapp/soql-parser-js';

const query = parseQuery(`SELECT Id FROM Account WHERE Id = 'FOO'`);
console.log('query', query);
Expand Down Expand Up @@ -125,7 +125,7 @@ Many of hte utility functions are provided to easily determine the shape of spec
Parsing a SOQL query can be completed by calling `parseQuery(soqlQueryString)`. A `Query` data structure will be returned.

```typescript
import { parseQuery } from 'soql-parser-js';
import { parseQuery } from '@jetstreamapp/soql-parser-js';

const soql = `
SELECT UserId, COUNT(Id)
Expand Down Expand Up @@ -189,7 +189,7 @@ console.log(JSON.stringify(soqlQuery, null, 2));
Added support for `allowPartialQuery` in version `4.4.0`

```typescript
import { parseQuery } from 'soql-parser-js';
import { parseQuery } from '@jetstreamapp/soql-parser-js';

const soql = `
WHERE LoginTime > 2010-09-20T22:16:30.000Z
Expand Down Expand Up @@ -235,7 +235,7 @@ console.log(JSON.stringify(soqlQuery, null, 2));
### Validating Queries

```typescript
import { isQueryValid } from 'soql-parser-js';
import { isQueryValid } from '@jetstreamapp/soql-parser-js';

const invalidSoql = `SELECT UserId, COUNT(Id) Account`;
const validSoql = `SELECT UserId, COUNT(Id) Account`;
Expand All @@ -259,7 +259,7 @@ Some utility methods have been provided to make it easier to build the field dat
**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.

```typescript
import { composeQuery, getField, Query } from 'soql-parser-js';
import { composeQuery, getField, Query } from '@jetstreamapp/soql-parser-js';

// Build a subquery
const oppLineItemsSubquery = {
Expand Down Expand Up @@ -339,7 +339,7 @@ Starting in version `4.4`, compose will not fail if there are missing `SELECT` a
Partial compose support it supported without any additional steps.

```typescript
import { Compose, parseQuery } from 'soql-parser-js';
import { Compose, parseQuery } from '@jetstreamapp/soql-parser-js';

const soql = `WHERE Name LIKE 'A%' AND MailingCity = 'California`;
const parsedQuery = parseQuery(soql, { allowPartialQuery: true });
Expand Down Expand Up @@ -374,7 +374,7 @@ If you need to compose just a part of a query instead of the entire query, you c
For example, if you just need the `WHERE` clause from a query as a string, you can do the following:
```typescript
import { Compose, parseQuery } from 'soql-parser-js';
import { Compose, parseQuery } from '@jetstreamapp/soql-parser-js';
const soql = `SELECT Id FROM Account WHERE Name = 'Foo'`;
const parsedQuery = parseQuery(soql);
Expand Down Expand Up @@ -430,7 +430,7 @@ This function is provided as a convenience and just calls parse and compose.
[Check out the demo](https://jetstreamapp.github.io/soql-parser-js/) to see the outcome of the various format options.
```typescript
import { formatQuery } from 'soql-parser-js';
import { formatQuery } from '@jetstreamapp/soql-parser-js';
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%'`;
Expand Down
14 changes: 7 additions & 7 deletions docs/docs/examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ sidebar_position: 4
Parsing a SOQL query can be completed by calling `parseQuery(soqlQueryString)`. A `Query` data structure will be returned.

```typescript
import { parseQuery } from 'soql-parser-js';
import { parseQuery } from '@jetstreamapp/soql-parser-js';

const soql = `
SELECT UserId, COUNT(Id)
Expand Down Expand Up @@ -71,7 +71,7 @@ console.log(JSON.stringify(soqlQuery, null, 2));
Added support for `allowPartialQuery` in version `4.4.0`

```typescript
import { parseQuery } from 'soql-parser-js';
import { parseQuery } from '@jetstreamapp/soql-parser-js';

const soql = `
WHERE LoginTime > 2010-09-20T22:16:30.000Z
Expand Down Expand Up @@ -117,7 +117,7 @@ console.log(JSON.stringify(soqlQuery, null, 2));
### Validating Queries

```typescript
import { isQueryValid } from 'soql-parser-js';
import { isQueryValid } from '@jetstreamapp/soql-parser-js';

const invalidSoql = `SELECT UserId, COUNT(Id) Account`;
const validSoql = `SELECT UserId, COUNT(Id) Account`;
Expand All @@ -141,7 +141,7 @@ Some utility methods have been provided to make it easier to build the field dat
**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.

```typescript
import { composeQuery, getField, Query } from 'soql-parser-js';
import { composeQuery, getField, Query } from '@jetstreamapp/soql-parser-js';

// Build a subquery
const oppLineItemsSubquery = {
Expand Down Expand Up @@ -221,7 +221,7 @@ Starting in version `4.4`, compose will not fail if there are missing `SELECT` a
Partial compose support it supported without any additional steps.

```typescript
import { Compose, parseQuery } from 'soql-parser-js';
import { Compose, parseQuery } from '@jetstreamapp/soql-parser-js';

const soql = `WHERE Name LIKE 'A%' AND MailingCity = 'California`;
const parsedQuery = parseQuery(soql, { allowPartialQuery: true });
Expand Down Expand Up @@ -256,7 +256,7 @@ If you need to compose just a part of a query instead of the entire query, you c
For example, if you just need the `WHERE` clause from a query as a string, you can do the following:
```typescript
import { Compose, parseQuery } from 'soql-parser-js';
import { Compose, parseQuery } from '@jetstreamapp/soql-parser-js';
const soql = `SELECT Id FROM Account WHERE Name = 'Foo'`;
const parsedQuery = parseQuery(soql);
Expand Down Expand Up @@ -312,7 +312,7 @@ This function is provided as a convenience and just calls parse and compose.
[Check out the demo](https://paustint.github.io/soql-parser-js/) to see the outcome of the various format options.
```typescript
import { formatQuery } from 'soql-parser-js';
import { formatQuery } from '@jetstreamapp/soql-parser-js';
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%'`;
Expand Down
6 changes: 3 additions & 3 deletions docs/docs/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ These are the most common functions exported by the library:
## Parse a query

```typescript
import { parseQuery, Query } from 'soql-parser-js';
import { parseQuery, Query } from '@jetstreamapp/soql-parser-js';

const query = parseQuery(`SELECT Id FROM Account WHERE Name = 'foo'`);

Expand Down Expand Up @@ -53,7 +53,7 @@ console.log(query);
Composing a query will take a query object and return a soql query.

```typescript
import { composeQuery, Query } from 'soql-parser-js';
import { composeQuery, Query } from '@jetstreamapp/soql-parser-js';

const query = {
fields: [
Expand Down Expand Up @@ -85,7 +85,7 @@ console.log(soql);
You can use the `getField` helper function to simplify the field generation. Read the api docs for more information.

```typescript
import { composeQuery, getField } from 'soql-parser-js';
import { composeQuery, getField } from '@jetstreamapp/soql-parser-js';

const soql = composeQuery({
fields: [
Expand Down
2 changes: 1 addition & 1 deletion docs/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const config = {
// GitHub pages deployment config.
// If you aren't using GitHub pages, you don't need these.
organizationName: 'jetstreamapp',
projectName: 'soql-parser-js',
projectName: '@jetstreamapp/soql-parser-js',
deploymentBranch: 'gh-pages',
trailingSlash: false,

Expand Down
2 changes: 1 addition & 1 deletion docs/src/components/ComposeQueries/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import clsx from 'clsx';
import React, { useEffect, useState } from 'react';
import { composeQuery, parseQuery } from 'soql-parser-js';
import { composeQuery, parseQuery } from '@jetstreamapp/soql-parser-js';
import ParsedOutput from './ParsedOutput';
import QueryInput from './QueryInput';

Expand Down
2 changes: 1 addition & 1 deletion docs/src/components/ParseQueries/ParsedOutput/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useEffect, useState } from 'react';
import { parseQuery, Query } from 'soql-parser-js';
import { parseQuery, Query } from '@jetstreamapp/soql-parser-js';

export interface ParsedOutputProps {
query: string;
Expand Down
2 changes: 1 addition & 1 deletion docs/src/components/Utilities/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import {
ValueWithDateLiteralCondition,
ValueWithDateNLiteralCondition,
WhereClause,
} from 'soql-parser-js';
} from '@jetstreamapp/soql-parser-js';

const sampleQuery: Query = {
fields: [
Expand Down

0 comments on commit 5136a96

Please sign in to comment.