angular-odata 0.92.0 → 0.95.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (196) hide show
  1. package/{esm2015/angular-odata.js → esm2020/angular-odata.mjs} +0 -0
  2. package/esm2020/lib/api.mjs +303 -0
  3. package/{esm2015/lib/cache/cache.js → esm2020/lib/cache/cache.mjs} +3 -3
  4. package/{esm2015/lib/cache/index.js → esm2020/lib/cache/index.mjs} +0 -0
  5. package/{esm2015/lib/cache/memory.js → esm2020/lib/cache/memory.mjs} +1 -1
  6. package/{esm2015/lib/cache/storage.js → esm2020/lib/cache/storage.mjs} +2 -2
  7. package/esm2020/lib/client.mjs +271 -0
  8. package/{esm2015/lib/constants.js → esm2020/lib/constants.mjs} +3 -1
  9. package/esm2020/lib/helper.mjs +268 -0
  10. package/{esm2015/lib/index.js → esm2020/lib/index.mjs} +0 -0
  11. package/esm2020/lib/models/collection.mjs +741 -0
  12. package/{esm2015/lib/models/index.js → esm2020/lib/models/index.mjs} +0 -0
  13. package/esm2020/lib/models/model.mjs +453 -0
  14. package/esm2020/lib/models/options.mjs +945 -0
  15. package/{esm2015/lib/module.js → esm2020/lib/module.mjs} +7 -7
  16. package/esm2020/lib/options.mjs +32 -0
  17. package/{esm2015/lib/resources/index.js → esm2020/lib/resources/index.mjs} +0 -0
  18. package/{esm2015/lib/resources/path/handlers.js → esm2020/lib/resources/path/handlers.mjs} +1 -1
  19. package/{esm2015/lib/resources/path/index.js → esm2020/lib/resources/path/index.mjs} +0 -0
  20. package/esm2020/lib/resources/path/segments.mjs +124 -0
  21. package/esm2020/lib/resources/query/builder.mjs +590 -0
  22. package/esm2020/lib/resources/query/expressions.mjs +207 -0
  23. package/esm2020/lib/resources/query/handlers.mjs +186 -0
  24. package/{esm2015/lib/resources/query/index.js → esm2020/lib/resources/query/index.mjs} +0 -0
  25. package/esm2020/lib/resources/query/options.mjs +103 -0
  26. package/esm2020/lib/resources/query/syntax.mjs +406 -0
  27. package/esm2020/lib/resources/request.mjs +167 -0
  28. package/esm2020/lib/resources/resource.mjs +326 -0
  29. package/esm2020/lib/resources/responses/annotations.mjs +119 -0
  30. package/{esm2015/lib/resources/responses/csdl/csdl-annotation.js → esm2020/lib/resources/responses/csdl/csdl-annotation.mjs} +0 -0
  31. package/{esm2015/lib/resources/responses/csdl/csdl-entity-container.js → esm2020/lib/resources/responses/csdl/csdl-entity-container.mjs} +0 -0
  32. package/{esm2015/lib/resources/responses/csdl/csdl-entity-set.js → esm2020/lib/resources/responses/csdl/csdl-entity-set.mjs} +0 -0
  33. package/{esm2015/lib/resources/responses/csdl/csdl-enum-type.js → esm2020/lib/resources/responses/csdl/csdl-enum-type.mjs} +0 -0
  34. package/{esm2015/lib/resources/responses/csdl/csdl-function-action.js → esm2020/lib/resources/responses/csdl/csdl-function-action.mjs} +0 -0
  35. package/{esm2015/lib/resources/responses/csdl/csdl-navigation-property-binding.js → esm2020/lib/resources/responses/csdl/csdl-navigation-property-binding.mjs} +0 -0
  36. package/{esm2015/lib/resources/responses/csdl/csdl-reference.js → esm2020/lib/resources/responses/csdl/csdl-reference.mjs} +0 -0
  37. package/{esm2015/lib/resources/responses/csdl/csdl-schema.js → esm2020/lib/resources/responses/csdl/csdl-schema.mjs} +0 -0
  38. package/{esm2015/lib/resources/responses/csdl/csdl-singleton.js → esm2020/lib/resources/responses/csdl/csdl-singleton.mjs} +0 -0
  39. package/{esm2015/lib/resources/responses/csdl/csdl-structural-property.js → esm2020/lib/resources/responses/csdl/csdl-structural-property.mjs} +0 -0
  40. package/{esm2015/lib/resources/responses/csdl/csdl-structured-type.js → esm2020/lib/resources/responses/csdl/csdl-structured-type.mjs} +0 -0
  41. package/{esm2015/lib/resources/responses/csdl/csdl-type-definition.js → esm2020/lib/resources/responses/csdl/csdl-type-definition.mjs} +0 -0
  42. package/{esm2015/lib/resources/responses/index.js → esm2020/lib/resources/responses/index.mjs} +0 -0
  43. package/esm2020/lib/resources/responses/metadata.mjs +547 -0
  44. package/{esm2015/lib/resources/responses/options.js → esm2020/lib/resources/responses/options.mjs} +0 -0
  45. package/{esm2015/lib/resources/responses/response.js → esm2020/lib/resources/responses/response.mjs} +0 -0
  46. package/{esm2015/lib/resources/responses/types.js → esm2020/lib/resources/responses/types.mjs} +0 -0
  47. package/esm2020/lib/resources/types/action.mjs +101 -0
  48. package/esm2020/lib/resources/types/batch.mjs +288 -0
  49. package/esm2020/lib/resources/types/count.mjs +27 -0
  50. package/esm2020/lib/resources/types/entity-set.mjs +94 -0
  51. package/esm2020/lib/resources/types/entity.mjs +106 -0
  52. package/esm2020/lib/resources/types/function.mjs +137 -0
  53. package/{esm2015/lib/resources/types/index.js → esm2020/lib/resources/types/index.mjs} +0 -0
  54. package/esm2020/lib/resources/types/media.mjs +41 -0
  55. package/esm2020/lib/resources/types/metadata.mjs +30 -0
  56. package/esm2020/lib/resources/types/navigation-property.mjs +226 -0
  57. package/esm2020/lib/resources/types/options.mjs +2 -0
  58. package/esm2020/lib/resources/types/property.mjs +183 -0
  59. package/esm2020/lib/resources/types/reference.mjs +85 -0
  60. package/esm2020/lib/resources/types/singleton.mjs +126 -0
  61. package/esm2020/lib/resources/types/value.mjs +41 -0
  62. package/esm2020/lib/schema/annotation.mjs +37 -0
  63. package/esm2020/lib/schema/callable.mjs +62 -0
  64. package/esm2020/lib/schema/element.mjs +51 -0
  65. package/esm2020/lib/schema/entity-container.mjs +9 -0
  66. package/esm2020/lib/schema/entity-set.mjs +9 -0
  67. package/esm2020/lib/schema/enum-type.mjs +71 -0
  68. package/{esm2015/lib/schema/index.js → esm2020/lib/schema/index.mjs} +0 -0
  69. package/esm2020/lib/schema/parsers/callable.mjs +113 -0
  70. package/{esm2015/lib/schema/parsers/edm.js → esm2020/lib/schema/parsers/edm.mjs} +2 -2
  71. package/esm2020/lib/schema/parsers/enum-type.mjs +107 -0
  72. package/{esm2015/lib/schema/parsers/index.js → esm2020/lib/schema/parsers/index.mjs} +0 -0
  73. package/esm2020/lib/schema/parsers/structured-type.mjs +412 -0
  74. package/esm2020/lib/schema/schema.mjs +61 -0
  75. package/esm2020/lib/schema/structured-type.mjs +198 -0
  76. package/esm2020/lib/services/base.mjs +29 -0
  77. package/esm2020/lib/services/entity-set.mjs +143 -0
  78. package/esm2020/lib/services/entity.mjs +12 -0
  79. package/{esm2015/lib/services/factory.js → esm2020/lib/services/factory.mjs} +3 -3
  80. package/{esm2015/lib/services/index.js → esm2020/lib/services/index.mjs} +0 -0
  81. package/{esm2015/lib/services/singleton.js → esm2020/lib/services/singleton.mjs} +1 -1
  82. package/{esm2015/lib/settings.js → esm2020/lib/settings.mjs} +1 -1
  83. package/{esm2015/lib/tokens.js → esm2020/lib/tokens.mjs} +0 -0
  84. package/esm2020/lib/types.mjs +37 -0
  85. package/{esm2015/lib/utils/arraybuffers.js → esm2020/lib/utils/arraybuffers.mjs} +0 -0
  86. package/{esm2015/lib/utils/dates.js → esm2020/lib/utils/dates.mjs} +0 -0
  87. package/{esm2015/lib/utils/durations.js → esm2020/lib/utils/durations.mjs} +0 -0
  88. package/{esm2015/lib/utils/enums.js → esm2020/lib/utils/enums.mjs} +0 -0
  89. package/{esm2015/lib/utils/http.js → esm2020/lib/utils/http.mjs} +0 -0
  90. package/{esm2015/lib/utils/index.js → esm2020/lib/utils/index.mjs} +0 -0
  91. package/{esm2015/lib/utils/objects.js → esm2020/lib/utils/objects.mjs} +0 -0
  92. package/esm2020/lib/utils/odata.mjs +22 -0
  93. package/{esm2015/lib/utils/strings.js → esm2020/lib/utils/strings.mjs} +0 -0
  94. package/{esm2015/lib/utils/types.js → esm2020/lib/utils/types.mjs} +0 -0
  95. package/{esm2015/lib/utils/urls.js → esm2020/lib/utils/urls.mjs} +0 -0
  96. package/{esm2015/public-api.js → esm2020/public-api.mjs} +0 -0
  97. package/fesm2015/{angular-odata.js → angular-odata.mjs} +849 -750
  98. package/fesm2015/angular-odata.mjs.map +1 -0
  99. package/fesm2020/angular-odata.mjs +10274 -0
  100. package/fesm2020/angular-odata.mjs.map +1 -0
  101. package/lib/api.d.ts +10 -10
  102. package/lib/cache/cache.d.ts +2 -2
  103. package/lib/cache/storage.d.ts +1 -1
  104. package/lib/client.d.ts +3 -3
  105. package/lib/constants.d.ts +1 -0
  106. package/lib/models/collection.d.ts +11 -19
  107. package/lib/models/model.d.ts +22 -18
  108. package/lib/models/options.d.ts +16 -21
  109. package/lib/module.d.ts +1 -1
  110. package/lib/options.d.ts +1 -0
  111. package/lib/resources/path/segments.d.ts +1 -1
  112. package/lib/resources/query/expressions.d.ts +37 -27
  113. package/lib/resources/query/handlers.d.ts +7 -11
  114. package/lib/resources/query/options.d.ts +2 -2
  115. package/lib/resources/query/syntax.d.ts +52 -54
  116. package/lib/resources/request.d.ts +1 -1
  117. package/lib/resources/resource.d.ts +25 -8
  118. package/lib/resources/types/action.d.ts +12 -19
  119. package/lib/resources/types/batch.d.ts +1 -3
  120. package/lib/resources/types/count.d.ts +5 -4
  121. package/lib/resources/types/entity-set.d.ts +11 -15
  122. package/lib/resources/types/entity.d.ts +12 -15
  123. package/lib/resources/types/function.d.ts +11 -18
  124. package/lib/resources/types/media.d.ts +6 -5
  125. package/lib/resources/types/metadata.d.ts +3 -5
  126. package/lib/resources/types/navigation-property.d.ts +15 -21
  127. package/lib/resources/types/property.d.ts +13 -19
  128. package/lib/resources/types/reference.d.ts +39 -6
  129. package/lib/resources/types/singleton.d.ts +12 -16
  130. package/lib/resources/types/value.d.ts +9 -5
  131. package/lib/schema/{base.d.ts → annotation.d.ts} +0 -0
  132. package/lib/schema/callable.d.ts +2 -18
  133. package/lib/schema/element.d.ts +39 -0
  134. package/lib/schema/entity-container.d.ts +2 -12
  135. package/lib/schema/entity-set.d.ts +2 -18
  136. package/lib/schema/enum-type.d.ts +2 -26
  137. package/lib/schema/parsers/enum-type.d.ts +4 -4
  138. package/lib/schema/parsers/structured-type.d.ts +4 -4
  139. package/lib/schema/schema.d.ts +2 -2
  140. package/lib/schema/structured-type.d.ts +8 -26
  141. package/lib/services/base.d.ts +2 -2
  142. package/lib/services/entity-set.d.ts +2 -2
  143. package/lib/services/entity.d.ts +1 -1
  144. package/lib/services/singleton.d.ts +2 -2
  145. package/lib/settings.d.ts +5 -5
  146. package/lib/types.d.ts +1 -0
  147. package/package.json +21 -8
  148. package/bundles/angular-odata.umd.js +0 -11861
  149. package/bundles/angular-odata.umd.js.map +0 -1
  150. package/esm2015/lib/api.js +0 -296
  151. package/esm2015/lib/client.js +0 -272
  152. package/esm2015/lib/helper.js +0 -268
  153. package/esm2015/lib/models/collection.js +0 -734
  154. package/esm2015/lib/models/model.js +0 -438
  155. package/esm2015/lib/models/options.js +0 -942
  156. package/esm2015/lib/options.js +0 -31
  157. package/esm2015/lib/resources/path/segments.js +0 -124
  158. package/esm2015/lib/resources/query/builder.js +0 -591
  159. package/esm2015/lib/resources/query/expressions.js +0 -194
  160. package/esm2015/lib/resources/query/handlers.js +0 -192
  161. package/esm2015/lib/resources/query/options.js +0 -103
  162. package/esm2015/lib/resources/query/syntax.js +0 -367
  163. package/esm2015/lib/resources/request.js +0 -168
  164. package/esm2015/lib/resources/resource.js +0 -243
  165. package/esm2015/lib/resources/responses/annotations.js +0 -121
  166. package/esm2015/lib/resources/responses/metadata.js +0 -548
  167. package/esm2015/lib/resources/types/action.js +0 -105
  168. package/esm2015/lib/resources/types/batch.js +0 -294
  169. package/esm2015/lib/resources/types/count.js +0 -33
  170. package/esm2015/lib/resources/types/entity-set.js +0 -101
  171. package/esm2015/lib/resources/types/entity.js +0 -137
  172. package/esm2015/lib/resources/types/function.js +0 -130
  173. package/esm2015/lib/resources/types/media.js +0 -47
  174. package/esm2015/lib/resources/types/metadata.js +0 -36
  175. package/esm2015/lib/resources/types/navigation-property.js +0 -205
  176. package/esm2015/lib/resources/types/options.js +0 -2
  177. package/esm2015/lib/resources/types/property.js +0 -151
  178. package/esm2015/lib/resources/types/reference.js +0 -74
  179. package/esm2015/lib/resources/types/singleton.js +0 -167
  180. package/esm2015/lib/resources/types/value.js +0 -35
  181. package/esm2015/lib/schema/base.js +0 -37
  182. package/esm2015/lib/schema/callable.js +0 -82
  183. package/esm2015/lib/schema/entity-container.js +0 -24
  184. package/esm2015/lib/schema/entity-set.js +0 -35
  185. package/esm2015/lib/schema/enum-type.js +0 -102
  186. package/esm2015/lib/schema/parsers/callable.js +0 -107
  187. package/esm2015/lib/schema/parsers/enum-type.js +0 -107
  188. package/esm2015/lib/schema/parsers/structured-type.js +0 -392
  189. package/esm2015/lib/schema/schema.js +0 -52
  190. package/esm2015/lib/schema/structured-type.js +0 -220
  191. package/esm2015/lib/services/base.js +0 -23
  192. package/esm2015/lib/services/entity-set.js +0 -146
  193. package/esm2015/lib/services/entity.js +0 -12
  194. package/esm2015/lib/types.js +0 -37
  195. package/esm2015/lib/utils/odata.js +0 -21
  196. package/fesm2015/angular-odata.js.map +0 -1
