Skip to content

Commit d0a1144

Browse files
committed
added aggregate fn indicator
Fields with aggregate functions are now flagged Updated unit test to allow alternate composed soql
1 parent 6473290 commit d0a1144

File tree

1 file changed

+24
-22
lines changed

1 file changed

+24
-22
lines changed

README.md

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -204,15 +204,15 @@ export interface SoqlComposeConfig {
204204

205205
### Data Models
206206
```typescript
207-
export type LogicalOperator = 'AND' | 'OR';
208-
export type Operator = '=' | '<=' | '>=' | '>' | '<' | 'LIKE' | 'IN' | 'NOT IN' | 'INCLUDES' | 'EXCLUDES';
209-
export type TypeOfFieldConditionType = 'WHEN' | 'ELSE';
210-
export type GroupSelector = 'ABOVE' | 'AT' | 'BELOW' | 'ABOVE_OR_BELOW';
211-
export type LogicalPrefix = 'NOT';
212-
export type ForClause = 'VIEW' | 'UPDATE' | 'REFERENCE';
213-
export type UpdateClause = 'TRACKING' | 'VIEWSTAT';
214-
215-
export interface Query {
207+
type LogicalOperator = 'AND' | 'OR';
208+
type Operator = '=' | '<=' | '>=' | '>' | '<' | 'LIKE' | 'IN' | 'NOT IN' | 'INCLUDES' | 'EXCLUDES';
209+
type TypeOfFieldConditionType = 'WHEN' | 'ELSE';
210+
type GroupSelector = 'ABOVE' | 'AT' | 'BELOW' | 'ABOVE_OR_BELOW';
211+
type LogicalPrefix = 'NOT';
212+
type ForClause = 'VIEW' | 'UPDATE' | 'REFERENCE';
213+
type UpdateClause = 'TRACKING' | 'VIEWSTAT';
214+
215+
interface Query {
216216
fields: Field[];
217217
subqueries: Query[];
218218
sObject?: string;
@@ -230,11 +230,11 @@ export interface Query {
230230
update?: UpdateClause;
231231
}
232232

233-
export interface SelectStatement {
233+
interface SelectStatement {
234234
fields: Field[];
235235
}
236236

237-
export interface Field {
237+
interface Field {
238238
text?: string;
239239
alias?: string;
240240
relationshipFields?: string[];
@@ -243,24 +243,24 @@ export interface Field {
243243
typeOf?: TypeOfField;
244244
}
245245

246-
export interface TypeOfField {
246+
interface TypeOfField {
247247
field: string;
248248
conditions: TypeOfFieldCondition[];
249249
}
250250

251-
export interface TypeOfFieldCondition {
251+
interface TypeOfFieldCondition {
252252
type: TypeOfFieldConditionType;
253253
objectType?: string; // not present when ELSE
254254
fieldList: string[];
255255
}
256256

257-
export interface WhereClause {
257+
interface WhereClause {
258258
left: Condition;
259259
right?: WhereClause;
260260
operator?: LogicalOperator;
261261
}
262262

263-
export interface Condition {
263+
interface Condition {
264264
openParen?: number;
265265
closeParen?: number;
266266
logicalPrefix?: LogicalPrefix;
@@ -271,25 +271,25 @@ export interface Condition {
271271
valueQuery?: Query;
272272
}
273273

274-
export interface OrderByClause {
274+
interface OrderByClause {
275275
field?: string;
276276
fn?: FunctionExp;
277277
order?: 'ASC' | 'DESC';
278278
nulls?: 'FIRST' | 'LAST';
279279
}
280280

281-
export interface GroupByClause {
281+
interface GroupByClause {
282282
field: string | string[];
283283
type?: 'CUBE' | 'ROLLUP';
284284
}
285285

286-
export interface HavingClause {
286+
interface HavingClause {
287287
left: HavingCondition;
288288
right?: HavingClause;
289289
operator?: LogicalOperator;
290290
}
291291

292-
export interface HavingCondition {
292+
interface HavingCondition {
293293
openParen?: number;
294294
closeParen?: number;
295295
field?: string;
@@ -298,23 +298,25 @@ export interface HavingCondition {
298298
value: string | number;
299299
}
300300

301-
export interface FunctionExp {
301+
interface FunctionExp {
302302
text?: string; // Count(Id)
303303
name?: string; // Count
304304
alias?: string;
305305
parameter?: string | string[];
306+
isAggregateFn?: boolean;
306307
fn?: FunctionExp; // used for nested functions FORMAT(MIN(CloseDate))
307308
}
308309

309-
export interface WithDataCategoryClause {
310+
interface WithDataCategoryClause {
310311
conditions: WithDataCategoryCondition[];
311312
}
312313

313-
export interface WithDataCategoryCondition {
314+
interface WithDataCategoryCondition {
314315
groupName: string;
315316
selector: GroupSelector;
316317
parameters: string[];
317318
}
319+
318320
```
319321

320322
## CLI Usage

0 commit comments

Comments
 (0)