angular-odata 0.78.1 → 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 (224) hide show
  1. package/README.md +133 -62
  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} +12 -5
  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} +0 -0
  7. package/{esm2015/lib/cache/storage.js → esm2020/lib/cache/storage.mjs} +1 -1
  8. package/esm2020/lib/client.mjs +271 -0
  9. package/{esm2015/lib/constants.js → esm2020/lib/constants.mjs} +9 -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} +6 -6
  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.mjs +207 -0
  24. package/esm2020/lib/resources/query/handlers.mjs +186 -0
  25. package/esm2020/lib/resources/query/index.mjs +4 -0
  26. package/esm2020/lib/resources/query/options.mjs +103 -0
  27. package/esm2020/lib/resources/query/syntax.mjs +406 -0
  28. package/esm2020/lib/resources/request.mjs +167 -0
  29. package/esm2020/lib/resources/resource.mjs +326 -0
  30. package/esm2020/lib/resources/responses/annotations.mjs +119 -0
  31. package/{esm2015/lib/resources/responses/csdl/csdl-annotation.js → esm2020/lib/resources/responses/csdl/csdl-annotation.mjs} +0 -0
  32. package/{esm2015/lib/resources/responses/csdl/csdl-entity-container.js → esm2020/lib/resources/responses/csdl/csdl-entity-container.mjs} +0 -0
  33. package/{esm2015/lib/resources/responses/csdl/csdl-entity-set.js → esm2020/lib/resources/responses/csdl/csdl-entity-set.mjs} +0 -0
  34. package/{esm2015/lib/resources/responses/csdl/csdl-enum-type.js → esm2020/lib/resources/responses/csdl/csdl-enum-type.mjs} +0 -0
  35. package/{esm2015/lib/resources/responses/csdl/csdl-function-action.js → esm2020/lib/resources/responses/csdl/csdl-function-action.mjs} +0 -0
  36. package/{esm2015/lib/resources/responses/csdl/csdl-navigation-property-binding.js → esm2020/lib/resources/responses/csdl/csdl-navigation-property-binding.mjs} +0 -0
  37. package/{esm2015/lib/resources/responses/csdl/csdl-reference.js → esm2020/lib/resources/responses/csdl/csdl-reference.mjs} +0 -0
  38. package/{esm2015/lib/resources/responses/csdl/csdl-schema.js → esm2020/lib/resources/responses/csdl/csdl-schema.mjs} +0 -0
  39. package/{esm2015/lib/resources/responses/csdl/csdl-singleton.js → esm2020/lib/resources/responses/csdl/csdl-singleton.mjs} +0 -0
  40. package/{esm2015/lib/resources/responses/csdl/csdl-structural-property.js → esm2020/lib/resources/responses/csdl/csdl-structural-property.mjs} +0 -0
  41. package/{esm2015/lib/resources/responses/csdl/csdl-structured-type.js → esm2020/lib/resources/responses/csdl/csdl-structured-type.mjs} +0 -0
  42. package/{esm2015/lib/resources/responses/csdl/csdl-type-definition.js → esm2020/lib/resources/responses/csdl/csdl-type-definition.mjs} +0 -0
  43. package/{esm2015/lib/resources/responses/index.js → esm2020/lib/resources/responses/index.mjs} +0 -0
  44. package/esm2020/lib/resources/responses/metadata.mjs +547 -0
  45. package/{esm2015/lib/resources/responses/options.js → esm2020/lib/resources/responses/options.mjs} +1 -1
  46. package/esm2020/lib/resources/responses/response.mjs +170 -0
  47. package/{esm2015/lib/resources/responses/types.js → esm2020/lib/resources/responses/types.mjs} +1 -1
  48. package/esm2020/lib/resources/types/action.mjs +101 -0
  49. package/esm2020/lib/resources/types/batch.mjs +288 -0
  50. package/esm2020/lib/resources/types/count.mjs +27 -0
  51. package/esm2020/lib/resources/types/entity-set.mjs +94 -0
  52. package/esm2020/lib/resources/types/entity.mjs +106 -0
  53. package/esm2020/lib/resources/types/function.mjs +137 -0
  54. package/{esm2015/lib/resources/types/index.js → esm2020/lib/resources/types/index.mjs} +0 -0
  55. package/esm2020/lib/resources/types/media.mjs +41 -0
  56. package/esm2020/lib/resources/types/metadata.mjs +30 -0
  57. package/esm2020/lib/resources/types/navigation-property.mjs +226 -0
  58. package/esm2020/lib/resources/types/options.mjs +2 -0
  59. package/esm2020/lib/resources/types/property.mjs +183 -0
  60. package/esm2020/lib/resources/types/reference.mjs +85 -0
  61. package/esm2020/lib/resources/types/singleton.mjs +126 -0
  62. package/esm2020/lib/resources/types/value.mjs +41 -0
  63. package/esm2020/lib/schema/annotation.mjs +37 -0
  64. package/esm2020/lib/schema/callable.mjs +62 -0
  65. package/esm2020/lib/schema/element.mjs +51 -0
  66. package/esm2020/lib/schema/entity-container.mjs +9 -0
  67. package/esm2020/lib/schema/entity-set.mjs +9 -0
  68. package/esm2020/lib/schema/enum-type.mjs +71 -0
  69. package/{esm2015/lib/schema/index.js → esm2020/lib/schema/index.mjs} +2 -1
  70. package/esm2020/lib/schema/parsers/callable.mjs +113 -0
  71. package/esm2020/lib/schema/parsers/edm.mjs +95 -0
  72. package/esm2020/lib/schema/parsers/enum-type.mjs +107 -0
  73. package/esm2020/lib/schema/parsers/index.mjs +5 -0
  74. package/esm2020/lib/schema/parsers/structured-type.mjs +412 -0
  75. package/esm2020/lib/schema/schema.mjs +61 -0
  76. package/esm2020/lib/schema/structured-type.mjs +198 -0
  77. package/esm2020/lib/services/base.mjs +29 -0
  78. package/esm2020/lib/services/entity-set.mjs +143 -0
  79. package/esm2020/lib/services/entity.mjs +12 -0
  80. package/{esm2015/lib/services/factory.js → esm2020/lib/services/factory.mjs} +3 -3
  81. package/{esm2015/lib/services/index.js → esm2020/lib/services/index.mjs} +0 -0
  82. package/esm2020/lib/services/singleton.mjs +48 -0
  83. package/{esm2015/lib/settings.js → esm2020/lib/settings.mjs} +1 -1
  84. package/{esm2015/lib/tokens.js → esm2020/lib/tokens.mjs} +0 -0
  85. package/esm2020/lib/types.mjs +37 -0
  86. package/esm2020/lib/utils/arraybuffers.mjs +46 -0
  87. package/{esm2015/lib/utils/dates.js → esm2020/lib/utils/dates.mjs} +0 -0
  88. package/esm2020/lib/utils/durations.mjs +40 -0
  89. package/{esm2015/lib/utils/enums.js → esm2020/lib/utils/enums.mjs} +0 -0
  90. package/esm2020/lib/utils/http.mjs +93 -0
  91. package/esm2020/lib/utils/index.mjs +10 -0
  92. package/esm2020/lib/utils/objects.mjs +195 -0
  93. package/esm2020/lib/utils/odata.mjs +22 -0
  94. package/esm2020/lib/utils/strings.mjs +20 -0
  95. package/esm2020/lib/utils/types.mjs +134 -0
  96. package/{esm2015/lib/utils/urls.js → esm2020/lib/utils/urls.mjs} +0 -0
  97. package/{esm2015/public-api.js → esm2020/public-api.mjs} +0 -0
  98. package/fesm2015/{angular-odata.js → angular-odata.mjs} +5068 -3943
  99. package/fesm2015/angular-odata.mjs.map +1 -0
  100. package/fesm2020/angular-odata.mjs +10274 -0
  101. package/fesm2020/angular-odata.mjs.map +1 -0
  102. package/lib/api.d.ts +17 -16
  103. package/lib/cache/cache.d.ts +2 -2
  104. package/lib/client.d.ts +93 -18
  105. package/lib/constants.d.ts +6 -2
  106. package/lib/helper.d.ts +3 -3
  107. package/lib/index.d.ts +0 -1
  108. package/lib/models/collection.d.ts +36 -47
  109. package/lib/models/model.d.ts +47 -40
  110. package/lib/models/options.d.ts +53 -52
  111. package/lib/options.d.ts +50 -2
  112. package/lib/resources/index.d.ts +2 -3
  113. package/lib/resources/path/handlers.d.ts +27 -0
  114. package/lib/resources/path/index.d.ts +2 -0
  115. package/lib/resources/{path-segments.d.ts → path/segments.d.ts} +4 -16
  116. package/lib/resources/{builder.d.ts → query/builder.d.ts} +12 -7
  117. package/lib/resources/query/expressions.d.ts +63 -0
  118. package/lib/resources/query/handlers.d.ts +89 -0
  119. package/lib/resources/query/index.d.ts +3 -0
  120. package/lib/resources/query/options.d.ts +38 -0
  121. package/lib/resources/query/syntax.d.ts +175 -0
  122. package/lib/resources/request.d.ts +8 -6
  123. package/lib/resources/resource.d.ts +49 -55
  124. package/lib/resources/responses/metadata.d.ts +1 -1
  125. package/lib/resources/responses/types.d.ts +1 -1
  126. package/lib/resources/types/action.d.ts +55 -69
  127. package/lib/resources/types/batch.d.ts +13 -8
  128. package/lib/resources/types/count.d.ts +16 -19
  129. package/lib/resources/types/entity-set.d.ts +24 -62
  130. package/lib/resources/types/entity.d.ts +35 -43
  131. package/lib/resources/types/function.d.ts +63 -71
  132. package/lib/resources/types/media.d.ts +20 -22
  133. package/lib/resources/types/metadata.d.ts +5 -7
  134. package/lib/resources/types/navigation-property.d.ts +100 -85
  135. package/lib/resources/types/options.d.ts +8 -8
  136. package/lib/resources/types/property.d.ts +63 -73
  137. package/lib/resources/types/reference.d.ts +72 -16
  138. package/lib/resources/types/singleton.d.ts +75 -43
  139. package/lib/resources/types/value.d.ts +18 -9
  140. package/lib/schema/annotation.d.ts +18 -0
  141. package/lib/schema/callable.d.ts +27 -11
  142. package/lib/schema/element.d.ts +39 -0
  143. package/lib/schema/entity-container.d.ts +3 -8
  144. package/lib/schema/entity-set.d.ts +3 -9
  145. package/lib/schema/enum-type.d.ts +41 -14
  146. package/lib/schema/index.d.ts +1 -0
  147. package/lib/{parsers → schema/parsers}/callable.d.ts +2 -2
  148. package/lib/schema/parsers/edm.d.ts +4 -0
  149. package/lib/{parsers → schema/parsers}/enum-type.d.ts +13 -7
  150. package/lib/{parsers → schema/parsers}/index.d.ts +0 -0
  151. package/lib/{parsers → schema/parsers}/structured-type.d.ts +14 -9
  152. package/lib/schema/schema.d.ts +6 -8
  153. package/lib/schema/structured-type.d.ts +97 -18
  154. package/lib/services/base.d.ts +12 -12
  155. package/lib/services/entity-set.d.ts +15 -12
  156. package/lib/services/entity.d.ts +4 -1
  157. package/lib/services/singleton.d.ts +6 -3
  158. package/lib/settings.d.ts +4 -4
  159. package/lib/types.d.ts +7 -3
  160. package/lib/utils/arraybuffers.d.ts +4 -0
  161. package/lib/{parsers/edm.d.ts → utils/durations.d.ts} +3 -3
  162. package/lib/utils/http.d.ts +9 -0
  163. package/lib/utils/index.d.ts +5 -2
  164. package/lib/utils/objects.d.ts +1 -1
  165. package/lib/utils/strings.d.ts +4 -0
  166. package/lib/utils/types.d.ts +2 -0
  167. package/package.json +21 -8
  168. package/bundles/angular-odata.umd.js +0 -10756
  169. package/bundles/angular-odata.umd.js.map +0 -1
  170. package/esm2015/lib/api.js +0 -251
  171. package/esm2015/lib/client.js +0 -197
  172. package/esm2015/lib/helper.js +0 -269
  173. package/esm2015/lib/index.js +0 -21
  174. package/esm2015/lib/models/collection.js +0 -660
  175. package/esm2015/lib/models/model.js +0 -421
  176. package/esm2015/lib/models/options.js +0 -889
  177. package/esm2015/lib/options.js +0 -31
  178. package/esm2015/lib/parsers/callable.js +0 -110
  179. package/esm2015/lib/parsers/edm.js +0 -310
  180. package/esm2015/lib/parsers/enum-type.js +0 -97
  181. package/esm2015/lib/parsers/index.js +0 -5
  182. package/esm2015/lib/parsers/structured-type.js +0 -394
  183. package/esm2015/lib/resources/builder.js +0 -537
  184. package/esm2015/lib/resources/index.js +0 -8
  185. package/esm2015/lib/resources/path-segments.js +0 -156
  186. package/esm2015/lib/resources/query-options.js +0 -157
  187. package/esm2015/lib/resources/request.js +0 -141
  188. package/esm2015/lib/resources/resource.js +0 -328
  189. package/esm2015/lib/resources/responses/annotations.js +0 -121
  190. package/esm2015/lib/resources/responses/metadata.js +0 -548
  191. package/esm2015/lib/resources/responses/response.js +0 -170
  192. package/esm2015/lib/resources/types/action.js +0 -146
  193. package/esm2015/lib/resources/types/batch.js +0 -330
  194. package/esm2015/lib/resources/types/count.js +0 -50
  195. package/esm2015/lib/resources/types/entity-set.js +0 -164
  196. package/esm2015/lib/resources/types/entity.js +0 -158
  197. package/esm2015/lib/resources/types/function.js +0 -166
  198. package/esm2015/lib/resources/types/media.js +0 -46
  199. package/esm2015/lib/resources/types/metadata.js +0 -36
  200. package/esm2015/lib/resources/types/navigation-property.js +0 -214
  201. package/esm2015/lib/resources/types/options.js +0 -2
  202. package/esm2015/lib/resources/types/property.js +0 -190
  203. package/esm2015/lib/resources/types/reference.js +0 -50
  204. package/esm2015/lib/resources/types/singleton.js +0 -147
  205. package/esm2015/lib/resources/types/value.js +0 -30
  206. package/esm2015/lib/schema/annotation.js +0 -7
  207. package/esm2015/lib/schema/callable.js +0 -50
  208. package/esm2015/lib/schema/entity-container.js +0 -17
  209. package/esm2015/lib/schema/entity-set.js +0 -23
  210. package/esm2015/lib/schema/enum-type.js +0 -68
  211. package/esm2015/lib/schema/schema.js +0 -55
  212. package/esm2015/lib/schema/structured-type.js +0 -107
  213. package/esm2015/lib/services/base.js +0 -23
  214. package/esm2015/lib/services/entity-set.js +0 -143
  215. package/esm2015/lib/services/entity.js +0 -10
  216. package/esm2015/lib/services/singleton.js +0 -46
  217. package/esm2015/lib/types.js +0 -37
  218. package/esm2015/lib/utils/http.js +0 -59
  219. package/esm2015/lib/utils/index.js +0 -7
  220. package/esm2015/lib/utils/objects.js +0 -140
  221. package/esm2015/lib/utils/odata.js +0 -21
  222. package/esm2015/lib/utils/types.js +0 -103
  223. package/fesm2015/angular-odata.js.map +0 -1
  224. package/lib/resources/query-options.d.ts +0 -57
