@travetto/model
Advanced tools
Comparing version 0.0.25 to 0.0.26
@@ -23,3 +23,3 @@ { | ||
}, | ||
"version": "0.0.25" | ||
"version": "0.0.26" | ||
} |
@@ -5,7 +5,5 @@ import { Class } from '@travetto/registry'; | ||
type SelectFieldFn = 'max' | 'min' | 'avg' | 'sum' | 'count'; | ||
type _SelectClause<T> = { | ||
[P in keyof T]?: | ||
T[P] extends object ? _SelectClause<RetainFields<T[P]>> : { alias: string, calc: SelectFieldFn } | 1 | 0 | boolean; | ||
T[P] extends object ? _SelectClause<RetainFields<T[P]>> : (1 | 0 | boolean); | ||
}; | ||
@@ -19,3 +17,3 @@ | ||
[P in keyof T]?: | ||
T[P] extends object ? _SortClause<RetainFields<T[P]>> : (boolean | 1 | -1); | ||
T[P] extends object ? _SortClause<RetainFields<T[P]>> : (1 | -1 | boolean); | ||
} | ||
@@ -22,0 +20,0 @@ |
@@ -41,3 +41,3 @@ import { ModelQuery, Query, PageableModelQuery, GroupClause, WhereClause } from '../../model'; | ||
[SORT, this.processSortClause.bind(this)], | ||
[GROUP_BY, this.processGroupByClause.bind(this)] | ||
// [GROUP_BY, this.processGroupByClause.bind(this)] | ||
] as [ | ||
@@ -215,3 +215,4 @@ keyof Query<any>, | ||
state.log(`Only true, false 0, and 1 are allowed for including/excluding fields`); | ||
} else if (actual === 'string') { | ||
} else { | ||
/*if (actual === 'string') { | ||
if (!/[A-Za-z_$0-9]/.test(value)) { | ||
@@ -227,6 +228,7 @@ state.log(`Only A-Z, a-z, 0-9, '$' and '_' are allowed in aliases for selecting fields`); | ||
} else { | ||
// or { alias: string, calc?: string } | ||
// console.log('Yay'); | ||
} | ||
} | ||
state.log(`Only true, false -1, and 1 or { alias: string, calc?: string } are allowed for selecting fields`); | ||
*/} | ||
state.log(`Only true, false, 0, and 1 are allowed for selecting fields`); | ||
} | ||
@@ -233,0 +235,0 @@ }); |
@@ -27,3 +27,3 @@ import { Class, ChangeEvent } from '@travetto/registry'; | ||
abstract getById<T extends ModelCore>(cls: Class<T>, id: string): Promise<T>; | ||
abstract getByQuery<T extends ModelCore>(cls: Class<T>, query: PageableModelQuery<T>, failOnMany?: boolean): Promise<T>; | ||
abstract getByQuery<T extends ModelCore>(cls: Class<T>, query: ModelQuery<T>, failOnMany?: boolean): Promise<T>; | ||
abstract getAllByQuery<T extends ModelCore>(cls: Class<T>, query: PageableModelQuery<T>): Promise<T[]>; | ||
@@ -30,0 +30,0 @@ abstract getCountByQuery<T extends ModelCore>(cls: Class<T>, query: ModelQuery<T>): Promise<number>; |
@@ -14,3 +14,3 @@ import { SortClause } from '../model'; | ||
collection: string; | ||
defaultSort?: SortClause<any>; | ||
defaultSort?: SortClause<any>[]; | ||
indicies: IndexConfig<any>[] = []; | ||
@@ -17,0 +17,0 @@ discriminator?: string; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
928
36969