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
|
@@ -1,28 +1,27 @@
|
|
|
1
|
+
import { Parser } from '../../../types';
|
|
1
2
|
import type { QueryCustomType } from '../builder';
|
|
2
3
|
export type Normalize = 'all' | 'right' | 'left' | 'none';
|
|
3
4
|
export interface Renderable {
|
|
4
|
-
render({ aliases, escape, prefix, }: {
|
|
5
|
+
render({ aliases, escape, prefix, parser, }: {
|
|
5
6
|
aliases?: QueryCustomType[];
|
|
6
7
|
escape?: boolean;
|
|
7
8
|
prefix?: string;
|
|
9
|
+
parser?: Parser<any>;
|
|
8
10
|
}): string;
|
|
9
11
|
toString(): string;
|
|
10
12
|
toJSON(): any;
|
|
11
13
|
clone(): any;
|
|
12
14
|
}
|
|
13
|
-
export declare
|
|
14
|
-
|
|
15
|
-
constructor(name?: string);
|
|
16
|
-
static factory<T extends object>(name?: string): T;
|
|
17
|
-
get(target: T, key: string | symbol): any;
|
|
18
|
-
has(target: T, key: string): any;
|
|
19
|
-
}
|
|
20
|
-
export declare function render(value: any, { aliases, normalize, escape, prefix, }?: {
|
|
15
|
+
export declare const FieldFactory: <T extends object>(names?: string[]) => any;
|
|
16
|
+
export declare function render(value: any, { aliases, normalize, escape, prefix, parser, }?: {
|
|
21
17
|
aliases?: QueryCustomType[];
|
|
22
18
|
normalize?: boolean;
|
|
23
19
|
escape?: boolean;
|
|
24
20
|
prefix?: string;
|
|
21
|
+
parser?: Parser<any>;
|
|
25
22
|
}): string | number | boolean | null;
|
|
23
|
+
export declare function resolve(values: any, parser?: Parser<any>): any;
|
|
24
|
+
export declare function encode(values: any, parser?: Parser<any>): any;
|
|
26
25
|
export declare class Function<T> implements Renderable {
|
|
27
26
|
protected name: string;
|
|
28
27
|
protected values: any[];
|
|
@@ -36,10 +35,11 @@ export declare class Function<T> implements Renderable {
|
|
|
36
35
|
values: any[];
|
|
37
36
|
normalize: Normalize;
|
|
38
37
|
};
|
|
39
|
-
render({ aliases, escape, prefix, }: {
|
|
38
|
+
render({ aliases, escape, prefix, parser, }: {
|
|
40
39
|
aliases?: QueryCustomType[];
|
|
41
40
|
escape?: boolean;
|
|
42
41
|
prefix?: string;
|
|
42
|
+
parser?: Parser<T>;
|
|
43
43
|
}): string;
|
|
44
44
|
clone(): Function<T>;
|
|
45
45
|
}
|
|
@@ -107,10 +107,11 @@ export declare class Operator<T> implements Renderable {
|
|
|
107
107
|
values: any[];
|
|
108
108
|
normalize: Normalize;
|
|
109
109
|
};
|
|
110
|
-
render({ aliases, escape, prefix, }: {
|
|
110
|
+
render({ aliases, escape, prefix, parser, }: {
|
|
111
111
|
aliases?: QueryCustomType[];
|
|
112
112
|
escape?: boolean;
|
|
113
113
|
prefix?: string;
|
|
114
|
+
parser?: Parser<T>;
|
|
114
115
|
}): string;
|
|
115
116
|
clone(): Operator<unknown>;
|
|
116
117
|
}
|
|
@@ -141,10 +142,11 @@ export declare class Grouping<T> implements Renderable {
|
|
|
141
142
|
$type: string;
|
|
142
143
|
group: any;
|
|
143
144
|
};
|
|
144
|
-
render({ aliases, escape, prefix, }: {
|
|
145
|
+
render({ aliases, escape, prefix, parser, }: {
|
|
145
146
|
aliases?: QueryCustomType[];
|
|
146
147
|
escape?: boolean;
|
|
147
148
|
prefix?: string;
|
|
149
|
+
parser?: Parser<T>;
|
|
148
150
|
}): string;
|
|
149
151
|
clone(): Grouping<unknown>;
|
|
150
152
|
}
|
|
@@ -160,10 +162,11 @@ export declare class Lambda<T> implements Renderable {
|
|
|
160
162
|
values: any[];
|
|
161
163
|
alias: string | undefined;
|
|
162
164
|
};
|
|
163
|
-
render({ aliases, escape, prefix, }: {
|
|
165
|
+
render({ aliases, escape, prefix, parser, }: {
|
|
164
166
|
aliases?: QueryCustomType[];
|
|
165
167
|
escape?: boolean;
|
|
166
168
|
prefix?: string;
|
|
169
|
+
parser?: Parser<T>;
|
|
167
170
|
}): string;
|
|
168
171
|
clone(): Lambda<unknown>;
|
|
169
172
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { QueryOption } from '../../types';
|
|
1
|
+
import { Parser, QueryOption } from '../../types';
|
|
2
2
|
import { Expand, Filter, OrderBy, Select, Transform } from './builder';
|
|
3
3
|
import { ComputeExpression, Expression, FilterExpression, OrderByExpression, SearchExpression } from './expressions';
|
|
4
4
|
import { ExpandExpression } from './expressions/expand';
|
|
@@ -24,10 +24,19 @@ export declare class ODataQueryOptions<T> {
|
|
|
24
24
|
constructor(values?: Map<QueryOption, any> | {
|
|
25
25
|
[name: string]: any;
|
|
26
26
|
});
|
|
27
|
-
pathAndParams(escape
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
pathAndParams({ escape, parser, }?: {
|
|
28
|
+
escape?: boolean;
|
|
29
|
+
parser?: Parser<T>;
|
|
30
|
+
}): [
|
|
31
|
+
string,
|
|
32
|
+
{
|
|
33
|
+
[name: string]: any;
|
|
34
|
+
}
|
|
35
|
+
];
|
|
36
|
+
toString({ escape, parser, }?: {
|
|
37
|
+
escape?: boolean;
|
|
38
|
+
parser?: Parser<T>;
|
|
39
|
+
}): string;
|
|
31
40
|
toJSON(): {};
|
|
32
41
|
toQueryArguments(): ODataQueryArguments<T>;
|
|
33
42
|
clone<O>(): ODataQueryOptions<O>;
|
|
@@ -56,7 +56,7 @@ export declare class ODataResource<T> {
|
|
|
56
56
|
[name: string]: any;
|
|
57
57
|
}];
|
|
58
58
|
endpointUrl(params?: boolean): string;
|
|
59
|
-
toString(): string;
|
|
59
|
+
toString(escape?: boolean): string;
|
|
60
60
|
clone(): ODataResource<T>;
|
|
61
61
|
private __parser;
|
|
62
62
|
deserialize(value: any, options?: ParserOptions): any;
|
|
@@ -6,33 +6,33 @@ export declare abstract class ODataAnnotations<T> {
|
|
|
6
6
|
protected context?: ODataContext | undefined;
|
|
7
7
|
constructor(helper: ODataVersionHelper, annotations?: Map<string, any>, context?: ODataContext | undefined);
|
|
8
8
|
attributes(data: {
|
|
9
|
-
[
|
|
9
|
+
[name: string]: any;
|
|
10
10
|
}, metadata: ODataMetadataType): Partial<T>;
|
|
11
11
|
update(data: {
|
|
12
|
-
[
|
|
12
|
+
[name: string]: any;
|
|
13
13
|
}): void;
|
|
14
14
|
get entitySet(): string | undefined;
|
|
15
15
|
get type(): string | undefined;
|
|
16
16
|
abstract union(other: ODataAnnotations<any>): ODataAnnotations<any>;
|
|
17
17
|
abstract clone(): ODataAnnotations<any>;
|
|
18
18
|
abstract data(data: {
|
|
19
|
-
[
|
|
19
|
+
[name: string]: any;
|
|
20
20
|
}): {
|
|
21
|
-
[
|
|
21
|
+
[name: string]: any;
|
|
22
22
|
};
|
|
23
23
|
}
|
|
24
24
|
export declare class ODataPropertyAnnotations<T> extends ODataAnnotations<T> {
|
|
25
25
|
union(other: ODataPropertyAnnotations<any>): ODataPropertyAnnotations<any>;
|
|
26
26
|
clone(): ODataPropertyAnnotations<any>;
|
|
27
27
|
data(data: {
|
|
28
|
-
[
|
|
28
|
+
[name: string]: any;
|
|
29
29
|
}): any;
|
|
30
30
|
}
|
|
31
31
|
export declare class ODataEntityAnnotations<T> extends ODataAnnotations<T> {
|
|
32
32
|
union(other: ODataEntityAnnotations<any>): ODataEntityAnnotations<any>;
|
|
33
33
|
clone(): ODataEntityAnnotations<any>;
|
|
34
34
|
data(data: {
|
|
35
|
-
[
|
|
35
|
+
[name: string]: any;
|
|
36
36
|
}): any;
|
|
37
37
|
get id(): string | undefined;
|
|
38
38
|
get etag(): string | undefined;
|
|
@@ -49,7 +49,7 @@ export declare class ODataEntityAnnotations<T> extends ODataAnnotations<T> {
|
|
|
49
49
|
property<F>(name: keyof T, type: 'single'): ODataEntityAnnotations<F>;
|
|
50
50
|
private _functions?;
|
|
51
51
|
get functions(): {
|
|
52
|
-
[
|
|
52
|
+
[name: string]: any;
|
|
53
53
|
};
|
|
54
54
|
function(name: string): any;
|
|
55
55
|
}
|
|
@@ -57,7 +57,7 @@ export declare class ODataEntitiesAnnotations<T> extends ODataAnnotations<T> {
|
|
|
57
57
|
union(other: ODataEntitiesAnnotations<any>): ODataEntitiesAnnotations<any>;
|
|
58
58
|
clone(): ODataEntitiesAnnotations<any>;
|
|
59
59
|
data(data: {
|
|
60
|
-
[
|
|
60
|
+
[name: string]: any;
|
|
61
61
|
}): any;
|
|
62
62
|
get readLink(): string | undefined;
|
|
63
63
|
get count(): number | undefined;
|
|
@@ -68,7 +68,7 @@ export declare class ODataEntitiesAnnotations<T> extends ODataAnnotations<T> {
|
|
|
68
68
|
get skiptoken(): string | undefined;
|
|
69
69
|
private _functions?;
|
|
70
70
|
get functions(): {
|
|
71
|
-
[
|
|
71
|
+
[name: string]: any;
|
|
72
72
|
};
|
|
73
73
|
function(name: string): any;
|
|
74
74
|
}
|
|
@@ -98,6 +98,7 @@ export declare class ODataStructuredTypeParser<T> extends ODataAnnotatable imple
|
|
|
98
98
|
titleize(term?: string | RegExp): string;
|
|
99
99
|
isTypeOf(type: string): boolean;
|
|
100
100
|
isSubtypeOf(type: string): boolean;
|
|
101
|
+
isOpenType(): boolean;
|
|
101
102
|
findChildParser(predicate: (p: ODataStructuredTypeParser<any>) => boolean): ODataStructuredTypeParser<any> | undefined;
|
|
102
103
|
childParser(predicate: (p: ODataStructuredTypeParser<any>) => boolean): Parser<any>;
|
|
103
104
|
deserialize(value: any, options?: ParserOptions): T;
|
|
@@ -126,6 +127,8 @@ export declare class ODataStructuredTypeParser<T> extends ODataAnnotatable imple
|
|
|
126
127
|
keys({ include_parents, }: {
|
|
127
128
|
include_parents: boolean;
|
|
128
129
|
}): ODataEntityTypeKey[];
|
|
130
|
+
isEntityType(): boolean;
|
|
131
|
+
isComplexType(): boolean;
|
|
129
132
|
/**
|
|
130
133
|
* Find the field parser for the given field name.
|
|
131
134
|
* @param name Name of the field
|
|
@@ -6,7 +6,6 @@ import { JsonSchemaOptions, ODataEntityTypeKey, ODataStructuredTypeFieldParser,
|
|
|
6
6
|
import { ODataSchema } from './schema';
|
|
7
7
|
export declare class ODataStructuredType<T> extends ODataSchemaElement {
|
|
8
8
|
base?: string;
|
|
9
|
-
open: boolean;
|
|
10
9
|
parent?: ODataStructuredType<any>;
|
|
11
10
|
children: ODataStructuredType<any>[];
|
|
12
11
|
model?: typeof ODataModel;
|
|
@@ -41,6 +40,8 @@ export declare class ODataStructuredType<T> extends ODataSchemaElement {
|
|
|
41
40
|
*/
|
|
42
41
|
isCompoundKey(): boolean;
|
|
43
42
|
isOpenType(): boolean;
|
|
43
|
+
isEntityType(): boolean;
|
|
44
|
+
isComplexType(): boolean;
|
|
44
45
|
/**
|
|
45
46
|
* Find the field parser for the given field name.
|
|
46
47
|
* @param name Name of the field
|
package/lib/utils/enums.d.ts
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
export declare const Enums: {
|
|
2
2
|
names<E extends {
|
|
3
|
-
[
|
|
3
|
+
[name: string]: any;
|
|
4
4
|
}>(enums: E): string[];
|
|
5
5
|
values<E_1 extends {
|
|
6
|
-
[
|
|
6
|
+
[name: string]: any;
|
|
7
7
|
}>(enums: E_1): number[];
|
|
8
8
|
toValue<E_2 extends {
|
|
9
|
-
[
|
|
9
|
+
[name: string]: any;
|
|
10
10
|
}>(enums: E_2, value: any): number | undefined;
|
|
11
11
|
toValues<E_3 extends {
|
|
12
|
-
[
|
|
12
|
+
[name: string]: any;
|
|
13
13
|
}>(enums: E_3, value: any): number[];
|
|
14
14
|
toName<E_4 extends {
|
|
15
|
-
[
|
|
15
|
+
[name: string]: any;
|
|
16
16
|
}>(enums: E_4, value: any): string | undefined;
|
|
17
17
|
toNames<E_5 extends {
|
|
18
|
-
[
|
|
18
|
+
[name: string]: any;
|
|
19
19
|
}>(enums: E_5, value: any): string[];
|
|
20
20
|
toFlags<E_6 extends {
|
|
21
|
-
[
|
|
21
|
+
[name: string]: any;
|
|
22
22
|
}>(enums: E_6, value: any): string[];
|
|
23
23
|
};
|
package/lib/utils/types.d.ts
CHANGED