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
|
@@ -1,31 +1,28 @@
|
|
|
1
1
|
import { Observable } from 'rxjs';
|
|
2
|
-
import {
|
|
2
|
+
import { ODataApi } from '../../api';
|
|
3
3
|
import { ODataCollection, ODataModel } from '../../models';
|
|
4
|
-
import {
|
|
4
|
+
import { ODataStructuredType } from '../../schema/structured-type';
|
|
5
5
|
import { QueryOptionNames } from '../../types';
|
|
6
|
+
import { ODataQueryOptions } from '../query';
|
|
7
|
+
import { ODataResource } from '../resource';
|
|
8
|
+
import { ODataEntities, ODataEntity } from '../responses';
|
|
6
9
|
import { ODataActionResource } from './action';
|
|
7
|
-
import { ODataApi } from '../../api';
|
|
8
10
|
import { ODataCountResource } from './count';
|
|
9
11
|
import { ODataEntityResource } from './entity';
|
|
10
12
|
import { ODataFunctionResource } from './function';
|
|
11
13
|
import { ODataOptions } from './options';
|
|
12
|
-
import { ODataPathSegments } from '../path';
|
|
13
|
-
import { ODataQueryOptions } from '../query';
|
|
14
14
|
export declare class ODataEntitySetResource<T> extends ODataResource<T> {
|
|
15
|
-
static factory<E>(api: ODataApi, path
|
|
15
|
+
static factory<E>(api: ODataApi, { path, schema, query, }: {
|
|
16
|
+
path: string;
|
|
17
|
+
schema?: ODataStructuredType<E>;
|
|
18
|
+
query?: ODataQueryOptions<E>;
|
|
19
|
+
}): ODataEntitySetResource<E>;
|
|
16
20
|
clone(): ODataEntitySetResource<T>;
|
|
17
|
-
schema(): import("angular-odata").ODataStructuredType<T> | undefined;
|
|
18
|
-
asCollection<M extends ODataModel<T>, C extends ODataCollection<T, M>>(entities: Partial<T>[] | {
|
|
19
|
-
[name: string]: any;
|
|
20
|
-
}[], { annots, reset, }?: {
|
|
21
|
-
annots?: ODataEntitiesAnnotations;
|
|
22
|
-
reset?: boolean;
|
|
23
|
-
}): C;
|
|
24
21
|
entity(key?: any): ODataEntityResource<T>;
|
|
25
|
-
cast<C>(type: string): ODataEntitySetResource<C>;
|
|
26
22
|
action<P, R>(path: string): ODataActionResource<P, R>;
|
|
27
23
|
function<P, R>(path: string): ODataFunctionResource<P, R>;
|
|
28
24
|
count(): ODataCountResource<T>;
|
|
25
|
+
cast<C>(type: string): ODataEntitySetResource<C>;
|
|
29
26
|
protected post(attrs: Partial<T>, options?: ODataOptions): Observable<ODataEntity<T>>;
|
|
30
27
|
protected get(options?: ODataOptions & {
|
|
31
28
|
withCount?: boolean;
|
|
@@ -1,30 +1,28 @@
|
|
|
1
|
-
import { ODataResource } from '../resource';
|
|
2
|
-
import { ODataEntity, ODataEntityAnnotations } from '../responses';
|
|
3
1
|
import { Observable } from 'rxjs';
|
|
2
|
+
import { ODataApi } from '../../api';
|
|
3
|
+
import { ODataModel } from '../../models';
|
|
4
|
+
import { ODataStructuredType } from '../../schema/structured-type';
|
|
4
5
|
import { QueryOptionNames } from '../../types';
|
|
6
|
+
import { ODataPathSegments } from '../path';
|
|
7
|
+
import { ODataQueryOptions } from '../query';
|
|
8
|
+
import { ODataResource } from '../resource';
|
|
9
|
+
import { ODataEntity } from '../responses/types';
|
|
5
10
|
import { ODataActionResource } from './action';
|
|
6
|
-
import { ODataApi } from '../../api';
|
|
7
11
|
import { ODataFunctionResource } from './function';
|
|
8
12
|
import { ODataMediaResource } from './media';
|
|
9
|
-
import { ODataModel } from '../../models';
|
|
10
13
|
import { ODataNavigationPropertyResource } from './navigation-property';
|
|
11
14
|
import { ODataOptions } from './options';
|
|
12
|
-
import { ODataPathSegments } from '../path';
|
|
13
15
|
import { ODataPropertyResource } from './property';
|
|
14
|
-
import { ODataQueryOptions } from '../query';
|
|
15
16
|
export declare class ODataEntityResource<T> extends ODataResource<T> {
|
|
16
|
-
static factory<E>(api: ODataApi, segments
|
|
17
|
+
static factory<E>(api: ODataApi, { schema, segments, query, }: {
|
|
18
|
+
schema?: ODataStructuredType<E>;
|
|
19
|
+
segments: ODataPathSegments;
|
|
20
|
+
query?: ODataQueryOptions<E>;
|
|
21
|
+
}): ODataEntityResource<E>;
|
|
17
22
|
clone(): ODataEntityResource<T>;
|
|
18
|
-
schema(): import("angular-odata").ODataStructuredType<T> | undefined;
|
|
19
|
-
asModel<M extends ODataModel<T>>(entity: Partial<T> | {
|
|
20
|
-
[name: string]: any;
|
|
21
|
-
}, { annots, reset }?: {
|
|
22
|
-
annots?: ODataEntityAnnotations;
|
|
23
|
-
reset?: boolean;
|
|
24
|
-
}): M;
|
|
25
23
|
key(value: any): ODataEntityResource<T>;
|
|
26
24
|
keys(values: any[]): ODataEntityResource<T>;
|
|
27
|
-
media(): ODataMediaResource
|
|
25
|
+
media(): ODataMediaResource;
|
|
28
26
|
navigationProperty<N>(path: string): ODataNavigationPropertyResource<N>;
|
|
29
27
|
property<P>(path: string): ODataPropertyResource<P>;
|
|
30
28
|
action<P, R>(path: string): ODataActionResource<P, R>;
|
|
@@ -1,29 +1,23 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ODataEntitiesOptions, ODataEntityOptions, ODataNoneOptions, ODataOptions, ODataPropertyOptions } from './options';
|
|
1
|
+
import { Observable } from 'rxjs';
|
|
3
2
|
import { ODataApi } from '../../api';
|
|
4
3
|
import { ODataCollection } from '../../models/collection';
|
|
5
4
|
import { ODataModel } from '../../models/model';
|
|
5
|
+
import { ODataCallable } from '../../schema/callable';
|
|
6
6
|
import { ODataPathSegments } from '../path';
|
|
7
7
|
import { ODataQueryOptions } from '../query';
|
|
8
8
|
import { ODataResource } from '../resource';
|
|
9
|
-
import {
|
|
9
|
+
import { ODataEntities, ODataEntity, ODataProperty } from '../responses';
|
|
10
|
+
import { ODataEntitiesOptions, ODataEntityOptions, ODataNoneOptions, ODataOptions, ODataPropertyOptions } from './options';
|
|
10
11
|
export declare class ODataFunctionResource<P, R> extends ODataResource<R> {
|
|
11
|
-
static factory<P, R>(api: ODataApi, path
|
|
12
|
+
static factory<P, R>(api: ODataApi, { path, schema, segments, query, }: {
|
|
13
|
+
path?: string;
|
|
14
|
+
schema?: ODataCallable<R>;
|
|
15
|
+
segments?: ODataPathSegments;
|
|
16
|
+
query?: ODataQueryOptions<R>;
|
|
17
|
+
}): ODataFunctionResource<P, R>;
|
|
18
|
+
static fromResource<P, R>(resource: ODataResource<any>, path: string): ODataFunctionResource<P, R>;
|
|
12
19
|
clone(): ODataFunctionResource<P, R>;
|
|
13
20
|
returnType(): string | undefined;
|
|
14
|
-
schema(): import("angular-odata").ODataCallable<R> | undefined;
|
|
15
|
-
asModel<M extends ODataModel<R>>(entity: Partial<R> | {
|
|
16
|
-
[name: string]: any;
|
|
17
|
-
}, { annots, reset }?: {
|
|
18
|
-
annots?: ODataEntityAnnotations;
|
|
19
|
-
reset?: boolean;
|
|
20
|
-
}): M;
|
|
21
|
-
asCollection<M extends ODataModel<R>, C extends ODataCollection<R, M>>(entities: Partial<R>[] | {
|
|
22
|
-
[name: string]: any;
|
|
23
|
-
}[], { annots, reset, }?: {
|
|
24
|
-
annots?: ODataEntitiesAnnotations;
|
|
25
|
-
reset?: boolean;
|
|
26
|
-
}): C;
|
|
27
21
|
parameters(params: P | null, { alias }?: {
|
|
28
22
|
alias?: boolean;
|
|
29
23
|
}): ODataFunctionResource<P, R>;
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
+
import { Observable } from 'rxjs';
|
|
1
2
|
import { ODataApi } from '../../api';
|
|
2
|
-
import { ODataOptions } from './options';
|
|
3
3
|
import { ODataPathSegments } from '../path';
|
|
4
4
|
import { ODataQueryOptions } from '../query';
|
|
5
5
|
import { ODataResource } from '../resource';
|
|
6
|
-
import {
|
|
7
|
-
export declare class ODataMediaResource
|
|
8
|
-
static factory<V>(api: ODataApi, segments
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
import { ODataOptions } from './options';
|
|
7
|
+
export declare class ODataMediaResource extends ODataResource<any> {
|
|
8
|
+
static factory<V>(api: ODataApi, { segments, query, }: {
|
|
9
|
+
segments: ODataPathSegments;
|
|
10
|
+
query?: ODataQueryOptions<V>;
|
|
11
|
+
}): ODataMediaResource;
|
|
12
|
+
clone(): ODataMediaResource;
|
|
11
13
|
protected get(options: {
|
|
12
14
|
responseType: any;
|
|
13
15
|
} & ODataOptions): Observable<any>;
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
+
import { Observable } from 'rxjs';
|
|
1
2
|
import { ODataApi } from '../../api';
|
|
2
|
-
import { ODataMetadata } from '../responses';
|
|
3
|
-
import { ODataOptions } from './options';
|
|
4
3
|
import { ODataPathSegments } from '../path';
|
|
5
4
|
import { ODataResource } from '../resource';
|
|
6
|
-
import {
|
|
5
|
+
import { ODataMetadata } from '../responses';
|
|
6
|
+
import { ODataOptions } from './options';
|
|
7
7
|
export declare class ODataMetadataResource extends ODataResource<any> {
|
|
8
8
|
constructor(api: ODataApi, segments?: ODataPathSegments);
|
|
9
9
|
static factory(api: ODataApi): ODataMetadataResource;
|
|
10
10
|
clone(): ODataMetadataResource;
|
|
11
|
-
schema(): undefined;
|
|
12
11
|
protected get(options?: ODataOptions): Observable<ODataMetadata>;
|
|
13
12
|
fetch(options?: ODataOptions): Observable<ODataMetadata>;
|
|
14
13
|
}
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { Observable } from 'rxjs';
|
|
2
|
-
import {
|
|
2
|
+
import { ODataApi } from '../../api';
|
|
3
3
|
import { ODataCollection, ODataModel } from '../../models';
|
|
4
|
-
import {
|
|
5
|
-
import { ODataEntitiesOptions, ODataEntityOptions, ODataOptions } from './options';
|
|
4
|
+
import { ODataStructuredType } from '../../schema';
|
|
6
5
|
import { QueryOptionNames } from '../../types';
|
|
7
|
-
import {
|
|
6
|
+
import { ODataPathSegments } from '../path';
|
|
7
|
+
import { ODataQueryOptions } from '../query';
|
|
8
|
+
import { ODataResource } from '../resource';
|
|
9
|
+
import { ODataEntities, ODataEntity } from '../responses';
|
|
8
10
|
import { ODataCountResource } from './count';
|
|
9
11
|
import { ODataMediaResource } from './media';
|
|
10
|
-
import {
|
|
12
|
+
import { ODataEntitiesOptions, ODataEntityOptions, ODataOptions } from './options';
|
|
11
13
|
import { ODataPropertyResource } from './property';
|
|
12
|
-
import { ODataQueryOptions } from '../query';
|
|
13
14
|
import { ODataReferenceResource } from './reference';
|
|
14
15
|
/**
|
|
15
16
|
* OData Navigation Property Resource
|
|
@@ -17,25 +18,19 @@ import { ODataReferenceResource } from './reference';
|
|
|
17
18
|
* https://www.odata.org/getting-started/advanced-tutorial/#derived
|
|
18
19
|
*/
|
|
19
20
|
export declare class ODataNavigationPropertyResource<T> extends ODataResource<T> {
|
|
20
|
-
static factory<
|
|
21
|
+
static factory<N>(api: ODataApi, { path, type, schema, segments, query, }: {
|
|
22
|
+
path: string;
|
|
23
|
+
type?: string;
|
|
24
|
+
schema?: ODataStructuredType<N>;
|
|
25
|
+
segments: ODataPathSegments;
|
|
26
|
+
query?: ODataQueryOptions<N>;
|
|
27
|
+
}): ODataNavigationPropertyResource<N>;
|
|
28
|
+
static fromResource<N>(resource: ODataResource<any>, path: string): ODataNavigationPropertyResource<N>;
|
|
21
29
|
clone(): ODataNavigationPropertyResource<T>;
|
|
22
|
-
schema(): import("angular-odata").ODataStructuredType<T> | undefined;
|
|
23
|
-
asModel<M extends ODataModel<T>>(entity: Partial<T> | {
|
|
24
|
-
[name: string]: any;
|
|
25
|
-
}, { annots, reset }?: {
|
|
26
|
-
annots?: ODataEntityAnnotations;
|
|
27
|
-
reset?: boolean;
|
|
28
|
-
}): M;
|
|
29
|
-
asCollection<M extends ODataModel<T>, C extends ODataCollection<T, M>>(entities: Partial<T>[] | {
|
|
30
|
-
[name: string]: any;
|
|
31
|
-
}[], { annots, reset, }?: {
|
|
32
|
-
annots?: ODataEntitiesAnnotations;
|
|
33
|
-
reset?: boolean;
|
|
34
|
-
}): C;
|
|
35
30
|
key(value: any): ODataNavigationPropertyResource<T>;
|
|
36
31
|
keys(values: any[]): ODataNavigationPropertyResource<T>;
|
|
37
|
-
media(): ODataMediaResource
|
|
38
|
-
reference(): ODataReferenceResource
|
|
32
|
+
media(): ODataMediaResource;
|
|
33
|
+
reference(): ODataReferenceResource<T>;
|
|
39
34
|
navigationProperty<N>(path: string): ODataNavigationPropertyResource<N>;
|
|
40
35
|
property<P>(path: string): ODataPropertyResource<P>;
|
|
41
36
|
count(): ODataCountResource<T>;
|
|
@@ -1,28 +1,23 @@
|
|
|
1
1
|
import { Observable } from 'rxjs';
|
|
2
|
-
import { ODataResource } from '../resource';
|
|
3
|
-
import { ODataCollection, ODataModel } from '../../models';
|
|
4
|
-
import { ODataEntities, ODataEntitiesAnnotations, ODataEntity, ODataEntityAnnotations, ODataProperty } from '../responses';
|
|
5
|
-
import { ODataEntitiesOptions, ODataEntityOptions, ODataOptions, ODataPropertyOptions } from './options';
|
|
6
2
|
import { ODataApi } from '../../api';
|
|
3
|
+
import { ODataCollection, ODataModel } from '../../models';
|
|
4
|
+
import { ODataStructuredType } from '../../schema';
|
|
7
5
|
import { ODataPathSegments } from '../path';
|
|
8
6
|
import { ODataQueryOptions } from '../query';
|
|
7
|
+
import { ODataResource } from '../resource';
|
|
8
|
+
import { ODataEntities, ODataEntity, ODataProperty } from '../responses';
|
|
9
|
+
import { ODataEntitiesOptions, ODataEntityOptions, ODataOptions, ODataPropertyOptions } from './options';
|
|
9
10
|
import { ODataValueResource } from './value';
|
|
10
11
|
export declare class ODataPropertyResource<T> extends ODataResource<T> {
|
|
11
|
-
static factory<P>(api: ODataApi, path
|
|
12
|
+
static factory<P>(api: ODataApi, { path, type, schema, segments, query, }: {
|
|
13
|
+
path: string;
|
|
14
|
+
type?: string;
|
|
15
|
+
schema?: ODataStructuredType<P>;
|
|
16
|
+
segments: ODataPathSegments;
|
|
17
|
+
query?: ODataQueryOptions<P>;
|
|
18
|
+
}): ODataPropertyResource<P>;
|
|
19
|
+
static fromResource<N>(resource: ODataResource<any>, path: string): ODataPropertyResource<N>;
|
|
12
20
|
clone(): ODataPropertyResource<T>;
|
|
13
|
-
schema(): import("angular-odata").ODataStructuredType<T> | undefined;
|
|
14
|
-
asModel<M extends ODataModel<T>>(entity: Partial<T> | {
|
|
15
|
-
[name: string]: any;
|
|
16
|
-
}, { annots, reset }?: {
|
|
17
|
-
annots?: ODataEntityAnnotations;
|
|
18
|
-
reset?: boolean;
|
|
19
|
-
}): M;
|
|
20
|
-
asCollection<M extends ODataModel<T>, C extends ODataCollection<T, M>>(entities: Partial<T>[] | {
|
|
21
|
-
[name: string]: any;
|
|
22
|
-
}[], { annots, reset, }?: {
|
|
23
|
-
annots?: ODataEntitiesAnnotations;
|
|
24
|
-
reset?: boolean;
|
|
25
|
-
}): C;
|
|
26
21
|
key(value: any): ODataPropertyResource<T>;
|
|
27
22
|
keys(values: any[]): ODataPropertyResource<T>;
|
|
28
23
|
value(): ODataValueResource<T>;
|
|
@@ -1,14 +1,18 @@
|
|
|
1
|
+
import { Observable } from 'rxjs';
|
|
1
2
|
import { ODataApi } from '../../api';
|
|
2
|
-
import {
|
|
3
|
-
import { ODataOptions } from './options';
|
|
3
|
+
import { QueryOptionNames } from '../../types';
|
|
4
4
|
import { ODataPathSegments } from '../path';
|
|
5
5
|
import { ODataQueryOptions } from '../query';
|
|
6
6
|
import { ODataResource } from '../resource';
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
import { ODataEntities, ODataEntity } from '../responses/types';
|
|
8
|
+
import { ODataEntityResource } from './entity';
|
|
9
|
+
import { ODataEntitiesOptions, ODataEntityOptions, ODataOptions } from './options';
|
|
10
|
+
export declare class ODataReferenceResource<T> extends ODataResource<T> {
|
|
11
|
+
static factory<P>(api: ODataApi, { segments, query, }: {
|
|
12
|
+
segments: ODataPathSegments;
|
|
13
|
+
query?: ODataQueryOptions<P>;
|
|
14
|
+
}): ODataReferenceResource<P>;
|
|
15
|
+
clone(): ODataReferenceResource<T>;
|
|
12
16
|
protected post(target: ODataEntityResource<any>, options?: ODataOptions): Observable<any>;
|
|
13
17
|
protected put(target: ODataEntityResource<any>, options?: ODataOptions & {
|
|
14
18
|
etag?: string;
|
|
@@ -48,4 +52,34 @@ export declare class ODataReferenceResource extends ODataResource<any> {
|
|
|
48
52
|
unset(options?: ODataOptions & {
|
|
49
53
|
etag?: string;
|
|
50
54
|
}): Observable<any>;
|
|
55
|
+
/**
|
|
56
|
+
* Fetch entity / entities
|
|
57
|
+
* @param options Options for the request
|
|
58
|
+
* @return An observable of the entity or entities with annotations
|
|
59
|
+
*/
|
|
60
|
+
fetch(options?: ODataEntityOptions & {
|
|
61
|
+
etag?: string;
|
|
62
|
+
bodyQueryOptions?: QueryOptionNames[];
|
|
63
|
+
}): Observable<ODataEntity<T>>;
|
|
64
|
+
fetch(options?: ODataEntitiesOptions & {
|
|
65
|
+
etag?: string;
|
|
66
|
+
bodyQueryOptions?: QueryOptionNames[];
|
|
67
|
+
}): Observable<ODataEntities<T>>;
|
|
68
|
+
/**
|
|
69
|
+
* Fetch the entity
|
|
70
|
+
* @param options Options for the request
|
|
71
|
+
* @returns The entity
|
|
72
|
+
*/
|
|
73
|
+
fetchEntity(options?: ODataOptions & {
|
|
74
|
+
etag?: string;
|
|
75
|
+
bodyQueryOptions?: QueryOptionNames[];
|
|
76
|
+
}): Observable<T | null>;
|
|
77
|
+
/**
|
|
78
|
+
* Fetch entities
|
|
79
|
+
* @param options Options for the request
|
|
80
|
+
* @returns The entities
|
|
81
|
+
*/
|
|
82
|
+
fetchEntities(options?: ODataOptions & {
|
|
83
|
+
bodyQueryOptions?: QueryOptionNames[];
|
|
84
|
+
}): Observable<T[] | null>;
|
|
51
85
|
}
|
|
@@ -1,26 +1,23 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { Observable } from 'rxjs';
|
|
2
|
+
import { ODataApi } from '../../api';
|
|
3
|
+
import { ODataModel } from '../../models';
|
|
4
|
+
import { ODataStructuredType } from '../../schema';
|
|
3
5
|
import { QueryOptionNames } from '../../types';
|
|
6
|
+
import { ODataQueryOptions } from '../query';
|
|
7
|
+
import { ODataResource } from '../resource';
|
|
8
|
+
import { ODataEntity } from '../responses';
|
|
4
9
|
import { ODataActionResource } from './action';
|
|
5
|
-
import { ODataApi } from '../../api';
|
|
6
10
|
import { ODataFunctionResource } from './function';
|
|
7
|
-
import { ODataModel } from '../../models';
|
|
8
11
|
import { ODataNavigationPropertyResource } from './navigation-property';
|
|
9
12
|
import { ODataOptions } from './options';
|
|
10
|
-
import { ODataPathSegments } from '../path';
|
|
11
13
|
import { ODataPropertyResource } from './property';
|
|
12
|
-
import { ODataQueryOptions } from '../query';
|
|
13
|
-
import { Observable } from 'rxjs';
|
|
14
14
|
export declare class ODataSingletonResource<T> extends ODataResource<T> {
|
|
15
|
-
static factory<
|
|
15
|
+
static factory<S>(api: ODataApi, { path, schema, query, }: {
|
|
16
|
+
path: string;
|
|
17
|
+
schema?: ODataStructuredType<S>;
|
|
18
|
+
query?: ODataQueryOptions<S>;
|
|
19
|
+
}): ODataSingletonResource<S>;
|
|
16
20
|
clone(): ODataSingletonResource<T>;
|
|
17
|
-
schema(): import("angular-odata").ODataStructuredType<T> | undefined;
|
|
18
|
-
asModel<M extends ODataModel<T>>(entity: Partial<T> | {
|
|
19
|
-
[name: string]: any;
|
|
20
|
-
}, { annots, reset }?: {
|
|
21
|
-
annots?: ODataEntityAnnotations;
|
|
22
|
-
reset?: boolean;
|
|
23
|
-
}): M;
|
|
24
21
|
key(value: any): ODataSingletonResource<T>;
|
|
25
22
|
keys(values: any[]): ODataSingletonResource<T>;
|
|
26
23
|
navigationProperty<N>(path: string): ODataNavigationPropertyResource<N>;
|
|
@@ -1,13 +1,18 @@
|
|
|
1
|
+
import { Observable } from 'rxjs';
|
|
1
2
|
import { ODataApi } from '../../api';
|
|
2
|
-
import {
|
|
3
|
+
import { ODataStructuredType } from '../../schema/structured-type';
|
|
3
4
|
import { ODataPathSegments } from '../path';
|
|
4
5
|
import { ODataQueryOptions } from '../query';
|
|
5
6
|
import { ODataResource } from '../resource';
|
|
6
|
-
import {
|
|
7
|
+
import { ODataOptions } from './options';
|
|
7
8
|
export declare class ODataValueResource<T> extends ODataResource<T> {
|
|
8
|
-
static factory<V>(api: ODataApi, type
|
|
9
|
+
static factory<V>(api: ODataApi, { type, schema, segments, query, }: {
|
|
10
|
+
type?: string;
|
|
11
|
+
schema?: ODataStructuredType<V>;
|
|
12
|
+
segments: ODataPathSegments;
|
|
13
|
+
query?: ODataQueryOptions<V>;
|
|
14
|
+
}): ODataValueResource<V>;
|
|
9
15
|
clone(): ODataValueResource<T>;
|
|
10
|
-
schema(): undefined;
|
|
11
16
|
protected get(options?: ODataOptions): Observable<T>;
|
|
12
17
|
/**
|
|
13
18
|
* Fetch the value of the resource.
|
|
@@ -8,3 +8,21 @@ export declare class ODataAnnotation {
|
|
|
8
8
|
properties?: string[];
|
|
9
9
|
constructor(annot: AnnotationConfig);
|
|
10
10
|
}
|
|
11
|
+
export declare class ODataAnnotatable {
|
|
12
|
+
annotations: ODataAnnotation[];
|
|
13
|
+
constructor(config: {
|
|
14
|
+
annotations?: AnnotationConfig[];
|
|
15
|
+
});
|
|
16
|
+
/**
|
|
17
|
+
* Find an annotation inside the annotatable.
|
|
18
|
+
* @param predicate Function that returns true if the annotation match.
|
|
19
|
+
* @returns The annotation that matches the predicate.
|
|
20
|
+
*/
|
|
21
|
+
findAnnotation(predicate: (annot: ODataAnnotation) => boolean): ODataAnnotation | undefined;
|
|
22
|
+
/**
|
|
23
|
+
* Find an annotation inside the annotatable and return its value.
|
|
24
|
+
* @param term The term of the annotation to find.
|
|
25
|
+
* @returns The value of the annotation.
|
|
26
|
+
*/
|
|
27
|
+
annotatedValue<T>(term: string | RegExp): T | undefined;
|
|
28
|
+
}
|
package/lib/schema/callable.d.ts
CHANGED
|
@@ -1,30 +1,14 @@
|
|
|
1
1
|
import { CallableConfig, Options, Parser } from '../types';
|
|
2
|
-
import {
|
|
2
|
+
import { ODataSchemaElement } from './element';
|
|
3
|
+
import { ODataCallableParser } from './parsers';
|
|
3
4
|
import { ODataSchema } from './schema';
|
|
4
|
-
export declare class ODataCallable<R> {
|
|
5
|
-
schema: ODataSchema;
|
|
6
|
-
name: string;
|
|
5
|
+
export declare class ODataCallable<R> extends ODataSchemaElement {
|
|
7
6
|
entitySetPath?: string;
|
|
8
7
|
bound?: boolean;
|
|
9
8
|
composable?: boolean;
|
|
10
9
|
parser: ODataCallableParser<R>;
|
|
11
10
|
constructor(config: CallableConfig, schema: ODataSchema);
|
|
12
11
|
path(): string;
|
|
13
|
-
/**
|
|
14
|
-
* Returns a full type of the callable including the namespace/alias.
|
|
15
|
-
* @param alias Use the alias of the namespace instead of the namespace.
|
|
16
|
-
* @returns The string representation of the type.
|
|
17
|
-
*/
|
|
18
|
-
type({ alias }?: {
|
|
19
|
-
alias?: boolean;
|
|
20
|
-
}): string;
|
|
21
|
-
/**
|
|
22
|
-
* Returns a boolean indicating if the callable is of the given type.
|
|
23
|
-
* @param type String representation of the type
|
|
24
|
-
* @returns True if the callable is type of the given type
|
|
25
|
-
*/
|
|
26
|
-
isTypeOf(type: string): boolean;
|
|
27
|
-
get api(): import("angular-odata").ODataApi;
|
|
28
12
|
configure({ parserForType, }: {
|
|
29
13
|
parserForType: (type: string) => Parser<any>;
|
|
30
14
|
}): void;
|
|
@@ -53,5 +37,5 @@ export declare class ODataCallable<R> {
|
|
|
53
37
|
* Returns the binding parameter of the callable.
|
|
54
38
|
* @returns The binding parameter of the callable.
|
|
55
39
|
*/
|
|
56
|
-
binding(): import("
|
|
40
|
+
binding(): import("./parsers").ODataParameterParser<any> | undefined;
|
|
57
41
|
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { AnnotationConfig } from '../types';
|
|
2
|
+
import { ODataAnnotatable } from './annotation';
|
|
3
|
+
import { ODataSchema } from './schema';
|
|
4
|
+
export declare class ODataSchemaElement extends ODataAnnotatable {
|
|
5
|
+
name: string;
|
|
6
|
+
schema: ODataSchema;
|
|
7
|
+
constructor(config: {
|
|
8
|
+
annotations?: AnnotationConfig[];
|
|
9
|
+
name: string;
|
|
10
|
+
}, schema: ODataSchema);
|
|
11
|
+
get api(): import("angular-odata").ODataApi;
|
|
12
|
+
/**
|
|
13
|
+
* Create a nicer looking title.
|
|
14
|
+
* Titleize is meant for creating pretty output.
|
|
15
|
+
* @param term The term of the annotation to find.
|
|
16
|
+
* @returns The titleized string.
|
|
17
|
+
*/
|
|
18
|
+
titleize(term?: string | RegExp): string;
|
|
19
|
+
/**
|
|
20
|
+
* Returns a full type of the structured type including the namespace/alias.
|
|
21
|
+
* @param alias Use the alias of the namespace instead of the namespace.
|
|
22
|
+
* @returns The string representation of the type.
|
|
23
|
+
*/
|
|
24
|
+
type({ alias }?: {
|
|
25
|
+
alias?: boolean;
|
|
26
|
+
}): string;
|
|
27
|
+
/**
|
|
28
|
+
* Returns a boolean indicating if the structured type is of the given type.
|
|
29
|
+
* @param type String representation of the type
|
|
30
|
+
* @returns True if the callable is type of the given type
|
|
31
|
+
*/
|
|
32
|
+
isTypeOf(type: string): boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Returns a boolean indicating if the structured type is a subtype of the given type.
|
|
35
|
+
* @param type String representation of the type
|
|
36
|
+
* @returns True if the callable is type of the given type
|
|
37
|
+
*/
|
|
38
|
+
isSubtypeOf(schema: ODataSchemaElement): boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Returns a boolean indicating if the structured type is a supertype of the given type.
|
|
41
|
+
* @param type String representation of the type
|
|
42
|
+
* @returns True if the callable is type of the given type
|
|
43
|
+
*/
|
|
44
|
+
isSupertypeOf(schema: ODataSchemaElement): boolean;
|
|
45
|
+
}
|
|
@@ -1,18 +1,8 @@
|
|
|
1
1
|
import { EntityContainerConfig } from '../types';
|
|
2
|
-
import {
|
|
2
|
+
import { ODataSchemaElement } from './element';
|
|
3
3
|
import { ODataEntitySet } from './entity-set';
|
|
4
4
|
import { ODataSchema } from './schema';
|
|
5
|
-
export declare class ODataEntityContainer {
|
|
6
|
-
schema: ODataSchema;
|
|
7
|
-
name: string;
|
|
8
|
-
annotations: ODataAnnotation[];
|
|
5
|
+
export declare class ODataEntityContainer extends ODataSchemaElement {
|
|
9
6
|
entitySets: ODataEntitySet[];
|
|
10
7
|
constructor(config: EntityContainerConfig, schema: ODataSchema);
|
|
11
|
-
get api(): import("angular-odata").ODataApi;
|
|
12
|
-
/**
|
|
13
|
-
* Find an annotation inside the entity container.
|
|
14
|
-
* @param predicate Function that returns true if the annotation match.
|
|
15
|
-
* @returns The annotation that matches the predicate.
|
|
16
|
-
*/
|
|
17
|
-
findAnnotation(predicate: (annot: ODataAnnotation) => boolean): ODataAnnotation | undefined;
|
|
18
8
|
}
|
|
@@ -1,26 +1,10 @@
|
|
|
1
1
|
import { EntitySetConfig } from '../types';
|
|
2
|
-
import {
|
|
2
|
+
import { ODataSchemaElement } from './element';
|
|
3
3
|
import { ODataSchema } from './schema';
|
|
4
|
-
export declare class ODataEntitySet {
|
|
5
|
-
schema: ODataSchema;
|
|
6
|
-
name: string;
|
|
4
|
+
export declare class ODataEntitySet extends ODataSchemaElement {
|
|
7
5
|
entityType: string;
|
|
8
6
|
service: {
|
|
9
7
|
new (...params: any[]): any;
|
|
10
8
|
};
|
|
11
|
-
annotations: ODataAnnotation[];
|
|
12
9
|
constructor(config: EntitySetConfig, schema: ODataSchema);
|
|
13
|
-
/**
|
|
14
|
-
* Returns a boolean indicating if the entity set is of the given type.
|
|
15
|
-
* @param type String representation of the type
|
|
16
|
-
* @returns True if the callable is type of the given type
|
|
17
|
-
*/
|
|
18
|
-
isTypeOf(type: string): boolean;
|
|
19
|
-
get api(): import("angular-odata").ODataApi;
|
|
20
|
-
/**
|
|
21
|
-
* Find an annotation inside the entity set.
|
|
22
|
-
* @param predicate Function that returns true if the annotation match.
|
|
23
|
-
* @returns The annotation that matches the predicate.
|
|
24
|
-
*/
|
|
25
|
-
findAnnotation(predicate: (annot: ODataAnnotation) => boolean): ODataAnnotation | undefined;
|
|
26
10
|
}
|
|
@@ -1,40 +1,16 @@
|
|
|
1
1
|
import { EnumTypeConfig, Options } from '../types';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { ODataSchemaElement } from './element';
|
|
3
|
+
import { ODataEnumTypeFieldParser, ODataEnumTypeParser } from './parsers';
|
|
4
4
|
import { ODataSchema } from './schema';
|
|
5
|
-
export declare class ODataEnumType<E> {
|
|
6
|
-
schema: ODataSchema;
|
|
7
|
-
name: string;
|
|
5
|
+
export declare class ODataEnumType<E> extends ODataSchemaElement {
|
|
8
6
|
parser: ODataEnumTypeParser<E>;
|
|
9
7
|
members: {
|
|
10
8
|
[name: string]: number;
|
|
11
9
|
} | {
|
|
12
10
|
[value: number]: string;
|
|
13
11
|
};
|
|
14
|
-
annotations: ODataAnnotation[];
|
|
15
12
|
constructor(config: EnumTypeConfig<E>, schema: ODataSchema);
|
|
16
|
-
/**
|
|
17
|
-
* Returns a full type of the enum type including the namespace/alias.
|
|
18
|
-
* @param alias Use the alias of the namespace instead of the namespace.
|
|
19
|
-
* @returns The string representation of the type.
|
|
20
|
-
*/
|
|
21
|
-
type({ alias }?: {
|
|
22
|
-
alias?: boolean;
|
|
23
|
-
}): string;
|
|
24
|
-
/**
|
|
25
|
-
* Returns a boolean indicating if the enum type is of the given type.
|
|
26
|
-
* @param type String representation of the type
|
|
27
|
-
* @returns True if the callable is type of the given type
|
|
28
|
-
*/
|
|
29
|
-
isTypeOf(type: string): boolean;
|
|
30
|
-
get api(): import("angular-odata").ODataApi;
|
|
31
13
|
configure(): void;
|
|
32
|
-
/**
|
|
33
|
-
* Find an annotation inside the enum type.
|
|
34
|
-
* @param predicate Function that returns true if the annotation match.
|
|
35
|
-
* @returns The annotation that matches the predicate.
|
|
36
|
-
*/
|
|
37
|
-
findAnnotation(predicate: (annot: ODataAnnotation) => boolean): ODataAnnotation | undefined;
|
|
38
14
|
/**
|
|
39
15
|
* Returns the fields of the enum type.
|
|
40
16
|
* @returns The fields of the enum type.
|
|
@@ -52,13 +28,6 @@ export declare class ODataEnumType<E> {
|
|
|
52
28
|
* @returns The field with the given value
|
|
53
29
|
*/
|
|
54
30
|
findFieldByValue(value: number): ODataEnumTypeFieldParser | undefined;
|
|
55
|
-
/**
|
|
56
|
-
* Find a title for a given value.
|
|
57
|
-
* @param value Value of the field
|
|
58
|
-
* @param pattern Pattern to use for find in annotations
|
|
59
|
-
* @returns The name or annotation of the filed that matches with the value.
|
|
60
|
-
*/
|
|
61
|
-
fieldTitle(value: number | string, pattern?: RegExp): string;
|
|
62
31
|
/**
|
|
63
32
|
* Map the fields of the enum type.
|
|
64
33
|
* @param mapper Function that maps the value to the new value
|
package/lib/schema/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CallableConfig, Options, OptionsHelper, Parameter, Parser } from '
|
|
1
|
+
import { CallableConfig, Options, OptionsHelper, Parameter, Parser } from '../../types';
|
|
2
2
|
import { ODataEnumTypeParser } from './enum-type';
|
|
3
3
|
import { ODataStructuredTypeParser } from './structured-type';
|
|
4
4
|
export declare class ODataParameterParser<T> {
|