angular-odata 0.124.0 → 0.126.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.
Files changed (71) hide show
  1. package/README.md +2 -2
  2. package/esm2022/lib/api.mjs +3 -2
  3. package/esm2022/lib/cache/storage.mjs +3 -3
  4. package/esm2022/lib/client.mjs +3 -3
  5. package/esm2022/lib/constants.mjs +2 -1
  6. package/esm2022/lib/helper.mjs +2 -2
  7. package/esm2022/lib/models/collection.mjs +147 -193
  8. package/esm2022/lib/models/model.mjs +141 -119
  9. package/esm2022/lib/models/options.mjs +115 -88
  10. package/esm2022/lib/resources/path/segments.mjs +13 -7
  11. package/esm2022/lib/resources/query/expressions/base.mjs +8 -3
  12. package/esm2022/lib/resources/query/expressions/compute.mjs +19 -4
  13. package/esm2022/lib/resources/query/expressions/count.mjs +24 -7
  14. package/esm2022/lib/resources/query/expressions/expand.mjs +30 -8
  15. package/esm2022/lib/resources/query/expressions/filter.mjs +29 -12
  16. package/esm2022/lib/resources/query/expressions/orderby.mjs +31 -8
  17. package/esm2022/lib/resources/query/expressions/search.mjs +30 -11
  18. package/esm2022/lib/resources/query/expressions/select.mjs +16 -4
  19. package/esm2022/lib/resources/query/expressions/syntax.mjs +185 -31
  20. package/esm2022/lib/resources/query/handlers.mjs +2 -2
  21. package/esm2022/lib/resources/query/index.mjs +2 -1
  22. package/esm2022/lib/resources/query/options.mjs +22 -12
  23. package/esm2022/lib/resources/request.mjs +4 -3
  24. package/esm2022/lib/resources/resource.mjs +39 -15
  25. package/esm2022/lib/resources/responses/annotations.mjs +1 -1
  26. package/esm2022/lib/resources/responses/response.mjs +3 -3
  27. package/esm2022/lib/resources/types/batch.mjs +2 -2
  28. package/esm2022/lib/resources/types/count.mjs +7 -4
  29. package/esm2022/lib/resources/types/entity-set.mjs +2 -1
  30. package/esm2022/lib/resources/types/entity.mjs +5 -5
  31. package/esm2022/lib/resources/types/function.mjs +1 -9
  32. package/esm2022/lib/resources/types/navigation-property.mjs +3 -2
  33. package/esm2022/lib/resources/types/options.mjs +1 -1
  34. package/esm2022/lib/resources/types/property.mjs +11 -3
  35. package/esm2022/lib/schema/parsers/structured-type.mjs +5 -4
  36. package/esm2022/lib/schema/structured-type.mjs +13 -2
  37. package/esm2022/lib/utils/enums.mjs +1 -1
  38. package/fesm2022/angular-odata.mjs +3873 -3536
  39. package/fesm2022/angular-odata.mjs.map +1 -1
  40. package/lib/api.d.ts +2 -2
  41. package/lib/client.d.ts +1 -1
  42. package/lib/constants.d.ts +1 -0
  43. package/lib/helper.d.ts +10 -10
  44. package/lib/models/collection.d.ts +18 -20
  45. package/lib/models/model.d.ts +14 -13
  46. package/lib/models/options.d.ts +38 -13
  47. package/lib/resources/path/segments.d.ts +8 -11
  48. package/lib/resources/query/expressions/base.d.ts +6 -3
  49. package/lib/resources/query/expressions/compute.d.ts +13 -2
  50. package/lib/resources/query/expressions/count.d.ts +15 -4
  51. package/lib/resources/query/expressions/expand.d.ts +15 -4
  52. package/lib/resources/query/expressions/filter.d.ts +15 -4
  53. package/lib/resources/query/expressions/orderby.d.ts +16 -4
  54. package/lib/resources/query/expressions/search.d.ts +14 -5
  55. package/lib/resources/query/expressions/select.d.ts +11 -2
  56. package/lib/resources/query/expressions/syntax.d.ts +65 -16
  57. package/lib/resources/query/handlers.d.ts +1 -1
  58. package/lib/resources/query/index.d.ts +1 -0
  59. package/lib/resources/query/options.d.ts +4 -3
  60. package/lib/resources/request.d.ts +3 -2
  61. package/lib/resources/resource.d.ts +10 -5
  62. package/lib/resources/responses/annotations.d.ts +9 -9
  63. package/lib/resources/responses/response.d.ts +2 -2
  64. package/lib/resources/types/count.d.ts +5 -1
  65. package/lib/resources/types/function.d.ts +0 -3
  66. package/lib/resources/types/options.d.ts +2 -1
  67. package/lib/resources/types/property.d.ts +2 -0
  68. package/lib/schema/parsers/structured-type.d.ts +1 -0
  69. package/lib/schema/structured-type.d.ts +2 -1
  70. package/lib/utils/enums.d.ts +7 -7
  71. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import { Parser } from '../../../types';
