angular-odata 0.128.0 → 0.131.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 +27 -244
- package/fesm2022/angular-odata.mjs +2320 -1118
- package/fesm2022/angular-odata.mjs.map +1 -1
- package/lib/api.d.ts +10 -11
- package/lib/cache/cache.d.ts +2 -2
- package/lib/cache/memory.d.ts +2 -2
- package/lib/cache/storage.d.ts +2 -2
- package/lib/index.d.ts +1 -0
- package/lib/loaders.d.ts +8 -8
- package/lib/metadata/csdl/csdl-annotation.d.ts +62 -26
- package/lib/metadata/csdl/csdl-entity-container.d.ts +8 -3
- package/lib/metadata/csdl/csdl-entity-set.d.ts +7 -2
- package/lib/metadata/csdl/csdl-enum-type.d.ts +11 -3
- package/lib/metadata/csdl/csdl-function-action.d.ts +54 -11
- package/lib/metadata/csdl/csdl-navigation-property-binding.d.ts +4 -0
- package/lib/metadata/csdl/csdl-reference.d.ts +26 -3
- package/lib/metadata/csdl/csdl-schema.d.ts +5 -2
- package/lib/metadata/csdl/csdl-singleton.d.ts +5 -0
- package/lib/metadata/csdl/csdl-structural-property.d.ts +19 -3
- package/lib/metadata/csdl/csdl-structured-type.d.ts +28 -7
- package/lib/metadata/csdl/csdl-type-definition.d.ts +3 -0
- package/lib/metadata/metadata.d.ts +16 -3
- package/lib/models/collection.d.ts +2 -1
- package/lib/models/model.d.ts +6 -5
- package/lib/models/options.d.ts +11 -4
- package/lib/module.d.ts +3 -3
- package/lib/options.d.ts +3 -3
- package/lib/resources/path/segments.d.ts +3 -3
- package/lib/resources/query/builder.d.ts +3 -2
- package/lib/resources/query/expressions/apply.d.ts +1 -1
- package/lib/resources/query/expressions/compute.d.ts +1 -1
- package/lib/resources/query/expressions/count.d.ts +1 -1
- package/lib/resources/query/expressions/expand.d.ts +5 -2
- package/lib/resources/query/expressions/filter.d.ts +2 -1
- package/lib/resources/query/expressions/orderby.d.ts +2 -1
- package/lib/resources/query/expressions/search.d.ts +2 -1
- package/lib/resources/query/expressions/select.d.ts +2 -1
- package/lib/resources/query/expressions/syntax.d.ts +2 -2
- package/lib/resources/query/handlers.d.ts +17 -5
- package/lib/resources/query/options.d.ts +3 -3
- package/lib/resources/resource.d.ts +36 -8
- package/lib/resources/types/action.d.ts +4 -4
- package/lib/resources/types/entity-set.d.ts +15 -8
- package/lib/resources/types/entity.d.ts +5 -1
- package/lib/resources/types/function.d.ts +4 -4
- package/lib/resources/types/navigation-property.d.ts +12 -3
- package/lib/resources/types/property.d.ts +14 -3
- package/lib/resources/types/singleton.d.ts +5 -1
- package/lib/schema/annotation.d.ts +3 -3
- package/lib/schema/callable.d.ts +3 -3
- package/lib/schema/element.d.ts +3 -3
- package/lib/schema/entity-container.d.ts +2 -2
- package/lib/schema/entity-set.d.ts +2 -2
- package/lib/schema/enum-type.d.ts +10 -10
- package/lib/schema/parsers/callable.d.ts +4 -4
- package/lib/schema/parsers/enum-type.d.ts +15 -15
- package/lib/schema/parsers/structured-type.d.ts +8 -5
- package/lib/schema/schema.d.ts +3 -3
- package/lib/schema/singleton.d.ts +2 -2
- package/lib/schema/structured-type.d.ts +7 -4
- package/lib/services/entity-set.d.ts +9 -6
- package/lib/services/entity.d.ts +1 -1
- package/lib/services/singleton.d.ts +1 -1
- package/lib/settings.d.ts +2 -2
- package/lib/types.d.ts +82 -69
- package/lib/utils/enums.d.ts +12 -12
- package/lib/utils/http.d.ts +1 -1
- package/lib/utils/objects.d.ts +1 -1
- package/lib/utils/odata.d.ts +2 -2
- package/lib/utils/strings.d.ts +2 -2
- package/package.json +3 -5
- package/schematics/apigen/angular/api-config.js +7 -1
- package/schematics/apigen/angular/api-config.js.map +1 -1
- package/schematics/apigen/angular/base.d.ts +22 -2
- package/schematics/apigen/angular/base.js +82 -42
- package/schematics/apigen/angular/base.js.map +1 -1
- package/schematics/apigen/angular/entity.js +7 -1
- package/schematics/apigen/angular/entity.js.map +1 -1
- package/schematics/apigen/angular/enum.js +1 -0
- package/schematics/apigen/angular/enum.js.map +1 -1
- package/schematics/apigen/angular/module.js.map +1 -1
- package/schematics/apigen/angular/service.js +3 -2
- package/schematics/apigen/angular/service.js.map +1 -1
- package/schematics/apigen/files/api-config/__fileName__.ts +8 -6
- package/schematics/apigen/files/entity/__fileName__.ts +2 -2
- package/schematics/apigen/files/entitycontainer-service/__fileName__.ts +1 -1
- package/schematics/apigen/files/entityset-service/__fileName__.ts +1 -1
- package/schematics/apigen/files/enum/__fileName__.ts +1 -1
- package/schematics/apigen/files/metadata/metadata.json +1 -0
- package/schematics/apigen/files/singleton-service/__fileName__.ts +1 -1
- package/schematics/apigen/index.js +56 -12
- package/schematics/apigen/index.js.map +1 -1
- package/schematics/apigen/metadata/csdl/csdl-annotation.d.ts +56 -23
- package/schematics/apigen/metadata/csdl/csdl-annotation.js +143 -13
- package/schematics/apigen/metadata/csdl/csdl-annotation.js.map +1 -1
- package/schematics/apigen/metadata/csdl/csdl-entity-container.d.ts +3 -0
- package/schematics/apigen/metadata/csdl/csdl-entity-container.js +19 -0
- package/schematics/apigen/metadata/csdl/csdl-entity-container.js.map +1 -1
- package/schematics/apigen/metadata/csdl/csdl-entity-set.d.ts +3 -0
- package/schematics/apigen/metadata/csdl/csdl-entity-set.js +11 -0
- package/schematics/apigen/metadata/csdl/csdl-entity-set.js.map +1 -1
- package/schematics/apigen/metadata/csdl/csdl-enum-type.d.ts +6 -0
- package/schematics/apigen/metadata/csdl/csdl-enum-type.js +17 -0
- package/schematics/apigen/metadata/csdl/csdl-enum-type.js.map +1 -1
- package/schematics/apigen/metadata/csdl/csdl-function-action.d.ts +37 -0
- package/schematics/apigen/metadata/csdl/csdl-function-action.js +52 -0
- package/schematics/apigen/metadata/csdl/csdl-function-action.js.map +1 -1
- package/schematics/apigen/metadata/csdl/csdl-navigation-property-binding.d.ts +4 -0
- package/schematics/apigen/metadata/csdl/csdl-navigation-property-binding.js +6 -0
- package/schematics/apigen/metadata/csdl/csdl-navigation-property-binding.js.map +1 -1
- package/schematics/apigen/metadata/csdl/csdl-reference.d.ts +15 -3
- package/schematics/apigen/metadata/csdl/csdl-reference.js +26 -2
- package/schematics/apigen/metadata/csdl/csdl-reference.js.map +1 -1
- package/schematics/apigen/metadata/csdl/csdl-schema.d.ts +3 -0
- package/schematics/apigen/metadata/csdl/csdl-schema.js +37 -0
- package/schematics/apigen/metadata/csdl/csdl-schema.js.map +1 -1
- package/schematics/apigen/metadata/csdl/csdl-singleton.d.ts +3 -0
- package/schematics/apigen/metadata/csdl/csdl-singleton.js +8 -0
- package/schematics/apigen/metadata/csdl/csdl-singleton.js.map +1 -1
- package/schematics/apigen/metadata/csdl/csdl-structural-property.d.ts +16 -0
- package/schematics/apigen/metadata/csdl/csdl-structural-property.js +53 -0
- package/schematics/apigen/metadata/csdl/csdl-structural-property.js.map +1 -1
- package/schematics/apigen/metadata/csdl/csdl-structured-type.d.ts +22 -3
- package/schematics/apigen/metadata/csdl/csdl-structured-type.js +47 -2
- package/schematics/apigen/metadata/csdl/csdl-structured-type.js.map +1 -1
- package/schematics/apigen/metadata/csdl/csdl-type-definition.d.ts +3 -0
- package/schematics/apigen/metadata/csdl/csdl-type-definition.js +19 -0
- package/schematics/apigen/metadata/csdl/csdl-type-definition.js.map +1 -1
- package/schematics/apigen/metadata/metadata.d.ts +10 -0
- package/schematics/apigen/metadata/metadata.js +12 -6
- package/schematics/apigen/metadata/metadata.js.map +1 -1
- package/schematics/apigen/metadata/parser.js.map +1 -1
- package/schematics/apigen/schema.d.ts +2 -1
- package/schematics/apigen/schema.json +15 -14
- package/schematics/apigen/utils.d.ts +1 -0
- package/schematics/apigen/utils.js +25 -1
- package/schematics/apigen/utils.js.map +1 -1
- package/schematics/ng-add/index.js +1 -2
- package/schematics/ng-add/index.js.map +1 -1
- package/esm2022/angular-odata.mjs +0 -5
- package/esm2022/lib/annotations.mjs +0 -140
- package/esm2022/lib/api.mjs +0 -419
- package/esm2022/lib/cache/cache.mjs +0 -175
- package/esm2022/lib/cache/index.mjs +0 -4
- package/esm2022/lib/cache/memory.mjs +0 -30
- package/esm2022/lib/cache/storage.mjs +0 -55
- package/esm2022/lib/client.mjs +0 -212
- package/esm2022/lib/constants.mjs +0 -95
- package/esm2022/lib/helper.mjs +0 -280
- package/esm2022/lib/index.mjs +0 -21
- package/esm2022/lib/loaders.mjs +0 -39
- package/esm2022/lib/metadata/csdl/csdl-annotation.mjs +0 -95
- package/esm2022/lib/metadata/csdl/csdl-entity-container.mjs +0 -27
- package/esm2022/lib/metadata/csdl/csdl-entity-set.mjs +0 -24
- package/esm2022/lib/metadata/csdl/csdl-enum-type.mjs +0 -37
- package/esm2022/lib/metadata/csdl/csdl-function-action.mjs +0 -94
- package/esm2022/lib/metadata/csdl/csdl-navigation-property-binding.mjs +0 -7
- package/esm2022/lib/metadata/csdl/csdl-reference.mjs +0 -23
- package/esm2022/lib/metadata/csdl/csdl-schema.mjs +0 -39
- package/esm2022/lib/metadata/csdl/csdl-singleton.mjs +0 -15
- package/esm2022/lib/metadata/csdl/csdl-structural-property.mjs +0 -70
- package/esm2022/lib/metadata/csdl/csdl-structured-type.mjs +0 -92
- package/esm2022/lib/metadata/csdl/csdl-type-definition.mjs +0 -15
- package/esm2022/lib/metadata/index.mjs +0 -3
- package/esm2022/lib/metadata/metadata.mjs +0 -14
- package/esm2022/lib/metadata/parser.mjs +0 -563
- package/esm2022/lib/models/collection.mjs +0 -814
- package/esm2022/lib/models/index.mjs +0 -4
- package/esm2022/lib/models/model.mjs +0 -553
- package/esm2022/lib/models/options.mjs +0 -1179
- package/esm2022/lib/module.mjs +0 -55
- package/esm2022/lib/options.mjs +0 -36
- package/esm2022/lib/resources/index.mjs +0 -7
- package/esm2022/lib/resources/options.mjs +0 -56
- package/esm2022/lib/resources/path/handlers.mjs +0 -79
- package/esm2022/lib/resources/path/index.mjs +0 -3
- package/esm2022/lib/resources/path/segments.mjs +0 -148
- package/esm2022/lib/resources/query/builder.mjs +0 -636
- package/esm2022/lib/resources/query/expressions/apply.mjs +0 -236
- package/esm2022/lib/resources/query/expressions/base.mjs +0 -25
- package/esm2022/lib/resources/query/expressions/compute.mjs +0 -54
- package/esm2022/lib/resources/query/expressions/count.mjs +0 -116
- package/esm2022/lib/resources/query/expressions/expand.mjs +0 -147
- package/esm2022/lib/resources/query/expressions/filter.mjs +0 -178
- package/esm2022/lib/resources/query/expressions/index.mjs +0 -10
- package/esm2022/lib/resources/query/expressions/orderby.mjs +0 -79
- package/esm2022/lib/resources/query/expressions/search.mjs +0 -141
- package/esm2022/lib/resources/query/expressions/select.mjs +0 -47
- package/esm2022/lib/resources/query/expressions/syntax.mjs +0 -751
- package/esm2022/lib/resources/query/handlers.mjs +0 -420
- package/esm2022/lib/resources/query/index.mjs +0 -5
- package/esm2022/lib/resources/query/options.mjs +0 -139
- package/esm2022/lib/resources/request.mjs +0 -196
- package/esm2022/lib/resources/resource.mjs +0 -311
- package/esm2022/lib/resources/response.mjs +0 -174
- package/esm2022/lib/resources/types/action.mjs +0 -116
- package/esm2022/lib/resources/types/batch.mjs +0 -428
- package/esm2022/lib/resources/types/count.mjs +0 -33
- package/esm2022/lib/resources/types/entity-set.mjs +0 -131
- package/esm2022/lib/resources/types/entity.mjs +0 -112
- package/esm2022/lib/resources/types/function.mjs +0 -146
- package/esm2022/lib/resources/types/index.mjs +0 -15
- package/esm2022/lib/resources/types/media.mjs +0 -44
- package/esm2022/lib/resources/types/metadata.mjs +0 -35
- package/esm2022/lib/resources/types/navigation-property.mjs +0 -256
- package/esm2022/lib/resources/types/options.mjs +0 -2
- package/esm2022/lib/resources/types/property.mjs +0 -197
- package/esm2022/lib/resources/types/reference.mjs +0 -87
- package/esm2022/lib/resources/types/singleton.mjs +0 -130
- package/esm2022/lib/resources/types/value.mjs +0 -48
- package/esm2022/lib/schema/annotation.mjs +0 -37
- package/esm2022/lib/schema/callable.mjs +0 -66
- package/esm2022/lib/schema/element.mjs +0 -67
- package/esm2022/lib/schema/entity-container.mjs +0 -11
- package/esm2022/lib/schema/entity-set.mjs +0 -9
- package/esm2022/lib/schema/enum-type.mjs +0 -68
- package/esm2022/lib/schema/index.mjs +0 -9
- package/esm2022/lib/schema/parsers/callable.mjs +0 -110
- package/esm2022/lib/schema/parsers/edm.mjs +0 -101
- package/esm2022/lib/schema/parsers/enum-type.mjs +0 -130
- package/esm2022/lib/schema/parsers/index.mjs +0 -5
- package/esm2022/lib/schema/parsers/structured-type.mjs +0 -514
- package/esm2022/lib/schema/schema.mjs +0 -45
- package/esm2022/lib/schema/singleton.mjs +0 -9
- package/esm2022/lib/schema/structured-type.mjs +0 -213
- package/esm2022/lib/services/base.mjs +0 -29
- package/esm2022/lib/services/entity-set.mjs +0 -155
- package/esm2022/lib/services/entity.mjs +0 -12
- package/esm2022/lib/services/factory.mjs +0 -44
- package/esm2022/lib/services/index.mjs +0 -5
- package/esm2022/lib/services/singleton.mjs +0 -54
- package/esm2022/lib/settings.mjs +0 -112
- package/esm2022/lib/types.mjs +0 -118
- package/esm2022/lib/utils/arraybuffers.mjs +0 -46
- package/esm2022/lib/utils/arrays.mjs +0 -10
- package/esm2022/lib/utils/dates.mjs +0 -18
- package/esm2022/lib/utils/durations.mjs +0 -40
- package/esm2022/lib/utils/enums.mjs +0 -61
- package/esm2022/lib/utils/http.mjs +0 -95
- package/esm2022/lib/utils/index.mjs +0 -10
- package/esm2022/lib/utils/objects.mjs +0 -204
- package/esm2022/lib/utils/odata.mjs +0 -22
- package/esm2022/lib/utils/strings.mjs +0 -20
- package/esm2022/lib/utils/types.mjs +0 -136
- package/esm2022/lib/utils/urls.mjs +0 -24
- package/esm2022/public-api.mjs +0 -5
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ODataStructuredTypeConfig } from '../../types';
|
|
2
2
|
import { CsdlAnnotable } from './csdl-annotation';
|
|
3
3
|
import { CsdlProperty, CsdlNavigationProperty } from './csdl-structural-property';
|
|
4
4
|
import type { CsdlSchema } from './csdl-schema';
|
|
@@ -19,6 +19,11 @@ export declare class CsdlStructuredType extends CsdlAnnotable {
|
|
|
19
19
|
Abstract?: boolean;
|
|
20
20
|
Annotation?: any[];
|
|
21
21
|
});
|
|
22
|
+
toJson(): {
|
|
23
|
+
[key: string]: any;
|
|
24
|
+
};
|
|
25
|
+
name(): string;
|
|
26
|
+
namespace(): string;
|
|
22
27
|
fullName(): string;
|
|
23
28
|
}
|
|
24
29
|
export declare class CsdlComplexType extends CsdlStructuredType {
|
|
@@ -31,7 +36,10 @@ export declare class CsdlComplexType extends CsdlStructuredType {
|
|
|
31
36
|
Abstract?: boolean;
|
|
32
37
|
Annotation?: any[];
|
|
33
38
|
});
|
|
34
|
-
|
|
39
|
+
toJson(): {
|
|
40
|
+
[x: string]: any;
|
|
41
|
+
};
|
|
42
|
+
toConfig(base?: Partial<ODataStructuredTypeConfig>): ODataStructuredTypeConfig;
|
|
35
43
|
}
|
|
36
44
|
export declare class CsdlEntityType extends CsdlStructuredType {
|
|
37
45
|
Key?: CsdlKey;
|
|
@@ -47,16 +55,25 @@ export declare class CsdlEntityType extends CsdlStructuredType {
|
|
|
47
55
|
HasStream?: boolean;
|
|
48
56
|
Annotation?: any[];
|
|
49
57
|
});
|
|
50
|
-
|
|
58
|
+
toJson(): {
|
|
59
|
+
[key: string]: any;
|
|
60
|
+
};
|
|
61
|
+
toConfig(base?: Partial<ODataStructuredTypeConfig>): ODataStructuredTypeConfig;
|
|
51
62
|
}
|
|
52
63
|
export declare class CsdlKey {
|
|
53
|
-
|
|
54
|
-
constructor({
|
|
55
|
-
|
|
64
|
+
PropertyRef: CsdlPropertyRef[];
|
|
65
|
+
constructor({ PropertyRef }: {
|
|
66
|
+
PropertyRef: any[];
|
|
56
67
|
});
|
|
68
|
+
toJson(): {
|
|
69
|
+
PropertyRef: {
|
|
70
|
+
Name: string;
|
|
71
|
+
Alias: string | undefined;
|
|
72
|
+
}[];
|
|
73
|
+
};
|
|
57
74
|
toConfig(): {
|
|
58
75
|
name: string;
|
|
59
|
-
alias?: string
|
|
76
|
+
alias?: string;
|
|
60
77
|
}[];
|
|
61
78
|
}
|
|
62
79
|
export declare class CsdlPropertyRef {
|
|
@@ -66,6 +83,10 @@ export declare class CsdlPropertyRef {
|
|
|
66
83
|
Name: string;
|
|
67
84
|
Alias?: string;
|
|
68
85
|
});
|
|
86
|
+
toJson(): {
|
|
87
|
+
Name: string;
|
|
88
|
+
Alias: string | undefined;
|
|
89
|
+
};
|
|
69
90
|
toConfig(): {
|
|
70
91
|
name: string;
|
|
71
92
|
alias?: string;
|
|
@@ -1,10 +1,23 @@
|
|
|
1
|
+
import { CsdlAction, CsdlFunction } from './csdl/csdl-function-action';
|
|
1
2
|
import { CsdlReference } from './csdl/csdl-reference';
|
|
2
3
|
import { CsdlSchema } from './csdl/csdl-schema';
|
|
3
|
-
import {
|
|
4
|
+
import { ODataApiConfig } from '../types';
|
|
4
5
|
export declare class ODataMetadata {
|
|
5
6
|
Version: string;
|
|
6
7
|
References: CsdlReference[];
|
|
7
8
|
Schemas: CsdlSchema[];
|
|
8
|
-
constructor(Version: string, References:
|
|
9
|
-
toConfig(base?:
|
|
9
|
+
constructor(Version: string, References: any[], Schemas: any[]);
|
|
10
|
+
toConfig(base?: Partial<ODataApiConfig>): ODataApiConfig;
|
|
11
|
+
toJson(): {
|
|
12
|
+
Version: string;
|
|
13
|
+
References: {
|
|
14
|
+
[key: string]: any;
|
|
15
|
+
}[];
|
|
16
|
+
Schemas: {
|
|
17
|
+
[key: string]: any;
|
|
18
|
+
}[];
|
|
19
|
+
};
|
|
20
|
+
functions(): CsdlFunction[];
|
|
21
|
+
actions(): CsdlAction[];
|
|
22
|
+
static fromJson(json: any): ODataMetadata;
|
|
10
23
|
}
|
|
@@ -152,7 +152,7 @@ export declare class ODataCollection<T, M extends ODataModel<T>> implements Iter
|
|
|
152
152
|
private _findEntry;
|
|
153
153
|
equals(other: ODataCollection<T, ODataModel<T>>): boolean;
|
|
154
154
|
get [Symbol.toStringTag](): string;
|
|
155
|
-
[Symbol.iterator](): Iterator<M
|
|
155
|
+
[Symbol.iterator](): Iterator<M>;
|
|
156
156
|
filter(predicate: (value: M, index: number, array: M[]) => unknown, thisArg?: any): M[];
|
|
157
157
|
map<U>(callbackfn: (value: M, index: number, array: M[]) => U, thisArg?: any): U[];
|
|
158
158
|
find(predicate: (value: M, index: number, obj: M[]) => unknown): M | undefined;
|
|
@@ -176,6 +176,7 @@ export declare class ODataCollection<T, M extends ODataModel<T>> implements Iter
|
|
|
176
176
|
sort(by: {
|
|
177
177
|
field: string | keyof T;
|
|
178
178
|
order?: 1 | -1;
|
|
179
|
+
comparator?: (a: any, b: any) => number;
|
|
179
180
|
}[], { silent }?: {
|
|
180
181
|
silent?: boolean;
|
|
181
182
|
}): void;
|
package/lib/models/model.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { Observable } from 'rxjs';
|
|
|
2
2
|
import { EntityKey, ODataActionOptions, ODataEntityResource, ODataFunctionOptions, ODataNavigationPropertyResource, ODataOptions, ODataPropertyResource, ODataQueryArgumentsOptions, ODataQueryOptionsHandler, ODataResource, ODataSingletonResource } from '../resources';
|
|
3
3
|
import { ODataStructuredType } from '../schema';
|
|
4
4
|
import { ODataCollection } from './collection';
|
|
5
|
-
import { ModelOptions, ODataModelField, ODataModelOptions, ODataModelAttribute, ODataModelEventEmitter } from './options';
|
|
5
|
+
import { ModelOptions, ODataModelField, ODataModelOptions, ODataModelAttribute, ODataModelEventEmitter, ModelInterface } from './options';
|
|
6
6
|
import { EdmType, ParserOptions } from '../types';
|
|
7
7
|
import { ODataEntityAnnotations } from '../annotations';
|
|
8
8
|
export declare class ODataModel<T> {
|
|
@@ -161,11 +161,12 @@ export declare class ODataModel<T> {
|
|
|
161
161
|
asEntity<R>(ctx: (model: this) => R): R;
|
|
162
162
|
callFunction<P, R>(name: string, params: P | null, responseType: 'property' | 'model' | 'collection' | 'none' | 'blob' | 'arraybuffer', options?: ODataFunctionOptions<R>): Observable<R | ODataModel<R> | ODataCollection<R, ODataModel<R>> | null | Blob | ArrayBuffer>;
|
|
163
163
|
callAction<P, R>(name: string, params: P | null, responseType?: 'property' | 'model' | 'collection' | 'none' | 'blob' | 'arraybuffer', { ...options }?: {} & ODataActionOptions<R>): Observable<R | ODataModel<R> | ODataCollection<R, ODataModel<R>> | null | Blob | ArrayBuffer>;
|
|
164
|
-
cast<S>(type: string, ModelType?: typeof ODataModel): ODataModel<
|
|
164
|
+
cast<S>(type: string, ModelType?: typeof ODataModel): ODataModel<T> & ModelInterface<T>;
|
|
165
|
+
cast<S, M extends ODataModel<S>>(type: string, ModelType?: typeof ODataModel): M;
|
|
165
166
|
fetchNavigationProperty<S>(name: keyof T | string, responseType: 'model' | 'collection', options?: ODataQueryArgumentsOptions<S>): Observable<ODataModel<S> | ODataCollection<S, ODataModel<S>> | null>;
|
|
166
|
-
fetchAttribute<P>(name: keyof T
|
|
167
|
-
getAttribute<P>(name: keyof T | string): P | ODataModel<P> | ODataCollection<P, ODataModel<P>> | null
|
|
168
|
-
setAttribute<N>(name: keyof T
|
|
167
|
+
fetchAttribute<P>(name: keyof T, options?: ODataQueryArgumentsOptions<P>): Observable<P | ODataModel<P> | ODataCollection<P, ODataModel<P>> | null>;
|
|
168
|
+
getAttribute<P>(name: keyof T | string): P | ODataModel<P> | ODataCollection<P, ODataModel<P>> | null;
|
|
169
|
+
setAttribute<N>(name: keyof T, model: ODataModel<N> | ODataCollection<N, ODataModel<N>> | null, options?: ODataOptions): Observable<this>;
|
|
169
170
|
setReference<N>(name: keyof T | string, model: ODataModel<N> | ODataCollection<N, ODataModel<N>> | null, options?: ODataOptions): Observable<this>;
|
|
170
171
|
get [Symbol.toStringTag](): string;
|
|
171
172
|
equals(other: ODataModel<T>): boolean;
|
package/lib/models/options.d.ts
CHANGED
|
@@ -87,8 +87,12 @@ export declare const INCLUDE_DEEP: {
|
|
|
87
87
|
export declare enum ODataModelState {
|
|
88
88
|
Added = 0,
|
|
89
89
|
Removed = 1,
|
|
90
|
-
|
|
90
|
+
Changed = 2,
|
|
91
|
+
Unchanged = 3
|
|
91
92
|
}
|
|
93
|
+
export type ModelInterface<T> = {
|
|
94
|
+
[P in keyof T]: T[P] extends (infer U)[] ? ODataCollection<U, ODataModel<U> & ModelInterface<U>> : T[P] extends object ? ODataModel<T[P]> & ModelInterface<T[P]> : T[P];
|
|
95
|
+
};
|
|
92
96
|
export type ModelOptions = {
|
|
93
97
|
cid?: string;
|
|
94
98
|
fields: Map<string, ModelFieldOptions>;
|
|
@@ -107,7 +111,9 @@ export type ModelFieldOptions = {
|
|
|
107
111
|
};
|
|
108
112
|
export declare function Model({ cid }?: {
|
|
109
113
|
cid?: string;
|
|
110
|
-
}): <T extends
|
|
114
|
+
}): <T extends {
|
|
115
|
+
new (...args: any[]): {};
|
|
116
|
+
}>(constructor: T) => T;
|
|
111
117
|
export declare function ModelField({ name, ...options }?: {
|
|
112
118
|
name?: string;
|
|
113
119
|
} & ModelFieldOptions): (target: any, key: string) => void;
|
|
@@ -151,7 +157,7 @@ export declare class ODataModelField<F> {
|
|
|
151
157
|
}): void;
|
|
152
158
|
isKey(): boolean;
|
|
153
159
|
hasReferentials(): boolean;
|
|
154
|
-
get referentials(): import("
|
|
160
|
+
get referentials(): import("angular-odata").ODataReferential[];
|
|
155
161
|
isStructuredType(): boolean;
|
|
156
162
|
structuredType(): ODataStructuredType<F>;
|
|
157
163
|
isEnumType(): boolean;
|
|
@@ -184,6 +190,7 @@ export declare class ODataModelField<F> {
|
|
|
184
190
|
export declare class ODataModelAttribute<T> {
|
|
185
191
|
private _model;
|
|
186
192
|
private _field;
|
|
193
|
+
private state;
|
|
187
194
|
private value?;
|
|
188
195
|
private change?;
|
|
189
196
|
private subscription?;
|
|
@@ -193,7 +200,7 @@ export declare class ODataModelAttribute<T> {
|
|
|
193
200
|
get navigation(): boolean;
|
|
194
201
|
get computed(): boolean | undefined;
|
|
195
202
|
get concurrency(): boolean;
|
|
196
|
-
get referentials(): import("
|
|
203
|
+
get referentials(): import("angular-odata").ODataReferential[];
|
|
197
204
|
get options(): ODataModelOptions<any>;
|
|
198
205
|
get name(): string;
|
|
199
206
|
get fieldName(): string;
|
package/lib/module.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { EnvironmentProviders, InjectionToken, ModuleWithProviders, Provider } from '@angular/core';
|
|
2
2
|
import { ODataConfigSyncLoader } from './loaders';
|
|
3
|
-
import {
|
|
3
|
+
import { ODataApiConfig } from './types';
|
|
4
4
|
import * as i0 from "@angular/core";
|
|
5
5
|
import * as i1 from "@angular/common";
|
|
6
6
|
import * as i2 from "@angular/common/http";
|
|
7
7
|
export interface PassedInitialConfig {
|
|
8
|
-
config?:
|
|
8
|
+
config?: ODataApiConfig | ODataApiConfig[];
|
|
9
9
|
loader?: Provider;
|
|
10
10
|
}
|
|
11
|
-
export declare const ODATA_CONFIG: InjectionToken<
|
|
11
|
+
export declare const ODATA_CONFIG: InjectionToken<ODataApiConfig>;
|
|
12
12
|
export declare function createSyncLoader(passedConfig: PassedInitialConfig): ODataConfigSyncLoader;
|
|
13
13
|
export declare function provideODataClient(passedConfig: PassedInitialConfig): EnvironmentProviders;
|
|
14
14
|
export declare class ODataModule {
|
package/lib/options.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare class ODataApiOptions implements
|
|
1
|
+
import { ODataApiConfigOptions, FetchPolicy, ODataMetadataType, ODataVersion, ParserOptions, QueryOption } from './types';
|
|
2
|
+
export declare class ODataApiOptions implements ODataApiConfigOptions {
|
|
3
3
|
/**
|
|
4
4
|
* Default OData version
|
|
5
5
|
*/
|
|
@@ -95,7 +95,7 @@ export declare class ODataApiOptions implements ApiOptions {
|
|
|
95
95
|
*/
|
|
96
96
|
omitNullValues?: boolean;
|
|
97
97
|
};
|
|
98
|
-
constructor(config:
|
|
98
|
+
constructor(config: ODataApiConfigOptions);
|
|
99
99
|
get parserOptions(): ParserOptions;
|
|
100
100
|
get helper(): import("./helper").ODataVersionHelper;
|
|
101
101
|
}
|
|
@@ -11,9 +11,9 @@ export type ODataSegment = {
|
|
|
11
11
|
parameters?: any;
|
|
12
12
|
};
|
|
13
13
|
export declare const pathAndParamsFromSegments: (segments: ODataSegment[], { escape, parser, options, }?: {
|
|
14
|
-
escape?: boolean
|
|
15
|
-
parser?: Parser<any
|
|
16
|
-
options?: ParserOptions
|
|
14
|
+
escape?: boolean;
|
|
15
|
+
parser?: Parser<any>;
|
|
16
|
+
options?: ParserOptions;
|
|
17
17
|
}) => [string, {
|
|
18
18
|
[name: string]: any;
|
|
19
19
|
}];
|
|
@@ -75,6 +75,7 @@ export type QueryOptions<T> = ExpandOptions<T> & {
|
|
|
75
75
|
} | {
|
|
76
76
|
[name: string]: any;
|
|
77
77
|
}[];
|
|
78
|
+
compute: string;
|
|
78
79
|
skip: number;
|
|
79
80
|
skiptoken: string;
|
|
80
81
|
key: string | number | {
|
|
@@ -92,8 +93,8 @@ export type QueryOptions<T> = ExpandOptions<T> & {
|
|
|
92
93
|
escape: boolean;
|
|
93
94
|
};
|
|
94
95
|
export declare const ITEM_ROOT = "";
|
|
95
|
-
export default function <T>({ select, search, skiptoken, format, top, skip, filter, transform, orderBy, key, count, expand, action, func, aliases, escape, }?: Partial<QueryOptions<T>>): string;
|
|
96
|
-
export declare function buildPathAndQuery<T>({ select, search, skiptoken, format, top, skip, filter, apply, transform, orderBy, key, count, expand, action, func, aliases, escape, }?: Partial<QueryOptions<T>>): [string, {
|
|
96
|
+
export default function <T>({ select, search, skiptoken, format, top, skip, filter, transform, compute, orderBy, key, count, expand, action, func, aliases, escape, }?: Partial<QueryOptions<T>>): string;
|
|
97
|
+
export declare function buildPathAndQuery<T>({ select, search, skiptoken, format, top, skip, filter, apply, transform, compute, orderBy, key, count, expand, action, func, aliases, escape, }?: Partial<QueryOptions<T>>): [string, {
|
|
97
98
|
[name: string]: any;
|
|
98
99
|
}];
|
|
99
100
|
export declare function normalizeValue(value: Value, { aliases, escape, }?: {
|
|
@@ -49,7 +49,7 @@ export declare class ApplyExpression<T> extends Expression<T> {
|
|
|
49
49
|
children?: Renderable[];
|
|
50
50
|
});
|
|
51
51
|
get [Symbol.toStringTag](): string;
|
|
52
|
-
static factory<T>(opts: (builder: ApplyExpressionBuilder<T>, current
|
|
52
|
+
static factory<T>(opts: (builder: ApplyExpressionBuilder<T>, current: ApplyExpression<T>) => ApplyExpression<T>, current?: ApplyExpression<T>): ApplyExpression<T>;
|
|
53
53
|
toJson(): {
|
|
54
54
|
$type: string;
|
|
55
55
|
children: any[];
|
|
@@ -13,7 +13,7 @@ export declare class ComputeExpression<T> extends Expression<T> {
|
|
|
13
13
|
names?: string[];
|
|
14
14
|
});
|
|
15
15
|
get [Symbol.toStringTag](): string;
|
|
16
|
-
static factory<T>(opts: (builder: ComputeExpressionBuilder<T>, current
|
|
16
|
+
static factory<T>(opts: (builder: ComputeExpressionBuilder<T>, current: ComputeExpression<T>) => ComputeExpression<T>, current?: ComputeExpression<T>): ComputeExpression<T>;
|
|
17
17
|
toJson(): {
|
|
18
18
|
$type: string;
|
|
19
19
|
children: any[];
|
|
@@ -34,7 +34,7 @@ export declare class CountExpression<T> extends Expression<T> {
|
|
|
34
34
|
children?: Renderable[];
|
|
35
35
|
});
|
|
36
36
|
get [Symbol.toStringTag](): string;
|
|
37
|
-
static factory<T>(opts: (builder: CountExpressionBuilder<T>, current
|
|
37
|
+
static factory<T>(opts: (builder: CountExpressionBuilder<T>, current: CountExpression<T>) => CountExpression<T>, current?: CountExpression<T>): CountExpression<T>;
|
|
38
38
|
private _add;
|
|
39
39
|
toJson(): {
|
|
40
40
|
$type: string;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Parser, ParserOptions } from '../../../types';
|
|
2
2
|
import { QueryCustomType, Unpacked } from '../builder';
|
|
3
3
|
import { Expression } from './base';
|
|
4
|
+
import { ComputeExpression, ComputeExpressionBuilder } from './compute';
|
|
4
5
|
import { FilterExpression, FilterExpressionBuilder } from './filter';
|
|
5
6
|
import { OrderByExpression, OrderByExpressionBuilder } from './orderby';
|
|
6
7
|
import { SearchExpression, SearchExpressionBuilder } from './search';
|
|
@@ -29,7 +30,8 @@ export declare class ExpandField<T> implements Renderable {
|
|
|
29
30
|
expand(opts: (builder: ExpandExpressionBuilder<T>, current?: ExpandExpression<T>) => ExpandExpression<T>): ExpandExpression<T>;
|
|
30
31
|
filter(opts: (builder: FilterExpressionBuilder<T>, current?: FilterExpression<T>) => FilterExpression<T>): FilterExpression<T>;
|
|
31
32
|
search(opts: (builder: SearchExpressionBuilder<T>) => SearchExpression<T>): SearchExpression<T>;
|
|
32
|
-
orderBy(opts: (builder: OrderByExpressionBuilder<T>, current
|
|
33
|
+
orderBy(opts: (builder: OrderByExpressionBuilder<T>, current: OrderByExpression<T>) => OrderByExpression<T>): OrderByExpression<T>;
|
|
34
|
+
compute(opts: (builder: ComputeExpressionBuilder<T>, current: ComputeExpression<T>) => ComputeExpression<T>): ComputeExpression<T>;
|
|
33
35
|
skip(n: number): number;
|
|
34
36
|
top(n: number): number;
|
|
35
37
|
levels(n: number | 'max'): number | "max";
|
|
@@ -45,7 +47,7 @@ export declare class ExpandExpression<T> extends Expression<T> {
|
|
|
45
47
|
children?: Renderable[];
|
|
46
48
|
});
|
|
47
49
|
get [Symbol.toStringTag](): string;
|
|
48
|
-
static factory<T>(opts: (builder: ExpandExpressionBuilder<T>, current
|
|
50
|
+
static factory<T>(opts: (builder: ExpandExpressionBuilder<T>, current: ExpandExpression<T>) => ExpandExpression<T>, current?: ExpandExpression<T>): ExpandExpression<T>;
|
|
49
51
|
toJson(): {
|
|
50
52
|
$type: string;
|
|
51
53
|
children: any[];
|
|
@@ -63,4 +65,5 @@ export declare class ExpandExpression<T> extends Expression<T> {
|
|
|
63
65
|
clone(): ExpandExpression<T>;
|
|
64
66
|
private _add;
|
|
65
67
|
field<F>(field: F, opts?: (e: ExpandField<Unpacked<F>>) => void): ExpandExpression<T>;
|
|
68
|
+
combine(expression: ExpandExpression<T>): ExpandExpression<T>;
|
|
66
69
|
}
|
|
@@ -19,7 +19,7 @@ export declare class FilterExpression<F> extends Expression<F> {
|
|
|
19
19
|
negated?: boolean;
|
|
20
20
|
});
|
|
21
21
|
get [Symbol.toStringTag](): string;
|
|
22
|
-
static factory<T>(opts: (builder: FilterExpressionBuilder<T>, current
|
|
22
|
+
static factory<T>(opts: (builder: FilterExpressionBuilder<T>, current: FilterExpression<T>) => FilterExpression<T>, current?: FilterExpression<T>): FilterExpression<T>;
|
|
23
23
|
toJson(): {
|
|
24
24
|
$type: string;
|
|
25
25
|
children: any[];
|
|
@@ -73,4 +73,5 @@ export declare class FilterExpression<F> extends Expression<F> {
|
|
|
73
73
|
}) => CountExpression<N>): FilterExpression<F>;
|
|
74
74
|
isof(type: string): FilterExpression<F>;
|
|
75
75
|
isof(left: F, type: string): FilterExpression<F>;
|
|
76
|
+
combine(exp: FilterExpression<F>, connector?: FilterConnector): FilterExpression<F>;
|
|
76
77
|
}
|
|
@@ -32,7 +32,7 @@ export declare class OrderByExpression<T> extends Expression<T> {
|
|
|
32
32
|
children?: Renderable[];
|
|
33
33
|
});
|
|
34
34
|
get [Symbol.toStringTag](): string;
|
|
35
|
-
static factory<T>(opts: (builder: OrderByExpressionBuilder<T>, current
|
|
35
|
+
static factory<T>(opts: (builder: OrderByExpressionBuilder<T>, current: OrderByExpression<T>) => OrderByExpression<T>, current?: OrderByExpression<T>): OrderByExpression<T>;
|
|
36
36
|
private _add;
|
|
37
37
|
toJson(): {
|
|
38
38
|
$type: string;
|
|
@@ -51,4 +51,5 @@ export declare class OrderByExpression<T> extends Expression<T> {
|
|
|
51
51
|
clone(): OrderByExpression<T>;
|
|
52
52
|
ascending(field: any): OrderByExpression<T>;
|
|
53
53
|
descending(field: any): OrderByExpression<T>;
|
|
54
|
+
combine(expression: OrderByExpression<T>): OrderByExpression<T>;
|
|
54
55
|
}
|
|
@@ -33,7 +33,7 @@ export declare class SearchExpression<T> extends Expression<T> {
|
|
|
33
33
|
negated?: boolean;
|
|
34
34
|
});
|
|
35
35
|
get [Symbol.toStringTag](): string;
|
|
36
|
-
static factory<T>(opts: (builder: SearchExpressionBuilder<T>, current
|
|
36
|
+
static factory<T>(opts: (builder: SearchExpressionBuilder<T>, current: SearchExpression<T>) => SearchExpression<T>, current?: SearchExpression<T>): SearchExpression<T>;
|
|
37
37
|
private _add;
|
|
38
38
|
render({ aliases, escape, prefix, parser, options, }?: {
|
|
39
39
|
aliases?: QueryCustomType[];
|
|
@@ -59,4 +59,5 @@ export declare class SearchExpression<T> extends Expression<T> {
|
|
|
59
59
|
and(exp: SearchExpression<T>): SearchExpression<T>;
|
|
60
60
|
not(exp: SearchExpression<T>): SearchExpression<T>;
|
|
61
61
|
term(value: any): SearchExpression<T>;
|
|
62
|
+
combine(expression: SearchExpression<T>, connector?: SearchConnector): SearchExpression<T>;
|
|
62
63
|
}
|
|
@@ -11,7 +11,7 @@ export declare class SelectExpression<T> extends Expression<T> {
|
|
|
11
11
|
children?: Renderable[];
|
|
12
12
|
});
|
|
13
13
|
get [Symbol.toStringTag](): string;
|
|
14
|
-
static factory<T>(opts: (builder: SelectExpressionBuilder<T>, current
|
|
14
|
+
static factory<T>(opts: (builder: SelectExpressionBuilder<T>, current: SelectExpression<T>) => SelectExpression<T>, current?: SelectExpression<T>): SelectExpression<T>;
|
|
15
15
|
toJson(): {
|
|
16
16
|
$type: string;
|
|
17
17
|
children: any[];
|
|
@@ -30,4 +30,5 @@ export declare class SelectExpression<T> extends Expression<T> {
|
|
|
30
30
|
private _add;
|
|
31
31
|
field(field: any): SelectExpression<T>;
|
|
32
32
|
fields(...fields: any[]): SelectExpression<T>;
|
|
33
|
+
combine(expression: SelectExpression<T>): SelectExpression<T>;
|
|
33
34
|
}
|
|
@@ -240,8 +240,8 @@ export declare class Transformations<T> {
|
|
|
240
240
|
export declare class Type<T> implements Renderable {
|
|
241
241
|
protected name: string;
|
|
242
242
|
protected type: string;
|
|
243
|
-
protected value?: any;
|
|
244
|
-
constructor(name: string, type: string, value?: any);
|
|
243
|
+
protected value?: any | undefined;
|
|
244
|
+
constructor(name: string, type: string, value?: any | undefined);
|
|
245
245
|
get [Symbol.toStringTag](): string;
|
|
246
246
|
toJson(): {
|
|
247
247
|
$type: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Parser, QueryOption } from '../../types';
|
|
1
|
+
import { Parser, ParserOptions, QueryOption } from '../../types';
|
|
2
2
|
import { Expand, Filter, OrderBy, Select, Transform } from './builder';
|
|
3
3
|
import { ComputeExpression, ComputeExpressionBuilder, FilterExpression, FilterExpressionBuilder, OrderByExpression, OrderByExpressionBuilder, SearchExpression, SearchExpressionBuilder, ExpandExpression, ExpandExpressionBuilder, SelectExpression, SelectExpressionBuilder, ApplyExpression, ApplyExpressionBuilder } from './expressions';
|
|
4
4
|
import { ODataQueryArguments, ODataQueryOptions } from './options';
|
|
@@ -98,7 +98,7 @@ export declare class ODataQueryOptionsHandler<T> {
|
|
|
98
98
|
* @param value The value to raw
|
|
99
99
|
* @returns The raw value
|
|
100
100
|
*/
|
|
101
|
-
raw(value: any): import("
|
|
101
|
+
raw(value: any): import("angular-odata").QueryCustomType;
|
|
102
102
|
/**
|
|
103
103
|
* Create a new odata alias parameter
|
|
104
104
|
* @link https://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part2-url-conventions.html#sec_ParameterAliases
|
|
@@ -106,19 +106,19 @@ export declare class ODataQueryOptionsHandler<T> {
|
|
|
106
106
|
* @param name The name of the alias
|
|
107
107
|
* @returns The alias
|
|
108
108
|
*/
|
|
109
|
-
alias(value: any, name?: string): import("
|
|
109
|
+
alias(value: any, name?: string): import("angular-odata").QueryCustomType;
|
|
110
110
|
/**
|
|
111
111
|
* Create a duration odata value
|
|
112
112
|
* @param value The value to duration
|
|
113
113
|
* @returns The duration value
|
|
114
114
|
*/
|
|
115
|
-
duration(value: any): import("
|
|
115
|
+
duration(value: any): import("angular-odata").QueryCustomType;
|
|
116
116
|
/**
|
|
117
117
|
* Create a binary odata value
|
|
118
118
|
* @param value The value to binary
|
|
119
119
|
* @returns The binary value
|
|
120
120
|
*/
|
|
121
|
-
binary(value: any): import("
|
|
121
|
+
binary(value: any): import("angular-odata").QueryCustomType;
|
|
122
122
|
/**
|
|
123
123
|
* Normalize the given value to a valid odata value
|
|
124
124
|
* @param value The value to normalize
|
|
@@ -247,6 +247,11 @@ export declare class ODataQueryOptionsHandler<T> {
|
|
|
247
247
|
* @param options The query to be applied.
|
|
248
248
|
*/
|
|
249
249
|
restore(options: ODataQueryArguments<T>): void;
|
|
250
|
+
/**
|
|
251
|
+
* Combine the given query options with the current query.
|
|
252
|
+
* @param options The query to be combined.
|
|
253
|
+
*/
|
|
254
|
+
combine(options: ODataQueryArguments<T>): void;
|
|
250
255
|
toJson(): {};
|
|
251
256
|
fromJson(json: {
|
|
252
257
|
[name: string]: any;
|
|
@@ -255,4 +260,11 @@ export declare class ODataQueryOptionsHandler<T> {
|
|
|
255
260
|
escape?: boolean;
|
|
256
261
|
parser?: Parser<T>;
|
|
257
262
|
}): string;
|
|
263
|
+
pathAndParams({ escape, parser, options, }?: {
|
|
264
|
+
escape?: boolean;
|
|
265
|
+
parser?: Parser<T>;
|
|
266
|
+
options?: ParserOptions;
|
|
267
|
+
}): [string, {
|
|
268
|
+
[name: string]: any;
|
|
269
|
+
}];
|
|
258
270
|
}
|
|
@@ -22,9 +22,9 @@ export type ODataQueryArguments<T> = {
|
|
|
22
22
|
[QueryOption.count]?: boolean | null;
|
|
23
23
|
};
|
|
24
24
|
export declare const pathAndParamsFromQueryOptions: <T>(values: Map<QueryOption, any>, { escape, parser, options, }?: {
|
|
25
|
-
escape?: boolean
|
|
26
|
-
parser?: Parser<T
|
|
27
|
-
options?: ParserOptions
|
|
25
|
+
escape?: boolean;
|
|
26
|
+
parser?: Parser<T>;
|
|
27
|
+
options?: ParserOptions;
|
|
28
28
|
}) => [string, {
|
|
29
29
|
[name: string]: any;
|
|
30
30
|
}];
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Observable } from 'rxjs';
|
|
2
2
|
import { ODataApi } from '../api';
|
|
3
|
-
import { ODataCollection, ODataModel } from '../models';
|
|
3
|
+
import { ModelInterface, ODataCollection, ODataModel } from '../models';
|
|
4
4
|
import { ODataStructuredType } from '../schema';
|
|
5
|
-
import { ParserOptions, QueryOption,
|
|
5
|
+
import { ParserOptions, QueryOption, ODataStructuredTypeFieldConfig } from '../types';
|
|
6
6
|
import { ODataPathSegments, ODataPathSegmentsHandler } from './path';
|
|
7
7
|
import { ODataQueryOptions, ODataQueryOptionsHandler } from './query';
|
|
8
8
|
import { ApplyExpression, ApplyExpressionBuilder, QueryCustomType } from './query';
|
|
@@ -35,24 +35,52 @@ export declare class ODataResource<T> {
|
|
|
35
35
|
* @returns string All covered types of the resource
|
|
36
36
|
*/
|
|
37
37
|
types(): string[];
|
|
38
|
-
callable(): import("
|
|
39
|
-
enumType(): import("
|
|
40
|
-
structuredType(): ODataStructuredType<T> | undefined;
|
|
38
|
+
callable(): import("angular-odata").ODataCallable<any> | undefined;
|
|
39
|
+
enumType(): import("angular-odata").ODataEnumType<any> | undefined;
|
|
40
|
+
structuredType(): ODataStructuredType<any> | ODataStructuredType<T> | undefined;
|
|
41
41
|
/**
|
|
42
42
|
* @returns boolean The resource has key ?
|
|
43
43
|
*/
|
|
44
44
|
hasKey(): boolean;
|
|
45
45
|
hasEntityKey(): boolean;
|
|
46
46
|
clearKey(): void | undefined;
|
|
47
|
+
asModel(entity?: Partial<T> | {
|
|
48
|
+
[name: string]: any;
|
|
49
|
+
}): ODataModel<T> & ModelInterface<T>;
|
|
50
|
+
asModel(entity: Partial<T> | {
|
|
51
|
+
[name: string]: any;
|
|
52
|
+
}, { reset, annots, ModelType, }: {
|
|
53
|
+
reset?: boolean;
|
|
54
|
+
annots?: ODataEntityAnnotations<T>;
|
|
55
|
+
ModelType?: typeof ODataModel;
|
|
56
|
+
}): ODataModel<T> & ModelInterface<T>;
|
|
47
57
|
asModel<M extends ODataModel<T>>(entity?: Partial<T> | {
|
|
48
58
|
[name: string]: any;
|
|
49
|
-
}
|
|
59
|
+
}): M;
|
|
60
|
+
asModel<M extends ODataModel<T>>(entity: Partial<T> | {
|
|
61
|
+
[name: string]: any;
|
|
62
|
+
}, { reset, annots, ModelType, }: {
|
|
63
|
+
reset?: boolean;
|
|
50
64
|
annots?: ODataEntityAnnotations<T>;
|
|
51
65
|
ModelType?: typeof ODataModel;
|
|
52
66
|
}): M;
|
|
67
|
+
asCollection(entities?: Partial<T>[] | {
|
|
68
|
+
[name: string]: any;
|
|
69
|
+
}[]): ODataCollection<T, ODataModel<T> & ModelInterface<T>>;
|
|
70
|
+
asCollection(entities: Partial<T>[] | {
|
|
71
|
+
[name: string]: any;
|
|
72
|
+
}[], { reset, annots, CollectionType, }: {
|
|
73
|
+
reset?: boolean;
|
|
74
|
+
annots?: ODataEntitiesAnnotations<T>;
|
|
75
|
+
CollectionType?: typeof ODataCollection;
|
|
76
|
+
}): ODataCollection<T, ODataModel<T> & ModelInterface<T>>;
|
|
53
77
|
asCollection<M extends ODataModel<T>, C extends ODataCollection<T, M>>(entities?: Partial<T>[] | {
|
|
54
78
|
[name: string]: any;
|
|
55
|
-
}[]
|
|
79
|
+
}[]): C;
|
|
80
|
+
asCollection<M extends ODataModel<T>, C extends ODataCollection<T, M>>(entities: Partial<T>[] | {
|
|
81
|
+
[name: string]: any;
|
|
82
|
+
}[], { reset, annots, CollectionType, }: {
|
|
83
|
+
reset?: boolean;
|
|
56
84
|
annots?: ODataEntitiesAnnotations<T>;
|
|
57
85
|
CollectionType?: typeof ODataCollection;
|
|
58
86
|
}): C;
|
|
@@ -100,7 +128,7 @@ export declare class ODataResource<T> {
|
|
|
100
128
|
transform<R>(opts: (builder: ApplyExpressionBuilder<T>, current?: ApplyExpression<T>) => ApplyExpression<T>, { type, fields, }?: {
|
|
101
129
|
type?: string;
|
|
102
130
|
fields?: {
|
|
103
|
-
[
|
|
131
|
+
[name: string]: ODataStructuredTypeFieldConfig;
|
|
104
132
|
};
|
|
105
133
|
}): ODataResource<R>;
|
|
106
134
|
static resolveKey<T>(value: any, schema?: ODataStructuredType<T>): EntityKey<T> | undefined;
|
|
@@ -56,9 +56,9 @@ export declare class ODataActionResource<P, R> extends ODataResource<R> {
|
|
|
56
56
|
* @param options Options for the request
|
|
57
57
|
* @returns Observable of the result of the action
|
|
58
58
|
*/
|
|
59
|
-
callModel
|
|
59
|
+
callModel(params: P | null, options?: ODataOptions & {
|
|
60
60
|
ModelType?: typeof ODataModel;
|
|
61
|
-
}): Observable<
|
|
61
|
+
}): Observable<(ODataModel<R> & import("angular-odata").ModelInterface<R>) | null>;
|
|
62
62
|
/**
|
|
63
63
|
* Execute the action and return the result as a entities
|
|
64
64
|
* @param params Parameters for the action
|
|
@@ -72,9 +72,9 @@ export declare class ODataActionResource<P, R> extends ODataResource<R> {
|
|
|
72
72
|
* @param options Options for the request
|
|
73
73
|
* @returns Observable of the result of the action
|
|
74
74
|
*/
|
|
75
|
-
callCollection
|
|
75
|
+
callCollection(params: P | null, options?: ODataOptions & {
|
|
76
76
|
CollectionType?: typeof ODataCollection;
|
|
77
|
-
}): Observable<
|
|
77
|
+
}): Observable<ODataCollection<R, ODataModel<R> & import("angular-odata").ModelInterface<R>> | null>;
|
|
78
78
|
callArraybuffer(params: P | null, { alias, ...options }?: {
|
|
79
79
|
alias?: boolean;
|
|
80
80
|
} & ODataOptions): Observable<ArrayBuffer>;
|