angular-odata 0.78.1 → 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/README.md +133 -62
- 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} +12 -5
- package/{esm2015/lib/cache/index.js → esm2020/lib/cache/index.mjs} +0 -0
- package/{esm2015/lib/cache/memory.js → esm2020/lib/cache/memory.mjs} +0 -0
- package/{esm2015/lib/cache/storage.js → esm2020/lib/cache/storage.mjs} +1 -1
- package/esm2020/lib/client.mjs +271 -0
- package/{esm2015/lib/constants.js → esm2020/lib/constants.mjs} +9 -3
- package/esm2020/lib/helper.mjs +268 -0
- package/esm2020/lib/index.mjs +19 -0
- package/esm2020/lib/models/collection.mjs +741 -0
- package/{esm2015/lib/models/index.js → esm2020/lib/models/index.mjs} +0 -0
- package/esm2020/lib/models/model.mjs +453 -0
- package/esm2020/lib/models/options.mjs +945 -0
- package/{esm2015/lib/module.js → esm2020/lib/module.mjs} +6 -6
- package/esm2020/lib/options.mjs +32 -0
- package/esm2020/lib/resources/index.mjs +7 -0
- package/esm2020/lib/resources/path/handlers.mjs +69 -0
- package/esm2020/lib/resources/path/index.mjs +3 -0
- package/esm2020/lib/resources/path/segments.mjs +124 -0
- package/esm2020/lib/resources/query/builder.mjs +590 -0
- package/esm2020/lib/resources/query/expressions.mjs +207 -0
- package/esm2020/lib/resources/query/handlers.mjs +186 -0
- package/esm2020/lib/resources/query/index.mjs +4 -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} +1 -1
- package/esm2020/lib/resources/responses/response.mjs +170 -0
- package/{esm2015/lib/resources/responses/types.js → esm2020/lib/resources/responses/types.mjs} +1 -1
- 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} +2 -1
- package/esm2020/lib/schema/parsers/callable.mjs +113 -0
- package/esm2020/lib/schema/parsers/edm.mjs +95 -0
- package/esm2020/lib/schema/parsers/enum-type.mjs +107 -0
- package/esm2020/lib/schema/parsers/index.mjs +5 -0
- package/esm2020/lib/schema/parsers/structured-type.mjs +412 -0
- package/esm2020/lib/schema/schema.mjs +61 -0
- package/esm2020/lib/schema/structured-type.mjs +198 -0
- package/esm2020/lib/services/base.mjs +29 -0
- package/esm2020/lib/services/entity-set.mjs +143 -0
- package/esm2020/lib/services/entity.mjs +12 -0
- package/{esm2015/lib/services/factory.js → esm2020/lib/services/factory.mjs} +3 -3
- package/{esm2015/lib/services/index.js → esm2020/lib/services/index.mjs} +0 -0
- package/esm2020/lib/services/singleton.mjs +48 -0
- package/{esm2015/lib/settings.js → esm2020/lib/settings.mjs} +1 -1
- package/{esm2015/lib/tokens.js → esm2020/lib/tokens.mjs} +0 -0
- package/esm2020/lib/types.mjs +37 -0
- package/esm2020/lib/utils/arraybuffers.mjs +46 -0
- package/{esm2015/lib/utils/dates.js → esm2020/lib/utils/dates.mjs} +0 -0
- package/esm2020/lib/utils/durations.mjs +40 -0
- package/{esm2015/lib/utils/enums.js → esm2020/lib/utils/enums.mjs} +0 -0
- package/esm2020/lib/utils/http.mjs +93 -0
- package/esm2020/lib/utils/index.mjs +10 -0
- package/esm2020/lib/utils/objects.mjs +195 -0
- package/esm2020/lib/utils/odata.mjs +22 -0
- package/esm2020/lib/utils/strings.mjs +20 -0
- package/esm2020/lib/utils/types.mjs +134 -0
- package/{esm2015/lib/utils/urls.js → esm2020/lib/utils/urls.mjs} +0 -0
- package/{esm2015/public-api.js → esm2020/public-api.mjs} +0 -0
- package/fesm2015/{angular-odata.js → angular-odata.mjs} +5068 -3943
- 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 +17 -16
- package/lib/cache/cache.d.ts +2 -2
- package/lib/client.d.ts +93 -18
- package/lib/constants.d.ts +6 -2
- package/lib/helper.d.ts +3 -3
- package/lib/index.d.ts +0 -1
- package/lib/models/collection.d.ts +36 -47
- package/lib/models/model.d.ts +47 -40
- package/lib/models/options.d.ts +53 -52
- package/lib/options.d.ts +50 -2
- package/lib/resources/index.d.ts +2 -3
- package/lib/resources/path/handlers.d.ts +27 -0
- package/lib/resources/path/index.d.ts +2 -0
- package/lib/resources/{path-segments.d.ts → path/segments.d.ts} +4 -16
- package/lib/resources/{builder.d.ts → query/builder.d.ts} +12 -7
- package/lib/resources/query/expressions.d.ts +63 -0
- package/lib/resources/query/handlers.d.ts +89 -0
- package/lib/resources/query/index.d.ts +3 -0
- package/lib/resources/query/options.d.ts +38 -0
- package/lib/resources/query/syntax.d.ts +175 -0
- package/lib/resources/request.d.ts +8 -6
- package/lib/resources/resource.d.ts +49 -55
- package/lib/resources/responses/metadata.d.ts +1 -1
- package/lib/resources/responses/types.d.ts +1 -1
- package/lib/resources/types/action.d.ts +55 -69
- package/lib/resources/types/batch.d.ts +13 -8
- package/lib/resources/types/count.d.ts +16 -19
- package/lib/resources/types/entity-set.d.ts +24 -62
- package/lib/resources/types/entity.d.ts +35 -43
- package/lib/resources/types/function.d.ts +63 -71
- package/lib/resources/types/media.d.ts +20 -22
- package/lib/resources/types/metadata.d.ts +5 -7
- package/lib/resources/types/navigation-property.d.ts +100 -85
- package/lib/resources/types/options.d.ts +8 -8
- package/lib/resources/types/property.d.ts +63 -73
- package/lib/resources/types/reference.d.ts +72 -16
- package/lib/resources/types/singleton.d.ts +75 -43
- package/lib/resources/types/value.d.ts +18 -9
- package/lib/schema/annotation.d.ts +18 -0
- package/lib/schema/callable.d.ts +27 -11
- package/lib/schema/element.d.ts +39 -0
- package/lib/schema/entity-container.d.ts +3 -8
- package/lib/schema/entity-set.d.ts +3 -9
- package/lib/schema/enum-type.d.ts +41 -14
- package/lib/schema/index.d.ts +1 -0
- package/lib/{parsers → schema/parsers}/callable.d.ts +2 -2
- package/lib/schema/parsers/edm.d.ts +4 -0
- package/lib/{parsers → schema/parsers}/enum-type.d.ts +13 -7
- package/lib/{parsers → schema/parsers}/index.d.ts +0 -0
- package/lib/{parsers → schema/parsers}/structured-type.d.ts +14 -9
- package/lib/schema/schema.d.ts +6 -8
- package/lib/schema/structured-type.d.ts +97 -18
- package/lib/services/base.d.ts +12 -12
- package/lib/services/entity-set.d.ts +15 -12
- package/lib/services/entity.d.ts +4 -1
- package/lib/services/singleton.d.ts +6 -3
- package/lib/settings.d.ts +4 -4
- package/lib/types.d.ts +7 -3
- package/lib/utils/arraybuffers.d.ts +4 -0
- package/lib/{parsers/edm.d.ts → utils/durations.d.ts} +3 -3
- package/lib/utils/http.d.ts +9 -0
- package/lib/utils/index.d.ts +5 -2
- package/lib/utils/objects.d.ts +1 -1
- package/lib/utils/strings.d.ts +4 -0
- package/lib/utils/types.d.ts +2 -0
- package/package.json +21 -8
- package/bundles/angular-odata.umd.js +0 -10756
- package/bundles/angular-odata.umd.js.map +0 -1
- package/esm2015/lib/api.js +0 -251
- package/esm2015/lib/client.js +0 -197
- package/esm2015/lib/helper.js +0 -269
- package/esm2015/lib/index.js +0 -21
- package/esm2015/lib/models/collection.js +0 -660
- package/esm2015/lib/models/model.js +0 -421
- package/esm2015/lib/models/options.js +0 -889
- package/esm2015/lib/options.js +0 -31
- package/esm2015/lib/parsers/callable.js +0 -110
- package/esm2015/lib/parsers/edm.js +0 -310
- package/esm2015/lib/parsers/enum-type.js +0 -97
- package/esm2015/lib/parsers/index.js +0 -5
- package/esm2015/lib/parsers/structured-type.js +0 -394
- package/esm2015/lib/resources/builder.js +0 -537
- package/esm2015/lib/resources/index.js +0 -8
- package/esm2015/lib/resources/path-segments.js +0 -156
- package/esm2015/lib/resources/query-options.js +0 -157
- package/esm2015/lib/resources/request.js +0 -141
- package/esm2015/lib/resources/resource.js +0 -328
- package/esm2015/lib/resources/responses/annotations.js +0 -121
- package/esm2015/lib/resources/responses/metadata.js +0 -548
- package/esm2015/lib/resources/responses/response.js +0 -170
- package/esm2015/lib/resources/types/action.js +0 -146
- package/esm2015/lib/resources/types/batch.js +0 -330
- package/esm2015/lib/resources/types/count.js +0 -50
- package/esm2015/lib/resources/types/entity-set.js +0 -164
- package/esm2015/lib/resources/types/entity.js +0 -158
- package/esm2015/lib/resources/types/function.js +0 -166
- package/esm2015/lib/resources/types/media.js +0 -46
- package/esm2015/lib/resources/types/metadata.js +0 -36
- package/esm2015/lib/resources/types/navigation-property.js +0 -214
- package/esm2015/lib/resources/types/options.js +0 -2
- package/esm2015/lib/resources/types/property.js +0 -190
- package/esm2015/lib/resources/types/reference.js +0 -50
- package/esm2015/lib/resources/types/singleton.js +0 -147
- package/esm2015/lib/resources/types/value.js +0 -30
- package/esm2015/lib/schema/annotation.js +0 -7
- package/esm2015/lib/schema/callable.js +0 -50
- package/esm2015/lib/schema/entity-container.js +0 -17
- package/esm2015/lib/schema/entity-set.js +0 -23
- package/esm2015/lib/schema/enum-type.js +0 -68
- package/esm2015/lib/schema/schema.js +0 -55
- package/esm2015/lib/schema/structured-type.js +0 -107
- package/esm2015/lib/services/base.js +0 -23
- package/esm2015/lib/services/entity-set.js +0 -143
- package/esm2015/lib/services/entity.js +0 -10
- package/esm2015/lib/services/singleton.js +0 -46
- package/esm2015/lib/types.js +0 -37
- package/esm2015/lib/utils/http.js +0 -59
- package/esm2015/lib/utils/index.js +0 -7
- package/esm2015/lib/utils/objects.js +0 -140
- package/esm2015/lib/utils/odata.js +0 -21
- package/esm2015/lib/utils/types.js +0 -103
- package/fesm2015/angular-odata.js.map +0 -1
- package/lib/resources/query-options.d.ts +0 -57
package/lib/models/options.d.ts
CHANGED
|
@@ -1,13 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { Options } from '../types';
|
|
1
|
+
import { Subscription } from 'rxjs';
|
|
2
|
+
import { EntityKey, ODataEntitiesAnnotations, ODataEntityAnnotations, ODataEntityResource, ODataEntitySetResource, ODataNavigationPropertyResource, ODataPropertyResource, ODataQueryOptions, ODataQueryOptionsHandler, ODataResource, ODataSingletonResource } from '../resources';
|
|
3
|
+
import { ODataEntitySet, ODataStructuredType, ODataStructuredTypeFieldParser } from '../schema';
|
|
4
|
+
import { Options, OptionsHelper } from '../types';
|
|
6
5
|
import type { ODataCollection } from './collection';
|
|
7
6
|
import type { ODataModel } from './model';
|
|
8
|
-
export declare const CID = "_cid";
|
|
9
|
-
export declare type ODataModelResource<T> = ODataEntityResource<T> | ODataSingletonResource<T> | ODataNavigationPropertyResource<T> | ODataPropertyResource<T>;
|
|
10
|
-
export declare type ODataCollectionResource<T> = ODataEntitySetResource<T> | ODataNavigationPropertyResource<T> | ODataPropertyResource<T>;
|
|
11
7
|
export declare type ODataModelEventType = 'change' | 'reset' | 'update' | 'destroy' | 'add' | 'remove' | 'invalid' | 'request' | 'sync' | 'attach';
|
|
12
8
|
export declare class ODataModelEvent<T> {
|
|
13
9
|
name: ODataModelEventType;
|
|
@@ -35,11 +31,16 @@ export declare class ODataModelEvent<T> {
|
|
|
35
31
|
get path(): string;
|
|
36
32
|
}
|
|
37
33
|
export declare const BUBBLING: string[];
|
|
38
|
-
export declare const
|
|
39
|
-
|
|
34
|
+
export declare const INCLUDE_SHALLOW: {
|
|
35
|
+
include_concurrency: boolean;
|
|
36
|
+
include_computed: boolean;
|
|
37
|
+
include_key: boolean;
|
|
38
|
+
};
|
|
39
|
+
export declare const INCLUDE_DEEP: {
|
|
40
40
|
include_concurrency: boolean;
|
|
41
41
|
include_computed: boolean;
|
|
42
42
|
include_key: boolean;
|
|
43
|
+
include_navigation: boolean;
|
|
43
44
|
include_non_field: boolean;
|
|
44
45
|
};
|
|
45
46
|
export declare enum ODataModelState {
|
|
@@ -80,7 +81,7 @@ export declare class ODataModelField<F> {
|
|
|
80
81
|
name: string;
|
|
81
82
|
field: string;
|
|
82
83
|
parser: ODataStructuredTypeFieldParser<F>;
|
|
83
|
-
|
|
84
|
+
options: ODataModelOptions<any>;
|
|
84
85
|
meta?: ODataModelOptions<any>;
|
|
85
86
|
default?: any;
|
|
86
87
|
required: boolean;
|
|
@@ -90,34 +91,35 @@ export declare class ODataModelField<F> {
|
|
|
90
91
|
min?: number;
|
|
91
92
|
max?: number;
|
|
92
93
|
pattern?: RegExp;
|
|
93
|
-
constructor(
|
|
94
|
+
constructor(options: ODataModelOptions<any>, { name, field, parser, ...opts }: ODataModelFieldOptions<F>);
|
|
94
95
|
get api(): import("angular-odata").ODataApi;
|
|
95
96
|
get type(): string;
|
|
96
97
|
get navigation(): boolean;
|
|
97
98
|
get collection(): boolean;
|
|
98
|
-
|
|
99
|
-
configure({ findOptionsForType, concurrency, }: {
|
|
99
|
+
annotatedValue<T>(term: string | RegExp): T | undefined;
|
|
100
|
+
configure({ findOptionsForType, concurrency, options, }: {
|
|
100
101
|
findOptionsForType: (type: string) => ODataModelOptions<any> | undefined;
|
|
101
102
|
concurrency: boolean;
|
|
103
|
+
options: OptionsHelper;
|
|
102
104
|
}): void;
|
|
103
105
|
isKey(): boolean;
|
|
104
106
|
hasReferentials(): boolean;
|
|
105
|
-
get referentials(): import("../
|
|
107
|
+
get referentials(): import("../schema").ODataReferential[];
|
|
106
108
|
isStructuredType(): boolean;
|
|
107
|
-
structured(): ODataStructuredType<F
|
|
109
|
+
structured(): ODataStructuredType<F>;
|
|
108
110
|
isEnumType(): boolean;
|
|
109
|
-
enum(): import("../schema").ODataEnumType<F
|
|
111
|
+
enum(): import("../schema").ODataEnumType<F>;
|
|
110
112
|
validate(value: any, { method, navigation, }?: {
|
|
111
|
-
method?: 'create' | 'update' | '
|
|
113
|
+
method?: 'create' | 'update' | 'modify';
|
|
112
114
|
navigation?: boolean;
|
|
113
115
|
}): any;
|
|
114
116
|
defaults(): any;
|
|
115
117
|
deserialize(value: any, options?: Options): F;
|
|
116
118
|
serialize(value: F, options?: Options): any;
|
|
117
119
|
encode(value: F, options?: Options): any;
|
|
118
|
-
resourceFactory<T, F>(
|
|
119
|
-
annotationsFactory(
|
|
120
|
-
schemaFactory<T, F>(
|
|
120
|
+
resourceFactory<T, F>(base: ODataResource<T>): ODataNavigationPropertyResource<F> | ODataPropertyResource<F>;
|
|
121
|
+
annotationsFactory(base: ODataEntityAnnotations): ODataEntityAnnotations | ODataEntitiesAnnotations;
|
|
122
|
+
schemaFactory<T, F>(base: ODataStructuredType<T>): ODataStructuredType<F> | undefined;
|
|
121
123
|
modelCollectionFactory<T, F>({ parent, value, reset, }: {
|
|
122
124
|
parent: ODataModel<any>;
|
|
123
125
|
value?: F | F[] | {
|
|
@@ -130,9 +132,9 @@ export declare class ODataModelField<F> {
|
|
|
130
132
|
}
|
|
131
133
|
export declare type ODataModelRelation<T> = {
|
|
132
134
|
state: ODataModelState;
|
|
133
|
-
model
|
|
135
|
+
model?: ODataModel<T> | ODataCollection<T, ODataModel<T>> | null;
|
|
134
136
|
field: ODataModelField<T>;
|
|
135
|
-
subscription
|
|
137
|
+
subscription?: Subscription;
|
|
136
138
|
};
|
|
137
139
|
export declare type ODataModelEntry<T, M extends ODataModel<T>> = {
|
|
138
140
|
state: ODataModelState;
|
|
@@ -140,7 +142,7 @@ export declare type ODataModelEntry<T, M extends ODataModel<T>> = {
|
|
|
140
142
|
key?: EntityKey<T> | {
|
|
141
143
|
[name: string]: any;
|
|
142
144
|
};
|
|
143
|
-
subscription
|
|
145
|
+
subscription?: Subscription;
|
|
144
146
|
};
|
|
145
147
|
export declare class ODataModelOptions<T> {
|
|
146
148
|
name: string;
|
|
@@ -152,71 +154,67 @@ export declare class ODataModelOptions<T> {
|
|
|
152
154
|
entitySet?: ODataEntitySet;
|
|
153
155
|
parent?: ODataModelOptions<any>;
|
|
154
156
|
children: ODataModelOptions<any>[];
|
|
155
|
-
constructor(options
|
|
157
|
+
constructor({ options, schema, }: {
|
|
158
|
+
options: ModelOptions;
|
|
159
|
+
schema: ODataStructuredType<T>;
|
|
160
|
+
});
|
|
156
161
|
get api(): import("angular-odata").ODataApi;
|
|
157
162
|
type(): string;
|
|
158
163
|
isTypeOf(type: string): boolean;
|
|
159
164
|
findChildOptions(predicate: (options: ODataModelOptions<any>) => boolean): ODataModelOptions<any> | undefined;
|
|
160
|
-
configure({ findOptionsForType, }: {
|
|
165
|
+
configure({ findOptionsForType, options, }: {
|
|
161
166
|
findOptionsForType: (type: string) => ODataModelOptions<any> | undefined;
|
|
167
|
+
options: OptionsHelper;
|
|
162
168
|
}): void;
|
|
163
169
|
fields({ include_navigation, include_parents, }?: {
|
|
164
170
|
include_parents?: boolean;
|
|
165
171
|
include_navigation?: boolean;
|
|
166
172
|
}): ODataModelField<any>[];
|
|
167
|
-
field(name: keyof T | string): ODataModelField<any
|
|
168
|
-
attach(self: ODataModel<T>, resource:
|
|
173
|
+
field<F>(name: keyof T | string): ODataModelField<any>;
|
|
174
|
+
attach(self: ODataModel<T>, resource: ODataEntityResource<T> | ODataNavigationPropertyResource<T> | ODataPropertyResource<T> | ODataSingletonResource<T>): void;
|
|
169
175
|
static chain(child: ODataModel<any> | ODataCollection<any, ODataModel<any>>): [
|
|
170
176
|
ODataModel<any> | ODataCollection<any, ODataModel<any>>,
|
|
171
177
|
ODataModelField<any> | null
|
|
172
178
|
][];
|
|
173
|
-
static resource<T>(child: ODataModel<T> | ODataCollection<T, ODataModel<T>>):
|
|
174
|
-
collectionResourceFactory(
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
modelResourceFactory({ baseResource, }?: {
|
|
178
|
-
fromSet?: boolean;
|
|
179
|
-
baseResource?: ODataResource<T>;
|
|
180
|
-
}): ODataModelResource<T>;
|
|
181
|
-
entityResource(self: ODataModel<T>): ODataModelResource<T>;
|
|
179
|
+
static resource<T>(child: ODataModel<T> | ODataCollection<T, ODataModel<T>>): ODataResource<T> | ODataResource<T>;
|
|
180
|
+
collectionResourceFactory(query?: ODataQueryOptions<T>): ODataEntitySetResource<T> | ODataNavigationPropertyResource<T> | ODataPropertyResource<T> | undefined;
|
|
181
|
+
modelResourceFactory(query?: ODataQueryOptions<T>): ODataEntityResource<T> | ODataNavigationPropertyResource<T> | ODataPropertyResource<T> | ODataSingletonResource<T> | undefined;
|
|
182
|
+
entityResource(self: ODataModel<T>): ODataResource<T>;
|
|
182
183
|
bind(self: ODataModel<T>, { parent, resource, annots, }?: {
|
|
183
184
|
parent?: [
|
|
184
185
|
ODataModel<any> | ODataCollection<any, ODataModel<any>>,
|
|
185
186
|
ODataModelField<any> | null
|
|
186
187
|
];
|
|
187
|
-
resource?:
|
|
188
|
+
resource?: ODataResource<T>;
|
|
188
189
|
annots?: ODataEntityAnnotations;
|
|
189
190
|
}): void;
|
|
190
|
-
query(self: ODataModel<T>, resource:
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
apply(query: QueryArguments<T>): void;
|
|
195
|
-
}) => void): void;
|
|
196
|
-
resolveKey(value: any, { field_mapping, resolve, }?: {
|
|
191
|
+
query(self: ODataModel<T>, resource: ODataEntityResource<T> | ODataPropertyResource<T> | ODataNavigationPropertyResource<T> | ODataSingletonResource<T>, func: (q: ODataQueryOptionsHandler<T>) => void): ODataModel<T>;
|
|
192
|
+
resolveKey(value: ODataModel<T> | T | {
|
|
193
|
+
[name: string]: any;
|
|
194
|
+
}, { field_mapping, resolve, }?: {
|
|
197
195
|
field_mapping?: boolean;
|
|
198
196
|
resolve?: boolean;
|
|
199
197
|
}): EntityKey<T> | {
|
|
200
198
|
[name: string]: any;
|
|
201
199
|
} | undefined;
|
|
202
|
-
resolveReferential(
|
|
200
|
+
resolveReferential(value: ODataModel<T> | T | {
|
|
203
201
|
[name: string]: any;
|
|
204
|
-
}, field: ODataModelField<any>, { field_mapping, resolve, }?: {
|
|
202
|
+
} | null, field: ODataModelField<any>, { field_mapping, resolve, }?: {
|
|
205
203
|
field_mapping?: boolean;
|
|
206
204
|
resolve?: boolean;
|
|
207
205
|
}): {
|
|
208
206
|
[name: string]: any;
|
|
209
207
|
} | undefined;
|
|
210
|
-
resolveReferenced(
|
|
208
|
+
resolveReferenced(value: ODataModel<T> | T | {
|
|
211
209
|
[name: string]: any;
|
|
212
|
-
}, field: ODataModelField<any>, { field_mapping, resolve, }?: {
|
|
210
|
+
} | null, field: ODataModelField<any>, { field_mapping, resolve, }?: {
|
|
213
211
|
field_mapping?: boolean;
|
|
214
212
|
resolve?: boolean;
|
|
215
213
|
}): {
|
|
216
214
|
[name: string]: any;
|
|
217
215
|
} | undefined;
|
|
218
216
|
validate(self: ODataModel<T>, { method, navigation, }?: {
|
|
219
|
-
method?: 'create' | 'update' | '
|
|
217
|
+
method?: 'create' | 'update' | 'modify';
|
|
220
218
|
navigation?: boolean;
|
|
221
219
|
}): {
|
|
222
220
|
[name: string]: string[];
|
|
@@ -227,7 +225,7 @@ export declare class ODataModelOptions<T> {
|
|
|
227
225
|
hasChanged(self: ODataModel<T>, { include_navigation }?: {
|
|
228
226
|
include_navigation?: boolean;
|
|
229
227
|
}): boolean;
|
|
230
|
-
asEntity<R, M extends ODataModel<T>>(self: M, func: (model: M) =>
|
|
228
|
+
asEntity<R, M extends ODataModel<T>>(self: M, func: (model: M) => R): R;
|
|
231
229
|
toEntity(self: ODataModel<T>, { client_id, include_navigation, include_concurrency, include_computed, include_key, include_non_field, changes_only, field_mapping, chain, }?: {
|
|
232
230
|
client_id?: boolean;
|
|
233
231
|
include_navigation?: boolean;
|
|
@@ -256,8 +254,9 @@ export declare class ODataModelOptions<T> {
|
|
|
256
254
|
}): void;
|
|
257
255
|
assign(self: ODataModel<T>, entity: Partial<T> | {
|
|
258
256
|
[name: string]: any;
|
|
259
|
-
}, { reset, silent, }?: {
|
|
257
|
+
}, { reset, reparent, silent, }?: {
|
|
260
258
|
reset?: boolean;
|
|
259
|
+
reparent?: boolean;
|
|
261
260
|
silent?: boolean;
|
|
262
261
|
}): void;
|
|
263
262
|
static isModel(obj: any): boolean;
|
|
@@ -265,6 +264,8 @@ export declare class ODataModelOptions<T> {
|
|
|
265
264
|
private updateCollection;
|
|
266
265
|
private updateModel;
|
|
267
266
|
private _get;
|
|
267
|
+
private _setStructured;
|
|
268
|
+
private _setValue;
|
|
268
269
|
private _set;
|
|
269
270
|
private _unsubscribe;
|
|
270
271
|
private _subscribe;
|
package/lib/options.d.ts
CHANGED
|
@@ -1,32 +1,80 @@
|
|
|
1
1
|
import { ApiOptions, FetchPolicy, ODataMetadataType, ODataVersion, Options, OptionsHelper, QueryOptionNames } from './types';
|
|
2
2
|
export declare class ODataApiOptions implements ApiOptions, OptionsHelper {
|
|
3
|
+
/**
|
|
4
|
+
* Default OData version
|
|
5
|
+
*/
|
|
3
6
|
version: ODataVersion;
|
|
7
|
+
/**
|
|
8
|
+
* Send enum as string in the request
|
|
9
|
+
*/
|
|
4
10
|
stringAsEnum?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Strip metadata from the response
|
|
13
|
+
*/
|
|
5
14
|
stripMetadata: ODataMetadataType;
|
|
15
|
+
/**
|
|
16
|
+
* Cache fetch policy
|
|
17
|
+
*/
|
|
6
18
|
fetchPolicy: FetchPolicy;
|
|
7
|
-
|
|
19
|
+
/**
|
|
20
|
+
* Extra params to be sent in the request
|
|
21
|
+
*/
|
|
8
22
|
params: {
|
|
9
23
|
[param: string]: string | string[];
|
|
10
24
|
};
|
|
25
|
+
/**
|
|
26
|
+
* Extra headers to be sent in the request
|
|
27
|
+
*/
|
|
11
28
|
headers: {
|
|
12
29
|
[param: string]: string | string[];
|
|
13
30
|
};
|
|
31
|
+
/**
|
|
32
|
+
* Http request with credentials
|
|
33
|
+
*/
|
|
14
34
|
withCredentials?: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Send query options in the request body
|
|
37
|
+
*/
|
|
15
38
|
bodyQueryOptions: QueryOptionNames[];
|
|
39
|
+
/**
|
|
40
|
+
* Customize accept header with OData options
|
|
41
|
+
* @link http://docs.oasis-open.org/odata/odata-json-format/v4.01/odata-json-format-v4.01.html#sec_RequestingtheJSONFormat
|
|
42
|
+
*/
|
|
16
43
|
accept?: {
|
|
17
|
-
|
|
44
|
+
exponentialDecimals?: boolean;
|
|
18
45
|
ieee754Compatible?: boolean;
|
|
46
|
+
metadata?: ODataMetadataType;
|
|
47
|
+
streaming?: boolean;
|
|
19
48
|
};
|
|
20
49
|
etag: {
|
|
50
|
+
/**
|
|
51
|
+
* @link http://docs.oasis-open.org/odata/odata/v4.0/errata02/os/complete/part1-protocol/odata-v4.0-errata02-os-part1-protocol-complete.html#_Toc406398229
|
|
52
|
+
*/
|
|
21
53
|
ifMatch: boolean;
|
|
54
|
+
/**
|
|
55
|
+
* @link http://docs.oasis-open.org/odata/odata/v4.0/errata02/os/complete/part1-protocol/odata-v4.0-errata02-os-part1-protocol-complete.html#_Toc406398230
|
|
56
|
+
*/
|
|
22
57
|
ifNoneMatch: boolean;
|
|
23
58
|
};
|
|
24
59
|
prefer?: {
|
|
60
|
+
/**
|
|
61
|
+
* @link http://docs.oasis-open.org/odata/odata/v4.0/errata02/os/complete/part1-protocol/odata-v4.0-errata02-os-part1-protocol-complete.html#_Toc406398238
|
|
62
|
+
*/
|
|
25
63
|
maxPageSize?: number;
|
|
64
|
+
/**
|
|
65
|
+
* @link http://docs.oasis-open.org/odata/odata/v4.0/errata02/os/complete/part1-protocol/odata-v4.0-errata02-os-part1-protocol-complete.html#_Toc406398240
|
|
66
|
+
*/
|
|
26
67
|
return?: 'representation' | 'minimal';
|
|
68
|
+
/**
|
|
69
|
+
* @link http://docs.oasis-open.org/odata/odata/v4.0/errata02/os/complete/part1-protocol/odata-v4.0-errata02-os-part1-protocol-complete.html#_Toc406398236
|
|
70
|
+
*/
|
|
27
71
|
continueOnError?: boolean;
|
|
72
|
+
/**
|
|
73
|
+
* @link http://docs.oasis-open.org/odata/odata/v4.0/errata02/os/complete/part1-protocol/odata-v4.0-errata02-os-part1-protocol-complete.html#_Toc406398237
|
|
74
|
+
*/
|
|
28
75
|
includeAnnotations?: string;
|
|
29
76
|
};
|
|
77
|
+
deleteRefBy: 'path' | 'id';
|
|
30
78
|
constructor(config: ApiOptions);
|
|
31
79
|
get helper(): import("./helper").ODataVersionHelper;
|
|
32
80
|
}
|
package/lib/resources/index.d.ts
CHANGED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { PathSegmentNames } from '../../types';
|
|
2
|
+
import { EntityKey } from '../resource';
|
|
3
|
+
import type { ODataPathSegments, ODataSegment } from './segments';
|
|
4
|
+
export declare class SegmentHandler {
|
|
5
|
+
private segment;
|
|
6
|
+
constructor(segment: ODataSegment);
|
|
7
|
+
get name(): PathSegmentNames;
|
|
8
|
+
type(value?: string): string | undefined;
|
|
9
|
+
path(value?: string): string;
|
|
10
|
+
key<T>(value?: EntityKey<T>): EntityKey<T>;
|
|
11
|
+
hasKey(): boolean;
|
|
12
|
+
clearKey(): void;
|
|
13
|
+
parameters<T>(value?: T): T;
|
|
14
|
+
hasParameters(): boolean;
|
|
15
|
+
clearParameters(): void;
|
|
16
|
+
}
|
|
17
|
+
export declare class ODataPathSegmentsHandler<T> {
|
|
18
|
+
protected segments: ODataPathSegments;
|
|
19
|
+
constructor(segments: ODataPathSegments);
|
|
20
|
+
entitySet(): SegmentHandler;
|
|
21
|
+
singleton(): SegmentHandler;
|
|
22
|
+
action(): SegmentHandler;
|
|
23
|
+
function(): SegmentHandler;
|
|
24
|
+
keys(values?: (EntityKey<T> | undefined)[]): (EntityKey<any> | undefined)[];
|
|
25
|
+
property(): SegmentHandler;
|
|
26
|
+
navigationProperty(): SegmentHandler;
|
|
27
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { PathSegmentNames } from '../../types';
|
|
2
|
+
import { EntityKey } from '../resource';
|
|
3
|
+
import { SegmentHandler } from './handlers';
|
|
3
4
|
export declare type ODataSegment = {
|
|
4
5
|
name: PathSegmentNames;
|
|
5
6
|
path: string;
|
|
@@ -10,7 +11,7 @@ export declare type ODataSegment = {
|
|
|
10
11
|
export declare class ODataPathSegments {
|
|
11
12
|
private _segments;
|
|
12
13
|
constructor(segments?: ODataSegment[]);
|
|
13
|
-
pathAndParams(): [string, {
|
|
14
|
+
pathAndParams(escape?: boolean): [string, {
|
|
14
15
|
[name: string]: any;
|
|
15
16
|
}];
|
|
16
17
|
types({ key }?: {
|
|
@@ -33,16 +34,3 @@ export declare class ODataPathSegments {
|
|
|
33
34
|
add(name: string, path: string): SegmentHandler;
|
|
34
35
|
get(name: string): SegmentHandler;
|
|
35
36
|
}
|
|
36
|
-
export declare class SegmentHandler {
|
|
37
|
-
private segment;
|
|
38
|
-
constructor(segment: ODataSegment);
|
|
39
|
-
get name(): PathSegmentNames;
|
|
40
|
-
type(value?: string): string | undefined;
|
|
41
|
-
path(value?: string): string;
|
|
42
|
-
key<T>(value?: EntityKey<T>): EntityKey<T>;
|
|
43
|
-
hasKey(): boolean;
|
|
44
|
-
clearKey(): void;
|
|
45
|
-
parameters<T>(value?: T): T;
|
|
46
|
-
hasParameters(): boolean;
|
|
47
|
-
clearParameters(): void;
|
|
48
|
-
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export declare type Unpacked<T> = T extends (infer U)[] ? U : T;
|
|
2
2
|
export declare type Select<T> = SelectType<T> | SelectType<T>[];
|
|
3
3
|
export declare type SelectType<T> = string | keyof T;
|
|
4
|
-
export declare type Filter = FilterType | FilterType[];
|
|
4
|
+
export declare type Filter<T> = FilterType | FilterType[];
|
|
5
5
|
export declare type FilterType = string | {
|
|
6
6
|
[name: string]: any;
|
|
7
7
|
};
|
|
@@ -29,16 +29,16 @@ export declare type NestedExpandOptions<T> = {
|
|
|
29
29
|
};
|
|
30
30
|
export declare type ExpandOptions<T> = {
|
|
31
31
|
select?: Select<T>;
|
|
32
|
-
filter?: Filter
|
|
32
|
+
filter?: Filter<T>;
|
|
33
33
|
orderBy?: OrderBy<T>;
|
|
34
34
|
top?: number;
|
|
35
35
|
levels?: number | 'max';
|
|
36
|
-
count?: boolean | Filter
|
|
36
|
+
count?: boolean | Filter<T>;
|
|
37
37
|
expand?: Expand<T>;
|
|
38
38
|
};
|
|
39
39
|
export declare type Transform<T> = {
|
|
40
40
|
aggregate?: Aggregate | Array<Aggregate>;
|
|
41
|
-
filter?: Filter
|
|
41
|
+
filter?: Filter<T>;
|
|
42
42
|
groupBy?: GroupBy<T>;
|
|
43
43
|
};
|
|
44
44
|
export declare type GroupBy<T> = {
|
|
@@ -74,7 +74,7 @@ export declare type QueryOptions<T> = ExpandOptions<T> & {
|
|
|
74
74
|
key: string | number | {
|
|
75
75
|
[name: string]: any;
|
|
76
76
|
};
|
|
77
|
-
count: boolean | Filter
|
|
77
|
+
count: boolean | Filter<T>;
|
|
78
78
|
action: string;
|
|
79
79
|
func: string | {
|
|
80
80
|
[functionName: string]: {
|
|
@@ -83,9 +83,14 @@ export declare type QueryOptions<T> = ExpandOptions<T> & {
|
|
|
83
83
|
};
|
|
84
84
|
format: string;
|
|
85
85
|
aliases: QueryCustomType[];
|
|
86
|
+
escape: boolean;
|
|
86
87
|
};
|
|
87
88
|
export declare const ITEM_ROOT = "";
|
|
88
|
-
export default function <T>({ select, search, skiptoken, format, top, skip, filter, transform, orderBy, key, count, expand, action, func, }?: Partial<QueryOptions<T>>): string;
|
|
89
|
-
export declare function buildPathAndQuery<T>({ select, search, skiptoken, format, top, skip, filter, transform, orderBy, key, count, expand, action, func, }?: Partial<QueryOptions<T>>): [string, {
|
|
89
|
+
export default function <T>({ select, search, skiptoken, format, top, skip, filter, transform, orderBy, key, count, expand, action, func, aliases, escape, }?: Partial<QueryOptions<T>>): string;
|
|
90
|
+
export declare function buildPathAndQuery<T>({ select, search, skiptoken, format, top, skip, filter, transform, orderBy, key, count, expand, action, func, aliases, escape, }?: Partial<QueryOptions<T>>): [string, {
|
|
90
91
|
[name: string]: any;
|
|
91
92
|
}];
|
|
93
|
+
export declare function normalizeValue(value: Value, { aliases, escape }: {
|
|
94
|
+
aliases?: QueryCustomType[];
|
|
95
|
+
escape?: boolean;
|
|
96
|
+
}): any;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import type { QueryCustomType } from './builder';
|
|
2
|
+
import { ODataFunctions, ODataOperators, Renderable } from './syntax';
|
|
3
|
+
export declare type Connector = 'and' | 'or';
|
|
4
|
+
export declare class Expression<T> implements Renderable {
|
|
5
|
+
private _connector;
|
|
6
|
+
private _negated;
|
|
7
|
+
private _children;
|
|
8
|
+
constructor({ children, connector, negated, }?: {
|
|
9
|
+
children?: Renderable[];
|
|
10
|
+
connector?: Connector;
|
|
11
|
+
negated?: boolean;
|
|
12
|
+
});
|
|
13
|
+
get [Symbol.toStringTag](): string;
|
|
14
|
+
static s<T extends object>(): T;
|
|
15
|
+
static e<T>(connector?: Connector): Expression<T>;
|
|
16
|
+
static o<T>(): ODataOperators<T>;
|
|
17
|
+
static f<T>(): ODataFunctions<T>;
|
|
18
|
+
static filter<T extends object>(opts: (e: {
|
|
19
|
+
s: T;
|
|
20
|
+
e: (connector?: Connector) => Expression<T>;
|
|
21
|
+
o: ODataOperators<T>;
|
|
22
|
+
f: ODataFunctions<T>;
|
|
23
|
+
}) => Expression<T>): Expression<T>;
|
|
24
|
+
toJSON(): {
|
|
25
|
+
children: any[];
|
|
26
|
+
connector: Connector;
|
|
27
|
+
negated: boolean;
|
|
28
|
+
};
|
|
29
|
+
children(): Renderable[];
|
|
30
|
+
connector(): Connector;
|
|
31
|
+
negated(): boolean;
|
|
32
|
+
length(): number;
|
|
33
|
+
render({ aliases, escape, prefix, }?: {
|
|
34
|
+
aliases?: QueryCustomType[];
|
|
35
|
+
escape?: boolean;
|
|
36
|
+
prefix?: string;
|
|
37
|
+
}): string;
|
|
38
|
+
private _add;
|
|
39
|
+
or(exp: Expression<T>): Expression<T>;
|
|
40
|
+
and(exp: Expression<T>): Expression<T>;
|
|
41
|
+
not(exp: Expression<T>): Expression<T>;
|
|
42
|
+
eq(left: any, right: any, normalize?: boolean): Expression<T>;
|
|
43
|
+
ne(left: any, right: any, normalize?: boolean): Expression<T>;
|
|
44
|
+
gt(left: any, right: any, normalize?: boolean): Expression<T>;
|
|
45
|
+
ge(left: any, right: any, normalize?: boolean): Expression<T>;
|
|
46
|
+
lt(left: any, right: any, normalize?: boolean): Expression<T>;
|
|
47
|
+
le(left: any, right: any, normalize?: boolean): Expression<T>;
|
|
48
|
+
has(left: any, right: any, normalize?: boolean): Expression<T>;
|
|
49
|
+
in(left: any, right: any, normalize?: boolean): Expression<T>;
|
|
50
|
+
contains(left: any, right: any, normalize?: boolean): Expression<T>;
|
|
51
|
+
startsWith(left: any, right: any, normalize?: boolean): Expression<T>;
|
|
52
|
+
endsWith(left: any, right: any, normalize?: boolean): Expression<T>;
|
|
53
|
+
any<N extends object>(left: N[], opts: (e: {
|
|
54
|
+
s: N;
|
|
55
|
+
e: (connector?: Connector) => Expression<N>;
|
|
56
|
+
}) => Expression<N>, alias?: string): Expression<T>;
|
|
57
|
+
all<N extends object>(left: N[], opts: (e: {
|
|
58
|
+
s: N;
|
|
59
|
+
e: (connector?: Connector) => Expression<N>;
|
|
60
|
+
}) => Expression<N>, alias?: string): Expression<T>;
|
|
61
|
+
isof(type: string): Expression<T>;
|
|
62
|
+
isof(left: T, type: string): Expression<T>;
|
|
63
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { QueryOptionNames } from '../../types';
|
|
2
|
+
import { Expand, Filter, OrderBy, Select, Transform } from './builder';
|
|
3
|
+
import { Connector, Expression } from './expressions';
|
|
4
|
+
import type { ODataQueryArguments, ODataQueryOptions } from './options';
|
|
5
|
+
import { ODataFunctions, ODataOperators } from './syntax';
|
|
6
|
+
export declare class ODataQueryOptionHandler<T> {
|
|
7
|
+
private o;
|
|
8
|
+
private n;
|
|
9
|
+
constructor(o: {
|
|
10
|
+
[name: string]: any;
|
|
11
|
+
}, n: QueryOptionNames);
|
|
12
|
+
get name(): QueryOptionNames;
|
|
13
|
+
toJSON(): any;
|
|
14
|
+
empty(): boolean;
|
|
15
|
+
value(v?: any): any;
|
|
16
|
+
private assertArray;
|
|
17
|
+
push(value: any): void;
|
|
18
|
+
remove(value: any): void;
|
|
19
|
+
at(index: number): any;
|
|
20
|
+
private assertObject;
|
|
21
|
+
set(path: string, value: any): void;
|
|
22
|
+
get(path: string, def?: any): any;
|
|
23
|
+
unset(path: string): void;
|
|
24
|
+
has(path: string): boolean;
|
|
25
|
+
assign(values: {
|
|
26
|
+
[attr: string]: any;
|
|
27
|
+
}): Object;
|
|
28
|
+
clear(): void;
|
|
29
|
+
}
|
|
30
|
+
export declare class ODataQueryOptionsHandler<T> {
|
|
31
|
+
protected options: ODataQueryOptions<T>;
|
|
32
|
+
constructor(options: ODataQueryOptions<T>);
|
|
33
|
+
/**
|
|
34
|
+
* Create a new odata alias parameter
|
|
35
|
+
* @link https://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part2-url-conventions.html#sec_ParameterAliases
|
|
36
|
+
* @param value The value of the alias
|
|
37
|
+
* @param name The name of the alias
|
|
38
|
+
* @returns The alias
|
|
39
|
+
*/
|
|
40
|
+
alias(value: any, name?: string): import("./builder").QueryCustomType;
|
|
41
|
+
select(opts: Select<T>): ODataQueryOptionHandler<T>;
|
|
42
|
+
select(): ODataQueryOptionHandler<T>;
|
|
43
|
+
expand(opts: Expand<T>): ODataQueryOptionHandler<T>;
|
|
44
|
+
expand(): ODataQueryOptionHandler<T>;
|
|
45
|
+
/**
|
|
46
|
+
* @link https://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part2-url-conventions.html#sec_SystemQueryOptioncompute
|
|
47
|
+
*/
|
|
48
|
+
compute(opts: (e: {
|
|
49
|
+
e: Expression<T>;
|
|
50
|
+
}) => Expression<T>): Expression<T>;
|
|
51
|
+
compute(opts: string): ODataQueryOptionHandler<T>;
|
|
52
|
+
compute(): ODataQueryOptionHandler<T>;
|
|
53
|
+
/**
|
|
54
|
+
* @link https://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part2-url-conventions.html#sec_SystemQueryOptionformat
|
|
55
|
+
*/
|
|
56
|
+
format(opts: string): ODataQueryOptionHandler<T>;
|
|
57
|
+
format(): ODataQueryOptionHandler<T>;
|
|
58
|
+
transform(opts: Transform<T>): ODataQueryOptionHandler<T>;
|
|
59
|
+
transform(): ODataQueryOptionHandler<T>;
|
|
60
|
+
search(opts: string): ODataQueryOptionHandler<T>;
|
|
61
|
+
search(): ODataQueryOptionHandler<T>;
|
|
62
|
+
filter(opts: (e: {
|
|
63
|
+
s: T;
|
|
64
|
+
e: (connector?: Connector) => Expression<T>;
|
|
65
|
+
o: ODataOperators<T>;
|
|
66
|
+
f: ODataFunctions<T>;
|
|
67
|
+
}) => Expression<T>): Expression<T>;
|
|
68
|
+
filter(opts: Filter<T>): ODataQueryOptionHandler<T>;
|
|
69
|
+
filter(): ODataQueryOptionHandler<T>;
|
|
70
|
+
orderBy(opts: (e: {
|
|
71
|
+
e: () => Expression<T>;
|
|
72
|
+
not: (e: Expression<T>) => Expression<T>;
|
|
73
|
+
}) => Expression<T>): Expression<T>;
|
|
74
|
+
orderBy(opts: OrderBy<T>): ODataQueryOptionHandler<T>;
|
|
75
|
+
orderBy(): ODataQueryOptionHandler<T>;
|
|
76
|
+
top(opts: number): ODataQueryOptionHandler<T>;
|
|
77
|
+
top(): ODataQueryOptionHandler<T>;
|
|
78
|
+
skip(opts: number): ODataQueryOptionHandler<T>;
|
|
79
|
+
skip(): ODataQueryOptionHandler<T>;
|
|
80
|
+
skiptoken(opts: string): ODataQueryOptionHandler<T>;
|
|
81
|
+
skiptoken(): ODataQueryOptionHandler<T>;
|
|
82
|
+
paging({ skip, skiptoken, top, }?: {
|
|
83
|
+
skip?: number;
|
|
84
|
+
skiptoken?: string;
|
|
85
|
+
top?: number;
|
|
86
|
+
}): void;
|
|
87
|
+
clearPaging(): void;
|
|
88
|
+
apply(query: ODataQueryArguments<T>): void;
|
|
89
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { QueryOptionNames } from '../../types';
|
|
2
|
+
import { Expand, Filter, OrderBy, Select, Transform } from './builder';
|
|
3
|
+
import { Expression } from './expressions';
|
|
4
|
+
import { ODataQueryOptionHandler } from './handlers';
|
|
5
|
+
export declare type ODataQueryArguments<T> = {
|
|
6
|
+
[QueryOptionNames.select]?: Select<T>;
|
|
7
|
+
[QueryOptionNames.filter]?: Filter<T>;
|
|
8
|
+
[QueryOptionNames.search]?: string;
|
|
9
|
+
[QueryOptionNames.compute]?: string;
|
|
10
|
+
[QueryOptionNames.transform]?: Transform<T>;
|
|
11
|
+
[QueryOptionNames.orderBy]?: OrderBy<T>;
|
|
12
|
+
[QueryOptionNames.top]?: number;
|
|
13
|
+
[QueryOptionNames.skip]?: number;
|
|
14
|
+
[QueryOptionNames.skiptoken]?: string;
|
|
15
|
+
[QueryOptionNames.expand]?: Expand<T>;
|
|
16
|
+
[QueryOptionNames.format]?: string;
|
|
17
|
+
};
|
|
18
|
+
export declare class ODataQueryOptions<T> {
|
|
19
|
+
options: {
|
|
20
|
+
[name: string]: any;
|
|
21
|
+
};
|
|
22
|
+
constructor(options?: {
|
|
23
|
+
[name: string]: any;
|
|
24
|
+
});
|
|
25
|
+
pathAndParams(escape?: boolean): [string, {
|
|
26
|
+
[name: string]: any;
|
|
27
|
+
}];
|
|
28
|
+
toString(): string;
|
|
29
|
+
toJSON(): {};
|
|
30
|
+
toQueryArguments(): ODataQueryArguments<T>;
|
|
31
|
+
clone<O>(): ODataQueryOptions<O>;
|
|
32
|
+
expression(name: QueryOptionNames, exp: Expression<T>): Expression<T>;
|
|
33
|
+
option<O>(name: QueryOptionNames, opts?: O): ODataQueryOptionHandler<O>;
|
|
34
|
+
has(name: QueryOptionNames): boolean;
|
|
35
|
+
remove(...names: QueryOptionNames[]): void;
|
|
36
|
+
keep(...names: QueryOptionNames[]): void;
|
|
37
|
+
clear(): void;
|
|
38
|
+
}
|