angular-odata 0.80.0 → 0.99.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 (237) hide show
  1. package/README.md +69 -34
  2. package/{esm2015/angular-odata.js → esm2020/angular-odata.mjs} +0 -0
  3. package/esm2020/lib/api.mjs +303 -0
  4. package/{esm2015/lib/cache/cache.js → esm2020/lib/cache/cache.mjs} +3 -3
  5. package/{esm2015/lib/cache/index.js → esm2020/lib/cache/index.mjs} +0 -0
  6. package/{esm2015/lib/cache/memory.js → esm2020/lib/cache/memory.mjs} +1 -1
  7. package/{esm2015/lib/cache/storage.js → esm2020/lib/cache/storage.mjs} +2 -2
  8. package/esm2020/lib/client.mjs +271 -0
  9. package/{esm2015/lib/constants.js → esm2020/lib/constants.mjs} +8 -3
  10. package/esm2020/lib/helper.mjs +268 -0
  11. package/esm2020/lib/index.mjs +19 -0
  12. package/esm2020/lib/models/collection.mjs +741 -0
  13. package/{esm2015/lib/models/index.js → esm2020/lib/models/index.mjs} +0 -0
  14. package/esm2020/lib/models/model.mjs +453 -0
  15. package/esm2020/lib/models/options.mjs +945 -0
  16. package/{esm2015/lib/module.js → esm2020/lib/module.mjs} +7 -7
  17. package/esm2020/lib/options.mjs +32 -0
  18. package/esm2020/lib/resources/index.mjs +7 -0
  19. package/esm2020/lib/resources/path/handlers.mjs +69 -0
  20. package/esm2020/lib/resources/path/index.mjs +3 -0
  21. package/esm2020/lib/resources/path/segments.mjs +124 -0
  22. package/esm2020/lib/resources/query/builder.mjs +590 -0
  23. package/esm2020/lib/resources/query/expressions/base.mjs +20 -0
  24. package/esm2020/lib/resources/query/expressions/compute.mjs +38 -0
  25. package/esm2020/lib/resources/query/expressions/expand.mjs +57 -0
  26. package/esm2020/lib/resources/query/expressions/filter.mjs +154 -0
  27. package/esm2020/lib/resources/query/expressions/index.mjs +7 -0
  28. package/esm2020/lib/resources/query/expressions/orderby.mjs +54 -0
  29. package/esm2020/lib/resources/query/expressions/search.mjs +113 -0
  30. package/esm2020/lib/resources/query/expressions/select.mjs +32 -0
  31. package/esm2020/lib/resources/query/expressions/syntax.mjs +371 -0
  32. package/esm2020/lib/resources/query/handlers.mjs +188 -0
  33. package/esm2020/lib/resources/query/index.mjs +4 -0
  34. package/esm2020/lib/resources/query/options.mjs +103 -0
  35. package/esm2020/lib/resources/request.mjs +167 -0
  36. package/esm2020/lib/resources/resource.mjs +326 -0
  37. package/esm2020/lib/resources/responses/annotations.mjs +119 -0
  38. package/{esm2015/lib/resources/responses/csdl/csdl-annotation.js → esm2020/lib/resources/responses/csdl/csdl-annotation.mjs} +0 -0
  39. package/{esm2015/lib/resources/responses/csdl/csdl-entity-container.js → esm2020/lib/resources/responses/csdl/csdl-entity-container.mjs} +0 -0
  40. package/{esm2015/lib/resources/responses/csdl/csdl-entity-set.js → esm2020/lib/resources/responses/csdl/csdl-entity-set.mjs} +0 -0
  41. package/{esm2015/lib/resources/responses/csdl/csdl-enum-type.js → esm2020/lib/resources/responses/csdl/csdl-enum-type.mjs} +0 -0
  42. package/{esm2015/lib/resources/responses/csdl/csdl-function-action.js → esm2020/lib/resources/responses/csdl/csdl-function-action.mjs} +0 -0
  43. package/{esm2015/lib/resources/responses/csdl/csdl-navigation-property-binding.js → esm2020/lib/resources/responses/csdl/csdl-navigation-property-binding.mjs} +0 -0
  44. package/{esm2015/lib/resources/responses/csdl/csdl-reference.js → esm2020/lib/resources/responses/csdl/csdl-reference.mjs} +0 -0
  45. package/{esm2015/lib/resources/responses/csdl/csdl-schema.js → esm2020/lib/resources/responses/csdl/csdl-schema.mjs} +0 -0
  46. package/{esm2015/lib/resources/responses/csdl/csdl-singleton.js → esm2020/lib/resources/responses/csdl/csdl-singleton.mjs} +0 -0
  47. package/{esm2015/lib/resources/responses/csdl/csdl-structural-property.js → esm2020/lib/resources/responses/csdl/csdl-structural-property.mjs} +0 -0
  48. package/{esm2015/lib/resources/responses/csdl/csdl-structured-type.js → esm2020/lib/resources/responses/csdl/csdl-structured-type.mjs} +0 -0
  49. package/{esm2015/lib/resources/responses/csdl/csdl-type-definition.js → esm2020/lib/resources/responses/csdl/csdl-type-definition.mjs} +0 -0
  50. package/{esm2015/lib/resources/responses/index.js → esm2020/lib/resources/responses/index.mjs} +0 -0
  51. package/esm2020/lib/resources/responses/metadata.mjs +547 -0
  52. package/{esm2015/lib/resources/responses/options.js → esm2020/lib/resources/responses/options.mjs} +0 -0
  53. package/{esm2015/lib/resources/responses/response.js → esm2020/lib/resources/responses/response.mjs} +0 -0
  54. package/{esm2015/lib/resources/responses/types.js → esm2020/lib/resources/responses/types.mjs} +0 -0
  55. package/esm2020/lib/resources/types/action.mjs +101 -0
  56. package/esm2020/lib/resources/types/batch.mjs +309 -0
  57. package/esm2020/lib/resources/types/count.mjs +27 -0
  58. package/esm2020/lib/resources/types/entity-set.mjs +94 -0
  59. package/esm2020/lib/resources/types/entity.mjs +106 -0
  60. package/esm2020/lib/resources/types/function.mjs +137 -0
  61. package/{esm2015/lib/resources/types/index.js → esm2020/lib/resources/types/index.mjs} +0 -0
  62. package/esm2020/lib/resources/types/media.mjs +41 -0
  63. package/esm2020/lib/resources/types/metadata.mjs +30 -0
  64. package/esm2020/lib/resources/types/navigation-property.mjs +226 -0
  65. package/esm2020/lib/resources/types/options.mjs +2 -0
  66. package/esm2020/lib/resources/types/property.mjs +183 -0
  67. package/esm2020/lib/resources/types/reference.mjs +85 -0
  68. package/esm2020/lib/resources/types/singleton.mjs +126 -0
  69. package/esm2020/lib/resources/types/value.mjs +41 -0
  70. package/esm2020/lib/schema/annotation.mjs +37 -0
  71. package/esm2020/lib/schema/callable.mjs +62 -0
  72. package/esm2020/lib/schema/element.mjs +51 -0
  73. package/esm2020/lib/schema/entity-container.mjs +9 -0
  74. package/esm2020/lib/schema/entity-set.mjs +9 -0
  75. package/esm2020/lib/schema/enum-type.mjs +71 -0
  76. package/{esm2015/lib/schema/index.js → esm2020/lib/schema/index.mjs} +2 -1
  77. package/esm2020/lib/schema/parsers/callable.mjs +113 -0
  78. package/esm2020/lib/schema/parsers/edm.mjs +95 -0
  79. package/esm2020/lib/schema/parsers/enum-type.mjs +107 -0
  80. package/esm2020/lib/schema/parsers/index.mjs +5 -0
  81. package/esm2020/lib/schema/parsers/structured-type.mjs +412 -0
  82. package/esm2020/lib/schema/schema.mjs +61 -0
  83. package/esm2020/lib/schema/structured-type.mjs +198 -0
  84. package/esm2020/lib/services/base.mjs +29 -0
  85. package/esm2020/lib/services/entity-set.mjs +143 -0
  86. package/esm2020/lib/services/entity.mjs +12 -0
  87. package/{esm2015/lib/services/factory.js → esm2020/lib/services/factory.mjs} +3 -3
  88. package/{esm2015/lib/services/index.js → esm2020/lib/services/index.mjs} +0 -0
  89. package/esm2020/lib/services/singleton.mjs +48 -0
  90. package/{esm2015/lib/settings.js → esm2020/lib/settings.mjs} +1 -1
  91. package/{esm2015/lib/tokens.js → esm2020/lib/tokens.mjs} +0 -0
  92. package/esm2020/lib/types.mjs +37 -0
  93. package/esm2020/lib/utils/arraybuffers.mjs +46 -0
  94. package/{esm2015/lib/utils/dates.js → esm2020/lib/utils/dates.mjs} +0 -0
  95. package/esm2020/lib/utils/durations.mjs +40 -0
  96. package/{esm2015/lib/utils/enums.js → esm2020/lib/utils/enums.mjs} +0 -0
  97. package/esm2020/lib/utils/http.mjs +93 -0
  98. package/esm2020/lib/utils/index.mjs +10 -0
  99. package/esm2020/lib/utils/objects.mjs +195 -0
  100. package/esm2020/lib/utils/odata.mjs +22 -0
  101. package/esm2020/lib/utils/strings.mjs +20 -0
  102. package/esm2020/lib/utils/types.mjs +134 -0
  103. package/{esm2015/lib/utils/urls.js → esm2020/lib/utils/urls.mjs} +0 -0
  104. package/{esm2015/public-api.js → esm2020/public-api.mjs} +0 -0
  105. package/fesm2015/{angular-odata.js → angular-odata.mjs} +4508 -3427
  106. package/fesm2015/angular-odata.mjs.map +1 -0
  107. package/fesm2020/angular-odata.mjs +10510 -0
  108. package/fesm2020/angular-odata.mjs.map +1 -0
  109. package/lib/api.d.ts +14 -14
  110. package/lib/cache/cache.d.ts +2 -2
  111. package/lib/cache/storage.d.ts +1 -1
  112. package/lib/client.d.ts +60 -9
  113. package/lib/constants.d.ts +5 -2
  114. package/lib/index.d.ts +0 -1
  115. package/lib/models/collection.d.ts +30 -42
  116. package/lib/models/model.d.ts +37 -30
  117. package/lib/models/options.d.ts +30 -38
  118. package/lib/module.d.ts +1 -1
  119. package/lib/options.d.ts +47 -0
  120. package/lib/resources/index.d.ts +2 -3
  121. package/lib/resources/path/handlers.d.ts +27 -0
  122. package/lib/resources/path/index.d.ts +2 -0
  123. package/lib/resources/{path-segments.d.ts → path/segments.d.ts} +4 -16
  124. package/lib/resources/{builder.d.ts → query/builder.d.ts} +12 -7
  125. package/lib/resources/query/expressions/base.d.ts +19 -0
  126. package/lib/resources/query/expressions/compute.d.ts +26 -0
  127. package/lib/resources/query/expressions/expand.d.ts +40 -0
  128. package/lib/resources/query/expressions/filter.d.ts +58 -0
  129. package/lib/resources/query/expressions/index.d.ts +6 -0
  130. package/lib/resources/query/expressions/orderby.d.ts +37 -0
  131. package/lib/resources/query/expressions/search.d.ts +47 -0
  132. package/lib/resources/query/expressions/select.d.ts +21 -0
  133. package/lib/resources/query/expressions/syntax.d.ts +177 -0
  134. package/lib/resources/query/handlers.d.ts +104 -0
  135. package/lib/resources/query/index.d.ts +3 -0
  136. package/lib/resources/query/options.d.ts +38 -0
  137. package/lib/resources/request.d.ts +4 -3
  138. package/lib/resources/resource.d.ts +42 -48
  139. package/lib/resources/types/action.d.ts +14 -61
  140. package/lib/resources/types/batch.d.ts +16 -3
  141. package/lib/resources/types/count.d.ts +9 -17
  142. package/lib/resources/types/entity-set.d.ts +12 -51
  143. package/lib/resources/types/entity.d.ts +13 -31
  144. package/lib/resources/types/function.d.ts +13 -60
  145. package/lib/resources/types/media.d.ts +9 -8
  146. package/lib/resources/types/metadata.d.ts +3 -5
  147. package/lib/resources/types/navigation-property.d.ts +74 -65
  148. package/lib/resources/types/options.d.ts +1 -1
  149. package/lib/resources/types/property.d.ts +49 -57
  150. package/lib/resources/types/reference.d.ts +65 -9
  151. package/lib/resources/types/singleton.d.ts +53 -31
  152. package/lib/resources/types/value.d.ts +16 -7
  153. package/lib/schema/annotation.d.ts +18 -0
  154. package/lib/schema/callable.d.ts +4 -20
  155. package/lib/schema/element.d.ts +39 -0
  156. package/lib/schema/entity-container.d.ts +2 -12
  157. package/lib/schema/entity-set.d.ts +2 -18
  158. package/lib/schema/enum-type.d.ts +19 -25
  159. package/lib/schema/index.d.ts +1 -0
  160. package/lib/{parsers → schema/parsers}/callable.d.ts +2 -2
  161. package/lib/schema/parsers/edm.d.ts +4 -0
  162. package/lib/{parsers → schema/parsers}/enum-type.d.ts +12 -11
  163. package/lib/{parsers → schema/parsers}/index.d.ts +0 -0
  164. package/lib/{parsers → schema/parsers}/structured-type.d.ts +12 -12
  165. package/lib/schema/schema.d.ts +3 -10
  166. package/lib/schema/structured-type.d.ts +65 -27
  167. package/lib/services/base.d.ts +2 -2
  168. package/lib/services/entity-set.d.ts +5 -2
  169. package/lib/services/entity.d.ts +4 -1
  170. package/lib/services/singleton.d.ts +5 -2
  171. package/lib/settings.d.ts +5 -5
  172. package/lib/types.d.ts +1 -0
  173. package/lib/utils/arraybuffers.d.ts +4 -0
  174. package/lib/{parsers/edm.d.ts → utils/durations.d.ts} +3 -3
  175. package/lib/utils/http.d.ts +1 -0
  176. package/lib/utils/index.d.ts +1 -0
  177. package/lib/utils/objects.d.ts +1 -0
  178. package/lib/utils/strings.d.ts +1 -0
  179. package/lib/utils/types.d.ts +2 -0
  180. package/package.json +21 -8
  181. package/bundles/angular-odata.umd.js +0 -11048
  182. package/bundles/angular-odata.umd.js.map +0 -1
  183. package/esm2015/lib/api.js +0 -297
  184. package/esm2015/lib/client.js +0 -221
  185. package/esm2015/lib/helper.js +0 -271
  186. package/esm2015/lib/index.js +0 -21
  187. package/esm2015/lib/models/collection.js +0 -687
  188. package/esm2015/lib/models/model.js +0 -423
  189. package/esm2015/lib/models/options.js +0 -909
  190. package/esm2015/lib/options.js +0 -31
  191. package/esm2015/lib/parsers/callable.js +0 -107
  192. package/esm2015/lib/parsers/edm.js +0 -192
  193. package/esm2015/lib/parsers/enum-type.js +0 -102
  194. package/esm2015/lib/parsers/index.js +0 -5
  195. package/esm2015/lib/parsers/structured-type.js +0 -389
  196. package/esm2015/lib/resources/builder.js +0 -537
  197. package/esm2015/lib/resources/index.js +0 -8
  198. package/esm2015/lib/resources/path-segments.js +0 -156
  199. package/esm2015/lib/resources/query-options.js +0 -157
  200. package/esm2015/lib/resources/request.js +0 -149
  201. package/esm2015/lib/resources/resource.js +0 -337
  202. package/esm2015/lib/resources/responses/annotations.js +0 -121
  203. package/esm2015/lib/resources/responses/metadata.js +0 -548
  204. package/esm2015/lib/resources/types/action.js +0 -180
  205. package/esm2015/lib/resources/types/batch.js +0 -288
  206. package/esm2015/lib/resources/types/count.js +0 -55
  207. package/esm2015/lib/resources/types/entity-set.js +0 -169
  208. package/esm2015/lib/resources/types/entity.js +0 -170
  209. package/esm2015/lib/resources/types/function.js +0 -205
  210. package/esm2015/lib/resources/types/media.js +0 -47
  211. package/esm2015/lib/resources/types/metadata.js +0 -36
  212. package/esm2015/lib/resources/types/navigation-property.js +0 -232
  213. package/esm2015/lib/resources/types/options.js +0 -2
  214. package/esm2015/lib/resources/types/property.js +0 -195
  215. package/esm2015/lib/resources/types/reference.js +0 -50
  216. package/esm2015/lib/resources/types/singleton.js +0 -159
  217. package/esm2015/lib/resources/types/value.js +0 -30
  218. package/esm2015/lib/schema/annotation.js +0 -7
  219. package/esm2015/lib/schema/callable.js +0 -82
  220. package/esm2015/lib/schema/entity-container.js +0 -22
  221. package/esm2015/lib/schema/entity-set.js +0 -33
  222. package/esm2015/lib/schema/enum-type.js +0 -101
  223. package/esm2015/lib/schema/schema.js +0 -60
  224. package/esm2015/lib/schema/structured-type.js +0 -148
  225. package/esm2015/lib/services/base.js +0 -23
  226. package/esm2015/lib/services/entity-set.js +0 -143
  227. package/esm2015/lib/services/entity.js +0 -10
  228. package/esm2015/lib/services/singleton.js +0 -46
  229. package/esm2015/lib/types.js +0 -37
  230. package/esm2015/lib/utils/http.js +0 -89
  231. package/esm2015/lib/utils/index.js +0 -9
  232. package/esm2015/lib/utils/objects.js +0 -139
  233. package/esm2015/lib/utils/odata.js +0 -21
  234. package/esm2015/lib/utils/strings.js +0 -13
  235. package/esm2015/lib/utils/types.js +0 -103
  236. package/fesm2015/angular-odata.js.map +0 -1
  237. package/lib/resources/query-options.d.ts +0 -57
