angular-odata 0.99.0 → 0.100.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/README.md +31 -25
- package/esm2020/lib/api.mjs +2 -2
- package/esm2020/lib/cache/cache.mjs +2 -2
- package/esm2020/lib/client.mjs +3 -3
- package/esm2020/lib/models/collection.mjs +53 -48
- package/esm2020/lib/models/model.mjs +33 -37
- package/esm2020/lib/models/options.mjs +35 -14
- package/esm2020/lib/module.mjs +4 -4
- package/esm2020/lib/options.mjs +4 -3
- package/esm2020/lib/resources/query/builder.mjs +4 -6
- package/esm2020/lib/resources/query/expressions/base.mjs +1 -1
- package/esm2020/lib/resources/query/expressions/compute.mjs +13 -6
- package/esm2020/lib/resources/query/expressions/expand.mjs +77 -13
- package/esm2020/lib/resources/query/expressions/filter.mjs +11 -5
- package/esm2020/lib/resources/query/expressions/orderby.mjs +11 -3
- package/esm2020/lib/resources/query/expressions/search.mjs +15 -3
- package/esm2020/lib/resources/query/expressions/select.mjs +10 -5
- package/esm2020/lib/resources/query/expressions/syntax.mjs +42 -9
- package/esm2020/lib/resources/query/handlers.mjs +13 -13
- package/esm2020/lib/resources/query/options.mjs +33 -36
- package/esm2020/lib/resources/resource.mjs +27 -74
- package/esm2020/lib/resources/responses/options.mjs +1 -2
- package/esm2020/lib/resources/types/action.mjs +4 -1
- package/esm2020/lib/resources/types/batch.mjs +6 -1
- package/esm2020/lib/resources/types/count.mjs +4 -1
- package/esm2020/lib/resources/types/entity-set.mjs +4 -1
- package/esm2020/lib/resources/types/entity.mjs +6 -3
- package/esm2020/lib/resources/types/function.mjs +11 -1
- package/esm2020/lib/resources/types/media.mjs +4 -1
- package/esm2020/lib/resources/types/metadata.mjs +4 -1
- package/esm2020/lib/resources/types/navigation-property.mjs +4 -1
- package/esm2020/lib/resources/types/property.mjs +4 -1
- package/esm2020/lib/resources/types/reference.mjs +4 -1
- package/esm2020/lib/resources/types/singleton.mjs +4 -1
- package/esm2020/lib/resources/types/value.mjs +4 -1
- package/esm2020/lib/schema/callable.mjs +6 -2
- package/esm2020/lib/schema/element.mjs +12 -2
- package/esm2020/lib/schema/enum-type.mjs +10 -2
- package/esm2020/lib/schema/parsers/callable.mjs +3 -2
- package/esm2020/lib/schema/parsers/enum-type.mjs +6 -5
- package/esm2020/lib/schema/parsers/structured-type.mjs +1 -1
- package/esm2020/lib/schema/structured-type.mjs +11 -2
- package/esm2020/lib/services/entity-set.mjs +6 -6
- package/esm2020/lib/services/factory.mjs +3 -3
- package/esm2020/lib/types.mjs +2 -1
- package/esm2020/lib/utils/objects.mjs +5 -1
- package/fesm2015/angular-odata.mjs +494 -305
- package/fesm2015/angular-odata.mjs.map +1 -1
- package/fesm2020/angular-odata.mjs +493 -309
- package/fesm2020/angular-odata.mjs.map +1 -1
- package/lib/models/collection.d.ts +4 -2
- package/lib/models/model.d.ts +1 -1
- package/lib/models/options.d.ts +16 -14
- package/lib/options.d.ts +4 -4
- package/lib/resources/query/builder.d.ts +1 -0
- package/lib/resources/query/expressions/base.d.ts +1 -0
- package/lib/resources/query/expressions/compute.d.ts +3 -2
- package/lib/resources/query/expressions/expand.d.ts +40 -12
- package/lib/resources/query/expressions/filter.d.ts +22 -21
- package/lib/resources/query/expressions/orderby.d.ts +4 -2
- package/lib/resources/query/expressions/search.d.ts +5 -2
- package/lib/resources/query/expressions/select.d.ts +3 -2
- package/lib/resources/query/expressions/syntax.d.ts +12 -2
- package/lib/resources/query/handlers.d.ts +12 -12
- package/lib/resources/query/options.d.ts +10 -8
- package/lib/resources/resource.d.ts +3 -1
- package/lib/resources/responses/options.d.ts +2 -3
- package/lib/resources/types/action.d.ts +1 -0
- package/lib/resources/types/batch.d.ts +1 -0
- package/lib/resources/types/count.d.ts +1 -0
- package/lib/resources/types/entity-set.d.ts +2 -1
- package/lib/resources/types/entity.d.ts +1 -0
- package/lib/resources/types/function.d.ts +4 -0
- package/lib/resources/types/media.d.ts +1 -0
- package/lib/resources/types/metadata.d.ts +1 -0
- package/lib/resources/types/navigation-property.d.ts +1 -0
- package/lib/resources/types/property.d.ts +1 -0
- package/lib/resources/types/reference.d.ts +1 -0
- package/lib/resources/types/singleton.d.ts +1 -0
- package/lib/resources/types/value.d.ts +1 -0
- package/lib/schema/callable.d.ts +4 -4
- package/lib/schema/element.d.ts +7 -1
- package/lib/schema/enum-type.d.ts +10 -4
- package/lib/schema/parsers/callable.d.ts +9 -7
- package/lib/schema/parsers/enum-type.d.ts +7 -5
- package/lib/schema/parsers/structured-type.d.ts +7 -7
- package/lib/schema/structured-type.d.ts +11 -5
- package/lib/types.d.ts +6 -5
- package/package.json +1 -1
|
@@ -17,6 +17,7 @@ export declare class ODataEntitySetResource<T> extends ODataResource<T> {
|
|
|
17
17
|
schema?: ODataStructuredType<E>;
|
|
18
18
|
query?: ODataQueryOptions<E>;
|
|
19
19
|
}): ODataEntitySetResource<E>;
|
|
20
|
+
clone(): ODataEntitySetResource<T>;
|
|
20
21
|
entity(key?: any): ODataEntityResource<T>;
|
|
21
22
|
action<P, R>(path: string): ODataActionResource<P, R>;
|
|
22
23
|
function<P, R>(path: string): ODataFunctionResource<P, R>;
|
|
@@ -39,7 +40,7 @@ export declare class ODataEntitySetResource<T> extends ODataResource<T> {
|
|
|
39
40
|
fetchCollection<M extends ODataModel<T>, C extends ODataCollection<T, M>>(options?: ODataOptions & {
|
|
40
41
|
withCount?: boolean;
|
|
41
42
|
bodyQueryOptions?: QueryOptionNames[];
|
|
42
|
-
}): Observable<
|
|
43
|
+
}): Observable<C | null>;
|
|
43
44
|
fetchAll(options?: ODataOptions & {
|
|
44
45
|
bodyQueryOptions?: QueryOptionNames[];
|
|
45
46
|
}): Observable<T[]>;
|
|
@@ -19,6 +19,7 @@ export declare class ODataEntityResource<T> extends ODataResource<T> {
|
|
|
19
19
|
segments: ODataPathSegments;
|
|
20
20
|
query?: ODataQueryOptions<E>;
|
|
21
21
|
}): ODataEntityResource<E>;
|
|
22
|
+
clone(): ODataEntityResource<T>;
|
|
22
23
|
key(value: any): ODataEntityResource<T>;
|
|
23
24
|
keys(values: any[]): ODataEntityResource<T>;
|
|
24
25
|
media(): ODataMediaResource;
|
|
@@ -16,7 +16,11 @@ export declare class ODataFunctionResource<P, R> extends ODataResource<R> {
|
|
|
16
16
|
query?: ODataQueryOptions<R>;
|
|
17
17
|
}): ODataFunctionResource<P, R>;
|
|
18
18
|
static fromResource<P, R>(resource: ODataResource<any>, path: string): ODataFunctionResource<P, R>;
|
|
19
|
+
clone(): ODataFunctionResource<P, R>;
|
|
19
20
|
returnType(): string | undefined;
|
|
21
|
+
pathAndParams(escape?: boolean): [string, {
|
|
22
|
+
[name: string]: any;
|
|
23
|
+
}];
|
|
20
24
|
parameters(params: P | null, { alias }?: {
|
|
21
25
|
alias?: boolean;
|
|
22
26
|
}): ODataFunctionResource<P, R>;
|
|
@@ -9,6 +9,7 @@ export declare class ODataMediaResource extends ODataResource<any> {
|
|
|
9
9
|
segments: ODataPathSegments;
|
|
10
10
|
query?: ODataQueryOptions<V>;
|
|
11
11
|
}): ODataMediaResource;
|
|
12
|
+
clone(): ODataMediaResource;
|
|
12
13
|
protected get(options: {
|
|
13
14
|
responseType: any;
|
|
14
15
|
} & ODataOptions): Observable<any>;
|
|
@@ -7,6 +7,7 @@ import { ODataOptions } from './options';
|
|
|
7
7
|
export declare class ODataMetadataResource extends ODataResource<any> {
|
|
8
8
|
constructor(api: ODataApi, segments?: ODataPathSegments);
|
|
9
9
|
static factory(api: ODataApi): ODataMetadataResource;
|
|
10
|
+
clone(): ODataMetadataResource;
|
|
10
11
|
protected get(options?: ODataOptions): Observable<ODataMetadata>;
|
|
11
12
|
fetch(options?: ODataOptions): Observable<ODataMetadata>;
|
|
12
13
|
}
|
|
@@ -26,6 +26,7 @@ export declare class ODataNavigationPropertyResource<T> extends ODataResource<T>
|
|
|
26
26
|
query?: ODataQueryOptions<N>;
|
|
27
27
|
}): ODataNavigationPropertyResource<N>;
|
|
28
28
|
static fromResource<N>(resource: ODataResource<any>, path: string): ODataNavigationPropertyResource<N>;
|
|
29
|
+
clone(): ODataNavigationPropertyResource<T>;
|
|
29
30
|
key(value: any): ODataNavigationPropertyResource<T>;
|
|
30
31
|
keys(values: any[]): ODataNavigationPropertyResource<T>;
|
|
31
32
|
media(): ODataMediaResource;
|
|
@@ -17,6 +17,7 @@ export declare class ODataPropertyResource<T> extends ODataResource<T> {
|
|
|
17
17
|
query?: ODataQueryOptions<P>;
|
|
18
18
|
}): ODataPropertyResource<P>;
|
|
19
19
|
static fromResource<N>(resource: ODataResource<any>, path: string): ODataPropertyResource<N>;
|
|
20
|
+
clone(): ODataPropertyResource<T>;
|
|
20
21
|
key(value: any): ODataPropertyResource<T>;
|
|
21
22
|
keys(values: any[]): ODataPropertyResource<T>;
|
|
22
23
|
value(): ODataValueResource<T>;
|
|
@@ -12,6 +12,7 @@ export declare class ODataReferenceResource<T> extends ODataResource<T> {
|
|
|
12
12
|
segments: ODataPathSegments;
|
|
13
13
|
query?: ODataQueryOptions<P>;
|
|
14
14
|
}): ODataReferenceResource<P>;
|
|
15
|
+
clone(): ODataReferenceResource<T>;
|
|
15
16
|
protected post(target: ODataEntityResource<any>, options?: ODataOptions): Observable<any>;
|
|
16
17
|
protected put(target: ODataEntityResource<any>, options?: ODataOptions & {
|
|
17
18
|
etag?: string;
|
|
@@ -17,6 +17,7 @@ export declare class ODataSingletonResource<T> extends ODataResource<T> {
|
|
|
17
17
|
schema?: ODataStructuredType<S>;
|
|
18
18
|
query?: ODataQueryOptions<S>;
|
|
19
19
|
}): ODataSingletonResource<S>;
|
|
20
|
+
clone(): ODataSingletonResource<T>;
|
|
20
21
|
key(value: any): ODataSingletonResource<T>;
|
|
21
22
|
keys(values: any[]): ODataSingletonResource<T>;
|
|
22
23
|
navigationProperty<N>(path: string): ODataNavigationPropertyResource<N>;
|
|
@@ -12,6 +12,7 @@ export declare class ODataValueResource<T> extends ODataResource<T> {
|
|
|
12
12
|
segments: ODataPathSegments;
|
|
13
13
|
query?: ODataQueryOptions<V>;
|
|
14
14
|
}): ODataValueResource<V>;
|
|
15
|
+
clone(): ODataValueResource<T>;
|
|
15
16
|
protected get(options?: ODataOptions): Observable<T>;
|
|
16
17
|
/**
|
|
17
18
|
* Fetch the value of the resource.
|
package/lib/schema/callable.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CallableConfig,
|
|
1
|
+
import { CallableConfig, OptionsHelper, 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?: OptionsHelper): 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?: OptionsHelper): 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?: OptionsHelper): any;
|
|
36
36
|
/**
|
|
37
37
|
* Returns the binding parameter of the callable.
|
|
38
38
|
* @returns The binding parameter of the callable.
|
package/lib/schema/element.d.ts
CHANGED
|
@@ -31,9 +31,15 @@ export declare class ODataSchemaElement extends ODataAnnotatable {
|
|
|
31
31
|
*/
|
|
32
32
|
isTypeOf(type: string): boolean;
|
|
33
33
|
/**
|
|
34
|
-
* Returns a boolean indicating if the structured type is a
|
|
34
|
+
* Returns a boolean indicating if the structured type is a subtype of the given type.
|
|
35
35
|
* @param type String representation of the type
|
|
36
36
|
* @returns True if the callable is type of the given type
|
|
37
37
|
*/
|
|
38
38
|
isSubtypeOf(schema: ODataSchemaElement): boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Returns a boolean indicating if the structured type is a supertype of the given type.
|
|
41
|
+
* @param type String representation of the type
|
|
42
|
+
* @returns True if the callable is type of the given type
|
|
43
|
+
*/
|
|
44
|
+
isSupertypeOf(schema: ODataSchemaElement): boolean;
|
|
39
45
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EnumTypeConfig,
|
|
1
|
+
import { EnumTypeConfig, OptionsHelper } from '../types';
|
|
2
2
|
import { ODataSchemaElement } from './element';
|
|
3
3
|
import { ODataEnumTypeFieldParser, ODataEnumTypeParser } from './parsers';
|
|
4
4
|
import { ODataSchema } from './schema';
|
|
@@ -28,6 +28,12 @@ export declare class ODataEnumType<E> extends ODataSchemaElement {
|
|
|
28
28
|
* @returns The field with the given value
|
|
29
29
|
*/
|
|
30
30
|
findFieldByValue(value: number): ODataEnumTypeFieldParser | undefined;
|
|
31
|
+
/**
|
|
32
|
+
* Find a fields by flag.
|
|
33
|
+
* @param value The value of the field
|
|
34
|
+
* @returns The fields with the given flag
|
|
35
|
+
*/
|
|
36
|
+
findFieldsByValue(value: number): ODataEnumTypeFieldParser[];
|
|
31
37
|
/**
|
|
32
38
|
* Map the fields of the enum type.
|
|
33
39
|
* @param mapper Function that maps the value to the new value
|
|
@@ -40,19 +46,19 @@ export declare class ODataEnumType<E> extends ODataSchemaElement {
|
|
|
40
46
|
* @param options Options for deserialization
|
|
41
47
|
* @returns Deserialized value
|
|
42
48
|
*/
|
|
43
|
-
deserialize(value: any, options?:
|
|
49
|
+
deserialize(value: any, options?: OptionsHelper): E;
|
|
44
50
|
/**
|
|
45
51
|
* Serialize the given value for the enum type.
|
|
46
52
|
* @param value Value to serialize
|
|
47
53
|
* @param options Options for serialization
|
|
48
54
|
* @returns Serialized value
|
|
49
55
|
*/
|
|
50
|
-
serialize(value: E, options?:
|
|
56
|
+
serialize(value: E, options?: OptionsHelper): any;
|
|
51
57
|
/**
|
|
52
58
|
* Encode the given value for the enum type.
|
|
53
59
|
* @param value Value to encode
|
|
54
60
|
* @param options Options for encoding
|
|
55
61
|
* @returns Encoded value
|
|
56
62
|
*/
|
|
57
|
-
encode(value: E, options?:
|
|
63
|
+
encode(value: E, options?: OptionsHelper): any;
|
|
58
64
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CallableConfig,
|
|
1
|
+
import { CallableConfig, OptionsHelper, 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> {
|
|
@@ -9,8 +9,8 @@ export declare class ODataParameterParser<T> {
|
|
|
9
9
|
nullable?: boolean;
|
|
10
10
|
optionsHelper?: OptionsHelper;
|
|
11
11
|
constructor(name: string, parameter: Parameter);
|
|
12
|
-
serialize(value: T, options?:
|
|
13
|
-
encode(value: any, options?:
|
|
12
|
+
serialize(value: T, options?: OptionsHelper): any;
|
|
13
|
+
encode(value: any, options?: OptionsHelper): string;
|
|
14
14
|
configure({ parserForType, options, }: {
|
|
15
15
|
parserForType: (type: string) => Parser<any>;
|
|
16
16
|
options: OptionsHelper;
|
|
@@ -31,13 +31,15 @@ export declare class ODataCallableParser<R> implements Parser<R> {
|
|
|
31
31
|
};
|
|
32
32
|
parser: Parser<any>;
|
|
33
33
|
parameters: ODataParameterParser<any>[];
|
|
34
|
+
nonParenthesisForEmptyParameterFunction?: boolean;
|
|
34
35
|
optionsHelper?: OptionsHelper;
|
|
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?: OptionsHelper): R;
|
|
39
|
+
serialize(params: any, options?: OptionsHelper): any;
|
|
40
|
+
encode(params: any, options?: OptionsHelper): any;
|
|
41
|
+
configure({ nonParenthesisForEmptyParameterFunction, parserForType, options, }: {
|
|
42
|
+
nonParenthesisForEmptyParameterFunction: boolean;
|
|
41
43
|
parserForType: (type: string) => Parser<any>;
|
|
42
44
|
options: OptionsHelper;
|
|
43
45
|
}): void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EnumTypeConfig, EnumTypeFieldConfig,
|
|
1
|
+
import { EnumTypeConfig, EnumTypeFieldConfig, OptionsHelper, Parser } from '../../types';
|
|
2
2
|
import { ODataAnnotatable } from '../annotation';
|
|
3
3
|
export declare class ODataEnumTypeFieldParser extends ODataAnnotatable {
|
|
4
4
|
name: string;
|
|
@@ -17,6 +17,7 @@ export declare class ODataEnumTypeParser<T> extends ODataAnnotatable implements
|
|
|
17
17
|
[value: number]: string;
|
|
18
18
|
};
|
|
19
19
|
fields: ODataEnumTypeFieldParser[];
|
|
20
|
+
stringAsEnum?: boolean;
|
|
20
21
|
optionsHelper?: OptionsHelper;
|
|
21
22
|
constructor(config: EnumTypeConfig<T>, namespace: string, alias?: string);
|
|
22
23
|
/**
|
|
@@ -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
|
+
configure({ stringAsEnum, options }: {
|
|
31
|
+
stringAsEnum: boolean;
|
|
30
32
|
options: OptionsHelper;
|
|
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?: OptionsHelper): T;
|
|
36
|
+
serialize(value: T, options?: OptionsHelper): string;
|
|
37
|
+
encode(value: T, options?: OptionsHelper): 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 { OptionsHelper, 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>;
|
|
@@ -57,10 +57,10 @@ 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?: OptionsHelper): T;
|
|
61
61
|
private toJson;
|
|
62
|
-
serialize(value: T, options?:
|
|
63
|
-
encode(value: T, options?:
|
|
62
|
+
serialize(value: T, options?: OptionsHelper): any;
|
|
63
|
+
encode(value: T, options?: OptionsHelper): string;
|
|
64
64
|
configure({ parserForType, options, }: {
|
|
65
65
|
parserForType: (type: string) => Parser<any>;
|
|
66
66
|
options: OptionsHelper;
|
|
@@ -97,9 +97,9 @@ 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?: OptionsHelper): T;
|
|
101
|
+
serialize(value: T, options?: OptionsHelper): any;
|
|
102
|
+
encode(value: T, options?: OptionsHelper): any;
|
|
103
103
|
configure({ parserForType, options, }: {
|
|
104
104
|
parserForType: (type: string) => Parser<any>;
|
|
105
105
|
options: OptionsHelper;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ODataCollection } from '../models';
|
|
2
2
|
import { ODataModel } from '../models/model';
|
|
3
|
-
import {
|
|
3
|
+
import { OptionsHelper, StructuredTypeConfig } from '../types';
|
|
4
4
|
import { ODataSchemaElement } from './element';
|
|
5
5
|
import { JsonSchemaOptions, ODataEntityTypeKey, ODataStructuredTypeFieldParser, ODataStructuredTypeParser } from './parsers';
|
|
6
6
|
import { ODataSchema } from './schema';
|
|
@@ -18,11 +18,17 @@ export declare class ODataStructuredType<T> extends ODataSchemaElement {
|
|
|
18
18
|
findOptionsForType: (type: string) => any;
|
|
19
19
|
}): void;
|
|
20
20
|
/**
|
|
21
|
-
* Returns a boolean indicating if the structured type is a
|
|
21
|
+
* Returns a boolean indicating if the structured type is a subtype of the given type.
|
|
22
22
|
* @param type String representation of the type
|
|
23
23
|
* @returns True if the callable is type of the given type
|
|
24
24
|
*/
|
|
25
25
|
isSubtypeOf(schema: ODataStructuredType<any>): boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Returns a boolean indicating if the structured type is a supertype of the given type.
|
|
28
|
+
* @param type String representation of the type
|
|
29
|
+
* @returns True if the callable is type of the given type
|
|
30
|
+
*/
|
|
31
|
+
isSupertypeOf(schema: ODataStructuredType<any>): boolean;
|
|
26
32
|
/**
|
|
27
33
|
* Returns a boolean indicating if the structured type has a simple key.
|
|
28
34
|
* @returns True if the structured type has a simple key
|
|
@@ -90,21 +96,21 @@ export declare class ODataStructuredType<T> extends ODataSchemaElement {
|
|
|
90
96
|
* @param options Options for deserialization
|
|
91
97
|
* @returns Deserialized value
|
|
92
98
|
*/
|
|
93
|
-
deserialize(value: any, options?:
|
|
99
|
+
deserialize(value: any, options?: OptionsHelper): T;
|
|
94
100
|
/**
|
|
95
101
|
* Serialize the given value for the structured type.
|
|
96
102
|
* @param value Value to serialize
|
|
97
103
|
* @param options Options for serialization
|
|
98
104
|
* @returns Serialized value
|
|
99
105
|
*/
|
|
100
|
-
serialize(value: T, options?:
|
|
106
|
+
serialize(value: T, options?: OptionsHelper): any;
|
|
101
107
|
/**
|
|
102
108
|
* Encode the given value for the structured type.
|
|
103
109
|
* @param value Value to encode
|
|
104
110
|
* @param options Options for encoding
|
|
105
111
|
* @returns Encoded value
|
|
106
112
|
*/
|
|
107
|
-
encode(value: T, options?:
|
|
113
|
+
encode(value: T, options?: OptionsHelper): any;
|
|
108
114
|
/**
|
|
109
115
|
* Resolve the key of the structured type for the given value.
|
|
110
116
|
* @param attrs Attributes of the value
|
package/lib/types.d.ts
CHANGED
|
@@ -30,13 +30,11 @@ export declare enum QueryOptionNames {
|
|
|
30
30
|
skip = "skip",
|
|
31
31
|
skiptoken = "skiptoken",
|
|
32
32
|
format = "format",
|
|
33
|
+
levels = "levels",
|
|
33
34
|
count = "count"
|
|
34
35
|
}
|
|
35
|
-
export interface
|
|
36
|
+
export interface ApiOptions {
|
|
36
37
|
version?: ODataVersion;
|
|
37
|
-
stringAsEnum?: boolean;
|
|
38
|
-
}
|
|
39
|
-
export interface ApiOptions extends Options {
|
|
40
38
|
params?: {
|
|
41
39
|
[param: string]: string | string[];
|
|
42
40
|
};
|
|
@@ -63,9 +61,12 @@ export interface ApiOptions extends Options {
|
|
|
63
61
|
stripMetadata?: ODataMetadataType;
|
|
64
62
|
fetchPolicy?: FetchPolicy;
|
|
65
63
|
bodyQueryOptions?: QueryOptionNames[];
|
|
64
|
+
stringAsEnum?: boolean;
|
|
66
65
|
deleteRefBy?: 'path' | 'id';
|
|
66
|
+
nonParenthesisForEmptyParameterFunction?: boolean;
|
|
67
67
|
}
|
|
68
|
-
export interface OptionsHelper
|
|
68
|
+
export interface OptionsHelper {
|
|
69
|
+
version?: ODataVersion;
|
|
69
70
|
helper: ODataVersionHelper;
|
|
70
71
|
exponentialDecimals?: boolean;
|
|
71
72
|
metadata?: ODataMetadataType;
|