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
package/lib/api.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Observable } from 'rxjs';
|
|
2
|
-
import { ApiConfig, Parser } from './types';
|
|
3
|
-
import { ODataSchema, ODataEnumType, ODataCallable, ODataEntitySet, ODataStructuredType } from './schema/index';
|
|
4
|
-
import { ODataModel, ODataCollection } from './models/index';
|
|
5
|
-
import { ODataBatchResource, ODataMetadataResource, ODataEntitySetResource, ODataSingletonResource, ODataFunctionResource, ODataActionResource, ODataEntityResource, ODataSegment, ODataNavigationPropertyResource, ODataRequest } from './resources/index';
|
|
6
2
|
import { ODataCache } from './cache/index';
|
|
3
|
+
import { ODataCollection, ODataModel, ODataModelOptions } from './models/index';
|
|
7
4
|
import { ODataApiOptions } from './options';
|
|
5
|
+
import { ODataActionResource, ODataBatchResource, ODataEntityResource, ODataEntitySetResource, ODataFunctionResource, ODataMetadataResource, ODataNavigationPropertyResource, ODataRequest, ODataSegment, ODataSingletonResource } from './resources/index';
|
|
6
|
+
import { ODataCallable, ODataEntitySet, ODataEnumType, ODataSchema, ODataStructuredType } from './schema';
|
|
8
7
|
import { ODataEntityService } from './services/entity';
|
|
8
|
+
import { ApiConfig, Parser } from './types';
|
|
9
9
|
/**
|
|
10
10
|
* Api abstraction for consuming OData services.
|
|
11
11
|
*/
|
|
@@ -52,38 +52,39 @@ export declare class ODataApi {
|
|
|
52
52
|
batch(): ODataBatchResource;
|
|
53
53
|
/**
|
|
54
54
|
* Build a singleton resource.
|
|
55
|
-
* @param
|
|
55
|
+
* @param path Name of the singleton
|
|
56
56
|
* @returns
|
|
57
57
|
*/
|
|
58
|
-
singleton<T>(
|
|
58
|
+
singleton<T>(path: string): ODataSingletonResource<T>;
|
|
59
59
|
/**
|
|
60
60
|
* Build an entity set resource.
|
|
61
|
-
* @param
|
|
61
|
+
* @param path Name of the entity set
|
|
62
62
|
* @returns
|
|
63
63
|
*/
|
|
64
|
-
entitySet<T>(
|
|
64
|
+
entitySet<T>(path: string): ODataEntitySetResource<T>;
|
|
65
65
|
/**
|
|
66
66
|
* Unbound Action
|
|
67
|
-
* @param {string}
|
|
67
|
+
* @param {string} path?
|
|
68
68
|
* @returns ODataActionResource
|
|
69
69
|
*/
|
|
70
|
-
action<P, R>(
|
|
70
|
+
action<P, R>(path: string): ODataActionResource<P, R>;
|
|
71
71
|
/**
|
|
72
72
|
* Unbound Function
|
|
73
|
-
* @param {string}
|
|
73
|
+
* @param {string} path?
|
|
74
74
|
* @returns ODataFunctionResource
|
|
75
75
|
*/
|
|
76
|
-
function<P, R>(
|
|
76
|
+
function<P, R>(path: string): ODataFunctionResource<P, R>;
|
|
77
77
|
request(req: ODataRequest<any>): Observable<any>;
|
|
78
|
+
private memo;
|
|
78
79
|
private findSchemaForType;
|
|
79
80
|
findEnumTypeForType<T>(type: string): ODataEnumType<T> | undefined;
|
|
80
81
|
findStructuredTypeForType<T>(type: string): ODataStructuredType<T> | undefined;
|
|
81
82
|
findCallableForType<T>(type: string, bindingType?: string): ODataCallable<T> | undefined;
|
|
82
83
|
findEntitySetForType(type: string): ODataEntitySet | undefined;
|
|
83
84
|
findModelForType(type: string): typeof ODataModel | undefined;
|
|
84
|
-
modelForType(type
|
|
85
|
+
modelForType(type: string): typeof ODataModel;
|
|
85
86
|
findCollectionForType(type: string): typeof ODataCollection | undefined;
|
|
86
|
-
collectionForType(type
|
|
87
|
+
collectionForType(type: string): typeof ODataCollection;
|
|
87
88
|
findServiceForType(type: string): typeof ODataEntityService | undefined;
|
|
88
89
|
findEntitySetForEntityType(entityType: string): ODataEntitySet | undefined;
|
|
89
90
|
findServiceForEntityType(entityType: string): typeof ODataEntityService | undefined;
|
|
@@ -94,6 +95,6 @@ export declare class ODataApi {
|
|
|
94
95
|
findModelByName(name: string): typeof ODataModel | undefined;
|
|
95
96
|
findCollectionByName(name: string): typeof ODataCollection | undefined;
|
|
96
97
|
findServiceByName(name: string): typeof ODataEntityService | undefined;
|
|
97
|
-
parserForType<T>(type: string, bindingType?: string): Parser<
|
|
98
|
-
findOptionsForType<T>(type: string):
|
|
98
|
+
parserForType<T>(type: string, bindingType?: string): Parser<T>;
|
|
99
|
+
findOptionsForType<T>(type: string): ODataModelOptions<T> | undefined;
|
|
99
100
|
}
|
package/lib/cache/cache.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Cache } from '../types';
|
|
2
|
-
import { ODataRequest, ODataResponse } from '../resources';
|
|
3
1
|
import { Observable } from 'rxjs';
|
|
2
|
+
import { ODataRequest, ODataResponse } from '../resources';
|
|
3
|
+
import { Cache } from '../types';
|
|
4
4
|
export interface ODataCacheEntry<T> {
|
|
5
5
|
payload: T;
|
|
6
6
|
lastRead: number;
|
package/lib/client.d.ts
CHANGED
|
@@ -1,33 +1,84 @@
|
|
|
1
|
+
import { HttpClient, HttpEvent, HttpHeaders, HttpParams, HttpResponse } from '@angular/common/http';
|
|
1
2
|
import { Injector } from '@angular/core';
|
|
2
|
-
import { HttpClient, HttpHeaders, HttpParams, HttpResponse, HttpEvent } from '@angular/common/http';
|
|
3
3
|
import { Observable } from 'rxjs';
|
|
4
|
-
import { ODataModel, ODataCollection } from './models/index';
|
|
5
|
-
import { ODataResource, ODataBatchResource, ODataMetadataResource, ODataEntitySetResource, ODataSingletonResource, ODataFunctionResource, ODataActionResource, ODataEntityResource, ODataSegment, ODataResponse, ODataNavigationPropertyResource } from './resources/index';
|
|
6
|
-
import { ODataSettings } from './settings';
|
|
7
4
|
import { ODataApi } from './api';
|
|
5
|
+
import { ODataCollection, ODataModel } from './models/index';
|
|
6
|
+
import { ODataActionResource, ODataBatchResource, ODataEntityResource, ODataEntitySetResource, ODataFunctionResource, ODataMetadataResource, ODataNavigationPropertyResource, ODataResource, ODataResponse, ODataSegment, ODataSingletonResource } from './resources/index';
|
|
8
7
|
import { ODataEntityService } from './services/entity';
|
|
8
|
+
import { ODataSettings } from './settings';
|
|
9
9
|
import * as i0 from "@angular/core";
|
|
10
10
|
export declare class ODataClient {
|
|
11
11
|
private http;
|
|
12
12
|
private settings;
|
|
13
13
|
private injector;
|
|
14
14
|
constructor(http: HttpClient, settings: ODataSettings, injector: Injector);
|
|
15
|
+
/**
|
|
16
|
+
* Resolve the api for the given value.
|
|
17
|
+
* Where value is: string type or an string name or an instance of resource.
|
|
18
|
+
* @param value The value to resolve.
|
|
19
|
+
* @returns The api for the value.
|
|
20
|
+
*/
|
|
15
21
|
apiFor(value?: ODataResource<any> | string): ODataApi;
|
|
22
|
+
/**
|
|
23
|
+
* Resolve the parser for the given string type.
|
|
24
|
+
* @param type The string type of the parser.
|
|
25
|
+
* @returns The parser for the given type.
|
|
26
|
+
*/
|
|
16
27
|
parserForType<T>(type: string): import("angular-odata").Parser<T>;
|
|
28
|
+
/**
|
|
29
|
+
* Resolve the enum type for the given string type.
|
|
30
|
+
* @param type The string type of the enum type.
|
|
31
|
+
* @returns The enum type for the given type.
|
|
32
|
+
*/
|
|
17
33
|
enumTypeForType<T>(type: string): import("angular-odata").ODataEnumType<T>;
|
|
18
|
-
|
|
34
|
+
/**
|
|
35
|
+
* Resolve the structured type for the given string type.
|
|
36
|
+
* @param type The string type of the structured type.
|
|
37
|
+
* @returns The structured type for the given type.
|
|
38
|
+
*/
|
|
19
39
|
structuredTypeForType<T>(type: string): import("angular-odata").ODataStructuredType<T>;
|
|
20
|
-
|
|
40
|
+
/**
|
|
41
|
+
* Resolve the callable for the given string type.
|
|
42
|
+
* @param type The string type of the callable.
|
|
43
|
+
* @returns The callable for the given type.
|
|
44
|
+
*/
|
|
21
45
|
callableForType<T>(type: string): import("angular-odata").ODataCallable<T>;
|
|
22
|
-
|
|
46
|
+
/**
|
|
47
|
+
* Resolve the entity set for the given string type.
|
|
48
|
+
* @param type The string type of the entity set.
|
|
49
|
+
* @returns The entity set for the given type.
|
|
50
|
+
*/
|
|
23
51
|
entitySetForType(type: string): import("angular-odata").ODataEntitySet;
|
|
24
|
-
|
|
52
|
+
/**
|
|
53
|
+
* Resolve the model for the given string type.
|
|
54
|
+
* @param type The string type of the model.
|
|
55
|
+
* @returns The model for the given type.
|
|
56
|
+
*/
|
|
25
57
|
modelForType(type: string): typeof ODataModel;
|
|
26
|
-
|
|
58
|
+
/**
|
|
59
|
+
* Resolve the collection for the given string type.
|
|
60
|
+
* @param type The string type of the collection.
|
|
61
|
+
* @returns The collection for the given type.
|
|
62
|
+
*/
|
|
27
63
|
collectionForType(type: string): typeof ODataCollection;
|
|
28
|
-
|
|
64
|
+
/**
|
|
65
|
+
* Resolve the service for the given string type.
|
|
66
|
+
* @param type The string type of the service.
|
|
67
|
+
* @returns The service for the given type.
|
|
68
|
+
*/
|
|
29
69
|
serviceForType(type: string): ODataEntityService<any>;
|
|
70
|
+
/**
|
|
71
|
+
* Resolve the service for the given string entity type.
|
|
72
|
+
* @param type The string entity type binding to the service.
|
|
73
|
+
* @returns The service for the given entity type.
|
|
74
|
+
*/
|
|
30
75
|
serviceForEntityType(type: string): ODataEntityService<any>;
|
|
76
|
+
enumTypeByName<T>(name: string): import("angular-odata").ODataEnumType<T>;
|
|
77
|
+
structuredTypeByName<T>(name: string): import("angular-odata").ODataStructuredType<T>;
|
|
78
|
+
callableByName<T>(name: string): import("angular-odata").ODataCallable<T>;
|
|
79
|
+
entitySetByName(name: string): import("angular-odata").ODataEntitySet;
|
|
80
|
+
modelByName(name: string): typeof ODataModel;
|
|
81
|
+
collectionByName(name: string): typeof ODataCollection;
|
|
31
82
|
serviceByName(name: string): ODataEntityService<any>;
|
|
32
83
|
fromJSON<E>(json: {
|
|
33
84
|
segments: ODataSegment[];
|
|
@@ -35,20 +86,44 @@ export declare class ODataClient {
|
|
|
35
86
|
[name: string]: any;
|
|
36
87
|
};
|
|
37
88
|
}, apiNameOrType?: string): ODataEntityResource<E> | ODataEntitySetResource<E> | ODataNavigationPropertyResource<E> | ODataSingletonResource<E>;
|
|
38
|
-
|
|
39
|
-
|
|
89
|
+
/**
|
|
90
|
+
* Build a resource for the metadata.
|
|
91
|
+
* @param apiName The name of the API.
|
|
92
|
+
* @returns The metadata resource.
|
|
93
|
+
*/
|
|
94
|
+
metadata(apiName?: string): ODataMetadataResource;
|
|
95
|
+
/**
|
|
96
|
+
* Build a resource for the batch.
|
|
97
|
+
* @param apiName The name of the API.
|
|
98
|
+
* @returns The batch resource.
|
|
99
|
+
*/
|
|
100
|
+
batch(apiName?: string): ODataBatchResource;
|
|
101
|
+
/**
|
|
102
|
+
* Build a resource for the singleton.
|
|
103
|
+
* @param path The full path to the singleton.
|
|
104
|
+
* @param apiNameOrType The name of the API or the type of the singleton.
|
|
105
|
+
* @returns The singleton resource.
|
|
106
|
+
*/
|
|
40
107
|
singleton<T>(path: string, apiNameOrType?: string): ODataSingletonResource<T>;
|
|
108
|
+
/**
|
|
109
|
+
* Build a resource for the entity set.
|
|
110
|
+
* @param path The full path to the entity set.
|
|
111
|
+
* @param apiNameOrType The name of the API or the type of the entity set.
|
|
112
|
+
* @returns The entity set resource.
|
|
113
|
+
*/
|
|
41
114
|
entitySet<T>(path: string, apiNameOrType?: string): ODataEntitySetResource<T>;
|
|
42
115
|
/**
|
|
43
|
-
*
|
|
44
|
-
* @param
|
|
45
|
-
* @
|
|
116
|
+
* Build a resource for unbound action.
|
|
117
|
+
* @param path The full path to the action.
|
|
118
|
+
* @param apiNameOrType The name of the API or the type of the entity.
|
|
119
|
+
* @returns The unbound action resource.
|
|
46
120
|
*/
|
|
47
121
|
action<P, R>(path: string, apiNameOrType?: string): ODataActionResource<P, R>;
|
|
48
122
|
/**
|
|
49
|
-
*
|
|
50
|
-
* @param
|
|
51
|
-
* @
|
|
123
|
+
* Build a resource for unbound function.
|
|
124
|
+
* @param path The full path to the function.
|
|
125
|
+
* @param apiNameOrType The name of the API or the type of the callable.
|
|
126
|
+
* @returns The unbound function resource.
|
|
52
127
|
*/
|
|
53
128
|
function<P, R>(path: string, apiNameOrType?: string): ODataFunctionResource<P, R>;
|
|
54
129
|
request(method: string, resource: ODataResource<any>, options: {
|
package/lib/constants.d.ts
CHANGED
|
@@ -46,6 +46,7 @@ export declare const DEFAULT_STRIP_METADATA = "full";
|
|
|
46
46
|
export declare const DEFAULT_FETCH_POLICY = "network-only";
|
|
47
47
|
export declare const DEFAULT_TIMEOUT = 60;
|
|
48
48
|
export declare const CALLABLE_BINDING_PARAMETER = "bindingParameter";
|
|
49
|
+
export declare const XSSI_PREFIX: RegExp;
|
|
49
50
|
export declare const QUERY_SEPARATOR = "?";
|
|
50
51
|
export declare const PARAM_SEPARATOR = "&";
|
|
51
52
|
export declare const VALUE_SEPARATOR = "=";
|
|
@@ -55,5 +56,8 @@ export declare const ODATA_ALIAS_PREFIX = "@";
|
|
|
55
56
|
export declare const NEWLINE = "\r\n";
|
|
56
57
|
export declare const NEWLINE_REGEXP: RegExp;
|
|
57
58
|
export declare const CACHE_KEY_SEPARATOR = ":";
|
|
58
|
-
export declare const
|
|
59
|
-
export declare const
|
|
59
|
+
export declare const CID_FIELD_NAME = "_cid";
|
|
60
|
+
export declare const COMPUTED: RegExp;
|
|
61
|
+
export declare const OPTIMISTIC_CONCURRENCY: RegExp;
|
|
62
|
+
export declare const DESCRIPTION: RegExp;
|
|
63
|
+
export declare const LONG_DESCRIPTION: RegExp;
|
package/lib/helper.d.ts
CHANGED
|
@@ -44,6 +44,9 @@ export interface ODataVersionHelper {
|
|
|
44
44
|
etag(value: {
|
|
45
45
|
[name: string]: any;
|
|
46
46
|
}, etag?: string): string | undefined;
|
|
47
|
+
type(value: {
|
|
48
|
+
[name: string]: any;
|
|
49
|
+
}, type?: string): string | undefined;
|
|
47
50
|
count(value: {
|
|
48
51
|
[name: string]: any;
|
|
49
52
|
}): number | undefined;
|
|
@@ -66,9 +69,6 @@ export interface ODataVersionHelper {
|
|
|
66
69
|
metadataEtag(value: {
|
|
67
70
|
[name: string]: any;
|
|
68
71
|
}): string | undefined;
|
|
69
|
-
type(value: {
|
|
70
|
-
[name: string]: any;
|
|
71
|
-
}): string | undefined;
|
|
72
72
|
nextLink(value: {
|
|
73
73
|
[name: string]: any;
|
|
74
74
|
}): string | undefined;
|
package/lib/index.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { Observable } from 'rxjs';
|
|
2
|
-
import { ODataEntitiesAnnotations, HttpOptions, Select, Expand, OptionHandler, Transform, Filter, OrderBy, QueryArguments, HttpQueryOptions } from '../resources/index';
|
|
3
1
|
import { EventEmitter } from '@angular/core';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { ODataEntitiesAnnotations, ODataEntitySetResource, ODataNavigationPropertyResource, ODataOptions, ODataPropertyResource, ODataQueryArgumentsOptions, ODataQueryOptionsHandler, ODataResource } from '../resources';
|
|
4
4
|
import { ODataModel } from './model';
|
|
5
|
-
import {
|
|
5
|
+
import { ODataModelEntry, ODataModelEvent, ODataModelField } from './options';
|
|
6
6
|
export declare class ODataCollection<T, M extends ODataModel<T>> implements Iterable<M> {
|
|
7
7
|
static model: typeof ODataModel | null;
|
|
8
8
|
_parent: [
|
|
9
9
|
ODataModel<any> | ODataCollection<any, ODataModel<any>>,
|
|
10
10
|
ODataModelField<any> | null
|
|
11
11
|
] | null;
|
|
12
|
-
_resource
|
|
12
|
+
_resource: ODataEntitySetResource<T> | ODataNavigationPropertyResource<T> | ODataPropertyResource<T> | null;
|
|
13
13
|
_annotations: ODataEntitiesAnnotations;
|
|
14
14
|
_entries: ODataModelEntry<T, M>[];
|
|
15
15
|
_model: typeof ODataModel;
|
|
@@ -20,15 +20,15 @@ export declare class ODataCollection<T, M extends ODataModel<T>> implements Iter
|
|
|
20
20
|
[name: string]: any;
|
|
21
21
|
}[], { parent, resource, annots, model, reset, }?: {
|
|
22
22
|
parent?: [ODataModel<any>, ODataModelField<any>];
|
|
23
|
-
resource?:
|
|
23
|
+
resource?: ODataResource<T>;
|
|
24
24
|
annots?: ODataEntitiesAnnotations;
|
|
25
25
|
model?: typeof ODataModel;
|
|
26
26
|
reset?: boolean;
|
|
27
27
|
});
|
|
28
28
|
isParentOf(child: ODataModel<any> | ODataCollection<any, ODataModel<any>>): boolean;
|
|
29
|
-
resource():
|
|
30
|
-
attach(resource:
|
|
31
|
-
asEntitySet<R>(func: (collection: this) =>
|
|
29
|
+
resource(): ODataEntitySetResource<T> | ODataNavigationPropertyResource<T> | ODataPropertyResource<T>;
|
|
30
|
+
attach(resource: ODataEntitySetResource<T> | ODataNavigationPropertyResource<T> | ODataPropertyResource<T>): void;
|
|
31
|
+
asEntitySet<R>(func: (collection: this) => R): R;
|
|
32
32
|
annots(): ODataEntitiesAnnotations;
|
|
33
33
|
private modelFactory;
|
|
34
34
|
toEntities({ client_id, include_navigation, include_concurrency, include_computed, include_key, include_non_field, changes_only, field_mapping, chain, }?: {
|
|
@@ -44,43 +44,39 @@ export declare class ODataCollection<T, M extends ODataModel<T>> implements Iter
|
|
|
44
44
|
}): (T | {
|
|
45
45
|
[name: string]: any;
|
|
46
46
|
})[];
|
|
47
|
+
toJSON(): (T | {
|
|
48
|
+
[name: string]: any;
|
|
49
|
+
})[];
|
|
47
50
|
hasChanged({ include_navigation }?: {
|
|
48
51
|
include_navigation?: boolean;
|
|
49
52
|
}): boolean;
|
|
50
53
|
clone<C extends ODataCollection<T, M>>(): C;
|
|
51
|
-
fetch({ withCount, ...options }?:
|
|
54
|
+
fetch({ withCount, ...options }?: ODataOptions & {
|
|
52
55
|
withCount?: boolean;
|
|
53
56
|
}): Observable<this>;
|
|
54
|
-
fetchAll(options?:
|
|
57
|
+
fetchAll(options?: ODataOptions): Observable<this>;
|
|
55
58
|
/**
|
|
56
59
|
* Save all models in the collection
|
|
57
60
|
* @param relModel The model is relationship
|
|
58
61
|
* @param method The method to use
|
|
59
62
|
* @param options HttpOptions
|
|
60
63
|
*/
|
|
61
|
-
save({ relModel,
|
|
64
|
+
save({ relModel, method, ...options }?: ODataOptions & {
|
|
62
65
|
relModel?: boolean;
|
|
63
|
-
|
|
64
|
-
method?: 'update' | 'patch';
|
|
66
|
+
method?: 'update' | 'modify';
|
|
65
67
|
}): Observable<this>;
|
|
66
68
|
private addReference;
|
|
67
69
|
private _addModel;
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
reset?: boolean;
|
|
71
|
-
position?: number;
|
|
72
|
-
}): void;
|
|
73
|
-
add(model: M, { silent, server, position, }?: {
|
|
70
|
+
private addModel;
|
|
71
|
+
add(model: M, { silent, reparent, server, position, }?: {
|
|
74
72
|
silent?: boolean;
|
|
73
|
+
reparent?: boolean;
|
|
75
74
|
server?: boolean;
|
|
76
75
|
position?: number;
|
|
77
76
|
}): Observable<this>;
|
|
78
77
|
private removeReference;
|
|
79
78
|
private _removeModel;
|
|
80
|
-
|
|
81
|
-
silent?: boolean;
|
|
82
|
-
reset?: boolean;
|
|
83
|
-
}): void;
|
|
79
|
+
private removeModel;
|
|
84
80
|
remove(model: M, { silent, server, }?: {
|
|
85
81
|
silent?: boolean;
|
|
86
82
|
server?: boolean;
|
|
@@ -90,47 +86,40 @@ export declare class ODataCollection<T, M extends ODataModel<T>> implements Iter
|
|
|
90
86
|
server?: boolean;
|
|
91
87
|
}): Observable<M>;
|
|
92
88
|
set(path: string | string[], value: any): any;
|
|
93
|
-
get(path:
|
|
89
|
+
get(path: number): M | undefined;
|
|
90
|
+
get(path: string | string[]): any;
|
|
94
91
|
reset({ path, silent, }?: {
|
|
95
92
|
path?: string | string[];
|
|
96
93
|
silent?: boolean;
|
|
97
94
|
}): void;
|
|
98
95
|
assign(objects: Partial<T>[] | {
|
|
99
96
|
[name: string]: any;
|
|
100
|
-
}[] | M[], { reset, silent, }?: {
|
|
97
|
+
}[] | M[], { reset, reparent, silent, }?: {
|
|
101
98
|
reset?: boolean;
|
|
99
|
+
reparent?: boolean;
|
|
102
100
|
silent?: boolean;
|
|
103
101
|
}): void;
|
|
104
|
-
query(func: (q:
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
transform(opts?: Transform<T>): OptionHandler<Transform<T>>;
|
|
108
|
-
search(opts?: string): OptionHandler<string>;
|
|
109
|
-
filter(opts?: Filter): OptionHandler<Filter>;
|
|
110
|
-
orderBy(opts?: OrderBy<T>): OptionHandler<OrderBy<T>>;
|
|
111
|
-
format(opts?: string): OptionHandler<string>;
|
|
112
|
-
top(opts?: number): OptionHandler<number>;
|
|
113
|
-
skip(opts?: number): OptionHandler<number>;
|
|
114
|
-
skiptoken(opts?: string): OptionHandler<string>;
|
|
115
|
-
paging({ skip, skiptoken, top, }: {
|
|
116
|
-
skip?: number;
|
|
117
|
-
skiptoken?: string;
|
|
118
|
-
top?: number;
|
|
119
|
-
}): void;
|
|
120
|
-
clearPaging(): void;
|
|
121
|
-
apply(query: QueryArguments<T>): void;
|
|
122
|
-
}) => void): void;
|
|
123
|
-
protected callFunction<P, R>(name: string, params: P | null, responseType: 'property' | 'model' | 'collection' | 'none', { ...options }?: {} & HttpQueryOptions<R>): Observable<R | ODataModel<R> | ODataCollection<R, ODataModel<R>> | null>;
|
|
124
|
-
protected callAction<P, R>(name: string, params: P | null, responseType: 'property' | 'model' | 'collection' | 'none', { ...options }?: {} & HttpQueryOptions<R>): Observable<R | ODataModel<R> | ODataCollection<R, ODataModel<R>> | null>;
|
|
102
|
+
query(func: (q: ODataQueryOptionsHandler<T>) => void): this;
|
|
103
|
+
callFunction<P, R>(name: string, params: P | null, responseType: 'property' | 'model' | 'collection' | 'none', { ...options }?: {} & ODataQueryArgumentsOptions<R>): Observable<R | ODataModel<R> | ODataCollection<R, ODataModel<R>> | null>;
|
|
104
|
+
callAction<P, R>(name: string, params: P | null, responseType: 'property' | 'model' | 'collection' | 'none', { ...options }?: {} & ODataQueryArgumentsOptions<R>): Observable<R | ODataModel<R> | ODataCollection<R, ODataModel<R>> | null>;
|
|
125
105
|
private _unsubscribe;
|
|
126
106
|
private _subscribe;
|
|
127
107
|
private _findEntry;
|
|
108
|
+
equals(other: ODataCollection<T, ODataModel<T>>): boolean;
|
|
128
109
|
get [Symbol.toStringTag](): string;
|
|
129
110
|
[Symbol.iterator](): {
|
|
130
111
|
next(): IteratorResult<M>;
|
|
131
112
|
};
|
|
113
|
+
filter(predicate: (m: M, index: number) => boolean): M[];
|
|
114
|
+
find(predicate: (m: M, index: number) => boolean): M | undefined;
|
|
115
|
+
first(): M | undefined;
|
|
116
|
+
last(): M | undefined;
|
|
117
|
+
next(model: M): M | undefined;
|
|
118
|
+
prev(model: M): M | undefined;
|
|
119
|
+
every(predicate: (m: M, index: number) => boolean): boolean;
|
|
120
|
+
some(predicate: (m: M, index: number) => boolean): boolean;
|
|
132
121
|
contains(model: M): boolean;
|
|
133
|
-
|
|
122
|
+
indexOf(model: M): number;
|
|
134
123
|
private _bisect;
|
|
135
124
|
private _compare;
|
|
136
125
|
_sortBy: {
|
package/lib/models/model.d.ts
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import { EventEmitter } from '@angular/core';
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
|
-
import {
|
|
4
|
-
import { ODataCollection } from './collection';
|
|
3
|
+
import { EntityKey, ODataEntityAnnotations, ODataEntityResource, ODataNavigationPropertyResource, ODataOptions, ODataPropertyResource, ODataQueryArgumentsOptions, ODataQueryOptionsHandler, ODataResource, ODataSingletonResource } from '../resources';
|
|
5
4
|
import { ODataStructuredType } from '../schema';
|
|
6
|
-
import {
|
|
5
|
+
import { ODataCollection } from './collection';
|
|
6
|
+
import { ModelOptions, ODataModelEvent, ODataModelField, ODataModelOptions, ODataModelRelation } from './options';
|
|
7
7
|
export declare class ODataModel<T> {
|
|
8
8
|
static options: ModelOptions;
|
|
9
9
|
static meta: ODataModelOptions<any>;
|
|
10
|
-
static buildMeta<T>(options
|
|
10
|
+
static buildMeta<T>({ options, schema, }: {
|
|
11
|
+
options?: ModelOptions;
|
|
12
|
+
schema: ODataStructuredType<T>;
|
|
13
|
+
}): void;
|
|
11
14
|
_parent: [
|
|
12
15
|
ODataModel<any> | ODataCollection<any, ODataModel<any>>,
|
|
13
16
|
ODataModelField<any> | null
|
|
@@ -21,9 +24,10 @@ export declare class ODataModel<T> {
|
|
|
21
24
|
_relations: {
|
|
22
25
|
[name: string]: ODataModelRelation<any>;
|
|
23
26
|
};
|
|
24
|
-
_resource
|
|
27
|
+
_resource: ODataResource<T> | null;
|
|
25
28
|
_annotations: ODataEntityAnnotations;
|
|
26
|
-
|
|
29
|
+
_reset: boolean;
|
|
30
|
+
_reparent: boolean;
|
|
27
31
|
_silent: boolean;
|
|
28
32
|
_meta: ODataModelOptions<T>;
|
|
29
33
|
events$: EventEmitter<ODataModelEvent<T>>;
|
|
@@ -34,16 +38,14 @@ export declare class ODataModel<T> {
|
|
|
34
38
|
ODataModel<any> | ODataCollection<any, ODataModel<any>>,
|
|
35
39
|
ODataModelField<any> | null
|
|
36
40
|
];
|
|
37
|
-
resource?:
|
|
41
|
+
resource?: ODataResource<T>;
|
|
38
42
|
annots?: ODataEntityAnnotations;
|
|
39
43
|
reset?: boolean;
|
|
40
44
|
});
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
resource(): ODataModelResource<T>;
|
|
44
|
-
navigationProperty<N>(name: string): ODataNavigationPropertyResource<N>;
|
|
45
|
+
resource(): ODataEntityResource<T> | ODataNavigationPropertyResource<T> | ODataPropertyResource<T> | ODataSingletonResource<T>;
|
|
46
|
+
navigationProperty<N>(name: keyof T | string): ODataNavigationPropertyResource<N>;
|
|
45
47
|
property<N>(name: string): ODataPropertyResource<N>;
|
|
46
|
-
attach(resource:
|
|
48
|
+
attach(resource: ODataEntityResource<T> | ODataNavigationPropertyResource<T> | ODataPropertyResource<T> | ODataSingletonResource<T>): void;
|
|
47
49
|
schema(): ODataStructuredType<T>;
|
|
48
50
|
annots(): ODataEntityAnnotations;
|
|
49
51
|
key({ field_mapping, resolve, }?: {
|
|
@@ -69,17 +71,17 @@ export declare class ODataModel<T> {
|
|
|
69
71
|
_errors?: {
|
|
70
72
|
[key: string]: any;
|
|
71
73
|
};
|
|
72
|
-
|
|
73
|
-
method?: 'create' | 'update' | '
|
|
74
|
+
validate({ method, navigation, }?: {
|
|
75
|
+
method?: 'create' | 'update' | 'modify';
|
|
74
76
|
navigation?: boolean;
|
|
75
77
|
}): {
|
|
76
78
|
[name: string]: string[];
|
|
77
79
|
} | undefined;
|
|
78
80
|
isValid({ method, navigation, }?: {
|
|
79
|
-
method?: 'create' | 'update' | '
|
|
81
|
+
method?: 'create' | 'update' | 'modify';
|
|
80
82
|
navigation?: boolean;
|
|
81
83
|
}): boolean;
|
|
82
|
-
|
|
84
|
+
defaults(): {
|
|
83
85
|
[name: string]: any;
|
|
84
86
|
};
|
|
85
87
|
toEntity({ client_id, include_navigation, include_concurrency, include_computed, include_key, include_non_field, changes_only, field_mapping, chain, }?: {
|
|
@@ -95,6 +97,9 @@ export declare class ODataModel<T> {
|
|
|
95
97
|
}): T | {
|
|
96
98
|
[name: string]: any;
|
|
97
99
|
};
|
|
100
|
+
toJSON(): T | {
|
|
101
|
+
[name: string]: any;
|
|
102
|
+
};
|
|
98
103
|
attributes({ changes_only, include_concurrency, include_computed, include_non_field, field_mapping, }?: {
|
|
99
104
|
changes_only?: boolean;
|
|
100
105
|
include_concurrency?: boolean;
|
|
@@ -112,34 +117,30 @@ export declare class ODataModel<T> {
|
|
|
112
117
|
}): void;
|
|
113
118
|
assign(entity: Partial<T> | {
|
|
114
119
|
[name: string]: any;
|
|
115
|
-
}, { reset, silent, }?: {
|
|
120
|
+
}, { reset, reparent, silent, }?: {
|
|
116
121
|
reset?: boolean;
|
|
122
|
+
reparent?: boolean;
|
|
117
123
|
silent?: boolean;
|
|
118
124
|
}): void;
|
|
119
125
|
clone<M extends ODataModel<T>>(): M;
|
|
120
126
|
private _request;
|
|
121
|
-
fetch({ ...options }?:
|
|
122
|
-
options?:
|
|
127
|
+
fetch({ ...options }?: ODataOptions & {
|
|
128
|
+
options?: ODataOptions;
|
|
123
129
|
}): Observable<this>;
|
|
124
|
-
save({ method, navigation, validate, ...options }?:
|
|
125
|
-
method?: 'create' | 'update' | '
|
|
130
|
+
save({ method, navigation, validate, ...options }?: ODataOptions & {
|
|
131
|
+
method?: 'create' | 'update' | 'modify';
|
|
126
132
|
navigation?: boolean;
|
|
127
133
|
validate?: boolean;
|
|
128
|
-
options?:
|
|
134
|
+
options?: ODataOptions;
|
|
129
135
|
}): Observable<this>;
|
|
130
|
-
destroy({ ...options }?:
|
|
131
|
-
options?:
|
|
136
|
+
destroy({ ...options }?: ODataOptions & {
|
|
137
|
+
options?: ODataOptions;
|
|
132
138
|
}): Observable<this>;
|
|
133
139
|
/**
|
|
134
140
|
* Create an execution context for change the internal query of a resource
|
|
135
141
|
* @param func Function to execute
|
|
136
142
|
*/
|
|
137
|
-
query(func: (q:
|
|
138
|
-
select(opts?: Select<T>): OptionHandler<Select<T>>;
|
|
139
|
-
expand(opts?: Expand<T>): OptionHandler<Expand<T>>;
|
|
140
|
-
format(opts?: string): OptionHandler<string>;
|
|
141
|
-
apply(query: QueryArguments<T>): void;
|
|
142
|
-
}) => void): void;
|
|
143
|
+
query(func: (q: ODataQueryOptionsHandler<T>) => void): this;
|
|
143
144
|
/**
|
|
144
145
|
* Perform a check on the internal state of the model and return true if the model is changed.
|
|
145
146
|
* @param include_navigation Check in navigation properties
|
|
@@ -150,15 +151,21 @@ export declare class ODataModel<T> {
|
|
|
150
151
|
}): boolean;
|
|
151
152
|
/**
|
|
152
153
|
* Create an execution context for a given function, where the model is bound to its entity endpoint
|
|
153
|
-
* @param
|
|
154
|
-
* @returns
|
|
154
|
+
* @param ctx Context function
|
|
155
|
+
* @returns The result of the context
|
|
155
156
|
*/
|
|
156
|
-
asEntity<R>(
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
157
|
+
asEntity<R>(ctx: (model: this) => R): R;
|
|
158
|
+
callFunction<P, R>(name: string, params: P | null, responseType: 'property' | 'model' | 'collection' | 'none', { ...options }?: {} & ODataQueryArgumentsOptions<R>): Observable<R | ODataModel<R> | ODataCollection<R, ODataModel<R>> | null>;
|
|
159
|
+
callAction<P, R>(name: string, params: P | null, responseType: 'property' | 'model' | 'collection' | 'none', { ...options }?: {} & ODataQueryArgumentsOptions<R>): Observable<R | ODataModel<R> | ODataCollection<R, ODataModel<R>> | null>;
|
|
160
|
+
cast<S>(type: string): ODataModel<S>;
|
|
161
|
+
fetchNavigationProperty<S>(name: keyof T | string, responseType: 'model' | 'collection', { ...options }?: {} & ODataQueryArgumentsOptions<S>): Observable<ODataModel<S> | ODataCollection<S, ODataModel<S>> | null>;
|
|
162
|
+
getValue<P>(name: keyof T | string, options?: ODataOptions): Observable<P | ODataModel<P> | ODataCollection<P, ODataModel<P>> | null>;
|
|
163
|
+
setReference<N>(name: keyof T | string, model: ODataModel<N> | ODataCollection<N, ODataModel<N>> | null, options?: ODataOptions): Observable<this>;
|
|
164
|
+
getReference<P>(name: keyof T | string): ODataModel<P> | ODataCollection<P, ODataModel<P>>;
|
|
165
|
+
equals(other: ODataModel<T>): boolean;
|
|
166
|
+
get [Symbol.toStringTag](): string;
|
|
167
|
+
collection(): ODataCollection<T, ODataModel<T>> | undefined;
|
|
168
|
+
next(): ODataModel<T> | undefined;
|
|
169
|
+
prev(): ODataModel<T> | undefined;
|
|
164
170
|
}
|
|
171
|
+
export declare const RESERVED_FIELD_NAMES: string[];
|