angular-odata 0.90.0 → 0.99.2
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 +31 -25
- 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 +757 -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 +956 -0
- package/{esm2015/lib/module.js → esm2020/lib/module.mjs} +7 -7
- package/esm2020/lib/options.mjs +32 -0
- package/{esm2015/lib/resources/index.js → esm2020/lib/resources/index.mjs} +0 -0
- package/{esm2015/lib/resources/path/handlers.js → esm2020/lib/resources/path/handlers.mjs} +1 -1
- package/{esm2015/lib/resources/path/index.js → esm2020/lib/resources/path/index.mjs} +0 -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/{esm2015/lib/resources/query/index.js → esm2020/lib/resources/query/index.mjs} +0 -0
- package/esm2020/lib/resources/query/options.mjs +103 -0
- package/esm2020/lib/resources/request.mjs +167 -0
- package/esm2020/lib/resources/resource.mjs +318 -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 +104 -0
- package/esm2020/lib/resources/types/batch.mjs +314 -0
- package/esm2020/lib/resources/types/count.mjs +30 -0
- package/esm2020/lib/resources/types/entity-set.mjs +97 -0
- package/esm2020/lib/resources/types/entity.mjs +109 -0
- package/esm2020/lib/resources/types/function.mjs +140 -0
- package/{esm2015/lib/resources/types/index.js → esm2020/lib/resources/types/index.mjs} +0 -0
- package/esm2020/lib/resources/types/media.mjs +44 -0
- package/esm2020/lib/resources/types/metadata.mjs +33 -0
- package/esm2020/lib/resources/types/navigation-property.mjs +229 -0
- package/esm2020/lib/resources/types/options.mjs +2 -0
- package/esm2020/lib/resources/types/property.mjs +186 -0
- package/esm2020/lib/resources/types/reference.mjs +88 -0
- package/esm2020/lib/resources/types/singleton.mjs +129 -0
- package/esm2020/lib/resources/types/value.mjs +44 -0
- package/esm2020/lib/schema/annotation.mjs +37 -0
- package/esm2020/lib/schema/callable.mjs +62 -0
- package/esm2020/lib/schema/element.mjs +61 -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 +207 -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/{esm2015/lib/services/singleton.js → esm2020/lib/services/singleton.mjs} +1 -1
- 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/{esm2015/lib/utils/arraybuffers.js → esm2020/lib/utils/arraybuffers.mjs} +0 -0
- package/{esm2015/lib/utils/dates.js → esm2020/lib/utils/dates.mjs} +0 -0
- package/{esm2015/lib/utils/durations.js → esm2020/lib/utils/durations.mjs} +0 -0
- package/{esm2015/lib/utils/enums.js → esm2020/lib/utils/enums.mjs} +0 -0
- package/{esm2015/lib/utils/http.js → esm2020/lib/utils/http.mjs} +0 -0
- package/{esm2015/lib/utils/index.js → esm2020/lib/utils/index.mjs} +0 -0
- package/{esm2015/lib/utils/objects.js → esm2020/lib/utils/objects.mjs} +13 -13
- package/esm2020/lib/utils/odata.mjs +22 -0
- package/esm2020/lib/utils/strings.mjs +20 -0
- package/{esm2015/lib/utils/types.js → esm2020/lib/utils/types.mjs} +0 -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} +3427 -2872
- package/fesm2015/angular-odata.mjs.map +1 -0
- package/fesm2020/angular-odata.mjs +10589 -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 +3 -3
- package/lib/constants.d.ts +5 -2
- package/lib/index.d.ts +0 -1
- package/lib/models/collection.d.ts +21 -21
- package/lib/models/model.d.ts +34 -22
- package/lib/models/options.d.ts +26 -29
- package/lib/module.d.ts +1 -1
- package/lib/options.d.ts +1 -0
- package/lib/resources/path/segments.d.ts +2 -2
- package/lib/resources/query/builder.d.ts +7 -3
- 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/{syntax.d.ts → expressions/syntax.d.ts} +74 -55
- package/lib/resources/query/handlers.d.ts +30 -19
- package/lib/resources/query/options.d.ts +3 -3
- package/lib/resources/request.d.ts +1 -1
- package/lib/resources/resource.d.ts +30 -12
- package/lib/resources/types/action.d.ts +12 -18
- package/lib/resources/types/batch.d.ts +10 -2
- package/lib/resources/types/count.d.ts +6 -4
- package/lib/resources/types/entity-set.d.ts +11 -14
- package/lib/resources/types/entity.d.ts +13 -15
- package/lib/resources/types/function.d.ts +11 -17
- package/lib/resources/types/media.d.ts +8 -6
- package/lib/resources/types/metadata.d.ts +3 -4
- package/lib/resources/types/navigation-property.d.ts +17 -22
- package/lib/resources/types/property.d.ts +13 -18
- package/lib/resources/types/reference.d.ts +41 -7
- package/lib/resources/types/singleton.d.ts +12 -15
- package/lib/resources/types/value.d.ts +9 -4
- package/lib/schema/annotation.d.ts +18 -0
- package/lib/schema/callable.d.ts +4 -20
- package/lib/schema/element.d.ts +45 -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 +3 -34
- package/lib/schema/index.d.ts +1 -0
- package/lib/{parsers → schema/parsers}/callable.d.ts +1 -1
- package/lib/{parsers → schema/parsers}/edm.d.ts +1 -1
- 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 +12 -24
- package/lib/services/base.d.ts +2 -2
- package/lib/services/entity-set.d.ts +2 -2
- package/lib/services/entity.d.ts +1 -1
- package/lib/services/singleton.d.ts +2 -2
- package/lib/settings.d.ts +5 -5
- package/lib/types.d.ts +1 -0
- package/lib/utils/strings.d.ts +1 -0
- package/package.json +21 -8
- package/bundles/angular-odata.umd.js +0 -11694
- package/bundles/angular-odata.umd.js.map +0 -1
- package/esm2015/lib/api.js +0 -297
- package/esm2015/lib/client.js +0 -272
- package/esm2015/lib/helper.js +0 -271
- package/esm2015/lib/index.js +0 -21
- package/esm2015/lib/models/collection.js +0 -717
- package/esm2015/lib/models/model.js +0 -419
- package/esm2015/lib/models/options.js +0 -924
- package/esm2015/lib/options.js +0 -31
- package/esm2015/lib/parsers/callable.js +0 -107
- package/esm2015/lib/parsers/edm.js +0 -95
- 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 -388
- package/esm2015/lib/resources/path/segments.js +0 -121
- package/esm2015/lib/resources/query/builder.js +0 -544
- package/esm2015/lib/resources/query/expressions.js +0 -194
- package/esm2015/lib/resources/query/handlers.js +0 -192
- package/esm2015/lib/resources/query/options.js +0 -103
- package/esm2015/lib/resources/query/syntax.js +0 -349
- package/esm2015/lib/resources/request.js +0 -168
- package/esm2015/lib/resources/resource.js +0 -243
- 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 -105
- package/esm2015/lib/resources/types/batch.js +0 -294
- package/esm2015/lib/resources/types/count.js +0 -33
- package/esm2015/lib/resources/types/entity-set.js +0 -101
- package/esm2015/lib/resources/types/entity.js +0 -137
- package/esm2015/lib/resources/types/function.js +0 -130
- 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 -205
- package/esm2015/lib/resources/types/options.js +0 -2
- package/esm2015/lib/resources/types/property.js +0 -151
- package/esm2015/lib/resources/types/reference.js +0 -73
- package/esm2015/lib/resources/types/singleton.js +0 -167
- package/esm2015/lib/resources/types/value.js +0 -35
- 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 -126
- package/esm2015/lib/schema/schema.js +0 -60
- package/esm2015/lib/schema/structured-type.js +0 -217
- package/esm2015/lib/services/base.js +0 -23
- package/esm2015/lib/services/entity-set.js +0 -146
- package/esm2015/lib/services/entity.js +0 -12
- package/esm2015/lib/types.js +0 -37
- package/esm2015/lib/utils/odata.js +0 -21
- package/esm2015/lib/utils/strings.js +0 -13
- package/fesm2015/angular-odata.js.map +0 -1
- package/lib/resources/query/expressions.d.ts +0 -50
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,11 +1,11 @@
|
|
|
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;
|
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, ODataQueryArgumentsOptions, ODataQueryOptionsHandler } 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,14 +20,14 @@ 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:
|
|
29
|
+
resource(): ODataEntitySetResource<T> | ODataNavigationPropertyResource<T> | ODataPropertyResource<T>;
|
|
30
|
+
attach(resource: ODataEntitySetResource<T> | ODataNavigationPropertyResource<T> | ODataPropertyResource<T>): void;
|
|
31
31
|
asEntitySet<R>(func: (collection: this) => R): R;
|
|
32
32
|
annots(): ODataEntitiesAnnotations;
|
|
33
33
|
private modelFactory;
|
|
@@ -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,13 +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
102
|
query(func: (q: ODataQueryOptionsHandler<T>) => void): this;
|
|
105
|
-
|
|
106
|
-
|
|
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>;
|
|
107
105
|
private _unsubscribe;
|
|
108
106
|
private _subscribe;
|
|
109
107
|
private _findEntry;
|
|
@@ -116,6 +114,8 @@ export declare class ODataCollection<T, M extends ODataModel<T>> implements Iter
|
|
|
116
114
|
find(predicate: (m: M, index: number) => boolean): M | undefined;
|
|
117
115
|
first(): M | undefined;
|
|
118
116
|
last(): M | undefined;
|
|
117
|
+
next(model: M): M | undefined;
|
|
118
|
+
prev(model: M): M | undefined;
|
|
119
119
|
every(predicate: (m: M, index: number) => boolean): boolean;
|
|
120
120
|
some(predicate: (m: M, index: number) => boolean): boolean;
|
|
121
121
|
contains(model: M): boolean;
|
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<R>(resource: ODataEntityResource<R> | ODataNavigationPropertyResource<R> | ODataPropertyResource<R> | ODataSingletonResource<R>): 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;
|
|
@@ -149,11 +155,17 @@ export declare class ODataModel<T> {
|
|
|
149
155
|
* @returns The result of the context
|
|
150
156
|
*/
|
|
151
157
|
asEntity<R>(ctx: (model: this) => R): R;
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
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;
|
|
159
170
|
}
|
|
171
|
+
export declare const RESERVED_FIELD_NAMES: string[];
|
package/lib/models/options.d.ts
CHANGED
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
import { Subscription } from 'rxjs';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { Options } from '../types';
|
|
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,7 +117,7 @@ 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>(base:
|
|
120
|
+
resourceFactory<T, F>(base: ODataResource<T>): ODataNavigationPropertyResource<F> | ODataPropertyResource<F>;
|
|
124
121
|
annotationsFactory(base: ODataEntityAnnotations): ODataEntityAnnotations | ODataEntitiesAnnotations;
|
|
125
122
|
schemaFactory<T, F>(base: ODataStructuredType<T>): ODataStructuredType<F> | undefined;
|
|
126
123
|
modelCollectionFactory<T, F>({ parent, value, reset, }: {
|
|
@@ -157,42 +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<F>(name: keyof T | string): ODataModelField<
|
|
173
|
-
attach(self: ODataModel<T>, resource:
|
|
173
|
+
field<F>(name: keyof T | string): ODataModelField<F>;
|
|
174
|
+
attach<R>(self: ODataModel<T>, resource: ODataEntityResource<R> | ODataNavigationPropertyResource<R> | ODataPropertyResource<R> | ODataSingletonResource<R>): 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>;
|
|
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:
|
|
191
|
+
query(self: ODataModel<T>, resource: ODataEntityResource<T> | ODataPropertyResource<T> | ODataNavigationPropertyResource<T> | ODataSingletonResource<T>, func: (q: ODataQueryOptionsHandler<T>) => void): ODataModel<T>;
|
|
196
192
|
resolveKey(value: ODataModel<T> | T | {
|
|
197
193
|
[name: string]: any;
|
|
198
194
|
}, { field_mapping, resolve, }?: {
|
|
@@ -258,8 +254,9 @@ export declare class ODataModelOptions<T> {
|
|
|
258
254
|
}): void;
|
|
259
255
|
assign(self: ODataModel<T>, entity: Partial<T> | {
|
|
260
256
|
[name: string]: any;
|
|
261
|
-
}, { reset, silent, }?: {
|
|
257
|
+
}, { reset, reparent, silent, }?: {
|
|
262
258
|
reset?: boolean;
|
|
259
|
+
reparent?: boolean;
|
|
263
260
|
silent?: boolean;
|
|
264
261
|
}): void;
|
|
265
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;
|
package/lib/options.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { EntityKey } from '../resource';
|
|
2
1
|
import { PathSegmentNames } from '../../types';
|
|
2
|
+
import { EntityKey } from '../resource';
|
|
3
3
|
import { SegmentHandler } from './handlers';
|
|
4
4
|
export declare type ODataSegment = {
|
|
5
5
|
name: PathSegmentNames;
|
|
@@ -11,7 +11,7 @@ export declare type ODataSegment = {
|
|
|
11
11
|
export declare class ODataPathSegments {
|
|
12
12
|
private _segments;
|
|
13
13
|
constructor(segments?: ODataSegment[]);
|
|
14
|
-
pathAndParams(): [string, {
|
|
14
|
+
pathAndParams(escape?: boolean): [string, {
|
|
15
15
|
[name: string]: any;
|
|
16
16
|
}];
|
|
17
17
|
types({ key }?: {
|
|
@@ -83,10 +83,14 @@ export declare type QueryOptions<T> = ExpandOptions<T> & {
|
|
|
83
83
|
};
|
|
84
84
|
format: string;
|
|
85
85
|
aliases: QueryCustomType[];
|
|
86
|
+
escape: boolean;
|
|
86
87
|
};
|
|
87
88
|
export declare const ITEM_ROOT = "";
|
|
88
|
-
export default function <T>({ select, search, skiptoken, format, top, skip, filter, transform, orderBy, key, count, expand, action, func, aliases, }?: Partial<QueryOptions<T>>): string;
|
|
89
|
-
export declare function buildPathAndQuery<T>({ select, search, skiptoken, format, top, skip, filter, transform, orderBy, key, count, expand, action, func, aliases, }?: Partial<QueryOptions<T>>): [string, {
|
|
89
|
+
export default function <T>({ select, search, skiptoken, format, top, skip, filter, transform, orderBy, key, count, expand, action, func, aliases, escape, }?: Partial<QueryOptions<T>>): string;
|
|
90
|
+
export declare function buildPathAndQuery<T>({ select, search, skiptoken, format, top, skip, filter, transform, orderBy, key, count, expand, action, func, aliases, escape, }?: Partial<QueryOptions<T>>): [string, {
|
|
90
91
|
[name: string]: any;
|
|
91
92
|
}];
|
|
92
|
-
export declare function normalizeValue(value: Value, aliases
|
|
93
|
+
export declare function normalizeValue(value: Value, { aliases, escape }: {
|
|
94
|
+
aliases?: QueryCustomType[];
|
|
95
|
+
escape?: boolean;
|
|
96
|
+
}): any;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { QueryCustomType } from '../builder';
|
|
2
|
+
import { Renderable } from './syntax';
|
|
3
|
+
export declare abstract class Expression<T> implements Renderable {
|
|
4
|
+
protected _children: Renderable[];
|
|
5
|
+
constructor({ children, }?: {
|
|
6
|
+
children?: Renderable[];
|
|
7
|
+
});
|
|
8
|
+
get [Symbol.toStringTag](): string;
|
|
9
|
+
abstract render({ aliases, escape, prefix, }: {
|
|
10
|
+
aliases?: QueryCustomType[] | undefined;
|
|
11
|
+
escape?: boolean | undefined;
|
|
12
|
+
prefix?: string | undefined;
|
|
13
|
+
}): string;
|
|
14
|
+
children(): Renderable[];
|
|
15
|
+
length(): number;
|
|
16
|
+
toJSON(): {
|
|
17
|
+
children: any[];
|
|
18
|
+
};
|
|
19
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { QueryCustomType } from '../builder';
|
|
2
|
+
import { Expression } from './base';
|
|
3
|
+
import { ODataFunctions, ODataOperators, Renderable } from './syntax';
|
|
4
|
+
export declare class ComputeExpression<T> extends Expression<T> {
|
|
5
|
+
names: string[];
|
|
6
|
+
constructor({ children, names, }?: {
|
|
7
|
+
children?: Renderable[];
|
|
8
|
+
names?: string[];
|
|
9
|
+
});
|
|
10
|
+
static e<T>(): ComputeExpression<T>;
|
|
11
|
+
static s<T extends object>(): T;
|
|
12
|
+
static compute<T extends object>(opts: (e: {
|
|
13
|
+
s: T;
|
|
14
|
+
e: () => ComputeExpression<T>;
|
|
15
|
+
}) => ComputeExpression<T>): ComputeExpression<T>;
|
|
16
|
+
render({ aliases, escape, prefix, }?: {
|
|
17
|
+
aliases?: QueryCustomType[] | undefined;
|
|
18
|
+
escape?: boolean | undefined;
|
|
19
|
+
prefix?: string | undefined;
|
|
20
|
+
}): string;
|
|
21
|
+
private _add;
|
|
22
|
+
field<T extends object>(name: string, opts: (e: {
|
|
23
|
+
o: ODataOperators<T>;
|
|
24
|
+
f: ODataFunctions<T>;
|
|
25
|
+
}) => Renderable): ComputeExpression<T>;
|
|
26
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { QueryCustomType } from '../builder';
|
|
2
|
+
import { Expression } from './base';
|
|
3
|
+
import { Renderable } from './syntax';
|
|
4
|
+
export declare class ExpandField<T> implements Renderable {
|
|
5
|
+
protected field: Renderable;
|
|
6
|
+
constructor(field: Renderable);
|
|
7
|
+
get [Symbol.toStringTag](): string;
|
|
8
|
+
toJSON(): {
|
|
9
|
+
field: any;
|
|
10
|
+
};
|
|
11
|
+
render({ aliases, escape, prefix, }: {
|
|
12
|
+
aliases?: QueryCustomType[];
|
|
13
|
+
escape?: boolean;
|
|
14
|
+
prefix?: string;
|
|
15
|
+
}): string;
|
|
16
|
+
select(): void;
|
|
17
|
+
filter(): void;
|
|
18
|
+
levels(): void;
|
|
19
|
+
orderBy(): void;
|
|
20
|
+
top(): void;
|
|
21
|
+
skip(): void;
|
|
22
|
+
}
|
|
23
|
+
export declare class ExpandExpression<T> extends Expression<T> {
|
|
24
|
+
constructor({ children, }?: {
|
|
25
|
+
children?: Renderable[];
|
|
26
|
+
});
|
|
27
|
+
static e<T>(): ExpandExpression<T>;
|
|
28
|
+
static s<T extends object>(): T;
|
|
29
|
+
static expand<T extends object>(opts: (e: {
|
|
30
|
+
s: T;
|
|
31
|
+
e: () => ExpandExpression<T>;
|
|
32
|
+
}) => ExpandExpression<T>): ExpandExpression<T>;
|
|
33
|
+
render({ aliases, escape, prefix, }?: {
|
|
34
|
+
aliases?: QueryCustomType[] | undefined;
|
|
35
|
+
escape?: boolean | undefined;
|
|
36
|
+
prefix?: string | undefined;
|
|
37
|
+
}): string;
|
|
38
|
+
private _add;
|
|
39
|
+
field<T extends object>(field: any, opts?: (e: ExpandField<keyof T>) => void): ExpandExpression<T>;
|
|
40
|
+
}
|