angular-odata 0.78.1 → 0.95.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 +133 -62
- package/{esm2015/angular-odata.js → esm2020/angular-odata.mjs} +0 -0
- package/esm2020/lib/api.mjs +303 -0
- package/{esm2015/lib/cache/cache.js → esm2020/lib/cache/cache.mjs} +12 -5
- package/{esm2015/lib/cache/index.js → esm2020/lib/cache/index.mjs} +0 -0
- package/{esm2015/lib/cache/memory.js → esm2020/lib/cache/memory.mjs} +0 -0
- package/{esm2015/lib/cache/storage.js → esm2020/lib/cache/storage.mjs} +1 -1
- package/esm2020/lib/client.mjs +271 -0
- package/{esm2015/lib/constants.js → esm2020/lib/constants.mjs} +9 -3
- package/esm2020/lib/helper.mjs +268 -0
- package/esm2020/lib/index.mjs +19 -0
- package/esm2020/lib/models/collection.mjs +741 -0
- package/{esm2015/lib/models/index.js → esm2020/lib/models/index.mjs} +0 -0
- package/esm2020/lib/models/model.mjs +453 -0
- package/esm2020/lib/models/options.mjs +945 -0
- package/{esm2015/lib/module.js → esm2020/lib/module.mjs} +6 -6
- package/esm2020/lib/options.mjs +32 -0
- package/esm2020/lib/resources/index.mjs +7 -0
- package/esm2020/lib/resources/path/handlers.mjs +69 -0
- package/esm2020/lib/resources/path/index.mjs +3 -0
- package/esm2020/lib/resources/path/segments.mjs +124 -0
- package/esm2020/lib/resources/query/builder.mjs +590 -0
- package/esm2020/lib/resources/query/expressions.mjs +207 -0
- package/esm2020/lib/resources/query/handlers.mjs +186 -0
- package/esm2020/lib/resources/query/index.mjs +4 -0
- package/esm2020/lib/resources/query/options.mjs +103 -0
- package/esm2020/lib/resources/query/syntax.mjs +406 -0
- package/esm2020/lib/resources/request.mjs +167 -0
- package/esm2020/lib/resources/resource.mjs +326 -0
- package/esm2020/lib/resources/responses/annotations.mjs +119 -0
- package/{esm2015/lib/resources/responses/csdl/csdl-annotation.js → esm2020/lib/resources/responses/csdl/csdl-annotation.mjs} +0 -0
- package/{esm2015/lib/resources/responses/csdl/csdl-entity-container.js → esm2020/lib/resources/responses/csdl/csdl-entity-container.mjs} +0 -0
- package/{esm2015/lib/resources/responses/csdl/csdl-entity-set.js → esm2020/lib/resources/responses/csdl/csdl-entity-set.mjs} +0 -0
- package/{esm2015/lib/resources/responses/csdl/csdl-enum-type.js → esm2020/lib/resources/responses/csdl/csdl-enum-type.mjs} +0 -0
- package/{esm2015/lib/resources/responses/csdl/csdl-function-action.js → esm2020/lib/resources/responses/csdl/csdl-function-action.mjs} +0 -0
- package/{esm2015/lib/resources/responses/csdl/csdl-navigation-property-binding.js → esm2020/lib/resources/responses/csdl/csdl-navigation-property-binding.mjs} +0 -0
- package/{esm2015/lib/resources/responses/csdl/csdl-reference.js → esm2020/lib/resources/responses/csdl/csdl-reference.mjs} +0 -0
- package/{esm2015/lib/resources/responses/csdl/csdl-schema.js → esm2020/lib/resources/responses/csdl/csdl-schema.mjs} +0 -0
- package/{esm2015/lib/resources/responses/csdl/csdl-singleton.js → esm2020/lib/resources/responses/csdl/csdl-singleton.mjs} +0 -0
- package/{esm2015/lib/resources/responses/csdl/csdl-structural-property.js → esm2020/lib/resources/responses/csdl/csdl-structural-property.mjs} +0 -0
- package/{esm2015/lib/resources/responses/csdl/csdl-structured-type.js → esm2020/lib/resources/responses/csdl/csdl-structured-type.mjs} +0 -0
- package/{esm2015/lib/resources/responses/csdl/csdl-type-definition.js → esm2020/lib/resources/responses/csdl/csdl-type-definition.mjs} +0 -0
- package/{esm2015/lib/resources/responses/index.js → esm2020/lib/resources/responses/index.mjs} +0 -0
- package/esm2020/lib/resources/responses/metadata.mjs +547 -0
- package/{esm2015/lib/resources/responses/options.js → esm2020/lib/resources/responses/options.mjs} +1 -1
- package/esm2020/lib/resources/responses/response.mjs +170 -0
- package/{esm2015/lib/resources/responses/types.js → esm2020/lib/resources/responses/types.mjs} +1 -1
- package/esm2020/lib/resources/types/action.mjs +101 -0
- package/esm2020/lib/resources/types/batch.mjs +288 -0
- package/esm2020/lib/resources/types/count.mjs +27 -0
- package/esm2020/lib/resources/types/entity-set.mjs +94 -0
- package/esm2020/lib/resources/types/entity.mjs +106 -0
- package/esm2020/lib/resources/types/function.mjs +137 -0
- package/{esm2015/lib/resources/types/index.js → esm2020/lib/resources/types/index.mjs} +0 -0
- package/esm2020/lib/resources/types/media.mjs +41 -0
- package/esm2020/lib/resources/types/metadata.mjs +30 -0
- package/esm2020/lib/resources/types/navigation-property.mjs +226 -0
- package/esm2020/lib/resources/types/options.mjs +2 -0
- package/esm2020/lib/resources/types/property.mjs +183 -0
- package/esm2020/lib/resources/types/reference.mjs +85 -0
- package/esm2020/lib/resources/types/singleton.mjs +126 -0
- package/esm2020/lib/resources/types/value.mjs +41 -0
- package/esm2020/lib/schema/annotation.mjs +37 -0
- package/esm2020/lib/schema/callable.mjs +62 -0
- package/esm2020/lib/schema/element.mjs +51 -0
- package/esm2020/lib/schema/entity-container.mjs +9 -0
- package/esm2020/lib/schema/entity-set.mjs +9 -0
- package/esm2020/lib/schema/enum-type.mjs +71 -0
- package/{esm2015/lib/schema/index.js → esm2020/lib/schema/index.mjs} +2 -1
- package/esm2020/lib/schema/parsers/callable.mjs +113 -0
- package/esm2020/lib/schema/parsers/edm.mjs +95 -0
- package/esm2020/lib/schema/parsers/enum-type.mjs +107 -0
- package/esm2020/lib/schema/parsers/index.mjs +5 -0
- package/esm2020/lib/schema/parsers/structured-type.mjs +412 -0
- package/esm2020/lib/schema/schema.mjs +61 -0
- package/esm2020/lib/schema/structured-type.mjs +198 -0
- package/esm2020/lib/services/base.mjs +29 -0
- package/esm2020/lib/services/entity-set.mjs +143 -0
- package/esm2020/lib/services/entity.mjs +12 -0
- package/{esm2015/lib/services/factory.js → esm2020/lib/services/factory.mjs} +3 -3
- package/{esm2015/lib/services/index.js → esm2020/lib/services/index.mjs} +0 -0
- package/esm2020/lib/services/singleton.mjs +48 -0
- package/{esm2015/lib/settings.js → esm2020/lib/settings.mjs} +1 -1
- package/{esm2015/lib/tokens.js → esm2020/lib/tokens.mjs} +0 -0
- package/esm2020/lib/types.mjs +37 -0
- package/esm2020/lib/utils/arraybuffers.mjs +46 -0
- package/{esm2015/lib/utils/dates.js → esm2020/lib/utils/dates.mjs} +0 -0
- package/esm2020/lib/utils/durations.mjs +40 -0
- package/{esm2015/lib/utils/enums.js → esm2020/lib/utils/enums.mjs} +0 -0
- package/esm2020/lib/utils/http.mjs +93 -0
- package/esm2020/lib/utils/index.mjs +10 -0
- package/esm2020/lib/utils/objects.mjs +195 -0
- package/esm2020/lib/utils/odata.mjs +22 -0
- package/esm2020/lib/utils/strings.mjs +20 -0
- package/esm2020/lib/utils/types.mjs +134 -0
- package/{esm2015/lib/utils/urls.js → esm2020/lib/utils/urls.mjs} +0 -0
- package/{esm2015/public-api.js → esm2020/public-api.mjs} +0 -0
- package/fesm2015/{angular-odata.js → angular-odata.mjs} +5068 -3943
- package/fesm2015/angular-odata.mjs.map +1 -0
- package/fesm2020/angular-odata.mjs +10274 -0
- package/fesm2020/angular-odata.mjs.map +1 -0
- package/lib/api.d.ts +17 -16
- package/lib/cache/cache.d.ts +2 -2
- package/lib/client.d.ts +93 -18
- package/lib/constants.d.ts +6 -2
- package/lib/helper.d.ts +3 -3
- package/lib/index.d.ts +0 -1
- package/lib/models/collection.d.ts +36 -47
- package/lib/models/model.d.ts +47 -40
- package/lib/models/options.d.ts +53 -52
- package/lib/options.d.ts +50 -2
- package/lib/resources/index.d.ts +2 -3
- package/lib/resources/path/handlers.d.ts +27 -0
- package/lib/resources/path/index.d.ts +2 -0
- package/lib/resources/{path-segments.d.ts → path/segments.d.ts} +4 -16
- package/lib/resources/{builder.d.ts → query/builder.d.ts} +12 -7
- package/lib/resources/query/expressions.d.ts +63 -0
- package/lib/resources/query/handlers.d.ts +89 -0
- package/lib/resources/query/index.d.ts +3 -0
- package/lib/resources/query/options.d.ts +38 -0
- package/lib/resources/query/syntax.d.ts +175 -0
- package/lib/resources/request.d.ts +8 -6
- package/lib/resources/resource.d.ts +49 -55
- package/lib/resources/responses/metadata.d.ts +1 -1
- package/lib/resources/responses/types.d.ts +1 -1
- package/lib/resources/types/action.d.ts +55 -69
- package/lib/resources/types/batch.d.ts +13 -8
- package/lib/resources/types/count.d.ts +16 -19
- package/lib/resources/types/entity-set.d.ts +24 -62
- package/lib/resources/types/entity.d.ts +35 -43
- package/lib/resources/types/function.d.ts +63 -71
- package/lib/resources/types/media.d.ts +20 -22
- package/lib/resources/types/metadata.d.ts +5 -7
- package/lib/resources/types/navigation-property.d.ts +100 -85
- package/lib/resources/types/options.d.ts +8 -8
- package/lib/resources/types/property.d.ts +63 -73
- package/lib/resources/types/reference.d.ts +72 -16
- package/lib/resources/types/singleton.d.ts +75 -43
- package/lib/resources/types/value.d.ts +18 -9
- package/lib/schema/annotation.d.ts +18 -0
- package/lib/schema/callable.d.ts +27 -11
- package/lib/schema/element.d.ts +39 -0
- package/lib/schema/entity-container.d.ts +3 -8
- package/lib/schema/entity-set.d.ts +3 -9
- package/lib/schema/enum-type.d.ts +41 -14
- package/lib/schema/index.d.ts +1 -0
- package/lib/{parsers → schema/parsers}/callable.d.ts +2 -2
- package/lib/schema/parsers/edm.d.ts +4 -0
- package/lib/{parsers → schema/parsers}/enum-type.d.ts +13 -7
- package/lib/{parsers → schema/parsers}/index.d.ts +0 -0
- package/lib/{parsers → schema/parsers}/structured-type.d.ts +14 -9
- package/lib/schema/schema.d.ts +6 -8
- package/lib/schema/structured-type.d.ts +97 -18
- package/lib/services/base.d.ts +12 -12
- package/lib/services/entity-set.d.ts +15 -12
- package/lib/services/entity.d.ts +4 -1
- package/lib/services/singleton.d.ts +6 -3
- package/lib/settings.d.ts +4 -4
- package/lib/types.d.ts +7 -3
- package/lib/utils/arraybuffers.d.ts +4 -0
- package/lib/{parsers/edm.d.ts → utils/durations.d.ts} +3 -3
- package/lib/utils/http.d.ts +9 -0
- package/lib/utils/index.d.ts +5 -2
- package/lib/utils/objects.d.ts +1 -1
- package/lib/utils/strings.d.ts +4 -0
- package/lib/utils/types.d.ts +2 -0
- package/package.json +21 -8
- package/bundles/angular-odata.umd.js +0 -10756
- package/bundles/angular-odata.umd.js.map +0 -1
- package/esm2015/lib/api.js +0 -251
- package/esm2015/lib/client.js +0 -197
- package/esm2015/lib/helper.js +0 -269
- package/esm2015/lib/index.js +0 -21
- package/esm2015/lib/models/collection.js +0 -660
- package/esm2015/lib/models/model.js +0 -421
- package/esm2015/lib/models/options.js +0 -889
- package/esm2015/lib/options.js +0 -31
- package/esm2015/lib/parsers/callable.js +0 -110
- package/esm2015/lib/parsers/edm.js +0 -310
- package/esm2015/lib/parsers/enum-type.js +0 -97
- package/esm2015/lib/parsers/index.js +0 -5
- package/esm2015/lib/parsers/structured-type.js +0 -394
- package/esm2015/lib/resources/builder.js +0 -537
- package/esm2015/lib/resources/index.js +0 -8
- package/esm2015/lib/resources/path-segments.js +0 -156
- package/esm2015/lib/resources/query-options.js +0 -157
- package/esm2015/lib/resources/request.js +0 -141
- package/esm2015/lib/resources/resource.js +0 -328
- package/esm2015/lib/resources/responses/annotations.js +0 -121
- package/esm2015/lib/resources/responses/metadata.js +0 -548
- package/esm2015/lib/resources/responses/response.js +0 -170
- package/esm2015/lib/resources/types/action.js +0 -146
- package/esm2015/lib/resources/types/batch.js +0 -330
- package/esm2015/lib/resources/types/count.js +0 -50
- package/esm2015/lib/resources/types/entity-set.js +0 -164
- package/esm2015/lib/resources/types/entity.js +0 -158
- package/esm2015/lib/resources/types/function.js +0 -166
- package/esm2015/lib/resources/types/media.js +0 -46
- package/esm2015/lib/resources/types/metadata.js +0 -36
- package/esm2015/lib/resources/types/navigation-property.js +0 -214
- package/esm2015/lib/resources/types/options.js +0 -2
- package/esm2015/lib/resources/types/property.js +0 -190
- package/esm2015/lib/resources/types/reference.js +0 -50
- package/esm2015/lib/resources/types/singleton.js +0 -147
- package/esm2015/lib/resources/types/value.js +0 -30
- package/esm2015/lib/schema/annotation.js +0 -7
- package/esm2015/lib/schema/callable.js +0 -50
- package/esm2015/lib/schema/entity-container.js +0 -17
- package/esm2015/lib/schema/entity-set.js +0 -23
- package/esm2015/lib/schema/enum-type.js +0 -68
- package/esm2015/lib/schema/schema.js +0 -55
- package/esm2015/lib/schema/structured-type.js +0 -107
- package/esm2015/lib/services/base.js +0 -23
- package/esm2015/lib/services/entity-set.js +0 -143
- package/esm2015/lib/services/entity.js +0 -10
- package/esm2015/lib/services/singleton.js +0 -46
- package/esm2015/lib/types.js +0 -37
- package/esm2015/lib/utils/http.js +0 -59
- package/esm2015/lib/utils/index.js +0 -7
- package/esm2015/lib/utils/objects.js +0 -140
- package/esm2015/lib/utils/odata.js +0 -21
- package/esm2015/lib/utils/types.js +0 -103
- package/fesm2015/angular-odata.js.map +0 -1
- package/lib/resources/query-options.d.ts +0 -57
|
@@ -1,128 +1,143 @@
|
|
|
1
1
|
import { Observable } from 'rxjs';
|
|
2
|
-
import { ODataModel, ODataCollection } from '../../models';
|
|
3
2
|
import { ODataApi } from '../../api';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
3
|
+
import { ODataCollection, ODataModel } from '../../models';
|
|
4
|
+
import { ODataStructuredType } from '../../schema';
|
|
5
|
+
import { QueryOptionNames } from '../../types';
|
|
6
|
+
import { ODataPathSegments } from '../path';
|
|
7
|
+
import { ODataQueryOptions } from '../query';
|
|
8
|
+
import { ODataResource } from '../resource';
|
|
9
|
+
import { ODataEntities, ODataEntity } from '../responses';
|
|
10
10
|
import { ODataCountResource } from './count';
|
|
11
|
-
import { ODataPropertyResource } from './property';
|
|
12
|
-
import { HttpEntityOptions, HttpEntitiesOptions, HttpOptions } from './options';
|
|
13
11
|
import { ODataMediaResource } from './media';
|
|
14
|
-
import {
|
|
12
|
+
import { ODataEntitiesOptions, ODataEntityOptions, ODataOptions } from './options';
|
|
13
|
+
import { ODataPropertyResource } from './property';
|
|
14
|
+
import { ODataReferenceResource } from './reference';
|
|
15
15
|
/**
|
|
16
16
|
* OData Navigation Property Resource
|
|
17
17
|
* https://www.odata.org/getting-started/advanced-tutorial/#containment
|
|
18
18
|
* https://www.odata.org/getting-started/advanced-tutorial/#derived
|
|
19
19
|
*/
|
|
20
20
|
export declare class ODataNavigationPropertyResource<T> extends ODataResource<T> {
|
|
21
|
-
static factory<
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}): M;
|
|
30
|
-
asCollection<M extends ODataModel<T>, C extends ODataCollection<T, M>>(entities: Partial<T>[] | {
|
|
31
|
-
[name: string]: any;
|
|
32
|
-
}[], { annots, reset, }?: {
|
|
33
|
-
annots?: ODataEntitiesAnnotations;
|
|
34
|
-
reset?: boolean;
|
|
35
|
-
}): C;
|
|
21
|
+
static factory<N>(api: ODataApi, { path, type, schema, segments, query, }: {
|
|
22
|
+
path: string;
|
|
23
|
+
type?: string;
|
|
24
|
+
schema?: ODataStructuredType<N>;
|
|
25
|
+
segments: ODataPathSegments;
|
|
26
|
+
query?: ODataQueryOptions<N>;
|
|
27
|
+
}): ODataNavigationPropertyResource<N>;
|
|
28
|
+
static fromResource<N>(resource: ODataResource<any>, path: string): ODataNavigationPropertyResource<N>;
|
|
36
29
|
key(value: any): ODataNavigationPropertyResource<T>;
|
|
37
30
|
keys(values: any[]): ODataNavigationPropertyResource<T>;
|
|
38
|
-
media(): ODataMediaResource
|
|
39
|
-
reference(): ODataReferenceResource
|
|
31
|
+
media(): ODataMediaResource;
|
|
32
|
+
reference(): ODataReferenceResource<T>;
|
|
40
33
|
navigationProperty<N>(path: string): ODataNavigationPropertyResource<N>;
|
|
41
34
|
property<P>(path: string): ODataPropertyResource<P>;
|
|
42
|
-
count(): ODataCountResource
|
|
35
|
+
count(): ODataCountResource<T>;
|
|
43
36
|
cast<C>(type: string): ODataNavigationPropertyResource<C>;
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
transform(opts: Transform<T>): ODataNavigationPropertyResource<T>;
|
|
47
|
-
search(opts: string): ODataNavigationPropertyResource<T>;
|
|
48
|
-
filter(opts: Filter): ODataNavigationPropertyResource<T>;
|
|
49
|
-
orderBy(opts: OrderBy<T>): ODataNavigationPropertyResource<T>;
|
|
50
|
-
format(opts: string): ODataNavigationPropertyResource<T>;
|
|
51
|
-
top(opts: number): ODataNavigationPropertyResource<T>;
|
|
52
|
-
skip(opts: number): ODataNavigationPropertyResource<T>;
|
|
53
|
-
skiptoken(opts: string): ODataNavigationPropertyResource<T>;
|
|
54
|
-
get segment(): {
|
|
55
|
-
entitySet(): import("../path-segments").SegmentHandler;
|
|
56
|
-
singleton(): import("../path-segments").SegmentHandler;
|
|
57
|
-
navigationProperty(): import("../path-segments").SegmentHandler;
|
|
58
|
-
keys(values?: (EntityKey<T> | undefined)[] | undefined): (EntityKey<any> | undefined)[];
|
|
59
|
-
};
|
|
60
|
-
/**
|
|
61
|
-
* Handle query options of the navigation property
|
|
62
|
-
* @returns Handler for mutate the query of the navigation property
|
|
63
|
-
*/
|
|
64
|
-
get query(): {
|
|
65
|
-
select(opts?: Select<T> | undefined): import("../query-options").OptionHandler<Select<T>>;
|
|
66
|
-
expand(opts?: Expand<T> | undefined): import("../query-options").OptionHandler<Expand<T>>;
|
|
67
|
-
compute(opts?: string | undefined): import("../query-options").OptionHandler<string>;
|
|
68
|
-
transform(opts?: Transform<T> | undefined): import("../query-options").OptionHandler<Transform<T>>;
|
|
69
|
-
search(opts?: string | undefined): import("../query-options").OptionHandler<string>;
|
|
70
|
-
filter(opts?: Filter | undefined): import("../query-options").OptionHandler<Filter>;
|
|
71
|
-
orderBy(opts?: OrderBy<T> | undefined): import("../query-options").OptionHandler<OrderBy<T>>;
|
|
72
|
-
format(opts?: string | undefined): import("../query-options").OptionHandler<string>;
|
|
73
|
-
top(opts?: number | undefined): import("../query-options").OptionHandler<number>;
|
|
74
|
-
skip(opts?: number | undefined): import("../query-options").OptionHandler<number>;
|
|
75
|
-
skiptoken(opts?: string | undefined): import("../query-options").OptionHandler<string>;
|
|
76
|
-
paging({ skip, skiptoken, top, }?: {
|
|
77
|
-
skip?: number | undefined;
|
|
78
|
-
skiptoken?: string | undefined;
|
|
79
|
-
top?: number | undefined;
|
|
80
|
-
}): void;
|
|
81
|
-
clearPaging(): void;
|
|
82
|
-
apply(query: import("../query-options").QueryArguments<T>): void;
|
|
83
|
-
};
|
|
84
|
-
get(options: HttpEntityOptions & {
|
|
37
|
+
protected post(attrs: Partial<T>, options?: ODataOptions): Observable<ODataEntity<T>>;
|
|
38
|
+
protected put(attrs: Partial<T>, options?: ODataOptions & {
|
|
85
39
|
etag?: string;
|
|
86
|
-
bodyQueryOptions?: QueryOptionNames[];
|
|
87
40
|
}): Observable<ODataEntity<T>>;
|
|
88
|
-
|
|
41
|
+
protected patch(attrs: Partial<T>, options?: ODataOptions & {
|
|
42
|
+
etag?: string;
|
|
43
|
+
}): Observable<ODataEntity<T>>;
|
|
44
|
+
protected delete(options?: ODataOptions & {
|
|
45
|
+
etag?: string;
|
|
46
|
+
}): Observable<any>;
|
|
47
|
+
protected get(options?: ODataEntityOptions & ODataEntitiesOptions & {
|
|
89
48
|
etag?: string;
|
|
90
49
|
bodyQueryOptions?: QueryOptionNames[];
|
|
91
|
-
}): Observable<
|
|
92
|
-
|
|
93
|
-
|
|
50
|
+
}): Observable<any>;
|
|
51
|
+
/**
|
|
52
|
+
* Create a new entity
|
|
53
|
+
* @param attrs The entity attributes
|
|
54
|
+
* @param options Options for the request
|
|
55
|
+
* @returns The created entity with the annotations
|
|
56
|
+
*/
|
|
57
|
+
create(attrs: Partial<T>, options?: ODataOptions): Observable<ODataEntity<T>>;
|
|
58
|
+
/**
|
|
59
|
+
* Update an existing entity
|
|
60
|
+
* @param attrs The entity attributes
|
|
61
|
+
* @param options Options for the request
|
|
62
|
+
* @param etag The etag of the entity
|
|
63
|
+
* @returns The updated entity with the annotations
|
|
64
|
+
*/
|
|
65
|
+
update(attrs: Partial<T>, options?: ODataOptions & {
|
|
94
66
|
etag?: string;
|
|
95
67
|
}): Observable<ODataEntity<T>>;
|
|
96
|
-
|
|
68
|
+
/**
|
|
69
|
+
* Modify an existing entity
|
|
70
|
+
* @param attrs The entity attributes
|
|
71
|
+
* @param options Options for the request
|
|
72
|
+
* @param etag The etag of the entity
|
|
73
|
+
* @returns The modified entity with the annotations
|
|
74
|
+
*/
|
|
75
|
+
modify(attrs: Partial<T>, options?: ODataOptions & {
|
|
97
76
|
etag?: string;
|
|
98
77
|
}): Observable<ODataEntity<T>>;
|
|
99
|
-
|
|
78
|
+
/**
|
|
79
|
+
* Delete an existing entity
|
|
80
|
+
* @param options Options for the request
|
|
81
|
+
* @param etag The etag of the entity
|
|
82
|
+
* @returns An observable of the destroy
|
|
83
|
+
*/
|
|
84
|
+
destroy(options?: ODataOptions & {
|
|
100
85
|
etag?: string;
|
|
101
86
|
}): Observable<any>;
|
|
102
|
-
|
|
87
|
+
/**
|
|
88
|
+
* Fetch entity / entities
|
|
89
|
+
* @param options Options for the request
|
|
90
|
+
* @return An observable of the entity or entities with annotations
|
|
91
|
+
*/
|
|
92
|
+
fetch(options?: ODataEntityOptions & {
|
|
103
93
|
etag?: string;
|
|
104
94
|
bodyQueryOptions?: QueryOptionNames[];
|
|
105
95
|
}): Observable<ODataEntity<T>>;
|
|
106
|
-
fetch(options?:
|
|
96
|
+
fetch(options?: ODataEntitiesOptions & {
|
|
107
97
|
etag?: string;
|
|
108
98
|
bodyQueryOptions?: QueryOptionNames[];
|
|
109
99
|
}): Observable<ODataEntities<T>>;
|
|
110
|
-
|
|
100
|
+
/**
|
|
101
|
+
* Fetch the entity
|
|
102
|
+
* @param options Options for the request
|
|
103
|
+
* @returns The entity
|
|
104
|
+
*/
|
|
105
|
+
fetchEntity(options?: ODataOptions & {
|
|
111
106
|
etag?: string;
|
|
112
107
|
bodyQueryOptions?: QueryOptionNames[];
|
|
113
108
|
}): Observable<T | null>;
|
|
114
|
-
|
|
109
|
+
/**
|
|
110
|
+
* Fetch the entity and return as model
|
|
111
|
+
* @param options Options for the request
|
|
112
|
+
* @returns The model
|
|
113
|
+
*/
|
|
114
|
+
fetchModel<M extends ODataModel<T>>(options?: ODataOptions & {
|
|
115
115
|
etag?: string;
|
|
116
116
|
bodyQueryOptions?: QueryOptionNames[];
|
|
117
|
-
}): Observable<
|
|
118
|
-
|
|
117
|
+
}): Observable<M | null>;
|
|
118
|
+
/**
|
|
119
|
+
* Fetch entities
|
|
120
|
+
* @param options Options for the request
|
|
121
|
+
* @returns The entities
|
|
122
|
+
*/
|
|
123
|
+
fetchEntities(options?: ODataOptions & {
|
|
119
124
|
bodyQueryOptions?: QueryOptionNames[];
|
|
120
125
|
}): Observable<T[] | null>;
|
|
121
|
-
|
|
126
|
+
/**
|
|
127
|
+
* Fetch entities and return as collection
|
|
128
|
+
* @param options Options for the request
|
|
129
|
+
* @returns The collection
|
|
130
|
+
*/
|
|
131
|
+
fetchCollection<M extends ODataModel<T>, C extends ODataCollection<T, M>>(options?: ODataOptions & {
|
|
122
132
|
withCount?: boolean;
|
|
123
133
|
bodyQueryOptions?: QueryOptionNames[];
|
|
124
|
-
}): Observable<
|
|
125
|
-
|
|
134
|
+
}): Observable<C | null>;
|
|
135
|
+
/**
|
|
136
|
+
* Fetch all entities
|
|
137
|
+
* @param options Options for the request
|
|
138
|
+
* @returns All entities
|
|
139
|
+
*/
|
|
140
|
+
fetchAll(options?: ODataOptions & {
|
|
126
141
|
bodyQueryOptions?: QueryOptionNames[];
|
|
127
142
|
}): Observable<T[]>;
|
|
128
143
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { HttpHeaders, HttpParams } from '@angular/common/http';
|
|
2
2
|
import { FetchPolicy } from '../../types';
|
|
3
|
-
import {
|
|
4
|
-
export declare type
|
|
3
|
+
import { ODataQueryArguments } from '../query';
|
|
4
|
+
export declare type ODataOptions = {
|
|
5
5
|
headers?: HttpHeaders | {
|
|
6
6
|
[header: string]: string | string[];
|
|
7
7
|
};
|
|
@@ -12,19 +12,19 @@ export declare type HttpOptions = {
|
|
|
12
12
|
withCredentials?: boolean;
|
|
13
13
|
fetchPolicy?: FetchPolicy;
|
|
14
14
|
};
|
|
15
|
-
export declare type
|
|
15
|
+
export declare type ODataEntityOptions = ODataOptions & {
|
|
16
16
|
responseType?: 'entity';
|
|
17
17
|
};
|
|
18
|
-
export declare type
|
|
18
|
+
export declare type ODataEntitiesOptions = ODataOptions & {
|
|
19
19
|
responseType?: 'entities';
|
|
20
20
|
withCount?: boolean;
|
|
21
21
|
};
|
|
22
|
-
export declare type
|
|
22
|
+
export declare type ODataPropertyOptions = ODataOptions & {
|
|
23
23
|
responseType?: 'property';
|
|
24
24
|
};
|
|
25
|
-
export declare type
|
|
25
|
+
export declare type ODataNoneOptions = ODataOptions & {
|
|
26
26
|
responseType?: 'none';
|
|
27
27
|
};
|
|
28
|
-
export declare type
|
|
28
|
+
export declare type ODataQueryArgumentsOptions<T> = ODataQueryArguments<T> & {
|
|
29
29
|
alias?: boolean;
|
|
30
|
-
} &
|
|
30
|
+
} & ODataOptions;
|
|
@@ -1,91 +1,81 @@
|
|
|
1
1
|
import { Observable } from 'rxjs';
|
|
2
|
-
import { ODataValueResource } from './value';
|
|
3
|
-
import { EntityKey, ODataResource } from '../resource';
|
|
4
|
-
import { ODataQueryOptions } from '../query-options';
|
|
5
|
-
import { ODataPathSegments } from '../path-segments';
|
|
6
|
-
import { HttpPropertyOptions, HttpEntitiesOptions, HttpEntityOptions, HttpOptions } from './options';
|
|
7
|
-
import { ODataProperty, ODataEntities, ODataEntity, ODataEntityAnnotations, ODataEntitiesAnnotations } from '../responses';
|
|
8
|
-
import { ODataModel, ODataCollection } from '../../models';
|
|
9
2
|
import { ODataApi } from '../../api';
|
|
10
|
-
import {
|
|
3
|
+
import { ODataCollection, ODataModel } from '../../models';
|
|
4
|
+
import { ODataStructuredType } from '../../schema';
|
|
5
|
+
import { ODataPathSegments } from '../path';
|
|
6
|
+
import { ODataQueryOptions } from '../query';
|
|
7
|
+
import { ODataResource } from '../resource';
|
|
8
|
+
import { ODataEntities, ODataEntity, ODataProperty } from '../responses';
|
|
9
|
+
import { ODataEntitiesOptions, ODataEntityOptions, ODataOptions, ODataPropertyOptions } from './options';
|
|
10
|
+
import { ODataValueResource } from './value';
|
|
11
11
|
export declare class ODataPropertyResource<T> extends ODataResource<T> {
|
|
12
|
-
static factory<P>(api: ODataApi, path
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}): M;
|
|
21
|
-
asCollection<M extends ODataModel<T>, C extends ODataCollection<T, M>>(entities: Partial<T>[] | {
|
|
22
|
-
[name: string]: any;
|
|
23
|
-
}[], { annots, reset, }?: {
|
|
24
|
-
annots?: ODataEntitiesAnnotations;
|
|
25
|
-
reset?: boolean;
|
|
26
|
-
}): C;
|
|
12
|
+
static factory<P>(api: ODataApi, { path, type, schema, segments, query, }: {
|
|
13
|
+
path: string;
|
|
14
|
+
type?: string;
|
|
15
|
+
schema?: ODataStructuredType<P>;
|
|
16
|
+
segments: ODataPathSegments;
|
|
17
|
+
query?: ODataQueryOptions<P>;
|
|
18
|
+
}): ODataPropertyResource<P>;
|
|
19
|
+
static fromResource<N>(resource: ODataResource<any>, path: string): ODataPropertyResource<N>;
|
|
27
20
|
key(value: any): ODataPropertyResource<T>;
|
|
28
21
|
keys(values: any[]): ODataPropertyResource<T>;
|
|
29
22
|
value(): ODataValueResource<T>;
|
|
30
23
|
property<P>(path: string): ODataPropertyResource<P>;
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
top(opts: number): ODataPropertyResource<T>;
|
|
39
|
-
skip(opts: number): ODataPropertyResource<T>;
|
|
40
|
-
skiptoken(opts: string): ODataPropertyResource<T>;
|
|
41
|
-
get segment(): {
|
|
42
|
-
entitySet(): import("../path-segments").SegmentHandler;
|
|
43
|
-
singleton(): import("../path-segments").SegmentHandler;
|
|
44
|
-
property(): import("../path-segments").SegmentHandler;
|
|
45
|
-
keys(values?: (EntityKey<any> | undefined)[] | undefined): (EntityKey<any> | undefined)[];
|
|
46
|
-
};
|
|
47
|
-
get query(): {
|
|
48
|
-
select(opts?: Select<T> | undefined): import("../query-options").OptionHandler<Select<T>>;
|
|
49
|
-
expand(opts?: Expand<T> | undefined): import("../query-options").OptionHandler<Expand<T>>;
|
|
50
|
-
compute(opts?: string | undefined): import("../query-options").OptionHandler<string>;
|
|
51
|
-
transform(opts?: Transform<T> | undefined): import("../query-options").OptionHandler<Transform<T>>;
|
|
52
|
-
search(opts?: string | undefined): import("../query-options").OptionHandler<string>;
|
|
53
|
-
filter(opts?: Filter | undefined): import("../query-options").OptionHandler<Filter>;
|
|
54
|
-
orderBy(opts?: OrderBy<T> | undefined): import("../query-options").OptionHandler<OrderBy<T>>;
|
|
55
|
-
format(opts?: string | undefined): import("../query-options").OptionHandler<string>;
|
|
56
|
-
top(opts?: number | undefined): import("../query-options").OptionHandler<number>;
|
|
57
|
-
skip(opts?: number | undefined): import("../query-options").OptionHandler<number>;
|
|
58
|
-
skiptoken(opts?: string | undefined): import("../query-options").OptionHandler<string>;
|
|
59
|
-
paging({ skip, skiptoken, top, }?: {
|
|
60
|
-
skip?: number | undefined;
|
|
61
|
-
skiptoken?: string | undefined;
|
|
62
|
-
top?: number | undefined;
|
|
63
|
-
}): void;
|
|
64
|
-
clearPaging(): void;
|
|
65
|
-
apply(query: import("../query-options").QueryArguments<T>): void;
|
|
66
|
-
};
|
|
67
|
-
get(options: HttpEntityOptions): Observable<ODataEntity<T>>;
|
|
68
|
-
get(options: HttpEntitiesOptions): Observable<ODataEntities<T>>;
|
|
69
|
-
get(options: HttpPropertyOptions): Observable<ODataProperty<T>>;
|
|
70
|
-
fetch(options?: HttpEntityOptions & {
|
|
24
|
+
protected get(options: ODataEntityOptions & ODataEntitiesOptions & ODataPropertyOptions): Observable<any>;
|
|
25
|
+
/**
|
|
26
|
+
* Fetch the property
|
|
27
|
+
* @param options Options for the request
|
|
28
|
+
* @return The entity / entities / property value
|
|
29
|
+
*/
|
|
30
|
+
fetch(options?: ODataEntityOptions & {
|
|
71
31
|
etag?: string;
|
|
72
32
|
}): Observable<ODataEntity<T>>;
|
|
73
|
-
fetch(options?:
|
|
74
|
-
fetch(options?:
|
|
75
|
-
|
|
33
|
+
fetch(options?: ODataEntitiesOptions): Observable<ODataEntities<T>>;
|
|
34
|
+
fetch(options?: ODataPropertyOptions): Observable<ODataProperty<T>>;
|
|
35
|
+
/**
|
|
36
|
+
* Fetch the property value
|
|
37
|
+
* @param options Options for the request
|
|
38
|
+
* @returns The property value
|
|
39
|
+
*/
|
|
40
|
+
fetchProperty(options?: ODataOptions & {
|
|
76
41
|
etag?: string;
|
|
77
42
|
}): Observable<T | null>;
|
|
78
|
-
|
|
43
|
+
/**
|
|
44
|
+
* Fetch the entity
|
|
45
|
+
* @param options Options for the request
|
|
46
|
+
* @returns The entity
|
|
47
|
+
*/
|
|
48
|
+
fetchEntity(options?: ODataOptions & {
|
|
79
49
|
etag?: string;
|
|
80
50
|
}): Observable<T | null>;
|
|
81
|
-
|
|
51
|
+
/**
|
|
52
|
+
* Fetch the entity and return as model
|
|
53
|
+
* @param options Options for the request
|
|
54
|
+
* @returns The model
|
|
55
|
+
*/
|
|
56
|
+
fetchModel<M extends ODataModel<T>>(options?: ODataOptions & {
|
|
82
57
|
etag?: string;
|
|
83
|
-
}): Observable<
|
|
84
|
-
|
|
58
|
+
}): Observable<M | null>;
|
|
59
|
+
/**
|
|
60
|
+
* Fetch the entities
|
|
61
|
+
* @param options Options for the request
|
|
62
|
+
* @returns The entities
|
|
63
|
+
*/
|
|
64
|
+
fetchEntities(options?: ODataOptions & {
|
|
85
65
|
withCount?: boolean;
|
|
86
66
|
}): Observable<T[] | null>;
|
|
87
|
-
|
|
67
|
+
/**
|
|
68
|
+
* Fetch the entities and return as collection
|
|
69
|
+
* @param options Options for the request
|
|
70
|
+
* @returns The collection
|
|
71
|
+
*/
|
|
72
|
+
fetchCollection<M extends ODataModel<T>, C extends ODataCollection<T, M>>(options?: ODataOptions & {
|
|
88
73
|
withCount?: boolean;
|
|
89
|
-
}): Observable<
|
|
90
|
-
|
|
74
|
+
}): Observable<C | null>;
|
|
75
|
+
/**
|
|
76
|
+
* Fetch all entities
|
|
77
|
+
* @param options Options for the request
|
|
78
|
+
* @returns All entities
|
|
79
|
+
*/
|
|
80
|
+
fetchAll(options?: ODataOptions): Observable<T[]>;
|
|
91
81
|
}
|
|
@@ -1,28 +1,84 @@
|
|
|
1
1
|
import { Observable } from 'rxjs';
|
|
2
|
+
import { ODataApi } from '../../api';
|
|
3
|
+
import { QueryOptionNames } from '../../types';
|
|
4
|
+
import { ODataPathSegments } from '../path';
|
|
5
|
+
import { ODataQueryOptions } from '../query';
|
|
2
6
|
import { ODataResource } from '../resource';
|
|
3
|
-
import {
|
|
4
|
-
import { ODataQueryOptions } from '../query-options';
|
|
7
|
+
import { ODataEntities, ODataEntity } from '../responses/types';
|
|
5
8
|
import { ODataEntityResource } from './entity';
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
post(target: ODataEntityResource<any>, options?:
|
|
13
|
-
put(target: ODataEntityResource<any>, options?:
|
|
9
|
+
import { ODataEntitiesOptions, ODataEntityOptions, ODataOptions } from './options';
|
|
10
|
+
export declare class ODataReferenceResource<T> extends ODataResource<T> {
|
|
11
|
+
static factory<P>(api: ODataApi, { segments, query, }: {
|
|
12
|
+
segments: ODataPathSegments;
|
|
13
|
+
query?: ODataQueryOptions<P>;
|
|
14
|
+
}): ODataReferenceResource<P>;
|
|
15
|
+
protected post(target: ODataEntityResource<any>, options?: ODataOptions): Observable<any>;
|
|
16
|
+
protected put(target: ODataEntityResource<any>, options?: ODataOptions & {
|
|
14
17
|
etag?: string;
|
|
15
18
|
}): Observable<any>;
|
|
16
|
-
delete({ etag, target, ...options }?: {
|
|
19
|
+
protected delete({ etag, target, ...options }?: {
|
|
17
20
|
etag?: string;
|
|
18
21
|
target?: ODataEntityResource<any>;
|
|
19
|
-
} &
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
22
|
+
} & ODataOptions): Observable<any>;
|
|
23
|
+
/**
|
|
24
|
+
* Add the given target to the collection.
|
|
25
|
+
* @param target The target resource
|
|
26
|
+
* @param options Options for the request
|
|
27
|
+
* @returns Observable of the response
|
|
28
|
+
*/
|
|
29
|
+
add(target: ODataEntityResource<any>, options?: ODataOptions): Observable<any>;
|
|
30
|
+
/**
|
|
31
|
+
* Remove the given target from the collection.
|
|
32
|
+
* @param target The target resource
|
|
33
|
+
* @param options Options for the request
|
|
34
|
+
* @returns Observable of the response
|
|
35
|
+
*/
|
|
36
|
+
remove(target?: ODataEntityResource<any>, options?: ODataOptions): Observable<any>;
|
|
37
|
+
/**
|
|
38
|
+
* Set the reference to the given target.
|
|
39
|
+
* @param target The target resource
|
|
40
|
+
* @param options Options for the request
|
|
41
|
+
* @returns Observable of the response
|
|
42
|
+
*/
|
|
43
|
+
set(target: ODataEntityResource<any>, options?: ODataOptions & {
|
|
23
44
|
etag?: string;
|
|
24
45
|
}): Observable<any>;
|
|
25
|
-
|
|
46
|
+
/**
|
|
47
|
+
* Unset the reference to the given target.
|
|
48
|
+
* @param options Options for the request.
|
|
49
|
+
* @returns Observable of the response
|
|
50
|
+
*/
|
|
51
|
+
unset(options?: ODataOptions & {
|
|
26
52
|
etag?: string;
|
|
27
53
|
}): Observable<any>;
|
|
54
|
+
/**
|
|
55
|
+
* Fetch entity / entities
|
|
56
|
+
* @param options Options for the request
|
|
57
|
+
* @return An observable of the entity or entities with annotations
|
|
58
|
+
*/
|
|
59
|
+
fetch(options?: ODataEntityOptions & {
|
|
60
|
+
etag?: string;
|
|
61
|
+
bodyQueryOptions?: QueryOptionNames[];
|
|
62
|
+
}): Observable<ODataEntity<T>>;
|
|
63
|
+
fetch(options?: ODataEntitiesOptions & {
|
|
64
|
+
etag?: string;
|
|
65
|
+
bodyQueryOptions?: QueryOptionNames[];
|
|
66
|
+
}): Observable<ODataEntities<T>>;
|
|
67
|
+
/**
|
|
68
|
+
* Fetch the entity
|
|
69
|
+
* @param options Options for the request
|
|
70
|
+
* @returns The entity
|
|
71
|
+
*/
|
|
72
|
+
fetchEntity(options?: ODataOptions & {
|
|
73
|
+
etag?: string;
|
|
74
|
+
bodyQueryOptions?: QueryOptionNames[];
|
|
75
|
+
}): Observable<T | null>;
|
|
76
|
+
/**
|
|
77
|
+
* Fetch entities
|
|
78
|
+
* @param options Options for the request
|
|
79
|
+
* @returns The entities
|
|
80
|
+
*/
|
|
81
|
+
fetchEntities(options?: ODataOptions & {
|
|
82
|
+
bodyQueryOptions?: QueryOptionNames[];
|
|
83
|
+
}): Observable<T[] | null>;
|
|
28
84
|
}
|