angular-odata 0.128.0 → 0.131.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +27 -244
- package/fesm2022/angular-odata.mjs +2320 -1118
- package/fesm2022/angular-odata.mjs.map +1 -1
- package/lib/api.d.ts +10 -11
- package/lib/cache/cache.d.ts +2 -2
- package/lib/cache/memory.d.ts +2 -2
- package/lib/cache/storage.d.ts +2 -2
- package/lib/index.d.ts +1 -0
- package/lib/loaders.d.ts +8 -8
- package/lib/metadata/csdl/csdl-annotation.d.ts +62 -26
- package/lib/metadata/csdl/csdl-entity-container.d.ts +8 -3
- package/lib/metadata/csdl/csdl-entity-set.d.ts +7 -2
- package/lib/metadata/csdl/csdl-enum-type.d.ts +11 -3
- package/lib/metadata/csdl/csdl-function-action.d.ts +54 -11
- package/lib/metadata/csdl/csdl-navigation-property-binding.d.ts +4 -0
- package/lib/metadata/csdl/csdl-reference.d.ts +26 -3
- package/lib/metadata/csdl/csdl-schema.d.ts +5 -2
- package/lib/metadata/csdl/csdl-singleton.d.ts +5 -0
- package/lib/metadata/csdl/csdl-structural-property.d.ts +19 -3
- package/lib/metadata/csdl/csdl-structured-type.d.ts +28 -7
- package/lib/metadata/csdl/csdl-type-definition.d.ts +3 -0
- package/lib/metadata/metadata.d.ts +16 -3
- package/lib/models/collection.d.ts +2 -1
- package/lib/models/model.d.ts +6 -5
- package/lib/models/options.d.ts +11 -4
- package/lib/module.d.ts +3 -3
- package/lib/options.d.ts +3 -3
- package/lib/resources/path/segments.d.ts +3 -3
- package/lib/resources/query/builder.d.ts +3 -2
- package/lib/resources/query/expressions/apply.d.ts +1 -1
- package/lib/resources/query/expressions/compute.d.ts +1 -1
- package/lib/resources/query/expressions/count.d.ts +1 -1
- package/lib/resources/query/expressions/expand.d.ts +5 -2
- package/lib/resources/query/expressions/filter.d.ts +2 -1
- package/lib/resources/query/expressions/orderby.d.ts +2 -1
- package/lib/resources/query/expressions/search.d.ts +2 -1
- package/lib/resources/query/expressions/select.d.ts +2 -1
- package/lib/resources/query/expressions/syntax.d.ts +2 -2
- package/lib/resources/query/handlers.d.ts +17 -5
- package/lib/resources/query/options.d.ts +3 -3
- package/lib/resources/resource.d.ts +36 -8
- package/lib/resources/types/action.d.ts +4 -4
- package/lib/resources/types/entity-set.d.ts +15 -8
- package/lib/resources/types/entity.d.ts +5 -1
- package/lib/resources/types/function.d.ts +4 -4
- package/lib/resources/types/navigation-property.d.ts +12 -3
- package/lib/resources/types/property.d.ts +14 -3
- package/lib/resources/types/singleton.d.ts +5 -1
- package/lib/schema/annotation.d.ts +3 -3
- package/lib/schema/callable.d.ts +3 -3
- package/lib/schema/element.d.ts +3 -3
- package/lib/schema/entity-container.d.ts +2 -2
- package/lib/schema/entity-set.d.ts +2 -2
- package/lib/schema/enum-type.d.ts +10 -10
- package/lib/schema/parsers/callable.d.ts +4 -4
- package/lib/schema/parsers/enum-type.d.ts +15 -15
- package/lib/schema/parsers/structured-type.d.ts +8 -5
- package/lib/schema/schema.d.ts +3 -3
- package/lib/schema/singleton.d.ts +2 -2
- package/lib/schema/structured-type.d.ts +7 -4
- package/lib/services/entity-set.d.ts +9 -6
- package/lib/services/entity.d.ts +1 -1
- package/lib/services/singleton.d.ts +1 -1
- package/lib/settings.d.ts +2 -2
- package/lib/types.d.ts +82 -69
- package/lib/utils/enums.d.ts +12 -12
- package/lib/utils/http.d.ts +1 -1
- package/lib/utils/objects.d.ts +1 -1
- package/lib/utils/odata.d.ts +2 -2
- package/lib/utils/strings.d.ts +2 -2
- package/package.json +3 -5
- package/schematics/apigen/angular/api-config.js +7 -1
- package/schematics/apigen/angular/api-config.js.map +1 -1
- package/schematics/apigen/angular/base.d.ts +22 -2
- package/schematics/apigen/angular/base.js +82 -42
- package/schematics/apigen/angular/base.js.map +1 -1
- package/schematics/apigen/angular/entity.js +7 -1
- package/schematics/apigen/angular/entity.js.map +1 -1
- package/schematics/apigen/angular/enum.js +1 -0
- package/schematics/apigen/angular/enum.js.map +1 -1
- package/schematics/apigen/angular/module.js.map +1 -1
- package/schematics/apigen/angular/service.js +3 -2
- package/schematics/apigen/angular/service.js.map +1 -1
- package/schematics/apigen/files/api-config/__fileName__.ts +8 -6
- package/schematics/apigen/files/entity/__fileName__.ts +2 -2
- package/schematics/apigen/files/entitycontainer-service/__fileName__.ts +1 -1
- package/schematics/apigen/files/entityset-service/__fileName__.ts +1 -1
- package/schematics/apigen/files/enum/__fileName__.ts +1 -1
- package/schematics/apigen/files/metadata/metadata.json +1 -0
- package/schematics/apigen/files/singleton-service/__fileName__.ts +1 -1
- package/schematics/apigen/index.js +56 -12
- package/schematics/apigen/index.js.map +1 -1
- package/schematics/apigen/metadata/csdl/csdl-annotation.d.ts +56 -23
- package/schematics/apigen/metadata/csdl/csdl-annotation.js +143 -13
- package/schematics/apigen/metadata/csdl/csdl-annotation.js.map +1 -1
- package/schematics/apigen/metadata/csdl/csdl-entity-container.d.ts +3 -0
- package/schematics/apigen/metadata/csdl/csdl-entity-container.js +19 -0
- package/schematics/apigen/metadata/csdl/csdl-entity-container.js.map +1 -1
- package/schematics/apigen/metadata/csdl/csdl-entity-set.d.ts +3 -0
- package/schematics/apigen/metadata/csdl/csdl-entity-set.js +11 -0
- package/schematics/apigen/metadata/csdl/csdl-entity-set.js.map +1 -1
- package/schematics/apigen/metadata/csdl/csdl-enum-type.d.ts +6 -0
- package/schematics/apigen/metadata/csdl/csdl-enum-type.js +17 -0
- package/schematics/apigen/metadata/csdl/csdl-enum-type.js.map +1 -1
- package/schematics/apigen/metadata/csdl/csdl-function-action.d.ts +37 -0
- package/schematics/apigen/metadata/csdl/csdl-function-action.js +52 -0
- package/schematics/apigen/metadata/csdl/csdl-function-action.js.map +1 -1
- package/schematics/apigen/metadata/csdl/csdl-navigation-property-binding.d.ts +4 -0
- package/schematics/apigen/metadata/csdl/csdl-navigation-property-binding.js +6 -0
- package/schematics/apigen/metadata/csdl/csdl-navigation-property-binding.js.map +1 -1
- package/schematics/apigen/metadata/csdl/csdl-reference.d.ts +15 -3
- package/schematics/apigen/metadata/csdl/csdl-reference.js +26 -2
- package/schematics/apigen/metadata/csdl/csdl-reference.js.map +1 -1
- package/schematics/apigen/metadata/csdl/csdl-schema.d.ts +3 -0
- package/schematics/apigen/metadata/csdl/csdl-schema.js +37 -0
- package/schematics/apigen/metadata/csdl/csdl-schema.js.map +1 -1
- package/schematics/apigen/metadata/csdl/csdl-singleton.d.ts +3 -0
- package/schematics/apigen/metadata/csdl/csdl-singleton.js +8 -0
- package/schematics/apigen/metadata/csdl/csdl-singleton.js.map +1 -1
- package/schematics/apigen/metadata/csdl/csdl-structural-property.d.ts +16 -0
- package/schematics/apigen/metadata/csdl/csdl-structural-property.js +53 -0
- package/schematics/apigen/metadata/csdl/csdl-structural-property.js.map +1 -1
- package/schematics/apigen/metadata/csdl/csdl-structured-type.d.ts +22 -3
- package/schematics/apigen/metadata/csdl/csdl-structured-type.js +47 -2
- package/schematics/apigen/metadata/csdl/csdl-structured-type.js.map +1 -1
- package/schematics/apigen/metadata/csdl/csdl-type-definition.d.ts +3 -0
- package/schematics/apigen/metadata/csdl/csdl-type-definition.js +19 -0
- package/schematics/apigen/metadata/csdl/csdl-type-definition.js.map +1 -1
- package/schematics/apigen/metadata/metadata.d.ts +10 -0
- package/schematics/apigen/metadata/metadata.js +12 -6
- package/schematics/apigen/metadata/metadata.js.map +1 -1
- package/schematics/apigen/metadata/parser.js.map +1 -1
- package/schematics/apigen/schema.d.ts +2 -1
- package/schematics/apigen/schema.json +15 -14
- package/schematics/apigen/utils.d.ts +1 -0
- package/schematics/apigen/utils.js +25 -1
- package/schematics/apigen/utils.js.map +1 -1
- package/schematics/ng-add/index.js +1 -2
- package/schematics/ng-add/index.js.map +1 -1
- package/esm2022/angular-odata.mjs +0 -5
- package/esm2022/lib/annotations.mjs +0 -140
- package/esm2022/lib/api.mjs +0 -419
- package/esm2022/lib/cache/cache.mjs +0 -175
- package/esm2022/lib/cache/index.mjs +0 -4
- package/esm2022/lib/cache/memory.mjs +0 -30
- package/esm2022/lib/cache/storage.mjs +0 -55
- package/esm2022/lib/client.mjs +0 -212
- package/esm2022/lib/constants.mjs +0 -95
- package/esm2022/lib/helper.mjs +0 -280
- package/esm2022/lib/index.mjs +0 -21
- package/esm2022/lib/loaders.mjs +0 -39
- package/esm2022/lib/metadata/csdl/csdl-annotation.mjs +0 -95
- package/esm2022/lib/metadata/csdl/csdl-entity-container.mjs +0 -27
- package/esm2022/lib/metadata/csdl/csdl-entity-set.mjs +0 -24
- package/esm2022/lib/metadata/csdl/csdl-enum-type.mjs +0 -37
- package/esm2022/lib/metadata/csdl/csdl-function-action.mjs +0 -94
- package/esm2022/lib/metadata/csdl/csdl-navigation-property-binding.mjs +0 -7
- package/esm2022/lib/metadata/csdl/csdl-reference.mjs +0 -23
- package/esm2022/lib/metadata/csdl/csdl-schema.mjs +0 -39
- package/esm2022/lib/metadata/csdl/csdl-singleton.mjs +0 -15
- package/esm2022/lib/metadata/csdl/csdl-structural-property.mjs +0 -70
- package/esm2022/lib/metadata/csdl/csdl-structured-type.mjs +0 -92
- package/esm2022/lib/metadata/csdl/csdl-type-definition.mjs +0 -15
- package/esm2022/lib/metadata/index.mjs +0 -3
- package/esm2022/lib/metadata/metadata.mjs +0 -14
- package/esm2022/lib/metadata/parser.mjs +0 -563
- package/esm2022/lib/models/collection.mjs +0 -814
- package/esm2022/lib/models/index.mjs +0 -4
- package/esm2022/lib/models/model.mjs +0 -553
- package/esm2022/lib/models/options.mjs +0 -1179
- package/esm2022/lib/module.mjs +0 -55
- package/esm2022/lib/options.mjs +0 -36
- package/esm2022/lib/resources/index.mjs +0 -7
- package/esm2022/lib/resources/options.mjs +0 -56
- package/esm2022/lib/resources/path/handlers.mjs +0 -79
- package/esm2022/lib/resources/path/index.mjs +0 -3
- package/esm2022/lib/resources/path/segments.mjs +0 -148
- package/esm2022/lib/resources/query/builder.mjs +0 -636
- package/esm2022/lib/resources/query/expressions/apply.mjs +0 -236
- package/esm2022/lib/resources/query/expressions/base.mjs +0 -25
- package/esm2022/lib/resources/query/expressions/compute.mjs +0 -54
- package/esm2022/lib/resources/query/expressions/count.mjs +0 -116
- package/esm2022/lib/resources/query/expressions/expand.mjs +0 -147
- package/esm2022/lib/resources/query/expressions/filter.mjs +0 -178
- package/esm2022/lib/resources/query/expressions/index.mjs +0 -10
- package/esm2022/lib/resources/query/expressions/orderby.mjs +0 -79
- package/esm2022/lib/resources/query/expressions/search.mjs +0 -141
- package/esm2022/lib/resources/query/expressions/select.mjs +0 -47
- package/esm2022/lib/resources/query/expressions/syntax.mjs +0 -751
- package/esm2022/lib/resources/query/handlers.mjs +0 -420
- package/esm2022/lib/resources/query/index.mjs +0 -5
- package/esm2022/lib/resources/query/options.mjs +0 -139
- package/esm2022/lib/resources/request.mjs +0 -196
- package/esm2022/lib/resources/resource.mjs +0 -311
- package/esm2022/lib/resources/response.mjs +0 -174
- package/esm2022/lib/resources/types/action.mjs +0 -116
- package/esm2022/lib/resources/types/batch.mjs +0 -428
- package/esm2022/lib/resources/types/count.mjs +0 -33
- package/esm2022/lib/resources/types/entity-set.mjs +0 -131
- package/esm2022/lib/resources/types/entity.mjs +0 -112
- package/esm2022/lib/resources/types/function.mjs +0 -146
- package/esm2022/lib/resources/types/index.mjs +0 -15
- package/esm2022/lib/resources/types/media.mjs +0 -44
- package/esm2022/lib/resources/types/metadata.mjs +0 -35
- package/esm2022/lib/resources/types/navigation-property.mjs +0 -256
- package/esm2022/lib/resources/types/options.mjs +0 -2
- package/esm2022/lib/resources/types/property.mjs +0 -197
- package/esm2022/lib/resources/types/reference.mjs +0 -87
- package/esm2022/lib/resources/types/singleton.mjs +0 -130
- package/esm2022/lib/resources/types/value.mjs +0 -48
- package/esm2022/lib/schema/annotation.mjs +0 -37
- package/esm2022/lib/schema/callable.mjs +0 -66
- package/esm2022/lib/schema/element.mjs +0 -67
- package/esm2022/lib/schema/entity-container.mjs +0 -11
- package/esm2022/lib/schema/entity-set.mjs +0 -9
- package/esm2022/lib/schema/enum-type.mjs +0 -68
- package/esm2022/lib/schema/index.mjs +0 -9
- package/esm2022/lib/schema/parsers/callable.mjs +0 -110
- package/esm2022/lib/schema/parsers/edm.mjs +0 -101
- package/esm2022/lib/schema/parsers/enum-type.mjs +0 -130
- package/esm2022/lib/schema/parsers/index.mjs +0 -5
- package/esm2022/lib/schema/parsers/structured-type.mjs +0 -514
- package/esm2022/lib/schema/schema.mjs +0 -45
- package/esm2022/lib/schema/singleton.mjs +0 -9
- package/esm2022/lib/schema/structured-type.mjs +0 -213
- package/esm2022/lib/services/base.mjs +0 -29
- package/esm2022/lib/services/entity-set.mjs +0 -155
- package/esm2022/lib/services/entity.mjs +0 -12
- package/esm2022/lib/services/factory.mjs +0 -44
- package/esm2022/lib/services/index.mjs +0 -5
- package/esm2022/lib/services/singleton.mjs +0 -54
- package/esm2022/lib/settings.mjs +0 -112
- package/esm2022/lib/types.mjs +0 -118
- package/esm2022/lib/utils/arraybuffers.mjs +0 -46
- package/esm2022/lib/utils/arrays.mjs +0 -10
- package/esm2022/lib/utils/dates.mjs +0 -18
- package/esm2022/lib/utils/durations.mjs +0 -40
- package/esm2022/lib/utils/enums.mjs +0 -61
- package/esm2022/lib/utils/http.mjs +0 -95
- package/esm2022/lib/utils/index.mjs +0 -10
- package/esm2022/lib/utils/objects.mjs +0 -204
- package/esm2022/lib/utils/odata.mjs +0 -22
- package/esm2022/lib/utils/strings.mjs +0 -20
- package/esm2022/lib/utils/types.mjs +0 -136
- package/esm2022/lib/utils/urls.mjs +0 -24
- package/esm2022/public-api.mjs +0 -5
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Observable } from 'rxjs';
|
|
2
2
|
import { ODataApi } from '../../api';
|
|
3
|
-
import { ODataCollection, ODataModel } from '../../models';
|
|
4
|
-
import { QueryOption,
|
|
3
|
+
import type { ModelInterface, ODataCollection, ODataModel } from '../../models';
|
|
4
|
+
import { QueryOption, ODataStructuredTypeFieldConfig } from '../../types';
|
|
5
5
|
import { ApplyExpression, ApplyExpressionBuilder, ODataQueryOptions } from '../query';
|
|
6
6
|
import { ODataResource } from '../resource';
|
|
7
7
|
import { ODataActionResource } from './action';
|
|
@@ -10,7 +10,6 @@ import { ODataEntityResource } from './entity';
|
|
|
10
10
|
import { ODataFunctionResource } from './function';
|
|
11
11
|
import { ODataOptions } from './options';
|
|
12
12
|
import { ODataEntities, ODataEntity } from '../response';
|
|
13
|
-
import { ODataEntitiesAnnotations } from '../../annotations';
|
|
14
13
|
export declare class ODataEntitySetResource<T> extends ODataResource<T> {
|
|
15
14
|
static factory<E>(api: ODataApi, { path, type, query, }: {
|
|
16
15
|
path: string;
|
|
@@ -21,7 +20,7 @@ export declare class ODataEntitySetResource<T> extends ODataResource<T> {
|
|
|
21
20
|
transform<R>(opts: (builder: ApplyExpressionBuilder<T>, current?: ApplyExpression<T>) => ApplyExpression<T>, { type, fields, }?: {
|
|
22
21
|
type?: string;
|
|
23
22
|
fields?: {
|
|
24
|
-
[
|
|
23
|
+
[name: string]: ODataStructuredTypeFieldConfig;
|
|
25
24
|
};
|
|
26
25
|
}): ODataEntitySetResource<R>;
|
|
27
26
|
entity(key?: any): ODataEntityResource<T>;
|
|
@@ -43,27 +42,35 @@ export declare class ODataEntitySetResource<T> extends ODataResource<T> {
|
|
|
43
42
|
withCount?: boolean;
|
|
44
43
|
bodyQueryOptions?: QueryOption[];
|
|
45
44
|
}): Observable<{
|
|
46
|
-
entities:
|
|
47
|
-
annots: ODataEntitiesAnnotations<
|
|
45
|
+
entities: any[];
|
|
46
|
+
annots: import("angular-odata").ODataEntitiesAnnotations<any>;
|
|
48
47
|
}>;
|
|
49
48
|
fetchMany(top: number, options?: ODataOptions & {
|
|
50
49
|
withCount?: boolean;
|
|
51
50
|
bodyQueryOptions?: QueryOption[];
|
|
52
51
|
}): Observable<{
|
|
53
52
|
entities: T[];
|
|
54
|
-
annots: ODataEntitiesAnnotations<T>;
|
|
53
|
+
annots: import("angular-odata").ODataEntitiesAnnotations<T>;
|
|
54
|
+
} | {
|
|
55
|
+
entities: T[];
|
|
56
|
+
annots: import("angular-odata").ODataEntitiesAnnotations<any>;
|
|
55
57
|
}>;
|
|
56
58
|
fetchOne(options?: ODataOptions & {
|
|
57
59
|
withCount?: boolean;
|
|
58
60
|
bodyQueryOptions?: QueryOption[];
|
|
59
61
|
}): Observable<{
|
|
60
62
|
entity: T | null;
|
|
61
|
-
annots: ODataEntitiesAnnotations<T>;
|
|
63
|
+
annots: import("angular-odata").ODataEntitiesAnnotations<T>;
|
|
62
64
|
}>;
|
|
63
65
|
fetchEntities(options?: ODataOptions & {
|
|
64
66
|
withCount?: boolean;
|
|
65
67
|
bodyQueryOptions?: QueryOption[];
|
|
66
68
|
}): Observable<T[] | null>;
|
|
69
|
+
fetchCollection(options?: ODataOptions & {
|
|
70
|
+
withCount?: boolean;
|
|
71
|
+
bodyQueryOptions?: QueryOption[];
|
|
72
|
+
CollectionType?: typeof ODataCollection;
|
|
73
|
+
}): Observable<ODataCollection<T, ODataModel<T> & ModelInterface<T>> | null>;
|
|
67
74
|
fetchCollection<M extends ODataModel<T>, C extends ODataCollection<T, M>>(options?: ODataOptions & {
|
|
68
75
|
withCount?: boolean;
|
|
69
76
|
bodyQueryOptions?: QueryOption[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Observable } from 'rxjs';
|
|
2
2
|
import { ODataApi } from '../../api';
|
|
3
|
-
import { ODataModel } from '../../models';
|
|
3
|
+
import { ModelInterface, ODataModel } from '../../models';
|
|
4
4
|
import { QueryOption } from '../../types';
|
|
5
5
|
import { ODataPathSegments } from '../path';
|
|
6
6
|
import { ODataQueryOptions } from '../query';
|
|
@@ -43,6 +43,10 @@ export declare class ODataEntityResource<T> extends ODataResource<T> {
|
|
|
43
43
|
fetchEntity(options?: ODataOptions & {
|
|
44
44
|
bodyQueryOptions?: QueryOption[];
|
|
45
45
|
}): Observable<T | null>;
|
|
46
|
+
fetchModel(options?: ODataOptions & {
|
|
47
|
+
bodyQueryOptions?: QueryOption[];
|
|
48
|
+
ModelType?: typeof ODataModel;
|
|
49
|
+
}): Observable<(ODataModel<T> & ModelInterface<T>) | null>;
|
|
46
50
|
fetchModel<M extends ODataModel<T>>(options?: ODataOptions & {
|
|
47
51
|
bodyQueryOptions?: QueryOption[];
|
|
48
52
|
ModelType?: typeof ODataModel;
|
|
@@ -74,10 +74,10 @@ export declare class ODataFunctionResource<P, R> extends ODataResource<R> {
|
|
|
74
74
|
* @param options Options for the request
|
|
75
75
|
* @returns Observable of the result of the function
|
|
76
76
|
*/
|
|
77
|
-
callModel
|
|
77
|
+
callModel(params: P | null, { alias, ModelType, ...options }?: ODataOptions & {
|
|
78
78
|
alias?: boolean;
|
|
79
79
|
ModelType?: typeof ODataModel;
|
|
80
|
-
}): Observable<
|
|
80
|
+
}): Observable<(ODataModel<R> & import("angular-odata").ModelInterface<R>) | null>;
|
|
81
81
|
/**
|
|
82
82
|
* Execute the function with the given parameters and return the result as a entities
|
|
83
83
|
* @param params Parameters to be sent to the function
|
|
@@ -95,10 +95,10 @@ export declare class ODataFunctionResource<P, R> extends ODataResource<R> {
|
|
|
95
95
|
* @param options Options for the request
|
|
96
96
|
* @returns Observable of the result of the function
|
|
97
97
|
*/
|
|
98
|
-
callCollection
|
|
98
|
+
callCollection(params: P | null, { alias, CollectionType, ...options }?: {
|
|
99
99
|
alias?: boolean;
|
|
100
100
|
CollectionType?: typeof ODataCollection;
|
|
101
|
-
} & ODataOptions): Observable<
|
|
101
|
+
} & ODataOptions): Observable<ODataCollection<R, ODataModel<R> & import("angular-odata").ModelInterface<R>> | null>;
|
|
102
102
|
callArraybuffer(params: P | null, { alias, ...options }?: {
|
|
103
103
|
alias?: boolean;
|
|
104
104
|
} & ODataOptions): Observable<ArrayBuffer>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Observable } from 'rxjs';
|
|
2
2
|
import { ODataApi } from '../../api';
|
|
3
|
-
import { ODataCollection, ODataModel } from '../../models';
|
|
4
|
-
import { QueryOption,
|
|
3
|
+
import type { ModelInterface, ODataCollection, ODataModel } from '../../models';
|
|
4
|
+
import { QueryOption, ODataStructuredTypeFieldConfig } from '../../types';
|
|
5
5
|
import { ODataPathSegments } from '../path';
|
|
6
6
|
import { ApplyExpression, ApplyExpressionBuilder } from '../query';
|
|
7
7
|
import { ODataResource } from '../resource';
|
|
@@ -28,7 +28,7 @@ export declare class ODataNavigationPropertyResource<T> extends ODataResource<T>
|
|
|
28
28
|
transform<R>(opts: (builder: ApplyExpressionBuilder<T>, current?: ApplyExpression<T>) => ApplyExpression<T>, { type, fields, }?: {
|
|
29
29
|
type?: string;
|
|
30
30
|
fields?: {
|
|
31
|
-
[
|
|
31
|
+
[name: string]: ODataStructuredTypeFieldConfig;
|
|
32
32
|
};
|
|
33
33
|
}): ODataNavigationPropertyResource<R>;
|
|
34
34
|
key(value: any): ODataNavigationPropertyResource<T>;
|
|
@@ -97,6 +97,10 @@ export declare class ODataNavigationPropertyResource<T> extends ODataResource<T>
|
|
|
97
97
|
* @param options Options for the request
|
|
98
98
|
* @returns The model
|
|
99
99
|
*/
|
|
100
|
+
fetchModel(options?: ODataOptions & {
|
|
101
|
+
bodyQueryOptions?: QueryOption[];
|
|
102
|
+
ModelType?: typeof ODataModel;
|
|
103
|
+
}): Observable<(ODataModel<T> & ModelInterface<T>) | null>;
|
|
100
104
|
fetchModel<M extends ODataModel<T>>(options?: ODataOptions & {
|
|
101
105
|
bodyQueryOptions?: QueryOption[];
|
|
102
106
|
ModelType?: typeof ODataModel;
|
|
@@ -114,6 +118,11 @@ export declare class ODataNavigationPropertyResource<T> extends ODataResource<T>
|
|
|
114
118
|
* @param options Options for the request
|
|
115
119
|
* @returns The collection
|
|
116
120
|
*/
|
|
121
|
+
fetchCollection(options?: ODataOptions & {
|
|
122
|
+
withCount?: boolean;
|
|
123
|
+
bodyQueryOptions?: QueryOption[];
|
|
124
|
+
CollectionType?: typeof ODataCollection;
|
|
125
|
+
}): Observable<ODataCollection<T, ODataModel<T> & ModelInterface<T>> | null>;
|
|
117
126
|
fetchCollection<M extends ODataModel<T>, C extends ODataCollection<T, M>>(options?: ODataOptions & {
|
|
118
127
|
withCount?: boolean;
|
|
119
128
|
bodyQueryOptions?: QueryOption[];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Observable } from 'rxjs';
|
|
2
2
|
import { ODataApi } from '../../api';
|
|
3
|
-
import { ODataCollection, ODataModel } from '../../models';
|
|
4
|
-
import { QueryOption,
|
|
3
|
+
import type { ModelInterface, ODataCollection, ODataModel } from '../../models';
|
|
4
|
+
import { QueryOption, ODataStructuredTypeFieldConfig } from '../../types';
|
|
5
5
|
import { ODataPathSegments } from '../path';
|
|
6
6
|
import { ApplyExpression, ApplyExpressionBuilder } from '../query';
|
|
7
7
|
import { ODataResource } from '../resource';
|
|
@@ -21,7 +21,7 @@ export declare class ODataPropertyResource<T> extends ODataResource<T> {
|
|
|
21
21
|
transform<R>(opts: (builder: ApplyExpressionBuilder<T>, current?: ApplyExpression<T>) => ApplyExpression<T>, { type, fields, }?: {
|
|
22
22
|
type?: string;
|
|
23
23
|
fields?: {
|
|
24
|
-
[
|
|
24
|
+
[name: string]: ODataStructuredTypeFieldConfig;
|
|
25
25
|
};
|
|
26
26
|
}): ODataPropertyResource<R>;
|
|
27
27
|
key(value: any): ODataPropertyResource<T>;
|
|
@@ -55,7 +55,12 @@ export declare class ODataPropertyResource<T> extends ODataResource<T> {
|
|
|
55
55
|
* @param options Options for the request
|
|
56
56
|
* @returns The model
|
|
57
57
|
*/
|
|
58
|
+
fetchModel(options?: ODataOptions & {
|
|
59
|
+
bodyQueryOptions?: QueryOption[];
|
|
60
|
+
ModelType?: typeof ODataModel;
|
|
61
|
+
}): Observable<(ODataModel<T> & ModelInterface<T>) | null>;
|
|
58
62
|
fetchModel<M extends ODataModel<T>>(options?: ODataOptions & {
|
|
63
|
+
bodyQueryOptions?: QueryOption[];
|
|
59
64
|
ModelType?: typeof ODataModel;
|
|
60
65
|
}): Observable<M | null>;
|
|
61
66
|
/**
|
|
@@ -71,8 +76,14 @@ export declare class ODataPropertyResource<T> extends ODataResource<T> {
|
|
|
71
76
|
* @param options Options for the request
|
|
72
77
|
* @returns The collection
|
|
73
78
|
*/
|
|
79
|
+
fetchCollection(options?: ODataOptions & {
|
|
80
|
+
withCount?: boolean;
|
|
81
|
+
bodyQueryOptions?: QueryOption[];
|
|
82
|
+
CollectionType?: typeof ODataCollection;
|
|
83
|
+
}): Observable<ODataCollection<T, ODataModel<T> & ModelInterface<T>> | null>;
|
|
74
84
|
fetchCollection<M extends ODataModel<T>, C extends ODataCollection<T, M>>(options?: ODataOptions & {
|
|
75
85
|
withCount?: boolean;
|
|
86
|
+
bodyQueryOptions?: QueryOption[];
|
|
76
87
|
CollectionType?: typeof ODataCollection;
|
|
77
88
|
}): Observable<C | null>;
|
|
78
89
|
fetchOne(options?: ODataOptions & {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Observable } from 'rxjs';
|
|
2
2
|
import { ODataApi } from '../../api';
|
|
3
|
-
import { ODataModel } from '../../models';
|
|
3
|
+
import { ModelInterface, ODataModel } from '../../models';
|
|
4
4
|
import { QueryOption } from '../../types';
|
|
5
5
|
import { ODataResource } from '../resource';
|
|
6
6
|
import { ODataEntity } from '../response';
|
|
@@ -76,6 +76,10 @@ export declare class ODataSingletonResource<T> extends ODataResource<T> {
|
|
|
76
76
|
* @param options The options for the request.
|
|
77
77
|
* @returns Observable of the entity.
|
|
78
78
|
*/
|
|
79
|
+
fetchModel(options?: ODataOptions & {
|
|
80
|
+
bodyQueryOptions?: QueryOption[];
|
|
81
|
+
ModelType?: typeof ODataModel;
|
|
82
|
+
}): Observable<(ODataModel<T> & ModelInterface<T>) | null>;
|
|
79
83
|
fetchModel<M extends ODataModel<T>>(options?: ODataOptions & {
|
|
80
84
|
bodyQueryOptions?: QueryOption[];
|
|
81
85
|
ModelType?: typeof ODataModel;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ODataAnnotationConfig } from '../types';
|
|
2
2
|
export declare class ODataAnnotation {
|
|
3
3
|
term: string;
|
|
4
4
|
string?: string;
|
|
@@ -6,12 +6,12 @@ export declare class ODataAnnotation {
|
|
|
6
6
|
int?: number;
|
|
7
7
|
permissions?: string[];
|
|
8
8
|
properties?: string[];
|
|
9
|
-
constructor(annot:
|
|
9
|
+
constructor(annot: ODataAnnotationConfig);
|
|
10
10
|
}
|
|
11
11
|
export declare class ODataAnnotatable {
|
|
12
12
|
annotations: ODataAnnotation[];
|
|
13
13
|
constructor(config: {
|
|
14
|
-
annotations?:
|
|
14
|
+
annotations?: ODataAnnotationConfig[];
|
|
15
15
|
});
|
|
16
16
|
/**
|
|
17
17
|
* Find an annotation inside the annotatable.
|
package/lib/schema/callable.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ODataCallableConfig, ParserOptions } from '../types';
|
|
2
2
|
import { ODataParserSchemaElement } from './element';
|
|
3
3
|
import { ODataCallableParser } from './parsers';
|
|
4
4
|
import { ODataSchema } from './schema';
|
|
@@ -6,7 +6,7 @@ export declare class ODataCallable<R> extends ODataParserSchemaElement<R, ODataC
|
|
|
6
6
|
entitySetPath?: string;
|
|
7
7
|
bound?: boolean;
|
|
8
8
|
composable?: boolean;
|
|
9
|
-
constructor(config:
|
|
9
|
+
constructor(config: ODataCallableConfig, schema: ODataSchema);
|
|
10
10
|
path(): string;
|
|
11
11
|
configure({ options }: {
|
|
12
12
|
options: ParserOptions;
|
|
@@ -36,6 +36,6 @@ export declare class ODataCallable<R> extends ODataParserSchemaElement<R, ODataC
|
|
|
36
36
|
* Returns the binding parameter of the callable.
|
|
37
37
|
* @returns The binding parameter of the callable.
|
|
38
38
|
*/
|
|
39
|
-
binding(): import("
|
|
39
|
+
binding(): import("angular-odata").ODataParameterParser<any> | undefined;
|
|
40
40
|
returnType(): string | undefined;
|
|
41
41
|
}
|
package/lib/schema/element.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ODataAnnotationConfig, Parser } from '../types';
|
|
2
2
|
import { ODataAnnotatable } from './annotation';
|
|
3
3
|
import { ODataSchema } from './schema';
|
|
4
4
|
export declare class ODataSchemaElement extends ODataAnnotatable {
|
|
5
5
|
name: string;
|
|
6
6
|
schema: ODataSchema;
|
|
7
7
|
constructor(config: {
|
|
8
|
-
annotations?:
|
|
8
|
+
annotations?: ODataAnnotationConfig[];
|
|
9
9
|
name: string;
|
|
10
10
|
}, schema: ODataSchema);
|
|
11
11
|
get api(): import("angular-odata").ODataApi;
|
|
@@ -46,7 +46,7 @@ export declare class ODataSchemaElement extends ODataAnnotatable {
|
|
|
46
46
|
export declare class ODataParserSchemaElement<E, P extends Parser<E>> extends ODataSchemaElement {
|
|
47
47
|
parser: P;
|
|
48
48
|
constructor(config: {
|
|
49
|
-
annotations?:
|
|
49
|
+
annotations?: ODataAnnotationConfig[];
|
|
50
50
|
name: string;
|
|
51
51
|
}, schema: ODataSchema, parser: P);
|
|
52
52
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ODataEntityContainerConfig } from '../types';
|
|
2
2
|
import { ODataSchemaElement } from './element';
|
|
3
3
|
import { ODataEntitySet } from './entity-set';
|
|
4
4
|
import { ODataSchema } from './schema';
|
|
@@ -6,5 +6,5 @@ import { ODataSingleton } from './singleton';
|
|
|
6
6
|
export declare class ODataEntityContainer extends ODataSchemaElement {
|
|
7
7
|
entitySets: ODataEntitySet[];
|
|
8
8
|
singletons: ODataSingleton[];
|
|
9
|
-
constructor(config:
|
|
9
|
+
constructor(config: ODataEntityContainerConfig, schema: ODataSchema);
|
|
10
10
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ODataEntitySetConfig } from '../types';
|
|
2
2
|
import { ODataSchemaElement } from './element';
|
|
3
3
|
import { ODataSchema } from './schema';
|
|
4
4
|
export declare class ODataEntitySet extends ODataSchemaElement {
|
|
@@ -6,5 +6,5 @@ export declare class ODataEntitySet extends ODataSchemaElement {
|
|
|
6
6
|
service: {
|
|
7
7
|
new (...params: any[]): any;
|
|
8
8
|
};
|
|
9
|
-
constructor(config:
|
|
9
|
+
constructor(config: ODataEntitySetConfig, schema: ODataSchema);
|
|
10
10
|
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ODataEnumTypeConfig, ParserOptions } from '../types';
|
|
2
2
|
import { ODataParserSchemaElement } from './element';
|
|
3
3
|
import { ODataEnumTypeFieldParser, ODataEnumTypeParser } from './parsers';
|
|
4
4
|
import { ODataSchema } from './schema';
|
|
5
5
|
export declare class ODataEnumType<E> extends ODataParserSchemaElement<E, ODataEnumTypeParser<E>> {
|
|
6
6
|
members: {
|
|
7
|
-
[name: string]:
|
|
7
|
+
[name: string]: number;
|
|
8
8
|
} | {
|
|
9
9
|
[value: number]: string;
|
|
10
10
|
};
|
|
11
|
-
constructor(config:
|
|
11
|
+
constructor(config: ODataEnumTypeConfig, schema: ODataSchema);
|
|
12
12
|
configure({ options }: {
|
|
13
13
|
options: ParserOptions;
|
|
14
14
|
}): void;
|
|
@@ -16,19 +16,19 @@ export declare class ODataEnumType<E> extends ODataParserSchemaElement<E, ODataE
|
|
|
16
16
|
* Returns the fields of the enum type.
|
|
17
17
|
* @returns The fields of the enum type.
|
|
18
18
|
*/
|
|
19
|
-
fields(
|
|
19
|
+
fields(namesValue?: string | number): ODataEnumTypeFieldParser[];
|
|
20
20
|
/**
|
|
21
21
|
* Find a field by name or value.
|
|
22
22
|
* @param enu The name or value of the field
|
|
23
23
|
* @returns The field with the given name or value
|
|
24
24
|
*/
|
|
25
|
-
field(
|
|
25
|
+
field(nameValue: string | number): ODataEnumTypeFieldParser | undefined;
|
|
26
26
|
/**
|
|
27
27
|
* Map the fields of the enum type.
|
|
28
28
|
* @param mapper Function that maps the value to the new value
|
|
29
29
|
* @returns The fields mapped by the mapper
|
|
30
30
|
*/
|
|
31
|
-
mapFields<T>(mapper: (field: ODataEnumTypeFieldParser
|
|
31
|
+
mapFields<T>(mapper: (field: ODataEnumTypeFieldParser) => T): T[];
|
|
32
32
|
/**
|
|
33
33
|
* Deseialize the given value from the enum type.
|
|
34
34
|
* @param value Value to deserialize
|
|
@@ -42,14 +42,14 @@ export declare class ODataEnumType<E> extends ODataParserSchemaElement<E, ODataE
|
|
|
42
42
|
* @param options Options for serialization
|
|
43
43
|
* @returns Serialized value
|
|
44
44
|
*/
|
|
45
|
-
serialize(value:
|
|
45
|
+
serialize(value: number, options?: ParserOptions): any;
|
|
46
46
|
/**
|
|
47
47
|
* Encode the given value for the enum type.
|
|
48
48
|
* @param value Value to encode
|
|
49
49
|
* @param options Options for encoding
|
|
50
50
|
* @returns Encoded value
|
|
51
51
|
*/
|
|
52
|
-
encode(value:
|
|
53
|
-
unpack(value:
|
|
54
|
-
pack(value: number[]):
|
|
52
|
+
encode(value: number, options?: ParserOptions): any;
|
|
53
|
+
unpack(value: string | number): number[];
|
|
54
|
+
pack(value: string | number | number[]): number;
|
|
55
55
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ODataCallableConfig, ParserOptions, ODataParameterConfig, Parser } from '../../types';
|
|
2
2
|
import { ODataEnumTypeParser } from './enum-type';
|
|
3
3
|
import { ODataStructuredTypeParser } from './structured-type';
|
|
4
4
|
export declare class ODataParameterParser<T> {
|
|
@@ -8,7 +8,7 @@ export declare class ODataParameterParser<T> {
|
|
|
8
8
|
collection?: boolean;
|
|
9
9
|
nullable?: boolean;
|
|
10
10
|
parserOptions?: ParserOptions;
|
|
11
|
-
constructor(name: string, parameter:
|
|
11
|
+
constructor(name: string, parameter: ODataParameterConfig);
|
|
12
12
|
serialize(value: T, options?: ParserOptions): any;
|
|
13
13
|
encode(value: any, options?: ParserOptions): string;
|
|
14
14
|
configure({ options, parserForType, }: {
|
|
@@ -20,7 +20,7 @@ export declare class ODataParameterParser<T> {
|
|
|
20
20
|
enumType(): ODataEnumTypeParser<T>;
|
|
21
21
|
isStructuredType(): boolean;
|
|
22
22
|
structuredType(): ODataStructuredTypeParser<T>;
|
|
23
|
-
field<F>(name: string): import("
|
|
23
|
+
field<F>(name: string): import("angular-odata").ODataStructuredTypeFieldParser<F>;
|
|
24
24
|
}
|
|
25
25
|
export declare class ODataCallableParser<R> implements Parser<R> {
|
|
26
26
|
name: string;
|
|
@@ -33,7 +33,7 @@ export declare class ODataCallableParser<R> implements Parser<R> {
|
|
|
33
33
|
parser: Parser<any>;
|
|
34
34
|
parameters: ODataParameterParser<any>[];
|
|
35
35
|
parserOptions?: ParserOptions;
|
|
36
|
-
constructor(config:
|
|
36
|
+
constructor(config: ODataCallableConfig, namespace: string, alias?: string);
|
|
37
37
|
isTypeOf(type: string): boolean;
|
|
38
38
|
deserialize(value: any, options?: ParserOptions): R;
|
|
39
39
|
serialize(params: any, options?: ParserOptions): any;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ODataEnumTypeConfig, ODataEnumTypeFieldConfig, ParserOptions, FieldParser, JsonType } from '../../types';
|
|
2
2
|
import { ODataAnnotatable } from '../annotation';
|
|
3
|
-
export declare class ODataEnumTypeFieldParser
|
|
3
|
+
export declare class ODataEnumTypeFieldParser extends ODataAnnotatable {
|
|
4
4
|
name: string;
|
|
5
|
-
value:
|
|
6
|
-
constructor(name: string, field:
|
|
5
|
+
value: number;
|
|
6
|
+
constructor(name: string, field: ODataEnumTypeFieldConfig);
|
|
7
7
|
titleize(term?: string | RegExp): string;
|
|
8
8
|
}
|
|
9
9
|
export declare class ODataEnumTypeParser<E> extends ODataAnnotatable implements FieldParser<E> {
|
|
@@ -12,28 +12,28 @@ export declare class ODataEnumTypeParser<E> extends ODataAnnotatable implements
|
|
|
12
12
|
alias?: string;
|
|
13
13
|
flags?: boolean;
|
|
14
14
|
members: {
|
|
15
|
-
[name: string]:
|
|
15
|
+
[name: string]: number;
|
|
16
16
|
} | {
|
|
17
17
|
[value: number]: string;
|
|
18
18
|
};
|
|
19
19
|
private _fields;
|
|
20
20
|
parserOptions?: ParserOptions;
|
|
21
|
-
constructor(config:
|
|
21
|
+
constructor(config: ODataEnumTypeConfig, namespace: string, alias?: string);
|
|
22
22
|
configure({ options }: {
|
|
23
23
|
options: ParserOptions;
|
|
24
24
|
}): void;
|
|
25
25
|
isTypeOf(type: string): boolean;
|
|
26
|
-
fields(
|
|
27
|
-
field(nameValue: string |
|
|
26
|
+
fields(namesValue?: string | number | number[]): ODataEnumTypeFieldParser[];
|
|
27
|
+
field(nameValue: string | number): ODataEnumTypeFieldParser | undefined;
|
|
28
28
|
/**
|
|
29
29
|
* Map the fields of the enum type.
|
|
30
30
|
* @param mapper Function that maps the value to the new value
|
|
31
31
|
* @returns The fields mapped by the mapper
|
|
32
32
|
*/
|
|
33
|
-
mapFields<R>(mapper: (field: ODataEnumTypeFieldParser
|
|
33
|
+
mapFields<R>(mapper: (field: ODataEnumTypeFieldParser) => R): R[];
|
|
34
34
|
deserialize(value: string, options?: ParserOptions): E;
|
|
35
|
-
serialize(value:
|
|
36
|
-
encode(value:
|
|
35
|
+
serialize(value: number, options?: ParserOptions): string | undefined;
|
|
36
|
+
encode(value: number, options?: ParserOptions): any;
|
|
37
37
|
toJsonSchema(): {
|
|
38
38
|
title: string;
|
|
39
39
|
type: JsonType;
|
|
@@ -43,14 +43,14 @@ export declare class ODataEnumTypeParser<E> extends ODataAnnotatable implements
|
|
|
43
43
|
enum?: undefined;
|
|
44
44
|
} | {
|
|
45
45
|
type: JsonType;
|
|
46
|
-
enum:
|
|
46
|
+
enum: number[];
|
|
47
47
|
title?: undefined;
|
|
48
48
|
items?: undefined;
|
|
49
49
|
};
|
|
50
|
-
validate(
|
|
50
|
+
validate(value: string | number, { method, navigation, }?: {
|
|
51
51
|
method?: 'create' | 'update' | 'modify';
|
|
52
52
|
navigation?: boolean;
|
|
53
53
|
}): string[] | undefined;
|
|
54
|
-
unpack(value:
|
|
55
|
-
pack(value: number[]):
|
|
54
|
+
unpack(value: string | number): number[];
|
|
55
|
+
pack(value: string | number | number[]): number;
|
|
56
56
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ParserOptions, Parser,
|
|
1
|
+
import { ParserOptions, Parser, ODataStructuredTypeConfig, ODataStructuredTypeFieldConfig, FieldParser, EdmType } from '../../types';
|
|
2
2
|
import { ODataAnnotatable } from '../annotation';
|
|
3
3
|
import { ODataEnumTypeParser } from './enum-type';
|
|
4
4
|
type JsonSchemaSelect<T> = Array<keyof T>;
|
|
@@ -47,7 +47,7 @@ export declare class ODataStructuredTypeFieldParser<T> extends ODataAnnotatable
|
|
|
47
47
|
scale?: number | 'variable';
|
|
48
48
|
referentials: ODataReferential[];
|
|
49
49
|
parserOptions?: ParserOptions;
|
|
50
|
-
constructor(name: string, structured: ODataStructuredTypeParser<any>, field:
|
|
50
|
+
constructor(name: string, structured: ODataStructuredTypeParser<any>, field: ODataStructuredTypeFieldConfig);
|
|
51
51
|
validate(value: any, { method, navigation, }?: {
|
|
52
52
|
method?: 'create' | 'update' | 'modify';
|
|
53
53
|
navigation?: boolean;
|
|
@@ -86,8 +86,8 @@ export declare class ODataStructuredTypeParser<T> extends ODataAnnotatable imple
|
|
|
86
86
|
private _keys?;
|
|
87
87
|
private _fields;
|
|
88
88
|
parserOptions?: ParserOptions;
|
|
89
|
-
constructor(config:
|
|
90
|
-
addField<F>(name: string, config:
|
|
89
|
+
constructor(config: ODataStructuredTypeConfig, namespace: string, alias?: string);
|
|
90
|
+
addField<F>(name: string, config: ODataStructuredTypeFieldConfig): ODataStructuredTypeFieldParser<F>;
|
|
91
91
|
/**
|
|
92
92
|
* Create a nicer looking title.
|
|
93
93
|
* Titleize is meant for creating pretty output.
|
|
@@ -144,9 +144,12 @@ export declare class ODataStructuredTypeParser<T> extends ODataAnnotatable imple
|
|
|
144
144
|
*/
|
|
145
145
|
pick(attrs: {
|
|
146
146
|
[name: string]: any;
|
|
147
|
-
}, { include_parents, include_navigation, include_etag, options, }?: {
|
|
147
|
+
}, { include_id, include_key, include_parents, include_navigation, include_computed, include_etag, options, }?: {
|
|
148
|
+
include_id?: boolean;
|
|
149
|
+
include_key?: boolean;
|
|
148
150
|
include_parents?: boolean;
|
|
149
151
|
include_navigation?: boolean;
|
|
152
|
+
include_computed?: boolean;
|
|
150
153
|
include_etag?: boolean;
|
|
151
154
|
options?: ParserOptions;
|
|
152
155
|
}): Partial<T>;
|
package/lib/schema/schema.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ODataApi } from '../api';
|
|
2
|
-
import { ParserOptions,
|
|
2
|
+
import { ParserOptions, ODataSchemaConfig, ODataStructuredTypeConfig } from '../types';
|
|
3
3
|
import { ODataAnnotatable } from './annotation';
|
|
4
4
|
import { ODataCallable } from './callable';
|
|
5
5
|
import { ODataEntityContainer } from './entity-container';
|
|
@@ -15,11 +15,11 @@ export declare class ODataSchema extends ODataAnnotatable {
|
|
|
15
15
|
entities: ODataStructuredType<any>[];
|
|
16
16
|
callables: ODataCallable<any>[];
|
|
17
17
|
containers: ODataEntityContainer[];
|
|
18
|
-
constructor(config:
|
|
18
|
+
constructor(config: ODataSchemaConfig, api: ODataApi);
|
|
19
19
|
isNamespaceOf(type: string): boolean;
|
|
20
20
|
get entitySets(): ODataEntitySet[];
|
|
21
21
|
get singletons(): ODataSingleton[];
|
|
22
|
-
createStructuredType<T>(config:
|
|
22
|
+
createStructuredType<T>(config: ODataStructuredTypeConfig): ODataStructuredType<T>;
|
|
23
23
|
configure({ options }: {
|
|
24
24
|
options: ParserOptions;
|
|
25
25
|
}): void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ODataSingletonConfig } from '../types';
|
|
2
2
|
import { ODataSchemaElement } from './element';
|
|
3
3
|
import { ODataSchema } from './schema';
|
|
4
4
|
export declare class ODataSingleton extends ODataSchemaElement {
|
|
@@ -6,5 +6,5 @@ export declare class ODataSingleton extends ODataSchemaElement {
|
|
|
6
6
|
service: {
|
|
7
7
|
new (...params: any[]): any;
|
|
8
8
|
};
|
|
9
|
-
constructor(config:
|
|
9
|
+
constructor(config: ODataSingletonConfig, schema: ODataSchema);
|
|
10
10
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ODataCollection } from '../models/collection';
|
|
2
2
|
import { ODataModel } from '../models/model';
|
|
3
|
-
import { ParserOptions,
|
|
3
|
+
import { ParserOptions, ODataStructuredTypeConfig, ODataStructuredTypeFieldConfig } from '../types';
|
|
4
4
|
import { ODataParserSchemaElement } from './element';
|
|
5
5
|
import { JsonSchemaOptions, ODataEntityTypeKey, ODataStructuredTypeFieldParser, ODataStructuredTypeParser } from './parsers';
|
|
6
6
|
import { ODataSchema } from './schema';
|
|
@@ -10,7 +10,7 @@ export declare class ODataStructuredType<T> extends ODataParserSchemaElement<T,
|
|
|
10
10
|
children: ODataStructuredType<any>[];
|
|
11
11
|
model?: typeof ODataModel;
|
|
12
12
|
collection?: typeof ODataCollection;
|
|
13
|
-
constructor(config:
|
|
13
|
+
constructor(config: ODataStructuredTypeConfig, schema: ODataSchema);
|
|
14
14
|
configure({ options }: {
|
|
15
15
|
options: ParserOptions;
|
|
16
16
|
}): void;
|
|
@@ -45,7 +45,7 @@ export declare class ODataStructuredType<T> extends ODataParserSchemaElement<T,
|
|
|
45
45
|
* @returns The field parser
|
|
46
46
|
*/
|
|
47
47
|
field<F>(name: keyof T): ODataStructuredTypeFieldParser<F>;
|
|
48
|
-
addField<F>(name: string, config:
|
|
48
|
+
addField<F>(name: string, config: ODataStructuredTypeFieldConfig): ODataStructuredTypeFieldParser<F>;
|
|
49
49
|
/**
|
|
50
50
|
* Find a parent schema of the structured type.
|
|
51
51
|
* @param predicate Function for evaluate the schemas in the hierarchy.
|
|
@@ -69,9 +69,12 @@ export declare class ODataStructuredType<T> extends ODataParserSchemaElement<T,
|
|
|
69
69
|
*/
|
|
70
70
|
pick(attrs: {
|
|
71
71
|
[name: string]: any;
|
|
72
|
-
}, { include_parents, include_navigation, include_etag, }?: {
|
|
72
|
+
}, { include_id, include_key, include_parents, include_navigation, include_computed, include_etag, }?: {
|
|
73
|
+
include_id?: boolean;
|
|
74
|
+
include_key?: boolean;
|
|
73
75
|
include_parents?: boolean;
|
|
74
76
|
include_navigation?: boolean;
|
|
77
|
+
include_computed?: boolean;
|
|
75
78
|
include_etag?: boolean;
|
|
76
79
|
}): Partial<T>;
|
|
77
80
|
/**
|
|
@@ -6,8 +6,8 @@ import { ODataEntityService } from './entity';
|
|
|
6
6
|
export declare class ODataEntitySetService<T> extends ODataEntityService<T> {
|
|
7
7
|
static Model?: typeof ODataModel;
|
|
8
8
|
static Collection?: typeof ODataCollection;
|
|
9
|
-
model(entity?: Partial<T
|
|
10
|
-
collection(entities?: Partial<T>[]): ODataCollection<T, ODataModel<T>>;
|
|
9
|
+
model(entity?: Partial<T>, reset?: boolean): ODataModel<T> & import("angular-odata").ModelInterface<T>;
|
|
10
|
+
collection(entities?: Partial<T>[], reset?: boolean): ODataCollection<T, ODataModel<T> & import("angular-odata").ModelInterface<T>>;
|
|
11
11
|
/**
|
|
12
12
|
* Get the entity set resource for this service.
|
|
13
13
|
*/
|
|
@@ -32,8 +32,8 @@ export declare class ODataEntitySetService<T> extends ODataEntityService<T> {
|
|
|
32
32
|
* @param options The options for the request.
|
|
33
33
|
*/
|
|
34
34
|
fetchAll(options?: ODataOptions): Observable<{
|
|
35
|
-
entities:
|
|
36
|
-
annots: import("
|
|
35
|
+
entities: any[];
|
|
36
|
+
annots: import("angular-odata").ODataEntitiesAnnotations<any>;
|
|
37
37
|
}>;
|
|
38
38
|
/**
|
|
39
39
|
* Get entities from the entity set.
|
|
@@ -44,7 +44,10 @@ export declare class ODataEntitySetService<T> extends ODataEntityService<T> {
|
|
|
44
44
|
withCount?: boolean;
|
|
45
45
|
}): Observable<{
|
|
46
46
|
entities: T[];
|
|
47
|
-
annots: import("
|
|
47
|
+
annots: import("angular-odata").ODataEntitiesAnnotations<T>;
|
|
48
|
+
} | {
|
|
49
|
+
entities: T[];
|
|
50
|
+
annots: import("angular-odata").ODataEntitiesAnnotations<any>;
|
|
48
51
|
}>;
|
|
49
52
|
/**
|
|
50
53
|
* Get an entity from the entity set.
|
|
@@ -56,7 +59,7 @@ export declare class ODataEntitySetService<T> extends ODataEntityService<T> {
|
|
|
56
59
|
etag?: string;
|
|
57
60
|
}): Observable<{
|
|
58
61
|
entity: T | null;
|
|
59
|
-
annots: import("
|
|
62
|
+
annots: import("angular-odata").ODataEntitiesAnnotations<T>;
|
|
60
63
|
}>;
|
|
61
64
|
/**
|
|
62
65
|
* Create an entity in the entity set.
|
package/lib/services/entity.d.ts
CHANGED
|
@@ -7,5 +7,5 @@ export declare abstract class ODataEntityService<T> extends ODataBaseService {
|
|
|
7
7
|
/**
|
|
8
8
|
* The schema for the structured type.
|
|
9
9
|
*/
|
|
10
|
-
get structuredTypeSchema(): import("angular-odata").ODataStructuredType<T> | undefined;
|
|
10
|
+
get structuredTypeSchema(): import("angular-odata").ODataStructuredType<any> | import("angular-odata").ODataStructuredType<T> | undefined;
|
|
11
11
|
}
|