@@ -1,84 +1,46 @@
1
1
  import { Observable } from 'rxjs';
2
- import { Expand, Select, Transform, Filter, OrderBy } from '../builder';
3
- import { ODataPathSegments } from '../path-segments';
4
- import { ODataActionResource } from './action';
5
- import { ODataFunctionResource } from './function';
6
- import { ODataQueryOptions } from '../query-options';
7
- import { ODataEntityResource } from './entity';
8
- import { ODataCountResource } from './count';
9
- import { EntityKey, ODataResource } from '../resource';
10
- import { HttpOptions } from './options';
11
- import { ODataEntity, ODataEntities, ODataEntitiesAnnotations } from '../responses';
12
- import { ODataModel, ODataCollection } from '../../models';
13
2
  import { ODataApi } from '../../api';
3
+ import { ODataCollection, ODataModel } from '../../models';
4
+ import { ODataStructuredType } from '../../schema/structured-type';
14
5
  import { QueryOptionNames } from '../../types';
6
+ import { ODataQueryOptions } from '../query';
7
+ import { ODataResource } from '../resource';
8
+ import { ODataEntities, ODataEntity } from '../responses';
9
+ import { ODataActionResource } from './action';
10
+ import { ODataCountResource } from './count';
11
+ import { ODataEntityResource } from './entity';
12
+ import { ODataFunctionResource } from './function';
13
+ import { ODataOptions } from './options';
15
14
  export declare class ODataEntitySetResource<T> extends ODataResource<T> {
16
- static factory<E>(api: ODataApi, path: string, type: string | undefined, segments: ODataPathSegments, query: ODataQueryOptions): ODataEntitySetResource<E>;
17
- clone(): ODataEntitySetResource<T>;
18
- schema(): import("angular-odata").ODataStructuredType<T> | undefined;
19
- asCollection<M extends ODataModel<T>, C extends ODataCollection<T, M>>(entities: Partial<T>[] | {
20
- [name: string]: any;
21
- }[], { annots, reset, }?: {
22
- annots?: ODataEntitiesAnnotations;
23
- reset?: boolean;
24
- }): C;
15
+ static factory<E>(api: ODataApi, { path, schema, query, }: {
16
+ path: string;
17
+ schema?: ODataStructuredType<E>;
18
+ query?: ODataQueryOptions<E>;
19
+ }): ODataEntitySetResource<E>;
25
20
  entity(key?: any): ODataEntityResource<T>;
26
- cast<C>(type: string): ODataEntitySetResource<C>;
27
21
  action<P, R>(path: string): ODataActionResource<P, R>;
28
22
  function<P, R>(path: string): ODataFunctionResource<P, R>;
29
- count(): ODataCountResource;
30
- select(opts: Select<T>): ODataEntitySetResource<T>;
31
- expand(opts: Expand<T>): ODataEntitySetResource<T>;
32
- transform(opts: Transform<T>): ODataEntitySetResource<T>;
33
- search(opts: string): ODataEntitySetResource<T>;
34
- filter(opts: Filter): ODataEntitySetResource<T>;
35
- orderBy(opts: OrderBy<T>): ODataEntitySetResource<T>;
36
- format(opts: string): ODataEntitySetResource<T>;
37
- top(opts: number): ODataEntitySetResource<T>;
38
- skip(opts: number): ODataEntitySetResource<T>;
39
- skiptoken(opts: string): ODataEntitySetResource<T>;
40
- get segment(): {
41
- entitySet(): import("../path-segments").SegmentHandler;
42
- keys(values?: (EntityKey<T> | undefined)[] | undefined): (EntityKey<any> | undefined)[];
43
- };
44
- get query(): {
45
- select(opts?: Select<T> | undefined): import("../query-options").OptionHandler<Select<T>>;
46
- expand(opts?: Expand<T> | undefined): import("../query-options").OptionHandler<Expand<T>>;
47
- compute(opts?: string | undefined): import("../query-options").OptionHandler<string>;
48
- transform(opts?: Transform<T> | undefined): import("../query-options").OptionHandler<Transform<T>>;
49
- search(opts?: string | undefined): import("../query-options").OptionHandler<string>;
50
- filter(opts?: Filter | undefined): import("../query-options").OptionHandler<Filter>;
51
- orderBy(opts?: OrderBy<T> | undefined): import("../query-options").OptionHandler<OrderBy<T>>;
52
- format(opts?: string | undefined): import("../query-options").OptionHandler<string>;
53
- top(opts?: number | undefined): import("../query-options").OptionHandler<number>;
54
- skip(opts?: number | undefined): import("../query-options").OptionHandler<number>;
55
- skiptoken(opts?: string | undefined): import("../query-options").OptionHandler<string>;
56
- paging({ skip, skiptoken, top, }?: {
57
- skip?: number | undefined;
58
- skiptoken?: string | undefined;
59
- top?: number | undefined;
60
- }): void;
61
- clearPaging(): void;
62
- apply(query: import("../query-options").QueryArguments<T>): void;
63
- };
64
- post(attrs: Partial<T>, options?: HttpOptions): Observable<ODataEntity<T>>;
65
- get(options?: HttpOptions & {
23
+ count(): ODataCountResource<T>;
24
+ cast<C>(type: string): ODataEntitySetResource<C>;
25
+ protected post(attrs: Partial<T>, options?: ODataOptions): Observable<ODataEntity<T>>;
26
+ protected get(options?: ODataOptions & {
66
27
  withCount?: boolean;
67
28
  bodyQueryOptions?: QueryOptionNames[];
68
29
  }): Observable<ODataEntities<T>>;
69
- fetch(options?: HttpOptions & {
30
+ create(attrs: Partial<T>, options?: ODataOptions): Observable<ODataEntity<T>>;
31
+ fetch(options?: ODataOptions & {
70
32
  withCount?: boolean;
71
33
  bodyQueryOptions?: QueryOptionNames[];
72
34
  }): Observable<ODataEntities<T>>;
73
- fetchEntities(options?: HttpOptions & {
35
+ fetchEntities(options?: ODataOptions & {
74
36
  withCount?: boolean;
75
37
  bodyQueryOptions?: QueryOptionNames[];
76
38
  }): Observable<T[] | null>;
77
- fetchCollection(options?: HttpOptions & {
39
+ fetchCollection<M extends ODataModel<T>, C extends ODataCollection<T, M>>(options?: ODataOptions & {
78
40
  withCount?: boolean;
79
41
  bodyQueryOptions?: QueryOptionNames[];
80
42
  }): Observable<ODataCollection<T, ODataModel<T>> | null>;
81
- fetchAll(options?: HttpOptions & {
43
+ fetchAll(options?: ODataOptions & {
82
44
  bodyQueryOptions?: QueryOptionNames[];
83
45
  }): Observable<T[]>;
84
46
  }
@@ -1,74 +1,66 @@
1
1
  import { Observable } from 'rxjs';
2
+ import { ODataApi } from '../../api';
3
+ import { ODataModel } from '../../models';
4
+ import { ODataStructuredType } from '../../schema/structured-type';
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';
2
10
  import { ODataActionResource } from './action';
3
11
  import { ODataFunctionResource } from './function';
12
+ import { ODataMediaResource } from './media';
4
13
  import { ODataNavigationPropertyResource } from './navigation-property';
14
+ import { ODataOptions } from './options';
5
15
  import { ODataPropertyResource } from './property';
6
- import { Expand, Select } from '../builder';
7
- import { ODataQueryOptions } from '../query-options';
8
- import { ODataPathSegments } from '../path-segments';
9
- import { EntityKey, ODataResource } from '../resource';
10
- import { HttpOptions } from './options';
11
- import { ODataMediaResource } from './media';
12
- import { ODataEntity, ODataEntityAnnotations } from '../responses';
13
- import { ODataModel } from '../../models';
14
- import { ODataApi } from '../../api';
15
- import { QueryOptionNames } from '../../types';
16
16
  export declare class ODataEntityResource<T> extends ODataResource<T> {
17
- static factory<E>(api: ODataApi, segments: ODataPathSegments, options: ODataQueryOptions): ODataEntityResource<E>;
18
- clone(): ODataEntityResource<T>;
19
- schema(): import("angular-odata").ODataStructuredType<T> | undefined;
20
- asModel<M extends ODataModel<T>>(entity: Partial<T> | {
21
- [name: string]: any;
22
- }, { annots, reset }?: {
23
- annots?: ODataEntityAnnotations;
24
- reset?: boolean;
25
- }): M;
17
+ static factory<E>(api: ODataApi, { schema, segments, query, }: {
18
+ schema?: ODataStructuredType<E>;
19
+ segments: ODataPathSegments;
20
+ query?: ODataQueryOptions<E>;
21
+ }): ODataEntityResource<E>;
26
22
  key(value: any): ODataEntityResource<T>;
27
23
  keys(values: any[]): ODataEntityResource<T>;
28
- media(): ODataMediaResource<T>;
24
+ media(): ODataMediaResource;
29
25
  navigationProperty<N>(path: string): ODataNavigationPropertyResource<N>;
30
26
  property<P>(path: string): ODataPropertyResource<P>;
31
27
  action<P, R>(path: string): ODataActionResource<P, R>;
32
28
  function<P, R>(path: string): ODataFunctionResource<P, R>;
33
29
  cast<C>(type: string): ODataEntityResource<C>;
34
- select(opts: Select<T>): ODataEntityResource<T>;
35
- expand(opts: Expand<T>): ODataEntityResource<T>;
36
- format(opts: string): ODataEntityResource<T>;
37
- get segment(): {
38
- entitySet(): import("../path-segments").SegmentHandler;
39
- keys(values?: (EntityKey<T> | undefined)[] | undefined): (EntityKey<any> | undefined)[];
40
- };
41
- get query(): {
42
- select(opts?: Select<T> | undefined): import("../query-options").OptionHandler<Select<T>>;
43
- expand(opts?: Expand<T> | undefined): import("../query-options").OptionHandler<Expand<T>>;
44
- compute(opts?: string | undefined): import("../query-options").OptionHandler<string>;
45
- format(opts?: string | undefined): import("../query-options").OptionHandler<string>;
46
- apply(query: import("../query-options").QueryArguments<T>): void;
47
- };
48
- get(options?: HttpOptions & {
30
+ protected post(attrs: Partial<T>, options?: ODataOptions): Observable<ODataEntity<T>>;
31
+ protected put(attrs: Partial<T>, options?: ODataOptions & {
32
+ etag?: string;
33
+ }): Observable<ODataEntity<T>>;
34
+ protected patch(attrs: Partial<T>, options?: ODataOptions & {
35
+ etag?: string;
36
+ }): Observable<ODataEntity<T>>;
37
+ protected delete(options?: ODataOptions & {
38
+ etag?: string;
39
+ }): Observable<any>;
40
+ protected get(options?: ODataOptions & {
49
41
  etag?: string;
50
42
  bodyQueryOptions?: QueryOptionNames[];
51
43
  }): Observable<ODataEntity<T>>;
52
- post(attrs: Partial<T>, options?: HttpOptions): Observable<ODataEntity<T>>;
53
- put(attrs: Partial<T>, options?: HttpOptions & {
44
+ create(attrs: Partial<T>, options?: ODataOptions): Observable<ODataEntity<T>>;
45
+ update(attrs: Partial<T>, options?: ODataOptions & {
54
46
  etag?: string;
55
47
  }): Observable<ODataEntity<T>>;
56
- patch(attrs: Partial<T>, options?: HttpOptions & {
48
+ modify(attrs: Partial<T>, options?: ODataOptions & {
57
49
  etag?: string;
58
50
  }): Observable<ODataEntity<T>>;
59
- delete(options?: HttpOptions & {
51
+ destroy(options?: ODataOptions & {
60
52
  etag?: string;
61
53
  }): Observable<any>;
62
- fetch(options?: HttpOptions & {
54
+ fetch(options?: ODataOptions & {
63
55
  etag?: string;
64
56
  bodyQueryOptions?: QueryOptionNames[];
65
57
  }): Observable<ODataEntity<T>>;
66
- fetchEntity(options?: HttpOptions & {
58
+ fetchEntity(options?: ODataOptions & {
67
59
  etag?: string;
68
60
  bodyQueryOptions?: QueryOptionNames[];
69
61
  }): Observable<T | null>;
70
- fetchModel(options?: HttpOptions & {
62
+ fetchModel<M extends ODataModel<T>>(options?: ODataOptions & {
71
63
  etag?: string;
72
64
  bodyQueryOptions?: QueryOptionNames[];
73
- }): Observable<ODataModel<T> | null>;
65
+ }): Observable<M | null>;
74
66
  }
@@ -1,100 +1,92 @@
1
1
  import { Observable } from 'rxjs';
2
- import { ODataPathSegments } from '../path-segments';
3
- import { ODataQueryOptions } from '../query-options';
4
- import { HttpEntityOptions, HttpEntitiesOptions, HttpPropertyOptions, HttpOptions, HttpNoneOptions } from './options';
5
- import { ODataEntity, ODataEntities, ODataProperty, ODataEntityAnnotations, ODataEntitiesAnnotations } from '../responses';
6
2
  import { ODataApi } from '../../api';
7
3
  import { ODataCollection } from '../../models/collection';
8
4
  import { ODataModel } from '../../models/model';
9
- import { Expand, Filter, OrderBy, Select, Transform } from '../builder';
5
+ import { ODataCallable } from '../../schema/callable';
6
+ import { ODataPathSegments } from '../path';
7
+ import { ODataQueryOptions } from '../query';
10
8
  import { ODataResource } from '../resource';
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("../../schema").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
- };
23
+ protected get(options?: ODataEntityOptions & ODataEntitiesOptions & ODataPropertyOptions): Observable<any>;
46
24
  /**
47
- * Handle query options of the function
48
- * @returns Handler for mutate the query of the function
25
+ * Execute the function
26
+ * @param params Parameters to be sent to the function
27
+ * @param alias If true, the parameters will be send using aliases
28
+ * @param options Options for the request
49
29
  */
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").QueryArguments<R>): void;
69
- };
70
- get(options?: HttpEntityOptions): Observable<ODataEntity<R>>;
71
- get(options?: HttpEntitiesOptions): Observable<ODataEntities<R>>;
72
- get(options?: HttpPropertyOptions): Observable<ODataProperty<R>>;
73
30
  call(params: P | null, options?: {
74
31
  alias?: boolean;
75
- } & HttpEntityOptions): Observable<ODataEntity<R>>;
32
+ } & ODataEntityOptions): Observable<ODataEntity<R>>;
76
33
  call(params: P | null, options?: {
77
34
  alias?: boolean;
78
- } & HttpEntitiesOptions): Observable<ODataEntities<R>>;
35
+ } & ODataEntitiesOptions): Observable<ODataEntities<R>>;
79
36
  call(params: P | null, options?: {
80
37
  alias?: boolean;
81
- } & HttpPropertyOptions): Observable<ODataProperty<R>>;
38
+ } & ODataPropertyOptions): Observable<ODataProperty<R>>;
82
39
  call(params: P | null, options?: {
83
40
  alias?: boolean;
84
- } & HttpNoneOptions): Observable<null>;
41
+ } & ODataNoneOptions): Observable<null>;
42
+ /**
43
+ * Execute the function with the given parameters and return the result as a property
44
+ * @param params Parameters to be sent to the function
45
+ * @param alias If true, the parameters will be send using aliases
46
+ * @param options Options for the request
47
+ * @returns Observable of the result of the function
48
+ */
85
49
  callProperty(params: P | null, { alias, ...options }?: {
86
50
  alias?: boolean;
87
- } & HttpOptions): Observable<R | null>;
51
+ } & ODataOptions): Observable<R | null>;
52
+ /**
53
+ * Execute the function with the given parameters and return the result as a entity
54
+ * @param params Parameters to be sent to the function
55
+ * @param alias If true, the parameters will be send using aliases
56
+ * @param options Options for the request
57
+ * @returns Observable of the result of the function
58
+ */
88
59
  callEntity(params: P | null, { alias, ...options }?: {
89
60
  alias?: boolean;
90
- } & HttpOptions): Observable<R | null>;
91
- callModel(params: P | null, { alias, ...options }?: {
61
+ } & ODataOptions): Observable<R | null>;
62
+ /**
63
+ * Execute the function with the given parameters and return the result as a model
64
+ * @param params Parameters to be sent to the function
65
+ * @param alias If true, the parameters will be send using aliases
66
+ * @param options Options for the request
67
+ * @returns Observable of the result of the function
68
+ */
69
+ callModel<M extends ODataModel<R>>(params: P | null, { alias, ...options }?: {
92
70
  alias?: boolean;
93
- } & HttpOptions): Observable<ODataModel<R> | null>;
71
+ } & ODataOptions): Observable<M | null>;
72
+ /**
73
+ * Execute the function with the given parameters and return the result as a entities
74
+ * @param params Parameters to be sent to the function
75
+ * @param alias If true, the parameters will be send using aliases
76
+ * @param options Options for the request
77
+ * @returns Observable of the result of the function
78
+ */
94
79
  callEntities(params: P | null, { alias, ...options }?: {
95
80
  alias?: boolean;
96
- } & HttpOptions): Observable<R[] | null>;
97
- callCollection(params: P | null, { alias, ...options }?: {
81
+ } & ODataOptions): Observable<R[] | null>;
82
+ /**
83
+ * Execute the function with the given parameters and return the result as a collection
84
+ * @param params Parameters to be sent to the function
85
+ * @param alias If true, the parameters will be send using aliases
86
+ * @param options Options for the request
87
+ * @returns Observable of the result of the function
88
+ */
89
+ callCollection<M extends ODataModel<R>, C extends ODataCollection<R, M>>(params: P | null, { alias, ...options }?: {
98
90
  alias?: boolean;
99
- } & HttpOptions): Observable<ODataCollection<R, ODataModel<R>> | null>;
91
+ } & ODataOptions): Observable<C | null>;
100
92
  }
@@ -1,37 +1,35 @@
1
1
  import { Observable } from 'rxjs';
2
- import { ODataResource } from '../resource';
3
- import { ODataPathSegments } from '../path-segments';
4
- import { ODataQueryOptions } from '../query-options';
5
- import { HttpOptions } from './options';
6
2
  import { ODataApi } from '../../api';
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;
11
- get(options?: {
12
- responseType: 'arraybuffer';
13
- } & HttpOptions): Observable<ArrayBuffer>;
14
- get(options?: {
15
- responseType: 'blob';
16
- } & HttpOptions): Observable<Blob>;
17
- put(data: ArrayBuffer | Blob, options?: HttpOptions & {
3
+ import { ODataPathSegments } from '../path';
4
+ import { ODataQueryOptions } from '../query';
5
+ import { ODataResource } from '../resource';
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;
12
+ protected get(options: {
13
+ responseType: any;
14
+ } & ODataOptions): Observable<any>;
15
+ protected put(data: ArrayBuffer | Blob, options?: ODataOptions & {
18
16
  etag?: string;
19
17
  }): Observable<any>;
20
18
  fetch(options?: {
21
19
  responseType: 'arraybuffer';
22
- } & HttpOptions): Observable<ArrayBuffer>;
20
+ } & ODataOptions): Observable<ArrayBuffer>;
23
21
  fetch(options?: {
24
22
  responseType: 'blob';
25
- } & HttpOptions): Observable<Blob>;
26
- fetchArraybuffer(options?: HttpOptions): Observable<ArrayBuffer>;
27
- fetchBlob(options?: HttpOptions): Observable<Blob>;
28
- upload(data: ArrayBuffer | Blob, options?: HttpOptions & {
23
+ } & ODataOptions): Observable<Blob>;
24
+ fetchArraybuffer(options?: ODataOptions): Observable<ArrayBuffer>;
25
+ fetchBlob(options?: ODataOptions): Observable<Blob>;
26
+ upload(data: ArrayBuffer | Blob, options?: ODataOptions & {
29
27
  etag?: string;
30
28
  }): Observable<any>;
31
- uploadArrayBuffer(data: ArrayBuffer, contentType: string, options?: HttpOptions & {
29
+ uploadArrayBuffer(data: ArrayBuffer, contentType: string, options?: ODataOptions & {
32
30
  etag?: string;
33
31
  }): Observable<any>;
34
- uploadBlob(data: Blob, options?: HttpOptions & {
32
+ uploadBlob(data: Blob, options?: ODataOptions & {
35
33
  etag?: string;
36
34
  }): Observable<any>;
37
35
  }
@@ -1,14 +1,12 @@
1
1
  import { Observable } from 'rxjs';
2
+ import { ODataApi } from '../../api';
3
+ import { ODataPathSegments } from '../path';
2
4
  import { ODataResource } from '../resource';
3
- import { ODataPathSegments } from '../path-segments';
4
- import { HttpOptions } from './options';
5
5
  import { ODataMetadata } from '../responses';
6
- import { ODataApi } from '../../api';
6
+ import { ODataOptions } from './options';
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
- get(options?: HttpOptions): Observable<ODataMetadata>;
13
- fetch(options?: HttpOptions): Observable<ODataMetadata>;
10
+ protected get(options?: ODataOptions): Observable<ODataMetadata>;
11
+ fetch(options?: ODataOptions): Observable<ODataMetadata>;
14
12
  }