angular-odata 0.122.0 → 0.124.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 (163) hide show
  1. package/esm2022/lib/api.mjs +373 -0
  2. package/esm2022/lib/cache/cache.mjs +175 -0
  3. package/{esm2020 → esm2022}/lib/cache/storage.mjs +1 -1
  4. package/esm2022/lib/client.mjs +252 -0
  5. package/{esm2020 → esm2022}/lib/helper.mjs +1 -1
  6. package/{esm2020 → esm2022}/lib/loaders.mjs +1 -1
  7. package/esm2022/lib/models/collection.mjs +865 -0
  8. package/esm2022/lib/models/model.mjs +535 -0
  9. package/esm2022/lib/models/options.mjs +1117 -0
  10. package/{esm2020 → esm2022}/lib/module.mjs +5 -5
  11. package/esm2022/lib/resources/path/segments.mjs +124 -0
  12. package/esm2022/lib/resources/query/builder.mjs +624 -0
  13. package/esm2022/lib/resources/query/expressions/base.mjs +20 -0
  14. package/esm2022/lib/resources/query/expressions/compute.mjs +39 -0
  15. package/esm2022/lib/resources/query/expressions/count.mjs +99 -0
  16. package/esm2022/lib/resources/query/expressions/expand.mjs +125 -0
  17. package/esm2022/lib/resources/query/expressions/filter.mjs +161 -0
  18. package/esm2022/lib/resources/query/expressions/orderby.mjs +56 -0
  19. package/esm2022/lib/resources/query/expressions/search.mjs +122 -0
  20. package/esm2022/lib/resources/query/expressions/select.mjs +31 -0
  21. package/esm2022/lib/resources/query/expressions/syntax.mjs +444 -0
  22. package/{esm2020 → esm2022}/lib/resources/query/handlers.mjs +1 -1
  23. package/esm2022/lib/resources/query/options.mjs +115 -0
  24. package/{esm2020 → esm2022}/lib/resources/request.mjs +1 -1
  25. package/esm2022/lib/resources/resource.mjs +257 -0
  26. package/{esm2020 → esm2022}/lib/resources/responses/annotations.mjs +1 -1
  27. package/esm2022/lib/resources/responses/csdl/csdl-annotation.mjs +33 -0
  28. package/{esm2020 → esm2022}/lib/resources/responses/csdl/csdl-entity-container.mjs +1 -1
  29. package/{esm2020 → esm2022}/lib/resources/responses/csdl/csdl-entity-set.mjs +1 -1
  30. package/{esm2020 → esm2022}/lib/resources/responses/csdl/csdl-enum-type.mjs +1 -1
  31. package/{esm2020 → esm2022}/lib/resources/responses/csdl/csdl-function-action.mjs +1 -1
  32. package/{esm2020 → esm2022}/lib/resources/responses/csdl/csdl-navigation-property-binding.mjs +1 -1
  33. package/{esm2020 → esm2022}/lib/resources/responses/csdl/csdl-reference.mjs +1 -1
  34. package/{esm2020 → esm2022}/lib/resources/responses/csdl/csdl-schema.mjs +1 -1
  35. package/{esm2020 → esm2022}/lib/resources/responses/csdl/csdl-singleton.mjs +1 -1
  36. package/{esm2020 → esm2022}/lib/resources/responses/csdl/csdl-structural-property.mjs +1 -1
  37. package/{esm2020 → esm2022}/lib/resources/responses/csdl/csdl-structured-type.mjs +1 -1
  38. package/{esm2020 → esm2022}/lib/resources/responses/csdl/csdl-type-definition.mjs +1 -1
  39. package/esm2022/lib/resources/responses/metadata.mjs +547 -0
  40. package/{esm2020 → esm2022}/lib/resources/responses/response.mjs +1 -1
  41. package/{esm2020 → esm2022}/lib/resources/types/action.mjs +1 -1
  42. package/{esm2020 → esm2022}/lib/resources/types/batch.mjs +1 -1
  43. package/{esm2020 → esm2022}/lib/resources/types/count.mjs +1 -1
  44. package/{esm2020 → esm2022}/lib/resources/types/entity-set.mjs +1 -1
  45. package/{esm2020 → esm2022}/lib/resources/types/entity.mjs +1 -1
  46. package/{esm2020 → esm2022}/lib/resources/types/function.mjs +1 -1
  47. package/{esm2020 → esm2022}/lib/resources/types/media.mjs +1 -1
  48. package/{esm2020 → esm2022}/lib/resources/types/navigation-property.mjs +1 -1
  49. package/{esm2020 → esm2022}/lib/resources/types/property.mjs +1 -1
  50. package/{esm2020 → esm2022}/lib/resources/types/reference.mjs +1 -1
  51. package/{esm2020 → esm2022}/lib/resources/types/singleton.mjs +1 -1
  52. package/{esm2020 → esm2022}/lib/resources/types/value.mjs +1 -1
  53. package/{esm2020 → esm2022}/lib/schema/annotation.mjs +1 -1
  54. package/{esm2020 → esm2022}/lib/schema/callable.mjs +1 -1
  55. package/{esm2020 → esm2022}/lib/schema/element.mjs +1 -1
  56. package/{esm2020 → esm2022}/lib/schema/entity-container.mjs +1 -1
  57. package/{esm2020 → esm2022}/lib/schema/enum-type.mjs +1 -1
  58. package/{esm2020 → esm2022}/lib/schema/parsers/callable.mjs +1 -1
  59. package/esm2022/lib/schema/parsers/edm.mjs +99 -0
  60. package/{esm2020 → esm2022}/lib/schema/parsers/enum-type.mjs +2 -2
  61. package/esm2022/lib/schema/parsers/structured-type.mjs +502 -0
  62. package/{esm2020 → esm2022}/lib/schema/schema.mjs +1 -1
  63. package/esm2022/lib/schema/structured-type.mjs +207 -0
  64. package/esm2022/lib/services/base.mjs +29 -0
  65. package/{esm2020 → esm2022}/lib/services/entity-set.mjs +1 -1
  66. package/{esm2020 → esm2022}/lib/services/factory.mjs +4 -4
  67. package/{esm2020 → esm2022}/lib/services/singleton.mjs +1 -1
  68. package/{esm2020 → esm2022}/lib/settings.mjs +1 -1
  69. package/{esm2020 → esm2022}/lib/types.mjs +1 -1
  70. package/{esm2020 → esm2022}/lib/utils/arrays.mjs +1 -1
  71. package/{esm2020 → esm2022}/lib/utils/durations.mjs +1 -1
  72. package/esm2022/lib/utils/enums.mjs +61 -0
  73. package/{esm2020 → esm2022}/lib/utils/http.mjs +1 -1
  74. package/{esm2020 → esm2022}/lib/utils/objects.mjs +1 -1
  75. package/{esm2020 → esm2022}/lib/utils/odata.mjs +1 -1
  76. package/esm2022/lib/utils/types.mjs +136 -0
  77. package/{fesm2020 → fesm2022}/angular-odata.mjs +544 -373
  78. package/fesm2022/angular-odata.mjs.map +1 -0
  79. package/lib/helper.d.ts +1 -1
  80. package/lib/models/model.d.ts +4 -2
  81. package/lib/models/options.d.ts +7 -8
  82. package/lib/resources/path/segments.d.ts +15 -6
  83. package/lib/resources/query/builder.d.ts +21 -20
  84. package/lib/resources/query/expressions/base.d.ts +6 -4
  85. package/lib/resources/query/expressions/compute.d.ts +10 -8
  86. package/lib/resources/query/expressions/count.d.ts +14 -11
  87. package/lib/resources/query/expressions/expand.d.ts +23 -19
  88. package/lib/resources/query/expressions/filter.d.ts +22 -20
  89. package/lib/resources/query/expressions/orderby.d.ts +12 -9
  90. package/lib/resources/query/expressions/search.d.ts +12 -9
  91. package/lib/resources/query/expressions/select.d.ts +9 -7
  92. package/lib/resources/query/expressions/syntax.d.ts +75 -71
  93. package/lib/resources/query/handlers.d.ts +2 -2
  94. package/lib/resources/query/options.d.ts +15 -6
  95. package/lib/resources/resource.d.ts +2 -2
  96. package/lib/resources/responses/types.d.ts +3 -3
  97. package/lib/resources/types/options.d.ts +7 -7
  98. package/lib/schema/parsers/structured-type.d.ts +8 -5
  99. package/lib/schema/structured-type.d.ts +2 -1
  100. package/lib/types.d.ts +15 -15
  101. package/lib/utils/durations.d.ts +1 -1
  102. package/lib/utils/enums.d.ts +3 -0
  103. package/lib/utils/types.d.ts +1 -0
  104. package/package.json +9 -15
  105. package/esm2020/lib/api.mjs +0 -373
  106. package/esm2020/lib/cache/cache.mjs +0 -173
  107. package/esm2020/lib/client.mjs +0 -252
  108. package/esm2020/lib/models/collection.mjs +0 -861
  109. package/esm2020/lib/models/model.mjs +0 -507
  110. package/esm2020/lib/models/options.mjs +0 -1110
  111. package/esm2020/lib/resources/path/segments.mjs +0 -124
  112. package/esm2020/lib/resources/query/builder.mjs +0 -588
  113. package/esm2020/lib/resources/query/expressions/base.mjs +0 -20
  114. package/esm2020/lib/resources/query/expressions/compute.mjs +0 -39
  115. package/esm2020/lib/resources/query/expressions/count.mjs +0 -89
  116. package/esm2020/lib/resources/query/expressions/expand.mjs +0 -115
  117. package/esm2020/lib/resources/query/expressions/filter.mjs +0 -161
  118. package/esm2020/lib/resources/query/expressions/orderby.mjs +0 -56
  119. package/esm2020/lib/resources/query/expressions/search.mjs +0 -122
  120. package/esm2020/lib/resources/query/expressions/select.mjs +0 -31
  121. package/esm2020/lib/resources/query/expressions/syntax.mjs +0 -409
  122. package/esm2020/lib/resources/query/options.mjs +0 -115
  123. package/esm2020/lib/resources/resource.mjs +0 -251
  124. package/esm2020/lib/resources/responses/csdl/csdl-annotation.mjs +0 -33
  125. package/esm2020/lib/resources/responses/metadata.mjs +0 -547
  126. package/esm2020/lib/schema/parsers/edm.mjs +0 -104
  127. package/esm2020/lib/schema/parsers/structured-type.mjs +0 -490
  128. package/esm2020/lib/schema/structured-type.mjs +0 -202
  129. package/esm2020/lib/services/base.mjs +0 -29
  130. package/esm2020/lib/utils/enums.mjs +0 -45
  131. package/esm2020/lib/utils/types.mjs +0 -133
  132. package/fesm2015/angular-odata.mjs +0 -11811
  133. package/fesm2015/angular-odata.mjs.map +0 -1
  134. package/fesm2020/angular-odata.mjs.map +0 -1
  135. /package/{esm2020 → esm2022}/angular-odata.mjs +0 -0
  136. /package/{esm2020 → esm2022}/lib/cache/index.mjs +0 -0
  137. /package/{esm2020 → esm2022}/lib/cache/memory.mjs +0 -0
  138. /package/{esm2020 → esm2022}/lib/constants.mjs +0 -0
  139. /package/{esm2020 → esm2022}/lib/index.mjs +0 -0
  140. /package/{esm2020 → esm2022}/lib/models/index.mjs +0 -0
  141. /package/{esm2020 → esm2022}/lib/options.mjs +0 -0
  142. /package/{esm2020 → esm2022}/lib/resources/index.mjs +0 -0
  143. /package/{esm2020 → esm2022}/lib/resources/path/handlers.mjs +0 -0
  144. /package/{esm2020 → esm2022}/lib/resources/path/index.mjs +0 -0
  145. /package/{esm2020 → esm2022}/lib/resources/query/expressions/index.mjs +0 -0
  146. /package/{esm2020 → esm2022}/lib/resources/query/index.mjs +0 -0
  147. /package/{esm2020 → esm2022}/lib/resources/responses/index.mjs +0 -0
  148. /package/{esm2020 → esm2022}/lib/resources/responses/options.mjs +0 -0
  149. /package/{esm2020 → esm2022}/lib/resources/responses/types.mjs +0 -0
  150. /package/{esm2020 → esm2022}/lib/resources/types/index.mjs +0 -0
  151. /package/{esm2020 → esm2022}/lib/resources/types/metadata.mjs +0 -0
  152. /package/{esm2020 → esm2022}/lib/resources/types/options.mjs +0 -0
  153. /package/{esm2020 → esm2022}/lib/schema/entity-set.mjs +0 -0
  154. /package/{esm2020 → esm2022}/lib/schema/index.mjs +0 -0
  155. /package/{esm2020 → esm2022}/lib/schema/parsers/index.mjs +0 -0
  156. /package/{esm2020 → esm2022}/lib/services/entity.mjs +0 -0
  157. /package/{esm2020 → esm2022}/lib/services/index.mjs +0 -0
  158. /package/{esm2020 → esm2022}/lib/utils/arraybuffers.mjs +0 -0
  159. /package/{esm2020 → esm2022}/lib/utils/dates.mjs +0 -0
  160. /package/{esm2020 → esm2022}/lib/utils/index.mjs +0 -0
  161. /package/{esm2020 → esm2022}/lib/utils/strings.mjs +0 -0
  162. /package/{esm2020 → esm2022}/lib/utils/urls.mjs +0 -0
  163. /package/{esm2020 → esm2022}/public-api.mjs +0 -0