1
+ import { Parser, ParserOptions } from '../../../types';
2
2
  import type { QueryCustomType } from '../builder';
3
3
  import { Expression } from './base';
4
4
  import { CountExpression, CountField } from './count';
@@ -18,19 +18,26 @@ export declare class FilterExpression<F> extends Expression<F> {
18
18
  connector?: FilterConnector;
19
19
  negated?: boolean;
20
20
  });
21
+ get [Symbol.toStringTag](): string;
21
22
  static filter<T>(opts: (builder: FilterExpressionBuilder<T>, current?: FilterExpression<T>) => FilterExpression<T>, current?: FilterExpression<T>): FilterExpression<T>;
22
- toJSON(): {
23
+ toJson(): {
24
+ $type: string;
23
25
  children: any[];
26
+ } & {
24
27
  connector: FilterConnector;
25
28
  negated: boolean;
26
29
  };
30
+ static fromJson<T>(json: {
31
+ [name: string]: any;
32
+ }): FilterExpression<T>;
27
33
  connector(): FilterConnector;
28
34
  negated(): boolean;
29
- render({ aliases, escape, prefix, parser, }?: {
35
+ render({ aliases, escape, prefix, parser, options, }?: {
30
36
  aliases?: QueryCustomType[];
31
37
  escape?: boolean;
32
38
  prefix?: string;
33
39
  parser?: Parser<any>;
40
+ options?: ParserOptions;
34
41
  }): string;
35
42
  clone(): FilterExpression<F>;
36
43
  private _add;
@@ -51,10 +58,14 @@ export declare class FilterExpression<F> extends Expression<F> {
51
58
  any<N>(left: N[], opts?: (e: {
52
59
  e: (connector?: FilterConnector) => FilterExpression<N>;
53
60
  t: N;
61
+ o: ODataOperators<N>;
62
+ f: ODataFunctions<N>;
54
63
  }) => FilterExpression<N>, alias?: string): FilterExpression<F>;
55
- all<N>(left: N[], opts: (e: {
64
+ all<N>(left: N[], opts?: (e: {
56
65
  t: N;
57
66
  e: (connector?: FilterConnector) => FilterExpression<N>;
67
+ o: ODataOperators<N>;
68
+ f: ODataFunctions<N>;
58
69
  }) => FilterExpression<N>, alias?: string): FilterExpression<F>;
59
70
  count<N>(left: N[], opts?: (e: {
60
71
  t: N;
@@ -1,4 +1,4 @@
1
- import { Parser } from '../../../types';
1
+ import { Parser, ParserOptions } from '../../../types';
2
2
  import type { QueryCustomType } from '../builder';
3
3
  import { Expression } from './base';
4
4
  import { Renderable } from './syntax';
@@ -7,17 +7,20 @@ export declare class OrderByField implements Renderable {
7
7
  protected order: 'asc' | 'desc';
8
8
  constructor(field: Renderable, order: 'asc' | 'desc');
9
9
  get [Symbol.toStringTag](): string;
10
- toJSON(): {
10
+ toJson(): {
11
+ $type: string;
11
12
  field: any;
12
13
  order: "asc" | "desc";
13
14
  };
14
- render({ aliases, escape, prefix, parser, }: {
15
+ render({ aliases, escape, prefix, parser, options, }: {
15
16
  aliases?: QueryCustomType[];
16
17
  escape?: boolean;
17
18
  prefix?: string;
18
19
  parser?: Parser<any>;
20
+ options?: ParserOptions;
19
21
  }): string;
20
22
  clone(): OrderByField;
23
+ resolve(parser: any): any;
21
24
  }
22
25
  export type OrderByExpressionBuilder<T> = {
23
26
  t: Readonly<Required<T>>;
@@ -27,13 +30,22 @@ export declare class OrderByExpression<T> extends Expression<T> {
27
30
  constructor({ children, }?: {
28
31
  children?: Renderable[];
29
32
  });
33
+ get [Symbol.toStringTag](): string;
30
34
  static orderBy<T>(opts: (builder: OrderByExpressionBuilder<T>, current?: OrderByExpression<T>) => OrderByExpression<T>, current?: OrderByExpression<T>): OrderByExpression<T>;
31
35
  private _add;
32
- render({ aliases, escape, prefix, parser, }?: {
36
+ toJson(): {
37
+ $type: string;
38
+ children: any[];
39
+ };
40
+ static fromJson<T>(json: {
41
+ [name: string]: any;
42
+ }): OrderByExpression<T>;
43
+ render({ aliases, escape, prefix, parser, options, }?: {
33
44
  aliases?: QueryCustomType[];
34
45
  escape?: boolean;
35
46
  prefix?: string;
36
47
  parser?: Parser<T>;
48
+ options?: ParserOptions;
37
49
  }): string;
38
50
  clone(): OrderByExpression<T>;
39
51
  ascending(field: any): OrderByExpression<T>;
@@ -1,4 +1,4 @@
1
- import { Parser } from '../../../types';
1
+ import { Parser, ParserOptions } from '../../../types';
2
2
  import type { QueryCustomType } from '../builder';
3
3
  import { Expression } from './base';
4
4
  import { Renderable } from './syntax';
@@ -7,17 +7,19 @@ export declare class SearchTerm implements Renderable {
7
7
  protected value: string;
8
8
  constructor(value: string);
9
9
  get [Symbol.toStringTag](): string;
10
- toJSON(): {
10
+ toJson(): {
11
11
  $type: string;
12
12
  value: string;
13
13
  };
14
- render({ aliases, escape, prefix, parser, }: {
14
+ render({ aliases, escape, prefix, parser, options, }: {
15
15
  aliases?: QueryCustomType[];
16
16
  escape?: boolean;
17
17
  prefix?: string;
18
18
  parser?: Parser<any>;
19
+ options?: ParserOptions;
19
20
  }): string;
20
21
  clone(): SearchTerm;
22
+ resolve(parser: any): any;
21
23
  }
22
24
  export type SearchExpressionBuilder<T> = {
23
25
  e: (connector?: SearchConnector) => SearchExpression<T>;
@@ -30,20 +32,27 @@ export declare class SearchExpression<T> extends Expression<T> {
30
32
  connector?: SearchConnector;
31
33
  negated?: boolean;
32
34
  });
35
+ get [Symbol.toStringTag](): string;
33
36
  static search<T>(opts: (builder: SearchExpressionBuilder<T>, current?: SearchExpression<T>) => SearchExpression<T>, current?: SearchExpression<T>): SearchExpression<T>;
34
37
  private _add;
35
- render({ aliases, escape, prefix, parser, }?: {
38
+ render({ aliases, escape, prefix, parser, options, }?: {
36
39
  aliases?: QueryCustomType[];
37
40
  escape?: boolean;
38
41
  prefix?: string;
39
42
  parser?: Parser<T>;
43
+ options?: ParserOptions;
40
44
  }): string;
41
45
  clone(): SearchExpression<T>;
42
- toJSON(): {
46
+ toJson(): {
47
+ $type: string;
43
48
  children: any[];
49
+ } & {
44
50
  connector: SearchConnector;
45
51
  negated: boolean;
46
52
  };
53
+ static fromJson<T>(json: {
54
+ [name: string]: any;
55
+ }): SearchExpression<T>;
47
56
  connector(): SearchConnector;
48
57
  negated(): boolean;
49
58
  or(exp: SearchExpression<T>): SearchExpression<T>;
@@ -1,4 +1,4 @@
1
- import { Parser } from '../../../types';
1
+ import { Parser, ParserOptions } from '../../../types';
2
2
  import type { QueryCustomType } from '../builder';
3
3
  import { Expression } from './base';
4
4
  import { Renderable } from './syntax';
@@ -10,12 +10,21 @@ export declare class SelectExpression<T> extends Expression<T> {
10
10
  constructor({ children, }?: {
11
11
  children?: Renderable[];
12
12
  });
13
+ get [Symbol.toStringTag](): string;
13
14
  static select<T>(opts: (builder: SelectExpressionBuilder<T>, current?: SelectExpression<T>) => SelectExpression<T>, current?: SelectExpression<T>): SelectExpression<T>;
14
- render({ aliases, escape, prefix, parser, }?: {
15
+ toJson(): {
16
+ $type: string;
17
+ children: any[];
18
+ };
19
+ static fromJson<T>(json: {
20
+ [name: string]: any;
21
+ }): SelectExpression<T>;
22
+ render({ aliases, escape, prefix, parser, options, }?: {
15
23
  aliases?: QueryCustomType[];
16
24
  escape?: boolean;
17
25
  prefix?: string;
18
26
  parser?: Parser<T>;
27
+ options?: ParserOptions;
19
28
  }): string;
20
29
  clone(): SelectExpression<T>;
21
30
  private _add;
@@ -1,27 +1,31 @@
1
- import { Parser } from '../../../types';
1
+ import { Parser, ParserOptions } from '../../../types';
2
2
  import type { QueryCustomType } from '../builder';
3
3
  export type Normalize = 'all' | 'right' | 'left' | 'none';
4
4
  export interface Renderable {
5
- render({ aliases, escape, prefix, parser, }: {
5
+ render({ aliases, escape, prefix, parser, options, }: {
6
6
  aliases?: QueryCustomType[];
7
7
  escape?: boolean;
8
8
  prefix?: string;
9
9
  parser?: Parser<any>;
10
+ options?: ParserOptions;
10
11
  }): string;
11
12
  toString(): string;
12
- toJSON(): any;
13
+ toJson(): any;
13
14
  clone(): any;
15
+ resolve(parser: any): any;
14
16
  }
15
- export declare const FieldFactory: <T extends object>(names?: string[]) => any;
16
- export declare function render(value: any, { aliases, normalize, escape, prefix, parser, }?: {
17
+ export declare const FieldFactory: <T extends object>(names?: (string | Renderable)[]) => any;
18
+ export declare const RenderableFactory: (value: any) => Renderable;
19
+ export declare function render(value: any, { aliases, normalize, escape, prefix, parser, options, }?: {
17
20
  aliases?: QueryCustomType[];
18
21
  normalize?: boolean;
19
22
  escape?: boolean;
20
23
  prefix?: string;
21
24
  parser?: Parser<any>;
25
+ options?: ParserOptions;
22
26
  }): string | number | boolean | null;
23
27
  export declare function resolve(values: any, parser?: Parser<any>): any;
24
- export declare function encode(values: any, parser?: Parser<any>): any;
28
+ export declare function encode(values: any, parser?: Parser<any>, options?: ParserOptions): any;
25
29
  export declare class Function<T> implements Renderable {
26
30
  protected name: string;
27
31
  protected values: any[];
@@ -29,19 +33,24 @@ export declare class Function<T> implements Renderable {
29
33
  protected escape: boolean;
30
34
  constructor(name: string, values: any[], normalize: Normalize, escape?: boolean);
31
35
  get [Symbol.toStringTag](): string;
32
- toJSON(): {
36
+ toJson(): {
33
37
  $type: string;
34
38
  name: string;
35
39
  values: any[];
36
40
  normalize: Normalize;
37
41
  };
38
- render({ aliases, escape, prefix, parser, }: {
42
+ static fromJson<T>(json: {
43
+ [name: string]: any;
44
+ }): Function<T>;
45
+ render({ aliases, escape, prefix, parser, options, }: {
39
46
  aliases?: QueryCustomType[];
40
47
  escape?: boolean;
41
48
  prefix?: string;
42
49
  parser?: Parser<T>;
50
+ options?: ParserOptions;
43
51
  }): string;
44
52
  clone(): Function<T>;
53
+ resolve(parser: any): any;
45
54
  }
46
55
  export declare class StringAndCollectionFunctions<T> {
47
56
  concat(left: any, right: any, normalize?: Normalize): Function<T>;
@@ -84,8 +93,8 @@ export declare class ArithmeticFunctions<T> {
84
93
  round(left: T | string, normalize?: Normalize): Function<T>;
85
94
  }
86
95
  export declare class TypeFunctions<T> {
87
- cast(left: T | string, right?: string, normalize?: Normalize): Function<T>;
88
- isof(left: T | string, right?: string, normalize?: Normalize): Function<T>;
96
+ cast<N>(left: T | string, type?: string): N;
97
+ isof(left: T | string, type?: string): Type<T>;
89
98
  }
90
99
  export declare class GeoFunctions<T> {
91
100
  geoDistance(left: T, right: string, normalize?: Normalize): Function<T>;
@@ -101,19 +110,24 @@ export declare class Operator<T> implements Renderable {
101
110
  protected normalize: Normalize;
102
111
  constructor(op: string, values: any[], normalize: Normalize);
103
112
  get [Symbol.toStringTag](): string;
104
- toJSON(): {
113
+ toJson(): {
105
114
  $type: string;
106
115
  op: string;
107
116
  values: any[];
108
117
  normalize: Normalize;
109
118
  };
110
- render({ aliases, escape, prefix, parser, }: {
119
+ static fromJson<T>(json: {
120
+ [name: string]: any;
121
+ }): Operator<T>;
122
+ render({ aliases, escape, prefix, parser, options, }: {
111
123
  aliases?: QueryCustomType[];
112
124
  escape?: boolean;
113
125
  prefix?: string;
114
126
  parser?: Parser<T>;
127
+ options?: ParserOptions;
115
128
  }): string;
116
129
  clone(): Operator<unknown>;
130
+ resolve(parser: any): any;
117
131
  }
118
132
  export declare class LogicalOperators<T> {
119
133
  eq(left: any, right: any, normalize?: Normalize): Operator<unknown>;
@@ -138,17 +152,47 @@ export declare class Grouping<T> implements Renderable {
138
152
  protected group: Renderable;
139
153
  constructor(group: Renderable);
140
154
  get [Symbol.toStringTag](): string;
141
- toJSON(): {
155
+ toJson(): {
142
156
  $type: string;
143
157
  group: any;
144
158
  };
145
- render({ aliases, escape, prefix, parser, }: {
159
+ static fromJson<T>(json: {
160
+ [name: string]: any;
161
+ }): Grouping<T>;
162
+ render({ aliases, escape, prefix, parser, options, }: {
146
163
  aliases?: QueryCustomType[];
147
164
  escape?: boolean;
148
165
  prefix?: string;
149
166
  parser?: Parser<T>;
167
+ options?: ParserOptions;
150
168
  }): string;
151
169
  clone(): Grouping<unknown>;
170
+ resolve(parser: any): any;
171
+ }
172
+ export declare class Type<T> implements Renderable {
173
+ protected name: string;
174
+ protected type: string;
175
+ protected value?: any;
176
+ constructor(name: string, type: string, value?: any);
177
+ get [Symbol.toStringTag](): string;
178
+ toJson(): {
179
+ $type: string;
180
+ name: string;
181
+ type: string;
182
+ value: any;
183
+ };
184
+ static fromJson<T>(json: {
185
+ [name: string]: any;
186
+ }): Type<T>;
187
+ render({ aliases, escape, prefix, parser, options, }: {
188
+ aliases?: QueryCustomType[];
189
+ escape?: boolean;
190
+ prefix?: string;
191
+ parser?: Parser<T>;
192
+ options?: ParserOptions;
193
+ }): string;
194
+ clone(): Type<unknown>;
195
+ resolve(parser: any): any;
152
196
  }
153
197
  export declare class Lambda<T> implements Renderable {
154
198
  protected op: string;
@@ -156,19 +200,24 @@ export declare class Lambda<T> implements Renderable {
156
200
  protected alias?: string | undefined;
157
201
  constructor(op: string, values: any[], alias?: string | undefined);
158
202
  get [Symbol.toStringTag](): string;
159
- toJSON(): {
203
+ toJson(): {
160
204
  $type: string;
161
205
  op: string;
162
206
  values: any[];
163
207
  alias: string | undefined;
164
208
  };
165
- render({ aliases, escape, prefix, parser, }: {
209
+ static fromJson<T>(json: {
210
+ [name: string]: any;
211
+ }): Lambda<T>;
212
+ render({ aliases, escape, prefix, parser, options, }: {
166
213
  aliases?: QueryCustomType[];
167
214
  escape?: boolean;
168
215
  prefix?: string;
169
216
  parser?: Parser<T>;
217
+ options?: ParserOptions;
170
218
  }): string;
171
219
  clone(): Lambda<unknown>;
220
+ resolve(parser: any): any;
172
221
  }
173
222
  export declare class LambdaOperators<T> {
174
223
  any(left: T, right: any, alias?: string): Lambda<unknown>;
@@ -14,7 +14,7 @@ export declare class ODataQueryOptionHandler<T> {
14
14
  * Converts the managed odata query option to a json object.
15
15
  * @returns {any}
16
16
  */
17
- toJSON(): any;
17
+ toJson(): any;
18
18
  /**
19
19
  * Returns a boolean indicating if the managed odata query option is empty.
20
20
  * @returns True if the managed odata query option is empty.
@@ -1,3 +1,4 @@
1
1
  export * from './builder';
2
2
  export * from './options';
3
3
  export * from './handlers';
4
+ export * from './expressions';
@@ -1,4 +1,4 @@
1
- import { Parser, QueryOption } from '../../types';
1
+ import { Parser, ParserOptions, 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,9 +24,10 @@ export declare class ODataQueryOptions<T> {
24
24
  constructor(values?: Map<QueryOption, any> | {
25
25
  [name: string]: any;
26
26
  });
27
- pathAndParams({ escape, parser, }?: {
27
+ pathAndParams({ escape, parser, options, }?: {
28
28
  escape?: boolean;
29
29
  parser?: Parser<T>;
30
+ options?: ParserOptions;
30
31
  }): [
31
32
  string,
32
33
  {
@@ -37,7 +38,7 @@ export declare class ODataQueryOptions<T> {
37
38
  escape?: boolean;
38
39
  parser?: Parser<T>;
39
40
  }): string;
40
- toJSON(): {};
41
+ toJson(): {};
41
42
  toQueryArguments(): ODataQueryArguments<T>;
42
43
  clone<O>(): ODataQueryOptions<O>;
43
44
  expression(key: QueryOption, exp?: Expression<T>): any;
@@ -1,6 +1,6 @@
1
1
  import { HttpContext, HttpHeaders, HttpParams } from '@angular/common/http';
2
2
  import { ODataApi } from '../api';
3
- import { QueryOption } from '../types';
3
+ import { FetchPolicy, ParserOptions, QueryOption } from '../types';
4
4
  import { ODataResource } from './resource';
5
5
  import { ODataOptions } from './types';
6
6
  export declare class ODataRequest<T> {
@@ -34,7 +34,8 @@ export declare class ODataRequest<T> {
34
34
  [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
35
35
  };
36
36
  responseType?: 'arraybuffer' | 'blob' | 'json' | 'text' | 'value' | 'property' | 'entity' | 'entities';
37
- fetchPolicy?: 'cache-first' | 'cache-and-network' | 'network-only' | 'no-cache' | 'cache-only';
37
+ fetchPolicy?: FetchPolicy;
38
+ parserOptions?: ParserOptions;
38
39
  withCredentials?: boolean;
39
40
  bodyQueryOptions?: QueryOption[];
40
41
  });
@@ -52,22 +52,27 @@ export declare class ODataResource<T> {
52
52
  isSubtypeOf(other: ODataResource<any>): boolean;
53
53
  isSupertypeOf(other: ODataResource<any>): boolean;
54
54
  isEqualTo(other: ODataResource<any>, test?: 'path' | 'params'): boolean;
55
- pathAndParams(escape?: boolean): [string, {
55
+ pathAndParams({ escape, ...options }?: ParserOptions & {
56
+ escape?: boolean;
57
+ }): [string, {
56
58
  [name: string]: any;
57
59
  }];
58
60
  endpointUrl(params?: boolean): string;
59
- toString(escape?: boolean): string;
61
+ toString({ escape, ...options }?: ParserOptions & {
62
+ escape?: boolean;
63
+ }): string;
60
64
  clone(): ODataResource<T>;
61
- private __parser;
65
+ private __serializeParser;
66
+ private __deserializeParser;
62
67
  deserialize(value: any, options?: ParserOptions): any;
63
68
  serialize(value: any, options?: ParserOptions): any;
64
69
  encode(value: any, options?: ParserOptions): any;
65
- toJSON(): {
70
+ toJson(): {
66
71
  segments: any[];
67
72
  options: {};
68
73
  };
69
74
  cloneSegments(): ODataPathSegments;
70
- clearQuery(): void;
75
+ clearQuery(): this;
71
76
  cloneQuery<P>(): ODataQueryOptions<P>;
72
77
  /**
73
78
  * Handle the path segments of the resource
@@ -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
- [key: string]: any;
9
+ [name: string]: any;
10
10
  }, metadata: ODataMetadataType): Partial<T>;
11
11
  update(data: {
12
- [key: string]: any;
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
- [key: string]: any;
19
+ [name: string]: any;
20
20
  }): {
21
- [key: string]: any;
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
- [key: string]: any;
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
- [key: string]: any;
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
- [key: string]: any;
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
- [key: string]: any;
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
- [key: string]: any;
71
+ [name: string]: any;
72
72
  };
73
73
  function(name: string): any;
74
74
  }
@@ -21,7 +21,7 @@ export declare class ODataResponse<T> extends HttpResponse<T> {
21
21
  url?: string;
22
22
  });
23
23
  static fromHttpResponse<T>(req: ODataRequest<T>, res: HttpResponse<T>): ODataResponse<T>;
24
- static fromJSON<T>(req: ODataRequest<T>, json: {
24
+ static fromJson<T>(req: ODataRequest<T>, json: {
25
25
  body: T | null;
26
26
  headers: {
27
27
  [name: string]: string | string[];
@@ -30,7 +30,7 @@ export declare class ODataResponse<T> extends HttpResponse<T> {
30
30
  statusText: string;
31
31
  url: string | null;
32
32
  }): ODataResponse<T>;
33
- toJSON(): {
33
+ toJson(): {
34
34
  body: T | null;
35
35
  headers: {
36
36
  [x: string]: string[];
@@ -1,16 +1,20 @@
1
1
  import { Observable } from 'rxjs';
2
2
  import { ODataApi } from '../../api';
3
+ import { EdmType } from '../../types';
3
4
  import { ODataPathSegments } from '../path';
4
5
  import { ODataQueryOptions } from '../query';
5
6
  import { ODataResource } from '../resource';
6
7
  import { ODataOptions } from './options';
8
+ import { ODataStructuredType } from '../../schema';
7
9
  export declare class ODataCountResource<T> extends ODataResource<T> {
8
- static factory<T>(api: ODataApi, { segments, query, }: {
10
+ static factory<T>(api: ODataApi, { schema, segments, query, }: {
11
+ schema?: ODataStructuredType<T>;
9
12
  segments: ODataPathSegments;
10
13
  query?: ODataQueryOptions<T>;
11
14
  }): ODataCountResource<T>;
12
15
  clone(): ODataCountResource<T>;
13
16
  protected get(options?: ODataOptions): Observable<any>;
17
+ returnType(): EdmType;
14
18
  /**
15
19
  * Fetch the count of the set.
16
20
  * @param options Options for the request
@@ -18,9 +18,6 @@ export declare class ODataFunctionResource<P, R> extends ODataResource<R> {
18
18
  static fromResource<P, R>(resource: ODataResource<any>, path: string): ODataFunctionResource<P, R>;
19
19
  clone(): ODataFunctionResource<P, R>;
20
20
  returnType(): string | undefined;
21
- pathAndParams(escape?: boolean): [string, {
22
- [name: string]: any;
23
- }];
24
21
  parameters(params: P | null, { alias }?: {
25
22
  alias?: boolean;
26
23
  }): ODataFunctionResource<P, R>;
@@ -1,5 +1,5 @@
1
1
  import { HttpContext, HttpHeaders, HttpParams } from '@angular/common/http';
2
- import { FetchPolicy } from '../../types';
2
+ import { FetchPolicy, ParserOptions } from '../../types';
3
3
  import { ODataQueryArguments } from '../query';
4
4
  export type ODataOptions = {
5
5
  etag?: string;
@@ -13,6 +13,7 @@ export type ODataOptions = {
13
13
  reportProgress?: boolean;
14
14
  withCredentials?: boolean;
15
15
  fetchPolicy?: FetchPolicy;
16
+ parserOptions?: ParserOptions;
16
17
  };
17
18
  export type ODataEntityOptions = ODataOptions & {
18
19
  responseType?: 'entity';
@@ -9,6 +9,7 @@ import { ODataResource } from '../resource';
9
9
  import { ODataEntities, ODataEntitiesAnnotations, ODataEntity, ODataProperty } from '../responses';
10
10
  import { ODataEntitiesOptions, ODataEntityOptions, ODataOptions, ODataPropertyOptions } from './options';
11
11
  import { ODataValueResource } from './value';
12
+ import { ODataCountResource } from './count';
12
13
  export declare class ODataPropertyResource<T> extends ODataResource<T> {
13
14
  static factory<P>(api: ODataApi, { path, type, schema, segments, query, }: {
14
15
  path: string;
@@ -22,6 +23,7 @@ export declare class ODataPropertyResource<T> extends ODataResource<T> {
22
23
  key(value: any): ODataPropertyResource<T>;
23
24
  keys(values: any[]): ODataPropertyResource<T>;
24
25
  value(): ODataValueResource<T>;
26
+ count(): ODataCountResource<T>;
25
27
  property<P>(path: string): ODataPropertyResource<P>;
26
28
  protected get(options?: ODataEntityOptions & ODataEntitiesOptions & ODataPropertyOptions): Observable<any>;
27
29
  /**
@@ -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
+ isSupertypeOf(type: string): boolean;
101
102
  isOpenType(): boolean;
102
103
  findChildParser(predicate: (p: ODataStructuredTypeParser<any>) => boolean): ODataStructuredTypeParser<any> | undefined;
103
104
  childParser(predicate: (p: ODataStructuredTypeParser<any>) => boolean): Parser<any>;
@@ -55,12 +55,13 @@ export declare class ODataStructuredType<T> extends ODataSchemaElement {
55
55
  * @returns The schema that matches the predicate.
56
56
  */
57
57
  findParentSchema(predicate: (p: ODataStructuredType<any>) => boolean): ODataStructuredType<any> | undefined;
58
+ findChildSchema(predicate: (p: ODataStructuredType<any>) => boolean): ODataStructuredType<any> | undefined;
58
59
  /**
59
60
  * Find a parent schema of the structured type for the given field.
60
61
  * @param field Field that belongs to the structured type
61
62
  * @returns The schema of the field
62
63
  */
63
- findSchemaForField<E>(field: ODataStructuredTypeFieldParser<any>): ODataStructuredType<E>;
64
+ findParentSchemaForField<E>(field: ODataStructuredTypeFieldParser<any>): ODataStructuredType<E>;
64
65
  /**
65
66
  * Picks the fields from attributes.
66
67
  * @param attrs