breeze-client 2.2.2 → 3.0.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/LICENSE +1 -1
- package/README.md +83 -63
- package/adapters/abstract-data-service-adapter.d.ts +120 -0
- package/adapters/abstract-data-service-adapter.js +395 -0
- package/adapters/abstract-data-service-adapter.js.map +1 -0
- package/adapters/adapter-ajax-fetch.d.ts +12 -0
- package/adapters/adapter-ajax-fetch.js +13 -0
- package/adapters/adapter-ajax-fetch.js.map +1 -0
- package/{adapter-ajax-post → adapters}/adapter-ajax-post.d.ts +40 -36
- package/{fesm2022/breeze-client-adapter-ajax-post.mjs → adapters/adapter-ajax-post.js} +80 -82
- package/adapters/adapter-ajax-post.js.map +1 -0
- package/{adapter-ajax-fetch → adapters}/adapter-core.d.ts +4 -4
- package/{fesm2022/breeze-client-adapter-uri-builder-json.mjs → adapters/adapter-core.js} +48 -91
- package/adapters/adapter-core.js.map +1 -0
- package/adapters/adapter-data-service-webapi.d.ts +9 -0
- package/{fesm2022/breeze-client-adapter-data-service-webapi.mjs → adapters/adapter-data-service-webapi.js} +105 -107
- package/adapters/adapter-data-service-webapi.js.map +1 -0
- package/adapters/adapter-model-library-backing-store.d.ts +32 -0
- package/adapters/adapter-model-library-backing-store.js +321 -0
- package/adapters/adapter-model-library-backing-store.js.map +1 -0
- package/adapters/adapter-uri-builder-json.d.ts +11 -0
- package/adapters/adapter-uri-builder-json.js +40 -0
- package/adapters/adapter-uri-builder-json.js.map +1 -0
- package/adapters/http.d.ts +52 -0
- package/adapters/http.js +202 -0
- package/adapters/http.js.map +1 -0
- package/angular/adapter-angular-httpclient.d.ts +21 -0
- package/angular/adapter-angular-httpclient.js +70 -0
- package/angular/adapter-angular-httpclient.js.map +1 -0
- package/breeze.d.ts +215 -0
- package/breeze.js +141 -0
- package/breeze.js.map +1 -0
- package/config/config.d.ts +212 -0
- package/config/config.js +392 -0
- package/config/config.js.map +1 -0
- package/config/configure.d.ts +66 -0
- package/config/configure.js +46 -0
- package/config/configure.js.map +1 -0
- package/config/default-adapters.d.ts +1 -0
- package/config/default-adapters.js +40 -0
- package/config/default-adapters.js.map +1 -0
- package/config/interface-registry.d.ts +191 -0
- package/config/interface-registry.js +5 -0
- package/config/interface-registry.js.map +1 -0
- package/{src → core}/assert-param.d.ts +52 -60
- package/core/assert-param.js +390 -0
- package/core/assert-param.js.map +1 -0
- package/core/core.d.ts +285 -0
- package/core/core.js +772 -0
- package/core/core.js.map +1 -0
- package/core/enum.d.ts +116 -0
- package/core/enum.js +167 -0
- package/core/enum.js.map +1 -0
- package/core/event.d.ts +169 -0
- package/core/event.js +338 -0
- package/core/event.js.map +1 -0
- package/entity/array.d.ts +3 -0
- package/entity/array.js +4 -0
- package/entity/array.js.map +1 -0
- package/entity/complex-array.d.ts +17 -0
- package/entity/complex-array.js +104 -0
- package/entity/complex-array.js.map +1 -0
- package/entity/default-property-interceptor.d.ts +1 -0
- package/entity/default-property-interceptor.js +496 -0
- package/entity/default-property-interceptor.js.map +1 -0
- package/{src → entity}/entity-action.d.ts +36 -42
- package/entity/entity-action.js +45 -0
- package/entity/entity-action.js.map +1 -0
- package/entity/entity-aspect.d.ts +457 -0
- package/entity/entity-aspect.js +1262 -0
- package/entity/entity-aspect.js.map +1 -0
- package/entity/entity-base.d.ts +55 -0
- package/entity/entity-base.js +41 -0
- package/entity/entity-base.js.map +1 -0
- package/entity/entity-group.d.ts +1 -0
- package/entity/entity-group.js +224 -0
- package/entity/entity-group.js.map +1 -0
- package/entity/entity-key.d.ts +95 -0
- package/entity/entity-key.js +189 -0
- package/entity/entity-key.js.map +1 -0
- package/{src → entity}/entity-state.d.ts +112 -84
- package/entity/entity-state.js +135 -0
- package/entity/entity-state.js.map +1 -0
- package/entity/key-generator.d.ts +57 -0
- package/entity/key-generator.js +155 -0
- package/entity/key-generator.js.map +1 -0
- package/entity/observable-array.d.ts +25 -0
- package/entity/observable-array.js +230 -0
- package/entity/observable-array.js.map +1 -0
- package/entity/primitive-array.d.ts +12 -0
- package/entity/primitive-array.js +71 -0
- package/entity/primitive-array.js.map +1 -0
- package/entity/relation-array.d.ts +24 -0
- package/entity/relation-array.js +176 -0
- package/entity/relation-array.js.map +1 -0
- package/entity/unattached-children-map.d.ts +1 -0
- package/entity/unattached-children-map.js +105 -0
- package/entity/unattached-children-map.js.map +1 -0
- package/generate-entity-classes.js +1176 -0
- package/manager/entity-manager.d.ts +801 -0
- package/manager/entity-manager.js +2395 -0
- package/manager/entity-manager.js.map +1 -0
- package/{src → manager}/save-options.d.ts +48 -42
- package/manager/save-options.js +51 -0
- package/manager/save-options.js.map +1 -0
- package/{src → metadata}/data-service.d.ts +229 -184
- package/metadata/data-service.js +246 -0
- package/metadata/data-service.js.map +1 -0
- package/metadata/data-type.d.ts +122 -0
- package/metadata/data-type.js +465 -0
- package/metadata/data-type.js.map +1 -0
- package/metadata/entity-metadata.d.ts +1193 -0
- package/metadata/entity-metadata.js +2502 -0
- package/metadata/entity-metadata.js.map +1 -0
- package/{src → metadata}/local-query-comparison-options.d.ts +65 -59
- package/metadata/local-query-comparison-options.js +69 -0
- package/metadata/local-query-comparison-options.js.map +1 -0
- package/{src → metadata}/naming-convention.d.ts +75 -72
- package/metadata/naming-convention.js +97 -0
- package/metadata/naming-convention.js.map +1 -0
- package/mixins/mixin-get-entity-graph.d.ts +63 -0
- package/{fesm2022/breeze-client-mixin-get-entity-graph.mjs → mixins/mixin-get-entity-graph.js} +331 -253
- package/mixins/mixin-get-entity-graph.js.map +1 -0
- package/mixins/mixin-save-queuing.d.ts +98 -0
- package/{fesm2022/breeze-client-mixin-save-queuing.mjs → mixins/mixin-save-queuing.js} +493 -365
- package/mixins/mixin-save-queuing.js.map +1 -0
- package/package.json +63 -94
- package/query/entity-query.d.ts +521 -0
- package/query/entity-query.js +1149 -0
- package/query/entity-query.js.map +1 -0
- package/{src → query}/mapping-context.d.ts +44 -46
- package/query/mapping-context.js +412 -0
- package/query/mapping-context.js.map +1 -0
- package/query/predicate.d.ts +394 -0
- package/query/predicate.js +1294 -0
- package/query/predicate.js.map +1 -0
- package/query/property-path.d.ts +252 -0
- package/query/property-path.js +2 -0
- package/query/property-path.js.map +1 -0
- package/{src → query}/query-options.d.ts +143 -119
- package/query/query-options.js +180 -0
- package/query/query-options.js.map +1 -0
- package/rxjs/breeze-rxjs.d.ts +72 -0
- package/rxjs/breeze-rxjs.js +117 -0
- package/rxjs/breeze-rxjs.js.map +1 -0
- package/validation/validate.d.ts +583 -0
- package/validation/validate.js +961 -0
- package/validation/validate.js.map +1 -0
- package/{src → validation}/validation-options.d.ts +67 -63
- package/validation/validation-options.js +70 -0
- package/validation/validation-options.js.map +1 -0
- package/adapter-ajax-angularjs/adapter-ajax-angularjs.d.ts +0 -17
- package/adapter-ajax-angularjs/adapter-core.d.ts +0 -4
- package/adapter-ajax-angularjs/index.d.ts +0 -5
- package/adapter-ajax-fetch/adapter-ajax-fetch.d.ts +0 -18
- package/adapter-ajax-fetch/index.d.ts +0 -5
- package/adapter-ajax-httpclient/adapter-ajax-httpclient.d.ts +0 -13
- package/adapter-ajax-httpclient/adapter-core.d.ts +0 -4
- package/adapter-ajax-httpclient/index.d.ts +0 -5
- package/adapter-ajax-jquery/adapter-ajax-jquery.d.ts +0 -15
- package/adapter-ajax-jquery/index.d.ts +0 -5
- package/adapter-ajax-post/index.d.ts +0 -5
- package/adapter-data-service-odata/adapter-core.d.ts +0 -4
- package/adapter-data-service-odata/adapter-data-service-odata.d.ts +0 -17
- package/adapter-data-service-odata/index.d.ts +0 -5
- package/adapter-data-service-webapi/adapter-data-service-webapi.d.ts +0 -15
- package/adapter-data-service-webapi/index.d.ts +0 -5
- package/adapter-model-library-backing-store/adapter-model-library-backing-store.d.ts +0 -10
- package/adapter-model-library-backing-store/index.d.ts +0 -5
- package/adapter-model-library-ko/adapter-model-library-ko.d.ts +0 -10
- package/adapter-model-library-ko/index.d.ts +0 -5
- package/adapter-uri-builder-json/adapter-core.d.ts +0 -4
- package/adapter-uri-builder-json/adapter-uri-builder-json.d.ts +0 -8
- package/adapter-uri-builder-json/index.d.ts +0 -5
- package/adapter-uri-builder-odata/adapter-core.d.ts +0 -4
- package/adapter-uri-builder-odata/adapter-uri-builder-odata.d.ts +0 -8
- package/adapter-uri-builder-odata/index.d.ts +0 -5
- package/esm2022/adapter-ajax-angularjs/adapter-ajax-angularjs.mjs +0 -135
- package/esm2022/adapter-ajax-angularjs/adapter-core.mjs +0 -49
- package/esm2022/adapter-ajax-angularjs/breeze-client-adapter-ajax-angularjs.mjs +0 -5
- package/esm2022/adapter-ajax-fetch/adapter-ajax-fetch.mjs +0 -135
- package/esm2022/adapter-ajax-fetch/adapter-core.mjs +0 -49
- package/esm2022/adapter-ajax-fetch/breeze-client-adapter-ajax-fetch.mjs +0 -5
- package/esm2022/adapter-ajax-httpclient/adapter-ajax-httpclient.mjs +0 -139
- package/esm2022/adapter-ajax-httpclient/adapter-core.mjs +0 -49
- package/esm2022/adapter-ajax-httpclient/breeze-client-adapter-ajax-httpclient.mjs +0 -5
- package/esm2022/adapter-ajax-jquery/adapter-ajax-jquery.mjs +0 -107
- package/esm2022/adapter-ajax-jquery/breeze-client-adapter-ajax-jquery.mjs +0 -5
- package/esm2022/adapter-ajax-post/adapter-ajax-post.mjs +0 -77
- package/esm2022/adapter-ajax-post/breeze-client-adapter-ajax-post.mjs +0 -5
- package/esm2022/adapter-data-service-odata/adapter-core.mjs +0 -49
- package/esm2022/adapter-data-service-odata/adapter-data-service-odata.mjs +0 -461
- package/esm2022/adapter-data-service-odata/breeze-client-adapter-data-service-odata.mjs +0 -5
- package/esm2022/adapter-data-service-webapi/adapter-data-service-webapi.mjs +0 -100
- package/esm2022/adapter-data-service-webapi/breeze-client-adapter-data-service-webapi.mjs +0 -5
- package/esm2022/adapter-model-library-backing-store/adapter-model-library-backing-store.mjs +0 -269
- package/esm2022/adapter-model-library-backing-store/breeze-client-adapter-model-library-backing-store.mjs +0 -5
- package/esm2022/adapter-model-library-ko/adapter-model-library-ko.mjs +0 -241
- package/esm2022/adapter-model-library-ko/breeze-client-adapter-model-library-ko.mjs +0 -5
- package/esm2022/adapter-uri-builder-json/adapter-core.mjs +0 -49
- package/esm2022/adapter-uri-builder-json/adapter-uri-builder-json.mjs +0 -37
- package/esm2022/adapter-uri-builder-json/breeze-client-adapter-uri-builder-json.mjs +0 -5
- package/esm2022/adapter-uri-builder-odata/adapter-core.mjs +0 -49
- package/esm2022/adapter-uri-builder-odata/adapter-uri-builder-odata.mjs +0 -191
- package/esm2022/adapter-uri-builder-odata/breeze-client-adapter-uri-builder-odata.mjs +0 -5
- package/esm2022/breeze-client.mjs +0 -5
- package/esm2022/index.mjs +0 -2
- package/esm2022/mixin-get-entity-graph/breeze-client-mixin-get-entity-graph.mjs +0 -5
- package/esm2022/mixin-get-entity-graph/mixin-get-entity-graph.mjs +0 -269
- package/esm2022/mixin-save-queuing/breeze-client-mixin-save-queuing.mjs +0 -5
- package/esm2022/mixin-save-queuing/mixin-save-queuing.mjs +0 -421
- package/esm2022/src/abstract-data-service-adapter.mjs +0 -325
- package/esm2022/src/array.mjs +0 -4
- package/esm2022/src/assert-param.mjs +0 -330
- package/esm2022/src/breeze.mjs +0 -85
- package/esm2022/src/complex-array.mjs +0 -117
- package/esm2022/src/config.mjs +0 -232
- package/esm2022/src/core.mjs +0 -712
- package/esm2022/src/csdl-metadata-parser.mjs +0 -385
- package/esm2022/src/data-service.mjs +0 -221
- package/esm2022/src/data-type.mjs +0 -510
- package/esm2022/src/default-property-interceptor.mjs +0 -460
- package/esm2022/src/entity-action.mjs +0 -45
- package/esm2022/src/entity-aspect.mjs +0 -897
- package/esm2022/src/entity-group.mjs +0 -192
- package/esm2022/src/entity-key.mjs +0 -125
- package/esm2022/src/entity-manager.mjs +0 -2163
- package/esm2022/src/entity-metadata.mjs +0 -2242
- package/esm2022/src/entity-query.mjs +0 -1024
- package/esm2022/src/entity-state.mjs +0 -107
- package/esm2022/src/enum.mjs +0 -143
- package/esm2022/src/event.mjs +0 -264
- package/esm2022/src/interface-registry.mjs +0 -39
- package/esm2022/src/key-generator.mjs +0 -110
- package/esm2022/src/local-query-comparison-options.mjs +0 -65
- package/esm2022/src/mapping-context.mjs +0 -411
- package/esm2022/src/naming-convention.mjs +0 -92
- package/esm2022/src/observable-array.mjs +0 -183
- package/esm2022/src/predicate.mjs +0 -1259
- package/esm2022/src/primitive-array.mjs +0 -85
- package/esm2022/src/query-options.mjs +0 -152
- package/esm2022/src/relation-array.mjs +0 -173
- package/esm2022/src/save-options.mjs +0 -41
- package/esm2022/src/unattached-children-map.mjs +0 -56
- package/esm2022/src/validate.mjs +0 -995
- package/esm2022/src/validation-options.mjs +0 -64
- package/fesm2022/breeze-client-adapter-ajax-angularjs.mjs +0 -190
- package/fesm2022/breeze-client-adapter-ajax-angularjs.mjs.map +0 -1
- package/fesm2022/breeze-client-adapter-ajax-fetch.mjs +0 -190
- package/fesm2022/breeze-client-adapter-ajax-fetch.mjs.map +0 -1
- package/fesm2022/breeze-client-adapter-ajax-httpclient.mjs +0 -194
- package/fesm2022/breeze-client-adapter-ajax-httpclient.mjs.map +0 -1
- package/fesm2022/breeze-client-adapter-ajax-jquery.mjs +0 -114
- package/fesm2022/breeze-client-adapter-ajax-jquery.mjs.map +0 -1
- package/fesm2022/breeze-client-adapter-ajax-post.mjs.map +0 -1
- package/fesm2022/breeze-client-adapter-data-service-odata.mjs +0 -516
- package/fesm2022/breeze-client-adapter-data-service-odata.mjs.map +0 -1
- package/fesm2022/breeze-client-adapter-data-service-webapi.mjs.map +0 -1
- package/fesm2022/breeze-client-adapter-model-library-backing-store.mjs +0 -276
- package/fesm2022/breeze-client-adapter-model-library-backing-store.mjs.map +0 -1
- package/fesm2022/breeze-client-adapter-model-library-ko.mjs +0 -248
- package/fesm2022/breeze-client-adapter-model-library-ko.mjs.map +0 -1
- package/fesm2022/breeze-client-adapter-uri-builder-json.mjs.map +0 -1
- package/fesm2022/breeze-client-adapter-uri-builder-odata.mjs +0 -246
- package/fesm2022/breeze-client-adapter-uri-builder-odata.mjs.map +0 -1
- package/fesm2022/breeze-client-mixin-get-entity-graph.mjs.map +0 -1
- package/fesm2022/breeze-client-mixin-save-queuing.mjs.map +0 -1
- package/fesm2022/breeze-client.mjs +0 -14144
- package/fesm2022/breeze-client.mjs.map +0 -1
- package/index.d.ts +0 -1
- package/mixin-get-entity-graph/index.d.ts +0 -5
- package/mixin-get-entity-graph/mixin-get-entity-graph.d.ts +0 -31
- package/mixin-save-queuing/index.d.ts +0 -5
- package/mixin-save-queuing/mixin-save-queuing.d.ts +0 -32
- package/src/abstract-data-service-adapter.d.ts +0 -84
- package/src/array.d.ts +0 -3
- package/src/breeze.d.ts +0 -139
- package/src/complex-array.d.ts +0 -13
- package/src/config.d.ts +0 -104
- package/src/core.d.ts +0 -164
- package/src/csdl-metadata-parser.d.ts +0 -7
- package/src/data-type.d.ts +0 -89
- package/src/default-property-interceptor.d.ts +0 -4
- package/src/entity-aspect.d.ts +0 -332
- package/src/entity-group.d.ts +0 -28
- package/src/entity-key.d.ts +0 -77
- package/src/entity-manager.d.ts +0 -680
- package/src/entity-metadata.d.ts +0 -988
- package/src/entity-query.d.ts +0 -444
- package/src/enum.d.ts +0 -100
- package/src/event.d.ts +0 -142
- package/src/interface-registry.d.ts +0 -150
- package/src/key-generator.d.ts +0 -12
- package/src/observable-array.d.ts +0 -52
- package/src/predicate.d.ts +0 -376
- package/src/primitive-array.d.ts +0 -7
- package/src/relation-array.d.ts +0 -18
- package/src/unattached-children-map.d.ts +0 -19
- package/src/validate.d.ts +0 -650
|
@@ -0,0 +1,521 @@
|
|
|
1
|
+
import { Callback, ErrorCallback } from '../core/core.js';
|
|
2
|
+
import { Entity } from '../entity/entity-aspect.js';
|
|
3
|
+
import type { QueriedAs } from '../entity/entity-aspect.js';
|
|
4
|
+
import { EntityKey } from '../entity/entity-key.js';
|
|
5
|
+
import { BreezeEnum } from '../core/enum.js';
|
|
6
|
+
import { DataService, JsonResultsAdapter } from '../metadata/data-service.js';
|
|
7
|
+
import { EntityManager, QueryResult } from '../manager/entity-manager.js';
|
|
8
|
+
import { EntityType, NavigationProperty } from '../metadata/entity-metadata.js';
|
|
9
|
+
import { QueryOptions, MergeStrategy, FetchStrategy } from './query-options.js';
|
|
10
|
+
import { Predicate } from './predicate.js';
|
|
11
|
+
import type { CollectionElement, CollectionPath, FilterOpFor, FilterValueFor, FunctionExpressionPath, WhereObject, NavigationPath, OrderByPath, PropertyPath, PropertyValue, QuantifierOp, SelectPath } from './property-path.js';
|
|
12
|
+
export interface RecursiveArray<T> {
|
|
13
|
+
[i: number]: T | RecursiveArray<T>;
|
|
14
|
+
}
|
|
15
|
+
export interface EntityQueryJsonContext {
|
|
16
|
+
entityType?: EntityType;
|
|
17
|
+
propertyPathFn?: Function;
|
|
18
|
+
toNameOnServer?: boolean;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
An EntityQuery instance is used to query entities either from a remote datasource or from a local {@link EntityManager}.
|
|
22
|
+
|
|
23
|
+
EntityQueries are immutable - this means that all EntityQuery methods that return an EntityQuery actually create a new EntityQuery. This means that
|
|
24
|
+
EntityQueries can be 'modified' without affecting any current instances.
|
|
25
|
+
*/
|
|
26
|
+
export declare class EntityQuery<T = any> {
|
|
27
|
+
/** The resource name used by this query. __Read Only__ */
|
|
28
|
+
resourceName?: string;
|
|
29
|
+
/** The {@link EntityType} that is associated with the 'from' clause ( resourceName) of the query. This is only guaranteed to be be set AFTER the query
|
|
30
|
+
has been executed because it depends on the {@link MetadataStore} associated with the {@link EntityManager} that the query was executed against.
|
|
31
|
+
This value may be null if the entityType cannot be associated with a resourceName. __Read Only__ */
|
|
32
|
+
fromEntityType?: EntityType;
|
|
33
|
+
/** The 'where' {@link Predicate} used by this query. __Read Only__ */
|
|
34
|
+
wherePredicate?: Predicate;
|
|
35
|
+
/** The `OrderByClause` used by this query. __Read Only__ */
|
|
36
|
+
orderByClause?: OrderByClause;
|
|
37
|
+
/** The `ExpandClause` used by this query. __Read Only__ */
|
|
38
|
+
expandClause?: ExpandClause;
|
|
39
|
+
/** The `SelectClause` used by this query. __Read Only__ */
|
|
40
|
+
selectClause?: SelectClause;
|
|
41
|
+
/** The number of entities to 'skip' for this query. __Read Only__ */
|
|
42
|
+
skipCount?: number;
|
|
43
|
+
/** The number of entities to 'take' for this query. __Read Only__ */
|
|
44
|
+
takeCount?: number;
|
|
45
|
+
/** Any additional parameters that were added to the query via the 'withParameters' method. __Read Only__ */
|
|
46
|
+
parameters: Object;
|
|
47
|
+
/** Whether an inline count is returned for this query. __Read Only__ */
|
|
48
|
+
inlineCountEnabled: boolean;
|
|
49
|
+
/** Whether entity tracking has been disabled for this query. __Read Only__ */
|
|
50
|
+
noTrackingEnabled: boolean;
|
|
51
|
+
/** Whether to send query as the body of a POST request. (Server needs to accomodate POST). __Read Only__ */
|
|
52
|
+
usePostEnabled: boolean;
|
|
53
|
+
/** The {@link QueryOptions} for this query. __Read Only__ */
|
|
54
|
+
queryOptions?: QueryOptions;
|
|
55
|
+
/** The {@link DataService} for this query. __Read Only__ */
|
|
56
|
+
dataService?: DataService;
|
|
57
|
+
/** The {@link EntityManager} for this query. This may be null and can be set via the 'using' method. */
|
|
58
|
+
entityManager?: EntityManager;
|
|
59
|
+
/** The entityType that will be returned by this query.
|
|
60
|
+
This property will only be set if the 'toType' method was called. __Read Only__ */
|
|
61
|
+
resultEntityType: EntityType | string;
|
|
62
|
+
/** Whether the query's property paths are the server's names, sent as written. Set by {@link EntityQuery.useNameOnServer}. __Read Only__ */
|
|
63
|
+
usesNameOnServer?: boolean;
|
|
64
|
+
/** Constructor. Most queries start from the static {@link EntityQuery.from} instead, which takes a
|
|
65
|
+
registered entity class and so gives a typed query:
|
|
66
|
+
```ts
|
|
67
|
+
const query = EntityQuery.from(Customer); // EntityQuery<Customer>
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
When a constructor is needed, supply the type argument. As with a type argument on
|
|
71
|
+
`EntityQuery.from(resourceName)`, nothing checks it against the resource name:
|
|
72
|
+
```ts
|
|
73
|
+
const query = new EntityQuery<Customer>("Customers");
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Usually this constructor will be followed by calls to filtering, ordering or selection methods
|
|
77
|
+
```ts
|
|
78
|
+
const query = new EntityQuery<Customer>("Customers")
|
|
79
|
+
.where("companyName", "startsWith", "C")
|
|
80
|
+
.orderBy("region");
|
|
81
|
+
```
|
|
82
|
+
@param resourceName - either a resource name or a serialized EntityQuery ( created by {@link EntityQuery.toJSON})
|
|
83
|
+
*/
|
|
84
|
+
constructor(resourceName?: string | Object);
|
|
85
|
+
/**
|
|
86
|
+
Specifies the resource to query for this EntityQuery.
|
|
87
|
+
```ts
|
|
88
|
+
const query = new EntityQuery()
|
|
89
|
+
.from("Customers");
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
is the same as
|
|
93
|
+
```ts
|
|
94
|
+
const query = new EntityQuery("Customers");
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
For a typed query, use the static `EntityQuery.from(Customer)` instead.
|
|
98
|
+
@param resourceName - The resource to query.
|
|
99
|
+
*/
|
|
100
|
+
from(resourceName: string): EntityQuery<T>;
|
|
101
|
+
/**
|
|
102
|
+
Creates a 'base' entityQuery, either for a registered entity class or for a resource name.
|
|
103
|
+
|
|
104
|
+
Given a class, the resource name comes from the metadata and the query carries the type, so the
|
|
105
|
+
results are typed:
|
|
106
|
+
```ts
|
|
107
|
+
const query = EntityQuery.from(Customer); // EntityQuery<Customer>
|
|
108
|
+
const custs = (await query.using(em).execute()).results; // Customer[]
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
The class must be registered with {@link MetadataStore.registerEntityTypeCtor}; that is what
|
|
112
|
+
tells Breeze which type it stands for, and an unregistered class throws.
|
|
113
|
+
|
|
114
|
+
A resource name may be given instead; see the other signature.
|
|
115
|
+
@param entityCtor - A constructor registered for the EntityType to query.
|
|
116
|
+
*/
|
|
117
|
+
static from<U extends Entity>(entityCtor: new () => U): EntityQuery<U>;
|
|
118
|
+
/**
|
|
119
|
+
Creates a 'base' entityQuery for the specified resource name. Prefer passing a registered entity
|
|
120
|
+
class, as in `EntityQuery.from(Customer)`, which gives a typed query.
|
|
121
|
+
|
|
122
|
+
Given a resource name, the query is untyped, as it always was:
|
|
123
|
+
```ts
|
|
124
|
+
const query = EntityQuery.from("Customers");
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
is the same as
|
|
128
|
+
```ts
|
|
129
|
+
const query = new EntityQuery("Customers");
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
A type argument may be supplied with a resource name, for a projection or a named server query
|
|
133
|
+
that no entity class describes. **Nothing checks it against the resource** - it is an assertion,
|
|
134
|
+
not a guarantee, and `EntityQuery.from<Customer>("Orders")` compiles:
|
|
135
|
+
```ts
|
|
136
|
+
const query = EntityQuery.from<CustomerDto>("CompanyNamesAndIds");
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
`U` is the caller's claim about what the resource returns; nothing checks it against the name.
|
|
140
|
+
It defaults to `any`, so `from("Customers")` behaves exactly as it always has.
|
|
141
|
+
@param resourceName - The resource to query.
|
|
142
|
+
*/
|
|
143
|
+
static from<U = any>(resourceName: string): EntityQuery<U>;
|
|
144
|
+
/**
|
|
145
|
+
Specifies the top level type this query will return, as a registered constructor. The query then
|
|
146
|
+
carries that type, so its results are typed - and because the constructor is resolved through
|
|
147
|
+
metadata, this is *checked*, unlike a type argument on {@link EntityQuery.from}:
|
|
148
|
+
```ts
|
|
149
|
+
const query = EntityQuery.from("CustomersAndOrders").toType(Customer); // EntityQuery<Customer>
|
|
150
|
+
```
|
|
151
|
+
@param entityCtor - A constructor registered for the EntityType this query will return.
|
|
152
|
+
@summary If the json result consists of more than a simple entity or array of entities, consider using a {@link JsonResultsAdapter} instead.
|
|
153
|
+
*/
|
|
154
|
+
toType<U extends Entity>(entityCtor: new () => U): EntityQuery<U>;
|
|
155
|
+
/**
|
|
156
|
+
Specifies the top level EntityType that this query will return. Only needed when a query returns a json result that does not include type information,
|
|
157
|
+
or when using a resource name that is not associated to an EntityType.
|
|
158
|
+
```ts
|
|
159
|
+
const query = EntityQuery.from("MyCustomMethod")
|
|
160
|
+
.toType("Customer");
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
Passing the registered class instead, as in `toType(Customer)`, also types the query.
|
|
164
|
+
@param entityType - The top level EntityType that this query will return.
|
|
165
|
+
@summary If the json result consists of more than a simple entity or array of entities, consider using a {@link JsonResultsAdapter} instead.
|
|
166
|
+
*/
|
|
167
|
+
toType(entityType: string | EntityType): EntityQuery<any>;
|
|
168
|
+
where<P extends CollectionPath<T>>(collection: P, quantifier: QuantifierOp | FilterQueryOp, predicate: Predicate<CollectionElement<T, P>>): EntityQuery<T>;
|
|
169
|
+
where(collection: CollectionPath<T>, quantifier: QuantifierOp | FilterQueryOp, property: string, quantifier2: QuantifierOp | FilterQueryOp, predicate: Predicate): EntityQuery<T>;
|
|
170
|
+
where(predicate: WhereObject<T>): EntityQuery<T>;
|
|
171
|
+
where(predicate?: Predicate<T>): EntityQuery<T>;
|
|
172
|
+
where<O extends string>(property: PropertyPath<T>, operator: string extends O ? O : never, value: any): EntityQuery<T>;
|
|
173
|
+
where<P extends string>(property: P extends FunctionExpressionPath ? P : (string extends P ? P : never), operator: string | FilterQueryOp, value: any): EntityQuery<T>;
|
|
174
|
+
where<P extends string>(collection: string extends P ? P : never, quantifier: string | FilterQueryOp, property: string, operator: string | FilterQueryOp, value: any): EntityQuery<T>;
|
|
175
|
+
where<P2 extends string>(collection: CollectionPath<T>, quantifier: string | FilterQueryOp, property: string extends P2 ? P2 : never, operator: string | FilterQueryOp, value: any): EntityQuery<T>;
|
|
176
|
+
where<O2 extends string>(collection: CollectionPath<T>, quantifier: string | FilterQueryOp, property: PropertyPath<CollectionElement<T, CollectionPath<T>>> | string, operator: string extends O2 ? O2 : never, value: any): EntityQuery<T>;
|
|
177
|
+
where(property: string, filterop: string, property2: string, filterop2: string, property3: string, filterop3: string, value: any): EntityQuery<T>;
|
|
178
|
+
where(anArray: RecursiveArray<string | number | FilterQueryOp | Predicate>): EntityQuery<T>;
|
|
179
|
+
where<P extends PropertyPath<T>, O extends FilterOpFor<PropertyValue<T, P>>>(property: P, operator: O, value: FilterValueFor<T, PropertyValue<T, P>, O>): EntityQuery<T>;
|
|
180
|
+
where<P extends CollectionPath<T>, P2 extends PropertyPath<CollectionElement<T, P>>, O2 extends FilterOpFor<PropertyValue<CollectionElement<T, P>, P2>>>(collection: P, quantifier: QuantifierOp, property: P2, operator: O2, value: FilterValueFor<CollectionElement<T, P>, PropertyValue<CollectionElement<T, P>, P2>, O2>): EntityQuery<T>;
|
|
181
|
+
orderBy(propertyPaths: OrderByPath<T> | OrderByPath<T>[], isDescending?: boolean): EntityQuery<T>;
|
|
182
|
+
orderBy<P extends string>(propertyPaths: P extends `${string},${string}` ? P : (string extends P ? P : never), isDescending?: boolean): EntityQuery<T>;
|
|
183
|
+
orderBy(propertyPaths?: undefined, isDescending?: boolean): EntityQuery<T>;
|
|
184
|
+
orderBy<P extends string>(propertyPaths: string extends P ? P[] : never, isDescending?: boolean): EntityQuery<T>;
|
|
185
|
+
orderByDesc(propertyPaths: OrderByPath<T> | OrderByPath<T>[]): EntityQuery<T>;
|
|
186
|
+
orderByDesc<P extends string>(propertyPaths: P extends `${string},${string}` ? P : (string extends P ? P : never)): EntityQuery<T>;
|
|
187
|
+
orderByDesc<P extends string>(propertyPaths: string extends P ? P[] : never): EntityQuery<T>;
|
|
188
|
+
/**
|
|
189
|
+
Returns a new query that selects a list of properties from the results of the original query and returns the values of just these properties. This
|
|
190
|
+
will be referred to as a projection.
|
|
191
|
+
If the result of this selection "projection" contains entities, these entities will automatically be added to EntityManager's cache and will
|
|
192
|
+
be made 'observable'.
|
|
193
|
+
Any simple properties, i.e. strings, numbers or dates within a projection will not be cached are will NOT be made 'observable'.
|
|
194
|
+
|
|
195
|
+
Simple data properties can be projected
|
|
196
|
+
```ts
|
|
197
|
+
const query = EntityQuery.from(Customer)
|
|
198
|
+
.where("companyName", "startsWith", "C")
|
|
199
|
+
.select("companyName");
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
This will return an array of objects each with a single "companyName" property of type string.
|
|
203
|
+
A similar query could return a navigation property instead
|
|
204
|
+
```ts
|
|
205
|
+
const query = EntityQuery.from(Customer)
|
|
206
|
+
.where("companyName", "startsWith", "C")
|
|
207
|
+
.select("orders");
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
where the result would be an array of objects each with a single "orders" property that would itself be an array of "Order" entities.
|
|
211
|
+
Composite projections are also possible:
|
|
212
|
+
```ts
|
|
213
|
+
const query = EntityQuery.from(Customer)
|
|
214
|
+
.where("companyName", "startsWith", "C")
|
|
215
|
+
.select("companyName, orders");
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
As well as projections involving nested property paths
|
|
219
|
+
```ts
|
|
220
|
+
const query = EntityQuery.from(Order)
|
|
221
|
+
.where("customer.companyName", "startsWith", "C")
|
|
222
|
+
.select("customer.companyName, customer, orderDate");
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
The projected query is an `EntityQuery<any>`: its results are no longer entities of the queried type.
|
|
226
|
+
@param propertyPaths - A comma-separated (',') string of property paths or an array of property paths.
|
|
227
|
+
If 'propertyPaths' is either null or omitted then any existing projection on the query is removed.
|
|
228
|
+
*/
|
|
229
|
+
select(propertyPaths: SelectPath<T> | SelectPath<T>[]): EntityQuery<any>;
|
|
230
|
+
select<P extends string>(propertyPaths: P extends `${string},${string}` ? P : (string extends P ? P : never)): EntityQuery<any>;
|
|
231
|
+
select(propertyPaths?: undefined): EntityQuery<any>;
|
|
232
|
+
select<P extends string>(propertyPaths: string extends P ? P[] : never): EntityQuery<any>;
|
|
233
|
+
/**
|
|
234
|
+
Returns a new query that skips the specified number of entities when returning results.
|
|
235
|
+
Any existing 'skip' can be cleared by calling 'skip' with no arguments.
|
|
236
|
+
```ts
|
|
237
|
+
const query = EntityQuery.from(Customer)
|
|
238
|
+
.where("companyName", "startsWith", "C")
|
|
239
|
+
.skip(5);
|
|
240
|
+
```
|
|
241
|
+
@param count - The number of entities to skip over. If omitted or null any existing skip count on the query is removed.
|
|
242
|
+
*/
|
|
243
|
+
skip(count?: number): EntityQuery<T>;
|
|
244
|
+
/**
|
|
245
|
+
Returns a new query that returns only the specified number of entities when returning results. - Same as 'take'.
|
|
246
|
+
Any existing 'top' can be cleared by calling 'top' with no arguments.
|
|
247
|
+
```ts
|
|
248
|
+
const query = EntityQuery.from(Customer)
|
|
249
|
+
.top(5);
|
|
250
|
+
```
|
|
251
|
+
@param count - The number of entities to return.
|
|
252
|
+
If 'count' is either null or omitted then any existing 'top' count on the query is removed.
|
|
253
|
+
*/
|
|
254
|
+
top(count?: number): EntityQuery<T>;
|
|
255
|
+
/**
|
|
256
|
+
Returns a new query that returns only the specified number of entities when returning results - Same as 'top'.
|
|
257
|
+
Any existing take can be cleared by calling take with no arguments.
|
|
258
|
+
```ts
|
|
259
|
+
const query = EntityQuery.from(Customer)
|
|
260
|
+
.take(5);
|
|
261
|
+
```
|
|
262
|
+
@param count - The number of entities to return.
|
|
263
|
+
If 'count' is either null or omitted then any existing 'take' count on the query is removed.
|
|
264
|
+
*/
|
|
265
|
+
take(count?: number): EntityQuery<T>;
|
|
266
|
+
expand(propertyPaths: NavigationPath<T> | NavigationPath<T>[]): EntityQuery<T>;
|
|
267
|
+
expand<P extends string>(propertyPaths: P extends `${string},${string}` ? P : (string extends P ? P : never)): EntityQuery<T>;
|
|
268
|
+
expand<P extends string>(propertyPaths: string extends P ? P[] : never): EntityQuery<T>;
|
|
269
|
+
expand(propertyPaths?: undefined): EntityQuery<T>;
|
|
270
|
+
/**
|
|
271
|
+
Returns a new query that includes a collection of parameters to pass to the server.
|
|
272
|
+
```ts
|
|
273
|
+
const query = EntityQuery.from("EmployeesFilteredByCountryAndBirthdate")
|
|
274
|
+
.toType(Employee)
|
|
275
|
+
.withParameters({ birthDate: "1/1/1960", country: "USA" });
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
will call the 'EmployeesFilteredByCountryAndBirthdate' method on the server and pass in 2 parameters. This
|
|
279
|
+
query will be uri encoded as
|
|
280
|
+
```ts
|
|
281
|
+
{serviceApi}/EmployeesFilteredByCountryAndBirthdate?birthDate=1%2F1%2F1960&country=USA
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
Parameters may also be mixed in with other query criteria.
|
|
285
|
+
```ts
|
|
286
|
+
const query = EntityQuery.from("EmployeesFilteredByCountryAndBirthdate")
|
|
287
|
+
.toType(Employee)
|
|
288
|
+
.withParameters({ birthDate: "1/1/1960", country: "USA" })
|
|
289
|
+
.where("lastName", "startsWith", "S")
|
|
290
|
+
.orderBy("birthDate");
|
|
291
|
+
```
|
|
292
|
+
@param parameters - A parameters object where the keys are the parameter names and the values are the parameter values.
|
|
293
|
+
*/
|
|
294
|
+
withParameters(parameters: Object): EntityQuery<T>;
|
|
295
|
+
/**
|
|
296
|
+
Returns a query with the `inlineCount` capability either enabled or disabled. With `inlineCount` enabled, an additional 'inlineCount' property
|
|
297
|
+
will be returned with the query results that will contain the number of entities that would have been returned by this
|
|
298
|
+
query with only the 'where'/'filter' clauses applied, i.e. without any 'skip'/'take' operators applied. For local queries this clause is ignored.
|
|
299
|
+
```ts
|
|
300
|
+
const query = EntityQuery.from(Customer)
|
|
301
|
+
.take(20)
|
|
302
|
+
.orderBy("companyName")
|
|
303
|
+
.inlineCount(true);
|
|
304
|
+
```
|
|
305
|
+
|
|
306
|
+
will return the first 20 customers as well as a count of _all_ of the customers in the remote store.
|
|
307
|
+
@param enabled - (default = true) Whether or not inlineCount capability should be enabled. If this parameter is omitted, true is assumed.
|
|
308
|
+
*/
|
|
309
|
+
inlineCount(enabled?: boolean): EntityQuery<T>;
|
|
310
|
+
/**
|
|
311
|
+
Returns a query whose property paths are the server's names rather than the client's, so Breeze
|
|
312
|
+
sends them as written instead of translating them with the `MetadataStore`'s naming convention.
|
|
313
|
+
```ts
|
|
314
|
+
EntityQuery.from('Customers').where('CompanyName', 'startsWith', 'A').useNameOnServer();
|
|
315
|
+
```
|
|
316
|
+
The query is built from a resource name because a typed query, `EntityQuery.from(Customer)`,
|
|
317
|
+
checks its paths against the client's names and would reject `'CompanyName'`.
|
|
318
|
+
Only the query sent to the server is affected: run against the cache, a query works on the
|
|
319
|
+
client's objects and needs the client's names.
|
|
320
|
+
@param usesNameOnServer - (default = true)
|
|
321
|
+
*/
|
|
322
|
+
useNameOnServer(usesNameOnServer?: boolean): EntityQuery<T>;
|
|
323
|
+
/**
|
|
324
|
+
Returns a query with the `noTracking` capability either enabled or disabled. With `noTracking` enabled, the results of this query
|
|
325
|
+
will not be coerced into entities but will instead look like raw javascript projections. i.e. simple javascript objects.
|
|
326
|
+
```ts
|
|
327
|
+
const query = EntityQuery.from(Customer)
|
|
328
|
+
.take(20)
|
|
329
|
+
.orderBy("companyName")
|
|
330
|
+
.noTracking(true);
|
|
331
|
+
```
|
|
332
|
+
@param enabled - (default = true) Whether or not the noTracking capability should be enabled. If this parameter is omitted, true is assumed.
|
|
333
|
+
*/
|
|
334
|
+
noTracking(enabled?: boolean): EntityQuery<T>;
|
|
335
|
+
/**
|
|
336
|
+
Returns a query with the `usePost` capability either enabled or disabled. With `usePost` enabled, the query is sent
|
|
337
|
+
as a POST request (instead of GET) and the query expression will be sent as JSON in the body of the post.
|
|
338
|
+
Note that the server must be able to parse the body of the request; otherwise the query expression will be ignored.
|
|
339
|
+
```ts
|
|
340
|
+
const query = EntityQuery.from(Order)
|
|
341
|
+
.where("freight", "gt", 100)
|
|
342
|
+
.usePost(true);
|
|
343
|
+
```
|
|
344
|
+
results in a POST request to `{host}/{path}/Orders`
|
|
345
|
+
with body `{"where": {"Freight":{"gt":100}}}`
|
|
346
|
+
@param enabled - (default = true) Whether or not usePost should be enabled. If this parameter is omitted, true is assumed.
|
|
347
|
+
*/
|
|
348
|
+
usePost(enabled?: boolean): EntityQuery<T>;
|
|
349
|
+
using(obj: EntityManager): EntityQuery<T>;
|
|
350
|
+
using(obj: DataService): EntityQuery<T>;
|
|
351
|
+
using(obj: JsonResultsAdapter): EntityQuery<T>;
|
|
352
|
+
using(obj: QueryOptions): EntityQuery<T>;
|
|
353
|
+
using(obj: MergeStrategy): EntityQuery<T>;
|
|
354
|
+
using(obj: FetchStrategy): EntityQuery<T>;
|
|
355
|
+
execute(): Promise<QueryResult<T>>;
|
|
356
|
+
/** @deprecated Await the returned promise instead of passing callbacks. */
|
|
357
|
+
execute(callback?: Callback, errorCallback?: ErrorCallback): Promise<QueryResult<T>>;
|
|
358
|
+
/**
|
|
359
|
+
Executes this query against the local cache. This method requires that an EntityManager have been previously specified via the "using" method.
|
|
360
|
+
```ts
|
|
361
|
+
// assume em is an entityManager already filled with order entities;
|
|
362
|
+
const query = EntityQuery.from(Order).using(em);
|
|
363
|
+
const orders = query.executeLocally(); // Order[]
|
|
364
|
+
```
|
|
365
|
+
|
|
366
|
+
Note that calling this method is the same as calling {@link EntityManager.executeQueryLocally}.
|
|
367
|
+
*/
|
|
368
|
+
executeLocally(): T[];
|
|
369
|
+
/**
|
|
370
|
+
Executes this query against the server and returns only the number of matching entities, without
|
|
371
|
+
materializing any of them. Requires an EntityManager, set via {@link EntityQuery.using}.
|
|
372
|
+
```ts
|
|
373
|
+
const count = await EntityQuery.from(Order).where("freight", ">", 100).using(em).executeCount();
|
|
374
|
+
```
|
|
375
|
+
|
|
376
|
+
It is `take(0).inlineCount(true)` and reads `inlineCount` off the result, so the server must
|
|
377
|
+
support inline count.
|
|
378
|
+
*/
|
|
379
|
+
executeCount(): Promise<number>;
|
|
380
|
+
/**
|
|
381
|
+
Returns the serializable form of this query: its resource name, clauses, parameters and options,
|
|
382
|
+
with client property names. `JSON.stringify` calls it, and passing the parsed JSON to the
|
|
383
|
+
`EntityQuery` constructor recreates the query. The `EntityManager` and `DataService` are not
|
|
384
|
+
included.
|
|
385
|
+
*/
|
|
386
|
+
toJSON(): Record<string, any>;
|
|
387
|
+
static fromEntities<U extends Entity>(entity: U): EntityQuery<QueriedAs<U>>;
|
|
388
|
+
static fromEntities<U extends Entity>(entities: U[]): EntityQuery<QueriedAs<U>>;
|
|
389
|
+
/**
|
|
390
|
+
Creates an EntityQuery for the specified {@link EntityKey}.
|
|
391
|
+
```ts
|
|
392
|
+
const entityKey = new EntityKey(Employee, 1);
|
|
393
|
+
const query = EntityQuery.fromEntityKey(entityKey);
|
|
394
|
+
```
|
|
395
|
+
|
|
396
|
+
or
|
|
397
|
+
```ts
|
|
398
|
+
// 'employee' is a previously queried employee
|
|
399
|
+
const entityKey = employee.entityAspect.getKey();
|
|
400
|
+
const query = EntityQuery.fromEntityKey(entityKey);
|
|
401
|
+
```
|
|
402
|
+
@param entityKey - The {@link EntityKey} for which a query will be created.
|
|
403
|
+
*/
|
|
404
|
+
static fromEntityKey(entityKey: EntityKey): EntityQuery<any>;
|
|
405
|
+
/**
|
|
406
|
+
Creates an EntityQuery for the specified entity and {@link NavigationProperty}.
|
|
407
|
+
```ts
|
|
408
|
+
// 'employee' is a previously queried employee
|
|
409
|
+
const query = EntityQuery.fromEntityNavigation(employee, "orders");
|
|
410
|
+
```
|
|
411
|
+
|
|
412
|
+
will return a query for the "orders" of the specified 'employee'. The {@link NavigationProperty}
|
|
413
|
+
itself may be passed instead of its name:
|
|
414
|
+
```ts
|
|
415
|
+
const ordersNavProp = employee.entityType.getNavigationProperty("orders");
|
|
416
|
+
const query = EntityQuery.fromEntityNavigation(employee, ordersNavProp);
|
|
417
|
+
```
|
|
418
|
+
@param entity - The Entity whose navigation property will be queried.
|
|
419
|
+
@param navigationProperty - The {@link NavigationProperty} or name of the NavigationProperty to be queried.
|
|
420
|
+
*/
|
|
421
|
+
static fromEntityNavigation: (entity: Entity, navigationProperty: NavigationProperty | string) => EntityQuery<any>;
|
|
422
|
+
}
|
|
423
|
+
/** Base class for BooleanQueryOp and FilterQueryOp */
|
|
424
|
+
export interface QueryOp {
|
|
425
|
+
/** The operator for this enum. */
|
|
426
|
+
operator: string;
|
|
427
|
+
}
|
|
428
|
+
/**
|
|
429
|
+
FilterQueryOp is an 'Enum' containing all of the valid {@link Predicate}
|
|
430
|
+
filter operators for an {@link EntityQuery}.
|
|
431
|
+
*/
|
|
432
|
+
export declare class FilterQueryOp extends BreezeEnum implements QueryOp {
|
|
433
|
+
/** The operator for this enum. */
|
|
434
|
+
operator: string;
|
|
435
|
+
/** Aliases: "eq", "==" */
|
|
436
|
+
static Equals: FilterQueryOp;
|
|
437
|
+
/** Aliases: "ne", "!=" */
|
|
438
|
+
static NotEquals: FilterQueryOp;
|
|
439
|
+
/** Aliases: "gt", ">" */
|
|
440
|
+
static GreaterThan: FilterQueryOp;
|
|
441
|
+
/** Aliases: "lt", "<" */
|
|
442
|
+
static LessThan: FilterQueryOp;
|
|
443
|
+
/** Aliases: "ge", ">=" */
|
|
444
|
+
static GreaterThanOrEqual: FilterQueryOp;
|
|
445
|
+
/** Aliases: "le", "<=" */
|
|
446
|
+
static LessThanOrEqual: FilterQueryOp;
|
|
447
|
+
/** String operation: Is a string a substring of another string. Aliases: "substringof" */
|
|
448
|
+
static Contains: FilterQueryOp;
|
|
449
|
+
/** No aliases */
|
|
450
|
+
static StartsWith: FilterQueryOp;
|
|
451
|
+
/** No aliases */
|
|
452
|
+
static EndsWith: FilterQueryOp;
|
|
453
|
+
/** Aliases: "some" */
|
|
454
|
+
static Any: FilterQueryOp;
|
|
455
|
+
/** Aliases: "every" */
|
|
456
|
+
static All: FilterQueryOp;
|
|
457
|
+
/** No aliases */
|
|
458
|
+
static In: FilterQueryOp;
|
|
459
|
+
}
|
|
460
|
+
/**
|
|
461
|
+
BooleanQueryOp is an 'Enum' containing all of the valid boolean
|
|
462
|
+
operators for an {@link EntityQuery}.
|
|
463
|
+
*/
|
|
464
|
+
export declare class BooleanQueryOp extends BreezeEnum implements QueryOp {
|
|
465
|
+
/** The operator for this enum. */
|
|
466
|
+
operator: string;
|
|
467
|
+
static And: BooleanQueryOp;
|
|
468
|
+
static Or: BooleanQueryOp;
|
|
469
|
+
static Not: BooleanQueryOp;
|
|
470
|
+
}
|
|
471
|
+
/** For use by breeze plugin authors only. The class is used in most {@link UriBuilderAdapter} implementations
|
|
472
|
+
@adapter (see {@link UriBuilderAdapter})
|
|
473
|
+
@hidden
|
|
474
|
+
|
|
475
|
+
An OrderByClause is a description of the properties and direction that the result
|
|
476
|
+
of a query should be sorted in. OrderByClauses are immutable, which means that any
|
|
477
|
+
method that would modify an OrderByClause actually returns a new OrderByClause.
|
|
478
|
+
|
|
479
|
+
For example for an Employee object with properties of 'company' and 'lastName' the following would be valid expressions:
|
|
480
|
+
```ts
|
|
481
|
+
const obc = new OrderByClause(["company.companyName", "lastName"]);
|
|
482
|
+
```
|
|
483
|
+
|
|
484
|
+
or
|
|
485
|
+
```ts
|
|
486
|
+
const obc = new OrderByClause(["company.companyName desc", "lastName"]);
|
|
487
|
+
```
|
|
488
|
+
|
|
489
|
+
or
|
|
490
|
+
```ts
|
|
491
|
+
const obc = new OrderByClause(["company.companyName", "lastName"], true);
|
|
492
|
+
```
|
|
493
|
+
*/
|
|
494
|
+
export declare class OrderByClause {
|
|
495
|
+
constructor(propertyPaths: string[] | OrderByClause[], isDesc?: boolean);
|
|
496
|
+
validate(entityType: EntityType): void;
|
|
497
|
+
getComparer(entityType: EntityType): (entity1: any, entity2: any) => number;
|
|
498
|
+
toJSONExt(context: EntityQueryJsonContext): string[];
|
|
499
|
+
}
|
|
500
|
+
/** For use by breeze plugin authors only. The class is used in most {@link UriBuilderAdapter} implementations
|
|
501
|
+
@adapter (see {@link UriBuilderAdapter})
|
|
502
|
+
@hidden
|
|
503
|
+
*/
|
|
504
|
+
export declare class SelectClause {
|
|
505
|
+
propertyPaths: string[];
|
|
506
|
+
constructor(propertyPaths: string[]);
|
|
507
|
+
validate(entityType: EntityType): void;
|
|
508
|
+
toFunction(config?: {
|
|
509
|
+
entityType?: EntityType;
|
|
510
|
+
}): (entity: Entity) => {};
|
|
511
|
+
toJSONExt(context: EntityQueryJsonContext): any[];
|
|
512
|
+
}
|
|
513
|
+
/** For use by breeze plugin authors only. The class is used in most {@link UriBuilderAdapter} implementations
|
|
514
|
+
@adapter (see {@link UriBuilderAdapter})
|
|
515
|
+
@hidden
|
|
516
|
+
*/
|
|
517
|
+
export declare class ExpandClause {
|
|
518
|
+
propertyPaths: string[];
|
|
519
|
+
constructor(propertyPaths: string[]);
|
|
520
|
+
toJSONExt(context: EntityQueryJsonContext): any[];
|
|
521
|
+
}
|