@@ -1,136 +1,138 @@
1
+ import { Parser } from '../../../types';
1
2
  import type { QueryCustomType } from '../builder';
3
+ export type Normalize = 'all' | 'right' | 'left' | 'none';
2
4
  export interface Renderable {
3
- render({ aliases, escape, prefix, }: {
5
+ render({ aliases, escape, prefix, parser, }: {
4
6
  aliases?: QueryCustomType[];
5
7
  escape?: boolean;
6
8
  prefix?: string;
9
+ parser?: Parser<any>;
7
10
  }): string;
8
11
  toString(): string;
9
12
  toJSON(): any;
10
13
  clone(): any;
11
14
  }
12
- export declare class Field<T extends object> implements ProxyHandler<T> {
13
- name: string;
14
- constructor(name?: string);
15
- static factory<T extends object>(name?: string): T;
16
- get(target: T, key: string | symbol): any;
17
- has(target: T, key: string): any;
18
- }
19
- 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, }?: {
20
17
  aliases?: QueryCustomType[];
21
18
  normalize?: boolean;
22
19
  escape?: boolean;
23
20
  prefix?: string;
21
+ parser?: Parser<any>;
24
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;
25
25
  export declare class Function<T> implements Renderable {
26
26
  protected name: string;
27
27
  protected values: any[];
28
- protected normalize: boolean;
28
+ protected normalize: Normalize;
29
29
  protected escape: boolean;
30
- constructor(name: string, values: any[], normalize?: boolean, escape?: boolean);
30
+ constructor(name: string, values: any[], normalize: Normalize, escape?: boolean);
31
31
  get [Symbol.toStringTag](): string;
32
32
  toJSON(): {
33
33
  $type: string;
34
34
  name: string;
35
35
  values: any[];
36
- normalize: boolean;
36
+ normalize: Normalize;
37
37
  };
38
- render({ aliases, escape, prefix, }: {
38
+ render({ aliases, escape, prefix, parser, }: {
39
39
  aliases?: QueryCustomType[];
40
40
  escape?: boolean;
41
41
  prefix?: string;
42
+ parser?: Parser<T>;
42
43
  }): string;
43
44
  clone(): Function<T>;
44
45
  }
45
46
  export declare class StringAndCollectionFunctions<T> {
46
- concat(field: any, value: any, normalize?: boolean): Function<T>;
47
- contains(field: any, value: any, normalize?: boolean): Function<T>;
48
- endsWith(field: any, value: any, normalize?: boolean): Function<T>;
49
- indexOf(field: any, value: any, normalize?: boolean): Function<T>;
50
- length(value: any, normalize?: boolean): Function<T>;
51
- startsWith(field: any, value: any, normalize?: boolean): Function<T>;
52
- subString(field: any, start: number, length?: number): Function<T>;
47
+ concat(left: any, right: any, normalize?: Normalize): Function<T>;
48
+ contains(left: any, right: any, normalize?: Normalize): Function<T>;
49
+ endsWith(left: any, right: any, normalize?: Normalize): Function<T>;
50
+ indexOf(left: any, right: any, normalize?: Normalize): Function<T>;
51
+ length(left: any, normalize?: Normalize): Function<T>;
52
+ startsWith(left: any, right: any, normalize?: Normalize): Function<T>;
53
+ subString(left: any, right: number, length?: number, normalize?: Normalize): Function<T>;
53
54
  }
54
55
  export declare class CollectionFunctions<T> {
55
- hasSubset(s1: T, s2: any): Function<T>;
56
- hasSubsequence(s1: T, s2: any): Function<T>;
56
+ hasSubset(left: T, right: any, normalize?: Normalize): Function<T>;
57
+ hasSubsequence(left: T, right: any, normalize?: Normalize): Function<T>;
57
58
  }
58
59
  export declare class StringFunctions<T> {
59
- matchesPattern(value: T | string, pattern: string): Function<T>;
60
- toLower(value: T): Function<T>;
61
- toUpper(value: T): Function<T>;
62
- trim(value: T): Function<T>;
60
+ matchesPattern(left: any | string, pattern: string, normalize?: Normalize): Function<T>;
61
+ toLower(left: any, normalize?: Normalize): Function<T>;
62
+ toUpper(left: any, normalize?: Normalize): Function<T>;
63
+ trim(left: any, normalize?: Normalize): Function<T>;
63
64
  }
64
65
  export declare class DateAndTimeFunctions<T> {
65
- date(value: any): Function<T>;
66
- day(value: any): Function<T>;
67
- fractionalseconds(value: any): Function<T>;
68
- hour(value: any): Function<T>;
69
- maxdatetime(value: any): Function<T>;
70
- mindatetime(value: any): Function<T>;
71
- minute(value: any): Function<T>;
72
- month(value: any): Function<T>;
66
+ date(left: any, normalize?: Normalize): Function<T>;
67
+ day(left: any, normalize?: Normalize): Function<T>;
68
+ fractionalseconds(left: any, normalize?: Normalize): Function<T>;
69
+ hour(left: any, normalize?: Normalize): Function<T>;
70
+ maxdatetime(left: any, normalize?: Normalize): Function<T>;
71
+ mindatetime(left: any, normalize?: Normalize): Function<T>;
72
+ minute(left: any, normalize?: Normalize): Function<T>;
73
+ month(left: any, normalize?: Normalize): Function<T>;
73
74
  now(): Function<T>;
74
- second(value: any): Function<T>;
75
- time(value: any): Function<T>;
76
- totaloffsetminutes(value: any): Function<T>;
77
- totalseconds(value: any): Function<T>;
78
- year(value: any): Function<T>;
75
+ second(left: any, normalize?: Normalize): Function<T>;
76
+ time(left: any, normalize?: Normalize): Function<T>;
77
+ totaloffsetminutes(left: any, normalize?: Normalize): Function<T>;
78
+ totalseconds(left: any, normalize?: Normalize): Function<T>;
79
+ year(left: any, normalize?: Normalize): Function<T>;
79
80
  }
80
81
  export declare class ArithmeticFunctions<T> {
81
- ceiling(value: T | string): Function<T>;
82
- floor(value: T | string): Function<T>;
83
- round(value: T | string): Function<T>;
82
+ ceiling(left: T | string, normalize?: Normalize): Function<T>;
83
+ floor(left: T | string, normalize?: Normalize): Function<T>;
84
+ round(left: T | string, normalize?: Normalize): Function<T>;
84
85
  }
85
86
  export declare class TypeFunctions<T> {
86
- cast(value: T | string, type?: string): Function<T>;
87
- isof(value: T | string, type?: string): Function<T>;
87
+ cast(left: T | string, right?: string, normalize?: Normalize): Function<T>;
88
+ isof(left: T | string, right?: string, normalize?: Normalize): Function<T>;
88
89
  }
89
90
  export declare class GeoFunctions<T> {
90
- geoDistance(value: T, point: string, normalize?: boolean): Function<T>;
91
- geoIntersects(value: T, polygon: string, normalize?: boolean): Function<T>;
92
- geoLength(line: T, normalize?: boolean): Function<T>;
91
+ geoDistance(left: T, right: string, normalize?: Normalize): Function<T>;
92
+ geoIntersects(left: T, right: string, normalize?: Normalize): Function<T>;
93
+ geoLength(left: T, normalize?: Normalize): Function<T>;
93
94
  }
94
95
  export declare class ConditionalFunctions<T> {
95
- case(condition: T | string, value: any): Function<T>;
96
+ case(left: T | string, right: any, normalize?: Normalize): Function<T>;
96
97
  }
97
98
  export declare class Operator<T> implements Renderable {
98
99
  protected op: string;
99
100
  protected values: any[];
100
- protected normalize: boolean;
101
- constructor(op: string, values: any[], normalize?: boolean);
101
+ protected normalize: Normalize;
102
+ constructor(op: string, values: any[], normalize: Normalize);
102
103
  get [Symbol.toStringTag](): string;
103
104
  toJSON(): {
104
105
  $type: string;
105
106
  op: string;
106
107
  values: any[];
107
- normalize: boolean;
108
+ normalize: Normalize;
108
109
  };
109
- render({ aliases, escape, prefix, }: {
110
+ render({ aliases, escape, prefix, parser, }: {
110
111
  aliases?: QueryCustomType[];
111
112
  escape?: boolean;
112
113
  prefix?: string;
114
+ parser?: Parser<T>;
113
115
  }): string;
114
116
  clone(): Operator<unknown>;
115
117
  }
116
118
  export declare class LogicalOperators<T> {
117
- eq(left: any, right: any, normalize?: boolean): Operator<unknown>;
118
- ne(left: any, right: any, normalize?: boolean): Operator<unknown>;
119
- gt(left: any, right: any, normalize?: boolean): Operator<unknown>;
120
- ge(left: any, right: any, normalize?: boolean): Operator<unknown>;
121
- lt(left: any, right: any, normalize?: boolean): Operator<unknown>;
122
- le(left: any, right: any, normalize?: boolean): Operator<unknown>;
123
- not(value: any, normalize?: boolean): Operator<T>;
124
- has(left: any, right: any, normalize?: boolean): Operator<unknown>;
125
- in(left: any, right: any, normalize?: boolean): Operator<unknown>;
119
+ eq(left: any, right: any, normalize?: Normalize): Operator<unknown>;
120
+ ne(left: any, right: any, normalize?: Normalize): Operator<unknown>;
121
+ gt(left: any, right: any, normalize?: Normalize): Operator<unknown>;
122
+ ge(left: any, right: any, normalize?: Normalize): Operator<unknown>;
123
+ lt(left: any, right: any, normalize?: Normalize): Operator<unknown>;
124
+ le(left: any, right: any, normalize?: Normalize): Operator<unknown>;
125
+ not(left: any, normalize?: Normalize): Operator<T>;
126
+ has(left: any, right: any, normalize?: Normalize): Operator<unknown>;
127
+ in(left: any, right: any, normalize?: Normalize): Operator<unknown>;
126
128
  }
127
129
  export declare class ArithmeticOperators<T> {
128
- add(left: any, right: any, normalize?: boolean): Operator<T>;
129
- sub(left: any, right: any, normalize?: boolean): Operator<unknown>;
130
- mul(left: any, right: any, normalize?: boolean): Operator<unknown>;
131
- div(left: any, right: any, normalize?: boolean): Operator<unknown>;
132
- mod(left: any, right: any, normalize?: boolean): Operator<unknown>;
133
- neg(value: any, normalize?: boolean): Operator<unknown>;
130
+ add(left: any, right: any, normalize?: Normalize): Operator<T>;
131
+ sub(left: any, right: any, normalize?: Normalize): Operator<unknown>;
132
+ mul(left: any, right: any, normalize?: Normalize): Operator<unknown>;
133
+ div(left: any, right: any, normalize?: Normalize): Operator<unknown>;
134
+ mod(left: any, right: any, normalize?: Normalize): Operator<unknown>;
135
+ neg(value: any, normalize?: Normalize): Operator<unknown>;
134
136
  }
135
137
  export declare class Grouping<T> implements Renderable {
136
138
  protected group: Renderable;
@@ -140,10 +142,11 @@ export declare class Grouping<T> implements Renderable {
140
142
  $type: string;
141
143
  group: any;
142
144
  };
143
- render({ aliases, escape, prefix, }: {
145
+ render({ aliases, escape, prefix, parser, }: {
144
146
  aliases?: QueryCustomType[];
145
147
  escape?: boolean;
146
148
  prefix?: string;
149
+ parser?: Parser<T>;
147
150
  }): string;
148
151
  clone(): Grouping<unknown>;
149
152
  }
@@ -159,16 +162,17 @@ export declare class Lambda<T> implements Renderable {
159
162
  values: any[];
160
163
  alias: string | undefined;
161
164
  };
162
- render({ aliases, escape, prefix, }: {
165
+ render({ aliases, escape, prefix, parser, }: {
163
166
  aliases?: QueryCustomType[];
164
167
  escape?: boolean;
165
168
  prefix?: string;
169
+ parser?: Parser<T>;
166
170
  }): string;
167
171
  clone(): Lambda<unknown>;
168
172
  }
169
173
  export declare class LambdaOperators<T> {
170
- any(field: T, value: any, alias?: string): Lambda<unknown>;
171
- all(field: T, value: any, alias?: string): Lambda<unknown>;
174
+ any(left: T, right: any, alias?: string): Lambda<unknown>;
175
+ all(left: T, right: any, alias?: string): Lambda<unknown>;
172
176
  }
173
177
  export declare class ODataOperators<T> {
174
178
  }
@@ -126,7 +126,7 @@ export declare class ODataQueryOptionsHandler<T> {
126
126
  * If opts is given then set te value as new value for $select.
127
127
  * @param opts Select<T> value or builder function for SelectExpression<T>
128
128
  */
129
- select(opts: SelectExpressionBuilder<T>): SelectExpression<T>;
129
+ select(opts: (builder: SelectExpressionBuilder<T>, current?: SelectExpression<T>) => SelectExpression<T>): SelectExpression<T>;
130
130
  select(opts: Select<T>): ODataQueryOptionHandler<T>;
131
131
  select(): ODataQueryOptionHandler<T>;
132
132
  /**
@@ -134,7 +134,7 @@ export declare class ODataQueryOptionsHandler<T> {
134
134
  * If opts is given then set te value as new value for $expand.
135
135
  * @param opts Expand<T> value or builder function for ExpandExpression<T>
136
136
  */
137
- expand(opts: ExpandExpressionBuilder<T>): ExpandExpression<T>;
137
+ expand(opts: (builder: ExpandExpressionBuilder<T>, current?: ExpandExpression<T>) => ExpandExpression<T>): ExpandExpression<T>;
138
138
  expand(opts: Expand<T>): ODataQueryOptionHandler<T>;
139
139
  expand(): ODataQueryOptionHandler<T>;
140
140
  /**
@@ -1,10 +1,10 @@
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';
5
5
  import { SelectExpression } from './expressions/select';
6
6
  import { ODataQueryOptionHandler } from './handlers';
7
- export declare type ODataQueryArguments<T> = {
7
+ export type ODataQueryArguments<T> = {
8
8
  [QueryOption.select]?: Select<T> | SelectExpression<T> | null;
9
9
  [QueryOption.expand]?: Expand<T> | ExpandExpression<T> | null;
10
10
  [QueryOption.compute]?: string | ComputeExpression<T> | null;
@@ -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?: boolean): [string, {
28
- [name: string]: any;
29
- }];
30
- toString(): string;
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>;
@@ -8,7 +8,7 @@ import { ODataPathSegments, ODataPathSegmentsHandler } from './path';
8
8
  import { ODataQueryOptions, ODataQueryOptionsHandler, QueryCustomType } from './query';
9
9
  import { ODataEntitiesAnnotations, ODataEntityAnnotations } from './responses/index';
10
10
  import { ODataOptions } from './types';
11
- export declare type EntityKey<T> = {
11
+ export type EntityKey<T> = {
12
12
  readonly [P in keyof T]?: T[P];
13
13
  } | QueryCustomType | string | number;
14
14
  export declare class ODataResource<T> {
@@ -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;
@@ -1,13 +1,13 @@
1
1
  import { ODataEntitiesAnnotations, ODataEntityAnnotations, ODataPropertyAnnotations } from './annotations';
2
- export declare type ODataEntity<T> = {
2
+ export type ODataEntity<T> = {
3
3
  entity: T | null;
4
4
  annots: ODataEntityAnnotations<T>;
5
5
  };
6
- export declare type ODataEntities<T> = {
6
+ export type ODataEntities<T> = {
7
7
  entities: T[] | null;
8
8
  annots: ODataEntitiesAnnotations<T>;
9
9
  };
10
- export declare type ODataProperty<T> = {
10
+ export type ODataProperty<T> = {
11
11
  property: T | null;
12
12
  annots: ODataPropertyAnnotations<T>;
13
13
  };
@@ -1,7 +1,7 @@
1
1
  import { HttpContext, HttpHeaders, HttpParams } from '@angular/common/http';
2
2
  import { FetchPolicy } from '../../types';
3
3
  import { ODataQueryArguments } from '../query';
4
- export declare type ODataOptions = {
4
+ export type ODataOptions = {
5
5
  etag?: string;
6
6
  context?: HttpContext;
7
7
  headers?: HttpHeaders | {
@@ -14,18 +14,18 @@ export declare type ODataOptions = {
14
14
  withCredentials?: boolean;
15
15
  fetchPolicy?: FetchPolicy;
16
16
  };
17
- export declare type ODataEntityOptions = ODataOptions & {
17
+ export type ODataEntityOptions = ODataOptions & {
18
18
  responseType?: 'entity';
19
19
  };
20
- export declare type ODataEntitiesOptions = ODataOptions & {
20
+ export type ODataEntitiesOptions = ODataOptions & {
21
21
  responseType?: 'entities';
22
22
  withCount?: boolean;
23
23
  };
24
- export declare type ODataPropertyOptions = ODataOptions & {
24
+ export type ODataPropertyOptions = ODataOptions & {
25
25
  responseType?: 'property';
26
26
  };
27
- export declare type ODataQueryArgumentsOptions<T> = ODataOptions & ODataQueryArguments<T>;
28
- export declare type ODataActionOptions<T> = ODataQueryArgumentsOptions<T>;
29
- export declare type ODataFunctionOptions<T> = ODataQueryArgumentsOptions<T> & {
27
+ export type ODataQueryArgumentsOptions<T> = ODataOptions & ODataQueryArguments<T>;
28
+ export type ODataActionOptions<T> = ODataQueryArgumentsOptions<T>;
29
+ export type ODataFunctionOptions<T> = ODataQueryArgumentsOptions<T> & {
30
30
  alias?: boolean;
31
31
  };
@@ -1,17 +1,17 @@
1
1
  import { ParserOptions, Parser, StructuredTypeConfig, StructuredTypeFieldConfig, FieldParser, EdmType } from '../../types';
2
2
  import { ODataAnnotatable } from '../annotation';
3
3
  import { ODataEnumTypeParser } from './enum-type';
4
- declare type JsonSchemaSelect<T> = Array<keyof T>;
5
- declare type JsonSchemaCustom<T> = {
4
+ type JsonSchemaSelect<T> = Array<keyof T>;
5
+ type JsonSchemaCustom<T> = {
6
6
  [P in keyof T]?: (schema: any, field: ODataStructuredTypeFieldParser<T[P]>) => any;
7
7
  };
8
- declare type JsonSchemaExpand<T> = {
8
+ type JsonSchemaExpand<T> = {
9
9
  [P in keyof T]?: JsonSchemaOptions<T[P]>;
10
10
  };
11
- declare type JsonSchemaRequired<T> = {
11
+ type JsonSchemaRequired<T> = {
12
12
  [P in keyof T]?: boolean;
13
13
  };
14
- export declare type JsonSchemaOptions<T> = {
14
+ export type JsonSchemaOptions<T> = {
15
15
  select?: JsonSchemaSelect<T>;
16
16
  custom?: JsonSchemaCustom<T>;
17
17
  expand?: JsonSchemaExpand<T>;
@@ -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/types.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  import { Observable } from 'rxjs';
2
- export declare type ODataVersion = '2.0' | '3.0' | '4.0';
3
- export declare type FetchPolicy = 'cache-first' | 'cache-and-network' | 'network-only' | 'no-cache' | 'cache-only';
4
- export declare type ODataMetadataType = 'minimal' | 'full' | 'none';
5
- export declare type CacheCacheability = 'public' | 'private' | 'no-cache' | 'no-store';
2
+ export type ODataVersion = '2.0' | '3.0' | '4.0';
3
+ export type FetchPolicy = 'cache-first' | 'cache-and-network' | 'network-only' | 'no-cache' | 'cache-only';
4
+ export type ODataMetadataType = 'minimal' | 'full' | 'none';
5
+ export type CacheCacheability = 'public' | 'private' | 'no-cache' | 'no-store';
6
6
  export declare enum PathSegment {
7
7
  batch = "batch",
8
8
  metadata = "metadata",
@@ -134,7 +134,7 @@ export interface Cache {
134
134
  put<T>(key: string, payload: T, ...opts: any[]): void;
135
135
  get<T>(key: string, ...opts: any[]): T | undefined;
136
136
  }
137
- export declare type ApiConfig = {
137
+ export type ApiConfig = {
138
138
  serviceRootUrl: string;
139
139
  name?: string;
140
140
  version?: ODataVersion;
@@ -148,7 +148,7 @@ export declare type ApiConfig = {
148
148
  };
149
149
  schemas?: SchemaConfig[];
150
150
  };
151
- export declare type AnnotationConfig = {
151
+ export type AnnotationConfig = {
152
152
  term: string;
153
153
  string?: string;
154
154
  bool?: boolean;
@@ -156,7 +156,7 @@ export declare type AnnotationConfig = {
156
156
  permissions?: string[];
157
157
  properties?: string[];
158
158
  };
159
- export declare type SchemaConfig = {
159
+ export type SchemaConfig = {
160
160
  namespace: string;
161
161
  alias?: string;
162
162
  annotations?: AnnotationConfig[];
@@ -165,16 +165,16 @@ export declare type SchemaConfig = {
165
165
  callables?: CallableConfig[];
166
166
  containers?: EntityContainerConfig[];
167
167
  };
168
- export declare type EntityContainerConfig = {
168
+ export type EntityContainerConfig = {
169
169
  name: string;
170
170
  annotations?: AnnotationConfig[];
171
171
  entitySets?: EntitySetConfig[];
172
172
  };
173
- export declare type EnumTypeFieldConfig<E> = {
173
+ export type EnumTypeFieldConfig<E> = {
174
174
  value: E;
175
175
  annotations?: AnnotationConfig[];
176
176
  };
177
- export declare type EnumTypeConfig<E> = {
177
+ export type EnumTypeConfig<E> = {
178
178
  name: string;
179
179
  flags?: boolean;
180
180
  annotations?: AnnotationConfig[];
@@ -187,7 +187,7 @@ export declare type EnumTypeConfig<E> = {
187
187
  [member: string]: EnumTypeFieldConfig<E>;
188
188
  };
189
189
  };
190
- export declare type StructuredTypeFieldConfig = {
190
+ export type StructuredTypeFieldConfig = {
191
191
  type: string;
192
192
  default?: any;
193
193
  maxLength?: number;
@@ -205,7 +205,7 @@ export declare type StructuredTypeFieldConfig = {
205
205
  referential?: string;
206
206
  referenced?: string;
207
207
  };
208
- export declare type StructuredTypeConfig<T> = {
208
+ export type StructuredTypeConfig<T> = {
209
209
  name: string;
210
210
  base?: string;
211
211
  open?: boolean;
@@ -224,12 +224,12 @@ export declare type StructuredTypeConfig<T> = {
224
224
  [P in keyof T]?: StructuredTypeFieldConfig;
225
225
  };
226
226
  };
227
- export declare type Parameter = {
227
+ export type Parameter = {
228
228
  type: string;
229
229
  nullable?: boolean;
230
230
  collection?: boolean;
231
231
  };
232
- export declare type CallableConfig = {
232
+ export type CallableConfig = {
233
233
  name: string;
234
234
  entitySetPath?: string;
235
235
  bound?: boolean;
@@ -242,7 +242,7 @@ export declare type CallableConfig = {
242
242
  collection?: boolean;
243
243
  };
244
244
  };
245
- export declare type EntitySetConfig = {
245
+ export type EntitySetConfig = {
246
246
  name: string;
247
247
  entityType: string;
248
248
  service: {
@@ -1,4 +1,4 @@
1
- export declare type Duration = {
1
+ export type Duration = {
2
2
  sign?: 1 | -1;
3
3
  years?: number;
4
4
  months?: number;
@@ -17,4 +17,7 @@ export declare const Enums: {
17
17
  toNames<E_5 extends {
18
18
  [key: string]: any;
19
19
  }>(enums: E_5, value: any): string[];
20
+ toFlags<E_6 extends {
21
+ [key: string]: any;
22
+ }>(enums: E_6, value: any): string[];
20
23
  };
@@ -1,5 +1,6 @@
1
1
  export declare const Types: {
2
2
  rawType(value: any): string;
3
+ isObject(value: any): boolean;
3
4
  isPlainObject(value: any): boolean;
4
5
  isFunction(value: any): boolean;
5
6
  isArray(value: any): boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "angular-odata",
3
- "version": "0.122.0",
3
+ "version": "0.124.0",
4
4
  "license": "MIT",
5
5
  "description": "Client side OData typescript library for Angular",
6
6
  "repository": {
@@ -25,17 +25,14 @@
25
25
  "homepage": "https://github.com/diegomvh/angular-odata",
26
26
  "private": false,
27
27
  "peerDependencies": {
28
- "@angular/common": ">=13.0.0",
29
- "@angular/core": ">=13.0.0"
28
+ "@angular/common": ">=14.0.0",
29
+ "@angular/core": ">=14.0.0"
30
30
  },
31
31
  "dependencies": {
32
32
  "tslib": "^2.3.0"
33
33
  },
34
- "module": "fesm2015/angular-odata.mjs",
35
- "es2020": "fesm2020/angular-odata.mjs",
36
- "esm2020": "esm2020/angular-odata.mjs",
37
- "fesm2020": "fesm2020/angular-odata.mjs",
38
- "fesm2015": "fesm2015/angular-odata.mjs",
34
+ "sideEffects": false,
35
+ "module": "fesm2022/angular-odata.mjs",
39
36
  "typings": "index.d.ts",
40
37
  "exports": {
41
38
  "./package.json": {
@@ -43,12 +40,9 @@
43
40
  },
44
41
  ".": {
45
42
  "types": "./index.d.ts",
46
- "esm2020": "./esm2020/angular-odata.mjs",
47
- "es2020": "./fesm2020/angular-odata.mjs",
48
- "es2015": "./fesm2015/angular-odata.mjs",
49
- "node": "./fesm2015/angular-odata.mjs",
50
- "default": "./fesm2020/angular-odata.mjs"
43
+ "esm2022": "./esm2022/angular-odata.mjs",
44
+ "esm": "./esm2022/angular-odata.mjs",
45
+ "default": "./fesm2022/angular-odata.mjs"
51
46
  }
52
- },
53
- "sideEffects": false
47
+ }
54
48
  }