angular-odata 0.80.0 → 0.99.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 +69 -34
- 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} +3 -3
- package/{esm2015/lib/cache/index.js → esm2020/lib/cache/index.mjs} +0 -0
- package/{esm2015/lib/cache/memory.js → esm2020/lib/cache/memory.mjs} +1 -1
- package/{esm2015/lib/cache/storage.js → esm2020/lib/cache/storage.mjs} +2 -2
- package/esm2020/lib/client.mjs +271 -0
- package/{esm2015/lib/constants.js → esm2020/lib/constants.mjs} +8 -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} +7 -7
- 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/base.mjs +20 -0
- package/esm2020/lib/resources/query/expressions/compute.mjs +38 -0
- package/esm2020/lib/resources/query/expressions/expand.mjs +57 -0
- package/esm2020/lib/resources/query/expressions/filter.mjs +154 -0
- package/esm2020/lib/resources/query/expressions/index.mjs +7 -0
- package/esm2020/lib/resources/query/expressions/orderby.mjs +54 -0
- package/esm2020/lib/resources/query/expressions/search.mjs +113 -0
- package/esm2020/lib/resources/query/expressions/select.mjs +32 -0
- package/esm2020/lib/resources/query/expressions/syntax.mjs +371 -0
- package/esm2020/lib/resources/query/handlers.mjs +188 -0
- package/esm2020/lib/resources/query/index.mjs +4 -0
- package/esm2020/lib/resources/query/options.mjs +103 -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} +0 -0
- package/{esm2015/lib/resources/responses/response.js → esm2020/lib/resources/responses/response.mjs} +0 -0
- package/{esm2015/lib/resources/responses/types.js → esm2020/lib/resources/responses/types.mjs} +0 -0
- package/esm2020/lib/resources/types/action.mjs +101 -0
- package/esm2020/lib/resources/types/batch.mjs +309 -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} +4508 -3427
- package/fesm2015/angular-odata.mjs.map +1 -0
- package/fesm2020/angular-odata.mjs +10510 -0
- package/fesm2020/angular-odata.mjs.map +1 -0
- package/lib/api.d.ts +14 -14
- package/lib/cache/cache.d.ts +2 -2
- package/lib/cache/storage.d.ts +1 -1
- package/lib/client.d.ts +60 -9
- package/lib/constants.d.ts +5 -2
- package/lib/index.d.ts +0 -1
- package/lib/models/collection.d.ts +30 -42
- package/lib/models/model.d.ts +37 -30
- package/lib/models/options.d.ts +30 -38
- package/lib/module.d.ts +1 -1
- package/lib/options.d.ts +47 -0
- 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/base.d.ts +19 -0
- package/lib/resources/query/expressions/compute.d.ts +26 -0
- package/lib/resources/query/expressions/expand.d.ts +40 -0
- package/lib/resources/query/expressions/filter.d.ts +58 -0
- package/lib/resources/query/expressions/index.d.ts +6 -0
- package/lib/resources/query/expressions/orderby.d.ts +37 -0
- package/lib/resources/query/expressions/search.d.ts +47 -0
- package/lib/resources/query/expressions/select.d.ts +21 -0
- package/lib/resources/query/expressions/syntax.d.ts +177 -0
- package/lib/resources/query/handlers.d.ts +104 -0
- package/lib/resources/query/index.d.ts +3 -0
- package/lib/resources/query/options.d.ts +38 -0
- package/lib/resources/request.d.ts +4 -3
- package/lib/resources/resource.d.ts +42 -48
- package/lib/resources/types/action.d.ts +14 -61
- package/lib/resources/types/batch.d.ts +16 -3
- package/lib/resources/types/count.d.ts +9 -17
- package/lib/resources/types/entity-set.d.ts +12 -51
- package/lib/resources/types/entity.d.ts +13 -31
- package/lib/resources/types/function.d.ts +13 -60
- package/lib/resources/types/media.d.ts +9 -8
- package/lib/resources/types/metadata.d.ts +3 -5
- package/lib/resources/types/navigation-property.d.ts +74 -65
- package/lib/resources/types/options.d.ts +1 -1
- package/lib/resources/types/property.d.ts +49 -57
- package/lib/resources/types/reference.d.ts +65 -9
- package/lib/resources/types/singleton.d.ts +53 -31
- package/lib/resources/types/value.d.ts +16 -7
- package/lib/schema/annotation.d.ts +18 -0
- package/lib/schema/callable.d.ts +4 -20
- package/lib/schema/element.d.ts +39 -0
- package/lib/schema/entity-container.d.ts +2 -12
- package/lib/schema/entity-set.d.ts +2 -18
- package/lib/schema/enum-type.d.ts +19 -25
- 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 +12 -11
- package/lib/{parsers → schema/parsers}/index.d.ts +0 -0
- package/lib/{parsers → schema/parsers}/structured-type.d.ts +12 -12
- package/lib/schema/schema.d.ts +3 -10
- package/lib/schema/structured-type.d.ts +65 -27
- package/lib/services/base.d.ts +2 -2
- package/lib/services/entity-set.d.ts +5 -2
- package/lib/services/entity.d.ts +4 -1
- package/lib/services/singleton.d.ts +5 -2
- package/lib/settings.d.ts +5 -5
- package/lib/types.d.ts +1 -0
- 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 +1 -0
- package/lib/utils/index.d.ts +1 -0
- package/lib/utils/objects.d.ts +1 -0
- package/lib/utils/strings.d.ts +1 -0
- package/lib/utils/types.d.ts +2 -0
- package/package.json +21 -8
- package/bundles/angular-odata.umd.js +0 -11048
- package/bundles/angular-odata.umd.js.map +0 -1
- package/esm2015/lib/api.js +0 -297
- package/esm2015/lib/client.js +0 -221
- package/esm2015/lib/helper.js +0 -271
- package/esm2015/lib/index.js +0 -21
- package/esm2015/lib/models/collection.js +0 -687
- package/esm2015/lib/models/model.js +0 -423
- package/esm2015/lib/models/options.js +0 -909
- package/esm2015/lib/options.js +0 -31
- package/esm2015/lib/parsers/callable.js +0 -107
- package/esm2015/lib/parsers/edm.js +0 -192
- package/esm2015/lib/parsers/enum-type.js +0 -102
- package/esm2015/lib/parsers/index.js +0 -5
- package/esm2015/lib/parsers/structured-type.js +0 -389
- 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 -149
- package/esm2015/lib/resources/resource.js +0 -337
- package/esm2015/lib/resources/responses/annotations.js +0 -121
- package/esm2015/lib/resources/responses/metadata.js +0 -548
- package/esm2015/lib/resources/types/action.js +0 -180
- package/esm2015/lib/resources/types/batch.js +0 -288
- package/esm2015/lib/resources/types/count.js +0 -55
- package/esm2015/lib/resources/types/entity-set.js +0 -169
- package/esm2015/lib/resources/types/entity.js +0 -170
- package/esm2015/lib/resources/types/function.js +0 -205
- package/esm2015/lib/resources/types/media.js +0 -47
- package/esm2015/lib/resources/types/metadata.js +0 -36
- package/esm2015/lib/resources/types/navigation-property.js +0 -232
- package/esm2015/lib/resources/types/options.js +0 -2
- package/esm2015/lib/resources/types/property.js +0 -195
- package/esm2015/lib/resources/types/reference.js +0 -50
- package/esm2015/lib/resources/types/singleton.js +0 -159
- package/esm2015/lib/resources/types/value.js +0 -30
- package/esm2015/lib/schema/annotation.js +0 -7
- package/esm2015/lib/schema/callable.js +0 -82
- package/esm2015/lib/schema/entity-container.js +0 -22
- package/esm2015/lib/schema/entity-set.js +0 -33
- package/esm2015/lib/schema/enum-type.js +0 -101
- package/esm2015/lib/schema/schema.js +0 -60
- package/esm2015/lib/schema/structured-type.js +0 -148
- 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 -89
- package/esm2015/lib/utils/index.js +0 -9
- package/esm2015/lib/utils/objects.js +0 -139
- package/esm2015/lib/utils/odata.js +0 -21
- package/esm2015/lib/utils/strings.js +0 -13
- 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, ODataModelOptions } 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,28 +52,28 @@ 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
78
|
private memo;
|
|
79
79
|
private findSchemaForType;
|
|
@@ -82,9 +82,9 @@ export declare class ODataApi {
|
|
|
82
82
|
findCallableForType<T>(type: string, bindingType?: string): ODataCallable<T> | undefined;
|
|
83
83
|
findEntitySetForType(type: string): ODataEntitySet | undefined;
|
|
84
84
|
findModelForType(type: string): typeof ODataModel | undefined;
|
|
85
|
-
modelForType(type
|
|
85
|
+
modelForType(type: string): typeof ODataModel;
|
|
86
86
|
findCollectionForType(type: string): typeof ODataCollection | undefined;
|
|
87
|
-
collectionForType(type
|
|
87
|
+
collectionForType(type: string): typeof ODataCollection;
|
|
88
88
|
findServiceForType(type: string): typeof ODataEntityService | undefined;
|
|
89
89
|
findEntitySetForEntityType(entityType: string): ODataEntitySet | undefined;
|
|
90
90
|
findServiceForEntityType(entityType: string): typeof ODataEntityService | undefined;
|
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/cache/storage.d.ts
CHANGED
package/lib/client.d.ts
CHANGED
|
@@ -1,33 +1,84 @@
|
|
|
1
1
|
import { HttpClient, HttpEvent, HttpHeaders, HttpParams, HttpResponse } from '@angular/common/http';
|
|
2
2
|
import { Injector } from '@angular/core';
|
|
3
|
-
import {
|
|
4
|
-
import { ODataCollection, ODataModel } from './models/index';
|
|
3
|
+
import { Observable } from 'rxjs';
|
|
5
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';
|
|
6
7
|
import { ODataEntityService } from './services/entity';
|
|
7
8
|
import { ODataSettings } from './settings';
|
|
8
|
-
import { Observable } from 'rxjs';
|
|
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[];
|
package/lib/constants.d.ts
CHANGED
|
@@ -56,5 +56,8 @@ export declare const ODATA_ALIAS_PREFIX = "@";
|
|
|
56
56
|
export declare const NEWLINE = "\r\n";
|
|
57
57
|
export declare const NEWLINE_REGEXP: RegExp;
|
|
58
58
|
export declare const CACHE_KEY_SEPARATOR = ":";
|
|
59
|
-
export declare const
|
|
60
|
-
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/index.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { Observable } from 'rxjs';
|
|
2
|
-
import { ODataEntitiesAnnotations, ODataOptions, Select, Expand, OptionHandler, Transform, Filter, OrderBy, ODataQueryArguments, ODataQueryArgumentsOptions } 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,6 +44,9 @@ 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;
|
|
@@ -64,22 +67,16 @@ export declare class ODataCollection<T, M extends ODataModel<T>> implements Iter
|
|
|
64
67
|
}): Observable<this>;
|
|
65
68
|
private addReference;
|
|
66
69
|
private _addModel;
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
reset?: boolean;
|
|
70
|
-
position?: number;
|
|
71
|
-
}): void;
|
|
72
|
-
add(model: M, { silent, server, position, }?: {
|
|
70
|
+
private addModel;
|
|
71
|
+
add(model: M, { silent, reparent, server, position, }?: {
|
|
73
72
|
silent?: boolean;
|
|
73
|
+
reparent?: boolean;
|
|
74
74
|
server?: boolean;
|
|
75
75
|
position?: number;
|
|
76
76
|
}): Observable<this>;
|
|
77
77
|
private removeReference;
|
|
78
78
|
private _removeModel;
|
|
79
|
-
|
|
80
|
-
silent?: boolean;
|
|
81
|
-
reset?: boolean;
|
|
82
|
-
}): void;
|
|
79
|
+
private removeModel;
|
|
83
80
|
remove(model: M, { silent, server, }?: {
|
|
84
81
|
silent?: boolean;
|
|
85
82
|
server?: boolean;
|
|
@@ -89,7 +86,7 @@ export declare class ODataCollection<T, M extends ODataModel<T>> implements Iter
|
|
|
89
86
|
server?: boolean;
|
|
90
87
|
}): Observable<M>;
|
|
91
88
|
set(path: string | string[], value: any): any;
|
|
92
|
-
get(path: number): M;
|
|
89
|
+
get(path: number): M | undefined;
|
|
93
90
|
get(path: string | string[]): any;
|
|
94
91
|
reset({ path, silent, }?: {
|
|
95
92
|
path?: string | string[];
|
|
@@ -97,31 +94,14 @@ export declare class ODataCollection<T, M extends ODataModel<T>> implements Iter
|
|
|
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: ODataQueryArguments<T>): void;
|
|
122
|
-
}) => void): void;
|
|
123
|
-
protected 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>;
|
|
124
|
-
protected 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>;
|
|
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;
|
|
@@ -130,8 +110,16 @@ export declare class ODataCollection<T, M extends ODataModel<T>> implements Iter
|
|
|
130
110
|
[Symbol.iterator](): {
|
|
131
111
|
next(): IteratorResult<M>;
|
|
132
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;
|
|
133
121
|
contains(model: M): boolean;
|
|
134
|
-
|
|
122
|
+
indexOf(model: M): number;
|
|
135
123
|
private _bisect;
|
|
136
124
|
private _compare;
|
|
137
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,7 +71,7 @@ export declare class ODataModel<T> {
|
|
|
69
71
|
_errors?: {
|
|
70
72
|
[key: string]: any;
|
|
71
73
|
};
|
|
72
|
-
|
|
74
|
+
validate({ method, navigation, }?: {
|
|
73
75
|
method?: 'create' | 'update' | 'modify';
|
|
74
76
|
navigation?: boolean;
|
|
75
77
|
}): {
|
|
@@ -79,7 +81,7 @@ export declare class ODataModel<T> {
|
|
|
79
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,8 +117,9 @@ 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;
|
|
@@ -134,12 +140,7 @@ export declare class ODataModel<T> {
|
|
|
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: ODataQueryArguments<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
|
|
@@ -151,14 +152,20 @@ export declare class ODataModel<T> {
|
|
|
151
152
|
/**
|
|
152
153
|
* Create an execution context for a given function, where the model is bound to its entity endpoint
|
|
153
154
|
* @param ctx Context function
|
|
154
|
-
* @returns
|
|
155
|
+
* @returns The result of the context
|
|
155
156
|
*/
|
|
156
|
-
asEntity<R>(ctx: (model: this) =>
|
|
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[];
|
package/lib/models/options.d.ts
CHANGED
|
@@ -1,13 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { Options } from '../types';
|
|
1
|
+
import { Subscription } from 'rxjs';
|
|
2
|
+
import { EntityKey, ODataEntitiesAnnotations, ODataEntityAnnotations, ODataEntityResource, ODataEntitySetResource, ODataNavigationPropertyResource, ODataPropertyResource, ODataQueryOptions, ODataQueryOptionsHandler, ODataResource, ODataSingletonResource } from '../resources';
|
|
3
|
+
import { ODataEntitySet, ODataStructuredType, ODataStructuredTypeFieldParser } from '../schema';
|
|
4
|
+
import { Options, OptionsHelper } from '../types';
|
|
6
5
|
import type { ODataCollection } from './collection';
|
|
7
6
|
import type { ODataModel } from './model';
|
|
8
|
-
export declare const CID = "_cid";
|
|
9
|
-
export declare type ODataModelResource<T> = ODataEntityResource<T> | ODataSingletonResource<T> | ODataNavigationPropertyResource<T> | ODataPropertyResource<T>;
|
|
10
|
-
export declare type ODataCollectionResource<T> = ODataEntitySetResource<T> | ODataNavigationPropertyResource<T> | ODataPropertyResource<T>;
|
|
11
7
|
export declare type ODataModelEventType = 'change' | 'reset' | 'update' | 'destroy' | 'add' | 'remove' | 'invalid' | 'request' | 'sync' | 'attach';
|
|
12
8
|
export declare class ODataModelEvent<T> {
|
|
13
9
|
name: ODataModelEventType;
|
|
@@ -100,18 +96,19 @@ export declare class ODataModelField<F> {
|
|
|
100
96
|
get type(): string;
|
|
101
97
|
get navigation(): boolean;
|
|
102
98
|
get collection(): boolean;
|
|
103
|
-
|
|
104
|
-
configure({ findOptionsForType, concurrency, }: {
|
|
99
|
+
annotatedValue<T>(term: string | RegExp): T | undefined;
|
|
100
|
+
configure({ findOptionsForType, concurrency, options, }: {
|
|
105
101
|
findOptionsForType: (type: string) => ODataModelOptions<any> | undefined;
|
|
106
102
|
concurrency: boolean;
|
|
103
|
+
options: OptionsHelper;
|
|
107
104
|
}): void;
|
|
108
105
|
isKey(): boolean;
|
|
109
106
|
hasReferentials(): boolean;
|
|
110
|
-
get referentials(): import("../
|
|
107
|
+
get referentials(): import("../schema").ODataReferential[];
|
|
111
108
|
isStructuredType(): boolean;
|
|
112
|
-
structured(): ODataStructuredType<F
|
|
109
|
+
structured(): ODataStructuredType<F>;
|
|
113
110
|
isEnumType(): boolean;
|
|
114
|
-
enum(): import("../schema").ODataEnumType<F
|
|
111
|
+
enum(): import("../schema").ODataEnumType<F>;
|
|
115
112
|
validate(value: any, { method, navigation, }?: {
|
|
116
113
|
method?: 'create' | 'update' | 'modify';
|
|
117
114
|
navigation?: boolean;
|
|
@@ -120,9 +117,9 @@ export declare class ODataModelField<F> {
|
|
|
120
117
|
deserialize(value: any, options?: Options): F;
|
|
121
118
|
serialize(value: F, options?: Options): any;
|
|
122
119
|
encode(value: F, options?: Options): any;
|
|
123
|
-
resourceFactory<T, F>(
|
|
124
|
-
annotationsFactory(
|
|
125
|
-
schemaFactory<T, F>(
|
|
120
|
+
resourceFactory<T, F>(base: ODataResource<T>): ODataNavigationPropertyResource<F> | ODataPropertyResource<F>;
|
|
121
|
+
annotationsFactory(base: ODataEntityAnnotations): ODataEntityAnnotations | ODataEntitiesAnnotations;
|
|
122
|
+
schemaFactory<T, F>(base: ODataStructuredType<T>): ODataStructuredType<F> | undefined;
|
|
126
123
|
modelCollectionFactory<T, F>({ parent, value, reset, }: {
|
|
127
124
|
parent: ODataModel<any>;
|
|
128
125
|
value?: F | F[] | {
|
|
@@ -157,47 +154,41 @@ export declare class ODataModelOptions<T> {
|
|
|
157
154
|
entitySet?: ODataEntitySet;
|
|
158
155
|
parent?: ODataModelOptions<any>;
|
|
159
156
|
children: ODataModelOptions<any>[];
|
|
160
|
-
constructor(options
|
|
157
|
+
constructor({ options, schema, }: {
|
|
158
|
+
options: ModelOptions;
|
|
159
|
+
schema: ODataStructuredType<T>;
|
|
160
|
+
});
|
|
161
161
|
get api(): import("angular-odata").ODataApi;
|
|
162
162
|
type(): string;
|
|
163
163
|
isTypeOf(type: string): boolean;
|
|
164
164
|
findChildOptions(predicate: (options: ODataModelOptions<any>) => boolean): ODataModelOptions<any> | undefined;
|
|
165
|
-
configure({ findOptionsForType, }: {
|
|
165
|
+
configure({ findOptionsForType, options, }: {
|
|
166
166
|
findOptionsForType: (type: string) => ODataModelOptions<any> | undefined;
|
|
167
|
+
options: OptionsHelper;
|
|
167
168
|
}): void;
|
|
168
169
|
fields({ include_navigation, include_parents, }?: {
|
|
169
170
|
include_parents?: boolean;
|
|
170
171
|
include_navigation?: boolean;
|
|
171
172
|
}): ODataModelField<any>[];
|
|
172
|
-
field(name: keyof T | string): ODataModelField<any
|
|
173
|
-
attach(self: ODataModel<T>, resource:
|
|
173
|
+
field<F>(name: keyof T | string): ODataModelField<any>;
|
|
174
|
+
attach(self: ODataModel<T>, resource: ODataEntityResource<T> | ODataNavigationPropertyResource<T> | ODataPropertyResource<T> | ODataSingletonResource<T>): void;
|
|
174
175
|
static chain(child: ODataModel<any> | ODataCollection<any, ODataModel<any>>): [
|
|
175
176
|
ODataModel<any> | ODataCollection<any, ODataModel<any>>,
|
|
176
177
|
ODataModelField<any> | null
|
|
177
178
|
][];
|
|
178
|
-
static resource<T>(child: ODataModel<T> | ODataCollection<T, ODataModel<T>>):
|
|
179
|
-
collectionResourceFactory(
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
modelResourceFactory({ baseResource, }?: {
|
|
183
|
-
fromSet?: boolean;
|
|
184
|
-
baseResource?: ODataResource<T>;
|
|
185
|
-
}): ODataModelResource<T>;
|
|
186
|
-
entityResource(self: ODataModel<T>): ODataModelResource<T>;
|
|
179
|
+
static resource<T>(child: ODataModel<T> | ODataCollection<T, ODataModel<T>>): ODataResource<T> | ODataResource<T>;
|
|
180
|
+
collectionResourceFactory(query?: ODataQueryOptions<T>): ODataEntitySetResource<T> | ODataNavigationPropertyResource<T> | ODataPropertyResource<T> | undefined;
|
|
181
|
+
modelResourceFactory(query?: ODataQueryOptions<T>): ODataEntityResource<T> | ODataNavigationPropertyResource<T> | ODataPropertyResource<T> | ODataSingletonResource<T> | undefined;
|
|
182
|
+
entityResource(self: ODataModel<T>): ODataResource<T>;
|
|
187
183
|
bind(self: ODataModel<T>, { parent, resource, annots, }?: {
|
|
188
184
|
parent?: [
|
|
189
185
|
ODataModel<any> | ODataCollection<any, ODataModel<any>>,
|
|
190
186
|
ODataModelField<any> | null
|
|
191
187
|
];
|
|
192
|
-
resource?:
|
|
188
|
+
resource?: ODataResource<T>;
|
|
193
189
|
annots?: ODataEntityAnnotations;
|
|
194
190
|
}): void;
|
|
195
|
-
query(self: ODataModel<T>, resource:
|
|
196
|
-
select(opts?: Select<T>): OptionHandler<Select<T>>;
|
|
197
|
-
expand(opts?: Expand<T>): OptionHandler<Expand<T>>;
|
|
198
|
-
format(opts?: string): OptionHandler<string>;
|
|
199
|
-
apply(query: ODataQueryArguments<T>): void;
|
|
200
|
-
}) => void): void;
|
|
191
|
+
query(self: ODataModel<T>, resource: ODataEntityResource<T> | ODataPropertyResource<T> | ODataNavigationPropertyResource<T> | ODataSingletonResource<T>, func: (q: ODataQueryOptionsHandler<T>) => void): ODataModel<T>;
|
|
201
192
|
resolveKey(value: ODataModel<T> | T | {
|
|
202
193
|
[name: string]: any;
|
|
203
194
|
}, { field_mapping, resolve, }?: {
|
|
@@ -234,7 +225,7 @@ export declare class ODataModelOptions<T> {
|
|
|
234
225
|
hasChanged(self: ODataModel<T>, { include_navigation }?: {
|
|
235
226
|
include_navigation?: boolean;
|
|
236
227
|
}): boolean;
|
|
237
|
-
asEntity<R, M extends ODataModel<T>>(self: M, func: (model: M) =>
|
|
228
|
+
asEntity<R, M extends ODataModel<T>>(self: M, func: (model: M) => R): R;
|
|
238
229
|
toEntity(self: ODataModel<T>, { client_id, include_navigation, include_concurrency, include_computed, include_key, include_non_field, changes_only, field_mapping, chain, }?: {
|
|
239
230
|
client_id?: boolean;
|
|
240
231
|
include_navigation?: boolean;
|
|
@@ -263,8 +254,9 @@ export declare class ODataModelOptions<T> {
|
|
|
263
254
|
}): void;
|
|
264
255
|
assign(self: ODataModel<T>, entity: Partial<T> | {
|
|
265
256
|
[name: string]: any;
|
|
266
|
-
}, { reset, silent, }?: {
|
|
257
|
+
}, { reset, reparent, silent, }?: {
|
|
267
258
|
reset?: boolean;
|
|
259
|
+
reparent?: boolean;
|
|
268
260
|
silent?: boolean;
|
|
269
261
|
}): void;
|
|
270
262
|
static isModel(obj: any): boolean;
|
package/lib/module.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ModuleWithProviders } from '@angular/core';
|
|
2
|
-
import { ApiConfig } from './types';
|
|
3
2
|
import { ODataSettings } from './settings';
|
|
3
|
+
import { ApiConfig } from './types';
|
|
4
4
|
import * as i0 from "@angular/core";
|
|
5
5
|
import * as i1 from "@angular/common/http";
|
|
6
6
|
export declare function createSettings(configs: ApiConfig[]): ODataSettings;
|