angular-odata 0.123.0 → 0.125.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/esm2022/lib/api.mjs +1 -1
- package/esm2022/lib/cache/cache.mjs +4 -2
- package/esm2022/lib/cache/storage.mjs +1 -1
- package/esm2022/lib/client.mjs +5 -6
- package/esm2022/lib/constants.mjs +2 -1
- package/esm2022/lib/helper.mjs +2 -2
- package/esm2022/lib/loaders.mjs +1 -1
- package/esm2022/lib/models/collection.mjs +83 -93
- package/esm2022/lib/models/model.mjs +154 -112
- package/esm2022/lib/models/options.mjs +86 -59
- package/esm2022/lib/module.mjs +6 -7
- package/esm2022/lib/resources/path/segments.mjs +6 -6
- package/esm2022/lib/resources/query/builder.mjs +11 -6
- package/esm2022/lib/resources/query/expressions/base.mjs +1 -1
- package/esm2022/lib/resources/query/expressions/compute.mjs +5 -5
- package/esm2022/lib/resources/query/expressions/count.mjs +19 -9
- package/esm2022/lib/resources/query/expressions/expand.mjs +15 -9
- package/esm2022/lib/resources/query/expressions/filter.mjs +7 -7
- package/esm2022/lib/resources/query/expressions/orderby.mjs +7 -7
- package/esm2022/lib/resources/query/expressions/search.mjs +5 -5
- package/esm2022/lib/resources/query/expressions/select.mjs +5 -5
- package/esm2022/lib/resources/query/expressions/syntax.mjs +89 -45
- package/esm2022/lib/resources/query/handlers.mjs +1 -1
- package/esm2022/lib/resources/query/options.mjs +6 -6
- package/esm2022/lib/resources/request.mjs +1 -1
- package/esm2022/lib/resources/resource.mjs +11 -5
- package/esm2022/lib/resources/responses/annotations.mjs +1 -1
- package/esm2022/lib/resources/responses/csdl/csdl-annotation.mjs +1 -1
- package/esm2022/lib/resources/responses/csdl/csdl-entity-container.mjs +1 -1
- package/esm2022/lib/resources/responses/csdl/csdl-entity-set.mjs +1 -1
- package/esm2022/lib/resources/responses/csdl/csdl-enum-type.mjs +1 -1
- package/esm2022/lib/resources/responses/csdl/csdl-function-action.mjs +1 -1
- package/esm2022/lib/resources/responses/csdl/csdl-navigation-property-binding.mjs +1 -1
- package/esm2022/lib/resources/responses/csdl/csdl-reference.mjs +1 -1
- package/esm2022/lib/resources/responses/csdl/csdl-schema.mjs +1 -1
- package/esm2022/lib/resources/responses/csdl/csdl-singleton.mjs +1 -1
- package/esm2022/lib/resources/responses/csdl/csdl-structural-property.mjs +1 -1
- package/esm2022/lib/resources/responses/csdl/csdl-structured-type.mjs +1 -1
- package/esm2022/lib/resources/responses/csdl/csdl-type-definition.mjs +1 -1
- package/esm2022/lib/resources/responses/metadata.mjs +2 -3
- package/esm2022/lib/resources/responses/response.mjs +1 -1
- package/esm2022/lib/resources/types/action.mjs +1 -1
- package/esm2022/lib/resources/types/batch.mjs +1 -1
- package/esm2022/lib/resources/types/count.mjs +1 -1
- package/esm2022/lib/resources/types/entity-set.mjs +1 -1
- package/esm2022/lib/resources/types/entity.mjs +1 -1
- package/esm2022/lib/resources/types/function.mjs +1 -1
- package/esm2022/lib/resources/types/media.mjs +1 -1
- package/esm2022/lib/resources/types/navigation-property.mjs +1 -1
- package/esm2022/lib/resources/types/property.mjs +1 -1
- package/esm2022/lib/resources/types/reference.mjs +1 -1
- package/esm2022/lib/resources/types/singleton.mjs +1 -1
- package/esm2022/lib/resources/types/value.mjs +1 -1
- package/esm2022/lib/schema/annotation.mjs +1 -1
- package/esm2022/lib/schema/callable.mjs +1 -1
- package/esm2022/lib/schema/element.mjs +1 -1
- package/esm2022/lib/schema/entity-container.mjs +1 -1
- package/esm2022/lib/schema/enum-type.mjs +1 -1
- package/esm2022/lib/schema/parsers/callable.mjs +1 -1
- package/esm2022/lib/schema/parsers/edm.mjs +1 -1
- package/esm2022/lib/schema/parsers/enum-type.mjs +1 -1
- package/esm2022/lib/schema/parsers/structured-type.mjs +14 -2
- package/esm2022/lib/schema/schema.mjs +1 -1
- package/esm2022/lib/schema/structured-type.mjs +9 -4
- package/esm2022/lib/services/base.mjs +1 -1
- package/esm2022/lib/services/entity-set.mjs +1 -1
- package/esm2022/lib/services/factory.mjs +5 -6
- package/esm2022/lib/services/singleton.mjs +1 -1
- package/esm2022/lib/settings.mjs +1 -1
- package/esm2022/lib/types.mjs +1 -1
- package/esm2022/lib/utils/arrays.mjs +1 -1
- package/esm2022/lib/utils/durations.mjs +1 -1
- package/esm2022/lib/utils/enums.mjs +1 -1
- package/esm2022/lib/utils/http.mjs +1 -1
- package/esm2022/lib/utils/objects.mjs +1 -1
- package/esm2022/lib/utils/odata.mjs +1 -1
- package/esm2022/lib/utils/types.mjs +4 -1
- package/fesm2022/angular-odata.mjs +521 -363
- package/fesm2022/angular-odata.mjs.map +1 -1
- package/lib/constants.d.ts +1 -0
- package/lib/helper.d.ts +10 -10
- package/lib/models/collection.d.ts +4 -5
- package/lib/models/model.d.ts +9 -9
- package/lib/models/options.d.ts +31 -10
- package/lib/resources/path/segments.d.ts +14 -5
- package/lib/resources/query/expressions/base.d.ts +3 -1
- package/lib/resources/query/expressions/compute.d.ts +8 -6
- package/lib/resources/query/expressions/count.d.ts +11 -8
- package/lib/resources/query/expressions/expand.d.ts +15 -12
- package/lib/resources/query/expressions/filter.d.ts +7 -5
- package/lib/resources/query/expressions/orderby.d.ts +9 -6
- package/lib/resources/query/expressions/search.d.ts +9 -6
- package/lib/resources/query/expressions/select.d.ts +7 -5
- package/lib/resources/query/expressions/syntax.d.ts +16 -13
- package/lib/resources/query/options.d.ts +14 -5
- package/lib/resources/resource.d.ts +1 -1
- package/lib/resources/responses/annotations.d.ts +9 -9
- package/lib/schema/parsers/structured-type.d.ts +3 -0
- package/lib/schema/structured-type.d.ts +2 -1
- package/lib/utils/enums.d.ts +7 -7
- package/lib/utils/types.d.ts +1 -0
- package/package.json +1 -1
package/lib/constants.d.ts
CHANGED
|
@@ -59,6 +59,7 @@ export declare const NEWLINE = "\r\n";
|
|
|
59
59
|
export declare const NEWLINE_REGEXP: RegExp;
|
|
60
60
|
export declare const CACHE_KEY_SEPARATOR = ":";
|
|
61
61
|
export declare const CID_FIELD_NAME = "_cid";
|
|
62
|
+
export declare const EVENT_SPLITTER: RegExp;
|
|
62
63
|
export declare const COMPUTED: RegExp;
|
|
63
64
|
export declare const OPTIMISTIC_CONCURRENCY: RegExp;
|
|
64
65
|
export declare const DESCRIPTION: RegExp;
|
package/lib/helper.d.ts
CHANGED
|
@@ -26,31 +26,31 @@ export interface ODataVersionHelper {
|
|
|
26
26
|
ODATA_DEFERRED: string;
|
|
27
27
|
ODATA_ANNOTATION: string;
|
|
28
28
|
entity(value: {
|
|
29
|
-
[
|
|
29
|
+
[name: string]: any;
|
|
30
30
|
}): any;
|
|
31
31
|
entities(value: {
|
|
32
|
-
[
|
|
32
|
+
[name: string]: any;
|
|
33
33
|
}): any;
|
|
34
34
|
property(value: {
|
|
35
|
-
[
|
|
35
|
+
[name: string]: any;
|
|
36
36
|
}): any;
|
|
37
37
|
annotations(value: {
|
|
38
|
-
[
|
|
38
|
+
[name: string]: any;
|
|
39
39
|
}): Map<string, any>;
|
|
40
40
|
attributes(value: {
|
|
41
|
-
[
|
|
41
|
+
[name: string]: any;
|
|
42
42
|
}, metadata: ODataMetadataType): any;
|
|
43
43
|
context(annots: Map<string, any> | {
|
|
44
|
-
[
|
|
44
|
+
[name: string]: any;
|
|
45
45
|
}): ODataContext;
|
|
46
46
|
id(annots: Map<string, any> | {
|
|
47
|
-
[
|
|
47
|
+
[name: string]: any;
|
|
48
48
|
}): string | undefined;
|
|
49
49
|
etag(annots: Map<string, any> | {
|
|
50
|
-
[
|
|
50
|
+
[name: string]: any;
|
|
51
51
|
}): string | undefined;
|
|
52
52
|
type(annots: Map<string, any> | {
|
|
53
|
-
[
|
|
53
|
+
[name: string]: any;
|
|
54
54
|
}): string | undefined;
|
|
55
55
|
count(annots: Map<string, any>): number | undefined;
|
|
56
56
|
functions(annots: Map<string, any>): Map<string, any>;
|
|
@@ -65,7 +65,7 @@ export interface ODataVersionHelper {
|
|
|
65
65
|
mediaContentType(annots: Map<string, any>): string | undefined;
|
|
66
66
|
deltaLink(annots: Map<string, any>): string | undefined;
|
|
67
67
|
countParam(): {
|
|
68
|
-
[
|
|
68
|
+
[name: string]: string;
|
|
69
69
|
};
|
|
70
70
|
}
|
|
71
71
|
export declare const ODataHelper: {
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { EventEmitter } from '@angular/core';
|
|
2
1
|
import { Observable } from 'rxjs';
|
|
3
2
|
import { ODataActionOptions, ODataEntitiesAnnotations, ODataEntitySetResource, ODataFunctionOptions, ODataNavigationPropertyResource, ODataOptions, ODataPropertyResource, ODataQueryOptionsHandler, ODataResource } from '../resources';
|
|
4
3
|
import { ODataStructuredType } from '../schema/structured-type';
|
|
5
4
|
import { ODataModel } from './model';
|
|
6
|
-
import { ModelFieldOptions, ODataModelEntry,
|
|
5
|
+
import { ModelFieldOptions, ODataModelEntry, ODataModelEventEmitter, ODataModelField } from './options';
|
|
7
6
|
export declare class ODataCollection<T, M extends ODataModel<T>> implements Iterable<M> {
|
|
8
7
|
static model: typeof ODataModel | null;
|
|
9
8
|
_parent: [
|
|
@@ -23,7 +22,7 @@ export declare class ODataCollection<T, M extends ODataModel<T>> implements Iter
|
|
|
23
22
|
_model: typeof ODataModel;
|
|
24
23
|
models(): M[];
|
|
25
24
|
get length(): number;
|
|
26
|
-
events$:
|
|
25
|
+
events$: ODataModelEventEmitter<T>;
|
|
27
26
|
constructor(entities?: Partial<T>[] | {
|
|
28
27
|
[name: string]: any;
|
|
29
28
|
}[], { parent, resource, annots, model, reset, }?: {
|
|
@@ -134,8 +133,8 @@ export declare class ODataCollection<T, M extends ODataModel<T>> implements Iter
|
|
|
134
133
|
silent?: boolean;
|
|
135
134
|
}): void;
|
|
136
135
|
query(ctx: (q: ODataQueryOptionsHandler<T>, s?: ODataStructuredType<T>) => void): this;
|
|
137
|
-
callFunction<P, R>(name: string, params: P | null, responseType: 'property' | 'model' | 'collection' | 'none',
|
|
138
|
-
callAction<P, R>(name: string, params: P | null, responseType: 'property' | 'model' | 'collection' | 'none',
|
|
136
|
+
callFunction<P, R>(name: string, params: P | null, responseType: 'property' | 'model' | 'collection' | 'none', options?: ODataFunctionOptions<R>): Observable<R | ODataModel<R> | ODataCollection<R, ODataModel<R>> | null>;
|
|
137
|
+
callAction<P, R>(name: string, params: P | null, responseType: 'property' | 'model' | 'collection' | 'none', options?: ODataActionOptions<R>): Observable<R | ODataModel<R> | ODataCollection<R, ODataModel<R>> | null>;
|
|
139
138
|
private _unlink;
|
|
140
139
|
private _link;
|
|
141
140
|
private _findEntry;
|
package/lib/models/model.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { EventEmitter } from '@angular/core';
|
|
2
1
|
import { Observable } from 'rxjs';
|
|
3
2
|
import { EntityKey, ODataActionOptions, ODataEntityAnnotations, ODataEntityResource, ODataFunctionOptions, ODataNavigationPropertyResource, ODataOptions, ODataPropertyResource, ODataQueryArgumentsOptions, ODataQueryOptionsHandler, ODataResource, ODataSingletonResource } from '../resources';
|
|
4
3
|
import { ODataStructuredType } from '../schema';
|
|
5
4
|
import { ODataCollection } from './collection';
|
|
6
|
-
import { ModelOptions,
|
|
5
|
+
import { ModelOptions, ODataModelField, ODataModelOptions, ODataModelAttribute, ODataModelEventEmitter } from './options';
|
|
7
6
|
import { ParserOptions } from '../types';
|
|
8
7
|
export declare class ODataModel<T> {
|
|
9
8
|
static options: ModelOptions;
|
|
@@ -25,12 +24,12 @@ export declare class ODataModel<T> {
|
|
|
25
24
|
resource: ODataResource<T> | null;
|
|
26
25
|
}[];
|
|
27
26
|
_attributes: Map<string, ODataModelAttribute<any>>;
|
|
28
|
-
_annotations: ODataEntityAnnotations<T
|
|
27
|
+
_annotations: ODataEntityAnnotations<T>;
|
|
29
28
|
_reset: boolean;
|
|
30
29
|
_reparent: boolean;
|
|
31
30
|
_silent: boolean;
|
|
32
31
|
_meta: ODataModelOptions<any>;
|
|
33
|
-
events$:
|
|
32
|
+
events$: ODataModelEventEmitter<T>;
|
|
34
33
|
constructor(data?: Partial<T> | {
|
|
35
34
|
[name: string]: any;
|
|
36
35
|
}, { parent, resource, annots, reset, }?: {
|
|
@@ -74,7 +73,7 @@ export declare class ODataModel<T> {
|
|
|
74
73
|
[name: string]: any;
|
|
75
74
|
} | null | undefined;
|
|
76
75
|
_errors?: {
|
|
77
|
-
[
|
|
76
|
+
[name: string]: any;
|
|
78
77
|
};
|
|
79
78
|
validate({ method, navigation, }?: {
|
|
80
79
|
method?: 'create' | 'update' | 'modify';
|
|
@@ -158,13 +157,14 @@ export declare class ODataModel<T> {
|
|
|
158
157
|
* @returns The result of the context
|
|
159
158
|
*/
|
|
160
159
|
asEntity<R>(ctx: (model: this) => R): R;
|
|
161
|
-
callFunction<P, R>(name: string, params: P | null, responseType: 'property' | 'model' | 'collection' | 'none' | 'blob' | 'arraybuffer',
|
|
160
|
+
callFunction<P, R>(name: string, params: P | null, responseType: 'property' | 'model' | 'collection' | 'none' | 'blob' | 'arraybuffer', options?: ODataFunctionOptions<R>): Observable<R | ODataModel<R> | ODataCollection<R, ODataModel<R>> | null | Blob | ArrayBuffer>;
|
|
162
161
|
callAction<P, R>(name: string, params: P | null, responseType?: 'property' | 'model' | 'collection' | 'none' | 'blob' | 'arraybuffer', { ...options }?: {} & ODataActionOptions<R>): Observable<R | ODataModel<R> | ODataCollection<R, ODataModel<R>> | null | Blob | ArrayBuffer>;
|
|
163
162
|
cast<S>(type: string): ODataModel<S>;
|
|
164
|
-
fetchNavigationProperty<S>(name: keyof T | string, responseType: 'model' | 'collection',
|
|
165
|
-
|
|
163
|
+
fetchNavigationProperty<S>(name: keyof T | string, responseType: 'model' | 'collection', options?: ODataQueryArgumentsOptions<S>): Observable<ODataModel<S> | ODataCollection<S, ODataModel<S>> | null>;
|
|
164
|
+
fetchAttribute<P>(name: keyof T | string, options?: ODataQueryArgumentsOptions<P>): Observable<P | ODataModel<P> | ODataCollection<P, ODataModel<P>> | null>;
|
|
165
|
+
getAttribute<P>(name: keyof T | string): P | ODataModel<P> | ODataCollection<P, ODataModel<P>> | null | undefined;
|
|
166
|
+
setAttribute<N>(name: keyof T | string, model: ODataModel<N> | ODataCollection<N, ODataModel<N>> | null, options?: ODataOptions): Observable<this>;
|
|
166
167
|
setReference<N>(name: keyof T | string, model: ODataModel<N> | ODataCollection<N, ODataModel<N>> | null, options?: ODataOptions): Observable<this>;
|
|
167
|
-
getReference<P>(name: keyof T | string): ODataModel<P> | ODataCollection<P, ODataModel<P>> | null;
|
|
168
168
|
get [Symbol.toStringTag](): string;
|
|
169
169
|
equals(other: ODataModel<T>): boolean;
|
|
170
170
|
collection(): ODataCollection<T, ODataModel<T>> | undefined;
|
package/lib/models/options.d.ts
CHANGED
|
@@ -18,33 +18,54 @@ export declare enum ODataModelEventType {
|
|
|
18
18
|
Attach = "attach"
|
|
19
19
|
}
|
|
20
20
|
export declare class ODataModelEvent<T> {
|
|
21
|
-
name: ODataModelEventType;
|
|
21
|
+
name: ODataModelEventType | string;
|
|
22
22
|
value?: any;
|
|
23
23
|
previous?: any;
|
|
24
24
|
options?: any;
|
|
25
|
-
constructor(name: ODataModelEventType, { model, collection, previous, value, attr, options, }?: {
|
|
25
|
+
constructor(name: ODataModelEventType | string, { model, collection, previous, value, attr, options, bubbly, chain, }?: {
|
|
26
26
|
model?: ODataModel<T>;
|
|
27
27
|
collection?: ODataCollection<T, ODataModel<T>>;
|
|
28
28
|
attr?: ODataModelAttribute<any> | number;
|
|
29
29
|
previous?: any;
|
|
30
30
|
value?: any;
|
|
31
31
|
options?: any;
|
|
32
|
+
bubbly?: boolean;
|
|
33
|
+
chain?: [
|
|
34
|
+
ODataModel<any> | ODataCollection<any, ODataModel<any>>,
|
|
35
|
+
ODataModelAttribute<any> | number | null
|
|
36
|
+
][];
|
|
32
37
|
});
|
|
33
|
-
bubbling: boolean;
|
|
34
|
-
stopPropagation(): void;
|
|
35
38
|
chain: [
|
|
36
39
|
ODataModel<any> | ODataCollection<any, ODataModel<any>>,
|
|
37
40
|
ODataModelAttribute<any> | number | null
|
|
38
41
|
][];
|
|
39
42
|
push(model: ODataModel<any> | ODataCollection<any, ODataModel<any>>, attr: ODataModelAttribute<any> | number): ODataModelEvent<T>;
|
|
43
|
+
bubbly: boolean;
|
|
44
|
+
stopPropagation(): void;
|
|
40
45
|
visited(model: ODataModel<any> | ODataCollection<any, ODataModel<any>>): boolean;
|
|
46
|
+
canContinueWith(self: ODataModel<T> | ODataCollection<T, ODataModel<T>>): boolean;
|
|
41
47
|
get path(): string;
|
|
42
48
|
model?: ODataModel<T>;
|
|
43
49
|
get currentModel(): ODataModel<any> | undefined;
|
|
44
50
|
collection?: ODataCollection<T, ODataModel<T>>;
|
|
45
51
|
get currentCollection(): ODataCollection<any, ODataModel<any>> | undefined;
|
|
46
52
|
}
|
|
47
|
-
export declare
|
|
53
|
+
export declare class ODataModelEventEmitter<T> extends EventEmitter<ODataModelEvent<T>> {
|
|
54
|
+
model?: ODataModel<T>;
|
|
55
|
+
collection?: ODataCollection<T, ODataModel<T>>;
|
|
56
|
+
constructor({ model, collection, }?: {
|
|
57
|
+
model?: ODataModel<T>;
|
|
58
|
+
collection?: ODataCollection<T, ODataModel<T>>;
|
|
59
|
+
});
|
|
60
|
+
trigger(type: ODataModelEventType | string, { collection, previous, value, attr, options, bubbly, }?: {
|
|
61
|
+
collection?: ODataCollection<T, ODataModel<T>>;
|
|
62
|
+
attr?: ODataModelAttribute<any> | number;
|
|
63
|
+
previous?: any;
|
|
64
|
+
value?: any;
|
|
65
|
+
options?: any;
|
|
66
|
+
bubbly?: boolean;
|
|
67
|
+
}): void;
|
|
68
|
+
}
|
|
48
69
|
export declare const INCLUDE_SHALLOW: {
|
|
49
70
|
include_concurrency: boolean;
|
|
50
71
|
include_computed: boolean;
|
|
@@ -64,9 +85,7 @@ export declare enum ODataModelState {
|
|
|
64
85
|
}
|
|
65
86
|
export type ModelOptions = {
|
|
66
87
|
cid?: string;
|
|
67
|
-
fields:
|
|
68
|
-
[name: string]: ModelFieldOptions;
|
|
69
|
-
};
|
|
88
|
+
fields: Map<string, ModelFieldOptions>;
|
|
70
89
|
};
|
|
71
90
|
export type ModelFieldOptions = {
|
|
72
91
|
field?: string;
|
|
@@ -156,7 +175,7 @@ export declare class ODataModelAttribute<T> {
|
|
|
156
175
|
private value?;
|
|
157
176
|
private change?;
|
|
158
177
|
private subscription?;
|
|
159
|
-
events$:
|
|
178
|
+
events$: ODataModelEventEmitter<T>;
|
|
160
179
|
constructor(_model: ODataModel<any>, _field: ODataModelField<T>);
|
|
161
180
|
get navigation(): boolean;
|
|
162
181
|
get computed(): boolean | undefined;
|
|
@@ -187,12 +206,12 @@ export declare class ODataModelOptions<T> {
|
|
|
187
206
|
name: string;
|
|
188
207
|
cid: string;
|
|
189
208
|
base?: string;
|
|
190
|
-
open?: boolean;
|
|
191
209
|
private _fields;
|
|
192
210
|
schema: ODataStructuredType<T>;
|
|
193
211
|
entitySet?: ODataEntitySet;
|
|
194
212
|
parent?: ODataModelOptions<any>;
|
|
195
213
|
children: ODataModelOptions<any>[];
|
|
214
|
+
events$: ODataModelEventEmitter<T>;
|
|
196
215
|
constructor({ options, schema, }: {
|
|
197
216
|
options: ModelOptions;
|
|
198
217
|
schema: ODataStructuredType<T>;
|
|
@@ -202,6 +221,8 @@ export declare class ODataModelOptions<T> {
|
|
|
202
221
|
alias?: boolean;
|
|
203
222
|
}): string;
|
|
204
223
|
isOpenType(): boolean;
|
|
224
|
+
isEntityType(): boolean;
|
|
225
|
+
isComplexType(): boolean;
|
|
205
226
|
isTypeOf(type: string): boolean;
|
|
206
227
|
isModelFor(entity: T | {
|
|
207
228
|
[name: string]: any;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PathSegment } from '../../types';
|
|
1
|
+
import { Parser, PathSegment } from '../../types';
|
|
2
2
|
import { EntityKey } from '../resource';
|
|
3
3
|
import { SegmentHandler } from './handlers';
|
|
4
4
|
export type ODataSegment = {
|
|
@@ -11,14 +11,23 @@ export type ODataSegment = {
|
|
|
11
11
|
export declare class ODataPathSegments {
|
|
12
12
|
private _segments;
|
|
13
13
|
constructor(segments?: ODataSegment[]);
|
|
14
|
-
pathAndParams(escape
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
pathAndParams({ escape, parser, }?: {
|
|
15
|
+
escape?: boolean;
|
|
16
|
+
parser?: Parser<any>;
|
|
17
|
+
}): [
|
|
18
|
+
string,
|
|
19
|
+
{
|
|
20
|
+
[name: string]: any;
|
|
21
|
+
}
|
|
22
|
+
];
|
|
17
23
|
types({ key }?: {
|
|
18
24
|
key?: boolean;
|
|
19
25
|
}): string[];
|
|
20
26
|
keys(values?: (EntityKey<any> | undefined)[]): (EntityKey<any> | undefined)[];
|
|
21
|
-
toString(
|
|
27
|
+
toString({ escape, parser, }?: {
|
|
28
|
+
escape?: boolean;
|
|
29
|
+
parser?: Parser<any>;
|
|
30
|
+
}): string;
|
|
22
31
|
toJSON(): any[];
|
|
23
32
|
clone(): ODataPathSegments;
|
|
24
33
|
find(predicate: (segment: ODataSegment) => boolean): ODataSegment | undefined;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Parser } from '../../../types';
|
|
1
2
|
import type { QueryCustomType } from '../builder';
|
|
2
3
|
import { Renderable } from './syntax';
|
|
3
4
|
export declare abstract class Expression<T> implements Renderable {
|
|
@@ -6,10 +7,11 @@ export declare abstract class Expression<T> implements Renderable {
|
|
|
6
7
|
children?: Renderable[];
|
|
7
8
|
});
|
|
8
9
|
get [Symbol.toStringTag](): string;
|
|
9
|
-
abstract render({ aliases, escape, prefix, }: {
|
|
10
|
+
abstract render({ aliases, escape, prefix, parser, }: {
|
|
10
11
|
aliases?: QueryCustomType[];
|
|
11
12
|
escape?: boolean;
|
|
12
13
|
prefix?: string;
|
|
14
|
+
parser?: Parser<T>;
|
|
13
15
|
}): string;
|
|
14
16
|
abstract clone(): Expression<T>;
|
|
15
17
|
children(): Renderable[];
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Parser } from '../../../types';
|
|
1
2
|
import type { QueryCustomType } from '../builder';
|
|
2
3
|
import { Expression } from './base';
|
|
3
4
|
import { ODataFunctions, ODataOperators, Renderable } from './syntax';
|
|
@@ -11,15 +12,16 @@ export declare class ComputeExpression<T> extends Expression<T> {
|
|
|
11
12
|
children?: Renderable[];
|
|
12
13
|
names?: string[];
|
|
13
14
|
});
|
|
14
|
-
static compute<T
|
|
15
|
-
render({ aliases, escape, prefix, }?: {
|
|
16
|
-
aliases?: QueryCustomType[]
|
|
17
|
-
escape?: boolean
|
|
18
|
-
prefix?: string
|
|
15
|
+
static compute<T>(opts: (builder: ComputeExpressionBuilder<T>, current?: ComputeExpression<T>) => ComputeExpression<T>, current?: ComputeExpression<T>): ComputeExpression<T>;
|
|
16
|
+
render({ aliases, escape, prefix, parser, }?: {
|
|
17
|
+
aliases?: QueryCustomType[];
|
|
18
|
+
escape?: boolean;
|
|
19
|
+
prefix?: string;
|
|
20
|
+
parser?: Parser<T>;
|
|
19
21
|
}): string;
|
|
20
22
|
clone(): ComputeExpression<T>;
|
|
21
23
|
private _add;
|
|
22
|
-
field<T
|
|
24
|
+
field<T>(name: string, opts: (e: {
|
|
23
25
|
o: ODataOperators<T>;
|
|
24
26
|
f: ODataFunctions<T>;
|
|
25
27
|
}) => Renderable): ComputeExpression<T>;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import { Parser } from '../../../types';
|
|
1
2
|
import type { QueryCustomType } from '../builder';
|
|
2
3
|
import { Expression } from './base';
|
|
3
4
|
import { FilterExpression, FilterExpressionBuilder } from './filter';
|
|
4
5
|
import { Renderable } from './syntax';
|
|
5
|
-
export declare class CountField<T
|
|
6
|
+
export declare class CountField<T> implements Renderable {
|
|
6
7
|
protected field: any;
|
|
7
8
|
private values;
|
|
8
9
|
constructor(field: any, values?: {
|
|
@@ -12,10 +13,11 @@ export declare class CountField<T extends object> implements Renderable {
|
|
|
12
13
|
toJSON(): {
|
|
13
14
|
field: any;
|
|
14
15
|
};
|
|
15
|
-
render({ aliases, escape, prefix, }: {
|
|
16
|
+
render({ aliases, escape, prefix, parser, }: {
|
|
16
17
|
aliases?: QueryCustomType[];
|
|
17
18
|
escape?: boolean;
|
|
18
19
|
prefix?: string;
|
|
20
|
+
parser?: Parser<T>;
|
|
19
21
|
}): string;
|
|
20
22
|
filter(opts: (builder: FilterExpressionBuilder<T>, current?: FilterExpression<T>) => FilterExpression<T>): any;
|
|
21
23
|
clone(): CountField<T>;
|
|
@@ -29,15 +31,16 @@ export declare class CountExpression<T> extends Expression<T> {
|
|
|
29
31
|
constructor({ children, }?: {
|
|
30
32
|
children?: Renderable[];
|
|
31
33
|
});
|
|
32
|
-
static count<T
|
|
34
|
+
static count<T>(opts: (builder: CountExpressionBuilder<T>, current?: CountExpression<T>) => CountExpression<T>, current?: CountExpression<T>): CountExpression<T>;
|
|
33
35
|
private _add;
|
|
34
|
-
render({ aliases, escape, prefix, }?: {
|
|
35
|
-
aliases?: QueryCustomType[]
|
|
36
|
-
escape?: boolean
|
|
37
|
-
prefix?: string
|
|
36
|
+
render({ aliases, escape, prefix, parser, }?: {
|
|
37
|
+
aliases?: QueryCustomType[];
|
|
38
|
+
escape?: boolean;
|
|
39
|
+
prefix?: string;
|
|
40
|
+
parser?: Parser<T>;
|
|
38
41
|
}): string;
|
|
39
42
|
clone(): CountExpression<T>;
|
|
40
|
-
field<F
|
|
43
|
+
field<F>(field: F[], opts?: (e: {
|
|
41
44
|
t: F;
|
|
42
45
|
f: CountField<F>;
|
|
43
46
|
}) => CountExpression<F>): CountExpression<F>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Parser } from '../../../types';
|
|
1
2
|
import type { QueryCustomType, Unpacked } from '../builder';
|
|
2
3
|
import { Expression } from './base';
|
|
3
4
|
import { FilterExpression, FilterExpressionBuilder } from './filter';
|
|
@@ -15,17 +16,18 @@ export declare class ExpandField<T> implements Renderable {
|
|
|
15
16
|
toJSON(): {
|
|
16
17
|
field: any;
|
|
17
18
|
};
|
|
18
|
-
render({ aliases, escape, prefix, }: {
|
|
19
|
+
render({ aliases, escape, prefix, parser, }: {
|
|
19
20
|
aliases?: QueryCustomType[];
|
|
20
21
|
escape?: boolean;
|
|
21
22
|
prefix?: string;
|
|
23
|
+
parser?: Parser<T>;
|
|
22
24
|
}): string;
|
|
23
25
|
clone(): ExpandField<T>;
|
|
24
|
-
select<T
|
|
25
|
-
expand<T
|
|
26
|
-
filter<T
|
|
27
|
-
search<T
|
|
28
|
-
orderBy<T
|
|
26
|
+
select<T>(opts: (builder: SelectExpressionBuilder<T>, current?: SelectExpression<T>) => SelectExpression<T>): SelectExpression<T>;
|
|
27
|
+
expand<T>(opts: (builder: ExpandExpressionBuilder<T>, current?: ExpandExpression<T>) => ExpandExpression<T>): ExpandExpression<T>;
|
|
28
|
+
filter<T>(opts: (builder: FilterExpressionBuilder<T>, current?: FilterExpression<T>) => FilterExpression<T>): FilterExpression<T>;
|
|
29
|
+
search<T>(opts: (builder: SearchExpressionBuilder<T>) => SearchExpression<T>): SearchExpression<T>;
|
|
30
|
+
orderBy<T>(opts: (builder: OrderByExpressionBuilder<T>, current?: OrderByExpression<T>) => OrderByExpression<T>): OrderByExpression<T>;
|
|
29
31
|
skip(n: number): number;
|
|
30
32
|
top(n: number): number;
|
|
31
33
|
levels(n: number | 'max'): number | "max";
|
|
@@ -40,13 +42,14 @@ export declare class ExpandExpression<T> extends Expression<T> {
|
|
|
40
42
|
constructor({ children, }?: {
|
|
41
43
|
children?: Renderable[];
|
|
42
44
|
});
|
|
43
|
-
static expand<T
|
|
44
|
-
render({ aliases, escape, prefix, }?: {
|
|
45
|
-
aliases?: QueryCustomType[]
|
|
46
|
-
escape?: boolean
|
|
47
|
-
prefix?: string
|
|
45
|
+
static expand<T>(opts: (builder: ExpandExpressionBuilder<T>, current?: ExpandExpression<T>) => ExpandExpression<T>, current?: ExpandExpression<T>): ExpandExpression<T>;
|
|
46
|
+
render({ aliases, escape, prefix, parser, }?: {
|
|
47
|
+
aliases?: QueryCustomType[];
|
|
48
|
+
escape?: boolean;
|
|
49
|
+
prefix?: string;
|
|
50
|
+
parser?: Parser<T>;
|
|
48
51
|
}): string;
|
|
49
52
|
clone(): ExpandExpression<T>;
|
|
50
53
|
private _add;
|
|
51
|
-
field<F
|
|
54
|
+
field<F>(field: F, opts?: (e: ExpandField<Unpacked<F>>) => void): ExpandExpression<T>;
|
|
52
55
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Parser } from '../../../types';
|
|
1
2
|
import type { QueryCustomType } from '../builder';
|
|
2
3
|
import { Expression } from './base';
|
|
3
4
|
import { CountExpression, CountField } from './count';
|
|
@@ -17,7 +18,7 @@ export declare class FilterExpression<F> extends Expression<F> {
|
|
|
17
18
|
connector?: FilterConnector;
|
|
18
19
|
negated?: boolean;
|
|
19
20
|
});
|
|
20
|
-
static filter<T
|
|
21
|
+
static filter<T>(opts: (builder: FilterExpressionBuilder<T>, current?: FilterExpression<T>) => FilterExpression<T>, current?: FilterExpression<T>): FilterExpression<T>;
|
|
21
22
|
toJSON(): {
|
|
22
23
|
children: any[];
|
|
23
24
|
connector: FilterConnector;
|
|
@@ -25,10 +26,11 @@ export declare class FilterExpression<F> extends Expression<F> {
|
|
|
25
26
|
};
|
|
26
27
|
connector(): FilterConnector;
|
|
27
28
|
negated(): boolean;
|
|
28
|
-
render({ aliases, escape, prefix, }?: {
|
|
29
|
+
render({ aliases, escape, prefix, parser, }?: {
|
|
29
30
|
aliases?: QueryCustomType[];
|
|
30
31
|
escape?: boolean;
|
|
31
32
|
prefix?: string;
|
|
33
|
+
parser?: Parser<any>;
|
|
32
34
|
}): string;
|
|
33
35
|
clone(): FilterExpression<F>;
|
|
34
36
|
private _add;
|
|
@@ -46,15 +48,15 @@ export declare class FilterExpression<F> extends Expression<F> {
|
|
|
46
48
|
contains(left: any, right: any, normalize?: Normalize): FilterExpression<F>;
|
|
47
49
|
startsWith(left: any, right: any, normalize?: Normalize): FilterExpression<F>;
|
|
48
50
|
endsWith(left: any, right: any, normalize?: Normalize): FilterExpression<F>;
|
|
49
|
-
any<N
|
|
51
|
+
any<N>(left: N[], opts?: (e: {
|
|
50
52
|
e: (connector?: FilterConnector) => FilterExpression<N>;
|
|
51
53
|
t: N;
|
|
52
54
|
}) => FilterExpression<N>, alias?: string): FilterExpression<F>;
|
|
53
|
-
all<N
|
|
55
|
+
all<N>(left: N[], opts: (e: {
|
|
54
56
|
t: N;
|
|
55
57
|
e: (connector?: FilterConnector) => FilterExpression<N>;
|
|
56
58
|
}) => FilterExpression<N>, alias?: string): FilterExpression<F>;
|
|
57
|
-
count<N
|
|
59
|
+
count<N>(left: N[], opts?: (e: {
|
|
58
60
|
t: N;
|
|
59
61
|
f: CountField<N>;
|
|
60
62
|
}) => CountExpression<N>): FilterExpression<F>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Parser } from '../../../types';
|
|
1
2
|
import type { QueryCustomType } from '../builder';
|
|
2
3
|
import { Expression } from './base';
|
|
3
4
|
import { Renderable } from './syntax';
|
|
@@ -10,10 +11,11 @@ export declare class OrderByField implements Renderable {
|
|
|
10
11
|
field: any;
|
|
11
12
|
order: "asc" | "desc";
|
|
12
13
|
};
|
|
13
|
-
render({ aliases, escape, prefix, }: {
|
|
14
|
+
render({ aliases, escape, prefix, parser, }: {
|
|
14
15
|
aliases?: QueryCustomType[];
|
|
15
16
|
escape?: boolean;
|
|
16
17
|
prefix?: string;
|
|
18
|
+
parser?: Parser<any>;
|
|
17
19
|
}): string;
|
|
18
20
|
clone(): OrderByField;
|
|
19
21
|
}
|
|
@@ -25,12 +27,13 @@ export declare class OrderByExpression<T> extends Expression<T> {
|
|
|
25
27
|
constructor({ children, }?: {
|
|
26
28
|
children?: Renderable[];
|
|
27
29
|
});
|
|
28
|
-
static orderBy<T
|
|
30
|
+
static orderBy<T>(opts: (builder: OrderByExpressionBuilder<T>, current?: OrderByExpression<T>) => OrderByExpression<T>, current?: OrderByExpression<T>): OrderByExpression<T>;
|
|
29
31
|
private _add;
|
|
30
|
-
render({ aliases, escape, prefix, }?: {
|
|
31
|
-
aliases?: QueryCustomType[]
|
|
32
|
-
escape?: boolean
|
|
33
|
-
prefix?: string
|
|
32
|
+
render({ aliases, escape, prefix, parser, }?: {
|
|
33
|
+
aliases?: QueryCustomType[];
|
|
34
|
+
escape?: boolean;
|
|
35
|
+
prefix?: string;
|
|
36
|
+
parser?: Parser<T>;
|
|
34
37
|
}): string;
|
|
35
38
|
clone(): OrderByExpression<T>;
|
|
36
39
|
ascending(field: any): OrderByExpression<T>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Parser } from '../../../types';
|
|
1
2
|
import type { QueryCustomType } from '../builder';
|
|
2
3
|
import { Expression } from './base';
|
|
3
4
|
import { Renderable } from './syntax';
|
|
@@ -10,10 +11,11 @@ export declare class SearchTerm implements Renderable {
|
|
|
10
11
|
$type: string;
|
|
11
12
|
value: string;
|
|
12
13
|
};
|
|
13
|
-
render({ aliases, escape, prefix, }: {
|
|
14
|
+
render({ aliases, escape, prefix, parser, }: {
|
|
14
15
|
aliases?: QueryCustomType[];
|
|
15
16
|
escape?: boolean;
|
|
16
17
|
prefix?: string;
|
|
18
|
+
parser?: Parser<any>;
|
|
17
19
|
}): string;
|
|
18
20
|
clone(): SearchTerm;
|
|
19
21
|
}
|
|
@@ -28,12 +30,13 @@ export declare class SearchExpression<T> extends Expression<T> {
|
|
|
28
30
|
connector?: SearchConnector;
|
|
29
31
|
negated?: boolean;
|
|
30
32
|
});
|
|
31
|
-
static search<T
|
|
33
|
+
static search<T>(opts: (builder: SearchExpressionBuilder<T>, current?: SearchExpression<T>) => SearchExpression<T>, current?: SearchExpression<T>): SearchExpression<T>;
|
|
32
34
|
private _add;
|
|
33
|
-
render({ aliases, escape, prefix, }?: {
|
|
34
|
-
aliases?: QueryCustomType[]
|
|
35
|
-
escape?: boolean
|
|
36
|
-
prefix?: string
|
|
35
|
+
render({ aliases, escape, prefix, parser, }?: {
|
|
36
|
+
aliases?: QueryCustomType[];
|
|
37
|
+
escape?: boolean;
|
|
38
|
+
prefix?: string;
|
|
39
|
+
parser?: Parser<T>;
|
|
37
40
|
}): string;
|
|
38
41
|
clone(): SearchExpression<T>;
|
|
39
42
|
toJSON(): {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Parser } from '../../../types';
|
|
1
2
|
import type { QueryCustomType } from '../builder';
|
|
2
3
|
import { Expression } from './base';
|
|
3
4
|
import { Renderable } from './syntax';
|
|
@@ -9,11 +10,12 @@ export declare class SelectExpression<T> extends Expression<T> {
|
|
|
9
10
|
constructor({ children, }?: {
|
|
10
11
|
children?: Renderable[];
|
|
11
12
|
});
|
|
12
|
-
static select<T
|
|
13
|
-
render({ aliases, escape, prefix, }?: {
|
|
14
|
-
aliases?: QueryCustomType[]
|
|
15
|
-
escape?: boolean
|
|
16
|
-
prefix?: string
|
|
13
|
+
static select<T>(opts: (builder: SelectExpressionBuilder<T>, current?: SelectExpression<T>) => SelectExpression<T>, current?: SelectExpression<T>): SelectExpression<T>;
|
|
14
|
+
render({ aliases, escape, prefix, parser, }?: {
|
|
15
|
+
aliases?: QueryCustomType[];
|
|
16
|
+
escape?: boolean;
|
|
17
|
+
prefix?: string;
|
|
18
|
+
parser?: Parser<T>;
|
|
17
19
|
}): string;
|
|
18
20
|
clone(): SelectExpression<T>;
|
|
19
21
|
private _add;
|