angular-odata 0.131.0 → 0.140.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/fesm2022/angular-odata.mjs +276 -543
- package/fesm2022/angular-odata.mjs.map +1 -1
- package/index.d.ts +6403 -3
- package/package.json +3 -3
- package/schematics/apigen/angular/base.js +2 -6
- package/schematics/apigen/angular/base.js.map +1 -1
- package/schematics/apigen/angular/entity.js +1 -2
- package/schematics/apigen/angular/entity.js.map +1 -1
- package/schematics/apigen/index.js +2 -6
- package/schematics/apigen/index.js.map +1 -1
- package/schematics/apigen/metadata/csdl/csdl-annotation.js +1 -2
- package/schematics/apigen/metadata/csdl/csdl-annotation.js.map +1 -1
- package/schematics/apigen/metadata/csdl/csdl-entity-container.js.map +1 -1
- package/schematics/apigen/metadata/csdl/csdl-entity-set.js.map +1 -1
- package/schematics/apigen/metadata/csdl/csdl-enum-type.d.ts +1 -1
- package/schematics/apigen/metadata/csdl/csdl-enum-type.js +1 -1
- package/schematics/apigen/metadata/csdl/csdl-enum-type.js.map +1 -1
- package/schematics/apigen/metadata/csdl/csdl-function-action.d.ts +1 -1
- package/schematics/apigen/metadata/csdl/csdl-reference.js +1 -2
- package/schematics/apigen/metadata/csdl/csdl-reference.js.map +1 -1
- package/schematics/apigen/metadata/csdl/csdl-schema.js +1 -2
- package/schematics/apigen/metadata/csdl/csdl-schema.js.map +1 -1
- package/schematics/apigen/metadata/csdl/csdl-singleton.js.map +1 -1
- package/schematics/apigen/metadata/csdl/csdl-structural-property.d.ts +1 -1
- package/schematics/apigen/metadata/csdl/csdl-structural-property.js +2 -3
- package/schematics/apigen/metadata/csdl/csdl-structural-property.js.map +1 -1
- package/schematics/apigen/metadata/csdl/csdl-structured-type.d.ts +1 -1
- package/schematics/apigen/metadata/csdl/csdl-structured-type.js +1 -2
- package/schematics/apigen/metadata/csdl/csdl-structured-type.js.map +1 -1
- package/schematics/apigen/metadata/parser.js +1 -3
- package/schematics/apigen/metadata/parser.js.map +1 -1
- package/schematics/apigen/utils.js +2 -4
- package/schematics/apigen/utils.js.map +1 -1
- package/lib/annotations.d.ts +0 -75
- package/lib/api.d.ts +0 -107
- package/lib/cache/cache.d.ts +0 -104
- package/lib/cache/index.d.ts +0 -3
- package/lib/cache/memory.d.ts +0 -19
- package/lib/cache/storage.d.ts +0 -35
- package/lib/client.d.ts +0 -613
- package/lib/constants.d.ts +0 -70
- package/lib/helper.d.ts +0 -75
- package/lib/index.d.ts +0 -14
- package/lib/loaders.d.ts +0 -21
- package/lib/metadata/csdl/csdl-annotation.d.ts +0 -159
- package/lib/metadata/csdl/csdl-entity-container.d.ts +0 -31
- package/lib/metadata/csdl/csdl-entity-set.d.ts +0 -25
- package/lib/metadata/csdl/csdl-enum-type.d.ts +0 -37
- package/lib/metadata/csdl/csdl-function-action.d.ts +0 -148
- package/lib/metadata/csdl/csdl-navigation-property-binding.d.ts +0 -12
- package/lib/metadata/csdl/csdl-reference.d.ts +0 -53
- package/lib/metadata/csdl/csdl-schema.d.ts +0 -37
- package/lib/metadata/csdl/csdl-singleton.d.ts +0 -21
- package/lib/metadata/csdl/csdl-structural-property.d.ts +0 -86
- package/lib/metadata/csdl/csdl-structured-type.d.ts +0 -94
- package/lib/metadata/csdl/csdl-type-definition.d.ts +0 -25
- package/lib/metadata/index.d.ts +0 -2
- package/lib/metadata/metadata.d.ts +0 -23
- package/lib/metadata/parser.d.ts +0 -110
- package/lib/models/collection.d.ts +0 -183
- package/lib/models/index.d.ts +0 -3
- package/lib/models/model.d.ts +0 -176
- package/lib/models/options.d.ts +0 -368
- package/lib/module.d.ts +0 -19
- package/lib/options.d.ts +0 -101
- package/lib/resources/index.d.ts +0 -6
- package/lib/resources/options.d.ts +0 -18
- package/lib/resources/path/handlers.d.ts +0 -29
- package/lib/resources/path/index.d.ts +0 -2
- package/lib/resources/path/segments.d.ts +0 -54
- package/lib/resources/query/builder.d.ts +0 -103
- package/lib/resources/query/expressions/apply.d.ts +0 -125
- package/lib/resources/query/expressions/base.d.ts +0 -25
- package/lib/resources/query/expressions/compute.d.ts +0 -39
- package/lib/resources/query/expressions/count.d.ts +0 -58
- package/lib/resources/query/expressions/expand.d.ts +0 -69
- package/lib/resources/query/expressions/filter.d.ts +0 -77
- package/lib/resources/query/expressions/index.d.ts +0 -9
- package/lib/resources/query/expressions/orderby.d.ts +0 -55
- package/lib/resources/query/expressions/search.d.ts +0 -63
- package/lib/resources/query/expressions/select.d.ts +0 -34
- package/lib/resources/query/expressions/syntax.d.ts +0 -313
- package/lib/resources/query/handlers.d.ts +0 -270
- package/lib/resources/query/index.d.ts +0 -4
- package/lib/resources/query/options.d.ts +0 -60
- package/lib/resources/request.d.ts +0 -64
- package/lib/resources/resource.d.ts +0 -161
- package/lib/resources/response.d.ts +0 -82
- package/lib/resources/types/action.d.ts +0 -84
- package/lib/resources/types/batch.d.ts +0 -62
- package/lib/resources/types/count.d.ts +0 -20
- package/lib/resources/types/entity-set.d.ts +0 -79
- package/lib/resources/types/entity.d.ts +0 -54
- package/lib/resources/types/function.d.ts +0 -108
- package/lib/resources/types/index.d.ts +0 -14
- package/lib/resources/types/media.d.ts +0 -28
- package/lib/resources/types/metadata.d.ts +0 -13
- package/lib/resources/types/navigation-property.d.ts +0 -157
- package/lib/resources/types/options.d.ts +0 -32
- package/lib/resources/types/property.d.ts +0 -115
- package/lib/resources/types/reference.d.ts +0 -74
- package/lib/resources/types/singleton.d.ts +0 -87
- package/lib/resources/types/value.d.ts +0 -19
- package/lib/schema/annotation.d.ts +0 -28
- package/lib/schema/callable.d.ts +0 -41
- package/lib/schema/element.d.ts +0 -52
- package/lib/schema/entity-container.d.ts +0 -10
- package/lib/schema/entity-set.d.ts +0 -10
- package/lib/schema/enum-type.d.ts +0 -55
- package/lib/schema/index.d.ts +0 -8
- package/lib/schema/parsers/callable.d.ts +0 -47
- package/lib/schema/parsers/edm.d.ts +0 -4
- package/lib/schema/parsers/enum-type.d.ts +0 -56
- package/lib/schema/parsers/index.d.ts +0 -4
- package/lib/schema/parsers/structured-type.d.ts +0 -172
- package/lib/schema/schema.d.ts +0 -26
- package/lib/schema/singleton.d.ts +0 -10
- package/lib/schema/structured-type.d.ts +0 -152
- package/lib/services/base.d.ts +0 -20
- package/lib/services/entity-set.d.ts +0 -120
- package/lib/services/entity.d.ts +0 -11
- package/lib/services/factory.d.ts +0 -33
- package/lib/services/index.d.ts +0 -4
- package/lib/services/singleton.d.ts +0 -44
- package/lib/settings.d.ts +0 -26
- package/lib/types.d.ts +0 -285
- package/lib/utils/arraybuffers.d.ts +0 -4
- package/lib/utils/arrays.d.ts +0 -3
- package/lib/utils/dates.d.ts +0 -3
- package/lib/utils/durations.d.ts +0 -14
- package/lib/utils/enums.d.ts +0 -23
- package/lib/utils/http.d.ts +0 -22
- package/lib/utils/index.d.ts +0 -9
- package/lib/utils/objects.d.ts +0 -37
- package/lib/utils/odata.d.ts +0 -4
- package/lib/utils/strings.d.ts +0 -7
- package/lib/utils/types.d.ts +0 -11
- package/lib/utils/urls.d.ts +0 -4
- package/public-api.d.ts +0 -1
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { ODataAnnotationConfig } from '../types';
|
|
2
|
-
export declare class ODataAnnotation {
|
|
3
|
-
term: string;
|
|
4
|
-
string?: string;
|
|
5
|
-
bool?: boolean;
|
|
6
|
-
int?: number;
|
|
7
|
-
permissions?: string[];
|
|
8
|
-
properties?: string[];
|
|
9
|
-
constructor(annot: ODataAnnotationConfig);
|
|
10
|
-
}
|
|
11
|
-
export declare class ODataAnnotatable {
|
|
12
|
-
annotations: ODataAnnotation[];
|
|
13
|
-
constructor(config: {
|
|
14
|
-
annotations?: ODataAnnotationConfig[];
|
|
15
|
-
});
|
|
16
|
-
/**
|
|
17
|
-
* Find an annotation inside the annotatable.
|
|
18
|
-
* @param predicate Function that returns true if the annotation match.
|
|
19
|
-
* @returns The annotation that matches the predicate.
|
|
20
|
-
*/
|
|
21
|
-
findAnnotation(predicate: (annot: ODataAnnotation) => boolean): ODataAnnotation | undefined;
|
|
22
|
-
/**
|
|
23
|
-
* Find an annotation inside the annotatable and return its value.
|
|
24
|
-
* @param term The term of the annotation to find.
|
|
25
|
-
* @returns The value of the annotation.
|
|
26
|
-
*/
|
|
27
|
-
annotatedValue<T>(term: string | RegExp): T | undefined;
|
|
28
|
-
}
|
package/lib/schema/callable.d.ts
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { ODataCallableConfig, ParserOptions } from '../types';
|
|
2
|
-
import { ODataParserSchemaElement } from './element';
|
|
3
|
-
import { ODataCallableParser } from './parsers';
|
|
4
|
-
import { ODataSchema } from './schema';
|
|
5
|
-
export declare class ODataCallable<R> extends ODataParserSchemaElement<R, ODataCallableParser<R>> {
|
|
6
|
-
entitySetPath?: string;
|
|
7
|
-
bound?: boolean;
|
|
8
|
-
composable?: boolean;
|
|
9
|
-
constructor(config: ODataCallableConfig, schema: ODataSchema);
|
|
10
|
-
path(): string;
|
|
11
|
-
configure({ options }: {
|
|
12
|
-
options: ParserOptions;
|
|
13
|
-
}): void;
|
|
14
|
-
/**
|
|
15
|
-
* Deseialize the given value from the callable.
|
|
16
|
-
* @param value Value to deserialize
|
|
17
|
-
* @param options Options for deserialization
|
|
18
|
-
* @returns Deserialized value
|
|
19
|
-
*/
|
|
20
|
-
deserialize(value: any, options?: ParserOptions): any;
|
|
21
|
-
/**
|
|
22
|
-
* Serialize the given value for the callable.
|
|
23
|
-
* @param value Value to serialize
|
|
24
|
-
* @param options Options for serialization
|
|
25
|
-
* @returns Serialized value
|
|
26
|
-
*/
|
|
27
|
-
serialize(value: any, options?: ParserOptions): any;
|
|
28
|
-
/**
|
|
29
|
-
* Encode the given value for the callable.
|
|
30
|
-
* @param value Value to encode
|
|
31
|
-
* @param options Options for encoding
|
|
32
|
-
* @returns Encoded value
|
|
33
|
-
*/
|
|
34
|
-
encode(value: any, options?: ParserOptions): any;
|
|
35
|
-
/**
|
|
36
|
-
* Returns the binding parameter of the callable.
|
|
37
|
-
* @returns The binding parameter of the callable.
|
|
38
|
-
*/
|
|
39
|
-
binding(): import("angular-odata").ODataParameterParser<any> | undefined;
|
|
40
|
-
returnType(): string | undefined;
|
|
41
|
-
}
|
package/lib/schema/element.d.ts
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { ODataAnnotationConfig, Parser } from '../types';
|
|
2
|
-
import { ODataAnnotatable } from './annotation';
|
|
3
|
-
import { ODataSchema } from './schema';
|
|
4
|
-
export declare class ODataSchemaElement extends ODataAnnotatable {
|
|
5
|
-
name: string;
|
|
6
|
-
schema: ODataSchema;
|
|
7
|
-
constructor(config: {
|
|
8
|
-
annotations?: ODataAnnotationConfig[];
|
|
9
|
-
name: string;
|
|
10
|
-
}, schema: ODataSchema);
|
|
11
|
-
get api(): import("angular-odata").ODataApi;
|
|
12
|
-
/**
|
|
13
|
-
* Create a nicer looking title.
|
|
14
|
-
* Titleize is meant for creating pretty output.
|
|
15
|
-
* @param term The term of the annotation to find.
|
|
16
|
-
* @returns The titleized string.
|
|
17
|
-
*/
|
|
18
|
-
titleize(term?: string | RegExp): string;
|
|
19
|
-
/**
|
|
20
|
-
* Returns a full type of the structured type including the namespace/alias.
|
|
21
|
-
* @param alias Use the alias of the namespace instead of the namespace.
|
|
22
|
-
* @returns The string representation of the type.
|
|
23
|
-
*/
|
|
24
|
-
type({ alias }?: {
|
|
25
|
-
alias?: boolean;
|
|
26
|
-
}): string;
|
|
27
|
-
/**
|
|
28
|
-
* Returns a boolean indicating if the structured type is of the given type.
|
|
29
|
-
* @param type String representation of the type
|
|
30
|
-
* @returns True if the callable is type of the given type
|
|
31
|
-
*/
|
|
32
|
-
isTypeOf(element: ODataSchemaElement): boolean;
|
|
33
|
-
/**
|
|
34
|
-
* Returns a boolean indicating if the structured type is a subtype of the given type.
|
|
35
|
-
* @param type String representation of the type
|
|
36
|
-
* @returns True if the callable is type of the given type
|
|
37
|
-
*/
|
|
38
|
-
isSubtypeOf(element: 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(element: ODataSchemaElement): boolean;
|
|
45
|
-
}
|
|
46
|
-
export declare class ODataParserSchemaElement<E, P extends Parser<E>> extends ODataSchemaElement {
|
|
47
|
-
parser: P;
|
|
48
|
-
constructor(config: {
|
|
49
|
-
annotations?: ODataAnnotationConfig[];
|
|
50
|
-
name: string;
|
|
51
|
-
}, schema: ODataSchema, parser: P);
|
|
52
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { ODataEntityContainerConfig } from '../types';
|
|
2
|
-
import { ODataSchemaElement } from './element';
|
|
3
|
-
import { ODataEntitySet } from './entity-set';
|
|
4
|
-
import { ODataSchema } from './schema';
|
|
5
|
-
import { ODataSingleton } from './singleton';
|
|
6
|
-
export declare class ODataEntityContainer extends ODataSchemaElement {
|
|
7
|
-
entitySets: ODataEntitySet[];
|
|
8
|
-
singletons: ODataSingleton[];
|
|
9
|
-
constructor(config: ODataEntityContainerConfig, schema: ODataSchema);
|
|
10
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { ODataEntitySetConfig } from '../types';
|
|
2
|
-
import { ODataSchemaElement } from './element';
|
|
3
|
-
import { ODataSchema } from './schema';
|
|
4
|
-
export declare class ODataEntitySet extends ODataSchemaElement {
|
|
5
|
-
entityType: string;
|
|
6
|
-
service: {
|
|
7
|
-
new (...params: any[]): any;
|
|
8
|
-
};
|
|
9
|
-
constructor(config: ODataEntitySetConfig, schema: ODataSchema);
|
|
10
|
-
}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { ODataEnumTypeConfig, ParserOptions } from '../types';
|
|
2
|
-
import { ODataParserSchemaElement } from './element';
|
|
3
|
-
import { ODataEnumTypeFieldParser, ODataEnumTypeParser } from './parsers';
|
|
4
|
-
import { ODataSchema } from './schema';
|
|
5
|
-
export declare class ODataEnumType<E> extends ODataParserSchemaElement<E, ODataEnumTypeParser<E>> {
|
|
6
|
-
members: {
|
|
7
|
-
[name: string]: number;
|
|
8
|
-
} | {
|
|
9
|
-
[value: number]: string;
|
|
10
|
-
};
|
|
11
|
-
constructor(config: ODataEnumTypeConfig, schema: ODataSchema);
|
|
12
|
-
configure({ options }: {
|
|
13
|
-
options: ParserOptions;
|
|
14
|
-
}): void;
|
|
15
|
-
/**
|
|
16
|
-
* Returns the fields of the enum type.
|
|
17
|
-
* @returns The fields of the enum type.
|
|
18
|
-
*/
|
|
19
|
-
fields(namesValue?: string | number): ODataEnumTypeFieldParser[];
|
|
20
|
-
/**
|
|
21
|
-
* Find a field by name or value.
|
|
22
|
-
* @param enu The name or value of the field
|
|
23
|
-
* @returns The field with the given name or value
|
|
24
|
-
*/
|
|
25
|
-
field(nameValue: string | number): ODataEnumTypeFieldParser | undefined;
|
|
26
|
-
/**
|
|
27
|
-
* Map the fields of the enum type.
|
|
28
|
-
* @param mapper Function that maps the value to the new value
|
|
29
|
-
* @returns The fields mapped by the mapper
|
|
30
|
-
*/
|
|
31
|
-
mapFields<T>(mapper: (field: ODataEnumTypeFieldParser) => T): T[];
|
|
32
|
-
/**
|
|
33
|
-
* Deseialize the given value from the enum type.
|
|
34
|
-
* @param value Value to deserialize
|
|
35
|
-
* @param options Options for deserialization
|
|
36
|
-
* @returns Deserialized value
|
|
37
|
-
*/
|
|
38
|
-
deserialize(value: any, options?: ParserOptions): E;
|
|
39
|
-
/**
|
|
40
|
-
* Serialize the given value for the enum type.
|
|
41
|
-
* @param value Value to serialize
|
|
42
|
-
* @param options Options for serialization
|
|
43
|
-
* @returns Serialized value
|
|
44
|
-
*/
|
|
45
|
-
serialize(value: number, options?: ParserOptions): any;
|
|
46
|
-
/**
|
|
47
|
-
* Encode the given value for the enum type.
|
|
48
|
-
* @param value Value to encode
|
|
49
|
-
* @param options Options for encoding
|
|
50
|
-
* @returns Encoded value
|
|
51
|
-
*/
|
|
52
|
-
encode(value: number, options?: ParserOptions): any;
|
|
53
|
-
unpack(value: string | number): number[];
|
|
54
|
-
pack(value: string | number | number[]): number;
|
|
55
|
-
}
|
package/lib/schema/index.d.ts
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { ODataCallableConfig, ParserOptions, ODataParameterConfig, Parser } from '../../types';
|
|
2
|
-
import { ODataEnumTypeParser } from './enum-type';
|
|
3
|
-
import { ODataStructuredTypeParser } from './structured-type';
|
|
4
|
-
export declare class ODataParameterParser<T> {
|
|
5
|
-
name: string;
|
|
6
|
-
type: string;
|
|
7
|
-
private parser;
|
|
8
|
-
collection?: boolean;
|
|
9
|
-
nullable?: boolean;
|
|
10
|
-
parserOptions?: ParserOptions;
|
|
11
|
-
constructor(name: string, parameter: ODataParameterConfig);
|
|
12
|
-
serialize(value: T, options?: ParserOptions): any;
|
|
13
|
-
encode(value: any, options?: ParserOptions): string;
|
|
14
|
-
configure({ options, parserForType, }: {
|
|
15
|
-
options: ParserOptions;
|
|
16
|
-
parserForType: (type: string) => Parser<any>;
|
|
17
|
-
}): void;
|
|
18
|
-
isEdmType(): boolean;
|
|
19
|
-
isEnumType(): boolean;
|
|
20
|
-
enumType(): ODataEnumTypeParser<T>;
|
|
21
|
-
isStructuredType(): boolean;
|
|
22
|
-
structuredType(): ODataStructuredTypeParser<T>;
|
|
23
|
-
field<F>(name: string): import("angular-odata").ODataStructuredTypeFieldParser<F>;
|
|
24
|
-
}
|
|
25
|
-
export declare class ODataCallableParser<R> implements Parser<R> {
|
|
26
|
-
name: string;
|
|
27
|
-
namespace: string;
|
|
28
|
-
alias?: string;
|
|
29
|
-
return?: {
|
|
30
|
-
type: string;
|
|
31
|
-
collection?: boolean;
|
|
32
|
-
};
|
|
33
|
-
parser: Parser<any>;
|
|
34
|
-
parameters: ODataParameterParser<any>[];
|
|
35
|
-
parserOptions?: ParserOptions;
|
|
36
|
-
constructor(config: ODataCallableConfig, namespace: string, alias?: string);
|
|
37
|
-
isTypeOf(type: string): boolean;
|
|
38
|
-
deserialize(value: any, options?: ParserOptions): R;
|
|
39
|
-
serialize(params: any, options?: ParserOptions): any;
|
|
40
|
-
encode(params: any, options?: ParserOptions): any;
|
|
41
|
-
configure({ options, parserForType, }: {
|
|
42
|
-
options: ParserOptions;
|
|
43
|
-
parserForType: (type: string) => Parser<any>;
|
|
44
|
-
}): void;
|
|
45
|
-
binding(): ODataParameterParser<any> | undefined;
|
|
46
|
-
returnType(): string | undefined;
|
|
47
|
-
}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { ODataEnumTypeConfig, ODataEnumTypeFieldConfig, ParserOptions, FieldParser, JsonType } from '../../types';
|
|
2
|
-
import { ODataAnnotatable } from '../annotation';
|
|
3
|
-
export declare class ODataEnumTypeFieldParser extends ODataAnnotatable {
|
|
4
|
-
name: string;
|
|
5
|
-
value: number;
|
|
6
|
-
constructor(name: string, field: ODataEnumTypeFieldConfig);
|
|
7
|
-
titleize(term?: string | RegExp): string;
|
|
8
|
-
}
|
|
9
|
-
export declare class ODataEnumTypeParser<E> extends ODataAnnotatable implements FieldParser<E> {
|
|
10
|
-
name: string;
|
|
11
|
-
namespace: string;
|
|
12
|
-
alias?: string;
|
|
13
|
-
flags?: boolean;
|
|
14
|
-
members: {
|
|
15
|
-
[name: string]: number;
|
|
16
|
-
} | {
|
|
17
|
-
[value: number]: string;
|
|
18
|
-
};
|
|
19
|
-
private _fields;
|
|
20
|
-
parserOptions?: ParserOptions;
|
|
21
|
-
constructor(config: ODataEnumTypeConfig, namespace: string, alias?: string);
|
|
22
|
-
configure({ options }: {
|
|
23
|
-
options: ParserOptions;
|
|
24
|
-
}): void;
|
|
25
|
-
isTypeOf(type: string): boolean;
|
|
26
|
-
fields(namesValue?: string | number | number[]): ODataEnumTypeFieldParser[];
|
|
27
|
-
field(nameValue: string | number): ODataEnumTypeFieldParser | undefined;
|
|
28
|
-
/**
|
|
29
|
-
* Map the fields of the enum type.
|
|
30
|
-
* @param mapper Function that maps the value to the new value
|
|
31
|
-
* @returns The fields mapped by the mapper
|
|
32
|
-
*/
|
|
33
|
-
mapFields<R>(mapper: (field: ODataEnumTypeFieldParser) => R): R[];
|
|
34
|
-
deserialize(value: string, options?: ParserOptions): E;
|
|
35
|
-
serialize(value: number, options?: ParserOptions): string | undefined;
|
|
36
|
-
encode(value: number, options?: ParserOptions): any;
|
|
37
|
-
toJsonSchema(): {
|
|
38
|
-
title: string;
|
|
39
|
-
type: JsonType;
|
|
40
|
-
items: {
|
|
41
|
-
type: JsonType;
|
|
42
|
-
};
|
|
43
|
-
enum?: undefined;
|
|
44
|
-
} | {
|
|
45
|
-
type: JsonType;
|
|
46
|
-
enum: number[];
|
|
47
|
-
title?: undefined;
|
|
48
|
-
items?: undefined;
|
|
49
|
-
};
|
|
50
|
-
validate(value: string | number, { method, navigation, }?: {
|
|
51
|
-
method?: 'create' | 'update' | 'modify';
|
|
52
|
-
navigation?: boolean;
|
|
53
|
-
}): string[] | undefined;
|
|
54
|
-
unpack(value: string | number): number[];
|
|
55
|
-
pack(value: string | number | number[]): number;
|
|
56
|
-
}
|
|
@@ -1,172 +0,0 @@
|
|
|
1
|
-
import { ParserOptions, Parser, ODataStructuredTypeConfig, ODataStructuredTypeFieldConfig, FieldParser, EdmType } from '../../types';
|
|
2
|
-
import { ODataAnnotatable } from '../annotation';
|
|
3
|
-
import { ODataEnumTypeParser } from './enum-type';
|
|
4
|
-
type JsonSchemaSelect<T> = Array<keyof T>;
|
|
5
|
-
type JsonSchemaCustom<T> = {
|
|
6
|
-
[P in keyof T]?: (schema: any, field: ODataStructuredTypeFieldParser<T[P]>) => any;
|
|
7
|
-
};
|
|
8
|
-
type JsonSchemaExpand<T> = {
|
|
9
|
-
[P in keyof T]?: JsonSchemaOptions<T[P]>;
|
|
10
|
-
};
|
|
11
|
-
type JsonSchemaRequired<T> = {
|
|
12
|
-
[P in keyof T]?: boolean;
|
|
13
|
-
};
|
|
14
|
-
export type JsonSchemaOptions<T> = {
|
|
15
|
-
select?: JsonSchemaSelect<T>;
|
|
16
|
-
custom?: JsonSchemaCustom<T>;
|
|
17
|
-
expand?: JsonSchemaExpand<T>;
|
|
18
|
-
required?: JsonSchemaRequired<T>;
|
|
19
|
-
};
|
|
20
|
-
export declare class ODataEntityTypeKey {
|
|
21
|
-
name: string;
|
|
22
|
-
alias?: string;
|
|
23
|
-
constructor({ name, alias }: {
|
|
24
|
-
name: string;
|
|
25
|
-
alias?: string;
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
export declare class ODataReferential {
|
|
29
|
-
property: string;
|
|
30
|
-
referencedProperty: string;
|
|
31
|
-
constructor({ property, referencedProperty, }: {
|
|
32
|
-
property: string;
|
|
33
|
-
referencedProperty: string;
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
export declare class ODataStructuredTypeFieldParser<T> extends ODataAnnotatable implements FieldParser<T> {
|
|
37
|
-
name: string;
|
|
38
|
-
private structured;
|
|
39
|
-
type: string | EdmType;
|
|
40
|
-
private parser;
|
|
41
|
-
collection: boolean;
|
|
42
|
-
navigation: boolean;
|
|
43
|
-
nullable?: boolean;
|
|
44
|
-
default?: any;
|
|
45
|
-
maxLength?: number;
|
|
46
|
-
precision?: number;
|
|
47
|
-
scale?: number | 'variable';
|
|
48
|
-
referentials: ODataReferential[];
|
|
49
|
-
parserOptions?: ParserOptions;
|
|
50
|
-
constructor(name: string, structured: ODataStructuredTypeParser<any>, field: ODataStructuredTypeFieldConfig);
|
|
51
|
-
validate(value: any, { method, navigation, }?: {
|
|
52
|
-
method?: 'create' | 'update' | 'modify';
|
|
53
|
-
navigation?: boolean;
|
|
54
|
-
}): {
|
|
55
|
-
[name: string]: any;
|
|
56
|
-
} | {
|
|
57
|
-
[name: string]: any;
|
|
58
|
-
}[] | string[] | undefined;
|
|
59
|
-
private parse;
|
|
60
|
-
deserialize(value: any, options?: ParserOptions): T;
|
|
61
|
-
private toJson;
|
|
62
|
-
serialize(value: T, options?: ParserOptions): any;
|
|
63
|
-
encode(value: T, options?: ParserOptions): string;
|
|
64
|
-
configure({ options, parserForType, }: {
|
|
65
|
-
options: ParserOptions;
|
|
66
|
-
parserForType: (type: string) => Parser<any>;
|
|
67
|
-
}): void;
|
|
68
|
-
toJsonSchema(options?: JsonSchemaOptions<T>): any;
|
|
69
|
-
isKey(): boolean;
|
|
70
|
-
hasReferentials(): boolean;
|
|
71
|
-
isEdmType(): boolean;
|
|
72
|
-
isEnumType(): boolean;
|
|
73
|
-
enumType(): ODataEnumTypeParser<T>;
|
|
74
|
-
isStructuredType(): boolean;
|
|
75
|
-
structuredType(): ODataStructuredTypeParser<T>;
|
|
76
|
-
field<F>(name: string): ODataStructuredTypeFieldParser<F>;
|
|
77
|
-
}
|
|
78
|
-
export declare class ODataStructuredTypeParser<T> extends ODataAnnotatable implements Parser<T> {
|
|
79
|
-
name: string;
|
|
80
|
-
namespace: string;
|
|
81
|
-
open: boolean;
|
|
82
|
-
children: ODataStructuredTypeParser<any>[];
|
|
83
|
-
alias?: string;
|
|
84
|
-
base?: string;
|
|
85
|
-
parent?: ODataStructuredTypeParser<any>;
|
|
86
|
-
private _keys?;
|
|
87
|
-
private _fields;
|
|
88
|
-
parserOptions?: ParserOptions;
|
|
89
|
-
constructor(config: ODataStructuredTypeConfig, namespace: string, alias?: string);
|
|
90
|
-
addField<F>(name: string, config: ODataStructuredTypeFieldConfig): ODataStructuredTypeFieldParser<F>;
|
|
91
|
-
/**
|
|
92
|
-
* Create a nicer looking title.
|
|
93
|
-
* Titleize is meant for creating pretty output.
|
|
94
|
-
* @param term The term of the annotation to find.
|
|
95
|
-
* @returns The titleized string.
|
|
96
|
-
*/
|
|
97
|
-
titleize(term?: string | RegExp): string;
|
|
98
|
-
isTypeOf(type: string): boolean;
|
|
99
|
-
isSubtypeOf(type: string): boolean;
|
|
100
|
-
isSupertypeOf(type: string): boolean;
|
|
101
|
-
isOpenType(): boolean;
|
|
102
|
-
findChildParser(predicate: (p: ODataStructuredTypeParser<any>) => boolean): ODataStructuredTypeParser<any> | undefined;
|
|
103
|
-
childParser(predicate: (p: ODataStructuredTypeParser<any>) => boolean): Parser<any>;
|
|
104
|
-
deserialize(value: any, options?: ParserOptions): T;
|
|
105
|
-
serialize(value: Partial<T>, options?: ParserOptions): any;
|
|
106
|
-
encode(value: T, options?: ParserOptions): any;
|
|
107
|
-
configure({ options, parserForType, }: {
|
|
108
|
-
options: ParserOptions;
|
|
109
|
-
parserForType: (type: string) => Parser<any>;
|
|
110
|
-
}): void;
|
|
111
|
-
/**
|
|
112
|
-
* Returns all fields of the structured type.
|
|
113
|
-
* @param include_navigation Include navigation properties in the result.
|
|
114
|
-
* @param include_parents Include the parent types in the result.
|
|
115
|
-
* @returns All fields of the structured type.
|
|
116
|
-
*/
|
|
117
|
-
fields({ include_navigation, include_parents, }: {
|
|
118
|
-
include_parents: boolean;
|
|
119
|
-
include_navigation: boolean;
|
|
120
|
-
}): ODataStructuredTypeFieldParser<any>[];
|
|
121
|
-
/**
|
|
122
|
-
* Returns the keys of the structured type.
|
|
123
|
-
* @param include_parents Include the parent fields
|
|
124
|
-
* @returns The keys of the structured type
|
|
125
|
-
*/
|
|
126
|
-
keys({ include_parents, }: {
|
|
127
|
-
include_parents: boolean;
|
|
128
|
-
}): ODataEntityTypeKey[];
|
|
129
|
-
isEntityType(): boolean;
|
|
130
|
-
isComplexType(): boolean;
|
|
131
|
-
/**
|
|
132
|
-
* Find the field parser for the given field name.
|
|
133
|
-
* @param name Name of the field
|
|
134
|
-
* @returns The field parser
|
|
135
|
-
*/
|
|
136
|
-
field<F>(name: keyof T): ODataStructuredTypeFieldParser<F>;
|
|
137
|
-
/**
|
|
138
|
-
* Picks the fields from attributes.
|
|
139
|
-
* @param attrs
|
|
140
|
-
* @param include_parents Include the parent fields
|
|
141
|
-
* @param include_navigation Include the navigation fields
|
|
142
|
-
* @param include_etag Include the etag field
|
|
143
|
-
* @returns The picked fields
|
|
144
|
-
*/
|
|
145
|
-
pick(attrs: {
|
|
146
|
-
[name: string]: any;
|
|
147
|
-
}, { include_id, include_key, include_parents, include_navigation, include_computed, include_etag, options, }?: {
|
|
148
|
-
include_id?: boolean;
|
|
149
|
-
include_key?: boolean;
|
|
150
|
-
include_parents?: boolean;
|
|
151
|
-
include_navigation?: boolean;
|
|
152
|
-
include_computed?: boolean;
|
|
153
|
-
include_etag?: boolean;
|
|
154
|
-
options?: ParserOptions;
|
|
155
|
-
}): Partial<T>;
|
|
156
|
-
resolveKey(value: any, { resolve, single, }?: {
|
|
157
|
-
resolve?: boolean;
|
|
158
|
-
single?: boolean;
|
|
159
|
-
}): any;
|
|
160
|
-
defaults(): {
|
|
161
|
-
[name: string]: any;
|
|
162
|
-
};
|
|
163
|
-
toJsonSchema(options?: JsonSchemaOptions<T>): any;
|
|
164
|
-
validate(attrs: any, { method, navigation, }?: {
|
|
165
|
-
create?: boolean;
|
|
166
|
-
method?: 'create' | 'update' | 'modify';
|
|
167
|
-
navigation?: boolean;
|
|
168
|
-
}): {
|
|
169
|
-
[name: string]: any;
|
|
170
|
-
} | undefined;
|
|
171
|
-
}
|
|
172
|
-
export {};
|
package/lib/schema/schema.d.ts
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { ODataApi } from '../api';
|
|
2
|
-
import { ParserOptions, ODataSchemaConfig, ODataStructuredTypeConfig } from '../types';
|
|
3
|
-
import { ODataAnnotatable } from './annotation';
|
|
4
|
-
import { ODataCallable } from './callable';
|
|
5
|
-
import { ODataEntityContainer } from './entity-container';
|
|
6
|
-
import { ODataEntitySet } from './entity-set';
|
|
7
|
-
import { ODataEnumType } from './enum-type';
|
|
8
|
-
import { ODataSingleton } from './singleton';
|
|
9
|
-
import { ODataStructuredType } from './structured-type';
|
|
10
|
-
export declare class ODataSchema extends ODataAnnotatable {
|
|
11
|
-
api: ODataApi;
|
|
12
|
-
namespace: string;
|
|
13
|
-
alias?: string;
|
|
14
|
-
enums: ODataEnumType<any>[];
|
|
15
|
-
entities: ODataStructuredType<any>[];
|
|
16
|
-
callables: ODataCallable<any>[];
|
|
17
|
-
containers: ODataEntityContainer[];
|
|
18
|
-
constructor(config: ODataSchemaConfig, api: ODataApi);
|
|
19
|
-
isNamespaceOf(type: string): boolean;
|
|
20
|
-
get entitySets(): ODataEntitySet[];
|
|
21
|
-
get singletons(): ODataSingleton[];
|
|
22
|
-
createStructuredType<T>(config: ODataStructuredTypeConfig): ODataStructuredType<T>;
|
|
23
|
-
configure({ options }: {
|
|
24
|
-
options: ParserOptions;
|
|
25
|
-
}): void;
|
|
26
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { ODataSingletonConfig } from '../types';
|
|
2
|
-
import { ODataSchemaElement } from './element';
|
|
3
|
-
import { ODataSchema } from './schema';
|
|
4
|
-
export declare class ODataSingleton extends ODataSchemaElement {
|
|
5
|
-
singletonType: string;
|
|
6
|
-
service: {
|
|
7
|
-
new (...params: any[]): any;
|
|
8
|
-
};
|
|
9
|
-
constructor(config: ODataSingletonConfig, schema: ODataSchema);
|
|
10
|
-
}
|