angular-odata 0.100.1 → 0.102.5
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 +84 -64
- package/esm2020/lib/cache/cache.mjs +56 -4
- package/esm2020/lib/cache/memory.mjs +16 -6
- package/esm2020/lib/cache/storage.mjs +23 -4
- package/esm2020/lib/client.mjs +3 -3
- package/esm2020/lib/constants.mjs +2 -1
- package/esm2020/lib/models/collection.mjs +103 -43
- package/esm2020/lib/models/model.mjs +17 -4
- package/esm2020/lib/models/options.mjs +200 -122
- package/esm2020/lib/module.mjs +5 -5
- package/esm2020/lib/options.mjs +3 -8
- package/esm2020/lib/resources/query/builder.mjs +1 -1
- package/esm2020/lib/resources/query/expressions/compute.mjs +5 -5
- package/esm2020/lib/resources/query/expressions/expand.mjs +6 -6
- package/esm2020/lib/resources/query/expressions/filter.mjs +9 -9
- package/esm2020/lib/resources/query/expressions/index.mjs +3 -1
- package/esm2020/lib/resources/query/expressions/orderby.mjs +5 -5
- package/esm2020/lib/resources/query/expressions/search.mjs +3 -3
- package/esm2020/lib/resources/query/expressions/select.mjs +7 -7
- package/esm2020/lib/resources/query/expressions/syntax.mjs +1 -1
- package/esm2020/lib/resources/query/handlers.mjs +208 -22
- package/esm2020/lib/resources/query/options.mjs +16 -13
- package/esm2020/lib/resources/request.mjs +31 -36
- package/esm2020/lib/resources/resource.mjs +27 -11
- package/esm2020/lib/resources/responses/annotations.mjs +1 -1
- package/esm2020/lib/resources/responses/metadata.mjs +1 -1
- package/esm2020/lib/resources/responses/options.mjs +1 -1
- package/esm2020/lib/resources/responses/response.mjs +2 -2
- package/esm2020/lib/resources/types/batch.mjs +108 -97
- package/esm2020/lib/resources/types/navigation-property.mjs +5 -3
- package/esm2020/lib/resources/types/options.mjs +1 -1
- package/esm2020/lib/resources/types/property.mjs +4 -4
- package/esm2020/lib/schema/callable.mjs +3 -3
- package/esm2020/lib/schema/enum-type.mjs +13 -26
- package/esm2020/lib/schema/parsers/callable.mjs +15 -20
- package/esm2020/lib/schema/parsers/enum-type.mjs +35 -18
- package/esm2020/lib/schema/parsers/structured-type.mjs +132 -66
- package/esm2020/lib/schema/structured-type.mjs +31 -39
- package/esm2020/lib/services/base.mjs +1 -1
- 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 +11 -6
- package/esm2020/lib/utils/types.mjs +6 -7
- package/fesm2015/angular-odata.mjs +3451 -2918
- package/fesm2015/angular-odata.mjs.map +1 -1
- package/fesm2020/angular-odata.mjs +3454 -2919
- package/fesm2020/angular-odata.mjs.map +1 -1
- package/{angular-odata.d.ts → index.d.ts} +0 -0
- package/lib/api.d.ts +2 -4
- 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/models/collection.d.ts +14 -9
- package/lib/models/model.d.ts +10 -7
- package/lib/models/options.d.ts +31 -22
- package/lib/options.d.ts +3 -7
- package/lib/resources/query/builder.d.ts +1 -1
- package/lib/resources/query/expressions/compute.d.ts +7 -6
- package/lib/resources/query/expressions/expand.d.ts +17 -32
- package/lib/resources/query/expressions/filter.d.ts +11 -10
- package/lib/resources/query/expressions/index.d.ts +2 -0
- package/lib/resources/query/expressions/orderby.d.ts +7 -6
- package/lib/resources/query/expressions/search.d.ts +5 -4
- package/lib/resources/query/expressions/select.d.ts +7 -6
- package/lib/resources/query/handlers.d.ts +158 -33
- package/lib/resources/query/options.d.ts +14 -12
- package/lib/resources/request.d.ts +2 -1
- package/lib/resources/resource.d.ts +7 -6
- package/lib/resources/responses/options.d.ts +2 -2
- package/lib/resources/types/batch.d.ts +8 -11
- package/lib/resources/types/options.d.ts +4 -2
- package/lib/schema/callable.d.ts +4 -4
- package/lib/schema/enum-type.d.ts +11 -23
- package/lib/schema/parsers/callable.d.ts +11 -10
- package/lib/schema/parsers/enum-type.d.ts +22 -14
- package/lib/schema/parsers/structured-type.d.ts +58 -14
- package/lib/schema/structured-type.d.ts +23 -23
- package/lib/services/base.d.ts +9 -9
- package/lib/types.d.ts +11 -13
- package/lib/utils/arrays.d.ts +3 -0
- package/lib/utils/enums.d.ts +2 -2
- package/lib/utils/objects.d.ts +1 -1
- package/lib/utils/strings.d.ts +1 -1
- package/lib/utils/types.d.ts +1 -1
- package/package.json +5 -5
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { EnumTypeConfig, EnumTypeFieldConfig,
|
|
1
|
+
import { EnumTypeConfig, EnumTypeFieldConfig, ParserOptions, Parser } from '../../types';
|
|
2
2
|
import { ODataAnnotatable } from '../annotation';
|
|
3
|
-
export declare class ODataEnumTypeFieldParser extends ODataAnnotatable {
|
|
3
|
+
export declare class ODataEnumTypeFieldParser<E> extends ODataAnnotatable {
|
|
4
4
|
name: string;
|
|
5
|
-
value:
|
|
6
|
-
constructor(name: string, field: EnumTypeFieldConfig);
|
|
5
|
+
value: E;
|
|
6
|
+
constructor(name: string, field: EnumTypeFieldConfig<E>);
|
|
7
7
|
titleize(term?: string | RegExp): string;
|
|
8
8
|
}
|
|
9
|
-
export declare class ODataEnumTypeParser<
|
|
9
|
+
export declare class ODataEnumTypeParser<E> extends ODataAnnotatable implements Parser<E> {
|
|
10
10
|
name: string;
|
|
11
11
|
namespace: string;
|
|
12
12
|
alias?: string;
|
|
13
13
|
flags?: boolean;
|
|
14
14
|
members: {
|
|
15
|
-
[name: string]:
|
|
15
|
+
[name: string]: E;
|
|
16
16
|
} | {
|
|
17
17
|
[value: number]: string;
|
|
18
18
|
};
|
|
19
|
-
|
|
19
|
+
private _fields;
|
|
20
20
|
stringAsEnum?: boolean;
|
|
21
|
-
|
|
22
|
-
constructor(config: EnumTypeConfig<
|
|
21
|
+
parserOptions?: ParserOptions;
|
|
22
|
+
constructor(config: EnumTypeConfig<E>, namespace: string, alias?: string);
|
|
23
23
|
/**
|
|
24
24
|
* Create a nicer looking title.
|
|
25
25
|
* Titleize is meant for creating pretty output.
|
|
@@ -27,14 +27,22 @@ export declare class ODataEnumTypeParser<T> extends ODataAnnotatable implements
|
|
|
27
27
|
* @returns The titleized string.
|
|
28
28
|
*/
|
|
29
29
|
ttitelize(term?: string | RegExp): string;
|
|
30
|
-
configure({ stringAsEnum, options }: {
|
|
30
|
+
configure({ stringAsEnum, options, }: {
|
|
31
31
|
stringAsEnum: boolean;
|
|
32
|
-
options:
|
|
32
|
+
options: ParserOptions;
|
|
33
33
|
}): void;
|
|
34
34
|
isTypeOf(type: string): boolean;
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
fields(value?: E): ODataEnumTypeFieldParser<E>[];
|
|
36
|
+
field(nameValue: string | E): ODataEnumTypeFieldParser<E>;
|
|
37
|
+
/**
|
|
38
|
+
* Map the fields of the enum type.
|
|
39
|
+
* @param mapper Function that maps the value to the new value
|
|
40
|
+
* @returns The fields mapped by the mapper
|
|
41
|
+
*/
|
|
42
|
+
mapFields<R>(mapper: (field: ODataEnumTypeFieldParser<E>) => R): R[];
|
|
43
|
+
deserialize(value: string, options?: ParserOptions): E;
|
|
44
|
+
serialize(value: E, options?: ParserOptions): string | undefined;
|
|
45
|
+
encode(value: E, options?: ParserOptions): any;
|
|
38
46
|
toJsonSchema(): any;
|
|
39
47
|
validate(member: string | number, { method, navigation, }?: {
|
|
40
48
|
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;
|
|
@@ -73,6 +73,7 @@ export declare class ODataStructuredTypeFieldParser<T> extends ODataAnnotatable
|
|
|
73
73
|
enum(): ODataEnumTypeParser<T>;
|
|
74
74
|
isStructuredType(): boolean;
|
|
75
75
|
structured(): ODataStructuredTypeParser<T>;
|
|
76
|
+
field<F>(name: string): ODataStructuredTypeFieldParser<F>;
|
|
76
77
|
}
|
|
77
78
|
export declare class ODataStructuredTypeParser<T> extends ODataAnnotatable implements Parser<T> {
|
|
78
79
|
name: string;
|
|
@@ -82,9 +83,9 @@ export declare class ODataStructuredTypeParser<T> extends ODataAnnotatable imple
|
|
|
82
83
|
alias?: string;
|
|
83
84
|
base?: string;
|
|
84
85
|
parent?: ODataStructuredTypeParser<any>;
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
86
|
+
private _keys?;
|
|
87
|
+
private _fields;
|
|
88
|
+
parserOptions?: ParserOptions;
|
|
88
89
|
constructor(config: StructuredTypeConfig<T>, namespace: string, alias?: string);
|
|
89
90
|
/**
|
|
90
91
|
* Create a nicer looking title.
|
|
@@ -97,14 +98,57 @@ export declare class ODataStructuredTypeParser<T> extends ODataAnnotatable imple
|
|
|
97
98
|
isSubtypeOf(type: string): boolean;
|
|
98
99
|
findChildParser(predicate: (p: ODataStructuredTypeParser<any>) => boolean): ODataStructuredTypeParser<any> | undefined;
|
|
99
100
|
childParser(predicate: (p: ODataStructuredTypeParser<any>) => boolean): Parser<any>;
|
|
100
|
-
deserialize(value: any, options?:
|
|
101
|
-
serialize(value: T, options?:
|
|
102
|
-
encode(value: T, options?:
|
|
101
|
+
deserialize(value: any, options?: ParserOptions): T;
|
|
102
|
+
serialize(value: T, options?: ParserOptions): any;
|
|
103
|
+
encode(value: T, options?: ParserOptions): any;
|
|
103
104
|
configure({ parserForType, options, }: {
|
|
104
105
|
parserForType: (type: string) => Parser<any>;
|
|
105
|
-
options:
|
|
106
|
+
options: ParserOptions;
|
|
106
107
|
}): void;
|
|
107
|
-
|
|
108
|
+
/**
|
|
109
|
+
* Returns all fields of the structured type.
|
|
110
|
+
* @param include_navigation Include navigation properties in the result.
|
|
111
|
+
* @param include_parents Include the parent types in the result.
|
|
112
|
+
* @returns All fields of the structured type.
|
|
113
|
+
*/
|
|
114
|
+
fields({ include_navigation, include_parents, }: {
|
|
115
|
+
include_parents: boolean;
|
|
116
|
+
include_navigation: boolean;
|
|
117
|
+
}): ODataStructuredTypeFieldParser<any>[];
|
|
118
|
+
/**
|
|
119
|
+
* Returns the keys of the structured type.
|
|
120
|
+
* @param include_parents Include the parent fields
|
|
121
|
+
* @returns The keys of the structured type
|
|
122
|
+
*/
|
|
123
|
+
keys({ include_parents, }: {
|
|
124
|
+
include_parents: boolean;
|
|
125
|
+
}): ODataEntityTypeKey[];
|
|
126
|
+
/**
|
|
127
|
+
* Find the field parser for the given field name.
|
|
128
|
+
* @param name Name of the field
|
|
129
|
+
* @returns The field parser
|
|
130
|
+
*/
|
|
131
|
+
field<F>(name: keyof T): ODataStructuredTypeFieldParser<F>;
|
|
132
|
+
/**
|
|
133
|
+
* Picks the fields from attributes.
|
|
134
|
+
* @param attrs
|
|
135
|
+
* @param include_parents Include the parent fields
|
|
136
|
+
* @param include_navigation Include the navigation fields
|
|
137
|
+
* @param include_etag Include the etag field
|
|
138
|
+
* @returns The picked fields
|
|
139
|
+
*/
|
|
140
|
+
pick(attrs: {
|
|
141
|
+
[name: string]: any;
|
|
142
|
+
}, { include_parents, include_navigation, include_etag, options, }?: {
|
|
143
|
+
include_parents?: boolean;
|
|
144
|
+
include_navigation?: boolean;
|
|
145
|
+
include_etag?: boolean;
|
|
146
|
+
options?: ParserOptions;
|
|
147
|
+
}): Partial<T>;
|
|
148
|
+
resolveKey(value: any, { resolve, single, }?: {
|
|
149
|
+
resolve?: boolean;
|
|
150
|
+
single?: boolean;
|
|
151
|
+
}): any;
|
|
108
152
|
defaults(): {
|
|
109
153
|
[name: string]: any;
|
|
110
154
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ODataCollection } from '../models';
|
|
2
2
|
import { ODataModel } from '../models/model';
|
|
3
|
-
import {
|
|
3
|
+
import { ParserOptions, StructuredTypeConfig } from '../types';
|
|
4
4
|
import { ODataSchemaElement } from './element';
|
|
5
5
|
import { JsonSchemaOptions, ODataEntityTypeKey, ODataStructuredTypeFieldParser, ODataStructuredTypeParser } from './parsers';
|
|
6
6
|
import { ODataSchema } from './schema';
|
|
@@ -44,7 +44,7 @@ export declare class ODataStructuredType<T> extends ODataSchemaElement {
|
|
|
44
44
|
* @param name Name of the field
|
|
45
45
|
* @returns The field parser
|
|
46
46
|
*/
|
|
47
|
-
|
|
47
|
+
field<F>(name: keyof T): ODataStructuredTypeFieldParser<F>;
|
|
48
48
|
/**
|
|
49
49
|
* Find a parent schema of the structured type.
|
|
50
50
|
* @param predicate Function for evaluate the schemas in the hierarchy.
|
|
@@ -57,24 +57,6 @@ export declare class ODataStructuredType<T> extends ODataSchemaElement {
|
|
|
57
57
|
* @returns The schema of the field
|
|
58
58
|
*/
|
|
59
59
|
findSchemaForField<E>(field: ODataStructuredTypeFieldParser<any>): ODataStructuredType<E>;
|
|
60
|
-
/**
|
|
61
|
-
* Returns all fields of the structured type.
|
|
62
|
-
* @param include_navigation Include navigation properties in the result.
|
|
63
|
-
* @param include_parents Include the parent types in the result.
|
|
64
|
-
* @returns All fields of the structured type.
|
|
65
|
-
*/
|
|
66
|
-
fields({ include_navigation, include_parents, }: {
|
|
67
|
-
include_parents: boolean;
|
|
68
|
-
include_navigation: boolean;
|
|
69
|
-
}): ODataStructuredTypeFieldParser<any>[];
|
|
70
|
-
/**
|
|
71
|
-
* Returns the keys of the structured type.
|
|
72
|
-
* @param include_parents Include the parent fields
|
|
73
|
-
* @returns The keys of the structured type
|
|
74
|
-
*/
|
|
75
|
-
keys({ include_parents, }?: {
|
|
76
|
-
include_parents?: boolean;
|
|
77
|
-
}): ODataEntityTypeKey[];
|
|
78
60
|
/**
|
|
79
61
|
* Picks the fields from attributes.
|
|
80
62
|
* @param attrs
|
|
@@ -96,21 +78,39 @@ export declare class ODataStructuredType<T> extends ODataSchemaElement {
|
|
|
96
78
|
* @param options Options for deserialization
|
|
97
79
|
* @returns Deserialized value
|
|
98
80
|
*/
|
|
99
|
-
deserialize(value: any, options?:
|
|
81
|
+
deserialize(value: any, options?: ParserOptions): T;
|
|
100
82
|
/**
|
|
101
83
|
* Serialize the given value for the structured type.
|
|
102
84
|
* @param value Value to serialize
|
|
103
85
|
* @param options Options for serialization
|
|
104
86
|
* @returns Serialized value
|
|
105
87
|
*/
|
|
106
|
-
serialize(value: T, options?:
|
|
88
|
+
serialize(value: T, options?: ParserOptions): any;
|
|
107
89
|
/**
|
|
108
90
|
* Encode the given value for the structured type.
|
|
109
91
|
* @param value Value to encode
|
|
110
92
|
* @param options Options for encoding
|
|
111
93
|
* @returns Encoded value
|
|
112
94
|
*/
|
|
113
|
-
encode(value: T, options?:
|
|
95
|
+
encode(value: T, options?: ParserOptions): any;
|
|
96
|
+
/**
|
|
97
|
+
* Returns all fields of the structured type.
|
|
98
|
+
* @param include_navigation Include navigation properties in the result.
|
|
99
|
+
* @param include_parents Include the parent types in the result.
|
|
100
|
+
* @returns All fields of the structured type.
|
|
101
|
+
*/
|
|
102
|
+
fields({ include_navigation, include_parents, }: {
|
|
103
|
+
include_parents: boolean;
|
|
104
|
+
include_navigation: boolean;
|
|
105
|
+
}): ODataStructuredTypeFieldParser<any>[];
|
|
106
|
+
/**
|
|
107
|
+
* Returns the keys of the structured type.
|
|
108
|
+
* @param include_parents Include the parent fields
|
|
109
|
+
* @returns The keys of the structured type
|
|
110
|
+
*/
|
|
111
|
+
keys({ include_parents, }?: {
|
|
112
|
+
include_parents?: boolean;
|
|
113
|
+
}): ODataEntityTypeKey[];
|
|
114
114
|
/**
|
|
115
115
|
* Resolve the key of the structured type for the given value.
|
|
116
116
|
* @param attrs Attributes of the value
|
package/lib/services/base.d.ts
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { Observable } from 'rxjs';
|
|
2
2
|
import { ODataClient } from '../client';
|
|
3
|
-
import { ODataActionResource, ODataEntities, ODataEntity, ODataFunctionResource, ODataNavigationPropertyResource, ODataProperty, ODataQueryArgumentsOptions } from '../resources';
|
|
3
|
+
import { ODataActionOptions, ODataActionResource, ODataEntities, ODataEntity, ODataFunctionOptions, ODataFunctionResource, ODataNavigationPropertyResource, ODataProperty, ODataQueryArgumentsOptions } from '../resources';
|
|
4
4
|
export declare abstract class ODataBaseService {
|
|
5
5
|
protected client: ODataClient;
|
|
6
6
|
protected name: string;
|
|
7
7
|
protected apiNameOrEntityType?: string | undefined;
|
|
8
8
|
constructor(client: ODataClient, name: string, apiNameOrEntityType?: string | undefined);
|
|
9
9
|
get api(): import("angular-odata").ODataApi;
|
|
10
|
-
protected callFunction<P, R>(params: P | null, resource: ODataFunctionResource<P, R>, responseType: 'entity', options?:
|
|
11
|
-
protected callFunction<P, R>(params: P | null, resource: ODataFunctionResource<P, R>, responseType: 'entities', options?:
|
|
12
|
-
protected callFunction<P, R>(params: P | null, resource: ODataFunctionResource<P, R>, responseType: 'property', options?:
|
|
13
|
-
protected callFunction<P, R>(params: P | null, resource: ODataFunctionResource<P, R>, responseType: 'none', options?:
|
|
14
|
-
protected callAction<P, R>(params: P | null, resource: ODataActionResource<P, R>, responseType: 'entity', options?:
|
|
15
|
-
protected callAction<P, R>(params: P | null, resource: ODataActionResource<P, R>, responseType: 'entities', options?:
|
|
16
|
-
protected callAction<P, R>(params: P | null, resource: ODataActionResource<P, R>, responseType: 'property', options?:
|
|
17
|
-
protected callAction<P, R>(params: P | null, resource: ODataActionResource<P, R>, responseType: 'none', options?:
|
|
10
|
+
protected callFunction<P, R>(params: P | null, resource: ODataFunctionResource<P, R>, responseType: 'entity', options?: ODataFunctionOptions<R>): Observable<ODataEntity<R>>;
|
|
11
|
+
protected callFunction<P, R>(params: P | null, resource: ODataFunctionResource<P, R>, responseType: 'entities', options?: ODataFunctionOptions<R>): Observable<ODataEntities<R>>;
|
|
12
|
+
protected callFunction<P, R>(params: P | null, resource: ODataFunctionResource<P, R>, responseType: 'property', options?: ODataFunctionOptions<R>): Observable<ODataProperty<R>>;
|
|
13
|
+
protected callFunction<P, R>(params: P | null, resource: ODataFunctionResource<P, R>, responseType: 'none', options?: ODataFunctionOptions<R>): Observable<null>;
|
|
14
|
+
protected callAction<P, R>(params: P | null, resource: ODataActionResource<P, R>, responseType: 'entity', options?: ODataActionOptions<R>): Observable<ODataEntity<R>>;
|
|
15
|
+
protected callAction<P, R>(params: P | null, resource: ODataActionResource<P, R>, responseType: 'entities', options?: ODataActionOptions<R>): Observable<ODataEntities<R>>;
|
|
16
|
+
protected callAction<P, R>(params: P | null, resource: ODataActionResource<P, R>, responseType: 'property', options?: ODataActionOptions<R>): Observable<ODataProperty<R>>;
|
|
17
|
+
protected callAction<P, R>(params: P | null, resource: ODataActionResource<P, R>, responseType: 'none', options?: ODataActionOptions<R>): Observable<null>;
|
|
18
18
|
protected fetchNavigationProperty<S>(resource: ODataNavigationPropertyResource<S>, responseType: 'entity', options?: ODataQueryArgumentsOptions<S>): Observable<ODataEntity<S>>;
|
|
19
19
|
protected fetchNavigationProperty<S>(resource: ODataNavigationPropertyResource<S>, responseType: 'entities', options?: ODataQueryArgumentsOptions<S>): Observable<ODataEntities<S>>;
|
|
20
20
|
}
|
package/lib/types.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { ODataVersionHelper } from './helper';
|
|
2
1
|
import { Observable } from 'rxjs';
|
|
3
2
|
export declare type ODataVersion = '2.0' | '3.0' | '4.0';
|
|
4
3
|
export declare type FetchPolicy = 'cache-first' | 'cache-and-network' | 'network-only' | 'no-cache' | 'cache-only';
|
|
@@ -65,25 +64,24 @@ export interface ApiOptions {
|
|
|
65
64
|
deleteRefBy?: 'path' | 'id';
|
|
66
65
|
nonParenthesisForEmptyParameterFunction?: boolean;
|
|
67
66
|
}
|
|
68
|
-
export interface
|
|
67
|
+
export interface ParserOptions {
|
|
69
68
|
version?: ODataVersion;
|
|
70
|
-
helper: ODataVersionHelper;
|
|
71
69
|
exponentialDecimals?: boolean;
|
|
72
70
|
metadata?: ODataMetadataType;
|
|
73
71
|
ieee754Compatible?: boolean;
|
|
74
72
|
streaming?: boolean;
|
|
75
73
|
}
|
|
76
|
-
export interface ResponseOptions extends
|
|
74
|
+
export interface ResponseOptions extends ParserOptions {
|
|
77
75
|
cacheability?: CacheCacheability;
|
|
78
76
|
maxAge?: number;
|
|
79
77
|
}
|
|
80
|
-
export interface StructuredTypeFieldOptions extends
|
|
78
|
+
export interface StructuredTypeFieldOptions extends ParserOptions {
|
|
81
79
|
field: StructuredTypeFieldConfig;
|
|
82
80
|
}
|
|
83
81
|
export interface Parser<T> {
|
|
84
|
-
deserialize(value: any, options?:
|
|
85
|
-
serialize(value: any, options?:
|
|
86
|
-
encode(value: any, options?:
|
|
82
|
+
deserialize(value: any, options?: ParserOptions | StructuredTypeFieldOptions): T;
|
|
83
|
+
serialize(value: any, options?: ParserOptions | StructuredTypeFieldOptions): any;
|
|
84
|
+
encode(value: any, options?: ParserOptions | StructuredTypeFieldOptions): any;
|
|
87
85
|
}
|
|
88
86
|
export declare const NONE_PARSER: Parser<any>;
|
|
89
87
|
export interface Cache {
|
|
@@ -126,21 +124,21 @@ export declare type EntityContainerConfig = {
|
|
|
126
124
|
annotations?: AnnotationConfig[];
|
|
127
125
|
entitySets?: EntitySetConfig[];
|
|
128
126
|
};
|
|
129
|
-
export declare type EnumTypeFieldConfig = {
|
|
130
|
-
value:
|
|
127
|
+
export declare type EnumTypeFieldConfig<E> = {
|
|
128
|
+
value: E;
|
|
131
129
|
annotations?: AnnotationConfig[];
|
|
132
130
|
};
|
|
133
|
-
export declare type EnumTypeConfig<
|
|
131
|
+
export declare type EnumTypeConfig<E> = {
|
|
134
132
|
name: string;
|
|
135
133
|
flags?: boolean;
|
|
136
134
|
annotations?: AnnotationConfig[];
|
|
137
135
|
members: {
|
|
138
|
-
[name: string]:
|
|
136
|
+
[name: string]: E;
|
|
139
137
|
} | {
|
|
140
138
|
[value: number]: string;
|
|
141
139
|
};
|
|
142
140
|
fields: {
|
|
143
|
-
[member: string]: EnumTypeFieldConfig
|
|
141
|
+
[member: string]: EnumTypeFieldConfig<E>;
|
|
144
142
|
};
|
|
145
143
|
};
|
|
146
144
|
export declare type StructuredTypeFieldConfig = {
|
package/lib/utils/enums.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export declare const Enums: {
|
|
2
2
|
names<E>(Enum: E): string[];
|
|
3
3
|
values<E_1>(Enum: E_1): number[];
|
|
4
|
-
toValue<E_2>(Enum: E_2, value: any): number;
|
|
4
|
+
toValue<E_2>(Enum: E_2, value: any): number | undefined;
|
|
5
5
|
toValues<E_3>(Enum: E_3, value: any): number[];
|
|
6
|
-
toName<E_4>(Enum: E_4, value: any): string;
|
|
6
|
+
toName<E_4>(Enum: E_4, value: any): string | undefined;
|
|
7
7
|
toNames<E_5>(Enum: E_5, value: any): string[];
|
|
8
8
|
};
|
package/lib/utils/objects.d.ts
CHANGED
package/lib/utils/strings.d.ts
CHANGED
package/lib/utils/types.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export declare const Types: {
|
|
2
2
|
rawType(value: any): string;
|
|
3
|
-
isObject(value: any): boolean;
|
|
4
3
|
isPlainObject(value: any): boolean;
|
|
5
4
|
isFunction(value: any): boolean;
|
|
6
5
|
isArray(value: any): boolean;
|
|
6
|
+
isMap(value: any): boolean;
|
|
7
7
|
isEmpty(value: any): boolean;
|
|
8
8
|
isEqual(value1: any, value2: any): boolean;
|
|
9
9
|
clone(target: any): any;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "angular-odata",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.102.5",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Client side OData typescript library for Angular",
|
|
6
6
|
"repository": {
|
|
@@ -25,8 +25,8 @@
|
|
|
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": ">=13.0.0",
|
|
29
|
+
"@angular/core": ">=13.0.0"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"tslib": "^2.3.0"
|
|
@@ -36,13 +36,13 @@
|
|
|
36
36
|
"esm2020": "esm2020/angular-odata.mjs",
|
|
37
37
|
"fesm2020": "fesm2020/angular-odata.mjs",
|
|
38
38
|
"fesm2015": "fesm2015/angular-odata.mjs",
|
|
39
|
-
"typings": "
|
|
39
|
+
"typings": "index.d.ts",
|
|
40
40
|
"exports": {
|
|
41
41
|
"./package.json": {
|
|
42
42
|
"default": "./package.json"
|
|
43
43
|
},
|
|
44
44
|
".": {
|
|
45
|
-
"types": "./
|
|
45
|
+
"types": "./index.d.ts",
|
|
46
46
|
"esm2020": "./esm2020/angular-odata.mjs",
|
|
47
47
|
"es2020": "./fesm2020/angular-odata.mjs",
|
|
48
48
|
"es2015": "./fesm2015/angular-odata.mjs",
|