angular-odata 0.90.0 → 0.99.2

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 (223) hide show
  1. package/README.md +31 -25
  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 +757 -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 +956 -0
  16. package/{esm2015/lib/module.js → esm2020/lib/module.mjs} +7 -7
  17. package/esm2020/lib/options.mjs +32 -0
  18. package/{esm2015/lib/resources/index.js → esm2020/lib/resources/index.mjs} +0 -0
  19. package/{esm2015/lib/resources/path/handlers.js → esm2020/lib/resources/path/handlers.mjs} +1 -1
  20. package/{esm2015/lib/resources/path/index.js → esm2020/lib/resources/path/index.mjs} +0 -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/{esm2015/lib/resources/query/index.js → esm2020/lib/resources/query/index.mjs} +0 -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 +318 -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 +104 -0
  56. package/esm2020/lib/resources/types/batch.mjs +314 -0
  57. package/esm2020/lib/resources/types/count.mjs +30 -0
  58. package/esm2020/lib/resources/types/entity-set.mjs +97 -0
  59. package/esm2020/lib/resources/types/entity.mjs +109 -0
  60. package/esm2020/lib/resources/types/function.mjs +140 -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 +44 -0
  63. package/esm2020/lib/resources/types/metadata.mjs +33 -0
  64. package/esm2020/lib/resources/types/navigation-property.mjs +229 -0
  65. package/esm2020/lib/resources/types/options.mjs +2 -0
  66. package/esm2020/lib/resources/types/property.mjs +186 -0
  67. package/esm2020/lib/resources/types/reference.mjs +88 -0
  68. package/esm2020/lib/resources/types/singleton.mjs +129 -0
  69. package/esm2020/lib/resources/types/value.mjs +44 -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 +61 -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 +207 -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/{esm2015/lib/services/singleton.js → esm2020/lib/services/singleton.mjs} +1 -1
  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/{esm2015/lib/utils/arraybuffers.js → esm2020/lib/utils/arraybuffers.mjs} +0 -0
  94. package/{esm2015/lib/utils/dates.js → esm2020/lib/utils/dates.mjs} +0 -0
  95. package/{esm2015/lib/utils/durations.js → esm2020/lib/utils/durations.mjs} +0 -0
  96. package/{esm2015/lib/utils/enums.js → esm2020/lib/utils/enums.mjs} +0 -0
  97. package/{esm2015/lib/utils/http.js → esm2020/lib/utils/http.mjs} +0 -0
  98. package/{esm2015/lib/utils/index.js → esm2020/lib/utils/index.mjs} +0 -0
  99. package/{esm2015/lib/utils/objects.js → esm2020/lib/utils/objects.mjs} +13 -13
  100. package/esm2020/lib/utils/odata.mjs +22 -0
  101. package/esm2020/lib/utils/strings.mjs +20 -0
  102. package/{esm2015/lib/utils/types.js → esm2020/lib/utils/types.mjs} +0 -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} +3427 -2872
  106. package/fesm2015/angular-odata.mjs.map +1 -0
  107. package/fesm2020/angular-odata.mjs +10589 -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 +3 -3
  113. package/lib/constants.d.ts +5 -2
  114. package/lib/index.d.ts +0 -1
  115. package/lib/models/collection.d.ts +21 -21
  116. package/lib/models/model.d.ts +34 -22
  117. package/lib/models/options.d.ts +26 -29
  118. package/lib/module.d.ts +1 -1
  119. package/lib/options.d.ts +1 -0
  120. package/lib/resources/path/segments.d.ts +2 -2
  121. package/lib/resources/query/builder.d.ts +7 -3
  122. package/lib/resources/query/expressions/base.d.ts +19 -0
  123. package/lib/resources/query/expressions/compute.d.ts +26 -0
  124. package/lib/resources/query/expressions/expand.d.ts +40 -0
  125. package/lib/resources/query/expressions/filter.d.ts +58 -0
  126. package/lib/resources/query/expressions/index.d.ts +6 -0
  127. package/lib/resources/query/expressions/orderby.d.ts +37 -0
  128. package/lib/resources/query/expressions/search.d.ts +47 -0
  129. package/lib/resources/query/expressions/select.d.ts +21 -0
  130. package/lib/resources/query/{syntax.d.ts → expressions/syntax.d.ts} +74 -55
  131. package/lib/resources/query/handlers.d.ts +30 -19
  132. package/lib/resources/query/options.d.ts +3 -3
  133. package/lib/resources/request.d.ts +1 -1
  134. package/lib/resources/resource.d.ts +30 -12
  135. package/lib/resources/types/action.d.ts +12 -18
  136. package/lib/resources/types/batch.d.ts +10 -2
  137. package/lib/resources/types/count.d.ts +6 -4
  138. package/lib/resources/types/entity-set.d.ts +11 -14
  139. package/lib/resources/types/entity.d.ts +13 -15
  140. package/lib/resources/types/function.d.ts +11 -17
  141. package/lib/resources/types/media.d.ts +8 -6
  142. package/lib/resources/types/metadata.d.ts +3 -4
  143. package/lib/resources/types/navigation-property.d.ts +17 -22
  144. package/lib/resources/types/property.d.ts +13 -18
  145. package/lib/resources/types/reference.d.ts +41 -7
  146. package/lib/resources/types/singleton.d.ts +12 -15
  147. package/lib/resources/types/value.d.ts +9 -4
  148. package/lib/schema/annotation.d.ts +18 -0
  149. package/lib/schema/callable.d.ts +4 -20
  150. package/lib/schema/element.d.ts +45 -0
  151. package/lib/schema/entity-container.d.ts +2 -12
  152. package/lib/schema/entity-set.d.ts +2 -18
  153. package/lib/schema/enum-type.d.ts +3 -34
  154. package/lib/schema/index.d.ts +1 -0
  155. package/lib/{parsers → schema/parsers}/callable.d.ts +1 -1
  156. package/lib/{parsers → schema/parsers}/edm.d.ts +1 -1
  157. package/lib/{parsers → schema/parsers}/enum-type.d.ts +12 -11
  158. package/lib/{parsers → schema/parsers}/index.d.ts +0 -0
  159. package/lib/{parsers → schema/parsers}/structured-type.d.ts +12 -12
  160. package/lib/schema/schema.d.ts +3 -10
  161. package/lib/schema/structured-type.d.ts +12 -24
  162. package/lib/services/base.d.ts +2 -2
  163. package/lib/services/entity-set.d.ts +2 -2
  164. package/lib/services/entity.d.ts +1 -1
  165. package/lib/services/singleton.d.ts +2 -2
  166. package/lib/settings.d.ts +5 -5
  167. package/lib/types.d.ts +1 -0
  168. package/lib/utils/strings.d.ts +1 -0
  169. package/package.json +21 -8
  170. package/bundles/angular-odata.umd.js +0 -11694
  171. package/bundles/angular-odata.umd.js.map +0 -1
  172. package/esm2015/lib/api.js +0 -297
  173. package/esm2015/lib/client.js +0 -272
  174. package/esm2015/lib/helper.js +0 -271
  175. package/esm2015/lib/index.js +0 -21
  176. package/esm2015/lib/models/collection.js +0 -717
  177. package/esm2015/lib/models/model.js +0 -419
  178. package/esm2015/lib/models/options.js +0 -924
  179. package/esm2015/lib/options.js +0 -31
  180. package/esm2015/lib/parsers/callable.js +0 -107
  181. package/esm2015/lib/parsers/edm.js +0 -95
  182. package/esm2015/lib/parsers/enum-type.js +0 -102
  183. package/esm2015/lib/parsers/index.js +0 -5
  184. package/esm2015/lib/parsers/structured-type.js +0 -388
  185. package/esm2015/lib/resources/path/segments.js +0 -121
  186. package/esm2015/lib/resources/query/builder.js +0 -544
  187. package/esm2015/lib/resources/query/expressions.js +0 -194
  188. package/esm2015/lib/resources/query/handlers.js +0 -192
  189. package/esm2015/lib/resources/query/options.js +0 -103
  190. package/esm2015/lib/resources/query/syntax.js +0 -349
  191. package/esm2015/lib/resources/request.js +0 -168
  192. package/esm2015/lib/resources/resource.js +0 -243
  193. package/esm2015/lib/resources/responses/annotations.js +0 -121
  194. package/esm2015/lib/resources/responses/metadata.js +0 -548
  195. package/esm2015/lib/resources/types/action.js +0 -105
  196. package/esm2015/lib/resources/types/batch.js +0 -294
  197. package/esm2015/lib/resources/types/count.js +0 -33
  198. package/esm2015/lib/resources/types/entity-set.js +0 -101
  199. package/esm2015/lib/resources/types/entity.js +0 -137
  200. package/esm2015/lib/resources/types/function.js +0 -130
  201. package/esm2015/lib/resources/types/media.js +0 -47
  202. package/esm2015/lib/resources/types/metadata.js +0 -36
  203. package/esm2015/lib/resources/types/navigation-property.js +0 -205
  204. package/esm2015/lib/resources/types/options.js +0 -2
  205. package/esm2015/lib/resources/types/property.js +0 -151
  206. package/esm2015/lib/resources/types/reference.js +0 -73
  207. package/esm2015/lib/resources/types/singleton.js +0 -167
  208. package/esm2015/lib/resources/types/value.js +0 -35
  209. package/esm2015/lib/schema/annotation.js +0 -7
  210. package/esm2015/lib/schema/callable.js +0 -82
  211. package/esm2015/lib/schema/entity-container.js +0 -22
  212. package/esm2015/lib/schema/entity-set.js +0 -33
  213. package/esm2015/lib/schema/enum-type.js +0 -126
  214. package/esm2015/lib/schema/schema.js +0 -60
  215. package/esm2015/lib/schema/structured-type.js +0 -217
  216. package/esm2015/lib/services/base.js +0 -23
  217. package/esm2015/lib/services/entity-set.js +0 -146
  218. package/esm2015/lib/services/entity.js +0 -12
  219. package/esm2015/lib/types.js +0 -37
  220. package/esm2015/lib/utils/odata.js +0 -21
  221. package/esm2015/lib/utils/strings.js +0 -13
  222. package/fesm2015/angular-odata.js.map +0 -1
  223. package/lib/resources/query/expressions.d.ts +0 -50
