angular-odata 0.122.0 → 0.124.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/api.mjs +373 -0
- package/esm2022/lib/cache/cache.mjs +175 -0
- package/{esm2020 → esm2022}/lib/cache/storage.mjs +1 -1
- package/esm2022/lib/client.mjs +252 -0
- package/{esm2020 → esm2022}/lib/helper.mjs +1 -1
- package/{esm2020 → esm2022}/lib/loaders.mjs +1 -1
- package/esm2022/lib/models/collection.mjs +865 -0
- package/esm2022/lib/models/model.mjs +535 -0
- package/esm2022/lib/models/options.mjs +1117 -0
- package/{esm2020 → esm2022}/lib/module.mjs +5 -5
- package/esm2022/lib/resources/path/segments.mjs +124 -0
- package/esm2022/lib/resources/query/builder.mjs +624 -0
- package/esm2022/lib/resources/query/expressions/base.mjs +20 -0
- package/esm2022/lib/resources/query/expressions/compute.mjs +39 -0
- package/esm2022/lib/resources/query/expressions/count.mjs +99 -0
- package/esm2022/lib/resources/query/expressions/expand.mjs +125 -0
- package/esm2022/lib/resources/query/expressions/filter.mjs +161 -0
- package/esm2022/lib/resources/query/expressions/orderby.mjs +56 -0
- package/esm2022/lib/resources/query/expressions/search.mjs +122 -0
- package/esm2022/lib/resources/query/expressions/select.mjs +31 -0
- package/esm2022/lib/resources/query/expressions/syntax.mjs +444 -0
- package/{esm2020 → esm2022}/lib/resources/query/handlers.mjs +1 -1
- package/esm2022/lib/resources/query/options.mjs +115 -0
- package/{esm2020 → esm2022}/lib/resources/request.mjs +1 -1
- package/esm2022/lib/resources/resource.mjs +257 -0
- package/{esm2020 → esm2022}/lib/resources/responses/annotations.mjs +1 -1
- package/esm2022/lib/resources/responses/csdl/csdl-annotation.mjs +33 -0
- package/{esm2020 → esm2022}/lib/resources/responses/csdl/csdl-entity-container.mjs +1 -1
- package/{esm2020 → esm2022}/lib/resources/responses/csdl/csdl-entity-set.mjs +1 -1
- package/{esm2020 → esm2022}/lib/resources/responses/csdl/csdl-enum-type.mjs +1 -1
- package/{esm2020 → esm2022}/lib/resources/responses/csdl/csdl-function-action.mjs +1 -1
- package/{esm2020 → esm2022}/lib/resources/responses/csdl/csdl-navigation-property-binding.mjs +1 -1
- package/{esm2020 → esm2022}/lib/resources/responses/csdl/csdl-reference.mjs +1 -1
- package/{esm2020 → esm2022}/lib/resources/responses/csdl/csdl-schema.mjs +1 -1
- package/{esm2020 → esm2022}/lib/resources/responses/csdl/csdl-singleton.mjs +1 -1
- package/{esm2020 → esm2022}/lib/resources/responses/csdl/csdl-structural-property.mjs +1 -1
- package/{esm2020 → esm2022}/lib/resources/responses/csdl/csdl-structured-type.mjs +1 -1
- package/{esm2020 → esm2022}/lib/resources/responses/csdl/csdl-type-definition.mjs +1 -1
- package/esm2022/lib/resources/responses/metadata.mjs +547 -0
- package/{esm2020 → esm2022}/lib/resources/responses/response.mjs +1 -1
- package/{esm2020 → esm2022}/lib/resources/types/action.mjs +1 -1
- package/{esm2020 → esm2022}/lib/resources/types/batch.mjs +1 -1
- package/{esm2020 → esm2022}/lib/resources/types/count.mjs +1 -1
- package/{esm2020 → esm2022}/lib/resources/types/entity-set.mjs +1 -1
- package/{esm2020 → esm2022}/lib/resources/types/entity.mjs +1 -1
- package/{esm2020 → esm2022}/lib/resources/types/function.mjs +1 -1
- package/{esm2020 → esm2022}/lib/resources/types/media.mjs +1 -1
- package/{esm2020 → esm2022}/lib/resources/types/navigation-property.mjs +1 -1
- package/{esm2020 → esm2022}/lib/resources/types/property.mjs +1 -1
- package/{esm2020 → esm2022}/lib/resources/types/reference.mjs +1 -1
- package/{esm2020 → esm2022}/lib/resources/types/singleton.mjs +1 -1
- package/{esm2020 → esm2022}/lib/resources/types/value.mjs +1 -1
- package/{esm2020 → esm2022}/lib/schema/annotation.mjs +1 -1
- package/{esm2020 → esm2022}/lib/schema/callable.mjs +1 -1
- package/{esm2020 → esm2022}/lib/schema/element.mjs +1 -1
- package/{esm2020 → esm2022}/lib/schema/entity-container.mjs +1 -1
- package/{esm2020 → esm2022}/lib/schema/enum-type.mjs +1 -1
- package/{esm2020 → esm2022}/lib/schema/parsers/callable.mjs +1 -1
- package/esm2022/lib/schema/parsers/edm.mjs +99 -0
- package/{esm2020 → esm2022}/lib/schema/parsers/enum-type.mjs +2 -2
- package/esm2022/lib/schema/parsers/structured-type.mjs +502 -0
- package/{esm2020 → esm2022}/lib/schema/schema.mjs +1 -1
- package/esm2022/lib/schema/structured-type.mjs +207 -0
- package/esm2022/lib/services/base.mjs +29 -0
- package/{esm2020 → esm2022}/lib/services/entity-set.mjs +1 -1
- package/{esm2020 → esm2022}/lib/services/factory.mjs +4 -4
- package/{esm2020 → esm2022}/lib/services/singleton.mjs +1 -1
- package/{esm2020 → esm2022}/lib/settings.mjs +1 -1
- package/{esm2020 → esm2022}/lib/types.mjs +1 -1
- package/{esm2020 → esm2022}/lib/utils/arrays.mjs +1 -1
- package/{esm2020 → esm2022}/lib/utils/durations.mjs +1 -1
- package/esm2022/lib/utils/enums.mjs +61 -0
- package/{esm2020 → esm2022}/lib/utils/http.mjs +1 -1
- package/{esm2020 → esm2022}/lib/utils/objects.mjs +1 -1
- package/{esm2020 → esm2022}/lib/utils/odata.mjs +1 -1
- package/esm2022/lib/utils/types.mjs +136 -0
- package/{fesm2020 → fesm2022}/angular-odata.mjs +544 -373
- package/fesm2022/angular-odata.mjs.map +1 -0
- package/lib/helper.d.ts +1 -1
- package/lib/models/model.d.ts +4 -2
- package/lib/models/options.d.ts +7 -8
- package/lib/resources/path/segments.d.ts +15 -6
- package/lib/resources/query/builder.d.ts +21 -20
- package/lib/resources/query/expressions/base.d.ts +6 -4
- package/lib/resources/query/expressions/compute.d.ts +10 -8
- package/lib/resources/query/expressions/count.d.ts +14 -11
- package/lib/resources/query/expressions/expand.d.ts +23 -19
- package/lib/resources/query/expressions/filter.d.ts +22 -20
- package/lib/resources/query/expressions/orderby.d.ts +12 -9
- package/lib/resources/query/expressions/search.d.ts +12 -9
- package/lib/resources/query/expressions/select.d.ts +9 -7
- package/lib/resources/query/expressions/syntax.d.ts +75 -71
- package/lib/resources/query/handlers.d.ts +2 -2
- package/lib/resources/query/options.d.ts +15 -6
- package/lib/resources/resource.d.ts +2 -2
- package/lib/resources/responses/types.d.ts +3 -3
- package/lib/resources/types/options.d.ts +7 -7
- package/lib/schema/parsers/structured-type.d.ts +8 -5
- package/lib/schema/structured-type.d.ts +2 -1
- package/lib/types.d.ts +15 -15
- package/lib/utils/durations.d.ts +1 -1
- package/lib/utils/enums.d.ts +3 -0
- package/lib/utils/types.d.ts +1 -0
- package/package.json +9 -15
- package/esm2020/lib/api.mjs +0 -373
- package/esm2020/lib/cache/cache.mjs +0 -173
- package/esm2020/lib/client.mjs +0 -252
- package/esm2020/lib/models/collection.mjs +0 -861
- package/esm2020/lib/models/model.mjs +0 -507
- package/esm2020/lib/models/options.mjs +0 -1110
- package/esm2020/lib/resources/path/segments.mjs +0 -124
- package/esm2020/lib/resources/query/builder.mjs +0 -588
- package/esm2020/lib/resources/query/expressions/base.mjs +0 -20
- package/esm2020/lib/resources/query/expressions/compute.mjs +0 -39
- package/esm2020/lib/resources/query/expressions/count.mjs +0 -89
- package/esm2020/lib/resources/query/expressions/expand.mjs +0 -115
- package/esm2020/lib/resources/query/expressions/filter.mjs +0 -161
- package/esm2020/lib/resources/query/expressions/orderby.mjs +0 -56
- package/esm2020/lib/resources/query/expressions/search.mjs +0 -122
- package/esm2020/lib/resources/query/expressions/select.mjs +0 -31
- package/esm2020/lib/resources/query/expressions/syntax.mjs +0 -409
- package/esm2020/lib/resources/query/options.mjs +0 -115
- package/esm2020/lib/resources/resource.mjs +0 -251
- package/esm2020/lib/resources/responses/csdl/csdl-annotation.mjs +0 -33
- package/esm2020/lib/resources/responses/metadata.mjs +0 -547
- package/esm2020/lib/schema/parsers/edm.mjs +0 -104
- package/esm2020/lib/schema/parsers/structured-type.mjs +0 -490
- package/esm2020/lib/schema/structured-type.mjs +0 -202
- package/esm2020/lib/services/base.mjs +0 -29
- package/esm2020/lib/utils/enums.mjs +0 -45
- package/esm2020/lib/utils/types.mjs +0 -133
- package/fesm2015/angular-odata.mjs +0 -11811
- package/fesm2015/angular-odata.mjs.map +0 -1
- package/fesm2020/angular-odata.mjs.map +0 -1
- /package/{esm2020 → esm2022}/angular-odata.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/cache/index.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/cache/memory.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/constants.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/index.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/models/index.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/options.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/resources/index.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/resources/path/handlers.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/resources/path/index.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/resources/query/expressions/index.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/resources/query/index.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/resources/responses/index.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/resources/responses/options.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/resources/responses/types.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/resources/types/index.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/resources/types/metadata.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/resources/types/options.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/schema/entity-set.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/schema/index.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/schema/parsers/index.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/services/entity.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/services/index.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/utils/arraybuffers.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/utils/dates.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/utils/index.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/utils/strings.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/utils/urls.mjs +0 -0
- /package/{esm2020 → esm2022}/public-api.mjs +0 -0
|
@@ -1,136 +1,138 @@
|
|
|
1
|
+
import { Parser } from '../../../types';
|
|
1
2
|
import type { QueryCustomType } from '../builder';
|
|
3
|
+
export type Normalize = 'all' | 'right' | 'left' | 'none';
|
|
2
4
|
export interface Renderable {
|
|
3
|
-
render({ aliases, escape, prefix, }: {
|
|
5
|
+
render({ aliases, escape, prefix, parser, }: {
|
|
4
6
|
aliases?: QueryCustomType[];
|
|
5
7
|
escape?: boolean;
|
|
6
8
|
prefix?: string;
|
|
9
|
+
parser?: Parser<any>;
|
|
7
10
|
}): string;
|
|
8
11
|
toString(): string;
|
|
9
12
|
toJSON(): any;
|
|
10
13
|
clone(): any;
|
|
11
14
|
}
|
|
12
|
-
export declare
|
|
13
|
-
|
|
14
|
-
constructor(name?: string);
|
|
15
|
-
static factory<T extends object>(name?: string): T;
|
|
16
|
-
get(target: T, key: string | symbol): any;
|
|
17
|
-
has(target: T, key: string): any;
|
|
18
|
-
}
|
|
19
|
-
export declare function render(value: any, { aliases, normalize, escape, prefix, }?: {
|
|
15
|
+
export declare const FieldFactory: <T extends object>(names?: string[]) => any;
|
|
16
|
+
export declare function render(value: any, { aliases, normalize, escape, prefix, parser, }?: {
|
|
20
17
|
aliases?: QueryCustomType[];
|
|
21
18
|
normalize?: boolean;
|
|
22
19
|
escape?: boolean;
|
|
23
20
|
prefix?: string;
|
|
21
|
+
parser?: Parser<any>;
|
|
24
22
|
}): string | number | boolean | null;
|
|
23
|
+
export declare function resolve(values: any, parser?: Parser<any>): any;
|
|
24
|
+
export declare function encode(values: any, parser?: Parser<any>): any;
|
|
25
25
|
export declare class Function<T> implements Renderable {
|
|
26
26
|
protected name: string;
|
|
27
27
|
protected values: any[];
|
|
28
|
-
protected normalize:
|
|
28
|
+
protected normalize: Normalize;
|
|
29
29
|
protected escape: boolean;
|
|
30
|
-
constructor(name: string, values: any[], normalize
|
|
30
|
+
constructor(name: string, values: any[], normalize: Normalize, escape?: boolean);
|
|
31
31
|
get [Symbol.toStringTag](): string;
|
|
32
32
|
toJSON(): {
|
|
33
33
|
$type: string;
|
|
34
34
|
name: string;
|
|
35
35
|
values: any[];
|
|
36
|
-
normalize:
|
|
36
|
+
normalize: Normalize;
|
|
37
37
|
};
|
|
38
|
-
render({ aliases, escape, prefix, }: {
|
|
38
|
+
render({ aliases, escape, prefix, parser, }: {
|
|
39
39
|
aliases?: QueryCustomType[];
|
|
40
40
|
escape?: boolean;
|
|
41
41
|
prefix?: string;
|
|
42
|
+
parser?: Parser<T>;
|
|
42
43
|
}): string;
|
|
43
44
|
clone(): Function<T>;
|
|
44
45
|
}
|
|
45
46
|
export declare class StringAndCollectionFunctions<T> {
|
|
46
|
-
concat(
|
|
47
|
-
contains(
|
|
48
|
-
endsWith(
|
|
49
|
-
indexOf(
|
|
50
|
-
length(
|
|
51
|
-
startsWith(
|
|
52
|
-
subString(
|
|
47
|
+
concat(left: any, right: any, normalize?: Normalize): Function<T>;
|
|
48
|
+
contains(left: any, right: any, normalize?: Normalize): Function<T>;
|
|
49
|
+
endsWith(left: any, right: any, normalize?: Normalize): Function<T>;
|
|
50
|
+
indexOf(left: any, right: any, normalize?: Normalize): Function<T>;
|
|
51
|
+
length(left: any, normalize?: Normalize): Function<T>;
|
|
52
|
+
startsWith(left: any, right: any, normalize?: Normalize): Function<T>;
|
|
53
|
+
subString(left: any, right: number, length?: number, normalize?: Normalize): Function<T>;
|
|
53
54
|
}
|
|
54
55
|
export declare class CollectionFunctions<T> {
|
|
55
|
-
hasSubset(
|
|
56
|
-
hasSubsequence(
|
|
56
|
+
hasSubset(left: T, right: any, normalize?: Normalize): Function<T>;
|
|
57
|
+
hasSubsequence(left: T, right: any, normalize?: Normalize): Function<T>;
|
|
57
58
|
}
|
|
58
59
|
export declare class StringFunctions<T> {
|
|
59
|
-
matchesPattern(
|
|
60
|
-
toLower(
|
|
61
|
-
toUpper(
|
|
62
|
-
trim(
|
|
60
|
+
matchesPattern(left: any | string, pattern: string, normalize?: Normalize): Function<T>;
|
|
61
|
+
toLower(left: any, normalize?: Normalize): Function<T>;
|
|
62
|
+
toUpper(left: any, normalize?: Normalize): Function<T>;
|
|
63
|
+
trim(left: any, normalize?: Normalize): Function<T>;
|
|
63
64
|
}
|
|
64
65
|
export declare class DateAndTimeFunctions<T> {
|
|
65
|
-
date(
|
|
66
|
-
day(
|
|
67
|
-
fractionalseconds(
|
|
68
|
-
hour(
|
|
69
|
-
maxdatetime(
|
|
70
|
-
mindatetime(
|
|
71
|
-
minute(
|
|
72
|
-
month(
|
|
66
|
+
date(left: any, normalize?: Normalize): Function<T>;
|
|
67
|
+
day(left: any, normalize?: Normalize): Function<T>;
|
|
68
|
+
fractionalseconds(left: any, normalize?: Normalize): Function<T>;
|
|
69
|
+
hour(left: any, normalize?: Normalize): Function<T>;
|
|
70
|
+
maxdatetime(left: any, normalize?: Normalize): Function<T>;
|
|
71
|
+
mindatetime(left: any, normalize?: Normalize): Function<T>;
|
|
72
|
+
minute(left: any, normalize?: Normalize): Function<T>;
|
|
73
|
+
month(left: any, normalize?: Normalize): Function<T>;
|
|
73
74
|
now(): Function<T>;
|
|
74
|
-
second(
|
|
75
|
-
time(
|
|
76
|
-
totaloffsetminutes(
|
|
77
|
-
totalseconds(
|
|
78
|
-
year(
|
|
75
|
+
second(left: any, normalize?: Normalize): Function<T>;
|
|
76
|
+
time(left: any, normalize?: Normalize): Function<T>;
|
|
77
|
+
totaloffsetminutes(left: any, normalize?: Normalize): Function<T>;
|
|
78
|
+
totalseconds(left: any, normalize?: Normalize): Function<T>;
|
|
79
|
+
year(left: any, normalize?: Normalize): Function<T>;
|
|
79
80
|
}
|
|
80
81
|
export declare class ArithmeticFunctions<T> {
|
|
81
|
-
ceiling(
|
|
82
|
-
floor(
|
|
83
|
-
round(
|
|
82
|
+
ceiling(left: T | string, normalize?: Normalize): Function<T>;
|
|
83
|
+
floor(left: T | string, normalize?: Normalize): Function<T>;
|
|
84
|
+
round(left: T | string, normalize?: Normalize): Function<T>;
|
|
84
85
|
}
|
|
85
86
|
export declare class TypeFunctions<T> {
|
|
86
|
-
cast(
|
|
87
|
-
isof(
|
|
87
|
+
cast(left: T | string, right?: string, normalize?: Normalize): Function<T>;
|
|
88
|
+
isof(left: T | string, right?: string, normalize?: Normalize): Function<T>;
|
|
88
89
|
}
|
|
89
90
|
export declare class GeoFunctions<T> {
|
|
90
|
-
geoDistance(
|
|
91
|
-
geoIntersects(
|
|
92
|
-
geoLength(
|
|
91
|
+
geoDistance(left: T, right: string, normalize?: Normalize): Function<T>;
|
|
92
|
+
geoIntersects(left: T, right: string, normalize?: Normalize): Function<T>;
|
|
93
|
+
geoLength(left: T, normalize?: Normalize): Function<T>;
|
|
93
94
|
}
|
|
94
95
|
export declare class ConditionalFunctions<T> {
|
|
95
|
-
case(
|
|
96
|
+
case(left: T | string, right: any, normalize?: Normalize): Function<T>;
|
|
96
97
|
}
|
|
97
98
|
export declare class Operator<T> implements Renderable {
|
|
98
99
|
protected op: string;
|
|
99
100
|
protected values: any[];
|
|
100
|
-
protected normalize:
|
|
101
|
-
constructor(op: string, values: any[], normalize
|
|
101
|
+
protected normalize: Normalize;
|
|
102
|
+
constructor(op: string, values: any[], normalize: Normalize);
|
|
102
103
|
get [Symbol.toStringTag](): string;
|
|
103
104
|
toJSON(): {
|
|
104
105
|
$type: string;
|
|
105
106
|
op: string;
|
|
106
107
|
values: any[];
|
|
107
|
-
normalize:
|
|
108
|
+
normalize: Normalize;
|
|
108
109
|
};
|
|
109
|
-
render({ aliases, escape, prefix, }: {
|
|
110
|
+
render({ aliases, escape, prefix, parser, }: {
|
|
110
111
|
aliases?: QueryCustomType[];
|
|
111
112
|
escape?: boolean;
|
|
112
113
|
prefix?: string;
|
|
114
|
+
parser?: Parser<T>;
|
|
113
115
|
}): string;
|
|
114
116
|
clone(): Operator<unknown>;
|
|
115
117
|
}
|
|
116
118
|
export declare class LogicalOperators<T> {
|
|
117
|
-
eq(left: any, right: any, normalize?:
|
|
118
|
-
ne(left: any, right: any, normalize?:
|
|
119
|
-
gt(left: any, right: any, normalize?:
|
|
120
|
-
ge(left: any, right: any, normalize?:
|
|
121
|
-
lt(left: any, right: any, normalize?:
|
|
122
|
-
le(left: any, right: any, normalize?:
|
|
123
|
-
not(
|
|
124
|
-
has(left: any, right: any, normalize?:
|
|
125
|
-
in(left: any, right: any, normalize?:
|
|
119
|
+
eq(left: any, right: any, normalize?: Normalize): Operator<unknown>;
|
|
120
|
+
ne(left: any, right: any, normalize?: Normalize): Operator<unknown>;
|
|
121
|
+
gt(left: any, right: any, normalize?: Normalize): Operator<unknown>;
|
|
122
|
+
ge(left: any, right: any, normalize?: Normalize): Operator<unknown>;
|
|
123
|
+
lt(left: any, right: any, normalize?: Normalize): Operator<unknown>;
|
|
124
|
+
le(left: any, right: any, normalize?: Normalize): Operator<unknown>;
|
|
125
|
+
not(left: any, normalize?: Normalize): Operator<T>;
|
|
126
|
+
has(left: any, right: any, normalize?: Normalize): Operator<unknown>;
|
|
127
|
+
in(left: any, right: any, normalize?: Normalize): Operator<unknown>;
|
|
126
128
|
}
|
|
127
129
|
export declare class ArithmeticOperators<T> {
|
|
128
|
-
add(left: any, right: any, normalize?:
|
|
129
|
-
sub(left: any, right: any, normalize?:
|
|
130
|
-
mul(left: any, right: any, normalize?:
|
|
131
|
-
div(left: any, right: any, normalize?:
|
|
132
|
-
mod(left: any, right: any, normalize?:
|
|
133
|
-
neg(value: any, normalize?:
|
|
130
|
+
add(left: any, right: any, normalize?: Normalize): Operator<T>;
|
|
131
|
+
sub(left: any, right: any, normalize?: Normalize): Operator<unknown>;
|
|
132
|
+
mul(left: any, right: any, normalize?: Normalize): Operator<unknown>;
|
|
133
|
+
div(left: any, right: any, normalize?: Normalize): Operator<unknown>;
|
|
134
|
+
mod(left: any, right: any, normalize?: Normalize): Operator<unknown>;
|
|
135
|
+
neg(value: any, normalize?: Normalize): Operator<unknown>;
|
|
134
136
|
}
|
|
135
137
|
export declare class Grouping<T> implements Renderable {
|
|
136
138
|
protected group: Renderable;
|
|
@@ -140,10 +142,11 @@ export declare class Grouping<T> implements Renderable {
|
|
|
140
142
|
$type: string;
|
|
141
143
|
group: any;
|
|
142
144
|
};
|
|
143
|
-
render({ aliases, escape, prefix, }: {
|
|
145
|
+
render({ aliases, escape, prefix, parser, }: {
|
|
144
146
|
aliases?: QueryCustomType[];
|
|
145
147
|
escape?: boolean;
|
|
146
148
|
prefix?: string;
|
|
149
|
+
parser?: Parser<T>;
|
|
147
150
|
}): string;
|
|
148
151
|
clone(): Grouping<unknown>;
|
|
149
152
|
}
|
|
@@ -159,16 +162,17 @@ export declare class Lambda<T> implements Renderable {
|
|
|
159
162
|
values: any[];
|
|
160
163
|
alias: string | undefined;
|
|
161
164
|
};
|
|
162
|
-
render({ aliases, escape, prefix, }: {
|
|
165
|
+
render({ aliases, escape, prefix, parser, }: {
|
|
163
166
|
aliases?: QueryCustomType[];
|
|
164
167
|
escape?: boolean;
|
|
165
168
|
prefix?: string;
|
|
169
|
+
parser?: Parser<T>;
|
|
166
170
|
}): string;
|
|
167
171
|
clone(): Lambda<unknown>;
|
|
168
172
|
}
|
|
169
173
|
export declare class LambdaOperators<T> {
|
|
170
|
-
any(
|
|
171
|
-
all(
|
|
174
|
+
any(left: T, right: any, alias?: string): Lambda<unknown>;
|
|
175
|
+
all(left: T, right: any, alias?: string): Lambda<unknown>;
|
|
172
176
|
}
|
|
173
177
|
export declare class ODataOperators<T> {
|
|
174
178
|
}
|
|
@@ -126,7 +126,7 @@ export declare class ODataQueryOptionsHandler<T> {
|
|
|
126
126
|
* If opts is given then set te value as new value for $select.
|
|
127
127
|
* @param opts Select<T> value or builder function for SelectExpression<T>
|
|
128
128
|
*/
|
|
129
|
-
select(opts: SelectExpressionBuilder<T>): SelectExpression<T>;
|
|
129
|
+
select(opts: (builder: SelectExpressionBuilder<T>, current?: SelectExpression<T>) => SelectExpression<T>): SelectExpression<T>;
|
|
130
130
|
select(opts: Select<T>): ODataQueryOptionHandler<T>;
|
|
131
131
|
select(): ODataQueryOptionHandler<T>;
|
|
132
132
|
/**
|
|
@@ -134,7 +134,7 @@ export declare class ODataQueryOptionsHandler<T> {
|
|
|
134
134
|
* If opts is given then set te value as new value for $expand.
|
|
135
135
|
* @param opts Expand<T> value or builder function for ExpandExpression<T>
|
|
136
136
|
*/
|
|
137
|
-
expand(opts: ExpandExpressionBuilder<T>): ExpandExpression<T>;
|
|
137
|
+
expand(opts: (builder: ExpandExpressionBuilder<T>, current?: ExpandExpression<T>) => ExpandExpression<T>): ExpandExpression<T>;
|
|
138
138
|
expand(opts: Expand<T>): ODataQueryOptionHandler<T>;
|
|
139
139
|
expand(): ODataQueryOptionHandler<T>;
|
|
140
140
|
/**
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { QueryOption } from '../../types';
|
|
1
|
+
import { Parser, QueryOption } from '../../types';
|
|
2
2
|
import { Expand, Filter, OrderBy, Select, Transform } from './builder';
|
|
3
3
|
import { ComputeExpression, Expression, FilterExpression, OrderByExpression, SearchExpression } from './expressions';
|
|
4
4
|
import { ExpandExpression } from './expressions/expand';
|
|
5
5
|
import { SelectExpression } from './expressions/select';
|
|
6
6
|
import { ODataQueryOptionHandler } from './handlers';
|
|
7
|
-
export
|
|
7
|
+
export type ODataQueryArguments<T> = {
|
|
8
8
|
[QueryOption.select]?: Select<T> | SelectExpression<T> | null;
|
|
9
9
|
[QueryOption.expand]?: Expand<T> | ExpandExpression<T> | null;
|
|
10
10
|
[QueryOption.compute]?: string | ComputeExpression<T> | null;
|
|
@@ -24,10 +24,19 @@ export declare class ODataQueryOptions<T> {
|
|
|
24
24
|
constructor(values?: Map<QueryOption, any> | {
|
|
25
25
|
[name: string]: any;
|
|
26
26
|
});
|
|
27
|
-
pathAndParams(escape
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
pathAndParams({ escape, parser, }?: {
|
|
28
|
+
escape?: boolean;
|
|
29
|
+
parser?: Parser<T>;
|
|
30
|
+
}): [
|
|
31
|
+
string,
|
|
32
|
+
{
|
|
33
|
+
[name: string]: any;
|
|
34
|
+
}
|
|
35
|
+
];
|
|
36
|
+
toString({ escape, parser, }?: {
|
|
37
|
+
escape?: boolean;
|
|
38
|
+
parser?: Parser<T>;
|
|
39
|
+
}): string;
|
|
31
40
|
toJSON(): {};
|
|
32
41
|
toQueryArguments(): ODataQueryArguments<T>;
|
|
33
42
|
clone<O>(): ODataQueryOptions<O>;
|
|
@@ -8,7 +8,7 @@ import { ODataPathSegments, ODataPathSegmentsHandler } from './path';
|
|
|
8
8
|
import { ODataQueryOptions, ODataQueryOptionsHandler, QueryCustomType } from './query';
|
|
9
9
|
import { ODataEntitiesAnnotations, ODataEntityAnnotations } from './responses/index';
|
|
10
10
|
import { ODataOptions } from './types';
|
|
11
|
-
export
|
|
11
|
+
export type EntityKey<T> = {
|
|
12
12
|
readonly [P in keyof T]?: T[P];
|
|
13
13
|
} | QueryCustomType | string | number;
|
|
14
14
|
export declare class ODataResource<T> {
|
|
@@ -56,7 +56,7 @@ export declare class ODataResource<T> {
|
|
|
56
56
|
[name: string]: any;
|
|
57
57
|
}];
|
|
58
58
|
endpointUrl(params?: boolean): string;
|
|
59
|
-
toString(): string;
|
|
59
|
+
toString(escape?: boolean): string;
|
|
60
60
|
clone(): ODataResource<T>;
|
|
61
61
|
private __parser;
|
|
62
62
|
deserialize(value: any, options?: ParserOptions): any;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { ODataEntitiesAnnotations, ODataEntityAnnotations, ODataPropertyAnnotations } from './annotations';
|
|
2
|
-
export
|
|
2
|
+
export type ODataEntity<T> = {
|
|
3
3
|
entity: T | null;
|
|
4
4
|
annots: ODataEntityAnnotations<T>;
|
|
5
5
|
};
|
|
6
|
-
export
|
|
6
|
+
export type ODataEntities<T> = {
|
|
7
7
|
entities: T[] | null;
|
|
8
8
|
annots: ODataEntitiesAnnotations<T>;
|
|
9
9
|
};
|
|
10
|
-
export
|
|
10
|
+
export type ODataProperty<T> = {
|
|
11
11
|
property: T | null;
|
|
12
12
|
annots: ODataPropertyAnnotations<T>;
|
|
13
13
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { HttpContext, HttpHeaders, HttpParams } from '@angular/common/http';
|
|
2
2
|
import { FetchPolicy } from '../../types';
|
|
3
3
|
import { ODataQueryArguments } from '../query';
|
|
4
|
-
export
|
|
4
|
+
export type ODataOptions = {
|
|
5
5
|
etag?: string;
|
|
6
6
|
context?: HttpContext;
|
|
7
7
|
headers?: HttpHeaders | {
|
|
@@ -14,18 +14,18 @@ export declare type ODataOptions = {
|
|
|
14
14
|
withCredentials?: boolean;
|
|
15
15
|
fetchPolicy?: FetchPolicy;
|
|
16
16
|
};
|
|
17
|
-
export
|
|
17
|
+
export type ODataEntityOptions = ODataOptions & {
|
|
18
18
|
responseType?: 'entity';
|
|
19
19
|
};
|
|
20
|
-
export
|
|
20
|
+
export type ODataEntitiesOptions = ODataOptions & {
|
|
21
21
|
responseType?: 'entities';
|
|
22
22
|
withCount?: boolean;
|
|
23
23
|
};
|
|
24
|
-
export
|
|
24
|
+
export type ODataPropertyOptions = ODataOptions & {
|
|
25
25
|
responseType?: 'property';
|
|
26
26
|
};
|
|
27
|
-
export
|
|
28
|
-
export
|
|
29
|
-
export
|
|
27
|
+
export type ODataQueryArgumentsOptions<T> = ODataOptions & ODataQueryArguments<T>;
|
|
28
|
+
export type ODataActionOptions<T> = ODataQueryArgumentsOptions<T>;
|
|
29
|
+
export type ODataFunctionOptions<T> = ODataQueryArgumentsOptions<T> & {
|
|
30
30
|
alias?: boolean;
|
|
31
31
|
};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { ParserOptions, Parser, StructuredTypeConfig, StructuredTypeFieldConfig, FieldParser, EdmType } from '../../types';
|
|
2
2
|
import { ODataAnnotatable } from '../annotation';
|
|
3
3
|
import { ODataEnumTypeParser } from './enum-type';
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
type JsonSchemaSelect<T> = Array<keyof T>;
|
|
5
|
+
type JsonSchemaCustom<T> = {
|
|
6
6
|
[P in keyof T]?: (schema: any, field: ODataStructuredTypeFieldParser<T[P]>) => any;
|
|
7
7
|
};
|
|
8
|
-
|
|
8
|
+
type JsonSchemaExpand<T> = {
|
|
9
9
|
[P in keyof T]?: JsonSchemaOptions<T[P]>;
|
|
10
10
|
};
|
|
11
|
-
|
|
11
|
+
type JsonSchemaRequired<T> = {
|
|
12
12
|
[P in keyof T]?: boolean;
|
|
13
13
|
};
|
|
14
|
-
export
|
|
14
|
+
export type JsonSchemaOptions<T> = {
|
|
15
15
|
select?: JsonSchemaSelect<T>;
|
|
16
16
|
custom?: JsonSchemaCustom<T>;
|
|
17
17
|
expand?: JsonSchemaExpand<T>;
|
|
@@ -98,6 +98,7 @@ export declare class ODataStructuredTypeParser<T> extends ODataAnnotatable imple
|
|
|
98
98
|
titleize(term?: string | RegExp): string;
|
|
99
99
|
isTypeOf(type: string): boolean;
|
|
100
100
|
isSubtypeOf(type: string): boolean;
|
|
101
|
+
isOpenType(): boolean;
|
|
101
102
|
findChildParser(predicate: (p: ODataStructuredTypeParser<any>) => boolean): ODataStructuredTypeParser<any> | undefined;
|
|
102
103
|
childParser(predicate: (p: ODataStructuredTypeParser<any>) => boolean): Parser<any>;
|
|
103
104
|
deserialize(value: any, options?: ParserOptions): T;
|
|
@@ -126,6 +127,8 @@ export declare class ODataStructuredTypeParser<T> extends ODataAnnotatable imple
|
|
|
126
127
|
keys({ include_parents, }: {
|
|
127
128
|
include_parents: boolean;
|
|
128
129
|
}): ODataEntityTypeKey[];
|
|
130
|
+
isEntityType(): boolean;
|
|
131
|
+
isComplexType(): boolean;
|
|
129
132
|
/**
|
|
130
133
|
* Find the field parser for the given field name.
|
|
131
134
|
* @param name Name of the field
|
|
@@ -6,7 +6,6 @@ import { JsonSchemaOptions, ODataEntityTypeKey, ODataStructuredTypeFieldParser,
|
|
|
6
6
|
import { ODataSchema } from './schema';
|
|
7
7
|
export declare class ODataStructuredType<T> extends ODataSchemaElement {
|
|
8
8
|
base?: string;
|
|
9
|
-
open: boolean;
|
|
10
9
|
parent?: ODataStructuredType<any>;
|
|
11
10
|
children: ODataStructuredType<any>[];
|
|
12
11
|
model?: typeof ODataModel;
|
|
@@ -41,6 +40,8 @@ export declare class ODataStructuredType<T> extends ODataSchemaElement {
|
|
|
41
40
|
*/
|
|
42
41
|
isCompoundKey(): boolean;
|
|
43
42
|
isOpenType(): boolean;
|
|
43
|
+
isEntityType(): boolean;
|
|
44
|
+
isComplexType(): boolean;
|
|
44
45
|
/**
|
|
45
46
|
* Find the field parser for the given field name.
|
|
46
47
|
* @param name Name of the field
|
package/lib/types.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Observable } from 'rxjs';
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
2
|
+
export type ODataVersion = '2.0' | '3.0' | '4.0';
|
|
3
|
+
export type FetchPolicy = 'cache-first' | 'cache-and-network' | 'network-only' | 'no-cache' | 'cache-only';
|
|
4
|
+
export type ODataMetadataType = 'minimal' | 'full' | 'none';
|
|
5
|
+
export type CacheCacheability = 'public' | 'private' | 'no-cache' | 'no-store';
|
|
6
6
|
export declare enum PathSegment {
|
|
7
7
|
batch = "batch",
|
|
8
8
|
metadata = "metadata",
|
|
@@ -134,7 +134,7 @@ export interface Cache {
|
|
|
134
134
|
put<T>(key: string, payload: T, ...opts: any[]): void;
|
|
135
135
|
get<T>(key: string, ...opts: any[]): T | undefined;
|
|
136
136
|
}
|
|
137
|
-
export
|
|
137
|
+
export type ApiConfig = {
|
|
138
138
|
serviceRootUrl: string;
|
|
139
139
|
name?: string;
|
|
140
140
|
version?: ODataVersion;
|
|
@@ -148,7 +148,7 @@ export declare type ApiConfig = {
|
|
|
148
148
|
};
|
|
149
149
|
schemas?: SchemaConfig[];
|
|
150
150
|
};
|
|
151
|
-
export
|
|
151
|
+
export type AnnotationConfig = {
|
|
152
152
|
term: string;
|
|
153
153
|
string?: string;
|
|
154
154
|
bool?: boolean;
|
|
@@ -156,7 +156,7 @@ export declare type AnnotationConfig = {
|
|
|
156
156
|
permissions?: string[];
|
|
157
157
|
properties?: string[];
|
|
158
158
|
};
|
|
159
|
-
export
|
|
159
|
+
export type SchemaConfig = {
|
|
160
160
|
namespace: string;
|
|
161
161
|
alias?: string;
|
|
162
162
|
annotations?: AnnotationConfig[];
|
|
@@ -165,16 +165,16 @@ export declare type SchemaConfig = {
|
|
|
165
165
|
callables?: CallableConfig[];
|
|
166
166
|
containers?: EntityContainerConfig[];
|
|
167
167
|
};
|
|
168
|
-
export
|
|
168
|
+
export type EntityContainerConfig = {
|
|
169
169
|
name: string;
|
|
170
170
|
annotations?: AnnotationConfig[];
|
|
171
171
|
entitySets?: EntitySetConfig[];
|
|
172
172
|
};
|
|
173
|
-
export
|
|
173
|
+
export type EnumTypeFieldConfig<E> = {
|
|
174
174
|
value: E;
|
|
175
175
|
annotations?: AnnotationConfig[];
|
|
176
176
|
};
|
|
177
|
-
export
|
|
177
|
+
export type EnumTypeConfig<E> = {
|
|
178
178
|
name: string;
|
|
179
179
|
flags?: boolean;
|
|
180
180
|
annotations?: AnnotationConfig[];
|
|
@@ -187,7 +187,7 @@ export declare type EnumTypeConfig<E> = {
|
|
|
187
187
|
[member: string]: EnumTypeFieldConfig<E>;
|
|
188
188
|
};
|
|
189
189
|
};
|
|
190
|
-
export
|
|
190
|
+
export type StructuredTypeFieldConfig = {
|
|
191
191
|
type: string;
|
|
192
192
|
default?: any;
|
|
193
193
|
maxLength?: number;
|
|
@@ -205,7 +205,7 @@ export declare type StructuredTypeFieldConfig = {
|
|
|
205
205
|
referential?: string;
|
|
206
206
|
referenced?: string;
|
|
207
207
|
};
|
|
208
|
-
export
|
|
208
|
+
export type StructuredTypeConfig<T> = {
|
|
209
209
|
name: string;
|
|
210
210
|
base?: string;
|
|
211
211
|
open?: boolean;
|
|
@@ -224,12 +224,12 @@ export declare type StructuredTypeConfig<T> = {
|
|
|
224
224
|
[P in keyof T]?: StructuredTypeFieldConfig;
|
|
225
225
|
};
|
|
226
226
|
};
|
|
227
|
-
export
|
|
227
|
+
export type Parameter = {
|
|
228
228
|
type: string;
|
|
229
229
|
nullable?: boolean;
|
|
230
230
|
collection?: boolean;
|
|
231
231
|
};
|
|
232
|
-
export
|
|
232
|
+
export type CallableConfig = {
|
|
233
233
|
name: string;
|
|
234
234
|
entitySetPath?: string;
|
|
235
235
|
bound?: boolean;
|
|
@@ -242,7 +242,7 @@ export declare type CallableConfig = {
|
|
|
242
242
|
collection?: boolean;
|
|
243
243
|
};
|
|
244
244
|
};
|
|
245
|
-
export
|
|
245
|
+
export type EntitySetConfig = {
|
|
246
246
|
name: string;
|
|
247
247
|
entityType: string;
|
|
248
248
|
service: {
|
package/lib/utils/durations.d.ts
CHANGED
package/lib/utils/enums.d.ts
CHANGED
package/lib/utils/types.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "angular-odata",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.124.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Client side OData typescript library for Angular",
|
|
6
6
|
"repository": {
|
|
@@ -25,17 +25,14 @@
|
|
|
25
25
|
"homepage": "https://github.com/diegomvh/angular-odata",
|
|
26
26
|
"private": false,
|
|
27
27
|
"peerDependencies": {
|
|
28
|
-
"@angular/common": ">=
|
|
29
|
-
"@angular/core": ">=
|
|
28
|
+
"@angular/common": ">=14.0.0",
|
|
29
|
+
"@angular/core": ">=14.0.0"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"tslib": "^2.3.0"
|
|
33
33
|
},
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"esm2020": "esm2020/angular-odata.mjs",
|
|
37
|
-
"fesm2020": "fesm2020/angular-odata.mjs",
|
|
38
|
-
"fesm2015": "fesm2015/angular-odata.mjs",
|
|
34
|
+
"sideEffects": false,
|
|
35
|
+
"module": "fesm2022/angular-odata.mjs",
|
|
39
36
|
"typings": "index.d.ts",
|
|
40
37
|
"exports": {
|
|
41
38
|
"./package.json": {
|
|
@@ -43,12 +40,9 @@
|
|
|
43
40
|
},
|
|
44
41
|
".": {
|
|
45
42
|
"types": "./index.d.ts",
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"node": "./fesm2015/angular-odata.mjs",
|
|
50
|
-
"default": "./fesm2020/angular-odata.mjs"
|
|
43
|
+
"esm2022": "./esm2022/angular-odata.mjs",
|
|
44
|
+
"esm": "./esm2022/angular-odata.mjs",
|
|
45
|
+
"default": "./fesm2022/angular-odata.mjs"
|
|
51
46
|
}
|
|
52
|
-
}
|
|
53
|
-
"sideEffects": false
|
|
47
|
+
}
|
|
54
48
|
}
|