angular-odata 0.125.0 → 0.127.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/README.md +2 -2
- package/esm2022/lib/api.mjs +5 -4
- package/esm2022/lib/cache/storage.mjs +3 -3
- package/esm2022/lib/client.mjs +7 -7
- package/esm2022/lib/loaders.mjs +1 -1
- package/esm2022/lib/models/collection.mjs +220 -216
- package/esm2022/lib/models/model.mjs +49 -50
- package/esm2022/lib/models/options.mjs +149 -117
- package/esm2022/lib/module.mjs +20 -7
- package/esm2022/lib/options.mjs +2 -1
- package/esm2022/lib/resources/path/segments.mjs +35 -13
- package/esm2022/lib/resources/query/builder.mjs +17 -5
- package/esm2022/lib/resources/query/expressions/apply.mjs +169 -0
- package/esm2022/lib/resources/query/expressions/base.mjs +8 -3
- package/esm2022/lib/resources/query/expressions/compute.mjs +20 -5
- package/esm2022/lib/resources/query/expressions/count.mjs +27 -10
- package/esm2022/lib/resources/query/expressions/expand.mjs +36 -14
- package/esm2022/lib/resources/query/expressions/filter.mjs +33 -16
- package/esm2022/lib/resources/query/expressions/index.mjs +2 -1
- package/esm2022/lib/resources/query/expressions/orderby.mjs +32 -9
- package/esm2022/lib/resources/query/expressions/search.mjs +34 -15
- package/esm2022/lib/resources/query/expressions/select.mjs +17 -5
- package/esm2022/lib/resources/query/expressions/syntax.mjs +319 -32
- package/esm2022/lib/resources/query/handlers.mjs +90 -55
- package/esm2022/lib/resources/query/index.mjs +2 -1
- package/esm2022/lib/resources/query/options.mjs +95 -71
- package/esm2022/lib/resources/request.mjs +4 -3
- package/esm2022/lib/resources/resource.mjs +53 -24
- package/esm2022/lib/resources/responses/annotations.mjs +4 -1
- package/esm2022/lib/resources/responses/response.mjs +3 -3
- package/esm2022/lib/resources/types/batch.mjs +19 -17
- package/esm2022/lib/resources/types/count.mjs +7 -4
- package/esm2022/lib/resources/types/entity-set.mjs +3 -2
- package/esm2022/lib/resources/types/entity.mjs +5 -5
- package/esm2022/lib/resources/types/function.mjs +1 -9
- package/esm2022/lib/resources/types/navigation-property.mjs +4 -3
- package/esm2022/lib/resources/types/options.mjs +1 -1
- package/esm2022/lib/resources/types/property.mjs +12 -4
- package/esm2022/lib/resources/types/reference.mjs +4 -4
- package/esm2022/lib/schema/parsers/enum-type.mjs +14 -7
- package/esm2022/lib/schema/parsers/structured-type.mjs +56 -44
- package/esm2022/lib/schema/structured-type.mjs +13 -2
- package/esm2022/lib/services/base.mjs +4 -4
- package/esm2022/lib/services/factory.mjs +4 -4
- package/esm2022/lib/types.mjs +12 -1
- package/esm2022/lib/utils/http.mjs +8 -6
- package/fesm2022/angular-odata.mjs +8885 -8094
- package/fesm2022/angular-odata.mjs.map +1 -1
- package/lib/api.d.ts +2 -2
- package/lib/client.d.ts +1 -1
- package/lib/models/collection.d.ts +33 -24
- package/lib/models/model.d.ts +18 -9
- package/lib/models/options.d.ts +22 -17
- package/lib/module.d.ts +2 -1
- package/lib/options.d.ts +5 -0
- package/lib/resources/path/segments.d.ts +18 -11
- package/lib/resources/query/builder.d.ts +6 -5
- package/lib/resources/query/expressions/apply.d.ts +103 -0
- package/lib/resources/query/expressions/base.d.ts +6 -3
- package/lib/resources/query/expressions/compute.d.ts +15 -4
- package/lib/resources/query/expressions/count.d.ts +17 -6
- package/lib/resources/query/expressions/expand.d.ts +22 -11
- package/lib/resources/query/expressions/filter.d.ts +17 -6
- package/lib/resources/query/expressions/index.d.ts +1 -0
- package/lib/resources/query/expressions/orderby.d.ts +18 -6
- package/lib/resources/query/expressions/search.d.ts +15 -6
- package/lib/resources/query/expressions/select.d.ts +13 -4
- package/lib/resources/query/expressions/syntax.d.ts +138 -19
- package/lib/resources/query/handlers.d.ts +33 -10
- package/lib/resources/query/index.d.ts +1 -0
- package/lib/resources/query/options.d.ts +24 -13
- package/lib/resources/request.d.ts +3 -2
- package/lib/resources/resource.d.ts +15 -6
- package/lib/resources/responses/annotations.d.ts +1 -0
- package/lib/resources/responses/response.d.ts +2 -2
- package/lib/resources/types/batch.d.ts +9 -4
- package/lib/resources/types/count.d.ts +5 -1
- package/lib/resources/types/function.d.ts +0 -3
- package/lib/resources/types/options.d.ts +2 -1
- package/lib/resources/types/property.d.ts +2 -0
- package/lib/schema/parsers/enum-type.d.ts +14 -2
- package/lib/schema/parsers/structured-type.d.ts +1 -0
- package/lib/schema/structured-type.d.ts +2 -1
- package/lib/types.d.ts +11 -0
- package/lib/utils/http.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Parser } from '../../../types';
|
|
1
|
+
import { Parser, ParserOptions } from '../../../types';
|
|
2
2
|
import type { 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> {
|
|
@@ -12,12 +12,23 @@ export declare class ComputeExpression<T> extends Expression<T> {
|
|
|
12
12
|
children?: Renderable[];
|
|
13
13
|
names?: string[];
|
|
14
14
|
});
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
get [Symbol.toStringTag](): string;
|
|
16
|
+
static factory<T>(opts: (builder: ComputeExpressionBuilder<T>, current?: ComputeExpression<T>) => ComputeExpression<T>, current?: ComputeExpression<T>): ComputeExpression<T>;
|
|
17
|
+
toJson(): {
|
|
18
|
+
$type: string;
|
|
19
|
+
children: any[];
|
|
20
|
+
} & {
|
|
21
|
+
names: string[];
|
|
22
|
+
};
|
|
23
|
+
static fromJson<T>(json: {
|
|
24
|
+
[name: string]: any;
|
|
25
|
+
}): ComputeExpression<T>;
|
|
26
|
+
render({ aliases, escape, prefix, parser, options, }?: {
|
|
17
27
|
aliases?: QueryCustomType[];
|
|
18
28
|
escape?: boolean;
|
|
19
29
|
prefix?: string;
|
|
20
30
|
parser?: Parser<T>;
|
|
31
|
+
options?: ParserOptions;
|
|
21
32
|
}): string;
|
|
22
33
|
clone(): ComputeExpression<T>;
|
|
23
34
|
private _add;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Parser } from '../../../types';
|
|
1
|
+
import { Parser, ParserOptions } from '../../../types';
|
|
2
2
|
import type { QueryCustomType } from '../builder';
|
|
3
3
|
import { Expression } from './base';
|
|
4
4
|
import { FilterExpression, FilterExpressionBuilder } from './filter';
|
|
@@ -10,34 +10,45 @@ export declare class CountField<T> implements Renderable {
|
|
|
10
10
|
[name: string]: any;
|
|
11
11
|
});
|
|
12
12
|
get [Symbol.toStringTag](): string;
|
|
13
|
-
|
|
13
|
+
toJson(): {
|
|
14
14
|
field: any;
|
|
15
15
|
};
|
|
16
|
-
render({ aliases, escape, prefix, parser, }: {
|
|
16
|
+
render({ aliases, escape, prefix, parser, options, }: {
|
|
17
17
|
aliases?: QueryCustomType[];
|
|
18
18
|
escape?: boolean;
|
|
19
19
|
prefix?: string;
|
|
20
20
|
parser?: Parser<T>;
|
|
21
|
+
options?: ParserOptions;
|
|
21
22
|
}): string;
|
|
22
23
|
filter(opts: (builder: FilterExpressionBuilder<T>, current?: FilterExpression<T>) => FilterExpression<T>): any;
|
|
23
24
|
clone(): CountField<T>;
|
|
25
|
+
resolve(parser: any): any;
|
|
24
26
|
private option;
|
|
25
27
|
}
|
|
26
28
|
export type CountExpressionBuilder<T> = {
|
|
27
|
-
t:
|
|
29
|
+
t: Required<T>;
|
|
28
30
|
e: () => CountExpression<T>;
|
|
29
31
|
};
|
|
30
32
|
export declare class CountExpression<T> extends Expression<T> {
|
|
31
33
|
constructor({ children, }?: {
|
|
32
34
|
children?: Renderable[];
|
|
33
35
|
});
|
|
34
|
-
|
|
36
|
+
get [Symbol.toStringTag](): string;
|
|
37
|
+
static factory<T>(opts: (builder: CountExpressionBuilder<T>, current?: CountExpression<T>) => CountExpression<T>, current?: CountExpression<T>): CountExpression<T>;
|
|
35
38
|
private _add;
|
|
36
|
-
|
|
39
|
+
toJson(): {
|
|
40
|
+
$type: string;
|
|
41
|
+
children: any[];
|
|
42
|
+
};
|
|
43
|
+
static fromJson<T>(json: {
|
|
44
|
+
[name: string]: any;
|
|
45
|
+
}): CountExpression<T>;
|
|
46
|
+
render({ aliases, escape, prefix, parser, options, }?: {
|
|
37
47
|
aliases?: QueryCustomType[];
|
|
38
48
|
escape?: boolean;
|
|
39
49
|
prefix?: string;
|
|
40
50
|
parser?: Parser<T>;
|
|
51
|
+
options?: ParserOptions;
|
|
41
52
|
}): string;
|
|
42
53
|
clone(): CountExpression<T>;
|
|
43
54
|
field<F>(field: F[], opts?: (e: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Parser } from '../../../types';
|
|
1
|
+
import { Parser, ParserOptions } from '../../../types';
|
|
2
2
|
import type { QueryCustomType, Unpacked } from '../builder';
|
|
3
3
|
import { Expression } from './base';
|
|
4
4
|
import { FilterExpression, FilterExpressionBuilder } from './filter';
|
|
@@ -13,21 +13,23 @@ export declare class ExpandField<T> implements Renderable {
|
|
|
13
13
|
[name: string]: any;
|
|
14
14
|
});
|
|
15
15
|
get [Symbol.toStringTag](): string;
|
|
16
|
-
|
|
16
|
+
toJson(): {
|
|
17
17
|
field: any;
|
|
18
18
|
};
|
|
19
|
-
render({ aliases, escape, prefix, parser, }: {
|
|
19
|
+
render({ aliases, escape, prefix, parser, options, }: {
|
|
20
20
|
aliases?: QueryCustomType[];
|
|
21
21
|
escape?: boolean;
|
|
22
22
|
prefix?: string;
|
|
23
23
|
parser?: Parser<T>;
|
|
24
|
+
options?: ParserOptions;
|
|
24
25
|
}): string;
|
|
25
26
|
clone(): ExpandField<T>;
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
resolve(parser: any): any;
|
|
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>;
|
|
31
33
|
skip(n: number): number;
|
|
32
34
|
top(n: number): number;
|
|
33
35
|
levels(n: number | 'max'): number | "max";
|
|
@@ -35,19 +37,28 @@ export declare class ExpandField<T> implements Renderable {
|
|
|
35
37
|
private option;
|
|
36
38
|
}
|
|
37
39
|
export type ExpandExpressionBuilder<T> = {
|
|
38
|
-
t:
|
|
40
|
+
t: Required<T>;
|
|
39
41
|
e: () => ExpandExpression<T>;
|
|
40
42
|
};
|
|
41
43
|
export declare class ExpandExpression<T> extends Expression<T> {
|
|
42
44
|
constructor({ children, }?: {
|
|
43
45
|
children?: Renderable[];
|
|
44
46
|
});
|
|
45
|
-
|
|
46
|
-
|
|
47
|
+
get [Symbol.toStringTag](): string;
|
|
48
|
+
static factory<T>(opts: (builder: ExpandExpressionBuilder<T>, current?: ExpandExpression<T>) => ExpandExpression<T>, current?: ExpandExpression<T>): ExpandExpression<T>;
|
|
49
|
+
toJson(): {
|
|
50
|
+
$type: string;
|
|
51
|
+
children: any[];
|
|
52
|
+
};
|
|
53
|
+
static fromJson<T>(json: {
|
|
54
|
+
[name: string]: any;
|
|
55
|
+
}): ExpandExpression<T>;
|
|
56
|
+
render({ aliases, escape, prefix, parser, options, }?: {
|
|
47
57
|
aliases?: QueryCustomType[];
|
|
48
58
|
escape?: boolean;
|
|
49
59
|
prefix?: string;
|
|
50
60
|
parser?: Parser<T>;
|
|
61
|
+
options?: ParserOptions;
|
|
51
62
|
}): string;
|
|
52
63
|
clone(): ExpandExpression<T>;
|
|
53
64
|
private _add;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { Parser } from '../../../types';
|
|
1
|
+
import { Parser, ParserOptions } from '../../../types';
|
|
2
2
|
import type { 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>;
|
|
@@ -18,19 +18,26 @@ export declare class FilterExpression<F> extends Expression<F> {
|
|
|
18
18
|
connector?: FilterConnector;
|
|
19
19
|
negated?: boolean;
|
|
20
20
|
});
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
get [Symbol.toStringTag](): string;
|
|
22
|
+
static factory<T>(opts: (builder: FilterExpressionBuilder<T>, current?: FilterExpression<T>) => FilterExpression<T>, current?: FilterExpression<T>): FilterExpression<T>;
|
|
23
|
+
toJson(): {
|
|
24
|
+
$type: string;
|
|
23
25
|
children: any[];
|
|
26
|
+
} & {
|
|
24
27
|
connector: FilterConnector;
|
|
25
28
|
negated: boolean;
|
|
26
29
|
};
|
|
30
|
+
static fromJson<T>(json: {
|
|
31
|
+
[name: string]: any;
|
|
32
|
+
}): FilterExpression<T>;
|
|
27
33
|
connector(): FilterConnector;
|
|
28
34
|
negated(): boolean;
|
|
29
|
-
render({ aliases, escape, prefix, parser, }?: {
|
|
35
|
+
render({ aliases, escape, prefix, parser, options, }?: {
|
|
30
36
|
aliases?: QueryCustomType[];
|
|
31
37
|
escape?: boolean;
|
|
32
38
|
prefix?: string;
|
|
33
39
|
parser?: Parser<any>;
|
|
40
|
+
options?: ParserOptions;
|
|
34
41
|
}): string;
|
|
35
42
|
clone(): FilterExpression<F>;
|
|
36
43
|
private _add;
|
|
@@ -51,10 +58,14 @@ export declare class FilterExpression<F> extends Expression<F> {
|
|
|
51
58
|
any<N>(left: N[], opts?: (e: {
|
|
52
59
|
e: (connector?: FilterConnector) => FilterExpression<N>;
|
|
53
60
|
t: N;
|
|
61
|
+
o: ODataOperators<N>;
|
|
62
|
+
f: ODataFunctions<N>;
|
|
54
63
|
}) => FilterExpression<N>, alias?: string): FilterExpression<F>;
|
|
55
|
-
all<N>(left: N[], opts
|
|
64
|
+
all<N>(left: N[], opts?: (e: {
|
|
56
65
|
t: N;
|
|
57
66
|
e: (connector?: FilterConnector) => FilterExpression<N>;
|
|
67
|
+
o: ODataOperators<N>;
|
|
68
|
+
f: ODataFunctions<N>;
|
|
58
69
|
}) => FilterExpression<N>, alias?: string): FilterExpression<F>;
|
|
59
70
|
count<N>(left: N[], opts?: (e: {
|
|
60
71
|
t: N;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Parser } from '../../../types';
|
|
1
|
+
import { Parser, ParserOptions } from '../../../types';
|
|
2
2
|
import type { QueryCustomType } from '../builder';
|
|
3
3
|
import { Expression } from './base';
|
|
4
4
|
import { Renderable } from './syntax';
|
|
@@ -7,33 +7,45 @@ export declare class OrderByField implements Renderable {
|
|
|
7
7
|
protected order: 'asc' | 'desc';
|
|
8
8
|
constructor(field: Renderable, order: 'asc' | 'desc');
|
|
9
9
|
get [Symbol.toStringTag](): string;
|
|
10
|
-
|
|
10
|
+
toJson(): {
|
|
11
|
+
$type: string;
|
|
11
12
|
field: any;
|
|
12
13
|
order: "asc" | "desc";
|
|
13
14
|
};
|
|
14
|
-
render({ aliases, escape, prefix, parser, }: {
|
|
15
|
+
render({ aliases, escape, prefix, parser, options, }: {
|
|
15
16
|
aliases?: QueryCustomType[];
|
|
16
17
|
escape?: boolean;
|
|
17
18
|
prefix?: string;
|
|
18
19
|
parser?: Parser<any>;
|
|
20
|
+
options?: ParserOptions;
|
|
19
21
|
}): string;
|
|
20
22
|
clone(): OrderByField;
|
|
23
|
+
resolve(parser: any): any;
|
|
21
24
|
}
|
|
22
25
|
export type OrderByExpressionBuilder<T> = {
|
|
23
|
-
t:
|
|
26
|
+
t: Required<T>;
|
|
24
27
|
e: () => OrderByExpression<T>;
|
|
25
28
|
};
|
|
26
29
|
export declare class OrderByExpression<T> extends Expression<T> {
|
|
27
30
|
constructor({ children, }?: {
|
|
28
31
|
children?: Renderable[];
|
|
29
32
|
});
|
|
30
|
-
|
|
33
|
+
get [Symbol.toStringTag](): string;
|
|
34
|
+
static factory<T>(opts: (builder: OrderByExpressionBuilder<T>, current?: OrderByExpression<T>) => OrderByExpression<T>, current?: OrderByExpression<T>): OrderByExpression<T>;
|
|
31
35
|
private _add;
|
|
32
|
-
|
|
36
|
+
toJson(): {
|
|
37
|
+
$type: string;
|
|
38
|
+
children: any[];
|
|
39
|
+
};
|
|
40
|
+
static fromJson<T>(json: {
|
|
41
|
+
[name: string]: any;
|
|
42
|
+
}): OrderByExpression<T>;
|
|
43
|
+
render({ aliases, escape, prefix, parser, options, }?: {
|
|
33
44
|
aliases?: QueryCustomType[];
|
|
34
45
|
escape?: boolean;
|
|
35
46
|
prefix?: string;
|
|
36
47
|
parser?: Parser<T>;
|
|
48
|
+
options?: ParserOptions;
|
|
37
49
|
}): string;
|
|
38
50
|
clone(): OrderByExpression<T>;
|
|
39
51
|
ascending(field: any): OrderByExpression<T>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Parser } from '../../../types';
|
|
1
|
+
import { Parser, ParserOptions } from '../../../types';
|
|
2
2
|
import type { QueryCustomType } from '../builder';
|
|
3
3
|
import { Expression } from './base';
|
|
4
4
|
import { Renderable } from './syntax';
|
|
@@ -7,17 +7,19 @@ export declare class SearchTerm implements Renderable {
|
|
|
7
7
|
protected value: string;
|
|
8
8
|
constructor(value: string);
|
|
9
9
|
get [Symbol.toStringTag](): string;
|
|
10
|
-
|
|
10
|
+
toJson(): {
|
|
11
11
|
$type: string;
|
|
12
12
|
value: string;
|
|
13
13
|
};
|
|
14
|
-
render({ aliases, escape, prefix, parser, }: {
|
|
14
|
+
render({ aliases, escape, prefix, parser, options, }: {
|
|
15
15
|
aliases?: QueryCustomType[];
|
|
16
16
|
escape?: boolean;
|
|
17
17
|
prefix?: string;
|
|
18
18
|
parser?: Parser<any>;
|
|
19
|
+
options?: ParserOptions;
|
|
19
20
|
}): string;
|
|
20
21
|
clone(): SearchTerm;
|
|
22
|
+
resolve(parser: any): any;
|
|
21
23
|
}
|
|
22
24
|
export type SearchExpressionBuilder<T> = {
|
|
23
25
|
e: (connector?: SearchConnector) => SearchExpression<T>;
|
|
@@ -30,20 +32,27 @@ export declare class SearchExpression<T> extends Expression<T> {
|
|
|
30
32
|
connector?: SearchConnector;
|
|
31
33
|
negated?: boolean;
|
|
32
34
|
});
|
|
33
|
-
|
|
35
|
+
get [Symbol.toStringTag](): string;
|
|
36
|
+
static factory<T>(opts: (builder: SearchExpressionBuilder<T>, current?: SearchExpression<T>) => SearchExpression<T>, current?: SearchExpression<T>): SearchExpression<T>;
|
|
34
37
|
private _add;
|
|
35
|
-
render({ aliases, escape, prefix, parser, }?: {
|
|
38
|
+
render({ aliases, escape, prefix, parser, options, }?: {
|
|
36
39
|
aliases?: QueryCustomType[];
|
|
37
40
|
escape?: boolean;
|
|
38
41
|
prefix?: string;
|
|
39
42
|
parser?: Parser<T>;
|
|
43
|
+
options?: ParserOptions;
|
|
40
44
|
}): string;
|
|
41
45
|
clone(): SearchExpression<T>;
|
|
42
|
-
|
|
46
|
+
toJson(): {
|
|
47
|
+
$type: string;
|
|
43
48
|
children: any[];
|
|
49
|
+
} & {
|
|
44
50
|
connector: SearchConnector;
|
|
45
51
|
negated: boolean;
|
|
46
52
|
};
|
|
53
|
+
static fromJson<T>(json: {
|
|
54
|
+
[name: string]: any;
|
|
55
|
+
}): SearchExpression<T>;
|
|
47
56
|
connector(): SearchConnector;
|
|
48
57
|
negated(): boolean;
|
|
49
58
|
or(exp: SearchExpression<T>): SearchExpression<T>;
|
|
@@ -1,21 +1,30 @@
|
|
|
1
|
-
import { Parser } from '../../../types';
|
|
1
|
+
import { Parser, ParserOptions } from '../../../types';
|
|
2
2
|
import type { 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> {
|
|
10
10
|
constructor({ children, }?: {
|
|
11
11
|
children?: Renderable[];
|
|
12
12
|
});
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
get [Symbol.toStringTag](): string;
|
|
14
|
+
static factory<T>(opts: (builder: SelectExpressionBuilder<T>, current?: SelectExpression<T>) => SelectExpression<T>, current?: SelectExpression<T>): SelectExpression<T>;
|
|
15
|
+
toJson(): {
|
|
16
|
+
$type: string;
|
|
17
|
+
children: any[];
|
|
18
|
+
};
|
|
19
|
+
static fromJson<T>(json: {
|
|
20
|
+
[name: string]: any;
|
|
21
|
+
}): SelectExpression<T>;
|
|
22
|
+
render({ aliases, escape, prefix, parser, options, }?: {
|
|
15
23
|
aliases?: QueryCustomType[];
|
|
16
24
|
escape?: boolean;
|
|
17
25
|
prefix?: string;
|
|
18
26
|
parser?: Parser<T>;
|
|
27
|
+
options?: ParserOptions;
|
|
19
28
|
}): string;
|
|
20
29
|
clone(): SelectExpression<T>;
|
|
21
30
|
private _add;
|
|
@@ -1,27 +1,30 @@
|
|
|
1
|
-
import { Parser } from '../../../types';
|
|
1
|
+
import { Parser, ParserOptions } from '../../../types';
|
|
2
2
|
import type { QueryCustomType } from '../builder';
|
|
3
3
|
export type Normalize = 'all' | 'right' | 'left' | 'none';
|
|
4
4
|
export interface Renderable {
|
|
5
|
-
render({ aliases, escape, prefix, parser, }: {
|
|
5
|
+
render({ aliases, escape, prefix, parser, options, }: {
|
|
6
6
|
aliases?: QueryCustomType[];
|
|
7
7
|
escape?: boolean;
|
|
8
8
|
prefix?: string;
|
|
9
9
|
parser?: Parser<any>;
|
|
10
|
+
options?: ParserOptions;
|
|
10
11
|
}): string;
|
|
11
|
-
|
|
12
|
-
toJSON(): any;
|
|
12
|
+
toJson(): any;
|
|
13
13
|
clone(): any;
|
|
14
|
+
resolve(parser: any): any;
|
|
14
15
|
}
|
|
15
|
-
export declare const FieldFactory: <T extends object>(names?: string[]) => any;
|
|
16
|
-
export declare
|
|
16
|
+
export declare const FieldFactory: <T extends object>(names?: (string | Renderable)[]) => any;
|
|
17
|
+
export declare const RenderableFactory: (value: any) => Renderable;
|
|
18
|
+
export declare function render(value: any, { aliases, normalize, escape, prefix, parser, options, }?: {
|
|
17
19
|
aliases?: QueryCustomType[];
|
|
18
20
|
normalize?: boolean;
|
|
19
21
|
escape?: boolean;
|
|
20
22
|
prefix?: string;
|
|
21
23
|
parser?: Parser<any>;
|
|
24
|
+
options?: ParserOptions;
|
|
22
25
|
}): string | number | boolean | null;
|
|
23
26
|
export declare function resolve(values: any, parser?: Parser<any>): any;
|
|
24
|
-
export declare function encode(values: any, parser?: Parser<any
|
|
27
|
+
export declare function encode(values: any, parser?: Parser<any>, options?: ParserOptions): any;
|
|
25
28
|
export declare class Function<T> implements Renderable {
|
|
26
29
|
protected name: string;
|
|
27
30
|
protected values: any[];
|
|
@@ -29,19 +32,24 @@ export declare class Function<T> implements Renderable {
|
|
|
29
32
|
protected escape: boolean;
|
|
30
33
|
constructor(name: string, values: any[], normalize: Normalize, escape?: boolean);
|
|
31
34
|
get [Symbol.toStringTag](): string;
|
|
32
|
-
|
|
35
|
+
toJson(): {
|
|
33
36
|
$type: string;
|
|
34
37
|
name: string;
|
|
35
38
|
values: any[];
|
|
36
39
|
normalize: Normalize;
|
|
37
40
|
};
|
|
38
|
-
|
|
41
|
+
static fromJson<T>(json: {
|
|
42
|
+
[name: string]: any;
|
|
43
|
+
}): Function<T>;
|
|
44
|
+
render({ aliases, escape, prefix, parser, options, }: {
|
|
39
45
|
aliases?: QueryCustomType[];
|
|
40
46
|
escape?: boolean;
|
|
41
47
|
prefix?: string;
|
|
42
48
|
parser?: Parser<T>;
|
|
49
|
+
options?: ParserOptions;
|
|
43
50
|
}): string;
|
|
44
51
|
clone(): Function<T>;
|
|
52
|
+
resolve(parser: any): any;
|
|
45
53
|
}
|
|
46
54
|
export declare class StringAndCollectionFunctions<T> {
|
|
47
55
|
concat(left: any, right: any, normalize?: Normalize): Function<T>;
|
|
@@ -84,8 +92,8 @@ export declare class ArithmeticFunctions<T> {
|
|
|
84
92
|
round(left: T | string, normalize?: Normalize): Function<T>;
|
|
85
93
|
}
|
|
86
94
|
export declare class TypeFunctions<T> {
|
|
87
|
-
cast(left: T | string,
|
|
88
|
-
isof(left: T | string,
|
|
95
|
+
cast<N>(left: T | string, type?: string): N;
|
|
96
|
+
isof(left: T | string, type?: string): Type<T>;
|
|
89
97
|
}
|
|
90
98
|
export declare class GeoFunctions<T> {
|
|
91
99
|
geoDistance(left: T, right: string, normalize?: Normalize): Function<T>;
|
|
@@ -101,19 +109,24 @@ export declare class Operator<T> implements Renderable {
|
|
|
101
109
|
protected normalize: Normalize;
|
|
102
110
|
constructor(op: string, values: any[], normalize: Normalize);
|
|
103
111
|
get [Symbol.toStringTag](): string;
|
|
104
|
-
|
|
112
|
+
toJson(): {
|
|
105
113
|
$type: string;
|
|
106
114
|
op: string;
|
|
107
115
|
values: any[];
|
|
108
116
|
normalize: Normalize;
|
|
109
117
|
};
|
|
110
|
-
|
|
118
|
+
static fromJson<T>(json: {
|
|
119
|
+
[name: string]: any;
|
|
120
|
+
}): Operator<T>;
|
|
121
|
+
render({ aliases, escape, prefix, parser, options, }: {
|
|
111
122
|
aliases?: QueryCustomType[];
|
|
112
123
|
escape?: boolean;
|
|
113
124
|
prefix?: string;
|
|
114
125
|
parser?: Parser<T>;
|
|
126
|
+
options?: ParserOptions;
|
|
115
127
|
}): string;
|
|
116
128
|
clone(): Operator<unknown>;
|
|
129
|
+
resolve(parser: any): any;
|
|
117
130
|
}
|
|
118
131
|
export declare class LogicalOperators<T> {
|
|
119
132
|
eq(left: any, right: any, normalize?: Normalize): Operator<unknown>;
|
|
@@ -138,17 +151,113 @@ export declare class Grouping<T> implements Renderable {
|
|
|
138
151
|
protected group: Renderable;
|
|
139
152
|
constructor(group: Renderable);
|
|
140
153
|
get [Symbol.toStringTag](): string;
|
|
141
|
-
|
|
154
|
+
toJson(): {
|
|
142
155
|
$type: string;
|
|
143
156
|
group: any;
|
|
144
157
|
};
|
|
145
|
-
|
|
158
|
+
static fromJson<T>(json: {
|
|
159
|
+
[name: string]: any;
|
|
160
|
+
}): Grouping<T>;
|
|
161
|
+
render({ aliases, escape, prefix, parser, options, }: {
|
|
146
162
|
aliases?: QueryCustomType[];
|
|
147
163
|
escape?: boolean;
|
|
148
164
|
prefix?: string;
|
|
149
165
|
parser?: Parser<T>;
|
|
166
|
+
options?: ParserOptions;
|
|
150
167
|
}): string;
|
|
151
168
|
clone(): Grouping<unknown>;
|
|
169
|
+
resolve(parser: any): any;
|
|
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(left: any, normalize?: Normalize): Function<T>;
|
|
235
|
+
filter(left: any, normalize?: Normalize): Function<T>;
|
|
236
|
+
}
|
|
237
|
+
export declare class Type<T> implements Renderable {
|
|
238
|
+
protected name: string;
|
|
239
|
+
protected type: string;
|
|
240
|
+
protected value?: any;
|
|
241
|
+
constructor(name: string, type: string, value?: any);
|
|
242
|
+
get [Symbol.toStringTag](): string;
|
|
243
|
+
toJson(): {
|
|
244
|
+
$type: string;
|
|
245
|
+
name: string;
|
|
246
|
+
type: string;
|
|
247
|
+
value: any;
|
|
248
|
+
};
|
|
249
|
+
static fromJson<T>(json: {
|
|
250
|
+
[name: string]: any;
|
|
251
|
+
}): Type<T>;
|
|
252
|
+
render({ aliases, escape, prefix, parser, options, }: {
|
|
253
|
+
aliases?: QueryCustomType[];
|
|
254
|
+
escape?: boolean;
|
|
255
|
+
prefix?: string;
|
|
256
|
+
parser?: Parser<T>;
|
|
257
|
+
options?: ParserOptions;
|
|
258
|
+
}): string;
|
|
259
|
+
clone(): Type<unknown>;
|
|
260
|
+
resolve(parser: any): any;
|
|
152
261
|
}
|
|
153
262
|
export declare class Lambda<T> implements Renderable {
|
|
154
263
|
protected op: string;
|
|
@@ -156,19 +265,24 @@ export declare class Lambda<T> implements Renderable {
|
|
|
156
265
|
protected alias?: string | undefined;
|
|
157
266
|
constructor(op: string, values: any[], alias?: string | undefined);
|
|
158
267
|
get [Symbol.toStringTag](): string;
|
|
159
|
-
|
|
268
|
+
toJson(): {
|
|
160
269
|
$type: string;
|
|
161
270
|
op: string;
|
|
162
271
|
values: any[];
|
|
163
272
|
alias: string | undefined;
|
|
164
273
|
};
|
|
165
|
-
|
|
274
|
+
static fromJson<T>(json: {
|
|
275
|
+
[name: string]: any;
|
|
276
|
+
}): Lambda<T>;
|
|
277
|
+
render({ aliases, escape, prefix, parser, options, }: {
|
|
166
278
|
aliases?: QueryCustomType[];
|
|
167
279
|
escape?: boolean;
|
|
168
280
|
prefix?: string;
|
|
169
281
|
parser?: Parser<T>;
|
|
282
|
+
options?: ParserOptions;
|
|
170
283
|
}): string;
|
|
171
284
|
clone(): Lambda<unknown>;
|
|
285
|
+
resolve(parser: any): any;
|
|
172
286
|
}
|
|
173
287
|
export declare class LambdaOperators<T> {
|
|
174
288
|
any(left: T, right: any, alias?: string): Lambda<unknown>;
|
|
@@ -176,7 +290,7 @@ export declare class LambdaOperators<T> {
|
|
|
176
290
|
}
|
|
177
291
|
export declare class ODataOperators<T> {
|
|
178
292
|
}
|
|
179
|
-
export interface ODataOperators<T> extends LogicalOperators<T>, ArithmeticOperators<T>, LambdaOperators<T> {
|
|
293
|
+
export interface ODataOperators<T> extends LogicalOperators<T>, ArithmeticOperators<T>, GroupingOperators<T>, LambdaOperators<T> {
|
|
180
294
|
}
|
|
181
295
|
export declare const operators: ODataOperators<any>;
|
|
182
296
|
export declare class ODataFunctions<T> {
|
|
@@ -184,8 +298,13 @@ export declare class ODataFunctions<T> {
|
|
|
184
298
|
export interface ODataFunctions<T> extends StringAndCollectionFunctions<T>, CollectionFunctions<T>, StringFunctions<T>, DateAndTimeFunctions<T>, ArithmeticFunctions<T>, TypeFunctions<T>, GeoFunctions<T>, ConditionalFunctions<T> {
|
|
185
299
|
}
|
|
186
300
|
export declare const functions: ODataFunctions<any>;
|
|
301
|
+
export declare class ODataTransformations<T> {
|
|
302
|
+
}
|
|
303
|
+
export interface ODataTransformations<T> extends Transformations<T> {
|
|
304
|
+
}
|
|
305
|
+
export declare const transformations: ODataTransformations<any>;
|
|
187
306
|
export declare class ODataSyntax<T> {
|
|
188
307
|
}
|
|
189
|
-
export interface ODataSyntax<T> extends ODataOperators<T>, ODataFunctions<T> {
|
|
308
|
+
export interface ODataSyntax<T> extends ODataOperators<T>, ODataFunctions<T>, ODataTransformations<T> {
|
|
190
309
|
}
|
|
191
310
|
export declare const syntax: ODataSyntax<any>;
|