@@ -1,14 +1,17 @@
1
+ import { Observable } from 'rxjs';
1
2
  import { ODataApi } from '../../api';
2
- import { ODataEntityResource } from './entity';
3
- import { ODataOptions } from './options';
3
+ import { QueryOptionNames } from '../../types';
4
4
  import { ODataPathSegments } from '../path';
5
5
  import { ODataQueryOptions } from '../query';
6
6
  import { ODataResource } from '../resource';
7
- import { Observable } from 'rxjs';
7
+ import { ODataEntities, ODataEntity } from '../responses/types';
8
+ import { ODataEntityResource } from './entity';
9
+ import { ODataEntitiesOptions, ODataEntityOptions, ODataOptions } from './options';
8
10
  export declare class ODataReferenceResource<T> extends ODataResource<T> {
9
- static factory<P>(api: ODataApi, segments: ODataPathSegments, options: ODataQueryOptions<P>): ODataReferenceResource<P>;
10
- clone(): ODataReferenceResource<T>;
11
- schema(): undefined;
11
+ static factory<P>(api: ODataApi, { segments, query, }: {
12
+ segments: ODataPathSegments;
13
+ query?: ODataQueryOptions<P>;
14
+ }): ODataReferenceResource<P>;
12
15
  protected post(target: ODataEntityResource<any>, options?: ODataOptions): Observable<any>;
13
16
  protected put(target: ODataEntityResource<any>, options?: ODataOptions & {
14
17
  etag?: string;
@@ -48,4 +51,34 @@ export declare class ODataReferenceResource<T> extends ODataResource<T> {
48
51
  unset(options?: ODataOptions & {
49
52
  etag?: string;
50
53
  }): Observable<any>;
54
+ /**
55
+ * Fetch entity / entities
56
+ * @param options Options for the request
57
+ * @return An observable of the entity or entities with annotations
58
+ */
59
+ fetch(options?: ODataEntityOptions & {
60
+ etag?: string;
61
+ bodyQueryOptions?: QueryOptionNames[];
62
+ }): Observable<ODataEntity<T>>;
63
+ fetch(options?: ODataEntitiesOptions & {
64
+ etag?: string;
65
+ bodyQueryOptions?: QueryOptionNames[];
66
+ }): Observable<ODataEntities<T>>;
67
+ /**
68
+ * Fetch the entity
69
+ * @param options Options for the request
70
+ * @returns The entity
71
+ */
72
+ fetchEntity(options?: ODataOptions & {
73
+ etag?: string;
74
+ bodyQueryOptions?: QueryOptionNames[];
75
+ }): Observable<T | null>;
76
+ /**
77
+ * Fetch entities
78
+ * @param options Options for the request
79
+ * @returns The entities
80
+ */
81
+ fetchEntities(options?: ODataOptions & {
82
+ bodyQueryOptions?: QueryOptionNames[];
83
+ }): Observable<T[] | null>;
51
84
  }
@@ -1,26 +1,22 @@
1
- import { ODataResource } from '../resource';
2
- import { ODataEntity, ODataEntityAnnotations } from '../responses';
1
+ import { Observable } from 'rxjs';
2
+ import { ODataApi } from '../../api';
3
+ import { ODataModel } from '../../models';
4
+ import { ODataStructuredType } from '../../schema';
3
5
  import { QueryOptionNames } from '../../types';
6
+ import { ODataQueryOptions } from '../query';
7
+ import { ODataResource } from '../resource';
8
+ import { ODataEntity } from '../responses';
4
9
  import { ODataActionResource } from './action';
5
- import { ODataApi } from '../../api';
6
10
  import { ODataFunctionResource } from './function';
7
- import { ODataModel } from '../../models';
8
11
  import { ODataNavigationPropertyResource } from './navigation-property';
9
12
  import { ODataOptions } from './options';
10
- import { ODataPathSegments } from '../path';
11
13
  import { ODataPropertyResource } from './property';
12
- import { ODataQueryOptions } from '../query';
13
- import { Observable } from 'rxjs';
14
14
  export declare class ODataSingletonResource<T> extends ODataResource<T> {
15
- static factory<R>(api: ODataApi, path: string, type: string | undefined, segments: ODataPathSegments, options: ODataQueryOptions<R>): ODataSingletonResource<R>;
16
- clone(): ODataSingletonResource<T>;
17
- schema(): import("../../schema").ODataStructuredType<T> | undefined;
18
- asModel<M extends ODataModel<T>>(entity: Partial<T> | {
19
- [name: string]: any;
20
- }, { annots, reset }?: {
21
- annots?: ODataEntityAnnotations;
22
- reset?: boolean;
23
- }): M;
15
+ static factory<S>(api: ODataApi, { path, schema, query, }: {
16
+ path: string;
17
+ schema?: ODataStructuredType<S>;
18
+ query?: ODataQueryOptions<S>;
19
+ }): ODataSingletonResource<S>;
24
20
  key(value: any): ODataSingletonResource<T>;
25
21
  keys(values: any[]): ODataSingletonResource<T>;
26
22
  navigationProperty<N>(path: string): ODataNavigationPropertyResource<N>;
@@ -1,13 +1,17 @@
1
+ import { Observable } from 'rxjs';
1
2
  import { ODataApi } from '../../api';
2
- import { ODataOptions } from './options';
3
+ import { ODataStructuredType } from '../../schema/structured-type';
3
4
  import { ODataPathSegments } from '../path';
4
5
  import { ODataQueryOptions } from '../query';
5
6
  import { ODataResource } from '../resource';
6
- import { Observable } from 'rxjs';
7
+ import { ODataOptions } from './options';
7
8
  export declare class ODataValueResource<T> extends ODataResource<T> {
8
- static factory<V>(api: ODataApi, type: string | undefined, segments: ODataPathSegments, options: ODataQueryOptions<V>): ODataValueResource<V>;
9
- clone(): ODataValueResource<T>;
10
- schema(): undefined;
9
+ static factory<V>(api: ODataApi, { type, schema, segments, query, }: {
10
+ type?: string;
11
+ schema?: ODataStructuredType<V>;
12
+ segments: ODataPathSegments;
13
+ query?: ODataQueryOptions<V>;
14
+ }): ODataValueResource<V>;
11
15
  protected get(options?: ODataOptions): Observable<T>;
12
16
  /**
13
17
  * Fetch the value of the resource.
File without changes
@@ -1,30 +1,14 @@
1
1
  import { CallableConfig, Options, Parser } from '../types';
2
+ import { ODataSchemaElement } from './element';
2
3
  import { ODataCallableParser } from './parsers';
3
4
  import { ODataSchema } from './schema';
4
- export declare class ODataCallable<R> {
5
- schema: ODataSchema;
6
- name: string;
5
+ export declare class ODataCallable<R> extends ODataSchemaElement {
7
6
  entitySetPath?: string;
8
7
  bound?: boolean;
9
8
  composable?: boolean;
10
9
  parser: ODataCallableParser<R>;
11
10
  constructor(config: CallableConfig, schema: ODataSchema);
12
11
  path(): string;
13
- /**
14
- * Returns a full type of the callable including the namespace/alias.
15
- * @param alias Use the alias of the namespace instead of the namespace.
16
- * @returns The string representation of the type.
17
- */
18
- type({ alias }?: {
19
- alias?: boolean;
20
- }): string;
21
- /**
22
- * Returns a boolean indicating if the callable is of the given type.
23
- * @param type String representation of the type
24
- * @returns True if the callable is type of the given type
25
- */
26
- isTypeOf(type: string): boolean;
27
- get api(): import("angular-odata").ODataApi;
28
12
  configure({ parserForType, }: {
29
13
  parserForType: (type: string) => Parser<any>;
30
14
  }): void;
@@ -0,0 +1,39 @@
1
+ import { AnnotationConfig } from '../types';
2
+ import { ODataAnnotatable } from './annotation';
3
+ import { ODataSchema } from './schema';
4
+ export declare class ODataSchemaElement extends ODataAnnotatable {
5
+ name: string;
6
+ schema: ODataSchema;
7
+ constructor(config: {
8
+ annotations?: AnnotationConfig[];
9
+ name: string;
10
+ }, schema: ODataSchema);
11
+ get api(): import("angular-odata").ODataApi;
12
+ /**
13
+ * Create a nicer looking title.
14
+ * Titleize is meant for creating pretty output.
15
+ * @param term The term of the annotation to find.
16
+ * @returns The titleized string.
17
+ */
18
+ titleize(term?: string | RegExp): string;
19
+ /**
20
+ * Returns a full type of the structured type including the namespace/alias.
21
+ * @param alias Use the alias of the namespace instead of the namespace.
22
+ * @returns The string representation of the type.
23
+ */
24
+ type({ alias }?: {
25
+ alias?: boolean;
26
+ }): string;
27
+ /**
28
+ * Returns a boolean indicating if the structured type is of the given type.
29
+ * @param type String representation of the type
30
+ * @returns True if the callable is type of the given type
31
+ */
32
+ isTypeOf(type: string): boolean;
33
+ /**
34
+ * Returns a boolean indicating if the structured type is a sub type of the given type.
35
+ * @param type String representation of the type
36
+ * @returns True if the callable is type of the given type
37
+ */
38
+ isSubtypeOf(schema: ODataSchemaElement): boolean;
39
+ }
@@ -1,18 +1,8 @@
1
1
  import { EntityContainerConfig } from '../types';
2
- import { ODataAnnotatable } from './base';
2
+ import { ODataSchemaElement } from './element';
3
3
  import { ODataEntitySet } from './entity-set';
4
4
  import { ODataSchema } from './schema';
5
- export declare class ODataEntityContainer extends ODataAnnotatable {
6
- schema: ODataSchema;
7
- name: string;
5
+ export declare class ODataEntityContainer extends ODataSchemaElement {
8
6
  entitySets: ODataEntitySet[];
9
7
  constructor(config: EntityContainerConfig, schema: ODataSchema);
10
- get api(): import("angular-odata").ODataApi;
11
- /**
12
- * Create a nicer looking title.
13
- * Titleize is meant for creating pretty output.
14
- * @param term The term of the annotation to find.
15
- * @returns The titleized string.
16
- */
17
- titelize(term: string | RegExp): string;
18
8
  }
@@ -1,26 +1,10 @@
1
1
  import { EntitySetConfig } from '../types';
2
- import { ODataAnnotatable } from './base';
2
+ import { ODataSchemaElement } from './element';
3
3
  import { ODataSchema } from './schema';
4
- export declare class ODataEntitySet extends ODataAnnotatable {
5
- schema: ODataSchema;
6
- name: string;
4
+ export declare class ODataEntitySet extends ODataSchemaElement {
7
5
  entityType: string;
8
6
  service: {
9
7
  new (...params: any[]): any;
10
8
  };
11
9
  constructor(config: EntitySetConfig, schema: ODataSchema);
12
- /**
13
- * Create a nicer looking title.
14
- * Titleize is meant for creating pretty output.
15
- * @param term The term of the annotation to find.
16
- * @returns The titleized string.
17
- */
18
- titelize(term: string | RegExp): string;
19
- /**
20
- * Returns a boolean indicating if the entity set is of the given type.
21
- * @param type String representation of the type
22
- * @returns True if the callable is type of the given type
23
- */
24
- isTypeOf(type: string): boolean;
25
- get api(): import("angular-odata").ODataApi;
26
10
  }
@@ -1,10 +1,8 @@
1
1
  import { EnumTypeConfig, Options } from '../types';
2
+ import { ODataSchemaElement } from './element';
2
3
  import { ODataEnumTypeFieldParser, ODataEnumTypeParser } from './parsers';
3
- import { ODataAnnotatable } from './base';
4
4
  import { ODataSchema } from './schema';
5
- export declare class ODataEnumType<E> extends ODataAnnotatable {
6
- schema: ODataSchema;
7
- name: string;
5
+ export declare class ODataEnumType<E> extends ODataSchemaElement {
8
6
  parser: ODataEnumTypeParser<E>;
9
7
  members: {
10
8
  [name: string]: number;
@@ -12,28 +10,6 @@ export declare class ODataEnumType<E> extends ODataAnnotatable {
12
10
  [value: number]: string;
13
11
  };
14
12
  constructor(config: EnumTypeConfig<E>, schema: ODataSchema);
15
- /**
16
- * Create a nicer looking title.
17
- * Titleize is meant for creating pretty output.
18
- * @param term The term of the annotation to find.
19
- * @returns The titleized string.
20
- */
21
- titelize(term: string | RegExp): string;
22
- /**
23
- * Returns a full type of the enum type including the namespace/alias.
24
- * @param alias Use the alias of the namespace instead of the namespace.
25
- * @returns The string representation of the type.
26
- */
27
- type({ alias }?: {
28
- alias?: boolean;
29
- }): string;
30
- /**
31
- * Returns a boolean indicating if the enum type is of the given type.
32
- * @param type String representation of the type
33
- * @returns True if the callable is type of the given type
34
- */
35
- isTypeOf(type: string): boolean;
36
- get api(): import("angular-odata").ODataApi;
37
13
  configure(): void;
38
14
  /**
39
15
  * Returns the fields of the enum type.
@@ -1,10 +1,10 @@
1
- import { ODataAnnotatable } from '../base';
2
- import { EnumTypeConfig, Parser, OptionsHelper, EnumTypeFieldConfig, Options } from '../../types';
1
+ import { EnumTypeConfig, EnumTypeFieldConfig, Options, OptionsHelper, Parser } from '../../types';
2
+ import { ODataAnnotatable } from '../annotation';
3
3
  export declare class ODataEnumTypeFieldParser extends ODataAnnotatable {
4
4
  name: string;
5
5
  value: number;
6
6
  constructor(name: string, field: EnumTypeFieldConfig);
7
- titleize(term: string | RegExp): string;
7
+ titleize(term?: string | RegExp): string;
8
8
  }
9
9
  export declare class ODataEnumTypeParser<T> extends ODataAnnotatable implements Parser<T> {
10
10
  name: string;
@@ -25,7 +25,7 @@ export declare class ODataEnumTypeParser<T> extends ODataAnnotatable implements
25
25
  * @param term The term of the annotation to find.
26
26
  * @returns The titleized string.
27
27
  */
28
- titelize(term: string | RegExp): string;
28
+ ttitelize(term?: string | RegExp): string;
29
29
  configure({ options }: {
30
30
  options: OptionsHelper;
31
31
  }): void;
@@ -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 { ODataAnnotatable } from '../base';
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;
@@ -92,9 +92,9 @@ export declare class ODataStructuredTypeParser<T> extends ODataAnnotatable imple
92
92
  * @param term The term of the annotation to find.
93
93
  * @returns The titleized string.
94
94
  */
95
- titelize(term: string | RegExp): string;
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,6 +1,6 @@
1
- import { Parser, SchemaConfig } from '../types';
2
- import { ODataAnnotatable } from './base';
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';
@@ -1,12 +1,10 @@
1
- import { JsonSchemaOptions, ODataEntityTypeKey, ODataStructuredTypeFieldParser, ODataStructuredTypeParser } from './parsers';
2
- import { Options, StructuredTypeConfig } from '../types';
3
- import { ODataAnnotatable } from './base';
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> extends ODataAnnotatable {
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>;
@@ -15,32 +13,16 @@ export declare class ODataStructuredType<T> extends ODataAnnotatable {
15
13
  collection?: typeof ODataCollection;
16
14
  parser: ODataStructuredTypeParser<T>;
17
15
  constructor(config: StructuredTypeConfig<T>, schema: ODataSchema);
18
- get api(): import("angular-odata").ODataApi;
19
16
  configure({ parserForType, findOptionsForType, }: {
20
17
  parserForType: (type: string) => any;
21
18
  findOptionsForType: (type: string) => any;
22
19
  }): void;
23
20
  /**
24
- * Create a nicer looking title.
25
- * Titleize is meant for creating pretty output.
26
- * @param term The term of the annotation to find.
27
- * @returns The titleized string.
28
- */
29
- titelize(term: string | RegExp): string;
30
- /**
31
- * Returns a full type of the structured type including the namespace/alias.
32
- * @param alias Use the alias of the namespace instead of the namespace.
33
- * @returns The string representation of the type.
34
- */
35
- type({ alias }?: {
36
- alias?: boolean;
37
- }): string;
38
- /**
39
- * 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.
40
22
  * @param type String representation of the type
41
23
  * @returns True if the callable is type of the given type
42
24
  */
43
- isTypeOf(type: string): boolean;
25
+ isSubtypeOf(schema: ODataStructuredType<any>): boolean;
44
26
  /**
45
27
  * Returns a boolean indicating if the structured type has a simple key.
46
28
  * @returns True if the structured type has a simple key
@@ -56,7 +38,7 @@ export declare class ODataStructuredType<T> extends ODataAnnotatable {
56
38
  * @param name Name of the field
57
39
  * @returns The field parser
58
40
  */
59
- findFieldByName<F>(name: keyof T): ODataStructuredTypeFieldParser<F>;
41
+ findFieldByName<F>(name: keyof T): ODataStructuredTypeFieldParser<F> | undefined;
60
42
  /**
61
43
  * Find a parent schema of the structured type.
62
44
  * @param predicate Function for evaluate the schemas in the hierarchy.
@@ -68,7 +50,7 @@ export declare class ODataStructuredType<T> extends ODataAnnotatable {
68
50
  * @param field Field that belongs to the structured type
69
51
  * @returns The schema of the field
70
52
  */
71
- findSchemaForField(field: ODataStructuredTypeFieldParser<any>): ODataStructuredType<any> | undefined;
53
+ findSchemaForField<E>(field: ODataStructuredTypeFieldParser<any>): ODataStructuredType<E>;
72
54
  /**
73
55
  * Returns all fields of the structured type.
74
56
  * @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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "angular-odata",
3
- "version": "0.92.0",
3
+ "version": "0.95.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
  }