angular-odata 0.99.5 → 0.101.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/esm2020/lib/api.mjs +66 -56
- package/esm2020/lib/cache/cache.mjs +56 -4
- package/esm2020/lib/cache/memory.mjs +14 -4
- package/esm2020/lib/cache/storage.mjs +21 -2
- package/esm2020/lib/client.mjs +3 -3
- package/esm2020/lib/constants.mjs +2 -1
- package/esm2020/lib/helper.mjs +91 -86
- package/esm2020/lib/models/collection.mjs +102 -41
- package/esm2020/lib/models/model.mjs +20 -5
- package/esm2020/lib/models/options.mjs +159 -114
- package/esm2020/lib/module.mjs +4 -4
- package/esm2020/lib/options.mjs +6 -10
- package/esm2020/lib/resources/query/builder.mjs +4 -7
- package/esm2020/lib/resources/query/expressions/syntax.mjs +1 -1
- package/esm2020/lib/resources/query/handlers.mjs +97 -18
- package/esm2020/lib/resources/query/options.mjs +41 -35
- package/esm2020/lib/resources/resource.mjs +33 -68
- package/esm2020/lib/resources/responses/annotations.mjs +6 -6
- package/esm2020/lib/resources/responses/metadata.mjs +1 -1
- package/esm2020/lib/resources/responses/options.mjs +1 -2
- package/esm2020/lib/resources/responses/response.mjs +4 -4
- package/esm2020/lib/resources/types/batch.mjs +108 -97
- package/esm2020/lib/resources/types/entity-set.mjs +1 -1
- package/esm2020/lib/resources/types/function.mjs +9 -1
- package/esm2020/lib/schema/callable.mjs +6 -2
- package/esm2020/lib/schema/enum-type.mjs +5 -2
- package/esm2020/lib/schema/parsers/callable.mjs +11 -20
- package/esm2020/lib/schema/parsers/enum-type.mjs +16 -18
- package/esm2020/lib/schema/parsers/structured-type.mjs +15 -27
- package/esm2020/lib/schema/structured-type.mjs +10 -11
- package/esm2020/lib/services/factory.mjs +3 -3
- package/esm2020/lib/types.mjs +1 -1
- package/esm2020/lib/utils/arrays.mjs +10 -0
- package/esm2020/lib/utils/enums.mjs +3 -3
- package/esm2020/lib/utils/objects.mjs +10 -5
- package/esm2020/lib/utils/types.mjs +5 -1
- package/esm2020/lib/utils/urls.mjs +2 -2
- package/fesm2015/angular-odata.mjs +3220 -2938
- package/fesm2015/angular-odata.mjs.map +1 -1
- package/fesm2020/angular-odata.mjs +3229 -2946
- package/fesm2020/angular-odata.mjs.map +1 -1
- package/lib/cache/cache.d.ts +62 -1
- package/lib/cache/memory.d.ts +10 -0
- package/lib/cache/storage.d.ts +19 -0
- package/lib/constants.d.ts +1 -0
- package/lib/helper.d.ts +28 -57
- package/lib/models/collection.d.ts +9 -5
- package/lib/models/model.d.ts +9 -12
- package/lib/models/options.d.ts +11 -10
- package/lib/options.d.ts +5 -9
- package/lib/resources/query/builder.d.ts +1 -1
- package/lib/resources/query/handlers.d.ts +126 -3
- package/lib/resources/query/options.d.ts +7 -9
- package/lib/resources/resource.d.ts +5 -4
- package/lib/resources/responses/annotations.d.ts +12 -18
- package/lib/resources/responses/options.d.ts +2 -3
- package/lib/resources/responses/response.d.ts +1 -3
- package/lib/resources/types/batch.d.ts +8 -11
- package/lib/resources/types/entity-set.d.ts +1 -1
- package/lib/resources/types/function.d.ts +3 -0
- package/lib/schema/callable.d.ts +4 -4
- package/lib/schema/enum-type.d.ts +4 -4
- package/lib/schema/parsers/callable.d.ts +13 -11
- package/lib/schema/parsers/enum-type.d.ts +9 -7
- package/lib/schema/parsers/structured-type.d.ts +11 -11
- package/lib/schema/structured-type.d.ts +4 -4
- package/lib/types.d.ts +10 -12
- package/lib/utils/arrays.d.ts +3 -0
- package/lib/utils/enums.d.ts +2 -2
- package/lib/utils/types.d.ts +1 -0
- package/package.json +3 -3
|
@@ -7,25 +7,80 @@ import type { ODataQueryArguments, ODataQueryOptions } from './options';
|
|
|
7
7
|
export declare class ODataQueryOptionHandler<T> {
|
|
8
8
|
private o;
|
|
9
9
|
private n;
|
|
10
|
-
constructor(o:
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
constructor(o: Map<QueryOptionNames, any>, n: QueryOptionNames);
|
|
11
|
+
/**
|
|
12
|
+
* The name of the managed odata query option.
|
|
13
|
+
*/
|
|
13
14
|
get name(): QueryOptionNames;
|
|
15
|
+
/**
|
|
16
|
+
* Converts the managed odata query option to a json object.
|
|
17
|
+
* @returns {any}
|
|
18
|
+
*/
|
|
14
19
|
toJSON(): any;
|
|
20
|
+
/**
|
|
21
|
+
* Returns a boolean indicating if the managed odata query option is empty.
|
|
22
|
+
* @returns True if the managed odata query option is empty.
|
|
23
|
+
*/
|
|
15
24
|
empty(): boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Get or Set the value of the managed odata query option.
|
|
27
|
+
* @param v The value to set.
|
|
28
|
+
* @returns
|
|
29
|
+
*/
|
|
16
30
|
value(v?: any): any;
|
|
17
31
|
private assertArray;
|
|
32
|
+
/**
|
|
33
|
+
* Push value to the managed odata query option.
|
|
34
|
+
* @param value Value to push
|
|
35
|
+
*/
|
|
18
36
|
push(value: any): void;
|
|
37
|
+
/**
|
|
38
|
+
* Remove value from the managed odata query option.
|
|
39
|
+
* @param value Value to remove
|
|
40
|
+
*/
|
|
19
41
|
remove(value: any): void;
|
|
42
|
+
/**
|
|
43
|
+
* Return value at index of the managed odata query option.
|
|
44
|
+
* @param index Index of the value
|
|
45
|
+
* @returns The value
|
|
46
|
+
*/
|
|
20
47
|
at(index: number): any;
|
|
21
48
|
private assertObject;
|
|
49
|
+
/**
|
|
50
|
+
* Set the value for path in the managed odata query option.
|
|
51
|
+
* @param path Path for set the value
|
|
52
|
+
* @param value Value to set
|
|
53
|
+
*/
|
|
22
54
|
set(path: string, value: any): void;
|
|
55
|
+
/**
|
|
56
|
+
* Get the value for path from the managed odata query option.
|
|
57
|
+
* @param path The path from get the value
|
|
58
|
+
* @param def Default if not found
|
|
59
|
+
* @returns
|
|
60
|
+
*/
|
|
23
61
|
get(path: string, def?: any): any;
|
|
62
|
+
/**
|
|
63
|
+
* Unset the value for path in the managed odata query option.
|
|
64
|
+
* @param path
|
|
65
|
+
*/
|
|
24
66
|
unset(path: string): void;
|
|
67
|
+
/**
|
|
68
|
+
* Test if the managed odata query option has the value.
|
|
69
|
+
* @param path The path fot test if the value is set
|
|
70
|
+
* @returns Boolean indicating if the value is set
|
|
71
|
+
*/
|
|
25
72
|
has(path: string): boolean;
|
|
73
|
+
/**
|
|
74
|
+
* Merge values from object into the managed odata query option.
|
|
75
|
+
* @param values Object to merge
|
|
76
|
+
* @returns
|
|
77
|
+
*/
|
|
26
78
|
assign(values: {
|
|
27
79
|
[attr: string]: any;
|
|
28
80
|
}): Object;
|
|
81
|
+
/**
|
|
82
|
+
* Clear the managed odata query option.
|
|
83
|
+
*/
|
|
29
84
|
clear(): void;
|
|
30
85
|
}
|
|
31
86
|
export declare class ODataQueryOptionsHandler<T> {
|
|
@@ -39,12 +94,28 @@ export declare class ODataQueryOptionsHandler<T> {
|
|
|
39
94
|
* @returns The alias
|
|
40
95
|
*/
|
|
41
96
|
alias(value: any, name?: string): import("./builder").QueryCustomType;
|
|
97
|
+
/**
|
|
98
|
+
* Normalize the given value to a valid odata value
|
|
99
|
+
* @param value The value to normalize
|
|
100
|
+
* @returns The normalized value
|
|
101
|
+
*/
|
|
102
|
+
normalize(value: any): any;
|
|
103
|
+
/**
|
|
104
|
+
* Build and return a handler for modifying the $select option.
|
|
105
|
+
* If opts is given then set te value as new value for $select.
|
|
106
|
+
* @param opts Select<T> value or builder function for SelectExpression<T>
|
|
107
|
+
*/
|
|
42
108
|
select(opts: (builder: {
|
|
43
109
|
s: T;
|
|
44
110
|
e: () => SelectExpression<T>;
|
|
45
111
|
}, current?: SelectExpression<T>) => SelectExpression<T>): SelectExpression<T>;
|
|
46
112
|
select(opts: Select<T>): ODataQueryOptionHandler<T>;
|
|
47
113
|
select(): ODataQueryOptionHandler<T>;
|
|
114
|
+
/**
|
|
115
|
+
* Build and return a handler for modifying the $expand option.
|
|
116
|
+
* If opts is given then set te value as new value for $expand.
|
|
117
|
+
* @param opts Expand<T> value or builder function for ExpandExpression<T>
|
|
118
|
+
*/
|
|
48
119
|
expand(opts: (builder: {
|
|
49
120
|
s: T;
|
|
50
121
|
e: () => ExpandExpression<T>;
|
|
@@ -52,7 +123,10 @@ export declare class ODataQueryOptionsHandler<T> {
|
|
|
52
123
|
expand(opts: Expand<T>): ODataQueryOptionHandler<T>;
|
|
53
124
|
expand(): ODataQueryOptionHandler<T>;
|
|
54
125
|
/**
|
|
126
|
+
* Build and return a handler for modifying the $compute option.
|
|
127
|
+
* If opts is given then set te value as new value for $compute.
|
|
55
128
|
* @link https://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part2-url-conventions.html#sec_SystemQueryOptioncompute
|
|
129
|
+
* @param opts string value or builder function for ComputeExpression<T>
|
|
56
130
|
*/
|
|
57
131
|
compute(opts: (builder: {
|
|
58
132
|
s: T;
|
|
@@ -63,17 +137,35 @@ export declare class ODataQueryOptionsHandler<T> {
|
|
|
63
137
|
compute(opts: string): ODataQueryOptionHandler<T>;
|
|
64
138
|
compute(): ODataQueryOptionHandler<T>;
|
|
65
139
|
/**
|
|
140
|
+
* Build and return a handler for modifying the $format option.
|
|
141
|
+
* If opts is given then set te value as new value for $format.
|
|
66
142
|
* @link https://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part2-url-conventions.html#sec_SystemQueryOptionformat
|
|
143
|
+
* @param opts string value for format
|
|
67
144
|
*/
|
|
68
145
|
format(opts: string): ODataQueryOptionHandler<T>;
|
|
69
146
|
format(): ODataQueryOptionHandler<T>;
|
|
147
|
+
/**
|
|
148
|
+
* Build and return a handler for modifying the $transform option.
|
|
149
|
+
* If opts is given then set te value as new value for $transform.
|
|
150
|
+
* @param opts string value for transform
|
|
151
|
+
*/
|
|
70
152
|
transform(opts: Transform<T>): ODataQueryOptionHandler<T>;
|
|
71
153
|
transform(): ODataQueryOptionHandler<T>;
|
|
154
|
+
/**
|
|
155
|
+
* Build and return a handler for modifying the $search option.
|
|
156
|
+
* If opts is given then set te value as new value for $search.
|
|
157
|
+
* @param opts string value or builder function for SearchExpression<T>
|
|
158
|
+
*/
|
|
72
159
|
search(opts: (builder: {
|
|
73
160
|
e: (connector: SearchConnector) => SearchExpression<T>;
|
|
74
161
|
}, current?: SearchExpression<T>) => SearchExpression<T>): SearchExpression<T>;
|
|
75
162
|
search(opts: string): ODataQueryOptionHandler<T>;
|
|
76
163
|
search(): ODataQueryOptionHandler<T>;
|
|
164
|
+
/**
|
|
165
|
+
* Build and return a handler for modifying the $filter option.
|
|
166
|
+
* If opts is given then set te value as new value for $filter.
|
|
167
|
+
* @param opts Filter<T> value or builder function for FilterExpression<T>
|
|
168
|
+
*/
|
|
77
169
|
filter(opts: (builder: {
|
|
78
170
|
s: T;
|
|
79
171
|
e: (connector?: FilterConnector) => FilterExpression<T>;
|
|
@@ -82,23 +174,54 @@ export declare class ODataQueryOptionsHandler<T> {
|
|
|
82
174
|
}, current?: FilterExpression<T>) => FilterExpression<T>): FilterExpression<T>;
|
|
83
175
|
filter(opts: Filter<T>): ODataQueryOptionHandler<T>;
|
|
84
176
|
filter(): ODataQueryOptionHandler<T>;
|
|
177
|
+
/**
|
|
178
|
+
* Build and return a handler for modifying the $orderby option.
|
|
179
|
+
* If opts is given then set te value as new value for $orderby.
|
|
180
|
+
* @param opts OrderBy<T> value or builder function for OrderByExpression<T>
|
|
181
|
+
*/
|
|
85
182
|
orderBy(opts: (builder: {
|
|
86
183
|
s: T;
|
|
87
184
|
e: () => OrderByExpression<T>;
|
|
88
185
|
}, current?: OrderByExpression<T>) => OrderByExpression<T>): OrderByExpression<T>;
|
|
89
186
|
orderBy(opts: OrderBy<T>): ODataQueryOptionHandler<T>;
|
|
90
187
|
orderBy(): ODataQueryOptionHandler<T>;
|
|
188
|
+
/**
|
|
189
|
+
* Build and return a handler for modifying the $top option.
|
|
190
|
+
* If opts is given then set te value as new value for $top.
|
|
191
|
+
* @param opts number value
|
|
192
|
+
*/
|
|
91
193
|
top(opts: number): ODataQueryOptionHandler<T>;
|
|
92
194
|
top(): ODataQueryOptionHandler<T>;
|
|
195
|
+
/**
|
|
196
|
+
* Build and return a handler for modifying the $skip option.
|
|
197
|
+
* If opts is given then set te value as new value for $skip.
|
|
198
|
+
* @param opts number value
|
|
199
|
+
*/
|
|
93
200
|
skip(opts: number): ODataQueryOptionHandler<T>;
|
|
94
201
|
skip(): ODataQueryOptionHandler<T>;
|
|
202
|
+
/**
|
|
203
|
+
* Build and return a handler for modifying the $skiptoken option.
|
|
204
|
+
* If opts is given then set te value as new value for $skiptoken.
|
|
205
|
+
* @param opts string value
|
|
206
|
+
*/
|
|
95
207
|
skiptoken(opts: string): ODataQueryOptionHandler<T>;
|
|
96
208
|
skiptoken(): ODataQueryOptionHandler<T>;
|
|
209
|
+
/**
|
|
210
|
+
* Shortcut for set $top, $skip, $skiptoken.
|
|
211
|
+
* @param param0 skip or top or skiptoken
|
|
212
|
+
*/
|
|
97
213
|
paging({ skip, skiptoken, top, }?: {
|
|
98
214
|
skip?: number;
|
|
99
215
|
skiptoken?: string;
|
|
100
216
|
top?: number;
|
|
101
217
|
}): void;
|
|
218
|
+
/**
|
|
219
|
+
* Shortcut for clear pagination by unset $top, $skip, $skiptoken.
|
|
220
|
+
*/
|
|
102
221
|
clearPaging(): void;
|
|
222
|
+
/**
|
|
223
|
+
* Apply the given query options to the current query.
|
|
224
|
+
* @param query The query to be applied.
|
|
225
|
+
*/
|
|
103
226
|
apply(query: ODataQueryArguments<T>): void;
|
|
104
227
|
}
|
|
@@ -18,10 +18,8 @@ export declare type ODataQueryArguments<T> = {
|
|
|
18
18
|
[QueryOptionNames.format]?: string;
|
|
19
19
|
};
|
|
20
20
|
export declare class ODataQueryOptions<T> {
|
|
21
|
-
values:
|
|
22
|
-
|
|
23
|
-
};
|
|
24
|
-
constructor(options?: {
|
|
21
|
+
values: Map<QueryOptionNames, any>;
|
|
22
|
+
constructor(values?: Map<QueryOptionNames, any> | {
|
|
25
23
|
[name: string]: any;
|
|
26
24
|
});
|
|
27
25
|
pathAndParams(escape?: boolean): [string, {
|
|
@@ -31,10 +29,10 @@ export declare class ODataQueryOptions<T> {
|
|
|
31
29
|
toJSON(): {};
|
|
32
30
|
toQueryArguments(): ODataQueryArguments<T>;
|
|
33
31
|
clone<O>(): ODataQueryOptions<O>;
|
|
34
|
-
expression(
|
|
35
|
-
option<O>(
|
|
36
|
-
has(
|
|
37
|
-
remove(...
|
|
38
|
-
keep(...
|
|
32
|
+
expression(key: QueryOptionNames, exp?: Expression<T>): any;
|
|
33
|
+
option<O>(key: QueryOptionNames, opts?: O): ODataQueryOptionHandler<O>;
|
|
34
|
+
has(key: QueryOptionNames): boolean;
|
|
35
|
+
remove(...keys: QueryOptionNames[]): void;
|
|
36
|
+
keep(...keys: QueryOptionNames[]): void;
|
|
39
37
|
clear(): void;
|
|
40
38
|
}
|
|
@@ -3,7 +3,7 @@ import { ODataApi } from '../api';
|
|
|
3
3
|
import { ODataCollection, ODataModel } from '../models';
|
|
4
4
|
import { ODataStructuredType } from '../schema';
|
|
5
5
|
import { ODataSchemaElement } from '../schema/element';
|
|
6
|
-
import {
|
|
6
|
+
import { ParserOptions, QueryOptionNames } from '../types';
|
|
7
7
|
import { ODataPathSegments, ODataPathSegmentsHandler } from './path';
|
|
8
8
|
import { ODataQueryOptions, ODataQueryOptionsHandler, QueryCustomType } from './query';
|
|
9
9
|
import { ODataEntitiesAnnotations, ODataEntityAnnotations } from './responses/index';
|
|
@@ -59,9 +59,10 @@ export declare class ODataResource<T> {
|
|
|
59
59
|
endpointUrl(params?: boolean): string;
|
|
60
60
|
toString(): string;
|
|
61
61
|
clone(): ODataResource<T>;
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
62
|
+
private __parser;
|
|
63
|
+
deserialize(value: any, options?: ParserOptions): any;
|
|
64
|
+
serialize(value: any, options?: ParserOptions): any;
|
|
65
|
+
encode(value: any, options?: ParserOptions): any;
|
|
65
66
|
toJSON(): {
|
|
66
67
|
segments: any[];
|
|
67
68
|
options: {};
|
|
@@ -2,35 +2,31 @@ import { ODataContext, ODataVersionHelper } from '../../helper';
|
|
|
2
2
|
import { ODataMetadataType } from '../../types';
|
|
3
3
|
export declare abstract class ODataAnnotations {
|
|
4
4
|
helper: ODataVersionHelper;
|
|
5
|
-
protected annotations:
|
|
6
|
-
[annot: string]: any;
|
|
7
|
-
};
|
|
5
|
+
protected annotations: Map<string, any>;
|
|
8
6
|
protected context?: ODataContext | undefined;
|
|
9
|
-
constructor(helper: ODataVersionHelper, annotations?:
|
|
10
|
-
[annot: string]: any;
|
|
11
|
-
}, context?: ODataContext | undefined);
|
|
7
|
+
constructor(helper: ODataVersionHelper, annotations?: Map<string, any>, context?: ODataContext | undefined);
|
|
12
8
|
attributes<T>(data: {
|
|
13
|
-
[
|
|
9
|
+
[key: string]: any;
|
|
14
10
|
}, metadata: ODataMetadataType): T;
|
|
15
11
|
get entitySet(): string | undefined;
|
|
16
12
|
get type(): string | undefined;
|
|
17
13
|
abstract clone(): ODataAnnotations;
|
|
18
14
|
abstract data(data: {
|
|
19
|
-
[
|
|
15
|
+
[key: string]: any;
|
|
20
16
|
}): {
|
|
21
|
-
[
|
|
17
|
+
[key: string]: any;
|
|
22
18
|
};
|
|
23
19
|
}
|
|
24
20
|
export declare class ODataPropertyAnnotations extends ODataAnnotations {
|
|
25
21
|
clone(): ODataPropertyAnnotations;
|
|
26
22
|
data(data: {
|
|
27
|
-
[
|
|
23
|
+
[key: string]: any;
|
|
28
24
|
}): any;
|
|
29
25
|
}
|
|
30
26
|
export declare class ODataEntityAnnotations extends ODataAnnotations {
|
|
31
27
|
clone(): ODataEntityAnnotations;
|
|
32
28
|
data(data: {
|
|
33
|
-
[
|
|
29
|
+
[key: string]: any;
|
|
34
30
|
}): any;
|
|
35
31
|
get id(): string | undefined;
|
|
36
32
|
get etag(): string | undefined;
|
|
@@ -42,20 +38,18 @@ export declare class ODataEntityAnnotations extends ODataAnnotations {
|
|
|
42
38
|
get mediaEditLink(): string | undefined;
|
|
43
39
|
get mediaContentType(): string | undefined;
|
|
44
40
|
private _properties?;
|
|
45
|
-
get properties():
|
|
46
|
-
|
|
47
|
-
};
|
|
48
|
-
property(name: string): any;
|
|
41
|
+
get properties(): Map<string, Map<string, any>>;
|
|
42
|
+
property(name: string): Map<string, any> | undefined;
|
|
49
43
|
private _functions?;
|
|
50
44
|
get functions(): {
|
|
51
|
-
[
|
|
45
|
+
[key: string]: any;
|
|
52
46
|
};
|
|
53
47
|
function(name: string): any;
|
|
54
48
|
}
|
|
55
49
|
export declare class ODataEntitiesAnnotations extends ODataAnnotations {
|
|
56
50
|
clone(): ODataEntitiesAnnotations;
|
|
57
51
|
data(data: {
|
|
58
|
-
[
|
|
52
|
+
[key: string]: any;
|
|
59
53
|
}): any;
|
|
60
54
|
get readLink(): string | undefined;
|
|
61
55
|
get count(): number | undefined;
|
|
@@ -66,7 +60,7 @@ export declare class ODataEntitiesAnnotations extends ODataAnnotations {
|
|
|
66
60
|
get skiptoken(): string | undefined;
|
|
67
61
|
private _functions?;
|
|
68
62
|
get functions(): {
|
|
69
|
-
[
|
|
63
|
+
[key: string]: any;
|
|
70
64
|
};
|
|
71
65
|
function(name: string): any;
|
|
72
66
|
}
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import { ODataMetadataType, ODataVersion,
|
|
1
|
+
import { ODataMetadataType, ODataVersion, ParserOptions, ResponseOptions } from '../../types';
|
|
2
2
|
export declare class ODataResponseOptions implements ResponseOptions {
|
|
3
3
|
version: ODataVersion;
|
|
4
4
|
streaming?: boolean;
|
|
5
5
|
metadata?: ODataMetadataType;
|
|
6
|
-
stringAsEnum?: boolean;
|
|
7
6
|
ieee754Compatible?: boolean;
|
|
8
7
|
location?: string;
|
|
9
8
|
cacheability?: 'public' | 'private' | 'no-cache' | 'no-store';
|
|
10
9
|
maxAge?: number;
|
|
11
|
-
constructor(config:
|
|
10
|
+
constructor(config: ParserOptions);
|
|
12
11
|
get helper(): import("../../helper").ODataVersionHelper;
|
|
13
12
|
clone(): ODataResponseOptions;
|
|
14
13
|
setFeatures(features: string): void;
|
|
@@ -46,9 +46,7 @@ export declare class ODataResponse<T> extends HttpResponse<T> {
|
|
|
46
46
|
private _context?;
|
|
47
47
|
get context(): ODataContext;
|
|
48
48
|
private _annotations?;
|
|
49
|
-
get annotations():
|
|
50
|
-
[name: string]: any;
|
|
51
|
-
};
|
|
49
|
+
get annotations(): Map<string, any>;
|
|
52
50
|
/**
|
|
53
51
|
* Handle the response body as an entity
|
|
54
52
|
* @returns
|
|
@@ -1,21 +1,16 @@
|
|
|
1
|
+
import { HttpErrorResponse, HttpResponseBase } from '@angular/common/http';
|
|
1
2
|
import { Observable, Subject } from 'rxjs';
|
|
2
3
|
import { ODataApi } from '../../api';
|
|
3
4
|
import { ODataRequest } from '../request';
|
|
4
5
|
import { ODataResource } from '../resource';
|
|
5
6
|
import { ODataResponse } from '../responses';
|
|
6
7
|
import { ODataOptions } from './options';
|
|
7
|
-
export declare class ODataBatchRequest<T> extends Subject<
|
|
8
|
+
export declare class ODataBatchRequest<T> extends Subject<HttpResponseBase> {
|
|
8
9
|
request: ODataRequest<any>;
|
|
9
10
|
constructor(request: ODataRequest<any>);
|
|
10
11
|
toString(): string;
|
|
11
|
-
onLoad(
|
|
12
|
-
|
|
13
|
-
message: string;
|
|
14
|
-
}): void;
|
|
15
|
-
onError(content: string[], status: {
|
|
16
|
-
code: number;
|
|
17
|
-
text: string;
|
|
18
|
-
}): void;
|
|
12
|
+
onLoad(response: HttpResponseBase): void;
|
|
13
|
+
onError(response: HttpErrorResponse): void;
|
|
19
14
|
}
|
|
20
15
|
/**
|
|
21
16
|
* OData Batch Resource
|
|
@@ -24,6 +19,8 @@ export declare class ODataBatchRequest<T> extends Subject<ODataResponse<T>> {
|
|
|
24
19
|
export declare class ODataBatchResource extends ODataResource<any> {
|
|
25
20
|
private _requests;
|
|
26
21
|
requests(): ODataRequest<any>[];
|
|
22
|
+
private _responses;
|
|
23
|
+
responses(): HttpResponseBase[] | null;
|
|
27
24
|
static factory(api: ODataApi): ODataBatchResource;
|
|
28
25
|
clone(): ODataBatchResource;
|
|
29
26
|
private storeRequester;
|
|
@@ -34,7 +31,7 @@ export declare class ODataBatchResource extends ODataResource<any> {
|
|
|
34
31
|
* @returns The result of execute the context
|
|
35
32
|
*/
|
|
36
33
|
add<R>(ctx: (batch: this) => Observable<R>): Observable<R>;
|
|
37
|
-
send(options?: ODataOptions):
|
|
34
|
+
send(options?: ODataOptions): Observable<null | ODataResponse<string>>;
|
|
38
35
|
/**
|
|
39
36
|
* Execute the batch request
|
|
40
37
|
* @param ctx The context for the request
|
|
@@ -44,5 +41,5 @@ export declare class ODataBatchResource extends ODataResource<any> {
|
|
|
44
41
|
exec<R>(ctx: (batch: this) => Observable<R>, options?: ODataOptions): Observable<R>;
|
|
45
42
|
body(): string;
|
|
46
43
|
static buildBody(batchBoundary: string, requests: ODataBatchRequest<any>[]): string;
|
|
47
|
-
static
|
|
44
|
+
static parseResponse(requests: ODataBatchRequest<any>[], response: ODataResponse<string>): HttpResponseBase[];
|
|
48
45
|
}
|
|
@@ -40,7 +40,7 @@ export declare class ODataEntitySetResource<T> extends ODataResource<T> {
|
|
|
40
40
|
fetchCollection<M extends ODataModel<T>, C extends ODataCollection<T, M>>(options?: ODataOptions & {
|
|
41
41
|
withCount?: boolean;
|
|
42
42
|
bodyQueryOptions?: QueryOptionNames[];
|
|
43
|
-
}): Observable<
|
|
43
|
+
}): Observable<C | null>;
|
|
44
44
|
fetchAll(options?: ODataOptions & {
|
|
45
45
|
bodyQueryOptions?: QueryOptionNames[];
|
|
46
46
|
}): Observable<T[]>;
|
|
@@ -18,6 +18,9 @@ export declare class ODataFunctionResource<P, R> extends ODataResource<R> {
|
|
|
18
18
|
static fromResource<P, R>(resource: ODataResource<any>, path: string): ODataFunctionResource<P, R>;
|
|
19
19
|
clone(): ODataFunctionResource<P, R>;
|
|
20
20
|
returnType(): string | undefined;
|
|
21
|
+
pathAndParams(escape?: boolean): [string, {
|
|
22
|
+
[name: string]: any;
|
|
23
|
+
}];
|
|
21
24
|
parameters(params: P | null, { alias }?: {
|
|
22
25
|
alias?: boolean;
|
|
23
26
|
}): ODataFunctionResource<P, R>;
|
package/lib/schema/callable.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CallableConfig,
|
|
1
|
+
import { CallableConfig, ParserOptions, Parser } from '../types';
|
|
2
2
|
import { ODataSchemaElement } from './element';
|
|
3
3
|
import { ODataCallableParser } from './parsers';
|
|
4
4
|
import { ODataSchema } from './schema';
|
|
@@ -18,21 +18,21 @@ export declare class ODataCallable<R> extends ODataSchemaElement {
|
|
|
18
18
|
* @param options Options for deserialization
|
|
19
19
|
* @returns Deserialized value
|
|
20
20
|
*/
|
|
21
|
-
deserialize(value: any, options?:
|
|
21
|
+
deserialize(value: any, options?: ParserOptions): any;
|
|
22
22
|
/**
|
|
23
23
|
* Serialize the given value for the callable.
|
|
24
24
|
* @param value Value to serialize
|
|
25
25
|
* @param options Options for serialization
|
|
26
26
|
* @returns Serialized value
|
|
27
27
|
*/
|
|
28
|
-
serialize(value: any, options?:
|
|
28
|
+
serialize(value: any, options?: ParserOptions): any;
|
|
29
29
|
/**
|
|
30
30
|
* Encode the given value for the callable.
|
|
31
31
|
* @param value Value to encode
|
|
32
32
|
* @param options Options for encoding
|
|
33
33
|
* @returns Encoded value
|
|
34
34
|
*/
|
|
35
|
-
encode(value: any, options?:
|
|
35
|
+
encode(value: any, options?: ParserOptions): any;
|
|
36
36
|
/**
|
|
37
37
|
* Returns the binding parameter of the callable.
|
|
38
38
|
* @returns The binding parameter of the callable.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EnumTypeConfig,
|
|
1
|
+
import { EnumTypeConfig, ParserOptions } from '../types';
|
|
2
2
|
import { ODataSchemaElement } from './element';
|
|
3
3
|
import { ODataEnumTypeFieldParser, ODataEnumTypeParser } from './parsers';
|
|
4
4
|
import { ODataSchema } from './schema';
|
|
@@ -46,19 +46,19 @@ export declare class ODataEnumType<E> extends ODataSchemaElement {
|
|
|
46
46
|
* @param options Options for deserialization
|
|
47
47
|
* @returns Deserialized value
|
|
48
48
|
*/
|
|
49
|
-
deserialize(value: any, options?:
|
|
49
|
+
deserialize(value: any, options?: ParserOptions): E;
|
|
50
50
|
/**
|
|
51
51
|
* Serialize the given value for the enum type.
|
|
52
52
|
* @param value Value to serialize
|
|
53
53
|
* @param options Options for serialization
|
|
54
54
|
* @returns Serialized value
|
|
55
55
|
*/
|
|
56
|
-
serialize(value: E, options?:
|
|
56
|
+
serialize(value: E, options?: ParserOptions): any;
|
|
57
57
|
/**
|
|
58
58
|
* Encode the given value for the enum type.
|
|
59
59
|
* @param value Value to encode
|
|
60
60
|
* @param options Options for encoding
|
|
61
61
|
* @returns Encoded value
|
|
62
62
|
*/
|
|
63
|
-
encode(value: E, options?:
|
|
63
|
+
encode(value: E, options?: ParserOptions): any;
|
|
64
64
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CallableConfig,
|
|
1
|
+
import { CallableConfig, ParserOptions, Parameter, Parser } from '../../types';
|
|
2
2
|
import { ODataEnumTypeParser } from './enum-type';
|
|
3
3
|
import { ODataStructuredTypeParser } from './structured-type';
|
|
4
4
|
export declare class ODataParameterParser<T> {
|
|
@@ -7,13 +7,13 @@ export declare class ODataParameterParser<T> {
|
|
|
7
7
|
private parser;
|
|
8
8
|
collection?: boolean;
|
|
9
9
|
nullable?: boolean;
|
|
10
|
-
|
|
10
|
+
parserOptions?: ParserOptions;
|
|
11
11
|
constructor(name: string, parameter: Parameter);
|
|
12
|
-
serialize(value: T, options?:
|
|
13
|
-
encode(value: any, options?:
|
|
12
|
+
serialize(value: T, options?: ParserOptions): any;
|
|
13
|
+
encode(value: any, options?: ParserOptions): string;
|
|
14
14
|
configure({ parserForType, options, }: {
|
|
15
15
|
parserForType: (type: string) => Parser<any>;
|
|
16
|
-
options:
|
|
16
|
+
options: ParserOptions;
|
|
17
17
|
}): void;
|
|
18
18
|
isEdmType(): boolean;
|
|
19
19
|
isEnumType(): boolean;
|
|
@@ -31,15 +31,17 @@ export declare class ODataCallableParser<R> implements Parser<R> {
|
|
|
31
31
|
};
|
|
32
32
|
parser: Parser<any>;
|
|
33
33
|
parameters: ODataParameterParser<any>[];
|
|
34
|
-
|
|
34
|
+
nonParenthesisForEmptyParameterFunction?: boolean;
|
|
35
|
+
parserOptions?: ParserOptions;
|
|
35
36
|
constructor(config: CallableConfig, namespace: string, alias?: string);
|
|
36
37
|
isTypeOf(type: string): boolean;
|
|
37
|
-
deserialize(value: any, options?:
|
|
38
|
-
serialize(params: any, options?:
|
|
39
|
-
encode(params: any, options?:
|
|
40
|
-
configure({ parserForType, options, }: {
|
|
38
|
+
deserialize(value: any, options?: ParserOptions): R;
|
|
39
|
+
serialize(params: any, options?: ParserOptions): any;
|
|
40
|
+
encode(params: any, options?: ParserOptions): any;
|
|
41
|
+
configure({ nonParenthesisForEmptyParameterFunction, parserForType, options, }: {
|
|
42
|
+
nonParenthesisForEmptyParameterFunction: boolean;
|
|
41
43
|
parserForType: (type: string) => Parser<any>;
|
|
42
|
-
options:
|
|
44
|
+
options: ParserOptions;
|
|
43
45
|
}): void;
|
|
44
46
|
binding(): ODataParameterParser<any> | undefined;
|
|
45
47
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EnumTypeConfig, EnumTypeFieldConfig,
|
|
1
|
+
import { EnumTypeConfig, EnumTypeFieldConfig, ParserOptions, Parser } from '../../types';
|
|
2
2
|
import { ODataAnnotatable } from '../annotation';
|
|
3
3
|
export declare class ODataEnumTypeFieldParser extends ODataAnnotatable {
|
|
4
4
|
name: string;
|
|
@@ -17,7 +17,8 @@ export declare class ODataEnumTypeParser<T> extends ODataAnnotatable implements
|
|
|
17
17
|
[value: number]: string;
|
|
18
18
|
};
|
|
19
19
|
fields: ODataEnumTypeFieldParser[];
|
|
20
|
-
|
|
20
|
+
stringAsEnum?: boolean;
|
|
21
|
+
parserOptions?: ParserOptions;
|
|
21
22
|
constructor(config: EnumTypeConfig<T>, namespace: string, alias?: string);
|
|
22
23
|
/**
|
|
23
24
|
* Create a nicer looking title.
|
|
@@ -26,13 +27,14 @@ export declare class ODataEnumTypeParser<T> extends ODataAnnotatable implements
|
|
|
26
27
|
* @returns The titleized string.
|
|
27
28
|
*/
|
|
28
29
|
ttitelize(term?: string | RegExp): string;
|
|
29
|
-
configure({ options }: {
|
|
30
|
-
|
|
30
|
+
configure({ stringAsEnum, options, }: {
|
|
31
|
+
stringAsEnum: boolean;
|
|
32
|
+
options: ParserOptions;
|
|
31
33
|
}): void;
|
|
32
34
|
isTypeOf(type: string): boolean;
|
|
33
|
-
deserialize(value: string, options?:
|
|
34
|
-
serialize(value: T, options?:
|
|
35
|
-
encode(value: T, options?:
|
|
35
|
+
deserialize(value: string, options?: ParserOptions): T;
|
|
36
|
+
serialize(value: T, options?: ParserOptions): string | undefined;
|
|
37
|
+
encode(value: T, options?: ParserOptions): any;
|
|
36
38
|
toJsonSchema(): any;
|
|
37
39
|
validate(member: string | number, { method, navigation, }?: {
|
|
38
40
|
method?: 'create' | 'update' | 'modify';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ParserOptions, Parser, StructuredTypeConfig, StructuredTypeFieldConfig } from '../../types';
|
|
2
2
|
import { ODataAnnotatable } from '../annotation';
|
|
3
3
|
import { ODataEnumTypeParser } from './enum-type';
|
|
4
4
|
declare type JsonSchemaSelect<T> = Array<keyof T>;
|
|
@@ -46,7 +46,7 @@ export declare class ODataStructuredTypeFieldParser<T> extends ODataAnnotatable
|
|
|
46
46
|
precision?: number;
|
|
47
47
|
scale?: number;
|
|
48
48
|
referentials: ODataReferential[];
|
|
49
|
-
|
|
49
|
+
parserOptions?: ParserOptions;
|
|
50
50
|
constructor(name: string, structuredType: ODataStructuredTypeParser<any>, field: StructuredTypeFieldConfig);
|
|
51
51
|
validate(value: any, { method, navigation, }?: {
|
|
52
52
|
method?: 'create' | 'update' | 'modify';
|
|
@@ -57,13 +57,13 @@ export declare class ODataStructuredTypeFieldParser<T> extends ODataAnnotatable
|
|
|
57
57
|
[name: string]: any;
|
|
58
58
|
}[] | string[] | undefined;
|
|
59
59
|
private parse;
|
|
60
|
-
deserialize(value: any, options?:
|
|
60
|
+
deserialize(value: any, options?: ParserOptions): T;
|
|
61
61
|
private toJson;
|
|
62
|
-
serialize(value: T, options?:
|
|
63
|
-
encode(value: T, options?:
|
|
62
|
+
serialize(value: T, options?: ParserOptions): any;
|
|
63
|
+
encode(value: T, options?: ParserOptions): string;
|
|
64
64
|
configure({ parserForType, options, }: {
|
|
65
65
|
parserForType: (type: string) => Parser<any>;
|
|
66
|
-
options:
|
|
66
|
+
options: ParserOptions;
|
|
67
67
|
}): void;
|
|
68
68
|
toJsonSchema(options?: JsonSchemaOptions<T>): any;
|
|
69
69
|
isKey(): boolean;
|
|
@@ -84,7 +84,7 @@ export declare class ODataStructuredTypeParser<T> extends ODataAnnotatable imple
|
|
|
84
84
|
parent?: ODataStructuredTypeParser<any>;
|
|
85
85
|
keys?: ODataEntityTypeKey[];
|
|
86
86
|
fields: ODataStructuredTypeFieldParser<any>[];
|
|
87
|
-
|
|
87
|
+
parserOptions?: ParserOptions;
|
|
88
88
|
constructor(config: StructuredTypeConfig<T>, namespace: string, alias?: string);
|
|
89
89
|
/**
|
|
90
90
|
* Create a nicer looking title.
|
|
@@ -97,12 +97,12 @@ export declare class ODataStructuredTypeParser<T> extends ODataAnnotatable imple
|
|
|
97
97
|
isSubtypeOf(type: string): boolean;
|
|
98
98
|
findChildParser(predicate: (p: ODataStructuredTypeParser<any>) => boolean): ODataStructuredTypeParser<any> | undefined;
|
|
99
99
|
childParser(predicate: (p: ODataStructuredTypeParser<any>) => boolean): Parser<any>;
|
|
100
|
-
deserialize(value: any, options?:
|
|
101
|
-
serialize(value: T, options?:
|
|
102
|
-
encode(value: T, options?:
|
|
100
|
+
deserialize(value: any, options?: ParserOptions): T;
|
|
101
|
+
serialize(value: T, options?: ParserOptions): any;
|
|
102
|
+
encode(value: T, options?: ParserOptions): any;
|
|
103
103
|
configure({ parserForType, options, }: {
|
|
104
104
|
parserForType: (type: string) => Parser<any>;
|
|
105
|
-
options:
|
|
105
|
+
options: ParserOptions;
|
|
106
106
|
}): void;
|
|
107
107
|
resolveKey(value: any): any;
|
|
108
108
|
defaults(): {
|