@@ -1,72 +1,25 @@
1
- import { Expand, Filter, OrderBy, Select, Transform } from '../builder';
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';
5
3
  import { ODataCollection } from '../../models/collection';
6
4
  import { ODataModel } from '../../models/model';
7
- import { ODataPathSegments } from '../path-segments';
8
- import { ODataQueryOptions } from '../query-options';
5
+ import { ODataCallable } from '../../schema/callable';
6
+ import { ODataPathSegments } from '../path';
7
+ import { ODataQueryOptions } from '../query';
9
8
  import { ODataResource } from '../resource';
10
- import { Observable } from 'rxjs';
9
+ import { ODataEntities, ODataEntity, ODataProperty } from '../responses';
10
+ import { ODataEntitiesOptions, ODataEntityOptions, ODataNoneOptions, ODataOptions, ODataPropertyOptions } from './options';
11
11
  export declare class ODataFunctionResource<P, R> extends ODataResource<R> {
12
- static factory<P, R>(api: ODataApi, path: string, type: string | undefined, segments: ODataPathSegments, options: ODataQueryOptions): 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
- clone(): ODataFunctionResource<P, R>;
15
- schema(): import("angular-odata").ODataCallable<R> | undefined;
16
- asModel<M extends ODataModel<R>>(entity: Partial<R> | {
17
- [name: string]: any;
18
- }, { annots, reset }?: {
19
- annots?: ODataEntityAnnotations;
20
- reset?: boolean;
21
- }): M;
22
- asCollection<M extends ODataModel<R>, C extends ODataCollection<R, M>>(entities: Partial<R>[] | {
23
- [name: string]: any;
24
- }[], { annots, reset, }?: {
25
- annots?: ODataEntitiesAnnotations;
26
- reset?: boolean;
27
- }): C;
28
20
  parameters(params: P | null, { alias }?: {
29
21
  alias?: boolean;
30
22
  }): ODataFunctionResource<P, R>;
31
- select(opts: Select<R>): ODataFunctionResource<P, R>;
32
- expand(opts: Expand<R>): ODataFunctionResource<P, R>;
33
- transform(opts: Transform<R>): ODataFunctionResource<P, R>;
34
- search(opts: string): ODataFunctionResource<P, R>;
35
- filter(opts: Filter): ODataFunctionResource<P, R>;
36
- orderBy(opts: OrderBy<R>): ODataFunctionResource<P, R>;
37
- format(opts: string): ODataFunctionResource<P, R>;
38
- top(opts: number): ODataFunctionResource<P, R>;
39
- skip(opts: number): ODataFunctionResource<P, R>;
40
- skiptoken(opts: string): ODataFunctionResource<P, R>;
41
- get segment(): {
42
- entitySet(): import("../path-segments").SegmentHandler;
43
- singleton(): import("../path-segments").SegmentHandler;
44
- function(): import("../path-segments").SegmentHandler;
45
- };
46
- /**
47
- * Handle query options of the function
48
- * @returns Handler for mutate the query of the function
49
- */
50
- get query(): {
51
- select(opts?: Select<R> | undefined): import("../query-options").OptionHandler<Select<R>>;
52
- expand(opts?: Expand<R> | undefined): import("../query-options").OptionHandler<Expand<R>>;
53
- compute(opts?: string | undefined): import("../query-options").OptionHandler<string>;
54
- transform(opts?: Transform<R> | undefined): import("../query-options").OptionHandler<Transform<R>>;
55
- search(opts?: string | undefined): import("../query-options").OptionHandler<string>;
56
- filter(opts?: Filter | undefined): import("../query-options").OptionHandler<Filter>;
57
- orderBy(opts?: OrderBy<R> | undefined): import("../query-options").OptionHandler<OrderBy<R>>;
58
- format(opts?: string | undefined): import("../query-options").OptionHandler<string>;
59
- top(opts?: number | undefined): import("../query-options").OptionHandler<number>;
60
- skip(opts?: number | undefined): import("../query-options").OptionHandler<number>;
61
- skiptoken(opts?: string | undefined): import("../query-options").OptionHandler<string>;
62
- paging({ skip, skiptoken, top, }?: {
63
- skip?: number | undefined;
64
- skiptoken?: string | undefined;
65
- top?: number | undefined;
66
- }): void;
67
- clearPaging(): void;
68
- apply(query: import("../query-options").ODataQueryArguments<R>): void;
69
- };
70
23
  protected get(options?: ODataEntityOptions & ODataEntitiesOptions & ODataPropertyOptions): Observable<any>;
71
24
  /**
72
25
  * Execute the function
@@ -1,13 +1,14 @@
1
+ import { Observable } from 'rxjs';
1
2
  import { ODataApi } from '../../api';
2
- import { ODataOptions } from './options';
3
- import { ODataPathSegments } from '../path-segments';
4
- import { ODataQueryOptions } from '../query-options';
3
+ import { ODataPathSegments } from '../path';
4
+ import { ODataQueryOptions } from '../query';
5
5
  import { ODataResource } from '../resource';
6
- import { Observable } from 'rxjs';
7
- export declare class ODataMediaResource<T> extends ODataResource<T> {
8
- static factory<V>(api: ODataApi, segments: ODataPathSegments, options: ODataQueryOptions): ODataMediaResource<V>;
9
- clone(): ODataMediaResource<T>;
10
- schema(): undefined;
6
+ import { ODataOptions } from './options';
7
+ export declare class ODataMediaResource extends ODataResource<any> {
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,13 +1,11 @@
1
+ import { Observable } from 'rxjs';
1
2
  import { ODataApi } from '../../api';
3
+ import { ODataPathSegments } from '../path';
4
+ import { ODataResource } from '../resource';
2
5
  import { ODataMetadata } from '../responses';
3
6
  import { ODataOptions } from './options';
4
- import { ODataPathSegments } from '../path-segments';
5
- import { ODataResource } from '../resource';
6
- import { Observable } from 'rxjs';
7
7
  export declare class ODataMetadataResource extends ODataResource<any> {
8
8
  constructor(api: ODataApi, segments?: ODataPathSegments);
9
- clone(): ODataMetadataResource;
10
- schema(): undefined;
11
9
  static factory(api: ODataApi): ODataMetadataResource;
12
10
  protected get(options?: ODataOptions): Observable<ODataMetadata>;
13
11
  fetch(options?: ODataOptions): Observable<ODataMetadata>;
@@ -1,16 +1,16 @@
1
1
  import { Observable } from 'rxjs';
2
- import { EntityKey, ODataResource } from '../resource';
3
- import { Expand, Filter, OrderBy, Select, Transform } from '../builder';
2
+ import { ODataApi } from '../../api';
4
3
  import { ODataCollection, ODataModel } from '../../models';
5
- import { ODataEntities, ODataEntitiesAnnotations, ODataEntity, ODataEntityAnnotations } from '../responses';
6
- import { ODataEntitiesOptions, ODataEntityOptions, ODataOptions } from './options';
4
+ import { ODataStructuredType } from '../../schema';
7
5
  import { QueryOptionNames } from '../../types';
8
- 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';
9
10
  import { ODataCountResource } from './count';
10
11
  import { ODataMediaResource } from './media';
11
- import { ODataPathSegments } from '../path-segments';
12
+ import { ODataEntitiesOptions, ODataEntityOptions, ODataOptions } from './options';
12
13
  import { ODataPropertyResource } from './property';
13
- import { ODataQueryOptions } from '../query-options';
14
14
  import { ODataReferenceResource } from './reference';
15
15
  /**
16
16
  * OData Navigation Property Resource
@@ -18,69 +18,22 @@ import { ODataReferenceResource } from './reference';
18
18
  * https://www.odata.org/getting-started/advanced-tutorial/#derived
19
19
  */
20
20
  export declare class ODataNavigationPropertyResource<T> extends ODataResource<T> {
21
- static factory<E>(api: ODataApi, path: string, type: string | undefined, segments: ODataPathSegments, options: ODataQueryOptions): ODataNavigationPropertyResource<E>;
22
- clone(): ODataNavigationPropertyResource<T>;
23
- schema(): import("angular-odata").ODataStructuredType<T> | undefined;
24
- asModel<M extends ODataModel<T>>(entity: Partial<T> | {
25
- [name: string]: any;
26
- }, { annots, reset }?: {
27
- annots?: ODataEntityAnnotations;
28
- reset?: boolean;
29
- }): M;
30
- asCollection<M extends ODataModel<T>, C extends ODataCollection<T, M>>(entities: Partial<T>[] | {
31
- [name: string]: any;
32
- }[], { annots, reset, }?: {
33
- annots?: ODataEntitiesAnnotations;
34
- reset?: boolean;
35
- }): 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>;
36
29
  key(value: any): ODataNavigationPropertyResource<T>;
37
30
  keys(values: any[]): ODataNavigationPropertyResource<T>;
38
- media(): ODataMediaResource<T>;
39
- reference(): ODataReferenceResource;
31
+ media(): ODataMediaResource;
32
+ reference(): ODataReferenceResource<T>;
40
33
  navigationProperty<N>(path: string): ODataNavigationPropertyResource<N>;
41
34
  property<P>(path: string): ODataPropertyResource<P>;
42
- count(): ODataCountResource;
35
+ count(): ODataCountResource<T>;
43
36
  cast<C>(type: string): ODataNavigationPropertyResource<C>;
44
- select(opts: Select<T>): ODataNavigationPropertyResource<T>;
45
- expand(opts: Expand<T>): ODataNavigationPropertyResource<T>;
46
- transform(opts: Transform<T>): ODataNavigationPropertyResource<T>;
47
- search(opts: string): ODataNavigationPropertyResource<T>;
48
- filter(opts: Filter): ODataNavigationPropertyResource<T>;
49
- orderBy(opts: OrderBy<T>): ODataNavigationPropertyResource<T>;
50
- format(opts: string): ODataNavigationPropertyResource<T>;
51
- top(opts: number): ODataNavigationPropertyResource<T>;
52
- skip(opts: number): ODataNavigationPropertyResource<T>;
53
- skiptoken(opts: string): ODataNavigationPropertyResource<T>;
54
- get segment(): {
55
- entitySet(): import("../path-segments").SegmentHandler;
56
- singleton(): import("../path-segments").SegmentHandler;
57
- navigationProperty(): import("../path-segments").SegmentHandler;
58
- keys(values?: (EntityKey<T> | undefined)[] | undefined): (EntityKey<any> | undefined)[];
59
- };
60
- /**
61
- * Handle query options of the navigation property
62
- * @returns Handler for mutate the query of the navigation property
63
- */
64
- get query(): {
65
- select(opts?: Select<T> | undefined): import("../query-options").OptionHandler<Select<T>>;
66
- expand(opts?: Expand<T> | undefined): import("../query-options").OptionHandler<Expand<T>>;
67
- compute(opts?: string | undefined): import("../query-options").OptionHandler<string>;
68
- transform(opts?: Transform<T> | undefined): import("../query-options").OptionHandler<Transform<T>>;
69
- search(opts?: string | undefined): import("../query-options").OptionHandler<string>;
70
- filter(opts?: Filter | undefined): import("../query-options").OptionHandler<Filter>;
71
- orderBy(opts?: OrderBy<T> | undefined): import("../query-options").OptionHandler<OrderBy<T>>;
72
- format(opts?: string | undefined): import("../query-options").OptionHandler<string>;
73
- top(opts?: number | undefined): import("../query-options").OptionHandler<number>;
74
- skip(opts?: number | undefined): import("../query-options").OptionHandler<number>;
75
- skiptoken(opts?: string | undefined): import("../query-options").OptionHandler<string>;
76
- paging({ skip, skiptoken, top, }?: {
77
- skip?: number | undefined;
78
- skiptoken?: string | undefined;
79
- top?: number | undefined;
80
- }): void;
81
- clearPaging(): void;
82
- apply(query: import("../query-options").ODataQueryArguments<T>): void;
83
- };
84
37
  protected post(attrs: Partial<T>, options?: ODataOptions): Observable<ODataEntity<T>>;
85
38
  protected put(attrs: Partial<T>, options?: ODataOptions & {
86
39
  etag?: string;
@@ -95,16 +48,47 @@ export declare class ODataNavigationPropertyResource<T> extends ODataResource<T>
95
48
  etag?: string;
96
49
  bodyQueryOptions?: QueryOptionNames[];
97
50
  }): Observable<any>;
51
+ /**
52
+ * Create a new entity
53
+ * @param attrs The entity attributes
54
+ * @param options Options for the request
55
+ * @returns The created entity with the annotations
56
+ */
98
57
  create(attrs: Partial<T>, options?: ODataOptions): Observable<ODataEntity<T>>;
58
+ /**
59
+ * Update an existing entity
60
+ * @param attrs The entity attributes
61
+ * @param options Options for the request
62
+ * @param etag The etag of the entity
63
+ * @returns The updated entity with the annotations
64
+ */
99
65
  update(attrs: Partial<T>, options?: ODataOptions & {
100
66
  etag?: string;
101
67
  }): Observable<ODataEntity<T>>;
68
+ /**
69
+ * Modify an existing entity
70
+ * @param attrs The entity attributes
71
+ * @param options Options for the request
72
+ * @param etag The etag of the entity
73
+ * @returns The modified entity with the annotations
74
+ */
102
75
  modify(attrs: Partial<T>, options?: ODataOptions & {
103
76
  etag?: string;
104
77
  }): Observable<ODataEntity<T>>;
78
+ /**
79
+ * Delete an existing entity
80
+ * @param options Options for the request
81
+ * @param etag The etag of the entity
82
+ * @returns An observable of the destroy
83
+ */
105
84
  destroy(options?: ODataOptions & {
106
85
  etag?: string;
107
86
  }): Observable<any>;
87
+ /**
88
+ * Fetch entity / entities
89
+ * @param options Options for the request
90
+ * @return An observable of the entity or entities with annotations
91
+ */
108
92
  fetch(options?: ODataEntityOptions & {
109
93
  etag?: string;
110
94
  bodyQueryOptions?: QueryOptionNames[];
@@ -113,21 +97,46 @@ export declare class ODataNavigationPropertyResource<T> extends ODataResource<T>
113
97
  etag?: string;
114
98
  bodyQueryOptions?: QueryOptionNames[];
115
99
  }): Observable<ODataEntities<T>>;
100
+ /**
101
+ * Fetch the entity
102
+ * @param options Options for the request
103
+ * @returns The entity
104
+ */
116
105
  fetchEntity(options?: ODataOptions & {
117
106
  etag?: string;
118
107
  bodyQueryOptions?: QueryOptionNames[];
119
108
  }): Observable<T | null>;
109
+ /**
110
+ * Fetch the entity and return as model
111
+ * @param options Options for the request
112
+ * @returns The model
113
+ */
120
114
  fetchModel<M extends ODataModel<T>>(options?: ODataOptions & {
121
115
  etag?: string;
122
116
  bodyQueryOptions?: QueryOptionNames[];
123
117
  }): Observable<M | null>;
118
+ /**
119
+ * Fetch entities
120
+ * @param options Options for the request
121
+ * @returns The entities
122
+ */
124
123
  fetchEntities(options?: ODataOptions & {
125
124
  bodyQueryOptions?: QueryOptionNames[];
126
125
  }): Observable<T[] | null>;
126
+ /**
127
+ * Fetch entities and return as collection
128
+ * @param options Options for the request
129
+ * @returns The collection
130
+ */
127
131
  fetchCollection<M extends ODataModel<T>, C extends ODataCollection<T, M>>(options?: ODataOptions & {
128
132
  withCount?: boolean;
129
133
  bodyQueryOptions?: QueryOptionNames[];
130
134
  }): Observable<C | null>;
135
+ /**
136
+ * Fetch all entities
137
+ * @param options Options for the request
138
+ * @returns All entities
139
+ */
131
140
  fetchAll(options?: ODataOptions & {
132
141
  bodyQueryOptions?: QueryOptionNames[];
133
142
  }): Observable<T[]>;
@@ -1,6 +1,6 @@
1
1
  import { HttpHeaders, HttpParams } from '@angular/common/http';
2
2
  import { FetchPolicy } from '../../types';
3
- import { ODataQueryArguments } from '../query-options';
3
+ import { ODataQueryArguments } from '../query';
4
4
  export declare type ODataOptions = {
5
5
  headers?: HttpHeaders | {
6
6
  [header: string]: string | string[];
@@ -1,89 +1,81 @@
1
1
  import { Observable } from 'rxjs';
2
- import { EntityKey, ODataResource } from '../resource';
3
- import { Expand, Filter, OrderBy, Select, Transform } from '../builder';
2
+ import { ODataApi } from '../../api';
4
3
  import { ODataCollection, ODataModel } from '../../models';
5
- import { ODataEntities, ODataEntitiesAnnotations, ODataEntity, ODataEntityAnnotations, ODataProperty } from '../responses';
4
+ import { ODataStructuredType } from '../../schema';
5
+ import { ODataPathSegments } from '../path';
6
+ import { ODataQueryOptions } from '../query';
7
+ import { ODataResource } from '../resource';
8
+ import { ODataEntities, ODataEntity, ODataProperty } from '../responses';
6
9
  import { ODataEntitiesOptions, ODataEntityOptions, ODataOptions, ODataPropertyOptions } from './options';
7
- import { ODataApi } from '../../api';
8
- import { ODataPathSegments } from '../path-segments';
9
- import { ODataQueryOptions } from '../query-options';
10
10
  import { ODataValueResource } from './value';
11
11
  export declare class ODataPropertyResource<T> extends ODataResource<T> {
12
- static factory<P>(api: ODataApi, path: string, type: string | undefined, segments: ODataPathSegments, options: ODataQueryOptions): ODataPropertyResource<P>;
13
- clone(): ODataPropertyResource<T>;
14
- schema(): import("angular-odata").ODataStructuredType<T> | undefined;
15
- asModel<M extends ODataModel<T>>(entity: Partial<T> | {
16
- [name: string]: any;
17
- }, { annots, reset }?: {
18
- annots?: ODataEntityAnnotations;
19
- reset?: boolean;
20
- }): M;
21
- asCollection<M extends ODataModel<T>, C extends ODataCollection<T, M>>(entities: Partial<T>[] | {
22
- [name: string]: any;
23
- }[], { annots, reset, }?: {
24
- annots?: ODataEntitiesAnnotations;
25
- reset?: boolean;
26
- }): 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>;
27
20
  key(value: any): ODataPropertyResource<T>;
28
21
  keys(values: any[]): ODataPropertyResource<T>;
29
22
  value(): ODataValueResource<T>;
30
23
  property<P>(path: string): ODataPropertyResource<P>;
31
- select(opts: Select<T>): ODataPropertyResource<T>;
32
- expand(opts: Expand<T>): ODataPropertyResource<T>;
33
- transform(opts: Transform<T>): ODataPropertyResource<T>;
34
- search(opts: string): ODataPropertyResource<T>;
35
- filter(opts: Filter): ODataPropertyResource<T>;
36
- orderBy(opts: OrderBy<T>): ODataPropertyResource<T>;
37
- format(opts: string): ODataPropertyResource<T>;
38
- top(opts: number): ODataPropertyResource<T>;
39
- skip(opts: number): ODataPropertyResource<T>;
40
- skiptoken(opts: string): ODataPropertyResource<T>;
41
- get segment(): {
42
- entitySet(): import("../path-segments").SegmentHandler;
43
- singleton(): import("../path-segments").SegmentHandler;
44
- property(): import("../path-segments").SegmentHandler;
45
- keys(values?: (EntityKey<any> | undefined)[] | undefined): (EntityKey<any> | undefined)[];
46
- };
47
- get query(): {
48
- select(opts?: Select<T> | undefined): import("../query-options").OptionHandler<Select<T>>;
49
- expand(opts?: Expand<T> | undefined): import("../query-options").OptionHandler<Expand<T>>;
50
- compute(opts?: string | undefined): import("../query-options").OptionHandler<string>;
51
- transform(opts?: Transform<T> | undefined): import("../query-options").OptionHandler<Transform<T>>;
52
- search(opts?: string | undefined): import("../query-options").OptionHandler<string>;
53
- filter(opts?: Filter | undefined): import("../query-options").OptionHandler<Filter>;
54
- orderBy(opts?: OrderBy<T> | undefined): import("../query-options").OptionHandler<OrderBy<T>>;
55
- format(opts?: string | undefined): import("../query-options").OptionHandler<string>;
56
- top(opts?: number | undefined): import("../query-options").OptionHandler<number>;
57
- skip(opts?: number | undefined): import("../query-options").OptionHandler<number>;
58
- skiptoken(opts?: string | undefined): import("../query-options").OptionHandler<string>;
59
- paging({ skip, skiptoken, top, }?: {
60
- skip?: number | undefined;
61
- skiptoken?: string | undefined;
62
- top?: number | undefined;
63
- }): void;
64
- clearPaging(): void;
65
- apply(query: import("../query-options").ODataQueryArguments<T>): void;
66
- };
67
24
  protected get(options: ODataEntityOptions & ODataEntitiesOptions & ODataPropertyOptions): Observable<any>;
25
+ /**
26
+ * Fetch the property
27
+ * @param options Options for the request
28
+ * @return The entity / entities / property value
29
+ */
68
30
  fetch(options?: ODataEntityOptions & {
69
31
  etag?: string;
70
32
  }): Observable<ODataEntity<T>>;
71
33
  fetch(options?: ODataEntitiesOptions): Observable<ODataEntities<T>>;
72
34
  fetch(options?: ODataPropertyOptions): Observable<ODataProperty<T>>;
35
+ /**
36
+ * Fetch the property value
37
+ * @param options Options for the request
38
+ * @returns The property value
39
+ */
73
40
  fetchProperty(options?: ODataOptions & {
74
41
  etag?: string;
75
42
  }): Observable<T | null>;
43
+ /**
44
+ * Fetch the entity
45
+ * @param options Options for the request
46
+ * @returns The entity
47
+ */
76
48
  fetchEntity(options?: ODataOptions & {
77
49
  etag?: string;
78
50
  }): Observable<T | null>;
51
+ /**
52
+ * Fetch the entity and return as model
53
+ * @param options Options for the request
54
+ * @returns The model
55
+ */
79
56
  fetchModel<M extends ODataModel<T>>(options?: ODataOptions & {
80
57
  etag?: string;
81
58
  }): Observable<M | null>;
59
+ /**
60
+ * Fetch the entities
61
+ * @param options Options for the request
62
+ * @returns The entities
63
+ */
82
64
  fetchEntities(options?: ODataOptions & {
83
65
  withCount?: boolean;
84
66
  }): Observable<T[] | null>;
67
+ /**
68
+ * Fetch the entities and return as collection
69
+ * @param options Options for the request
70
+ * @returns The collection
71
+ */
85
72
  fetchCollection<M extends ODataModel<T>, C extends ODataCollection<T, M>>(options?: ODataOptions & {
86
73
  withCount?: boolean;
87
74
  }): Observable<C | null>;
75
+ /**
76
+ * Fetch all entities
77
+ * @param options Options for the request
78
+ * @returns All entities
79
+ */
88
80
  fetchAll(options?: ODataOptions): Observable<T[]>;
89
81
  }
@@ -1,14 +1,17 @@
1
+ import { Observable } from 'rxjs';
1
2
  import { ODataApi } from '../../api';
2
- import { ODataEntityResource } from './entity';
3
- import { ODataOptions } from './options';
4
- import { ODataPathSegments } from '../path-segments';
5
- import { ODataQueryOptions } from '../query-options';
3
+ import { QueryOptionNames } from '../../types';
4
+ import { ODataPathSegments } from '../path';
5
+ import { ODataQueryOptions } from '../query';
6
6
  import { ODataResource } from '../resource';
7
- import { Observable } from 'rxjs';
8
- export declare class ODataReferenceResource extends ODataResource<any> {
9
- static factory<P>(api: ODataApi, segments: ODataPathSegments, options: ODataQueryOptions): ODataReferenceResource;
10
- clone(): ODataReferenceResource;
11
- schema(): undefined;
7
+ import { ODataEntities, ODataEntity } from '../responses/types';
8
+ import { ODataEntityResource } from './entity';
9
+ import { ODataEntitiesOptions, ODataEntityOptions, ODataOptions } from './options';
10
+ export declare class ODataReferenceResource<T> extends ODataResource<T> {
11
+ static factory<P>(api: ODataApi, { segments, query, }: {
12
+ segments: ODataPathSegments;
13
+ query?: ODataQueryOptions<P>;
14
+ }): ODataReferenceResource<P>;
12
15
  protected post(target: ODataEntityResource<any>, options?: ODataOptions): Observable<any>;
13
16
  protected put(target: ODataEntityResource<any>, options?: ODataOptions & {
14
17
  etag?: string;
@@ -17,12 +20,65 @@ export declare class ODataReferenceResource extends ODataResource<any> {
17
20
  etag?: string;
18
21
  target?: ODataEntityResource<any>;
19
22
  } & ODataOptions): Observable<any>;
23
+ /**
24
+ * Add the given target to the collection.
25
+ * @param target The target resource
26
+ * @param options Options for the request
27
+ * @returns Observable of the response
28
+ */
20
29
  add(target: ODataEntityResource<any>, options?: ODataOptions): Observable<any>;
30
+ /**
31
+ * Remove the given target from the collection.
32
+ * @param target The target resource
33
+ * @param options Options for the request
34
+ * @returns Observable of the response
35
+ */
21
36
  remove(target?: ODataEntityResource<any>, options?: ODataOptions): Observable<any>;
37
+ /**
38
+ * Set the reference to the given target.
39
+ * @param target The target resource
40
+ * @param options Options for the request
41
+ * @returns Observable of the response
42
+ */
22
43
  set(target: ODataEntityResource<any>, options?: ODataOptions & {
23
44
  etag?: string;
24
45
  }): Observable<any>;
46
+ /**
47
+ * Unset the reference to the given target.
48
+ * @param options Options for the request.
49
+ * @returns Observable of the response
50
+ */
25
51
  unset(options?: ODataOptions & {
26
52
  etag?: string;
27
53
  }): Observable<any>;
54
+ /**
55
+ * Fetch entity / entities
56
+ * @param options Options for the request
57
+ * @return An observable of the entity or entities with annotations
58
+ */
59
+ fetch(options?: ODataEntityOptions & {
60
+ etag?: string;
61
+ bodyQueryOptions?: QueryOptionNames[];
62
+ }): Observable<ODataEntity<T>>;
63
+ fetch(options?: ODataEntitiesOptions & {
64
+ etag?: string;
65
+ bodyQueryOptions?: QueryOptionNames[];
66
+ }): Observable<ODataEntities<T>>;
67
+ /**
68
+ * Fetch the entity
69
+ * @param options Options for the request
70
+ * @returns The entity
71
+ */
72
+ fetchEntity(options?: ODataOptions & {
73
+ etag?: string;
74
+ bodyQueryOptions?: QueryOptionNames[];
75
+ }): Observable<T | null>;
76
+ /**
77
+ * Fetch entities
78
+ * @param options Options for the request
79
+ * @returns The entities
80
+ */
81
+ fetchEntities(options?: ODataOptions & {
82
+ bodyQueryOptions?: QueryOptionNames[];
83
+ }): Observable<T[] | null>;
28
84
  }