angular-odata 0.92.0 → 0.95.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{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} +3 -1
- package/esm2020/lib/helper.mjs +268 -0
- package/{esm2015/lib/index.js → esm2020/lib/index.mjs} +0 -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/{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.mjs +207 -0
- package/esm2020/lib/resources/query/handlers.mjs +186 -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/query/syntax.mjs +406 -0
- package/esm2020/lib/resources/request.mjs +167 -0
- package/esm2020/lib/resources/resource.mjs +326 -0
- package/esm2020/lib/resources/responses/annotations.mjs +119 -0
- package/{esm2015/lib/resources/responses/csdl/csdl-annotation.js → esm2020/lib/resources/responses/csdl/csdl-annotation.mjs} +0 -0
- package/{esm2015/lib/resources/responses/csdl/csdl-entity-container.js → esm2020/lib/resources/responses/csdl/csdl-entity-container.mjs} +0 -0
- package/{esm2015/lib/resources/responses/csdl/csdl-entity-set.js → esm2020/lib/resources/responses/csdl/csdl-entity-set.mjs} +0 -0
- package/{esm2015/lib/resources/responses/csdl/csdl-enum-type.js → esm2020/lib/resources/responses/csdl/csdl-enum-type.mjs} +0 -0
- package/{esm2015/lib/resources/responses/csdl/csdl-function-action.js → esm2020/lib/resources/responses/csdl/csdl-function-action.mjs} +0 -0
- package/{esm2015/lib/resources/responses/csdl/csdl-navigation-property-binding.js → esm2020/lib/resources/responses/csdl/csdl-navigation-property-binding.mjs} +0 -0
- package/{esm2015/lib/resources/responses/csdl/csdl-reference.js → esm2020/lib/resources/responses/csdl/csdl-reference.mjs} +0 -0
- package/{esm2015/lib/resources/responses/csdl/csdl-schema.js → esm2020/lib/resources/responses/csdl/csdl-schema.mjs} +0 -0
- package/{esm2015/lib/resources/responses/csdl/csdl-singleton.js → esm2020/lib/resources/responses/csdl/csdl-singleton.mjs} +0 -0
- package/{esm2015/lib/resources/responses/csdl/csdl-structural-property.js → esm2020/lib/resources/responses/csdl/csdl-structural-property.mjs} +0 -0
- package/{esm2015/lib/resources/responses/csdl/csdl-structured-type.js → esm2020/lib/resources/responses/csdl/csdl-structured-type.mjs} +0 -0
- package/{esm2015/lib/resources/responses/csdl/csdl-type-definition.js → esm2020/lib/resources/responses/csdl/csdl-type-definition.mjs} +0 -0
- package/{esm2015/lib/resources/responses/index.js → esm2020/lib/resources/responses/index.mjs} +0 -0
- package/esm2020/lib/resources/responses/metadata.mjs +547 -0
- package/{esm2015/lib/resources/responses/options.js → esm2020/lib/resources/responses/options.mjs} +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 +288 -0
- package/esm2020/lib/resources/types/count.mjs +27 -0
- package/esm2020/lib/resources/types/entity-set.mjs +94 -0
- package/esm2020/lib/resources/types/entity.mjs +106 -0
- package/esm2020/lib/resources/types/function.mjs +137 -0
- package/{esm2015/lib/resources/types/index.js → esm2020/lib/resources/types/index.mjs} +0 -0
- package/esm2020/lib/resources/types/media.mjs +41 -0
- package/esm2020/lib/resources/types/metadata.mjs +30 -0
- package/esm2020/lib/resources/types/navigation-property.mjs +226 -0
- package/esm2020/lib/resources/types/options.mjs +2 -0
- package/esm2020/lib/resources/types/property.mjs +183 -0
- package/esm2020/lib/resources/types/reference.mjs +85 -0
- package/esm2020/lib/resources/types/singleton.mjs +126 -0
- package/esm2020/lib/resources/types/value.mjs +41 -0
- package/esm2020/lib/schema/annotation.mjs +37 -0
- package/esm2020/lib/schema/callable.mjs +62 -0
- package/esm2020/lib/schema/element.mjs +51 -0
- package/esm2020/lib/schema/entity-container.mjs +9 -0
- package/esm2020/lib/schema/entity-set.mjs +9 -0
- package/esm2020/lib/schema/enum-type.mjs +71 -0
- package/{esm2015/lib/schema/index.js → esm2020/lib/schema/index.mjs} +0 -0
- package/esm2020/lib/schema/parsers/callable.mjs +113 -0
- package/{esm2015/lib/schema/parsers/edm.js → esm2020/lib/schema/parsers/edm.mjs} +2 -2
- package/esm2020/lib/schema/parsers/enum-type.mjs +107 -0
- package/{esm2015/lib/schema/parsers/index.js → esm2020/lib/schema/parsers/index.mjs} +0 -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/{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} +0 -0
- package/esm2020/lib/utils/odata.mjs +22 -0
- package/{esm2015/lib/utils/strings.js → esm2020/lib/utils/strings.mjs} +0 -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} +849 -750
- package/fesm2015/angular-odata.mjs.map +1 -0
- package/fesm2020/angular-odata.mjs +10274 -0
- package/fesm2020/angular-odata.mjs.map +1 -0
- package/lib/api.d.ts +10 -10
- 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 +1 -0
- package/lib/models/collection.d.ts +11 -19
- package/lib/models/model.d.ts +22 -18
- package/lib/models/options.d.ts +16 -21
- package/lib/module.d.ts +1 -1
- package/lib/options.d.ts +1 -0
- package/lib/resources/path/segments.d.ts +1 -1
- package/lib/resources/query/expressions.d.ts +37 -27
- package/lib/resources/query/handlers.d.ts +7 -11
- package/lib/resources/query/options.d.ts +2 -2
- package/lib/resources/query/syntax.d.ts +52 -54
- package/lib/resources/request.d.ts +1 -1
- package/lib/resources/resource.d.ts +25 -8
- package/lib/resources/types/action.d.ts +12 -19
- package/lib/resources/types/batch.d.ts +1 -3
- package/lib/resources/types/count.d.ts +5 -4
- package/lib/resources/types/entity-set.d.ts +11 -15
- package/lib/resources/types/entity.d.ts +12 -15
- package/lib/resources/types/function.d.ts +11 -18
- package/lib/resources/types/media.d.ts +6 -5
- package/lib/resources/types/metadata.d.ts +3 -5
- package/lib/resources/types/navigation-property.d.ts +15 -21
- package/lib/resources/types/property.d.ts +13 -19
- package/lib/resources/types/reference.d.ts +39 -6
- package/lib/resources/types/singleton.d.ts +12 -16
- package/lib/resources/types/value.d.ts +9 -5
- package/lib/schema/{base.d.ts → annotation.d.ts} +0 -0
- package/lib/schema/callable.d.ts +2 -18
- 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 +2 -26
- package/lib/schema/parsers/enum-type.d.ts +4 -4
- package/lib/schema/parsers/structured-type.d.ts +4 -4
- package/lib/schema/schema.d.ts +2 -2
- package/lib/schema/structured-type.d.ts +8 -26
- 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/package.json +21 -8
- package/bundles/angular-odata.umd.js +0 -11861
- package/bundles/angular-odata.umd.js.map +0 -1
- package/esm2015/lib/api.js +0 -296
- package/esm2015/lib/client.js +0 -272
- package/esm2015/lib/helper.js +0 -268
- package/esm2015/lib/models/collection.js +0 -734
- package/esm2015/lib/models/model.js +0 -438
- package/esm2015/lib/models/options.js +0 -942
- package/esm2015/lib/options.js +0 -31
- package/esm2015/lib/resources/path/segments.js +0 -124
- package/esm2015/lib/resources/query/builder.js +0 -591
- 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 -367
- 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 -74
- package/esm2015/lib/resources/types/singleton.js +0 -167
- package/esm2015/lib/resources/types/value.js +0 -35
- package/esm2015/lib/schema/base.js +0 -37
- package/esm2015/lib/schema/callable.js +0 -82
- package/esm2015/lib/schema/entity-container.js +0 -24
- package/esm2015/lib/schema/entity-set.js +0 -35
- package/esm2015/lib/schema/enum-type.js +0 -102
- package/esm2015/lib/schema/parsers/callable.js +0 -107
- package/esm2015/lib/schema/parsers/enum-type.js +0 -107
- package/esm2015/lib/schema/parsers/structured-type.js +0 -392
- package/esm2015/lib/schema/schema.js +0 -52
- package/esm2015/lib/schema/structured-type.js +0 -220
- 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/fesm2015/angular-odata.js.map +0 -1
|
@@ -1,14 +1,17 @@
|
|
|
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 {
|
|
7
|
+
import { ODataEntities, ODataEntity } from '../responses/types';
|
|
8
|
+
import { ODataEntityResource } from './entity';
|
|
9
|
+
import { ODataEntitiesOptions, ODataEntityOptions, ODataOptions } from './options';
|
|
8
10
|
export declare class ODataReferenceResource<T> extends ODataResource<T> {
|
|
9
|
-
static factory<P>(api: ODataApi, segments
|
|
10
|
-
|
|
11
|
-
|
|
11
|
+
static factory<P>(api: ODataApi, { segments, query, }: {
|
|
12
|
+
segments: ODataPathSegments;
|
|
13
|
+
query?: ODataQueryOptions<P>;
|
|
14
|
+
}): ODataReferenceResource<P>;
|
|
12
15
|
protected post(target: ODataEntityResource<any>, options?: ODataOptions): Observable<any>;
|
|
13
16
|
protected put(target: ODataEntityResource<any>, options?: ODataOptions & {
|
|
14
17
|
etag?: string;
|
|
@@ -48,4 +51,34 @@ export declare class ODataReferenceResource<T> extends ODataResource<T> {
|
|
|
48
51
|
unset(options?: ODataOptions & {
|
|
49
52
|
etag?: string;
|
|
50
53
|
}): Observable<any>;
|
|
54
|
+
/**
|
|
55
|
+
* Fetch entity / entities
|
|
56
|
+
* @param options Options for the request
|
|
57
|
+
* @return An observable of the entity or entities with annotations
|
|
58
|
+
*/
|
|
59
|
+
fetch(options?: ODataEntityOptions & {
|
|
60
|
+
etag?: string;
|
|
61
|
+
bodyQueryOptions?: QueryOptionNames[];
|
|
62
|
+
}): Observable<ODataEntity<T>>;
|
|
63
|
+
fetch(options?: ODataEntitiesOptions & {
|
|
64
|
+
etag?: string;
|
|
65
|
+
bodyQueryOptions?: QueryOptionNames[];
|
|
66
|
+
}): Observable<ODataEntities<T>>;
|
|
67
|
+
/**
|
|
68
|
+
* Fetch the entity
|
|
69
|
+
* @param options Options for the request
|
|
70
|
+
* @returns The entity
|
|
71
|
+
*/
|
|
72
|
+
fetchEntity(options?: ODataOptions & {
|
|
73
|
+
etag?: string;
|
|
74
|
+
bodyQueryOptions?: QueryOptionNames[];
|
|
75
|
+
}): Observable<T | null>;
|
|
76
|
+
/**
|
|
77
|
+
* Fetch entities
|
|
78
|
+
* @param options Options for the request
|
|
79
|
+
* @returns The entities
|
|
80
|
+
*/
|
|
81
|
+
fetchEntities(options?: ODataOptions & {
|
|
82
|
+
bodyQueryOptions?: QueryOptionNames[];
|
|
83
|
+
}): Observable<T[] | null>;
|
|
51
84
|
}
|
|
@@ -1,26 +1,22 @@
|
|
|
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<
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}, { annots, reset }?: {
|
|
21
|
-
annots?: ODataEntityAnnotations;
|
|
22
|
-
reset?: boolean;
|
|
23
|
-
}): M;
|
|
15
|
+
static factory<S>(api: ODataApi, { path, schema, query, }: {
|
|
16
|
+
path: string;
|
|
17
|
+
schema?: ODataStructuredType<S>;
|
|
18
|
+
query?: ODataQueryOptions<S>;
|
|
19
|
+
}): ODataSingletonResource<S>;
|
|
24
20
|
key(value: any): ODataSingletonResource<T>;
|
|
25
21
|
keys(values: any[]): ODataSingletonResource<T>;
|
|
26
22
|
navigationProperty<N>(path: string): ODataNavigationPropertyResource<N>;
|
|
@@ -1,13 +1,17 @@
|
|
|
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
|
-
|
|
10
|
-
|
|
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>;
|
|
11
15
|
protected get(options?: ODataOptions): Observable<T>;
|
|
12
16
|
/**
|
|
13
17
|
* Fetch the value of the resource.
|
|
File without changes
|
package/lib/schema/callable.d.ts
CHANGED
|
@@ -1,30 +1,14 @@
|
|
|
1
1
|
import { CallableConfig, Options, Parser } from '../types';
|
|
2
|
+
import { ODataSchemaElement } from './element';
|
|
2
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;
|
|
@@ -0,0 +1,39 @@
|
|
|
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 sub type 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
|
+
}
|
|
@@ -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 extends
|
|
6
|
-
schema: ODataSchema;
|
|
7
|
-
name: string;
|
|
5
|
+
export declare class ODataEntityContainer extends ODataSchemaElement {
|
|
8
6
|
entitySets: ODataEntitySet[];
|
|
9
7
|
constructor(config: EntityContainerConfig, schema: ODataSchema);
|
|
10
|
-
get api(): import("angular-odata").ODataApi;
|
|
11
|
-
/**
|
|
12
|
-
* Create a nicer looking title.
|
|
13
|
-
* Titleize is meant for creating pretty output.
|
|
14
|
-
* @param term The term of the annotation to find.
|
|
15
|
-
* @returns The titleized string.
|
|
16
|
-
*/
|
|
17
|
-
titelize(term: string | RegExp): string;
|
|
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 extends
|
|
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
9
|
constructor(config: EntitySetConfig, schema: ODataSchema);
|
|
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
|
-
titelize(term: string | RegExp): string;
|
|
19
|
-
/**
|
|
20
|
-
* Returns a boolean indicating if the entity set is of the given type.
|
|
21
|
-
* @param type String representation of the type
|
|
22
|
-
* @returns True if the callable is type of the given type
|
|
23
|
-
*/
|
|
24
|
-
isTypeOf(type: string): boolean;
|
|
25
|
-
get api(): import("angular-odata").ODataApi;
|
|
26
10
|
}
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { EnumTypeConfig, Options } from '../types';
|
|
2
|
+
import { ODataSchemaElement } from './element';
|
|
2
3
|
import { ODataEnumTypeFieldParser, ODataEnumTypeParser } from './parsers';
|
|
3
|
-
import { ODataAnnotatable } from './base';
|
|
4
4
|
import { ODataSchema } from './schema';
|
|
5
|
-
export declare class ODataEnumType<E> extends
|
|
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;
|
|
@@ -12,28 +10,6 @@ export declare class ODataEnumType<E> extends ODataAnnotatable {
|
|
|
12
10
|
[value: number]: string;
|
|
13
11
|
};
|
|
14
12
|
constructor(config: EnumTypeConfig<E>, schema: ODataSchema);
|
|
15
|
-
/**
|
|
16
|
-
* Create a nicer looking title.
|
|
17
|
-
* Titleize is meant for creating pretty output.
|
|
18
|
-
* @param term The term of the annotation to find.
|
|
19
|
-
* @returns The titleized string.
|
|
20
|
-
*/
|
|
21
|
-
titelize(term: string | RegExp): string;
|
|
22
|
-
/**
|
|
23
|
-
* Returns a full type of the enum type including the namespace/alias.
|
|
24
|
-
* @param alias Use the alias of the namespace instead of the namespace.
|
|
25
|
-
* @returns The string representation of the type.
|
|
26
|
-
*/
|
|
27
|
-
type({ alias }?: {
|
|
28
|
-
alias?: boolean;
|
|
29
|
-
}): string;
|
|
30
|
-
/**
|
|
31
|
-
* Returns a boolean indicating if the enum type is of the given type.
|
|
32
|
-
* @param type String representation of the type
|
|
33
|
-
* @returns True if the callable is type of the given type
|
|
34
|
-
*/
|
|
35
|
-
isTypeOf(type: string): boolean;
|
|
36
|
-
get api(): import("angular-odata").ODataApi;
|
|
37
13
|
configure(): void;
|
|
38
14
|
/**
|
|
39
15
|
* Returns the fields of the enum type.
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { EnumTypeConfig, EnumTypeFieldConfig, Options, OptionsHelper, Parser } from '../../types';
|
|
2
|
+
import { ODataAnnotatable } from '../annotation';
|
|
3
3
|
export declare class ODataEnumTypeFieldParser extends ODataAnnotatable {
|
|
4
4
|
name: string;
|
|
5
5
|
value: number;
|
|
6
6
|
constructor(name: string, field: EnumTypeFieldConfig);
|
|
7
|
-
titleize(term
|
|
7
|
+
titleize(term?: string | RegExp): string;
|
|
8
8
|
}
|
|
9
9
|
export declare class ODataEnumTypeParser<T> extends ODataAnnotatable implements Parser<T> {
|
|
10
10
|
name: string;
|
|
@@ -25,7 +25,7 @@ export declare class ODataEnumTypeParser<T> extends ODataAnnotatable implements
|
|
|
25
25
|
* @param term The term of the annotation to find.
|
|
26
26
|
* @returns The titleized string.
|
|
27
27
|
*/
|
|
28
|
-
|
|
28
|
+
ttitelize(term?: string | RegExp): string;
|
|
29
29
|
configure({ options }: {
|
|
30
30
|
options: OptionsHelper;
|
|
31
31
|
}): void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Options, OptionsHelper, Parser, StructuredTypeConfig, StructuredTypeFieldConfig } from '../../types';
|
|
2
|
+
import { ODataAnnotatable } from '../annotation';
|
|
2
3
|
import { ODataEnumTypeParser } from './enum-type';
|
|
3
|
-
import { ODataAnnotatable } from '../base';
|
|
4
4
|
declare type JsonSchemaSelect<T> = Array<keyof T>;
|
|
5
5
|
declare type JsonSchemaCustom<T> = {
|
|
6
6
|
[P in keyof T]?: (schema: any, field: ODataStructuredTypeFieldParser<T[P]>) => any;
|
|
@@ -92,9 +92,9 @@ export declare class ODataStructuredTypeParser<T> extends ODataAnnotatable imple
|
|
|
92
92
|
* @param term The term of the annotation to find.
|
|
93
93
|
* @returns The titleized string.
|
|
94
94
|
*/
|
|
95
|
-
|
|
95
|
+
titleize(term?: string | RegExp): string;
|
|
96
96
|
isTypeOf(type: string): boolean;
|
|
97
|
-
|
|
97
|
+
isSubtypeOf(type: string): boolean;
|
|
98
98
|
findChildParser(predicate: (p: ODataStructuredTypeParser<any>) => boolean): ODataStructuredTypeParser<any> | undefined;
|
|
99
99
|
childParser(predicate: (p: ODataStructuredTypeParser<any>) => boolean): Parser<any>;
|
|
100
100
|
deserialize(value: any, options?: Options): T;
|
package/lib/schema/schema.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Parser, SchemaConfig } from '../types';
|
|
2
|
-
import { ODataAnnotatable } from './base';
|
|
3
1
|
import { ODataApi } from '../api';
|
|
2
|
+
import { Parser, SchemaConfig } from '../types';
|
|
3
|
+
import { ODataAnnotatable } from './annotation';
|
|
4
4
|
import { ODataCallable } from './callable';
|
|
5
5
|
import { ODataEntityContainer } from './entity-container';
|
|
6
6
|
import { ODataEntitySet } from './entity-set';
|
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
import { JsonSchemaOptions, ODataEntityTypeKey, ODataStructuredTypeFieldParser, ODataStructuredTypeParser } from './parsers';
|
|
2
|
-
import { Options, StructuredTypeConfig } from '../types';
|
|
3
|
-
import { ODataAnnotatable } from './base';
|
|
4
1
|
import { ODataCollection } from '../models';
|
|
5
2
|
import { ODataModel } from '../models/model';
|
|
3
|
+
import { Options, StructuredTypeConfig } from '../types';
|
|
4
|
+
import { ODataSchemaElement } from './element';
|
|
5
|
+
import { JsonSchemaOptions, ODataEntityTypeKey, ODataStructuredTypeFieldParser, ODataStructuredTypeParser } from './parsers';
|
|
6
6
|
import { ODataSchema } from './schema';
|
|
7
|
-
export declare class ODataStructuredType<T> extends
|
|
8
|
-
name: string;
|
|
9
|
-
schema: ODataSchema;
|
|
7
|
+
export declare class ODataStructuredType<T> extends ODataSchemaElement {
|
|
10
8
|
base?: string;
|
|
11
9
|
open: boolean;
|
|
12
10
|
parent?: ODataStructuredType<any>;
|
|
@@ -15,32 +13,16 @@ export declare class ODataStructuredType<T> extends ODataAnnotatable {
|
|
|
15
13
|
collection?: typeof ODataCollection;
|
|
16
14
|
parser: ODataStructuredTypeParser<T>;
|
|
17
15
|
constructor(config: StructuredTypeConfig<T>, schema: ODataSchema);
|
|
18
|
-
get api(): import("angular-odata").ODataApi;
|
|
19
16
|
configure({ parserForType, findOptionsForType, }: {
|
|
20
17
|
parserForType: (type: string) => any;
|
|
21
18
|
findOptionsForType: (type: string) => any;
|
|
22
19
|
}): void;
|
|
23
20
|
/**
|
|
24
|
-
*
|
|
25
|
-
* Titleize is meant for creating pretty output.
|
|
26
|
-
* @param term The term of the annotation to find.
|
|
27
|
-
* @returns The titleized string.
|
|
28
|
-
*/
|
|
29
|
-
titelize(term: string | RegExp): string;
|
|
30
|
-
/**
|
|
31
|
-
* Returns a full type of the structured type including the namespace/alias.
|
|
32
|
-
* @param alias Use the alias of the namespace instead of the namespace.
|
|
33
|
-
* @returns The string representation of the type.
|
|
34
|
-
*/
|
|
35
|
-
type({ alias }?: {
|
|
36
|
-
alias?: boolean;
|
|
37
|
-
}): string;
|
|
38
|
-
/**
|
|
39
|
-
* Returns a boolean indicating if the structured type is of the given type.
|
|
21
|
+
* Returns a boolean indicating if the structured type is a sub type of the given type.
|
|
40
22
|
* @param type String representation of the type
|
|
41
23
|
* @returns True if the callable is type of the given type
|
|
42
24
|
*/
|
|
43
|
-
|
|
25
|
+
isSubtypeOf(schema: ODataStructuredType<any>): boolean;
|
|
44
26
|
/**
|
|
45
27
|
* Returns a boolean indicating if the structured type has a simple key.
|
|
46
28
|
* @returns True if the structured type has a simple key
|
|
@@ -56,7 +38,7 @@ export declare class ODataStructuredType<T> extends ODataAnnotatable {
|
|
|
56
38
|
* @param name Name of the field
|
|
57
39
|
* @returns The field parser
|
|
58
40
|
*/
|
|
59
|
-
findFieldByName<F>(name: keyof T): ODataStructuredTypeFieldParser<F
|
|
41
|
+
findFieldByName<F>(name: keyof T): ODataStructuredTypeFieldParser<F> | undefined;
|
|
60
42
|
/**
|
|
61
43
|
* Find a parent schema of the structured type.
|
|
62
44
|
* @param predicate Function for evaluate the schemas in the hierarchy.
|
|
@@ -68,7 +50,7 @@ export declare class ODataStructuredType<T> extends ODataAnnotatable {
|
|
|
68
50
|
* @param field Field that belongs to the structured type
|
|
69
51
|
* @returns The schema of the field
|
|
70
52
|
*/
|
|
71
|
-
findSchemaForField(field: ODataStructuredTypeFieldParser<any>): ODataStructuredType<
|
|
53
|
+
findSchemaForField<E>(field: ODataStructuredTypeFieldParser<any>): ODataStructuredType<E>;
|
|
72
54
|
/**
|
|
73
55
|
* Returns all fields of the structured type.
|
|
74
56
|
* @param include_navigation Include navigation properties in the result.
|
package/lib/services/base.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ODataActionResource, ODataEntities, ODataEntity, ODataFunctionResource, ODataNavigationPropertyResource, ODataProperty, ODataQueryArgumentsOptions } from '../resources';
|
|
2
|
-
import { ODataClient } from '../client';
|
|
3
1
|
import { Observable } from 'rxjs';
|
|
2
|
+
import { ODataClient } from '../client';
|
|
3
|
+
import { ODataActionResource, ODataEntities, ODataEntity, ODataFunctionResource, ODataNavigationPropertyResource, ODataProperty, ODataQueryArgumentsOptions } from '../resources';
|
|
4
4
|
export declare abstract class ODataBaseService {
|
|
5
5
|
protected client: ODataClient;
|
|
6
6
|
protected name: string;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { EntityKey, ODataEntities, ODataEntity, ODataEntityResource, ODataEntitySetResource, ODataOptions } from '../resources';
|
|
2
1
|
import { Observable } from 'rxjs';
|
|
3
2
|
import { ODataCollection } from '../models/collection';
|
|
4
|
-
import { ODataEntityService } from './entity';
|
|
5
3
|
import { ODataModel } from '../models/model';
|
|
4
|
+
import { EntityKey, ODataEntities, ODataEntity, ODataEntityResource, ODataEntitySetResource, ODataOptions } from '../resources';
|
|
5
|
+
import { ODataEntityService } from './entity';
|
|
6
6
|
export declare class ODataEntitySetService<T> extends ODataEntityService<T> {
|
|
7
7
|
/**
|
|
8
8
|
* Get the entity set resource for this service.
|
package/lib/services/entity.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { ODataModel } from '../models/model';
|
|
1
2
|
import { EntityKey, ODataResource } from '../resources';
|
|
2
3
|
import { ODataBaseService } from './base';
|
|
3
|
-
import { ODataModel } from '../models/model';
|
|
4
4
|
export declare abstract class ODataEntityService<T> extends ODataBaseService {
|
|
5
5
|
abstract entity(key?: EntityKey<T>): ODataResource<T>;
|
|
6
6
|
abstract attach<M extends ODataModel<T>>(value: M): void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { Observable } from 'rxjs';
|
|
2
|
+
import type { ODataModel } from '../models/model';
|
|
1
3
|
import type { ODataEntity, ODataOptions, ODataSingletonResource } from '../resources';
|
|
2
4
|
import { ODataEntityService } from './entity';
|
|
3
|
-
import type { ODataModel } from '../models/model';
|
|
4
|
-
import { Observable } from 'rxjs';
|
|
5
5
|
/**
|
|
6
6
|
* OData Singleton Service
|
|
7
7
|
* www.odata.org/getting-started/advanced-tutorial/#singleton
|
package/lib/settings.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ODataCallable, ODataEntitySet, ODataEnumType, ODataStructuredType } from './schema';
|
|
3
|
-
import { ODataCollection, ODataModel } from './models';
|
|
1
|
+
import { Observable } from 'rxjs';
|
|
4
2
|
import { ODataApi } from './api';
|
|
5
|
-
import {
|
|
3
|
+
import { ODataCollection, ODataModel } from './models';
|
|
6
4
|
import { ODataRequest } from './resources';
|
|
7
|
-
import {
|
|
5
|
+
import { ODataCallable, ODataEntitySet, ODataEnumType, ODataStructuredType } from './schema';
|
|
6
|
+
import { ODataEntityService } from './services/entity';
|
|
7
|
+
import { ApiConfig, Parser } from './types';
|
|
8
8
|
export declare class ODataSettings {
|
|
9
9
|
apis: ODataApi[];
|
|
10
10
|
constructor(...configs: ApiConfig[]);
|
package/lib/types.d.ts
CHANGED
|
@@ -63,6 +63,7 @@ export interface ApiOptions extends Options {
|
|
|
63
63
|
stripMetadata?: ODataMetadataType;
|
|
64
64
|
fetchPolicy?: FetchPolicy;
|
|
65
65
|
bodyQueryOptions?: QueryOptionNames[];
|
|
66
|
+
deleteRefBy?: 'path' | 'id';
|
|
66
67
|
}
|
|
67
68
|
export interface OptionsHelper extends Options {
|
|
68
69
|
helper: ODataVersionHelper;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "angular-odata",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.95.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Client side OData typescript library for Angular",
|
|
6
6
|
"repository": {
|
|
@@ -25,17 +25,30 @@
|
|
|
25
25
|
"homepage": "https://github.com/diegomvh/angular-odata",
|
|
26
26
|
"private": false,
|
|
27
27
|
"peerDependencies": {
|
|
28
|
-
"@angular/common": "^
|
|
29
|
-
"@angular/core": "^
|
|
28
|
+
"@angular/common": "^13.1.0",
|
|
29
|
+
"@angular/core": "^13.1.0"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"tslib": "^2.3.0"
|
|
33
33
|
},
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"fesm2015": "fesm2015/angular-odata.
|
|
34
|
+
"module": "fesm2015/angular-odata.mjs",
|
|
35
|
+
"es2020": "fesm2020/angular-odata.mjs",
|
|
36
|
+
"esm2020": "esm2020/angular-odata.mjs",
|
|
37
|
+
"fesm2020": "fesm2020/angular-odata.mjs",
|
|
38
|
+
"fesm2015": "fesm2015/angular-odata.mjs",
|
|
39
39
|
"typings": "angular-odata.d.ts",
|
|
40
|
+
"exports": {
|
|
41
|
+
"./package.json": {
|
|
42
|
+
"default": "./package.json"
|
|
43
|
+
},
|
|
44
|
+
".": {
|
|
45
|
+
"types": "./angular-odata.d.ts",
|
|
46
|
+
"esm2020": "./esm2020/angular-odata.mjs",
|
|
47
|
+
"es2020": "./fesm2020/angular-odata.mjs",
|
|
48
|
+
"es2015": "./fesm2015/angular-odata.mjs",
|
|
49
|
+
"node": "./fesm2015/angular-odata.mjs",
|
|
50
|
+
"default": "./fesm2020/angular-odata.mjs"
|
|
51
|
+
}
|
|
52
|
+
},
|
|
40
53
|
"sideEffects": false
|
|
41
54
|
}
|