@@ -1,18 +1,12 @@
1
- import { ODataAnnotation } from '../schema/annotation';
2
- import { EnumTypeConfig, Parser, OptionsHelper, EnumTypeFieldConfig, Options } from '../types';
3
- export declare class ODataEnumTypeFieldParser {
1
+ import { EnumTypeConfig, EnumTypeFieldConfig, Options, OptionsHelper, Parser } from '../../types';
2
+ import { ODataAnnotatable } from '../annotation';
3
+ export declare class ODataEnumTypeFieldParser extends ODataAnnotatable {
4
4
  name: string;
5
5
  value: number;
6
- annotations: ODataAnnotation[];
7
6
  constructor(name: string, field: EnumTypeFieldConfig);
8
- /**
9
- * Find an annotation inside the enum field.
10
- * @param predicate Function that returns true if the annotation match.
11
- * @returns The annotation that matches the predicate.
12
- */
13
- findAnnotation(predicate: (annot: ODataAnnotation) => boolean): ODataAnnotation | undefined;
7
+ titleize(term?: string | RegExp): string;
14
8
  }
15
- export declare class ODataEnumTypeParser<T> implements Parser<T> {
9
+ export declare class ODataEnumTypeParser<T> extends ODataAnnotatable implements Parser<T> {
16
10
  name: string;
17
11
  namespace: string;
18
12
  alias?: string;
@@ -25,6 +19,13 @@ export declare class ODataEnumTypeParser<T> implements Parser<T> {
25
19
  fields: ODataEnumTypeFieldParser[];
26
20
  optionsHelper?: OptionsHelper;
27
21
  constructor(config: EnumTypeConfig<T>, namespace: string, alias?: string);
22
+ /**
23
+ * Create a nicer looking title.
24
+ * Titleize is meant for creating pretty output.
25
+ * @param term The term of the annotation to find.
26
+ * @returns The titleized string.
27
+ */
28
+ ttitelize(term?: string | RegExp): string;
28
29
  configure({ options }: {
29
30
  options: OptionsHelper;
30
31
  }): void;
File without changes
@@ -1,6 +1,6 @@
1
- import { Parser, StructuredTypeFieldConfig, StructuredTypeConfig, OptionsHelper, Options } from '../types';
1
+ import { Options, OptionsHelper, Parser, StructuredTypeConfig, StructuredTypeFieldConfig } from '../../types';
2
+ import { ODataAnnotatable } from '../annotation';
2
3
  import { ODataEnumTypeParser } from './enum-type';
3
- import { ODataAnnotation } from '../schema/annotation';
4
4
  declare type JsonSchemaSelect<T> = Array<keyof T>;
5
5
  declare type JsonSchemaCustom<T> = {
6
6
  [P in keyof T]?: (schema: any, field: ODataStructuredTypeFieldParser<T[P]>) => any;
@@ -33,7 +33,7 @@ export declare class ODataReferential {
33
33
  referencedProperty: string;
34
34
  });
35
35
  }
36
- export declare class ODataStructuredTypeFieldParser<T> implements Parser<T> {
36
+ export declare class ODataStructuredTypeFieldParser<T> extends ODataAnnotatable implements Parser<T> {
37
37
  name: string;
38
38
  private structuredType;
39
39
  type: string;
@@ -46,15 +46,8 @@ export declare class ODataStructuredTypeFieldParser<T> implements Parser<T> {
46
46
  precision?: number;
47
47
  scale?: number;
48
48
  referentials: ODataReferential[];
49
- annotations: ODataAnnotation[];
50
49
  optionsHelper?: OptionsHelper;
51
50
  constructor(name: string, structuredType: ODataStructuredTypeParser<any>, field: StructuredTypeFieldConfig);
52
- /**
53
- * Find an annotation inside the structured field type.
54
- * @param predicate Function that returns true if the annotation match.
55
- * @returns The annotation that matches the predicate.
56
- */
57
- findAnnotation(predicate: (annot: ODataAnnotation) => boolean): ODataAnnotation | undefined;
58
51
  validate(value: any, { method, navigation, }?: {
59
52
  method?: 'create' | 'update' | 'modify';
60
53
  navigation?: boolean;
@@ -81,7 +74,7 @@ export declare class ODataStructuredTypeFieldParser<T> implements Parser<T> {
81
74
  isStructuredType(): boolean;
82
75
  structured(): ODataStructuredTypeParser<T>;
83
76
  }
84
- export declare class ODataStructuredTypeParser<T> implements Parser<T> {
77
+ export declare class ODataStructuredTypeParser<T> extends ODataAnnotatable implements Parser<T> {
85
78
  name: string;
86
79
  namespace: string;
87
80
  open: boolean;
@@ -93,8 +86,15 @@ export declare class ODataStructuredTypeParser<T> implements Parser<T> {
93
86
  fields: ODataStructuredTypeFieldParser<any>[];
94
87
  optionsHelper?: OptionsHelper;
95
88
  constructor(config: StructuredTypeConfig<T>, namespace: string, alias?: string);
89
+ /**
90
+ * Create a nicer looking title.
91
+ * Titleize is meant for creating pretty output.
92
+ * @param term The term of the annotation to find.
93
+ * @returns The titleized string.
94
+ */
95
+ titleize(term?: string | RegExp): string;
96
96
  isTypeOf(type: string): boolean;
97
- typeFor(name: string): string | undefined;
97
+ isSubtypeOf(type: string): boolean;
98
98
  findChildParser(predicate: (p: ODataStructuredTypeParser<any>) => boolean): ODataStructuredTypeParser<any> | undefined;
99
99
  childParser(predicate: (p: ODataStructuredTypeParser<any>) => boolean): Parser<any>;
100
100
  deserialize(value: any, options?: Options): T;
@@ -1,12 +1,12 @@
1
- import { Parser, SchemaConfig } from '../types';
2
- import { ODataAnnotation } from './annotation';
3
1
  import { ODataApi } from '../api';
2
+ import { Parser, SchemaConfig } from '../types';
3
+ import { ODataAnnotatable } from './annotation';
4
4
  import { ODataCallable } from './callable';
5
5
  import { ODataEntityContainer } from './entity-container';
6
6
  import { ODataEntitySet } from './entity-set';
7
7
  import { ODataEnumType } from './enum-type';
8
8
  import { ODataStructuredType } from './structured-type';
9
- export declare class ODataSchema {
9
+ export declare class ODataSchema extends ODataAnnotatable {
10
10
  api: ODataApi;
11
11
  namespace: string;
12
12
  alias?: string;
@@ -14,16 +14,9 @@ export declare class ODataSchema {
14
14
  entities: ODataStructuredType<any>[];
15
15
  callables: ODataCallable<any>[];
16
16
  containers: ODataEntityContainer[];
17
- annotations: ODataAnnotation[];
18
17
  constructor(config: SchemaConfig, api: ODataApi);
19
18
  isNamespaceOf(type: string): boolean | "" | undefined;
20
19
  get entitySets(): ODataEntitySet[];
21
- /**
22
- * Find an annotation inside the schema.
23
- * @param predicate Function that returns true if the annotation match.
24
- * @returns The annotation that matches the predicate.
25
- */
26
- findAnnotation(predicate: (annot: ODataAnnotation) => boolean): ODataAnnotation | undefined;
27
20
  findEnumTypeForType<T>(type: string): ODataEnumType<T> | undefined;
28
21
  findStructuredTypeForType<T>(type: string): ODataStructuredType<T> | undefined;
29
22
  findCallableForType<T>(type: string, bindingType?: string): ODataCallable<T> | undefined;
@@ -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,23 @@ 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.
21
+ * Returns a boolean indicating if the structured type is a subtype of the given type.
22
+ * @param type String representation of the type
23
+ * @returns True if the callable is type of the given type
28
24
  */
29
- type({ alias }?: {
30
- alias?: boolean;
31
- }): string;
25
+ isSubtypeOf(schema: ODataStructuredType<any>): boolean;
32
26
  /**
33
- * Returns a boolean indicating if the structured type is of the given type.
27
+ * Returns a boolean indicating if the structured type is a supertype of the given type.
34
28
  * @param type String representation of the type
35
29
  * @returns True if the callable is type of the given type
36
30
  */
37
- isTypeOf(type: string): boolean;
31
+ isSupertypeOf(schema: ODataStructuredType<any>): boolean;
38
32
  /**
39
33
  * Returns a boolean indicating if the structured type has a simple key.
40
34
  * @returns True if the structured type has a simple key
@@ -45,18 +39,12 @@ export declare class ODataStructuredType<T> {
45
39
  * @returns True if the structured type has a compound key.
46
40
  */
47
41
  isCompoundKey(): boolean;
48
- /**
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.
52
- */
53
- findAnnotation(predicate: (annot: ODataAnnotation) => boolean): ODataAnnotation | undefined;
54
42
  /**
55
43
  * Find the field parser for the given field name.
56
44
  * @param name Name of the field
57
45
  * @returns The field parser
58
46
  */
59
- findFieldByName(name: keyof T): ODataStructuredTypeFieldParser<any> | undefined;
47
+ findFieldByName<F>(name: keyof T): ODataStructuredTypeFieldParser<F> | undefined;
60
48
  /**
61
49
  * Find a parent schema of the structured type.
62
50
  * @param predicate Function for evaluate the schemas in the hierarchy.
@@ -68,7 +56,7 @@ export declare class ODataStructuredType<T> {
68
56
  * @param field Field that belongs to the structured type
69
57
  * @returns The schema of the field
70
58
  */
71
- findSchemaForField(field: ODataStructuredTypeFieldParser<any>): ODataStructuredType<any> | undefined;
59
+ findSchemaForField<E>(field: ODataStructuredTypeFieldParser<any>): ODataStructuredType<E>;
72
60
  /**
73
61
  * Returns all fields of the structured type.
74
62
  * @param include_navigation Include navigation properties in the result.
@@ -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.
@@ -1,6 +1,6 @@
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;
@@ -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
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;
@@ -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
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "angular-odata",
3
- "version": "0.90.0",
3
+ "version": "0.99.2",
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
  }