angular-odata 0.92.0 → 0.95.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (196) hide show
  1. package/{esm2015/angular-odata.js → esm2020/angular-odata.mjs} +0 -0
  2. package/esm2020/lib/api.mjs +303 -0
  3. package/{esm2015/lib/cache/cache.js → esm2020/lib/cache/cache.mjs} +3 -3
  4. package/{esm2015/lib/cache/index.js → esm2020/lib/cache/index.mjs} +0 -0
  5. package/{esm2015/lib/cache/memory.js → esm2020/lib/cache/memory.mjs} +1 -1
  6. package/{esm2015/lib/cache/storage.js → esm2020/lib/cache/storage.mjs} +2 -2
  7. package/esm2020/lib/client.mjs +271 -0
  8. package/{esm2015/lib/constants.js → esm2020/lib/constants.mjs} +3 -1
  9. package/esm2020/lib/helper.mjs +268 -0
  10. package/{esm2015/lib/index.js → esm2020/lib/index.mjs} +0 -0
  11. package/esm2020/lib/models/collection.mjs +741 -0
  12. package/{esm2015/lib/models/index.js → esm2020/lib/models/index.mjs} +0 -0
  13. package/esm2020/lib/models/model.mjs +453 -0
  14. package/esm2020/lib/models/options.mjs +945 -0
  15. package/{esm2015/lib/module.js → esm2020/lib/module.mjs} +7 -7
  16. package/esm2020/lib/options.mjs +32 -0
  17. package/{esm2015/lib/resources/index.js → esm2020/lib/resources/index.mjs} +0 -0
  18. package/{esm2015/lib/resources/path/handlers.js → esm2020/lib/resources/path/handlers.mjs} +1 -1
  19. package/{esm2015/lib/resources/path/index.js → esm2020/lib/resources/path/index.mjs} +0 -0
  20. package/esm2020/lib/resources/path/segments.mjs +124 -0
  21. package/esm2020/lib/resources/query/builder.mjs +590 -0
  22. package/esm2020/lib/resources/query/expressions.mjs +207 -0
  23. package/esm2020/lib/resources/query/handlers.mjs +186 -0
  24. package/{esm2015/lib/resources/query/index.js → esm2020/lib/resources/query/index.mjs} +0 -0
  25. package/esm2020/lib/resources/query/options.mjs +103 -0
  26. package/esm2020/lib/resources/query/syntax.mjs +406 -0
  27. package/esm2020/lib/resources/request.mjs +167 -0
  28. package/esm2020/lib/resources/resource.mjs +326 -0
  29. package/esm2020/lib/resources/responses/annotations.mjs +119 -0
  30. package/{esm2015/lib/resources/responses/csdl/csdl-annotation.js → esm2020/lib/resources/responses/csdl/csdl-annotation.mjs} +0 -0
  31. package/{esm2015/lib/resources/responses/csdl/csdl-entity-container.js → esm2020/lib/resources/responses/csdl/csdl-entity-container.mjs} +0 -0
  32. package/{esm2015/lib/resources/responses/csdl/csdl-entity-set.js → esm2020/lib/resources/responses/csdl/csdl-entity-set.mjs} +0 -0
  33. package/{esm2015/lib/resources/responses/csdl/csdl-enum-type.js → esm2020/lib/resources/responses/csdl/csdl-enum-type.mjs} +0 -0
  34. package/{esm2015/lib/resources/responses/csdl/csdl-function-action.js → esm2020/lib/resources/responses/csdl/csdl-function-action.mjs} +0 -0
  35. package/{esm2015/lib/resources/responses/csdl/csdl-navigation-property-binding.js → esm2020/lib/resources/responses/csdl/csdl-navigation-property-binding.mjs} +0 -0
  36. package/{esm2015/lib/resources/responses/csdl/csdl-reference.js → esm2020/lib/resources/responses/csdl/csdl-reference.mjs} +0 -0
  37. package/{esm2015/lib/resources/responses/csdl/csdl-schema.js → esm2020/lib/resources/responses/csdl/csdl-schema.mjs} +0 -0
  38. package/{esm2015/lib/resources/responses/csdl/csdl-singleton.js → esm2020/lib/resources/responses/csdl/csdl-singleton.mjs} +0 -0
  39. package/{esm2015/lib/resources/responses/csdl/csdl-structural-property.js → esm2020/lib/resources/responses/csdl/csdl-structural-property.mjs} +0 -0
  40. package/{esm2015/lib/resources/responses/csdl/csdl-structured-type.js → esm2020/lib/resources/responses/csdl/csdl-structured-type.mjs} +0 -0
  41. package/{esm2015/lib/resources/responses/csdl/csdl-type-definition.js → esm2020/lib/resources/responses/csdl/csdl-type-definition.mjs} +0 -0
  42. package/{esm2015/lib/resources/responses/index.js → esm2020/lib/resources/responses/index.mjs} +0 -0
  43. package/esm2020/lib/resources/responses/metadata.mjs +547 -0
  44. package/{esm2015/lib/resources/responses/options.js → esm2020/lib/resources/responses/options.mjs} +0 -0
  45. package/{esm2015/lib/resources/responses/response.js → esm2020/lib/resources/responses/response.mjs} +0 -0
  46. package/{esm2015/lib/resources/responses/types.js → esm2020/lib/resources/responses/types.mjs} +0 -0
  47. package/esm2020/lib/resources/types/action.mjs +101 -0
  48. package/esm2020/lib/resources/types/batch.mjs +288 -0
  49. package/esm2020/lib/resources/types/count.mjs +27 -0
  50. package/esm2020/lib/resources/types/entity-set.mjs +94 -0
  51. package/esm2020/lib/resources/types/entity.mjs +106 -0
  52. package/esm2020/lib/resources/types/function.mjs +137 -0
  53. package/{esm2015/lib/resources/types/index.js → esm2020/lib/resources/types/index.mjs} +0 -0
  54. package/esm2020/lib/resources/types/media.mjs +41 -0
  55. package/esm2020/lib/resources/types/metadata.mjs +30 -0
  56. package/esm2020/lib/resources/types/navigation-property.mjs +226 -0
  57. package/esm2020/lib/resources/types/options.mjs +2 -0
  58. package/esm2020/lib/resources/types/property.mjs +183 -0
  59. package/esm2020/lib/resources/types/reference.mjs +85 -0
  60. package/esm2020/lib/resources/types/singleton.mjs +126 -0
  61. package/esm2020/lib/resources/types/value.mjs +41 -0
  62. package/esm2020/lib/schema/annotation.mjs +37 -0
  63. package/esm2020/lib/schema/callable.mjs +62 -0
  64. package/esm2020/lib/schema/element.mjs +51 -0
  65. package/esm2020/lib/schema/entity-container.mjs +9 -0
  66. package/esm2020/lib/schema/entity-set.mjs +9 -0
  67. package/esm2020/lib/schema/enum-type.mjs +71 -0
  68. package/{esm2015/lib/schema/index.js → esm2020/lib/schema/index.mjs} +0 -0
  69. package/esm2020/lib/schema/parsers/callable.mjs +113 -0
  70. package/{esm2015/lib/schema/parsers/edm.js → esm2020/lib/schema/parsers/edm.mjs} +2 -2
  71. package/esm2020/lib/schema/parsers/enum-type.mjs +107 -0
  72. package/{esm2015/lib/schema/parsers/index.js → esm2020/lib/schema/parsers/index.mjs} +0 -0
  73. package/esm2020/lib/schema/parsers/structured-type.mjs +412 -0
  74. package/esm2020/lib/schema/schema.mjs +61 -0
  75. package/esm2020/lib/schema/structured-type.mjs +198 -0
  76. package/esm2020/lib/services/base.mjs +29 -0
  77. package/esm2020/lib/services/entity-set.mjs +143 -0
  78. package/esm2020/lib/services/entity.mjs +12 -0
  79. package/{esm2015/lib/services/factory.js → esm2020/lib/services/factory.mjs} +3 -3
  80. package/{esm2015/lib/services/index.js → esm2020/lib/services/index.mjs} +0 -0
  81. package/{esm2015/lib/services/singleton.js → esm2020/lib/services/singleton.mjs} +1 -1
  82. package/{esm2015/lib/settings.js → esm2020/lib/settings.mjs} +1 -1
  83. package/{esm2015/lib/tokens.js → esm2020/lib/tokens.mjs} +0 -0
  84. package/esm2020/lib/types.mjs +37 -0
  85. package/{esm2015/lib/utils/arraybuffers.js → esm2020/lib/utils/arraybuffers.mjs} +0 -0
  86. package/{esm2015/lib/utils/dates.js → esm2020/lib/utils/dates.mjs} +0 -0
  87. package/{esm2015/lib/utils/durations.js → esm2020/lib/utils/durations.mjs} +0 -0
  88. package/{esm2015/lib/utils/enums.js → esm2020/lib/utils/enums.mjs} +0 -0
  89. package/{esm2015/lib/utils/http.js → esm2020/lib/utils/http.mjs} +0 -0
  90. package/{esm2015/lib/utils/index.js → esm2020/lib/utils/index.mjs} +0 -0
  91. package/{esm2015/lib/utils/objects.js → esm2020/lib/utils/objects.mjs} +0 -0
  92. package/esm2020/lib/utils/odata.mjs +22 -0
  93. package/{esm2015/lib/utils/strings.js → esm2020/lib/utils/strings.mjs} +0 -0
  94. package/{esm2015/lib/utils/types.js → esm2020/lib/utils/types.mjs} +0 -0
  95. package/{esm2015/lib/utils/urls.js → esm2020/lib/utils/urls.mjs} +0 -0
  96. package/{esm2015/public-api.js → esm2020/public-api.mjs} +0 -0
  97. package/fesm2015/{angular-odata.js → angular-odata.mjs} +849 -750
  98. package/fesm2015/angular-odata.mjs.map +1 -0
  99. package/fesm2020/angular-odata.mjs +10274 -0
  100. package/fesm2020/angular-odata.mjs.map +1 -0
  101. package/lib/api.d.ts +10 -10
  102. package/lib/cache/cache.d.ts +2 -2
  103. package/lib/cache/storage.d.ts +1 -1
  104. package/lib/client.d.ts +3 -3
  105. package/lib/constants.d.ts +1 -0
  106. package/lib/models/collection.d.ts +11 -19
  107. package/lib/models/model.d.ts +22 -18
  108. package/lib/models/options.d.ts +16 -21
  109. package/lib/module.d.ts +1 -1
  110. package/lib/options.d.ts +1 -0
  111. package/lib/resources/path/segments.d.ts +1 -1
  112. package/lib/resources/query/expressions.d.ts +37 -27
  113. package/lib/resources/query/handlers.d.ts +7 -11
  114. package/lib/resources/query/options.d.ts +2 -2
  115. package/lib/resources/query/syntax.d.ts +52 -54
  116. package/lib/resources/request.d.ts +1 -1
  117. package/lib/resources/resource.d.ts +25 -8
  118. package/lib/resources/types/action.d.ts +12 -19
  119. package/lib/resources/types/batch.d.ts +1 -3
  120. package/lib/resources/types/count.d.ts +5 -4
  121. package/lib/resources/types/entity-set.d.ts +11 -15
  122. package/lib/resources/types/entity.d.ts +12 -15
  123. package/lib/resources/types/function.d.ts +11 -18
  124. package/lib/resources/types/media.d.ts +6 -5
  125. package/lib/resources/types/metadata.d.ts +3 -5
  126. package/lib/resources/types/navigation-property.d.ts +15 -21
  127. package/lib/resources/types/property.d.ts +13 -19
  128. package/lib/resources/types/reference.d.ts +39 -6
  129. package/lib/resources/types/singleton.d.ts +12 -16
  130. package/lib/resources/types/value.d.ts +9 -5
  131. package/lib/schema/{base.d.ts → annotation.d.ts} +0 -0
  132. package/lib/schema/callable.d.ts +2 -18
  133. package/lib/schema/element.d.ts +39 -0
  134. package/lib/schema/entity-container.d.ts +2 -12
  135. package/lib/schema/entity-set.d.ts +2 -18
  136. package/lib/schema/enum-type.d.ts +2 -26
  137. package/lib/schema/parsers/enum-type.d.ts +4 -4
  138. package/lib/schema/parsers/structured-type.d.ts +4 -4
  139. package/lib/schema/schema.d.ts +2 -2
  140. package/lib/schema/structured-type.d.ts +8 -26
  141. package/lib/services/base.d.ts +2 -2
  142. package/lib/services/entity-set.d.ts +2 -2
  143. package/lib/services/entity.d.ts +1 -1
  144. package/lib/services/singleton.d.ts +2 -2
  145. package/lib/settings.d.ts +5 -5
  146. package/lib/types.d.ts +1 -0
  147. package/package.json +21 -8
  148. package/bundles/angular-odata.umd.js +0 -11861
  149. package/bundles/angular-odata.umd.js.map +0 -1
  150. package/esm2015/lib/api.js +0 -296
  151. package/esm2015/lib/client.js +0 -272
  152. package/esm2015/lib/helper.js +0 -268
  153. package/esm2015/lib/models/collection.js +0 -734
  154. package/esm2015/lib/models/model.js +0 -438
  155. package/esm2015/lib/models/options.js +0 -942
  156. package/esm2015/lib/options.js +0 -31
  157. package/esm2015/lib/resources/path/segments.js +0 -124
  158. package/esm2015/lib/resources/query/builder.js +0 -591
  159. package/esm2015/lib/resources/query/expressions.js +0 -194
  160. package/esm2015/lib/resources/query/handlers.js +0 -192
  161. package/esm2015/lib/resources/query/options.js +0 -103
  162. package/esm2015/lib/resources/query/syntax.js +0 -367
  163. package/esm2015/lib/resources/request.js +0 -168
  164. package/esm2015/lib/resources/resource.js +0 -243
  165. package/esm2015/lib/resources/responses/annotations.js +0 -121
  166. package/esm2015/lib/resources/responses/metadata.js +0 -548
  167. package/esm2015/lib/resources/types/action.js +0 -105
  168. package/esm2015/lib/resources/types/batch.js +0 -294
  169. package/esm2015/lib/resources/types/count.js +0 -33
  170. package/esm2015/lib/resources/types/entity-set.js +0 -101
  171. package/esm2015/lib/resources/types/entity.js +0 -137
  172. package/esm2015/lib/resources/types/function.js +0 -130
  173. package/esm2015/lib/resources/types/media.js +0 -47
  174. package/esm2015/lib/resources/types/metadata.js +0 -36
  175. package/esm2015/lib/resources/types/navigation-property.js +0 -205
  176. package/esm2015/lib/resources/types/options.js +0 -2
  177. package/esm2015/lib/resources/types/property.js +0 -151
  178. package/esm2015/lib/resources/types/reference.js +0 -74
  179. package/esm2015/lib/resources/types/singleton.js +0 -167
  180. package/esm2015/lib/resources/types/value.js +0 -35
  181. package/esm2015/lib/schema/base.js +0 -37
  182. package/esm2015/lib/schema/callable.js +0 -82
  183. package/esm2015/lib/schema/entity-container.js +0 -24
  184. package/esm2015/lib/schema/entity-set.js +0 -35
  185. package/esm2015/lib/schema/enum-type.js +0 -102
  186. package/esm2015/lib/schema/parsers/callable.js +0 -107
  187. package/esm2015/lib/schema/parsers/enum-type.js +0 -107
  188. package/esm2015/lib/schema/parsers/structured-type.js +0 -392
  189. package/esm2015/lib/schema/schema.js +0 -52
  190. package/esm2015/lib/schema/structured-type.js +0 -220
  191. package/esm2015/lib/services/base.js +0 -23
  192. package/esm2015/lib/services/entity-set.js +0 -146
  193. package/esm2015/lib/services/entity.js +0 -12
  194. package/esm2015/lib/types.js +0 -37
  195. package/esm2015/lib/utils/odata.js +0 -21
  196. package/fesm2015/angular-odata.js.map +0 -1
