angular-odata 0.102.5 → 0.105.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 +4 -2
- package/esm2020/lib/client.mjs +3 -3
- package/esm2020/lib/helper.mjs +7 -10
- package/esm2020/lib/models/collection.mjs +10 -4
- package/esm2020/lib/models/model.mjs +9 -6
- package/esm2020/lib/models/options.mjs +44 -23
- package/esm2020/lib/module.mjs +4 -4
- package/esm2020/lib/options.mjs +8 -2
- package/esm2020/lib/resources/query/expressions/compute.mjs +3 -9
- package/esm2020/lib/resources/query/expressions/expand.mjs +3 -9
- package/esm2020/lib/resources/query/expressions/filter.mjs +11 -14
- package/esm2020/lib/resources/query/expressions/orderby.mjs +3 -9
- package/esm2020/lib/resources/query/expressions/search.mjs +2 -5
- package/esm2020/lib/resources/query/expressions/select.mjs +3 -9
- package/esm2020/lib/resources/query/expressions/syntax.mjs +12 -7
- package/esm2020/lib/resources/query/options.mjs +9 -3
- package/esm2020/lib/resources/resource.mjs +7 -10
- package/esm2020/lib/resources/responses/annotations.mjs +7 -1
- package/esm2020/lib/schema/callable.mjs +4 -4
- package/esm2020/lib/schema/enum-type.mjs +9 -6
- package/esm2020/lib/schema/parsers/callable.mjs +9 -11
- package/esm2020/lib/schema/parsers/edm.mjs +11 -3
- package/esm2020/lib/schema/parsers/enum-type.mjs +21 -23
- package/esm2020/lib/schema/parsers/structured-type.mjs +10 -10
- package/esm2020/lib/schema/schema.mjs +5 -5
- package/esm2020/lib/schema/structured-type.mjs +6 -4
- package/esm2020/lib/services/factory.mjs +3 -3
- package/esm2020/lib/types.mjs +1 -1
- package/esm2020/lib/utils/enums.mjs +1 -1
- package/fesm2015/angular-odata.mjs +214 -212
- package/fesm2015/angular-odata.mjs.map +1 -1
- package/fesm2020/angular-odata.mjs +202 -174
- package/fesm2020/angular-odata.mjs.map +1 -1
- package/lib/helper.d.ts +3 -0
- package/lib/models/collection.d.ts +3 -2
- package/lib/models/options.d.ts +12 -6
- package/lib/options.d.ts +8 -2
- package/lib/resources/query/expressions/compute.d.ts +1 -3
- package/lib/resources/query/expressions/expand.d.ts +1 -3
- package/lib/resources/query/expressions/filter.d.ts +2 -4
- package/lib/resources/query/expressions/orderby.d.ts +1 -3
- package/lib/resources/query/expressions/search.d.ts +0 -1
- package/lib/resources/query/expressions/select.d.ts +1 -3
- package/lib/resources/responses/annotations.d.ts +3 -0
- package/lib/schema/callable.d.ts +3 -1
- package/lib/schema/enum-type.d.ts +8 -2
- package/lib/schema/parsers/callable.d.ts +6 -6
- package/lib/schema/parsers/enum-type.d.ts +5 -10
- package/lib/schema/parsers/structured-type.d.ts +7 -5
- package/lib/schema/schema.d.ts +3 -2
- package/lib/schema/structured-type.d.ts +4 -3
- package/lib/types.d.ts +4 -1
- package/package.json +1 -1
package/lib/helper.d.ts
CHANGED
|
@@ -16,6 +16,7 @@ export declare class ODataCollection<T, M extends ODataModel<T>> implements Iter
|
|
|
16
16
|
_model: typeof ODataModel;
|
|
17
17
|
models(): M[];
|
|
18
18
|
get length(): number;
|
|
19
|
+
isEmpty(): boolean;
|
|
19
20
|
events$: EventEmitter<ODataModelEvent<T>>;
|
|
20
21
|
constructor(entities?: Partial<T>[] | {
|
|
21
22
|
[name: string]: any;
|
|
@@ -42,10 +43,10 @@ export declare class ODataCollection<T, M extends ODataModel<T>> implements Iter
|
|
|
42
43
|
changes_only?: boolean;
|
|
43
44
|
field_mapping?: boolean;
|
|
44
45
|
chain?: (ODataModel<any> | ODataCollection<any, ODataModel<any>>)[];
|
|
45
|
-
}): (T | {
|
|
46
|
+
}): (Partial<T> | {
|
|
46
47
|
[name: string]: any;
|
|
47
48
|
})[];
|
|
48
|
-
toJSON(): (T | {
|
|
49
|
+
toJSON(): (Partial<T> | {
|
|
49
50
|
[name: string]: any;
|
|
50
51
|
})[];
|
|
51
52
|
hasChanged({ include_navigation }?: {
|
package/lib/models/options.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Subscription } from 'rxjs';
|
|
2
2
|
import { EntityKey, ODataEntitiesAnnotations, ODataEntityAnnotations, ODataEntityResource, ODataEntitySetResource, ODataNavigationPropertyResource, ODataPropertyResource, ODataQueryOptions, ODataQueryOptionsHandler, ODataResource, ODataSingletonResource } from '../resources';
|
|
3
3
|
import { ODataEntitySet, ODataStructuredType, ODataStructuredTypeFieldParser } from '../schema';
|
|
4
|
-
import { ParserOptions } from '../types';
|
|
4
|
+
import { Parser, ParserOptions } from '../types';
|
|
5
5
|
import type { ODataCollection } from './collection';
|
|
6
6
|
import type { ODataModel } from './model';
|
|
7
7
|
export declare type ODataModelEventType = 'change' | 'reset' | 'update' | 'destroy' | 'add' | 'remove' | 'invalid' | 'request' | 'sync' | 'attach';
|
|
@@ -123,11 +123,16 @@ export declare class ODataModelField<F> {
|
|
|
123
123
|
resourceFactory<T, F>(base: ODataResource<T>): ODataNavigationPropertyResource<F> | ODataPropertyResource<F>;
|
|
124
124
|
annotationsFactory(base: ODataEntityAnnotations): ODataEntityAnnotations | ODataEntitiesAnnotations;
|
|
125
125
|
schemaFactory<T, F>(base: ODataStructuredType<T>): ODataStructuredType<F> | undefined;
|
|
126
|
-
|
|
126
|
+
modelFactory<F>({ parent, value, reset, }: {
|
|
127
127
|
parent: ODataModel<any>;
|
|
128
|
-
value?: F |
|
|
128
|
+
value?: Partial<F> | {
|
|
129
129
|
[name: string]: any;
|
|
130
|
-
}
|
|
130
|
+
};
|
|
131
|
+
reset?: boolean;
|
|
132
|
+
}): ODataModel<F>;
|
|
133
|
+
collectionFactory<F>({ parent, value, reset, }: {
|
|
134
|
+
parent: ODataModel<any>;
|
|
135
|
+
value?: Partial<F>[] | {
|
|
131
136
|
[name: string]: any;
|
|
132
137
|
}[];
|
|
133
138
|
reset?: boolean;
|
|
@@ -170,9 +175,10 @@ export declare class ODataModelOptions<T> {
|
|
|
170
175
|
[name: string]: any;
|
|
171
176
|
}): boolean;
|
|
172
177
|
findChildOptions(predicate: (options: ODataModelOptions<any>) => boolean): ODataModelOptions<any> | undefined;
|
|
173
|
-
configure({
|
|
174
|
-
findOptionsForType: (type: string) => ODataModelOptions<any> | undefined;
|
|
178
|
+
configure({ options, parserForType, findOptionsForType, }: {
|
|
175
179
|
options: ParserOptions;
|
|
180
|
+
parserForType: (type: string) => Parser<any>;
|
|
181
|
+
findOptionsForType: (type: string) => ODataModelOptions<any> | undefined;
|
|
176
182
|
}): void;
|
|
177
183
|
fields({ include_navigation, include_parents, }: {
|
|
178
184
|
include_parents: boolean;
|
package/lib/options.d.ts
CHANGED
|
@@ -8,6 +8,14 @@ export declare class ODataApiOptions implements ApiOptions {
|
|
|
8
8
|
* Send enum as string in the request
|
|
9
9
|
*/
|
|
10
10
|
stringAsEnum: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Delete reference by path or by id
|
|
13
|
+
*/
|
|
14
|
+
deleteRefBy: 'path' | 'id';
|
|
15
|
+
/**
|
|
16
|
+
* No use parenthesis for empty parameters functions
|
|
17
|
+
*/
|
|
18
|
+
nonParenthesisForEmptyParameterFunction: boolean;
|
|
11
19
|
/**
|
|
12
20
|
* Strip metadata from the response
|
|
13
21
|
*/
|
|
@@ -74,8 +82,6 @@ export declare class ODataApiOptions implements ApiOptions {
|
|
|
74
82
|
*/
|
|
75
83
|
includeAnnotations?: string;
|
|
76
84
|
};
|
|
77
|
-
deleteRefBy: 'path' | 'id';
|
|
78
|
-
nonParenthesisForEmptyParameterFunction: boolean;
|
|
79
85
|
constructor(config: ApiOptions);
|
|
80
86
|
get parserOptions(): ParserOptions;
|
|
81
87
|
get helper(): import("./helper").ODataVersionHelper;
|
|
@@ -2,7 +2,7 @@ import type { QueryCustomType } from '../builder';
|
|
|
2
2
|
import { Expression } from './base';
|
|
3
3
|
import { ODataFunctions, ODataOperators, Renderable } from './syntax';
|
|
4
4
|
export declare type ComputeExpressionBuilder<T> = {
|
|
5
|
-
t: T
|
|
5
|
+
t: Required<Readonly<T>>;
|
|
6
6
|
e: () => ComputeExpression<T>;
|
|
7
7
|
};
|
|
8
8
|
export declare class ComputeExpression<T> extends Expression<T> {
|
|
@@ -11,8 +11,6 @@ export declare class ComputeExpression<T> extends Expression<T> {
|
|
|
11
11
|
children?: Renderable[];
|
|
12
12
|
names?: string[];
|
|
13
13
|
});
|
|
14
|
-
static expression<T>(): ComputeExpression<T>;
|
|
15
|
-
static type<T extends object>(): T;
|
|
16
14
|
static compute<T extends object>(opts: (builder: ComputeExpressionBuilder<T>, current?: ComputeExpression<T>) => ComputeExpression<T>, current?: ComputeExpression<T>): ComputeExpression<T>;
|
|
17
15
|
render({ aliases, escape, prefix, }?: {
|
|
18
16
|
aliases?: QueryCustomType[] | undefined;
|
|
@@ -32,15 +32,13 @@ export declare class ExpandField<T> implements Renderable {
|
|
|
32
32
|
private option;
|
|
33
33
|
}
|
|
34
34
|
export declare type ExpandExpressionBuilder<T> = {
|
|
35
|
-
t: T
|
|
35
|
+
t: Readonly<Required<T>>;
|
|
36
36
|
e: () => ExpandExpression<T>;
|
|
37
37
|
};
|
|
38
38
|
export declare class ExpandExpression<T> extends Expression<T> {
|
|
39
39
|
constructor({ children, }?: {
|
|
40
40
|
children?: Renderable[];
|
|
41
41
|
});
|
|
42
|
-
static expression<T>(): ExpandExpression<T>;
|
|
43
|
-
static type<T extends object>(): T;
|
|
44
42
|
static expand<T extends object>(opts: (builder: ExpandExpressionBuilder<T>, current?: ExpandExpression<T>) => ExpandExpression<T>, current?: ExpandExpression<T>): ExpandExpression<T>;
|
|
45
43
|
render({ aliases, escape, prefix, }?: {
|
|
46
44
|
aliases?: QueryCustomType[] | undefined;
|
|
@@ -3,7 +3,7 @@ import { Expression } from './base';
|
|
|
3
3
|
import { ODataFunctions, ODataOperators, Renderable } from './syntax';
|
|
4
4
|
export declare type FilterConnector = 'and' | 'or';
|
|
5
5
|
export declare type FilterExpressionBuilder<T> = {
|
|
6
|
-
t: T
|
|
6
|
+
t: Readonly<Required<T>>;
|
|
7
7
|
e: (connector?: FilterConnector) => FilterExpression<T>;
|
|
8
8
|
o: ODataOperators<T>;
|
|
9
9
|
f: ODataFunctions<T>;
|
|
@@ -16,8 +16,6 @@ export declare class FilterExpression<F> extends Expression<F> {
|
|
|
16
16
|
connector?: FilterConnector;
|
|
17
17
|
negated?: boolean;
|
|
18
18
|
});
|
|
19
|
-
static type<T extends object>(): T;
|
|
20
|
-
static expression<T>(connector?: FilterConnector): FilterExpression<T>;
|
|
21
19
|
static filter<T extends object>(opts: (builder: FilterExpressionBuilder<T>, current?: FilterExpression<T>) => FilterExpression<T>, current?: FilterExpression<T>): FilterExpression<T>;
|
|
22
20
|
toJSON(): {
|
|
23
21
|
children: any[];
|
|
@@ -47,7 +45,7 @@ export declare class FilterExpression<F> extends Expression<F> {
|
|
|
47
45
|
contains(left: any, right: any, normalize?: boolean): FilterExpression<F>;
|
|
48
46
|
startsWith(left: any, right: any, normalize?: boolean): FilterExpression<F>;
|
|
49
47
|
endsWith(left: any, right: any, normalize?: boolean): FilterExpression<F>;
|
|
50
|
-
any<N extends object>(left: N[], opts
|
|
48
|
+
any<N extends object>(left: N[], opts?: (e: {
|
|
51
49
|
e: (connector?: FilterConnector) => FilterExpression<N>;
|
|
52
50
|
t: N;
|
|
53
51
|
}) => FilterExpression<N>, alias?: string): FilterExpression<F>;
|
|
@@ -18,15 +18,13 @@ export declare class OrderByField implements Renderable {
|
|
|
18
18
|
clone(): OrderByField;
|
|
19
19
|
}
|
|
20
20
|
export declare type OrderByExpressionBuilder<T> = {
|
|
21
|
-
t: T
|
|
21
|
+
t: Readonly<Required<T>>;
|
|
22
22
|
e: () => OrderByExpression<T>;
|
|
23
23
|
};
|
|
24
24
|
export declare class OrderByExpression<T> extends Expression<T> {
|
|
25
25
|
constructor({ children, }?: {
|
|
26
26
|
children?: Renderable[];
|
|
27
27
|
});
|
|
28
|
-
static expression<T>(): OrderByExpression<T>;
|
|
29
|
-
static type<T extends object>(): T;
|
|
30
28
|
static orderBy<T extends object>(opts: (builder: OrderByExpressionBuilder<T>, current?: OrderByExpression<T>) => OrderByExpression<T>, current?: OrderByExpression<T>): OrderByExpression<T>;
|
|
31
29
|
private _add;
|
|
32
30
|
render({ aliases, escape, prefix, }?: {
|
|
@@ -28,7 +28,6 @@ export declare class SearchExpression<T> extends Expression<T> {
|
|
|
28
28
|
connector?: SearchConnector;
|
|
29
29
|
negated?: boolean;
|
|
30
30
|
});
|
|
31
|
-
static expression<T>(connector?: SearchConnector): SearchExpression<T>;
|
|
32
31
|
static search<T extends object>(opts: (builder: SearchExpressionBuilder<T>, current?: SearchExpression<T>) => SearchExpression<T>, current?: SearchExpression<T>): SearchExpression<T>;
|
|
33
32
|
private _add;
|
|
34
33
|
render({ aliases, escape, prefix, }?: {
|
|
@@ -2,15 +2,13 @@ import type { QueryCustomType } from '../builder';
|
|
|
2
2
|
import { Expression } from './base';
|
|
3
3
|
import { Renderable } from './syntax';
|
|
4
4
|
export declare type SelectExpressionBuilder<T> = {
|
|
5
|
-
t: T
|
|
5
|
+
t: Readonly<Required<T>>;
|
|
6
6
|
e: () => SelectExpression<T>;
|
|
7
7
|
};
|
|
8
8
|
export declare class SelectExpression<T> extends Expression<T> {
|
|
9
9
|
constructor({ children, }?: {
|
|
10
10
|
children?: Renderable[];
|
|
11
11
|
});
|
|
12
|
-
static expression<T>(): SelectExpression<T>;
|
|
13
|
-
static type<T extends object>(): T;
|
|
14
12
|
static select<T extends object>(opts: (builder: SelectExpressionBuilder<T>, current?: SelectExpression<T>) => SelectExpression<T>, current?: SelectExpression<T>): SelectExpression<T>;
|
|
15
13
|
render({ aliases, escape, prefix, }?: {
|
|
16
14
|
aliases?: QueryCustomType[] | undefined;
|
|
@@ -8,6 +8,9 @@ export declare abstract class ODataAnnotations {
|
|
|
8
8
|
attributes<T>(data: {
|
|
9
9
|
[key: string]: any;
|
|
10
10
|
}, metadata: ODataMetadataType): T;
|
|
11
|
+
update(data: {
|
|
12
|
+
[key: string]: any;
|
|
13
|
+
}): void;
|
|
11
14
|
get entitySet(): string | undefined;
|
|
12
15
|
get type(): string | undefined;
|
|
13
16
|
abstract clone(): ODataAnnotations;
|
package/lib/schema/callable.d.ts
CHANGED
|
@@ -9,8 +9,10 @@ export declare class ODataCallable<R> extends ODataSchemaElement {
|
|
|
9
9
|
parser: ODataCallableParser<R>;
|
|
10
10
|
constructor(config: CallableConfig, schema: ODataSchema);
|
|
11
11
|
path(): string;
|
|
12
|
-
configure({ parserForType, }: {
|
|
12
|
+
configure({ options, parserForType, findOptionsForType, }: {
|
|
13
|
+
options: ParserOptions;
|
|
13
14
|
parserForType: (type: string) => Parser<any>;
|
|
15
|
+
findOptionsForType: (type: string) => any;
|
|
14
16
|
}): void;
|
|
15
17
|
/**
|
|
16
18
|
* Deseialize the given value from the callable.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EnumTypeConfig, ParserOptions } from '../types';
|
|
1
|
+
import { EnumTypeConfig, Parser, ParserOptions } from '../types';
|
|
2
2
|
import { ODataSchemaElement } from './element';
|
|
3
3
|
import { ODataEnumTypeFieldParser, ODataEnumTypeParser } from './parsers';
|
|
4
4
|
import { ODataSchema } from './schema';
|
|
@@ -10,7 +10,11 @@ export declare class ODataEnumType<E> extends ODataSchemaElement {
|
|
|
10
10
|
[value: number]: string;
|
|
11
11
|
};
|
|
12
12
|
constructor(config: EnumTypeConfig<E>, schema: ODataSchema);
|
|
13
|
-
configure(
|
|
13
|
+
configure({ options, parserForType, findOptionsForType, }: {
|
|
14
|
+
options: ParserOptions;
|
|
15
|
+
parserForType: (type: string) => Parser<any>;
|
|
16
|
+
findOptionsForType: (type: string) => any;
|
|
17
|
+
}): void;
|
|
14
18
|
/**
|
|
15
19
|
* Returns the fields of the enum type.
|
|
16
20
|
* @returns The fields of the enum type.
|
|
@@ -49,4 +53,6 @@ export declare class ODataEnumType<E> extends ODataSchemaElement {
|
|
|
49
53
|
* @returns Encoded value
|
|
50
54
|
*/
|
|
51
55
|
encode(value: E, options?: ParserOptions): any;
|
|
56
|
+
unpack(value: E): number[];
|
|
57
|
+
pack(value: number[]): E;
|
|
52
58
|
}
|
|
@@ -11,9 +11,10 @@ export declare class ODataParameterParser<T> {
|
|
|
11
11
|
constructor(name: string, parameter: Parameter);
|
|
12
12
|
serialize(value: T, options?: ParserOptions): any;
|
|
13
13
|
encode(value: any, options?: ParserOptions): string;
|
|
14
|
-
configure({ parserForType,
|
|
15
|
-
parserForType: (type: string) => Parser<any>;
|
|
14
|
+
configure({ options, parserForType, findOptionsForType, }: {
|
|
16
15
|
options: ParserOptions;
|
|
16
|
+
parserForType: (type: string) => Parser<any>;
|
|
17
|
+
findOptionsForType: (type: string) => any;
|
|
17
18
|
}): void;
|
|
18
19
|
isEdmType(): boolean;
|
|
19
20
|
isEnumType(): boolean;
|
|
@@ -32,17 +33,16 @@ export declare class ODataCallableParser<R> implements Parser<R> {
|
|
|
32
33
|
};
|
|
33
34
|
parser: Parser<any>;
|
|
34
35
|
parameters: ODataParameterParser<any>[];
|
|
35
|
-
nonParenthesisForEmptyParameterFunction?: boolean;
|
|
36
36
|
parserOptions?: ParserOptions;
|
|
37
37
|
constructor(config: CallableConfig, namespace: string, alias?: string);
|
|
38
38
|
isTypeOf(type: string): boolean;
|
|
39
39
|
deserialize(value: any, options?: ParserOptions): R;
|
|
40
40
|
serialize(params: any, options?: ParserOptions): any;
|
|
41
41
|
encode(params: any, options?: ParserOptions): any;
|
|
42
|
-
configure({
|
|
43
|
-
nonParenthesisForEmptyParameterFunction: boolean;
|
|
44
|
-
parserForType: (type: string) => Parser<any>;
|
|
42
|
+
configure({ options, parserForType, findOptionsForType, }: {
|
|
45
43
|
options: ParserOptions;
|
|
44
|
+
parserForType: (type: string) => Parser<any>;
|
|
45
|
+
findOptionsForType: (type: string) => any;
|
|
46
46
|
}): void;
|
|
47
47
|
binding(): ODataParameterParser<any> | undefined;
|
|
48
48
|
}
|
|
@@ -17,19 +17,12 @@ export declare class ODataEnumTypeParser<E> extends ODataAnnotatable implements
|
|
|
17
17
|
[value: number]: string;
|
|
18
18
|
};
|
|
19
19
|
private _fields;
|
|
20
|
-
stringAsEnum?: boolean;
|
|
21
20
|
parserOptions?: ParserOptions;
|
|
22
21
|
constructor(config: EnumTypeConfig<E>, namespace: string, alias?: string);
|
|
23
|
-
|
|
24
|
-
* Create a nicer looking title.
|
|
25
|
-
* Titleize is meant for creating pretty output.
|
|
26
|
-
* @param term The term of the annotation to find.
|
|
27
|
-
* @returns The titleized string.
|
|
28
|
-
*/
|
|
29
|
-
ttitelize(term?: string | RegExp): string;
|
|
30
|
-
configure({ stringAsEnum, options, }: {
|
|
31
|
-
stringAsEnum: boolean;
|
|
22
|
+
configure({ options, parserForType, findOptionsForType, }: {
|
|
32
23
|
options: ParserOptions;
|
|
24
|
+
parserForType: (type: string) => Parser<any>;
|
|
25
|
+
findOptionsForType: (type: string) => any;
|
|
33
26
|
}): void;
|
|
34
27
|
isTypeOf(type: string): boolean;
|
|
35
28
|
fields(value?: E): ODataEnumTypeFieldParser<E>[];
|
|
@@ -48,4 +41,6 @@ export declare class ODataEnumTypeParser<E> extends ODataAnnotatable implements
|
|
|
48
41
|
method?: 'create' | 'update' | 'modify';
|
|
49
42
|
navigation?: boolean;
|
|
50
43
|
}): string[] | undefined;
|
|
44
|
+
unpack(value: E): number[];
|
|
45
|
+
pack(value: number[]): E;
|
|
51
46
|
}
|
|
@@ -44,7 +44,7 @@ export declare class ODataStructuredTypeFieldParser<T> extends ODataAnnotatable
|
|
|
44
44
|
nullable: boolean;
|
|
45
45
|
navigation: boolean;
|
|
46
46
|
precision?: number;
|
|
47
|
-
scale?: number;
|
|
47
|
+
scale?: number | 'variable';
|
|
48
48
|
referentials: ODataReferential[];
|
|
49
49
|
parserOptions?: ParserOptions;
|
|
50
50
|
constructor(name: string, structuredType: ODataStructuredTypeParser<any>, field: StructuredTypeFieldConfig);
|
|
@@ -61,9 +61,10 @@ export declare class ODataStructuredTypeFieldParser<T> extends ODataAnnotatable
|
|
|
61
61
|
private toJson;
|
|
62
62
|
serialize(value: T, options?: ParserOptions): any;
|
|
63
63
|
encode(value: T, options?: ParserOptions): string;
|
|
64
|
-
configure({ parserForType,
|
|
65
|
-
parserForType: (type: string) => Parser<any>;
|
|
64
|
+
configure({ options, parserForType, findOptionsForType, }: {
|
|
66
65
|
options: ParserOptions;
|
|
66
|
+
parserForType: (type: string) => Parser<any>;
|
|
67
|
+
findOptionsForType: (type: string) => any;
|
|
67
68
|
}): void;
|
|
68
69
|
toJsonSchema(options?: JsonSchemaOptions<T>): any;
|
|
69
70
|
isKey(): boolean;
|
|
@@ -101,9 +102,10 @@ export declare class ODataStructuredTypeParser<T> extends ODataAnnotatable imple
|
|
|
101
102
|
deserialize(value: any, options?: ParserOptions): T;
|
|
102
103
|
serialize(value: T, options?: ParserOptions): any;
|
|
103
104
|
encode(value: T, options?: ParserOptions): any;
|
|
104
|
-
configure({ parserForType,
|
|
105
|
-
parserForType: (type: string) => Parser<any>;
|
|
105
|
+
configure({ options, parserForType, findOptionsForType, }: {
|
|
106
106
|
options: ParserOptions;
|
|
107
|
+
parserForType: (type: string) => Parser<any>;
|
|
108
|
+
findOptionsForType: (type: string) => any;
|
|
107
109
|
}): void;
|
|
108
110
|
/**
|
|
109
111
|
* Returns all fields of the structured type.
|
package/lib/schema/schema.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ODataApi } from '../api';
|
|
2
|
-
import { Parser, SchemaConfig } from '../types';
|
|
2
|
+
import { Parser, ParserOptions, SchemaConfig } from '../types';
|
|
3
3
|
import { ODataAnnotatable } from './annotation';
|
|
4
4
|
import { ODataCallable } from './callable';
|
|
5
5
|
import { ODataEntityContainer } from './entity-container';
|
|
@@ -21,7 +21,8 @@ export declare class ODataSchema extends ODataAnnotatable {
|
|
|
21
21
|
findStructuredTypeForType<T>(type: string): ODataStructuredType<T> | undefined;
|
|
22
22
|
findCallableForType<T>(type: string, bindingType?: string): ODataCallable<T> | undefined;
|
|
23
23
|
findEntitySetForType(type: string): ODataEntitySet | undefined;
|
|
24
|
-
configure({ parserForType, findOptionsForType, }: {
|
|
24
|
+
configure({ options, parserForType, findOptionsForType, }: {
|
|
25
|
+
options: ParserOptions;
|
|
25
26
|
parserForType: (type: string) => Parser<any>;
|
|
26
27
|
findOptionsForType: (type: string) => any;
|
|
27
28
|
}): void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ODataCollection } from '../models';
|
|
2
2
|
import { ODataModel } from '../models/model';
|
|
3
|
-
import { ParserOptions, StructuredTypeConfig } from '../types';
|
|
3
|
+
import { Parser, 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';
|
|
@@ -13,8 +13,9 @@ export declare class ODataStructuredType<T> extends ODataSchemaElement {
|
|
|
13
13
|
collection?: typeof ODataCollection;
|
|
14
14
|
parser: ODataStructuredTypeParser<T>;
|
|
15
15
|
constructor(config: StructuredTypeConfig<T>, schema: ODataSchema);
|
|
16
|
-
configure({ parserForType, findOptionsForType, }: {
|
|
17
|
-
|
|
16
|
+
configure({ options, parserForType, findOptionsForType, }: {
|
|
17
|
+
options: ParserOptions;
|
|
18
|
+
parserForType: (type: string) => Parser<any>;
|
|
18
19
|
findOptionsForType: (type: string) => any;
|
|
19
20
|
}): void;
|
|
20
21
|
/**
|
package/lib/types.d.ts
CHANGED
|
@@ -70,6 +70,9 @@ export interface ParserOptions {
|
|
|
70
70
|
metadata?: ODataMetadataType;
|
|
71
71
|
ieee754Compatible?: boolean;
|
|
72
72
|
streaming?: boolean;
|
|
73
|
+
stringAsEnum?: boolean;
|
|
74
|
+
deleteRefBy?: 'path' | 'id';
|
|
75
|
+
nonParenthesisForEmptyParameterFunction?: boolean;
|
|
73
76
|
}
|
|
74
77
|
export interface ResponseOptions extends ParserOptions {
|
|
75
78
|
cacheability?: CacheCacheability;
|
|
@@ -151,7 +154,7 @@ export declare type StructuredTypeFieldConfig = {
|
|
|
151
154
|
navigation?: boolean;
|
|
152
155
|
precision?: number;
|
|
153
156
|
annotations?: AnnotationConfig[];
|
|
154
|
-
scale?: number;
|
|
157
|
+
scale?: number | 'variable';
|
|
155
158
|
referentials?: {
|
|
156
159
|
property: string;
|
|
157
160
|
referencedProperty: string;
|