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,12 +1,10 @@
1
- import { JsonSchemaOptions, ODataEntityTypeKey, ODataStructuredTypeFieldParser, ODataStructuredTypeParser } from '../parsers';
2
- import { Options, StructuredTypeConfig } from '../types';
3
- import { ODataAnnotation } from './annotation';
4
1
  import { ODataCollection } from '../models';
5
2
  import { ODataModel } from '../models/model';
3
+ import { Options, StructuredTypeConfig } from '../types';
4
+ import { ODataSchemaElement } from './element';
5
+ import { JsonSchemaOptions, ODataEntityTypeKey, ODataStructuredTypeFieldParser, ODataStructuredTypeParser } from './parsers';
6
6
  import { ODataSchema } from './schema';
7
- export declare class ODataStructuredType<T> {
8
- name: string;
9
- schema: ODataSchema;
7
+ export declare class ODataStructuredType<T> extends ODataSchemaElement {
10
8
  base?: string;
11
9
  open: boolean;
12
10
  parent?: ODataStructuredType<any>;
@@ -14,27 +12,17 @@ export declare class ODataStructuredType<T> {
14
12
  model?: typeof ODataModel;
15
13
  collection?: typeof ODataCollection;
16
14
  parser: ODataStructuredTypeParser<T>;
17
- annotations: ODataAnnotation[];
18
15
  constructor(config: StructuredTypeConfig<T>, schema: ODataSchema);
19
- get api(): import("angular-odata").ODataApi;
20
16
  configure({ parserForType, findOptionsForType, }: {
21
17
  parserForType: (type: string) => any;
22
18
  findOptionsForType: (type: string) => any;
23
19
  }): void;
24
20
  /**
25
- * Returns a full type of the structured type including the namespace/alias.
26
- * @param alias Use the alias of the namespace instead of the namespace.
27
- * @returns The string representation of the type.
28
- */
29
- type({ alias }?: {
30
- alias?: boolean;
31
- }): string;
32
- /**
33
- * Returns a boolean indicating if the structured type is of the given type.
21
+ * Returns a boolean indicating if the structured type is a sub type of the given type.
34
22
  * @param type String representation of the type
35
23
  * @returns True if the callable is type of the given type
36
24
  */
37
- isTypeOf(type: string): boolean;
25
+ isSubtypeOf(schema: ODataStructuredType<any>): boolean;
38
26
  /**
39
27
  * Returns a boolean indicating if the structured type has a simple key.
40
28
  * @returns True if the structured type has a simple key
@@ -46,20 +34,50 @@ export declare class ODataStructuredType<T> {
46
34
  */
47
35
  isCompoundKey(): boolean;
48
36
  /**
49
- * Find an annotation inside the structured type
50
- * @param predicate Function that returns true if the annotation match.
51
- * @returns The annotation that matches the predicate.
37
+ * Find the field parser for the given field name.
38
+ * @param name Name of the field
39
+ * @returns The field parser
52
40
  */
53
- findAnnotation(predicate: (annot: ODataAnnotation) => boolean): ODataAnnotation | undefined;
54
- field(name: keyof T): ODataStructuredTypeFieldParser<any> | undefined;
55
- fields({ include_navigation, include_parents, }?: {
56
- include_parents?: boolean;
57
- include_navigation?: boolean;
41
+ findFieldByName<F>(name: keyof T): ODataStructuredTypeFieldParser<F> | undefined;
42
+ /**
43
+ * Find a parent schema of the structured type.
44
+ * @param predicate Function for evaluate the schemas in the hierarchy.
45
+ * @returns The schema that matches the predicate.
46
+ */
47
+ findParentSchema(predicate: (p: ODataStructuredType<any>) => boolean): ODataStructuredType<any> | undefined;
48
+ /**
49
+ * Find a parent schema of the structured type for the given field.
50
+ * @param field Field that belongs to the structured type
51
+ * @returns The schema of the field
52
+ */
53
+ findSchemaForField<E>(field: ODataStructuredTypeFieldParser<any>): ODataStructuredType<E>;
54
+ /**
55
+ * Returns all fields of the structured type.
56
+ * @param include_navigation Include navigation properties in the result.
57
+ * @param include_parents Include the parent types in the result.
58
+ * @returns All fields of the structured type.
59
+ */
60
+ fields({ include_navigation, include_parents, }: {
61
+ include_parents: boolean;
62
+ include_navigation: boolean;
58
63
  }): ODataStructuredTypeFieldParser<any>[];
64
+ /**
65
+ * Returns the keys of the structured type.
66
+ * @param include_parents Include the parent fields
67
+ * @returns The keys of the structured type
68
+ */
59
69
  keys({ include_parents, }?: {
60
70
  include_parents?: boolean;
61
71
  }): ODataEntityTypeKey[];
62
- pick(value: {
72
+ /**
73
+ * Picks the fields from attributes.
74
+ * @param attrs
75
+ * @param include_parents Include the parent fields
76
+ * @param include_navigation Include the navigation fields
77
+ * @param include_etag Include the etag field
78
+ * @returns The picked fields
79
+ */
80
+ pick(attrs: {
63
81
  [name: string]: any;
64
82
  }, { include_parents, include_navigation, include_etag, }?: {
65
83
  include_parents?: boolean;
@@ -87,13 +105,33 @@ export declare class ODataStructuredType<T> {
87
105
  * @returns Encoded value
88
106
  */
89
107
  encode(value: T, options?: Options): any;
108
+ /**
109
+ * Resolve the key of the structured type for the given value.
110
+ * @param attrs Attributes of the value
111
+ * @returns Resolved key
112
+ */
90
113
  resolveKey(attrs: T | {
91
114
  [name: string]: any;
92
115
  }): any;
116
+ /**
117
+ * Returns the defaults values for the structured type.
118
+ * @returns Default values for the structured type
119
+ */
93
120
  defaults(): {
94
121
  [name: string]: any;
95
122
  };
123
+ /**
124
+ * Convert the structured type to json schema
125
+ * @param options Options for json schema
126
+ * @returns Json Schema
127
+ */
96
128
  toJsonSchema(options?: JsonSchemaOptions<T>): any;
129
+ /**
130
+ * Validate the given value against the structured type.
131
+ * @param attrs Attributes of the value
132
+ * @param method Method to use for the process validation
133
+ * @returns Object with the errors
134
+ */
97
135
  validate(attrs: Partial<T>, { method, navigation, }?: {
98
136
  method?: 'create' | 'update' | 'modify';
99
137
  navigation?: boolean;
@@ -1,6 +1,6 @@
1
- import { ODataActionResource, ODataEntities, ODataEntity, ODataFunctionResource, ODataNavigationPropertyResource, ODataProperty, ODataQueryArgumentsOptions } from '../resources';
2
- import { ODataClient } from '../client';
3
1
  import { Observable } from 'rxjs';
2
+ import { ODataClient } from '../client';
3
+ import { ODataActionResource, ODataEntities, ODataEntity, ODataFunctionResource, ODataNavigationPropertyResource, ODataProperty, ODataQueryArgumentsOptions } from '../resources';
4
4
  export declare abstract class ODataBaseService {
5
5
  protected client: ODataClient;
6
6
  protected name: string;
@@ -1,8 +1,8 @@
1
- import { EntityKey, ODataEntities, ODataEntity, ODataEntityResource, ODataEntitySetResource, ODataOptions } from '../resources';
2
1
  import { Observable } from 'rxjs';
3
2
  import { ODataCollection } from '../models/collection';
4
- import { ODataEntityService } from './entity';
5
3
  import { ODataModel } from '../models/model';
4
+ import { EntityKey, ODataEntities, ODataEntity, ODataEntityResource, ODataEntitySetResource, ODataOptions } from '../resources';
5
+ import { ODataEntityService } from './entity';
6
6
  export declare class ODataEntitySetService<T> extends ODataEntityService<T> {
7
7
  /**
8
8
  * Get the entity set resource for this service.
@@ -19,6 +19,9 @@ export declare class ODataEntitySetService<T> extends ODataEntityService<T> {
19
19
  */
20
20
  attach<M extends ODataModel<T>>(model: M): void;
21
21
  attach<C extends ODataCollection<T, ODataModel<T>>>(model: C): void;
22
+ /**
23
+ * The schema for the entity set.
24
+ */
22
25
  get entitySetSchema(): import("angular-odata").ODataEntitySet | undefined;
23
26
  /**
24
27
  * Get all entities from the entity set.
@@ -1,8 +1,11 @@
1
+ import { ODataModel } from '../models/model';
1
2
  import { EntityKey, ODataResource } from '../resources';
2
3
  import { ODataBaseService } from './base';
3
- import { ODataModel } from '../models/model';
4
4
  export declare abstract class ODataEntityService<T> extends ODataBaseService {
5
5
  abstract entity(key?: EntityKey<T>): ODataResource<T>;
6
6
  abstract attach<M extends ODataModel<T>>(value: M): void;
7
+ /**
8
+ * The schema for the structured type.
9
+ */
7
10
  get structuredTypeSchema(): import("angular-odata").ODataStructuredType<T> | undefined;
8
11
  }
@@ -1,7 +1,7 @@
1
+ import { Observable } from 'rxjs';
2
+ import type { ODataModel } from '../models/model';
1
3
  import type { ODataEntity, ODataOptions, ODataSingletonResource } from '../resources';
2
4
  import { ODataEntityService } from './entity';
3
- import type { ODataModel } from '../models/model';
4
- import { Observable } from 'rxjs';
5
5
  /**
6
6
  * OData Singleton Service
7
7
  * www.odata.org/getting-started/advanced-tutorial/#singleton
@@ -17,6 +17,9 @@ export declare class ODataSingletonService<T> extends ODataEntityService<T> {
17
17
  * @param model The model to attach.
18
18
  */
19
19
  attach<M extends ODataModel<T>>(model: M): void;
20
+ /**
21
+ * The schema for the singleton.
22
+ */
20
23
  get singletonSchema(): import("angular-odata").ODataEntitySet | undefined;
21
24
  /**
22
25
  * Update the singleton entity
package/lib/settings.d.ts CHANGED
@@ -1,10 +1,10 @@
1
- import { ApiConfig, Parser } from './types';
2
- import { ODataCallable, ODataEntitySet, ODataEnumType, ODataStructuredType } from './schema';
3
- import { ODataCollection, ODataModel } from './models';
1
+ import { Observable } from 'rxjs';
4
2
  import { ODataApi } from './api';
5
- import { ODataEntityService } from './services/entity';
3
+ import { ODataCollection, ODataModel } from './models';
6
4
  import { ODataRequest } from './resources';
7
- import { Observable } from 'rxjs';
5
+ import { ODataCallable, ODataEntitySet, ODataEnumType, ODataStructuredType } from './schema';
6
+ import { ODataEntityService } from './services/entity';
7
+ import { ApiConfig, Parser } from './types';
8
8
  export declare class ODataSettings {
9
9
  apis: ODataApi[];
10
10
  constructor(...configs: ApiConfig[]);
package/lib/types.d.ts CHANGED
@@ -63,6 +63,7 @@ export interface ApiOptions extends Options {
63
63
  stripMetadata?: ODataMetadataType;
64
64
  fetchPolicy?: FetchPolicy;
65
65
  bodyQueryOptions?: QueryOptionNames[];
66
+ deleteRefBy?: 'path' | 'id';
66
67
  }
67
68
  export interface OptionsHelper extends Options {
68
69
  helper: ODataVersionHelper;
@@ -0,0 +1,4 @@
1
+ export declare const ArrayBuffers: {
2
+ toArrayBuffer(v: string): ArrayBuffer;
3
+ toString(v: ArrayBuffer): string;
4
+ };
@@ -1,4 +1,3 @@
1
- import { Parser } from '../types';
2
1
  export declare type Duration = {
3
2
  sign?: 1 | -1;
4
3
  years?: number;
@@ -9,6 +8,7 @@ export declare type Duration = {
9
8
  minutes?: number;
10
9
  seconds?: number;
11
10
  };
12
- export declare const EDM_PARSERS: {
13
- [type: string]: Parser<any>;
11
+ export declare const Durations: {
12
+ toDuration(v: string): Duration;
13
+ toString(v: Duration): string;
14
14
  };
@@ -7,6 +7,7 @@ export declare const Http: {
7
7
  [param: string]: string | string[];
8
8
  })[]): HttpParams;
9
9
  splitHttpParams(params: HttpParams, keys: string[]): [HttpParams, HttpParams];
10
+ withoutHttpParams(params: HttpParams, keys: string[]): HttpParams;
10
11
  resolveHeaderKey(headers: HttpHeaders | {
11
12
  [param: string]: string | string[];
12
13
  }, options: string[]): string | undefined;
@@ -1,4 +1,5 @@
1
1
  export * from './dates';
2
+ export * from './durations';
2
3
  export * from './enums';
3
4
  export * from './http';
4
5
  export * from './objects';
@@ -19,4 +19,5 @@ export declare const Objects: {
19
19
  resolveKey(key: any, { single }?: {
20
20
  single?: boolean | undefined;
21
21
  }): any;
22
+ clone(target: any, map?: WeakMap<object, any> | undefined): any;
22
23
  };
@@ -1,3 +1,4 @@
1
1
  export declare const Strings: {
2
2
  uniqueId(prefix?: string | undefined, suffix?: string | undefined): string;
3
+ titleCase(text: string): string;
3
4
  };
@@ -1,8 +1,10 @@
1
1
  export declare const Types: {
2
+ rawType(value: any): string;
2
3
  isObject(value: any): boolean;
3
4
  isPlainObject(value: any): boolean;
4
5
  isFunction(value: any): boolean;
5
6
  isArray(value: any): boolean;
6
7
  isEmpty(value: any): boolean;
7
8
  isEqual(value1: any, value2: any): boolean;
9
+ clone(target: any): any;
8
10
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "angular-odata",
3
- "version": "0.80.0",
3
+ "version": "0.99.0",
4
4
  "license": "MIT",
5
5
  "description": "Client side OData typescript library for Angular",
6
6
  "repository": {
@@ -25,17 +25,30 @@
25
25
  "homepage": "https://github.com/diegomvh/angular-odata",
26
26
  "private": false,
27
27
  "peerDependencies": {
28
- "@angular/common": "^12.2.0",
29
- "@angular/core": "^12.2.0"
28
+ "@angular/common": "^13.1.0",
29
+ "@angular/core": "^13.1.0"
30
30
  },
31
31
  "dependencies": {
32
32
  "tslib": "^2.3.0"
33
33
  },
34
- "main": "bundles/angular-odata.umd.js",
35
- "module": "fesm2015/angular-odata.js",
36
- "es2015": "fesm2015/angular-odata.js",
37
- "esm2015": "esm2015/angular-odata.js",
38
- "fesm2015": "fesm2015/angular-odata.js",
34
+ "module": "fesm2015/angular-odata.mjs",
35
+ "es2020": "fesm2020/angular-odata.mjs",
36
+ "esm2020": "esm2020/angular-odata.mjs",
37
+ "fesm2020": "fesm2020/angular-odata.mjs",
38
+ "fesm2015": "fesm2015/angular-odata.mjs",
39
39
  "typings": "angular-odata.d.ts",
40
+ "exports": {
41
+ "./package.json": {
42
+ "default": "./package.json"
43
+ },
44
+ ".": {
45
+ "types": "./angular-odata.d.ts",
46
+ "esm2020": "./esm2020/angular-odata.mjs",
47
+ "es2020": "./fesm2020/angular-odata.mjs",
48
+ "es2015": "./fesm2015/angular-odata.mjs",
49
+ "node": "./fesm2015/angular-odata.mjs",
50
+ "default": "./fesm2020/angular-odata.mjs"
51
+ }
52
+ },
40
53
  "sideEffects": false
41
54
  }