@@ -1,14 +1,20 @@
1
1
  import type { QueryCustomType } from './builder';
2
2
  export interface Renderable {
3
- render({ aliases, escape, }: {
3
+ render({ aliases, escape, prefix, }: {
4
4
  aliases?: QueryCustomType[];
5
5
  escape?: boolean;
6
+ prefix?: string;
6
7
  }): string;
7
8
  toString(): string;
8
9
  toJSON(): any;
9
10
  }
10
- export declare type Funcs<T> = (x: ODataSyntax<T>) => Function<T> | Operator<T> | Grouping<T> | Navigation<T, any>;
11
- export declare type Field<T> = keyof T | Funcs<keyof T>;
11
+ export declare type Funcs<T> = (x: ODataSyntax<T>) => Function<T> | Operator<T> | Grouping<T>;
12
+ export declare class Field<T extends object> implements ProxyHandler<T> {
13
+ name: string;
14
+ constructor(name?: string);
15
+ static factory<T extends object>(): T;
16
+ get(target: T, p: string | symbol): any;
17
+ }
12
18
  export declare class Function<T> implements Renderable {
13
19
  protected name: string;
14
20
  protected values: any[];
@@ -21,19 +27,20 @@ export declare class Function<T> implements Renderable {
21
27
  values: any[];
22
28
  normalize: boolean;
23
29
  };
24
- render({ aliases, escape, }: {
30
+ render({ aliases, escape, prefix, }: {
25
31
  aliases?: QueryCustomType[];
26
32
  escape?: boolean;
33
+ prefix?: string;
27
34
  }): string;
28
35
  }
29
36
  export declare class StringAndCollectionFunctions<T> {
30
- concat(field: T, value: any, normalize?: boolean): Function<T>;
31
- contains(field: T, value: any, normalize?: boolean): Function<T>;
32
- endsWith(field: T, value: any, normalize?: boolean): Function<T>;
33
- indexOf(field: T, value: any, normalize?: boolean): Function<T>;
34
- length(value: T, normalize?: boolean): Function<T>;
35
- startsWith(field: T, value: any, normalize?: boolean): Function<T>;
36
- subString(field: T, start: number, length?: number): Function<T>;
37
+ concat(field: any, value: any, normalize?: boolean): Function<T>;
38
+ contains(field: any, value: any, normalize?: boolean): Function<T>;
39
+ endsWith(field: any, value: any, normalize?: boolean): Function<T>;
40
+ indexOf(field: any, value: any, normalize?: boolean): Function<T>;
41
+ length(value: any, normalize?: boolean): Function<T>;
42
+ startsWith(field: any, value: any, normalize?: boolean): Function<T>;
43
+ subString(field: any, start: number, length?: number): Function<T>;
37
44
  }
38
45
  export declare class CollectionFunctions<T> {
39
46
  hasSubset(s1: T, s2: any): Function<T>;
@@ -46,20 +53,20 @@ export declare class StringFunctions<T> {
46
53
  trim(value: T): Function<T>;
47
54
  }
48
55
  export declare class DateAndTimeFunctions<T> {
49
- date(value: T): Function<T>;
50
- day(value: T): Function<T>;
51
- fractionalseconds(value: T): Function<T>;
52
- hour(value: T): Function<T>;
53
- maxdatetime(value: T): Function<T>;
54
- mindatetime(value: T): Function<T>;
55
- minute(value: T): Function<T>;
56
- month(value: T): Function<T>;
56
+ date(value: any): Function<T>;
57
+ day(value: any): Function<T>;
58
+ fractionalseconds(value: any): Function<T>;
59
+ hour(value: any): Function<T>;
60
+ maxdatetime(value: any): Function<T>;
61
+ mindatetime(value: any): Function<T>;
62
+ minute(value: any): Function<T>;
63
+ month(value: any): Function<T>;
57
64
  now(): Function<T>;
58
- second(value: T): Function<T>;
59
- time(value: T): Function<T>;
60
- totaloffsetminutes(value: T): Function<T>;
61
- totalseconds(value: T): Function<T>;
62
- year(value: T): Function<T>;
65
+ second(value: any): Function<T>;
66
+ time(value: any): Function<T>;
67
+ totaloffsetminutes(value: any): Function<T>;
68
+ totalseconds(value: any): Function<T>;
69
+ year(value: any): Function<T>;
63
70
  }
64
71
  export declare class ArithmeticFunctions<T> {
65
72
  ceiling(value: T | string): Function<T>;
@@ -89,9 +96,10 @@ export declare class Operator<T> implements Renderable {
89
96
  values: any[];
90
97
  normalize: boolean;
91
98
  };
92
- render({ aliases, escape, }: {
99
+ render({ aliases, escape, prefix, }: {
93
100
  aliases?: QueryCustomType[];
94
- escape: boolean;
101
+ escape?: boolean;
102
+ prefix?: string;
95
103
  }): string;
96
104
  }
97
105
  export declare class LogicalOperators<T> {
@@ -101,8 +109,6 @@ export declare class LogicalOperators<T> {
101
109
  ge(left: any, right: any, normalize?: boolean): Operator<unknown>;
102
110
  lt(left: any, right: any, normalize?: boolean): Operator<unknown>;
103
111
  le(left: any, right: any, normalize?: boolean): Operator<unknown>;
104
- and(left: any, right: any, normalize?: boolean): Operator<unknown>;
105
- or(left: any, right: any, normalize?: boolean): Operator<unknown>;
106
112
  not(value: any, normalize?: boolean): Operator<T>;
107
113
  has(left: any, right: any, normalize?: boolean): Operator<unknown>;
108
114
  in(left: any, right: any, normalize?: boolean): Operator<unknown>;
@@ -122,47 +128,39 @@ export declare class Grouping<T> implements Renderable {
122
128
  toJSON(): {
123
129
  group: any;
124
130
  };
125
- render({ aliases, escape, }: {
126
- aliases?: QueryCustomType[];
127
- escape: boolean;
128
- }): string;
129
- }
130
- export declare class Navigation<T, N> implements Renderable {
131
- protected field: T;
132
- protected value: Field<N>;
133
- constructor(field: T, value: Field<N>);
134
- get [Symbol.toStringTag](): string;
135
- toJSON(): {
136
- field: T;
137
- value: Field<N>;
138
- };
139
- render({ aliases, escape, }: {
131
+ render({ aliases, escape, prefix, }: {
140
132
  aliases?: QueryCustomType[];
141
- escape: boolean;
133
+ escape?: boolean;
134
+ prefix?: string;
142
135
  }): string;
143
136
  }
144
- export declare class GroupingAndNavigationOperators<T> {
137
+ export declare class GroupingOperators<T> {
145
138
  grouping(value: any): Grouping<unknown>;
146
- navigation<N>(field: T, value: Field<N>): Navigation<T, N>;
147
139
  }
148
- export declare class Lambda<T> extends Operator<T> {
140
+ export declare class Lambda<T> implements Renderable {
149
141
  protected op: string;
150
142
  protected values: any[];
151
- protected normalize: boolean;
152
- constructor(op: string, values: any[], normalize?: boolean);
143
+ protected alias?: string | undefined;
144
+ constructor(op: string, values: any[], alias?: string | undefined);
153
145
  get [Symbol.toStringTag](): string;
154
- render({ aliases, escape, }: {
146
+ toJSON(): {
147
+ op: string;
148
+ values: any[];
149
+ alias: string | undefined;
150
+ };
151
+ render({ aliases, escape, prefix, }: {
155
152
  aliases?: QueryCustomType[];
156
- escape: boolean;
153
+ escape?: boolean;
154
+ prefix?: string;
157
155
  }): string;
158
156
  }
159
157
  export declare class LambdaOperators<T> {
160
- any(field: T, value: any): Lambda<unknown>;
161
- all(field: T, value: any): Lambda<unknown>;
158
+ any(field: T, value: any, alias?: string): Lambda<unknown>;
159
+ all(field: T, value: any, alias?: string): Lambda<unknown>;
162
160
  }
163
161
  export declare class ODataOperators<T> {
164
162
  }
165
- export interface ODataOperators<T> extends LogicalOperators<T>, ArithmeticOperators<T>, GroupingAndNavigationOperators<T>, LambdaOperators<T> {
163
+ export interface ODataOperators<T> extends LogicalOperators<T>, ArithmeticOperators<T>, GroupingOperators<T>, LambdaOperators<T> {
166
164
  }
167
165
  export declare const operators: ODataOperators<any>;
168
166
  export declare class ODataFunctions<T> {
@@ -1,7 +1,7 @@
1
1
  import { HttpHeaders, HttpParams } from '@angular/common/http';
2
2
  import { ODataApi } from '../api';
3
- import { ODataResource } from './resource';
4
3
  import { QueryOptionNames } from '../types';
4
+ import { ODataResource } from './resource';
5
5
  export declare class ODataRequest<T> {
6
6
  readonly api: ODataApi;
7
7
  readonly observe: 'events' | 'response';
@@ -1,18 +1,26 @@
1
1
  import { Observable } from 'rxjs';
2
2
  import { ODataApi } from '../api';
3
- import { ODataCallable, ODataStructuredType } from '../schema';
3
+ import { ODataCollection, ODataModel } from '../models';
4
+ import { ODataStructuredType } from '../schema';
5
+ import { ODataSchemaElement } from '../schema/element';
4
6
  import { OptionsHelper, QueryOptionNames } from '../types';
5
7
  import { ODataPathSegments, ODataPathSegmentsHandler } from './path';
6
8
  import { ODataQueryOptions, ODataQueryOptionsHandler, QueryCustomType } from './query';
9
+ import { ODataEntitiesAnnotations, ODataEntityAnnotations } from './responses/index';
7
10
  import { ODataOptions } from './types';
8
11
  export declare type EntityKey<T> = {
9
12
  readonly [P in keyof T]?: T[P];
10
13
  } | QueryCustomType | string | number;
11
- export declare abstract class ODataResource<T> {
14
+ export declare class ODataResource<T> {
12
15
  api: ODataApi;
16
+ schema?: ODataSchemaElement;
13
17
  protected pathSegments: ODataPathSegments;
14
18
  protected queryOptions: ODataQueryOptions<T>;
15
- constructor(api: ODataApi, segments?: ODataPathSegments, query?: ODataQueryOptions<T>);
19
+ constructor(api: ODataApi, { segments, query, schema, }?: {
20
+ segments?: ODataPathSegments;
21
+ query?: ODataQueryOptions<T>;
22
+ schema?: ODataSchemaElement;
23
+ });
16
24
  /**
17
25
  * @returns string The type of the resource
18
26
  */
@@ -30,17 +38,26 @@ export declare abstract class ODataResource<T> {
30
38
  */
31
39
  hasKey(): boolean;
32
40
  clearKey(): void | undefined;
41
+ asModel<M extends ODataModel<T>>(entity?: Partial<T> | {
42
+ [name: string]: any;
43
+ }, { annots, reset }?: {
44
+ annots?: ODataEntityAnnotations;
45
+ reset?: boolean;
46
+ }): M;
47
+ asCollection<M extends ODataModel<T>, C extends ODataCollection<T, M>>(entities?: Partial<T>[] | {
48
+ [name: string]: any;
49
+ }[], { annots, reset, }?: {
50
+ annots?: ODataEntitiesAnnotations;
51
+ reset?: boolean;
52
+ }): C;
33
53
  isSubtypeOf(other: ODataResource<any>): boolean;
34
- isParentOf(other: ODataResource<any>): boolean;
35
- isChildOf(other: ODataResource<any>): boolean;
36
54
  isEqualTo(other: ODataResource<any>, test?: 'path' | 'params'): boolean;
37
55
  pathAndParams(escape?: boolean): [string, {
38
56
  [name: string]: any;
39
57
  }];
40
58
  endpointUrl(params?: boolean): string;
41
59
  toString(): string;
42
- abstract clone(): ODataResource<T>;
43
- abstract schema(): ODataStructuredType<T> | ODataCallable<T> | undefined;
60
+ clone<R extends ODataResource<T>>(): R;
44
61
  deserialize(value: any, options?: OptionsHelper): any;
45
62
  serialize(value: any, options?: OptionsHelper): any;
46
63
  encode(value: any, options?: OptionsHelper): any;
@@ -64,7 +81,7 @@ export declare abstract class ODataResource<T> {
64
81
  * @param f Function context for handle the query options
65
82
  */
66
83
  query(f: (q: ODataQueryOptionsHandler<T>) => void): this;
67
- static resolveKey<T>(value: any, schema?: ODataStructuredType<T> | ODataCallable<T>): EntityKey<T> | undefined;
84
+ static resolveKey<T>(value: any, schema?: ODataStructuredType<T>): EntityKey<T> | undefined;
68
85
  protected resolveKey(value: any): EntityKey<T> | undefined;
69
86
  protected request(method: string, options: ODataOptions & {
70
87
  body?: any;
@@ -1,28 +1,21 @@
1
- import { ODataCollection, ODataModel } from '../../models';
2
- import { ODataEntities, ODataEntitiesAnnotations, ODataEntity, ODataEntityAnnotations, ODataProperty } from '../responses';
3
- import { ODataEntitiesOptions, ODataEntityOptions, ODataNoneOptions, ODataOptions, ODataPropertyOptions } from './options';
1
+ import { Observable } from 'rxjs';
4
2
  import { ODataApi } from '../../api';
3
+ import { ODataCollection, ODataModel } from '../../models';
4
+ import { ODataCallable } from '../../schema/callable';
5
5
  import { ODataPathSegments } from '../path';
6
6
  import { ODataQueryOptions } from '../query';
7
7
  import { ODataResource } from '../resource';
8
- import { Observable } from 'rxjs';
8
+ import { ODataEntities, ODataEntity, ODataProperty } from '../responses';
9
+ import { ODataEntitiesOptions, ODataEntityOptions, ODataNoneOptions, ODataOptions, ODataPropertyOptions } from './options';
9
10
  export declare class ODataActionResource<P, R> extends ODataResource<R> {
10
- static factory<P, R>(api: ODataApi, path: string, type: string | undefined, segments: ODataPathSegments, query: ODataQueryOptions<R>): ODataActionResource<P, R>;
11
- clone(): ODataActionResource<P, R>;
12
- schema(): import("angular-odata").ODataCallable<R> | undefined;
11
+ static factory<P, R>(api: ODataApi, { path, schema, segments, query, }: {
12
+ path?: string;
13
+ schema?: ODataCallable<R>;
14
+ segments?: ODataPathSegments;
15
+ query?: ODataQueryOptions<R>;
16
+ }): ODataActionResource<P, R>;
17
+ static fromResource<P, R>(resource: ODataResource<any>, path: string): ODataActionResource<P, R>;
13
18
  returnType(): string | undefined;
14
- asModel<M extends ODataModel<R>>(entity: Partial<R> | {
15
- [name: string]: any;
16
- }, { annots, reset }?: {
17
- annots?: ODataEntityAnnotations;
18
- reset?: boolean;
19
- }): M;
20
- asCollection<M extends ODataModel<R>, C extends ODataCollection<R, M>>(entities: Partial<R>[] | {
21
- [name: string]: any;
22
- }[], { annots, reset, }?: {
23
- annots?: ODataEntitiesAnnotations;
24
- reset?: boolean;
25
- }): C;
26
19
  protected post(params: P | null, options?: ODataEntityOptions & ODataEntitiesOptions & ODataPropertyOptions): Observable<any>;
27
20
  /**
28
21
  * Execute the action
@@ -1,9 +1,9 @@
1
1
  import { Observable, Subject } from 'rxjs';
2
2
  import { ODataApi } from '../../api';
3
- import { ODataOptions } from './options';
4
3
  import { ODataRequest } from '../request';
5
4
  import { ODataResource } from '../resource';
6
5
  import { ODataResponse } from '../responses';
6
+ import { ODataOptions } from './options';
7
7
  export declare class ODataBatchRequest<T> extends Subject<ODataResponse<T>> {
8
8
  request: ODataRequest<any>;
9
9
  constructor(request: ODataRequest<any>);
@@ -25,8 +25,6 @@ export declare class ODataBatchResource extends ODataResource<any> {
25
25
  private _requests;
26
26
  requests(): ODataRequest<any>[];
27
27
  static factory(api: ODataApi): ODataBatchResource;
28
- clone(): ODataBatchResource;
29
- schema(): undefined;
30
28
  /**
31
29
  * Execute the batch request
32
30
  * @param ctx The context for the request
@@ -1,13 +1,14 @@
1
1
  import { Observable } from 'rxjs';
2
2
  import { ODataApi } from '../../api';
3
- import { ODataOptions } from './options';
4
3
  import { ODataPathSegments } from '../path';
5
4
  import { ODataQueryOptions } from '../query';
6
5
  import { ODataResource } from '../resource';
6
+ import { ODataOptions } from './options';
7
7
  export declare class ODataCountResource<T> extends ODataResource<T> {
8
- static factory<T>(api: ODataApi, segments: ODataPathSegments, query: ODataQueryOptions<T>): ODataCountResource<T>;
9
- clone(): ODataCountResource<T>;
10
- schema(): undefined;
8
+ static factory<T>(api: ODataApi, { segments, query, }: {
9
+ segments: ODataPathSegments;
10
+ query?: ODataQueryOptions<T>;
11
+ }): ODataCountResource<T>;
11
12
  protected get(options?: ODataOptions): Observable<number>;
12
13
  /**
13
14
  * Fetch the count of the set.
@@ -1,31 +1,27 @@
1
1
  import { Observable } from 'rxjs';
2
- import { ODataResource } from '../resource';
2
+ import { ODataApi } from '../../api';
3
3
  import { ODataCollection, ODataModel } from '../../models';
4
- import { ODataEntities, ODataEntitiesAnnotations, ODataEntity } from '../responses';
4
+ import { ODataStructuredType } from '../../schema/structured-type';
5
5
  import { QueryOptionNames } from '../../types';
6
+ import { ODataQueryOptions } from '../query';
7
+ import { ODataResource } from '../resource';
8
+ import { ODataEntities, ODataEntity } from '../responses';
6
9
  import { ODataActionResource } from './action';
7
- import { ODataApi } from '../../api';
8
10
  import { ODataCountResource } from './count';
9
11
  import { ODataEntityResource } from './entity';
10
12
  import { ODataFunctionResource } from './function';
11
13
  import { ODataOptions } from './options';
12
- import { ODataPathSegments } from '../path';
13
- import { ODataQueryOptions } from '../query';
14
14
  export declare class ODataEntitySetResource<T> extends ODataResource<T> {
15
- static factory<E>(api: ODataApi, path: string, type: string | undefined, segments: ODataPathSegments, query: ODataQueryOptions<E>): ODataEntitySetResource<E>;
16
- clone(): ODataEntitySetResource<T>;
17
- schema(): import("angular-odata").ODataStructuredType<T> | undefined;
18
- asCollection<M extends ODataModel<T>, C extends ODataCollection<T, M>>(entities: Partial<T>[] | {
19
- [name: string]: any;
20
- }[], { annots, reset, }?: {
21
- annots?: ODataEntitiesAnnotations;
22
- reset?: boolean;
23
- }): C;
15
+ static factory<E>(api: ODataApi, { path, schema, query, }: {
16
+ path: string;
17
+ schema?: ODataStructuredType<E>;
18
+ query?: ODataQueryOptions<E>;
19
+ }): ODataEntitySetResource<E>;
24
20
  entity(key?: any): ODataEntityResource<T>;
25
- cast<C>(type: string): ODataEntitySetResource<C>;
26
21
  action<P, R>(path: string): ODataActionResource<P, R>;
27
22
  function<P, R>(path: string): ODataFunctionResource<P, R>;
28
23
  count(): ODataCountResource<T>;
24
+ cast<C>(type: string): ODataEntitySetResource<C>;
29
25
  protected post(attrs: Partial<T>, options?: ODataOptions): Observable<ODataEntity<T>>;
30
26
  protected get(options?: ODataOptions & {
31
27
  withCount?: boolean;
@@ -1,27 +1,24 @@
1
- import { ODataResource } from '../resource';
2
- import { ODataEntity, ODataEntityAnnotations } from '../responses';
3
1
  import { Observable } from 'rxjs';
2
+ import { ODataApi } from '../../api';
3
+ import { ODataModel } from '../../models';
4
+ import { ODataStructuredType } from '../../schema/structured-type';
4
5
  import { QueryOptionNames } from '../../types';
6
+ import { ODataPathSegments } from '../path';
7
+ import { ODataQueryOptions } from '../query';
8
+ import { ODataResource } from '../resource';
9
+ import { ODataEntity } from '../responses/types';
5
10
  import { ODataActionResource } from './action';
6
- import { ODataApi } from '../../api';
7
11
  import { ODataFunctionResource } from './function';
8
12
  import { ODataMediaResource } from './media';
9
- import { ODataModel } from '../../models';
10
13
  import { ODataNavigationPropertyResource } from './navigation-property';
11
14
  import { ODataOptions } from './options';
12
- import { ODataPathSegments } from '../path';
13
15
  import { ODataPropertyResource } from './property';
14
- import { ODataQueryOptions } from '../query';
15
16
  export declare class ODataEntityResource<T> extends ODataResource<T> {
16
- static factory<E>(api: ODataApi, segments: ODataPathSegments, options: ODataQueryOptions<E>): ODataEntityResource<E>;
17
- clone(): ODataEntityResource<T>;
18
- schema(): import("../../schema").ODataStructuredType<T> | undefined;
19
- asModel<M extends ODataModel<T>>(entity: Partial<T> | {
20
- [name: string]: any;
21
- }, { annots, reset }?: {
22
- annots?: ODataEntityAnnotations;
23
- reset?: boolean;
24
- }): M;
17
+ static factory<E>(api: ODataApi, { schema, segments, query, }: {
18
+ schema?: ODataStructuredType<E>;
19
+ segments: ODataPathSegments;
20
+ query?: ODataQueryOptions<E>;
21
+ }): ODataEntityResource<E>;
25
22
  key(value: any): ODataEntityResource<T>;
26
23
  keys(values: any[]): ODataEntityResource<T>;
27
24
  media(): ODataMediaResource;
@@ -1,29 +1,22 @@
1
- import { ODataEntities, ODataEntitiesAnnotations, ODataEntity, ODataEntityAnnotations, ODataProperty } from '../responses';
2
- import { ODataEntitiesOptions, ODataEntityOptions, ODataNoneOptions, ODataOptions, ODataPropertyOptions } from './options';
1
+ import { Observable } from 'rxjs';
3
2
  import { ODataApi } from '../../api';
4
3
  import { ODataCollection } from '../../models/collection';
5
4
  import { ODataModel } from '../../models/model';
5
+ import { ODataCallable } from '../../schema/callable';
6
6
  import { ODataPathSegments } from '../path';
7
7
  import { ODataQueryOptions } from '../query';
8
8
  import { ODataResource } from '../resource';
9
- import { Observable } from 'rxjs';
9
+ import { ODataEntities, ODataEntity, ODataProperty } from '../responses';
10
+ import { ODataEntitiesOptions, ODataEntityOptions, ODataNoneOptions, ODataOptions, ODataPropertyOptions } from './options';
10
11
  export declare class ODataFunctionResource<P, R> extends ODataResource<R> {
11
- static factory<P, R>(api: ODataApi, path: string, type: string | undefined, segments: ODataPathSegments, options: ODataQueryOptions<R>): ODataFunctionResource<P, R>;
12
- clone(): ODataFunctionResource<P, R>;
12
+ static factory<P, R>(api: ODataApi, { path, schema, segments, query, }: {
13
+ path?: string;
14
+ schema?: ODataCallable<R>;
15
+ segments?: ODataPathSegments;
16
+ query?: ODataQueryOptions<R>;
17
+ }): ODataFunctionResource<P, R>;
18
+ static fromResource<P, R>(resource: ODataResource<any>, path: string): ODataFunctionResource<P, R>;
13
19
  returnType(): string | undefined;
14
- schema(): import("angular-odata").ODataCallable<R> | undefined;
15
- asModel<M extends ODataModel<R>>(entity: Partial<R> | {
16
- [name: string]: any;
17
- }, { annots, reset }?: {
18
- annots?: ODataEntityAnnotations;
19
- reset?: boolean;
20
- }): M;
21
- asCollection<M extends ODataModel<R>, C extends ODataCollection<R, M>>(entities: Partial<R>[] | {
22
- [name: string]: any;
23
- }[], { annots, reset, }?: {
24
- annots?: ODataEntitiesAnnotations;
25
- reset?: boolean;
26
- }): C;
27
20
  parameters(params: P | null, { alias }?: {
28
21
  alias?: boolean;
29
22
  }): ODataFunctionResource<P, R>;
@@ -1,13 +1,14 @@
1
+ import { Observable } from 'rxjs';
1
2
  import { ODataApi } from '../../api';
2
- import { ODataOptions } from './options';
3
3
  import { ODataPathSegments } from '../path';
4
4
  import { ODataQueryOptions } from '../query';
5
5
  import { ODataResource } from '../resource';
6
- import { Observable } from 'rxjs';
6
+ import { ODataOptions } from './options';
7
7
  export declare class ODataMediaResource extends ODataResource<any> {
8
- static factory<V>(api: ODataApi, segments: ODataPathSegments, options: ODataQueryOptions<V>): ODataMediaResource;
9
- clone(): ODataMediaResource;
10
- schema(): undefined;
8
+ static factory<V>(api: ODataApi, { segments, query, }: {
9
+ segments: ODataPathSegments;
10
+ query?: ODataQueryOptions<V>;
11
+ }): ODataMediaResource;
11
12
  protected get(options: {
12
13
  responseType: any;
13
14
  } & ODataOptions): Observable<any>;
@@ -1,14 +1,12 @@
1
+ import { Observable } from 'rxjs';
1
2
  import { ODataApi } from '../../api';
2
- import { ODataMetadata } from '../responses';
3
- import { ODataOptions } from './options';
4
3
  import { ODataPathSegments } from '../path';
5
4
  import { ODataResource } from '../resource';
6
- import { Observable } from 'rxjs';
5
+ import { ODataMetadata } from '../responses';
6
+ import { ODataOptions } from './options';
7
7
  export declare class ODataMetadataResource extends ODataResource<any> {
8
8
  constructor(api: ODataApi, segments?: ODataPathSegments);
9
9
  static factory(api: ODataApi): ODataMetadataResource;
10
- clone(): ODataMetadataResource;
11
- schema(): undefined;
12
10
  protected get(options?: ODataOptions): Observable<ODataMetadata>;
13
11
  fetch(options?: ODataOptions): Observable<ODataMetadata>;
14
12
  }
@@ -1,15 +1,16 @@
1
1
  import { Observable } from 'rxjs';
2
- import { ODataResource } from '../resource';
2
+ import { ODataApi } from '../../api';
3
3
  import { ODataCollection, ODataModel } from '../../models';
4
- import { ODataEntities, ODataEntitiesAnnotations, ODataEntity, ODataEntityAnnotations } from '../responses';
5
- import { ODataEntitiesOptions, ODataEntityOptions, ODataOptions } from './options';
4
+ import { ODataStructuredType } from '../../schema';
6
5
  import { QueryOptionNames } from '../../types';
7
- import { ODataApi } from '../../api';
6
+ import { ODataPathSegments } from '../path';
7
+ import { ODataQueryOptions } from '../query';
8
+ import { ODataResource } from '../resource';
9
+ import { ODataEntities, ODataEntity } from '../responses';
8
10
  import { ODataCountResource } from './count';
9
11
  import { ODataMediaResource } from './media';
10
- import { ODataPathSegments } from '../path';
12
+ import { ODataEntitiesOptions, ODataEntityOptions, ODataOptions } from './options';
11
13
  import { ODataPropertyResource } from './property';
12
- import { ODataQueryOptions } from '../query';
13
14
  import { ODataReferenceResource } from './reference';
14
15
  /**
15
16
  * OData Navigation Property Resource
@@ -17,21 +18,14 @@ import { ODataReferenceResource } from './reference';
17
18
  * https://www.odata.org/getting-started/advanced-tutorial/#derived
18
19
  */
19
20
  export declare class ODataNavigationPropertyResource<T> extends ODataResource<T> {
20
- static factory<E>(api: ODataApi, path: string, type: string | undefined, segments: ODataPathSegments, options: ODataQueryOptions<E>): ODataNavigationPropertyResource<E>;
21
- clone(): ODataNavigationPropertyResource<T>;
22
- schema(): import("../../schema").ODataStructuredType<T> | undefined;
23
- asModel<M extends ODataModel<T>>(entity: Partial<T> | {
24
- [name: string]: any;
25
- }, { annots, reset }?: {
26
- annots?: ODataEntityAnnotations;
27
- reset?: boolean;
28
- }): M;
29
- asCollection<M extends ODataModel<T>, C extends ODataCollection<T, M>>(entities: Partial<T>[] | {
30
- [name: string]: any;
31
- }[], { annots, reset, }?: {
32
- annots?: ODataEntitiesAnnotations;
33
- reset?: boolean;
34
- }): C;
21
+ static factory<N>(api: ODataApi, { path, type, schema, segments, query, }: {
22
+ path: string;
23
+ type?: string;
24
+ schema?: ODataStructuredType<N>;
25
+ segments: ODataPathSegments;
26
+ query?: ODataQueryOptions<N>;
27
+ }): ODataNavigationPropertyResource<N>;
28
+ static fromResource<N>(resource: ODataResource<any>, path: string): ODataNavigationPropertyResource<N>;
35
29
  key(value: any): ODataNavigationPropertyResource<T>;
36
30
  keys(values: any[]): ODataNavigationPropertyResource<T>;
37
31
  media(): ODataMediaResource;
@@ -1,28 +1,22 @@
1
1
  import { Observable } from 'rxjs';
2
- import { ODataResource } from '../resource';
3
- import { ODataCollection, ODataModel } from '../../models';
4
- import { ODataEntities, ODataEntitiesAnnotations, ODataEntity, ODataEntityAnnotations, ODataProperty } from '../responses';
5
- import { ODataEntitiesOptions, ODataEntityOptions, ODataOptions, ODataPropertyOptions } from './options';
6
2
  import { ODataApi } from '../../api';
3
+ import { ODataCollection, ODataModel } from '../../models';
4
+ import { ODataStructuredType } from '../../schema';
7
5
  import { ODataPathSegments } from '../path';
8
6
  import { ODataQueryOptions } from '../query';
7
+ import { ODataResource } from '../resource';
8
+ import { ODataEntities, ODataEntity, ODataProperty } from '../responses';
9
+ import { ODataEntitiesOptions, ODataEntityOptions, ODataOptions, ODataPropertyOptions } from './options';
9
10
  import { ODataValueResource } from './value';
10
11
  export declare class ODataPropertyResource<T> extends ODataResource<T> {
11
- static factory<P>(api: ODataApi, path: string, type: string | undefined, segments: ODataPathSegments, options: ODataQueryOptions<P>): ODataPropertyResource<P>;
12
- clone(): ODataPropertyResource<T>;
13
- schema(): import("../../schema").ODataStructuredType<T> | undefined;
14
- asModel<M extends ODataModel<T>>(entity: Partial<T> | {
15
- [name: string]: any;
16
- }, { annots, reset }?: {
17
- annots?: ODataEntityAnnotations;
18
- reset?: boolean;
19
- }): M;
20
- asCollection<M extends ODataModel<T>, C extends ODataCollection<T, M>>(entities: Partial<T>[] | {
21
- [name: string]: any;
22
- }[], { annots, reset, }?: {
23
- annots?: ODataEntitiesAnnotations;
24
- reset?: boolean;
25
- }): C;
12
+ static factory<P>(api: ODataApi, { path, type, schema, segments, query, }: {
13
+ path: string;
14
+ type?: string;
15
+ schema?: ODataStructuredType<P>;
16
+ segments: ODataPathSegments;
17
+ query?: ODataQueryOptions<P>;
18
+ }): ODataPropertyResource<P>;
19
+ static fromResource<N>(resource: ODataResource<any>, path: string): ODataPropertyResource<N>;
26
20
  key(value: any): ODataPropertyResource<T>;
27
21
  keys(values: any[]): ODataPropertyResource<T>;
28
22
  value(): ODataValueResource<T>;