angular-odata 0.126.0 → 0.128.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/esm2022/lib/annotations.mjs +140 -0
- package/esm2022/lib/api.mjs +211 -166
- package/esm2022/lib/cache/cache.mjs +1 -1
- package/esm2022/lib/cache/memory.mjs +1 -1
- package/esm2022/lib/client.mjs +8 -48
- package/esm2022/lib/constants.mjs +4 -1
- package/esm2022/lib/index.mjs +3 -1
- package/esm2022/lib/loaders.mjs +23 -17
- package/esm2022/lib/metadata/csdl/csdl-annotation.mjs +95 -0
- package/esm2022/lib/metadata/csdl/csdl-entity-container.mjs +27 -0
- package/esm2022/lib/metadata/csdl/csdl-entity-set.mjs +24 -0
- package/esm2022/lib/metadata/csdl/csdl-enum-type.mjs +37 -0
- package/esm2022/lib/metadata/csdl/csdl-function-action.mjs +94 -0
- package/esm2022/lib/metadata/csdl/csdl-navigation-property-binding.mjs +7 -0
- package/esm2022/lib/metadata/csdl/csdl-reference.mjs +23 -0
- package/esm2022/lib/metadata/csdl/csdl-schema.mjs +39 -0
- package/esm2022/lib/metadata/csdl/csdl-singleton.mjs +15 -0
- package/esm2022/lib/metadata/csdl/csdl-structural-property.mjs +70 -0
- package/esm2022/lib/metadata/csdl/csdl-structured-type.mjs +92 -0
- package/esm2022/lib/metadata/csdl/csdl-type-definition.mjs +15 -0
- package/esm2022/lib/metadata/index.mjs +3 -0
- package/esm2022/lib/metadata/metadata.mjs +14 -0
- package/esm2022/lib/metadata/parser.mjs +563 -0
- package/esm2022/lib/models/collection.mjs +202 -207
- package/esm2022/lib/models/model.mjs +48 -52
- package/esm2022/lib/models/options.mjs +172 -137
- package/esm2022/lib/module.mjs +21 -8
- package/esm2022/lib/options.mjs +2 -1
- package/esm2022/lib/resources/index.mjs +2 -2
- package/esm2022/lib/resources/options.mjs +56 -0
- package/esm2022/lib/resources/path/handlers.mjs +14 -4
- package/esm2022/lib/resources/path/segments.mjs +29 -11
- package/esm2022/lib/resources/query/builder.mjs +14 -2
- package/esm2022/lib/resources/query/expressions/apply.mjs +236 -0
- package/esm2022/lib/resources/query/expressions/base.mjs +1 -1
- package/esm2022/lib/resources/query/expressions/compute.mjs +2 -2
- package/esm2022/lib/resources/query/expressions/count.mjs +6 -6
- package/esm2022/lib/resources/query/expressions/expand.mjs +7 -7
- package/esm2022/lib/resources/query/expressions/filter.mjs +6 -6
- package/esm2022/lib/resources/query/expressions/index.mjs +2 -1
- package/esm2022/lib/resources/query/expressions/orderby.mjs +3 -3
- package/esm2022/lib/resources/query/expressions/search.mjs +6 -6
- package/esm2022/lib/resources/query/expressions/select.mjs +6 -2
- package/esm2022/lib/resources/query/expressions/syntax.mjs +161 -8
- package/esm2022/lib/resources/query/handlers.mjs +89 -54
- package/esm2022/lib/resources/query/options.mjs +91 -77
- package/esm2022/lib/resources/request.mjs +5 -5
- package/esm2022/lib/resources/resource.mjs +118 -88
- package/esm2022/lib/resources/response.mjs +174 -0
- package/esm2022/lib/resources/types/action.mjs +29 -26
- package/esm2022/lib/resources/types/batch.mjs +18 -16
- package/esm2022/lib/resources/types/count.mjs +7 -7
- package/esm2022/lib/resources/types/entity-set.mjs +38 -25
- package/esm2022/lib/resources/types/entity.mjs +14 -11
- package/esm2022/lib/resources/types/function.mjs +25 -28
- package/esm2022/lib/resources/types/metadata.mjs +9 -5
- package/esm2022/lib/resources/types/navigation-property.mjs +37 -31
- package/esm2022/lib/resources/types/property.mjs +32 -50
- package/esm2022/lib/resources/types/reference.mjs +6 -7
- package/esm2022/lib/resources/types/singleton.mjs +11 -7
- package/esm2022/lib/resources/types/value.mjs +16 -12
- package/esm2022/lib/schema/callable.mjs +10 -10
- package/esm2022/lib/schema/element.mjs +15 -9
- package/esm2022/lib/schema/entity-container.mjs +4 -2
- package/esm2022/lib/schema/enum-type.mjs +6 -7
- package/esm2022/lib/schema/index.mjs +2 -1
- package/esm2022/lib/schema/parsers/callable.mjs +10 -7
- package/esm2022/lib/schema/parsers/edm.mjs +6 -4
- package/esm2022/lib/schema/parsers/enum-type.mjs +15 -8
- package/esm2022/lib/schema/parsers/structured-type.mjs +66 -55
- package/esm2022/lib/schema/schema.mjs +18 -34
- package/esm2022/lib/schema/singleton.mjs +9 -0
- package/esm2022/lib/schema/structured-type.mjs +18 -23
- package/esm2022/lib/services/base.mjs +4 -4
- package/esm2022/lib/services/entity-set.mjs +12 -2
- package/esm2022/lib/services/entity.mjs +2 -2
- package/esm2022/lib/services/factory.mjs +22 -11
- package/esm2022/lib/services/singleton.mjs +8 -2
- package/esm2022/lib/settings.mjs +7 -99
- package/esm2022/lib/types.mjs +12 -1
- package/esm2022/lib/utils/http.mjs +8 -6
- package/fesm2022/angular-odata.mjs +7413 -6579
- package/fesm2022/angular-odata.mjs.map +1 -1
- package/lib/{resources/responses/annotations.d.ts → annotations.d.ts} +3 -2
- package/lib/api.d.ts +29 -26
- package/lib/cache/memory.d.ts +1 -1
- package/lib/client.d.ts +0 -20
- package/lib/constants.d.ts +3 -0
- package/lib/index.d.ts +1 -0
- package/lib/loaders.d.ts +7 -1
- package/lib/metadata/csdl/csdl-annotation.d.ts +123 -0
- package/lib/metadata/csdl/csdl-entity-container.d.ts +26 -0
- package/lib/metadata/csdl/csdl-entity-set.d.ts +20 -0
- package/lib/metadata/csdl/csdl-enum-type.d.ts +29 -0
- package/lib/metadata/csdl/csdl-function-action.d.ts +105 -0
- package/lib/metadata/csdl/csdl-navigation-property-binding.d.ts +8 -0
- package/lib/metadata/csdl/csdl-reference.d.ts +30 -0
- package/lib/metadata/csdl/csdl-schema.d.ts +34 -0
- package/lib/metadata/csdl/csdl-singleton.d.ts +16 -0
- package/lib/metadata/csdl/csdl-structural-property.d.ts +70 -0
- package/lib/metadata/csdl/csdl-structured-type.d.ts +73 -0
- package/lib/metadata/csdl/csdl-type-definition.d.ts +22 -0
- package/lib/metadata/index.d.ts +2 -0
- package/lib/metadata/metadata.d.ts +10 -0
- package/lib/{resources/responses/metadata.d.ts → metadata/parser.d.ts} +19 -7
- package/lib/models/collection.d.ts +23 -12
- package/lib/models/model.d.ts +19 -19
- package/lib/models/options.d.ts +43 -27
- package/lib/module.d.ts +2 -1
- package/lib/options.d.ts +5 -0
- package/lib/resources/index.d.ts +1 -1
- package/lib/resources/{responses/options.d.ts → options.d.ts} +2 -2
- package/lib/resources/path/handlers.d.ts +4 -2
- package/lib/resources/path/segments.d.ts +13 -1
- package/lib/resources/query/builder.d.ts +6 -5
- package/lib/resources/query/expressions/apply.d.ts +125 -0
- package/lib/resources/query/expressions/base.d.ts +1 -1
- package/lib/resources/query/expressions/compute.d.ts +4 -4
- package/lib/resources/query/expressions/count.d.ts +3 -3
- package/lib/resources/query/expressions/expand.d.ts +8 -8
- package/lib/resources/query/expressions/filter.d.ts +3 -3
- package/lib/resources/query/expressions/index.d.ts +1 -0
- package/lib/resources/query/expressions/orderby.d.ts +7 -6
- package/lib/resources/query/expressions/search.d.ts +2 -2
- package/lib/resources/query/expressions/select.d.ts +4 -3
- package/lib/resources/query/expressions/syntax.d.ts +77 -4
- package/lib/resources/query/handlers.d.ts +32 -9
- package/lib/resources/query/options.d.ts +20 -10
- package/lib/resources/resource.d.ts +32 -16
- package/lib/resources/{responses/response.d.ts → response.d.ts} +17 -5
- package/lib/resources/types/action.d.ts +12 -10
- package/lib/resources/types/batch.d.ts +12 -6
- package/lib/resources/types/count.d.ts +1 -5
- package/lib/resources/types/entity-set.d.ts +13 -6
- package/lib/resources/types/entity.d.ts +3 -4
- package/lib/resources/types/function.d.ts +11 -11
- package/lib/resources/types/metadata.d.ts +1 -1
- package/lib/resources/types/navigation-property.d.ts +13 -7
- package/lib/resources/types/property.d.ts +15 -8
- package/lib/resources/types/reference.d.ts +2 -4
- package/lib/resources/types/singleton.d.ts +4 -6
- package/lib/resources/types/value.d.ts +2 -6
- package/lib/schema/callable.d.ts +5 -7
- package/lib/schema/element.d.ts +11 -4
- package/lib/schema/entity-container.d.ts +2 -0
- package/lib/schema/enum-type.d.ts +4 -7
- package/lib/schema/index.d.ts +1 -0
- package/lib/schema/parsers/callable.d.ts +7 -8
- package/lib/schema/parsers/enum-type.d.ts +15 -5
- package/lib/schema/parsers/structured-type.d.ts +6 -8
- package/lib/schema/schema.d.ts +6 -9
- package/lib/schema/singleton.d.ts +10 -0
- package/lib/schema/structured-type.d.ts +5 -8
- package/lib/services/entity-set.d.ts +7 -3
- package/lib/services/factory.d.ts +14 -2
- package/lib/services/singleton.d.ts +4 -2
- package/lib/settings.d.ts +0 -10
- package/lib/types.d.ts +23 -3
- package/lib/utils/http.d.ts +1 -1
- package/package.json +5 -1
- package/schematics/apigen/angular/api-config.d.ts +15 -0
- package/schematics/apigen/angular/api-config.js +34 -0
- package/schematics/apigen/angular/api-config.js.map +1 -0
- package/schematics/apigen/angular/base.d.ts +51 -0
- package/schematics/apigen/angular/base.js +200 -0
- package/schematics/apigen/angular/base.js.map +1 -0
- package/schematics/apigen/angular/entity.d.ts +24 -0
- package/schematics/apigen/angular/entity.js +71 -0
- package/schematics/apigen/angular/entity.js.map +1 -0
- package/schematics/apigen/angular/enum.d.ts +25 -0
- package/schematics/apigen/angular/enum.js +56 -0
- package/schematics/apigen/angular/enum.js.map +1 -0
- package/schematics/apigen/angular/import.d.ts +6 -0
- package/schematics/apigen/angular/import.js +18 -0
- package/schematics/apigen/angular/import.js.map +1 -0
- package/schematics/apigen/angular/module.d.ts +18 -0
- package/schematics/apigen/angular/module.js +41 -0
- package/schematics/apigen/angular/module.js.map +1 -0
- package/schematics/apigen/angular/service.d.ts +20 -0
- package/schematics/apigen/angular/service.js +76 -0
- package/schematics/apigen/angular/service.js.map +1 -0
- package/schematics/apigen/files/api-config/__fileName__.ts +9 -0
- package/schematics/apigen/files/entity/__fileName__.ts +7 -0
- package/schematics/apigen/files/entitycontainer-service/__fileName__.ts +18 -0
- package/schematics/apigen/files/entityset-service/__fileName__.ts +27 -0
- package/schematics/apigen/files/enum/__fileName__.ts +4 -0
- package/schematics/apigen/files/index/__fileName__.ts +2 -0
- package/schematics/apigen/files/module/__fileName__.ts +9 -0
- package/schematics/apigen/files/singleton-service/__fileName__.ts +18 -0
- package/schematics/apigen/index.d.ts +3 -0
- package/schematics/apigen/index.js +106 -0
- package/schematics/apigen/index.js.map +1 -0
- package/schematics/apigen/metadata/csdl/csdl-annotation.d.ts +120 -0
- package/schematics/apigen/metadata/csdl/csdl-annotation.js +98 -0
- package/schematics/apigen/metadata/csdl/csdl-annotation.js.map +1 -0
- package/schematics/apigen/metadata/csdl/csdl-entity-container.d.ts +26 -0
- package/schematics/apigen/metadata/csdl/csdl-entity-container.js +30 -0
- package/schematics/apigen/metadata/csdl/csdl-entity-container.js.map +1 -0
- package/schematics/apigen/metadata/csdl/csdl-entity-set.d.ts +20 -0
- package/schematics/apigen/metadata/csdl/csdl-entity-set.js +26 -0
- package/schematics/apigen/metadata/csdl/csdl-entity-set.js.map +1 -0
- package/schematics/apigen/metadata/csdl/csdl-enum-type.d.ts +28 -0
- package/schematics/apigen/metadata/csdl/csdl-enum-type.js +33 -0
- package/schematics/apigen/metadata/csdl/csdl-enum-type.js.map +1 -0
- package/schematics/apigen/metadata/csdl/csdl-function-action.d.ts +103 -0
- package/schematics/apigen/metadata/csdl/csdl-function-action.js +84 -0
- package/schematics/apigen/metadata/csdl/csdl-function-action.js.map +1 -0
- package/schematics/apigen/metadata/csdl/csdl-navigation-property-binding.d.ts +8 -0
- package/schematics/apigen/metadata/csdl/csdl-navigation-property-binding.js +11 -0
- package/schematics/apigen/metadata/csdl/csdl-navigation-property-binding.js.map +1 -0
- package/schematics/apigen/metadata/csdl/csdl-reference.d.ts +30 -0
- package/schematics/apigen/metadata/csdl/csdl-reference.js +29 -0
- package/schematics/apigen/metadata/csdl/csdl-reference.js.map +1 -0
- package/schematics/apigen/metadata/csdl/csdl-schema.d.ts +32 -0
- package/schematics/apigen/metadata/csdl/csdl-schema.js +26 -0
- package/schematics/apigen/metadata/csdl/csdl-schema.js.map +1 -0
- package/schematics/apigen/metadata/csdl/csdl-singleton.d.ts +18 -0
- package/schematics/apigen/metadata/csdl/csdl-singleton.js +25 -0
- package/schematics/apigen/metadata/csdl/csdl-singleton.js.map +1 -0
- package/schematics/apigen/metadata/csdl/csdl-structural-property.d.ts +63 -0
- package/schematics/apigen/metadata/csdl/csdl-structural-property.js +50 -0
- package/schematics/apigen/metadata/csdl/csdl-structural-property.js.map +1 -0
- package/schematics/apigen/metadata/csdl/csdl-structured-type.d.ts +64 -0
- package/schematics/apigen/metadata/csdl/csdl-structured-type.js +71 -0
- package/schematics/apigen/metadata/csdl/csdl-structured-type.js.map +1 -0
- package/schematics/apigen/metadata/csdl/csdl-type-definition.d.ts +22 -0
- package/schematics/apigen/metadata/csdl/csdl-type-definition.js +19 -0
- package/schematics/apigen/metadata/csdl/csdl-type-definition.js.map +1 -0
- package/schematics/apigen/metadata/index.d.ts +1 -0
- package/schematics/apigen/metadata/index.js +18 -0
- package/schematics/apigen/metadata/index.js.map +1 -0
- package/schematics/apigen/metadata/metadata.d.ts +11 -0
- package/schematics/apigen/metadata/metadata.js +30 -0
- package/schematics/apigen/metadata/metadata.js.map +1 -0
- package/schematics/apigen/metadata/parser.d.ts +110 -0
- package/schematics/apigen/metadata/parser.js +568 -0
- package/schematics/apigen/metadata/parser.js.map +1 -0
- package/schematics/apigen/schema.d.ts +8 -0
- package/schematics/apigen/schema.js +3 -0
- package/schematics/apigen/schema.js.map +1 -0
- package/schematics/apigen/schema.json +36 -0
- package/schematics/apigen/utils.d.ts +1 -0
- package/schematics/apigen/utils.js +75 -0
- package/schematics/apigen/utils.js.map +1 -0
- package/schematics/collection.json +14 -0
- package/schematics/ng-add/index.d.ts +2 -0
- package/schematics/ng-add/index.js +13 -0
- package/schematics/ng-add/index.js.map +1 -0
- package/schematics/random.d.ts +1 -0
- package/schematics/random.js +604 -0
- package/schematics/random.js.map +1 -0
- package/esm2022/lib/resources/responses/annotations.mjs +0 -137
- package/esm2022/lib/resources/responses/csdl/csdl-annotation.mjs +0 -33
- package/esm2022/lib/resources/responses/csdl/csdl-entity-container.mjs +0 -11
- package/esm2022/lib/resources/responses/csdl/csdl-entity-set.mjs +0 -9
- package/esm2022/lib/resources/responses/csdl/csdl-enum-type.mjs +0 -15
- package/esm2022/lib/resources/responses/csdl/csdl-function-action.mjs +0 -56
- package/esm2022/lib/resources/responses/csdl/csdl-navigation-property-binding.mjs +0 -7
- package/esm2022/lib/resources/responses/csdl/csdl-reference.mjs +0 -23
- package/esm2022/lib/resources/responses/csdl/csdl-schema.mjs +0 -18
- package/esm2022/lib/resources/responses/csdl/csdl-singleton.mjs +0 -8
- package/esm2022/lib/resources/responses/csdl/csdl-structural-property.mjs +0 -39
- package/esm2022/lib/resources/responses/csdl/csdl-structured-type.mjs +0 -34
- package/esm2022/lib/resources/responses/csdl/csdl-type-definition.mjs +0 -14
- package/esm2022/lib/resources/responses/index.mjs +0 -5
- package/esm2022/lib/resources/responses/metadata.mjs +0 -547
- package/esm2022/lib/resources/responses/options.mjs +0 -56
- package/esm2022/lib/resources/responses/response.mjs +0 -174
- package/esm2022/lib/resources/responses/types.mjs +0 -2
- package/lib/resources/responses/csdl/csdl-annotation.d.ts +0 -27
- package/lib/resources/responses/csdl/csdl-entity-container.d.ts +0 -12
- package/lib/resources/responses/csdl/csdl-entity-set.d.ts +0 -8
- package/lib/resources/responses/csdl/csdl-enum-type.d.ts +0 -12
- package/lib/resources/responses/csdl/csdl-function-action.d.ts +0 -49
- package/lib/resources/responses/csdl/csdl-navigation-property-binding.d.ts +0 -5
- package/lib/resources/responses/csdl/csdl-reference.d.ts +0 -18
- package/lib/resources/responses/csdl/csdl-schema.d.ts +0 -20
- package/lib/resources/responses/csdl/csdl-singleton.d.ts +0 -7
- package/lib/resources/responses/csdl/csdl-structural-property.d.ts +0 -31
- package/lib/resources/responses/csdl/csdl-structured-type.d.ts +0 -27
- package/lib/resources/responses/csdl/csdl-type-definition.d.ts +0 -11
- package/lib/resources/responses/index.d.ts +0 -4
- package/lib/resources/responses/types.d.ts +0 -13
|
@@ -12,7 +12,7 @@ export declare enum StandardAggregateMethods {
|
|
|
12
12
|
average = "average",
|
|
13
13
|
countdistinct = "countdistinct"
|
|
14
14
|
}
|
|
15
|
-
export type
|
|
15
|
+
export type AggregateType = string | {
|
|
16
16
|
[propertyName: string]: {
|
|
17
17
|
with: StandardAggregateMethods;
|
|
18
18
|
as: string;
|
|
@@ -41,11 +41,11 @@ export type ExpandOptions<T> = {
|
|
|
41
41
|
expand?: Expand<T>;
|
|
42
42
|
};
|
|
43
43
|
export type Transform<T> = {
|
|
44
|
-
aggregate?:
|
|
44
|
+
aggregate?: AggregateType | Array<AggregateType>;
|
|
45
45
|
filter?: Filter<T>;
|
|
46
|
-
groupBy?:
|
|
46
|
+
groupBy?: GroupByType<T>;
|
|
47
47
|
};
|
|
48
|
-
export type
|
|
48
|
+
export type GroupByType<T> = {
|
|
49
49
|
properties: Array<keyof T>;
|
|
50
50
|
transform?: Transform<T>;
|
|
51
51
|
};
|
|
@@ -69,6 +69,7 @@ export declare const isQueryCustomType: (value: any) => boolean;
|
|
|
69
69
|
export declare const isRawType: (value: any) => boolean;
|
|
70
70
|
export type QueryOptions<T> = ExpandOptions<T> & {
|
|
71
71
|
search: string;
|
|
72
|
+
apply: string;
|
|
72
73
|
transform: {
|
|
73
74
|
[name: string]: any;
|
|
74
75
|
} | {
|
|
@@ -92,7 +93,7 @@ export type QueryOptions<T> = ExpandOptions<T> & {
|
|
|
92
93
|
};
|
|
93
94
|
export declare const ITEM_ROOT = "";
|
|
94
95
|
export default function <T>({ select, search, skiptoken, format, top, skip, filter, transform, orderBy, key, count, expand, action, func, aliases, escape, }?: Partial<QueryOptions<T>>): string;
|
|
95
|
-
export declare function buildPathAndQuery<T>({ select, search, skiptoken, format, top, skip, filter, transform, orderBy, key, count, expand, action, func, aliases, escape, }?: Partial<QueryOptions<T>>): [string, {
|
|
96
|
+
export declare function buildPathAndQuery<T>({ select, search, skiptoken, format, top, skip, filter, apply, transform, orderBy, key, count, expand, action, func, aliases, escape, }?: Partial<QueryOptions<T>>): [string, {
|
|
96
97
|
[name: string]: any;
|
|
97
98
|
}];
|
|
98
99
|
export declare function normalizeValue(value: Value, { aliases, escape, }?: {
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { Parser, ParserOptions } from '../../../types';
|
|
2
|
+
import { QueryCustomType } from '../builder';
|
|
3
|
+
import { Expression } from './base';
|
|
4
|
+
import { FilterConnector, FilterExpression } from './filter';
|
|
5
|
+
import { SearchConnector, SearchExpression } from './search';
|
|
6
|
+
import { ODataFunctions, ODataOperators, Renderable, AggregateMethod } from './syntax';
|
|
7
|
+
export declare class GroupByTransformations<T> extends Expression<T> {
|
|
8
|
+
protected methods: (AggregateMethod | string)[];
|
|
9
|
+
protected aliases: string[];
|
|
10
|
+
constructor({ children, methods, aliases, }?: {
|
|
11
|
+
children?: Renderable[];
|
|
12
|
+
methods?: (AggregateMethod | string)[];
|
|
13
|
+
aliases?: string[];
|
|
14
|
+
});
|
|
15
|
+
get [Symbol.toStringTag](): string;
|
|
16
|
+
toJson(): {
|
|
17
|
+
$type: string;
|
|
18
|
+
children: any[];
|
|
19
|
+
} & {
|
|
20
|
+
methods: string[];
|
|
21
|
+
aliases: string[];
|
|
22
|
+
};
|
|
23
|
+
static fromJson<T>(json: {
|
|
24
|
+
[name: string]: any;
|
|
25
|
+
}): GroupByTransformations<T>;
|
|
26
|
+
render({ aliases, escape, prefix, parser, options, }?: {
|
|
27
|
+
aliases?: QueryCustomType[];
|
|
28
|
+
escape?: boolean;
|
|
29
|
+
prefix?: string;
|
|
30
|
+
parser?: Parser<T>;
|
|
31
|
+
options?: ParserOptions;
|
|
32
|
+
}): string;
|
|
33
|
+
clone(): GroupByTransformations<T>;
|
|
34
|
+
private _add;
|
|
35
|
+
aggregate(value: any, method: AggregateMethod | string, alias: string): GroupByTransformations<T>;
|
|
36
|
+
sum(value: any, alias: string): GroupByTransformations<T>;
|
|
37
|
+
min(value: any, alias: string): GroupByTransformations<T>;
|
|
38
|
+
max(value: any, alias: string): GroupByTransformations<T>;
|
|
39
|
+
average(value: any, alias: string): GroupByTransformations<T>;
|
|
40
|
+
countdistinct(value: any, alias: string): GroupByTransformations<T>;
|
|
41
|
+
count(alias: string): GroupByTransformations<T>;
|
|
42
|
+
}
|
|
43
|
+
export type ApplyExpressionBuilder<T> = {
|
|
44
|
+
t: Required<T>;
|
|
45
|
+
e: () => ApplyExpression<T>;
|
|
46
|
+
};
|
|
47
|
+
export declare class ApplyExpression<T> extends Expression<T> {
|
|
48
|
+
constructor({ children, }?: {
|
|
49
|
+
children?: Renderable[];
|
|
50
|
+
});
|
|
51
|
+
get [Symbol.toStringTag](): string;
|
|
52
|
+
static factory<T>(opts: (builder: ApplyExpressionBuilder<T>, current?: ApplyExpression<T>) => ApplyExpression<T>, current?: ApplyExpression<T>): ApplyExpression<T>;
|
|
53
|
+
toJson(): {
|
|
54
|
+
$type: string;
|
|
55
|
+
children: any[];
|
|
56
|
+
};
|
|
57
|
+
static fromJson<T>(json: {
|
|
58
|
+
[name: string]: any;
|
|
59
|
+
}): ApplyExpression<T>;
|
|
60
|
+
render({ aliases, escape, prefix, parser, options, }?: {
|
|
61
|
+
aliases?: QueryCustomType[];
|
|
62
|
+
escape?: boolean;
|
|
63
|
+
prefix?: string;
|
|
64
|
+
parser?: Parser<T>;
|
|
65
|
+
options?: ParserOptions;
|
|
66
|
+
}): string;
|
|
67
|
+
clone(): ApplyExpression<T>;
|
|
68
|
+
private _add;
|
|
69
|
+
aggregate(value: any, method: AggregateMethod, alias: string): ApplyExpression<T>;
|
|
70
|
+
topCount(opts: (e: {
|
|
71
|
+
o: ODataOperators<T>;
|
|
72
|
+
f: ODataFunctions<T>;
|
|
73
|
+
}) => Renderable): ApplyExpression<T>;
|
|
74
|
+
topSum(opts: (e: {
|
|
75
|
+
o: ODataOperators<T>;
|
|
76
|
+
f: ODataFunctions<T>;
|
|
77
|
+
}) => Renderable): ApplyExpression<T>;
|
|
78
|
+
topPercent(opts: (e: {
|
|
79
|
+
o: ODataOperators<T>;
|
|
80
|
+
f: ODataFunctions<T>;
|
|
81
|
+
}) => Renderable): ApplyExpression<T>;
|
|
82
|
+
bottomCount(opts: (e: {
|
|
83
|
+
o: ODataOperators<T>;
|
|
84
|
+
f: ODataFunctions<T>;
|
|
85
|
+
}) => Renderable): ApplyExpression<T>;
|
|
86
|
+
bottomSum(opts: (e: {
|
|
87
|
+
o: ODataOperators<T>;
|
|
88
|
+
f: ODataFunctions<T>;
|
|
89
|
+
}) => Renderable): ApplyExpression<T>;
|
|
90
|
+
bottomPercent(opts: (e: {
|
|
91
|
+
o: ODataOperators<T>;
|
|
92
|
+
f: ODataFunctions<T>;
|
|
93
|
+
}) => Renderable): ApplyExpression<T>;
|
|
94
|
+
identity(opts: (e: {
|
|
95
|
+
o: ODataOperators<T>;
|
|
96
|
+
f: ODataFunctions<T>;
|
|
97
|
+
}) => Renderable): ApplyExpression<T>;
|
|
98
|
+
concat(opts: (e: {
|
|
99
|
+
o: ODataOperators<T>;
|
|
100
|
+
f: ODataFunctions<T>;
|
|
101
|
+
}) => Renderable): ApplyExpression<T>;
|
|
102
|
+
groupBy(props: (e: {
|
|
103
|
+
rollup: (f: any) => any;
|
|
104
|
+
}) => any | any[], opts?: (e: GroupByTransformations<T>) => GroupByTransformations<T>): ApplyExpression<T>;
|
|
105
|
+
filter(opts: (e: {
|
|
106
|
+
t: T;
|
|
107
|
+
e: (connector?: FilterConnector) => FilterExpression<T>;
|
|
108
|
+
o: ODataOperators<T>;
|
|
109
|
+
f: ODataFunctions<T>;
|
|
110
|
+
}) => FilterExpression<T>): ApplyExpression<T>;
|
|
111
|
+
expand(opts: (e: {
|
|
112
|
+
o: ODataOperators<T>;
|
|
113
|
+
f: ODataFunctions<T>;
|
|
114
|
+
}) => Renderable): ApplyExpression<T>;
|
|
115
|
+
search(opts: (e: {
|
|
116
|
+
t: T;
|
|
117
|
+
e: (connector?: SearchConnector) => SearchExpression<T>;
|
|
118
|
+
o: ODataOperators<T>;
|
|
119
|
+
f: ODataFunctions<T>;
|
|
120
|
+
}) => SearchExpression<T>): ApplyExpression<T>;
|
|
121
|
+
compute(opts: (e: {
|
|
122
|
+
o: ODataOperators<T>;
|
|
123
|
+
f: ODataFunctions<T>;
|
|
124
|
+
}) => Renderable): ApplyExpression<T>;
|
|
125
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Parser, ParserOptions } from '../../../types';
|
|
2
|
-
import
|
|
2
|
+
import { QueryCustomType } from '../builder';
|
|
3
3
|
import { Renderable } from './syntax';
|
|
4
4
|
export declare abstract class Expression<T> implements Renderable {
|
|
5
5
|
protected _children: Renderable[];
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { Parser, ParserOptions } from '../../../types';
|
|
2
|
-
import
|
|
2
|
+
import { QueryCustomType } from '../builder';
|
|
3
3
|
import { Expression } from './base';
|
|
4
4
|
import { ODataFunctions, ODataOperators, Renderable } from './syntax';
|
|
5
5
|
export type ComputeExpressionBuilder<T> = {
|
|
6
|
-
t: Required<
|
|
6
|
+
t: Required<T>;
|
|
7
7
|
e: () => ComputeExpression<T>;
|
|
8
8
|
};
|
|
9
9
|
export declare class ComputeExpression<T> extends Expression<T> {
|
|
10
|
-
names: string[];
|
|
10
|
+
protected names: string[];
|
|
11
11
|
constructor({ children, names, }?: {
|
|
12
12
|
children?: Renderable[];
|
|
13
13
|
names?: string[];
|
|
14
14
|
});
|
|
15
15
|
get [Symbol.toStringTag](): string;
|
|
16
|
-
static
|
|
16
|
+
static factory<T>(opts: (builder: ComputeExpressionBuilder<T>, current?: ComputeExpression<T>) => ComputeExpression<T>, current?: ComputeExpression<T>): ComputeExpression<T>;
|
|
17
17
|
toJson(): {
|
|
18
18
|
$type: string;
|
|
19
19
|
children: any[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Parser, ParserOptions } from '../../../types';
|
|
2
|
-
import
|
|
2
|
+
import { QueryCustomType } from '../builder';
|
|
3
3
|
import { Expression } from './base';
|
|
4
4
|
import { FilterExpression, FilterExpressionBuilder } from './filter';
|
|
5
5
|
import { Renderable } from './syntax';
|
|
@@ -26,7 +26,7 @@ export declare class CountField<T> implements Renderable {
|
|
|
26
26
|
private option;
|
|
27
27
|
}
|
|
28
28
|
export type CountExpressionBuilder<T> = {
|
|
29
|
-
t:
|
|
29
|
+
t: Required<T>;
|
|
30
30
|
e: () => CountExpression<T>;
|
|
31
31
|
};
|
|
32
32
|
export declare class CountExpression<T> extends Expression<T> {
|
|
@@ -34,7 +34,7 @@ export declare class CountExpression<T> extends Expression<T> {
|
|
|
34
34
|
children?: Renderable[];
|
|
35
35
|
});
|
|
36
36
|
get [Symbol.toStringTag](): string;
|
|
37
|
-
static
|
|
37
|
+
static factory<T>(opts: (builder: CountExpressionBuilder<T>, current?: CountExpression<T>) => CountExpression<T>, current?: CountExpression<T>): CountExpression<T>;
|
|
38
38
|
private _add;
|
|
39
39
|
toJson(): {
|
|
40
40
|
$type: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Parser, ParserOptions } from '../../../types';
|
|
2
|
-
import
|
|
2
|
+
import { QueryCustomType, Unpacked } from '../builder';
|
|
3
3
|
import { Expression } from './base';
|
|
4
4
|
import { FilterExpression, FilterExpressionBuilder } from './filter';
|
|
5
5
|
import { OrderByExpression, OrderByExpressionBuilder } from './orderby';
|
|
@@ -25,11 +25,11 @@ export declare class ExpandField<T> implements Renderable {
|
|
|
25
25
|
}): string;
|
|
26
26
|
clone(): ExpandField<T>;
|
|
27
27
|
resolve(parser: any): any;
|
|
28
|
-
select
|
|
29
|
-
expand
|
|
30
|
-
filter
|
|
31
|
-
search
|
|
32
|
-
orderBy
|
|
28
|
+
select(opts: (builder: SelectExpressionBuilder<T>, current?: SelectExpression<T>) => SelectExpression<T>): SelectExpression<T>;
|
|
29
|
+
expand(opts: (builder: ExpandExpressionBuilder<T>, current?: ExpandExpression<T>) => ExpandExpression<T>): ExpandExpression<T>;
|
|
30
|
+
filter(opts: (builder: FilterExpressionBuilder<T>, current?: FilterExpression<T>) => FilterExpression<T>): FilterExpression<T>;
|
|
31
|
+
search(opts: (builder: SearchExpressionBuilder<T>) => SearchExpression<T>): SearchExpression<T>;
|
|
32
|
+
orderBy(opts: (builder: OrderByExpressionBuilder<T>, current?: OrderByExpression<T>) => OrderByExpression<T>): OrderByExpression<T>;
|
|
33
33
|
skip(n: number): number;
|
|
34
34
|
top(n: number): number;
|
|
35
35
|
levels(n: number | 'max'): number | "max";
|
|
@@ -37,7 +37,7 @@ export declare class ExpandField<T> implements Renderable {
|
|
|
37
37
|
private option;
|
|
38
38
|
}
|
|
39
39
|
export type ExpandExpressionBuilder<T> = {
|
|
40
|
-
t:
|
|
40
|
+
t: Required<T>;
|
|
41
41
|
e: () => ExpandExpression<T>;
|
|
42
42
|
};
|
|
43
43
|
export declare class ExpandExpression<T> extends Expression<T> {
|
|
@@ -45,7 +45,7 @@ export declare class ExpandExpression<T> extends Expression<T> {
|
|
|
45
45
|
children?: Renderable[];
|
|
46
46
|
});
|
|
47
47
|
get [Symbol.toStringTag](): string;
|
|
48
|
-
static
|
|
48
|
+
static factory<T>(opts: (builder: ExpandExpressionBuilder<T>, current?: ExpandExpression<T>) => ExpandExpression<T>, current?: ExpandExpression<T>): ExpandExpression<T>;
|
|
49
49
|
toJson(): {
|
|
50
50
|
$type: string;
|
|
51
51
|
children: any[];
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Parser, ParserOptions } from '../../../types';
|
|
2
|
-
import
|
|
2
|
+
import { QueryCustomType } from '../builder';
|
|
3
3
|
import { Expression } from './base';
|
|
4
4
|
import { CountExpression, CountField } from './count';
|
|
5
5
|
import { Normalize, ODataFunctions, ODataOperators, Renderable } from './syntax';
|
|
6
6
|
export type FilterConnector = 'and' | 'or';
|
|
7
7
|
export type FilterExpressionBuilder<T> = {
|
|
8
|
-
t:
|
|
8
|
+
t: Required<T>;
|
|
9
9
|
e: (connector?: FilterConnector) => FilterExpression<T>;
|
|
10
10
|
o: ODataOperators<T>;
|
|
11
11
|
f: ODataFunctions<T>;
|
|
@@ -19,7 +19,7 @@ export declare class FilterExpression<F> extends Expression<F> {
|
|
|
19
19
|
negated?: boolean;
|
|
20
20
|
});
|
|
21
21
|
get [Symbol.toStringTag](): string;
|
|
22
|
-
static
|
|
22
|
+
static factory<T>(opts: (builder: FilterExpressionBuilder<T>, current?: FilterExpression<T>) => FilterExpression<T>, current?: FilterExpression<T>): FilterExpression<T>;
|
|
23
23
|
toJson(): {
|
|
24
24
|
$type: string;
|
|
25
25
|
children: any[];
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import { Parser, ParserOptions } from '../../../types';
|
|
2
|
-
import
|
|
2
|
+
import { QueryCustomType } from '../builder';
|
|
3
3
|
import { Expression } from './base';
|
|
4
4
|
import { Renderable } from './syntax';
|
|
5
|
+
export type OrderAttribute = 'asc' | 'desc';
|
|
5
6
|
export declare class OrderByField implements Renderable {
|
|
6
7
|
protected field: Renderable;
|
|
7
|
-
protected order:
|
|
8
|
-
constructor(field: Renderable, order:
|
|
8
|
+
protected order: OrderAttribute;
|
|
9
|
+
constructor(field: Renderable, order: OrderAttribute);
|
|
9
10
|
get [Symbol.toStringTag](): string;
|
|
10
11
|
toJson(): {
|
|
11
12
|
$type: string;
|
|
12
13
|
field: any;
|
|
13
|
-
order:
|
|
14
|
+
order: OrderAttribute;
|
|
14
15
|
};
|
|
15
16
|
render({ aliases, escape, prefix, parser, options, }: {
|
|
16
17
|
aliases?: QueryCustomType[];
|
|
@@ -23,7 +24,7 @@ export declare class OrderByField implements Renderable {
|
|
|
23
24
|
resolve(parser: any): any;
|
|
24
25
|
}
|
|
25
26
|
export type OrderByExpressionBuilder<T> = {
|
|
26
|
-
t:
|
|
27
|
+
t: Required<T>;
|
|
27
28
|
e: () => OrderByExpression<T>;
|
|
28
29
|
};
|
|
29
30
|
export declare class OrderByExpression<T> extends Expression<T> {
|
|
@@ -31,7 +32,7 @@ export declare class OrderByExpression<T> extends Expression<T> {
|
|
|
31
32
|
children?: Renderable[];
|
|
32
33
|
});
|
|
33
34
|
get [Symbol.toStringTag](): string;
|
|
34
|
-
static
|
|
35
|
+
static factory<T>(opts: (builder: OrderByExpressionBuilder<T>, current?: OrderByExpression<T>) => OrderByExpression<T>, current?: OrderByExpression<T>): OrderByExpression<T>;
|
|
35
36
|
private _add;
|
|
36
37
|
toJson(): {
|
|
37
38
|
$type: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Parser, ParserOptions } from '../../../types';
|
|
2
|
-
import
|
|
2
|
+
import { QueryCustomType } from '../builder';
|
|
3
3
|
import { Expression } from './base';
|
|
4
4
|
import { Renderable } from './syntax';
|
|
5
5
|
export type SearchConnector = 'AND' | 'OR';
|
|
@@ -33,7 +33,7 @@ export declare class SearchExpression<T> extends Expression<T> {
|
|
|
33
33
|
negated?: boolean;
|
|
34
34
|
});
|
|
35
35
|
get [Symbol.toStringTag](): string;
|
|
36
|
-
static
|
|
36
|
+
static factory<T>(opts: (builder: SearchExpressionBuilder<T>, current?: SearchExpression<T>) => SearchExpression<T>, current?: SearchExpression<T>): SearchExpression<T>;
|
|
37
37
|
private _add;
|
|
38
38
|
render({ aliases, escape, prefix, parser, options, }?: {
|
|
39
39
|
aliases?: QueryCustomType[];
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Parser, ParserOptions } from '../../../types';
|
|
2
|
-
import
|
|
2
|
+
import { QueryCustomType } from '../builder';
|
|
3
3
|
import { Expression } from './base';
|
|
4
4
|
import { Renderable } from './syntax';
|
|
5
5
|
export type SelectExpressionBuilder<T> = {
|
|
6
|
-
t:
|
|
6
|
+
t: Required<T>;
|
|
7
7
|
e: () => SelectExpression<T>;
|
|
8
8
|
};
|
|
9
9
|
export declare class SelectExpression<T> extends Expression<T> {
|
|
@@ -11,7 +11,7 @@ export declare class SelectExpression<T> extends Expression<T> {
|
|
|
11
11
|
children?: Renderable[];
|
|
12
12
|
});
|
|
13
13
|
get [Symbol.toStringTag](): string;
|
|
14
|
-
static
|
|
14
|
+
static factory<T>(opts: (builder: SelectExpressionBuilder<T>, current?: SelectExpression<T>) => SelectExpression<T>, current?: SelectExpression<T>): SelectExpression<T>;
|
|
15
15
|
toJson(): {
|
|
16
16
|
$type: string;
|
|
17
17
|
children: any[];
|
|
@@ -29,4 +29,5 @@ export declare class SelectExpression<T> extends Expression<T> {
|
|
|
29
29
|
clone(): SelectExpression<T>;
|
|
30
30
|
private _add;
|
|
31
31
|
field(field: any): SelectExpression<T>;
|
|
32
|
+
fields(...fields: any[]): SelectExpression<T>;
|
|
32
33
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Parser, ParserOptions } from '../../../types';
|
|
2
|
-
import
|
|
2
|
+
import { QueryCustomType } from '../builder';
|
|
3
3
|
export type Normalize = 'all' | 'right' | 'left' | 'none';
|
|
4
4
|
export interface Renderable {
|
|
5
5
|
render({ aliases, escape, prefix, parser, options, }: {
|
|
@@ -9,7 +9,6 @@ export interface Renderable {
|
|
|
9
9
|
parser?: Parser<any>;
|
|
10
10
|
options?: ParserOptions;
|
|
11
11
|
}): string;
|
|
12
|
-
toString(): string;
|
|
13
12
|
toJson(): any;
|
|
14
13
|
clone(): any;
|
|
15
14
|
resolve(parser: any): any;
|
|
@@ -169,6 +168,75 @@ export declare class Grouping<T> implements Renderable {
|
|
|
169
168
|
clone(): Grouping<unknown>;
|
|
170
169
|
resolve(parser: any): any;
|
|
171
170
|
}
|
|
171
|
+
export declare class GroupingOperators<T> {
|
|
172
|
+
group(value: any): Grouping<T>;
|
|
173
|
+
rollup(...values: any): Function<T>;
|
|
174
|
+
}
|
|
175
|
+
export type AggregateMethod = 'sum' | 'min' | 'max' | 'average' | 'countdistinct';
|
|
176
|
+
export declare class Aggregate<T> implements Renderable {
|
|
177
|
+
protected value: Renderable;
|
|
178
|
+
protected method: AggregateMethod;
|
|
179
|
+
protected alias: string;
|
|
180
|
+
constructor(value: Renderable, method: AggregateMethod, alias: string);
|
|
181
|
+
get [Symbol.toStringTag](): string;
|
|
182
|
+
toJson(): {
|
|
183
|
+
$type: string;
|
|
184
|
+
value: any;
|
|
185
|
+
method: AggregateMethod;
|
|
186
|
+
alias: string;
|
|
187
|
+
};
|
|
188
|
+
static fromJson<T>(json: {
|
|
189
|
+
[name: string]: any;
|
|
190
|
+
}): Aggregate<T>;
|
|
191
|
+
render({ aliases, escape, prefix, parser, options, }: {
|
|
192
|
+
aliases?: QueryCustomType[];
|
|
193
|
+
escape?: boolean;
|
|
194
|
+
prefix?: string;
|
|
195
|
+
parser?: Parser<T>;
|
|
196
|
+
options?: ParserOptions;
|
|
197
|
+
}): string;
|
|
198
|
+
clone(): Aggregate<unknown>;
|
|
199
|
+
resolve(parser: any): any;
|
|
200
|
+
}
|
|
201
|
+
export declare class GroupBy<T> implements Renderable {
|
|
202
|
+
protected properties: Renderable[];
|
|
203
|
+
protected transformations?: Renderable | undefined;
|
|
204
|
+
constructor(properties: Renderable[], transformations?: Renderable | undefined);
|
|
205
|
+
get [Symbol.toStringTag](): string;
|
|
206
|
+
toJson(): {
|
|
207
|
+
$type: string;
|
|
208
|
+
properties: any[];
|
|
209
|
+
transformations: any;
|
|
210
|
+
};
|
|
211
|
+
static fromJson<T>(json: {
|
|
212
|
+
[name: string]: any;
|
|
213
|
+
}): GroupBy<T>;
|
|
214
|
+
render({ aliases, escape, prefix, parser, options, }: {
|
|
215
|
+
aliases?: QueryCustomType[];
|
|
216
|
+
escape?: boolean;
|
|
217
|
+
prefix?: string;
|
|
218
|
+
parser?: Parser<T>;
|
|
219
|
+
options?: ParserOptions;
|
|
220
|
+
}): string;
|
|
221
|
+
clone(): GroupBy<unknown>;
|
|
222
|
+
resolve(parser: any): any;
|
|
223
|
+
}
|
|
224
|
+
export declare class Transformations<T> {
|
|
225
|
+
aggregate(value: Renderable, method: AggregateMethod, alias: string): Aggregate<T>;
|
|
226
|
+
groupby(properties: Renderable[], options?: Renderable): GroupBy<T>;
|
|
227
|
+
topCount(value: number, field: Renderable, normalize?: Normalize): Function<T>;
|
|
228
|
+
topSum(value: number, field: Renderable, normalize?: Normalize): Function<T>;
|
|
229
|
+
topPercent(value: number, field: Renderable, normalize?: Normalize): Function<T>;
|
|
230
|
+
bottomCount(value: number, field: Renderable, normalize?: Normalize): Function<T>;
|
|
231
|
+
bottomSum(value: number, field: Renderable, normalize?: Normalize): Function<T>;
|
|
232
|
+
bottomPercent(value: number, field: Renderable, normalize?: Normalize): Function<T>;
|
|
233
|
+
identity(): Function<T>;
|
|
234
|
+
search(value: any, normalize?: Normalize): Function<T>;
|
|
235
|
+
filter(value: any, normalize?: Normalize): Function<T>;
|
|
236
|
+
skip(value: number, normalize?: Normalize): Function<T>;
|
|
237
|
+
top(value: number, normalize?: Normalize): Function<T>;
|
|
238
|
+
orderby(value: any, normalize?: Normalize): Function<T>;
|
|
239
|
+
}
|
|
172
240
|
export declare class Type<T> implements Renderable {
|
|
173
241
|
protected name: string;
|
|
174
242
|
protected type: string;
|
|
@@ -225,7 +293,7 @@ export declare class LambdaOperators<T> {
|
|
|
225
293
|
}
|
|
226
294
|
export declare class ODataOperators<T> {
|
|
227
295
|
}
|
|
228
|
-
export interface ODataOperators<T> extends LogicalOperators<T>, ArithmeticOperators<T>, LambdaOperators<T> {
|
|
296
|
+
export interface ODataOperators<T> extends LogicalOperators<T>, ArithmeticOperators<T>, GroupingOperators<T>, LambdaOperators<T> {
|
|
229
297
|
}
|
|
230
298
|
export declare const operators: ODataOperators<any>;
|
|
231
299
|
export declare class ODataFunctions<T> {
|
|
@@ -233,8 +301,13 @@ export declare class ODataFunctions<T> {
|
|
|
233
301
|
export interface ODataFunctions<T> extends StringAndCollectionFunctions<T>, CollectionFunctions<T>, StringFunctions<T>, DateAndTimeFunctions<T>, ArithmeticFunctions<T>, TypeFunctions<T>, GeoFunctions<T>, ConditionalFunctions<T> {
|
|
234
302
|
}
|
|
235
303
|
export declare const functions: ODataFunctions<any>;
|
|
304
|
+
export declare class ODataTransformations<T> {
|
|
305
|
+
}
|
|
306
|
+
export interface ODataTransformations<T> extends Transformations<T> {
|
|
307
|
+
}
|
|
308
|
+
export declare const transformations: ODataTransformations<any>;
|
|
236
309
|
export declare class ODataSyntax<T> {
|
|
237
310
|
}
|
|
238
|
-
export interface ODataSyntax<T> extends ODataOperators<T>, ODataFunctions<T> {
|
|
311
|
+
export interface ODataSyntax<T> extends ODataOperators<T>, ODataFunctions<T>, ODataTransformations<T> {
|
|
239
312
|
}
|
|
240
313
|
export declare const syntax: ODataSyntax<any>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { QueryOption } from '../../types';
|
|
1
|
+
import { Parser, QueryOption } from '../../types';
|
|
2
2
|
import { Expand, Filter, OrderBy, Select, Transform } from './builder';
|
|
3
|
-
import { ComputeExpression, ComputeExpressionBuilder, FilterExpression, FilterExpressionBuilder, OrderByExpression, OrderByExpressionBuilder, SearchExpression, SearchExpressionBuilder, ExpandExpression, ExpandExpressionBuilder, SelectExpression, SelectExpressionBuilder } from './expressions';
|
|
4
|
-
import
|
|
3
|
+
import { ComputeExpression, ComputeExpressionBuilder, FilterExpression, FilterExpressionBuilder, OrderByExpression, OrderByExpressionBuilder, SearchExpression, SearchExpressionBuilder, ExpandExpression, ExpandExpressionBuilder, SelectExpression, SelectExpressionBuilder, ApplyExpression, ApplyExpressionBuilder } from './expressions';
|
|
4
|
+
import { ODataQueryArguments, ODataQueryOptions } from './options';
|
|
5
5
|
export declare class ODataQueryOptionHandler<T> {
|
|
6
6
|
private o;
|
|
7
7
|
private n;
|
|
@@ -85,6 +85,10 @@ export declare class ODataQueryOptionHandler<T> {
|
|
|
85
85
|
* Clear the managed odata query option.
|
|
86
86
|
*/
|
|
87
87
|
clear(): void;
|
|
88
|
+
toString({ escape, parser, }?: {
|
|
89
|
+
escape?: boolean;
|
|
90
|
+
parser?: Parser<T>;
|
|
91
|
+
}): string;
|
|
88
92
|
}
|
|
89
93
|
export declare class ODataQueryOptionsHandler<T> {
|
|
90
94
|
protected options: ODataQueryOptions<T>;
|
|
@@ -146,6 +150,15 @@ export declare class ODataQueryOptionsHandler<T> {
|
|
|
146
150
|
compute(opts: (builder: ComputeExpressionBuilder<T>, current?: ComputeExpression<T>) => ComputeExpression<T>): ComputeExpression<T>;
|
|
147
151
|
compute(opts: string): ODataQueryOptionHandler<T>;
|
|
148
152
|
compute(): ODataQueryOptionHandler<T>;
|
|
153
|
+
/**
|
|
154
|
+
* Build and return a handler for modifying the $apply option.
|
|
155
|
+
* If opts is given then set te value as new value for $compute.
|
|
156
|
+
* @link http://docs.oasis-open.org/odata/odata-data-aggregation-ext/v4.0/cs02/odata-data-aggregation-ext-v4.0-cs02.html
|
|
157
|
+
* @param opts string value or builder function for ApplyExpression<T>
|
|
158
|
+
*/
|
|
159
|
+
apply(opts: (builder: ApplyExpressionBuilder<T>, current?: ApplyExpression<T>) => ApplyExpression<T>): ApplyExpression<T>;
|
|
160
|
+
apply(opts: string): ODataQueryOptionHandler<T>;
|
|
161
|
+
apply(): ODataQueryOptionHandler<T>;
|
|
149
162
|
/**
|
|
150
163
|
* Build and return a handler for modifying the $format option.
|
|
151
164
|
* If opts is given then set te value as new value for $format.
|
|
@@ -206,6 +219,8 @@ export declare class ODataQueryOptionsHandler<T> {
|
|
|
206
219
|
*/
|
|
207
220
|
skiptoken(opts: string): ODataQueryOptionHandler<T>;
|
|
208
221
|
skiptoken(): ODataQueryOptionHandler<T>;
|
|
222
|
+
remove(...keys: QueryOption[]): void;
|
|
223
|
+
keep(...keys: QueryOption[]): void;
|
|
209
224
|
/**
|
|
210
225
|
* Shortcut for set $top, $skip, $skiptoken.
|
|
211
226
|
* @param param0 skip or top or skiptoken
|
|
@@ -218,18 +233,26 @@ export declare class ODataQueryOptionsHandler<T> {
|
|
|
218
233
|
/**
|
|
219
234
|
* Shortcut for clear pagination by unset $top, $skip, $skiptoken.
|
|
220
235
|
*/
|
|
221
|
-
|
|
236
|
+
removePaging(): void;
|
|
222
237
|
/**
|
|
223
238
|
* Shortcut for clear query.
|
|
224
239
|
*/
|
|
225
240
|
clear(): void;
|
|
226
241
|
/**
|
|
227
|
-
*
|
|
242
|
+
* Store the query options from the current query.
|
|
228
243
|
*/
|
|
229
|
-
|
|
244
|
+
store(): ODataQueryArguments<T>;
|
|
230
245
|
/**
|
|
231
|
-
*
|
|
232
|
-
* @param
|
|
246
|
+
* Restore the given query options to the current query.
|
|
247
|
+
* @param options The query to be applied.
|
|
233
248
|
*/
|
|
234
|
-
|
|
249
|
+
restore(options: ODataQueryArguments<T>): void;
|
|
250
|
+
toJson(): {};
|
|
251
|
+
fromJson(json: {
|
|
252
|
+
[name: string]: any;
|
|
253
|
+
}): void;
|
|
254
|
+
toString({ escape, parser, }?: {
|
|
255
|
+
escape?: boolean;
|
|
256
|
+
parser?: Parser<T>;
|
|
257
|
+
}): string;
|
|
235
258
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Parser, ParserOptions, QueryOption } from '../../types';
|
|
2
2
|
import { Expand, Filter, OrderBy, Select, Transform } from './builder';
|
|
3
3
|
import { ComputeExpression, Expression, FilterExpression, OrderByExpression, SearchExpression } from './expressions';
|
|
4
|
+
import { ApplyExpression } from './expressions/apply';
|
|
4
5
|
import { ExpandExpression } from './expressions/expand';
|
|
5
6
|
import { SelectExpression } from './expressions/select';
|
|
6
7
|
import { ODataQueryOptionHandler } from './handlers';
|
|
@@ -8,6 +9,7 @@ export type ODataQueryArguments<T> = {
|
|
|
8
9
|
[QueryOption.select]?: Select<T> | SelectExpression<T> | null;
|
|
9
10
|
[QueryOption.expand]?: Expand<T> | ExpandExpression<T> | null;
|
|
10
11
|
[QueryOption.compute]?: string | ComputeExpression<T> | null;
|
|
12
|
+
[QueryOption.apply]?: string | ApplyExpression<T> | null;
|
|
11
13
|
[QueryOption.filter]?: Filter<T> | FilterExpression<T> | null;
|
|
12
14
|
[QueryOption.search]?: string | SearchExpression<T> | null;
|
|
13
15
|
[QueryOption.transform]?: Transform<T> | null;
|
|
@@ -19,26 +21,34 @@ export type ODataQueryArguments<T> = {
|
|
|
19
21
|
[QueryOption.levels]?: number | 'max' | null;
|
|
20
22
|
[QueryOption.count]?: boolean | null;
|
|
21
23
|
};
|
|
24
|
+
export declare const pathAndParamsFromQueryOptions: <T>(values: Map<QueryOption, any>, { escape, parser, options, }?: {
|
|
25
|
+
escape?: boolean | undefined;
|
|
26
|
+
parser?: Parser<T> | undefined;
|
|
27
|
+
options?: ParserOptions | undefined;
|
|
28
|
+
}) => [string, {
|
|
29
|
+
[name: string]: any;
|
|
30
|
+
}];
|
|
22
31
|
export declare class ODataQueryOptions<T> {
|
|
23
|
-
|
|
24
|
-
constructor(values?: Map<QueryOption, any>
|
|
25
|
-
[name: string]: any;
|
|
26
|
-
});
|
|
32
|
+
private _values;
|
|
33
|
+
constructor(values?: Map<QueryOption, any>);
|
|
27
34
|
pathAndParams({ escape, parser, options, }?: {
|
|
28
35
|
escape?: boolean;
|
|
29
36
|
parser?: Parser<T>;
|
|
30
37
|
options?: ParserOptions;
|
|
31
|
-
}): [
|
|
32
|
-
string
|
|
33
|
-
|
|
34
|
-
[name: string]: any;
|
|
35
|
-
}
|
|
36
|
-
];
|
|
38
|
+
}): [string, {
|
|
39
|
+
[name: string]: any;
|
|
40
|
+
}];
|
|
37
41
|
toString({ escape, parser, }?: {
|
|
38
42
|
escape?: boolean;
|
|
39
43
|
parser?: Parser<T>;
|
|
40
44
|
}): string;
|
|
41
45
|
toJson(): {};
|
|
46
|
+
fromJson<T>(json: {
|
|
47
|
+
[name: string]: any;
|
|
48
|
+
}): this;
|
|
49
|
+
static fromJson<T>(json: {
|
|
50
|
+
[name: string]: any;
|
|
51
|
+
}): ODataQueryOptions<T>;
|
|
42
52
|
toQueryArguments(): ODataQueryArguments<T>;
|
|
43
53
|
clone<O>(): ODataQueryOptions<O>;
|
|
44
54
|
expression(key: QueryOption, exp?: Expression<T>): any;
|