angular-odata 0.121.0 → 0.123.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/client.mjs +253 -0
- package/esm2022/lib/models/collection.mjs +862 -0
- package/esm2022/lib/models/model.mjs +519 -0
- package/esm2022/lib/models/options.mjs +1110 -0
- package/esm2022/lib/module.mjs +43 -0
- package/esm2022/lib/resources/query/builder.mjs +619 -0
- package/{esm2020 → esm2022}/lib/resources/query/expressions/base.mjs +1 -1
- package/{esm2020 → esm2022}/lib/resources/query/expressions/compute.mjs +1 -1
- package/{esm2020 → esm2022}/lib/resources/query/expressions/count.mjs +1 -1
- package/esm2022/lib/resources/query/expressions/expand.mjs +119 -0
- package/esm2022/lib/resources/query/expressions/filter.mjs +161 -0
- package/{esm2020 → esm2022}/lib/resources/query/expressions/orderby.mjs +1 -1
- package/{esm2020 → esm2022}/lib/resources/query/expressions/search.mjs +1 -1
- package/{esm2020 → esm2022}/lib/resources/query/expressions/select.mjs +1 -1
- package/esm2022/lib/resources/query/expressions/syntax.mjs +409 -0
- package/{esm2020 → esm2022}/lib/resources/query/handlers.mjs +1 -1
- package/esm2022/lib/resources/query/options.mjs +115 -0
- package/esm2022/lib/resources/responses/metadata.mjs +548 -0
- package/esm2022/lib/schema/parsers/edm.mjs +99 -0
- package/{esm2020 → esm2022}/lib/schema/parsers/enum-type.mjs +2 -2
- package/esm2022/lib/services/factory.mjs +34 -0
- package/esm2022/lib/utils/enums.mjs +61 -0
- package/{fesm2020 → fesm2022}/angular-odata.mjs +643 -614
- package/fesm2022/angular-odata.mjs.map +1 -0
- package/lib/helper.d.ts +1 -1
- package/lib/models/model.d.ts +7 -16
- package/lib/models/options.d.ts +51 -33
- package/lib/resources/path/segments.d.ts +1 -1
- package/lib/resources/query/builder.d.ts +21 -20
- package/lib/resources/query/expressions/base.d.ts +3 -3
- package/lib/resources/query/expressions/compute.d.ts +2 -2
- package/lib/resources/query/expressions/count.d.ts +3 -3
- package/lib/resources/query/expressions/expand.d.ts +13 -12
- package/lib/resources/query/expressions/filter.d.ts +15 -15
- package/lib/resources/query/expressions/orderby.d.ts +3 -3
- package/lib/resources/query/expressions/search.d.ts +3 -3
- package/lib/resources/query/expressions/select.d.ts +2 -2
- package/lib/resources/query/expressions/syntax.d.ts +59 -58
- package/lib/resources/query/handlers.d.ts +2 -2
- package/lib/resources/query/options.d.ts +1 -1
- package/lib/resources/resource.d.ts +1 -1
- 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 +5 -5
- package/lib/types.d.ts +15 -15
- package/lib/utils/durations.d.ts +1 -1
- package/lib/utils/enums.d.ts +3 -0
- package/package.json +9 -15
- package/esm2020/lib/client.mjs +0 -252
- package/esm2020/lib/models/collection.mjs +0 -857
- package/esm2020/lib/models/model.mjs +0 -518
- package/esm2020/lib/models/options.mjs +0 -1130
- package/esm2020/lib/module.mjs +0 -42
- package/esm2020/lib/resources/query/builder.mjs +0 -588
- 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/syntax.mjs +0 -409
- package/esm2020/lib/resources/query/options.mjs +0 -115
- package/esm2020/lib/resources/responses/metadata.mjs +0 -547
- package/esm2020/lib/schema/parsers/edm.mjs +0 -104
- package/esm2020/lib/services/factory.mjs +0 -33
- package/esm2020/lib/utils/enums.mjs +0 -45
- package/fesm2015/angular-odata.mjs +0 -11841
- 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/api.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/cache/cache.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/cache/storage.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/constants.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/helper.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/index.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/loaders.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/path/segments.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/request.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/resources/resource.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/resources/responses/annotations.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/resources/responses/csdl/csdl-annotation.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/resources/responses/csdl/csdl-entity-container.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/resources/responses/csdl/csdl-entity-set.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/resources/responses/csdl/csdl-enum-type.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/resources/responses/csdl/csdl-function-action.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/resources/responses/csdl/csdl-navigation-property-binding.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/resources/responses/csdl/csdl-reference.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/resources/responses/csdl/csdl-schema.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/resources/responses/csdl/csdl-singleton.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/resources/responses/csdl/csdl-structural-property.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/resources/responses/csdl/csdl-structured-type.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/resources/responses/csdl/csdl-type-definition.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/response.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/resources/responses/types.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/resources/types/action.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/resources/types/batch.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/resources/types/count.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/resources/types/entity-set.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/resources/types/entity.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/resources/types/function.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/resources/types/index.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/resources/types/media.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/resources/types/metadata.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/resources/types/navigation-property.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/resources/types/options.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/resources/types/property.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/resources/types/reference.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/resources/types/singleton.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/resources/types/value.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/schema/annotation.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/schema/callable.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/schema/element.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/schema/entity-container.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/schema/entity-set.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/schema/enum-type.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/schema/index.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/schema/parsers/callable.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/schema/parsers/index.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/schema/parsers/structured-type.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/schema/schema.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/schema/structured-type.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/services/base.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/services/entity-set.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/services/singleton.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/settings.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/types.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/utils/arraybuffers.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/utils/arrays.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/utils/dates.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/utils/durations.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/utils/http.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/utils/index.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/utils/objects.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/utils/odata.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/utils/strings.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/utils/types.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/utils/urls.mjs +0 -0
- /package/{esm2020 → esm2022}/public-api.mjs +0 -0
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { QueryCustomType } from '../builder';
|
|
2
|
+
export type Normalize = 'all' | 'right' | 'left' | 'none';
|
|
2
3
|
export interface Renderable {
|
|
3
4
|
render({ aliases, escape, prefix, }: {
|
|
4
5
|
aliases?: QueryCustomType[];
|
|
@@ -25,15 +26,15 @@ export declare function render(value: any, { aliases, normalize, escape, prefix,
|
|
|
25
26
|
export declare class Function<T> implements Renderable {
|
|
26
27
|
protected name: string;
|
|
27
28
|
protected values: any[];
|
|
28
|
-
protected normalize:
|
|
29
|
+
protected normalize: Normalize;
|
|
29
30
|
protected escape: boolean;
|
|
30
|
-
constructor(name: string, values: any[], normalize
|
|
31
|
+
constructor(name: string, values: any[], normalize: Normalize, escape?: boolean);
|
|
31
32
|
get [Symbol.toStringTag](): string;
|
|
32
33
|
toJSON(): {
|
|
33
34
|
$type: string;
|
|
34
35
|
name: string;
|
|
35
36
|
values: any[];
|
|
36
|
-
normalize:
|
|
37
|
+
normalize: Normalize;
|
|
37
38
|
};
|
|
38
39
|
render({ aliases, escape, prefix, }: {
|
|
39
40
|
aliases?: QueryCustomType[];
|
|
@@ -43,68 +44,68 @@ export declare class Function<T> implements Renderable {
|
|
|
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
110
|
render({ aliases, escape, prefix, }: {
|
|
110
111
|
aliases?: QueryCustomType[];
|
|
@@ -114,23 +115,23 @@ export declare class Operator<T> implements Renderable {
|
|
|
114
115
|
clone(): Operator<unknown>;
|
|
115
116
|
}
|
|
116
117
|
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?:
|
|
118
|
+
eq(left: any, right: any, normalize?: Normalize): Operator<unknown>;
|
|
119
|
+
ne(left: any, right: any, normalize?: Normalize): Operator<unknown>;
|
|
120
|
+
gt(left: any, right: any, normalize?: Normalize): Operator<unknown>;
|
|
121
|
+
ge(left: any, right: any, normalize?: Normalize): Operator<unknown>;
|
|
122
|
+
lt(left: any, right: any, normalize?: Normalize): Operator<unknown>;
|
|
123
|
+
le(left: any, right: any, normalize?: Normalize): Operator<unknown>;
|
|
124
|
+
not(left: any, normalize?: Normalize): Operator<T>;
|
|
125
|
+
has(left: any, right: any, normalize?: Normalize): Operator<unknown>;
|
|
126
|
+
in(left: any, right: any, normalize?: Normalize): Operator<unknown>;
|
|
126
127
|
}
|
|
127
128
|
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?:
|
|
129
|
+
add(left: any, right: any, normalize?: Normalize): Operator<T>;
|
|
130
|
+
sub(left: any, right: any, normalize?: Normalize): Operator<unknown>;
|
|
131
|
+
mul(left: any, right: any, normalize?: Normalize): Operator<unknown>;
|
|
132
|
+
div(left: any, right: any, normalize?: Normalize): Operator<unknown>;
|
|
133
|
+
mod(left: any, right: any, normalize?: Normalize): Operator<unknown>;
|
|
134
|
+
neg(value: any, normalize?: Normalize): Operator<unknown>;
|
|
134
135
|
}
|
|
135
136
|
export declare class Grouping<T> implements Renderable {
|
|
136
137
|
protected group: Renderable;
|
|
@@ -167,8 +168,8 @@ export declare class Lambda<T> implements Renderable {
|
|
|
167
168
|
clone(): Lambda<unknown>;
|
|
168
169
|
}
|
|
169
170
|
export declare class LambdaOperators<T> {
|
|
170
|
-
any(
|
|
171
|
-
all(
|
|
171
|
+
any(left: T, right: any, alias?: string): Lambda<unknown>;
|
|
172
|
+
all(left: T, right: any, alias?: string): Lambda<unknown>;
|
|
172
173
|
}
|
|
173
174
|
export declare class ODataOperators<T> {
|
|
174
175
|
}
|
|
@@ -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
|
/**
|
|
@@ -4,7 +4,7 @@ import { ComputeExpression, Expression, FilterExpression, OrderByExpression, Sea
|
|
|
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;
|
|
@@ -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> {
|
|
@@ -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>;
|
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "angular-odata",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.123.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
|
}
|