angular-odata 0.130.0 → 0.140.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 (247) hide show
  1. package/fesm2022/angular-odata.mjs +2469 -2600
  2. package/fesm2022/angular-odata.mjs.map +1 -1
  3. package/index.d.ts +6403 -3
  4. package/package.json +3 -5
  5. package/schematics/apigen/angular/base.js +2 -6
  6. package/schematics/apigen/angular/base.js.map +1 -1
  7. package/schematics/apigen/angular/entity.js +1 -2
  8. package/schematics/apigen/angular/entity.js.map +1 -1
  9. package/schematics/apigen/files/api-config/__fileName__.ts +4 -4
  10. package/schematics/apigen/index.js +2 -6
  11. package/schematics/apigen/index.js.map +1 -1
  12. package/schematics/apigen/metadata/csdl/csdl-annotation.js +1 -2
  13. package/schematics/apigen/metadata/csdl/csdl-annotation.js.map +1 -1
  14. package/schematics/apigen/metadata/csdl/csdl-entity-container.js.map +1 -1
  15. package/schematics/apigen/metadata/csdl/csdl-entity-set.js.map +1 -1
  16. package/schematics/apigen/metadata/csdl/csdl-enum-type.d.ts +1 -1
  17. package/schematics/apigen/metadata/csdl/csdl-enum-type.js +1 -1
  18. package/schematics/apigen/metadata/csdl/csdl-enum-type.js.map +1 -1
  19. package/schematics/apigen/metadata/csdl/csdl-function-action.d.ts +1 -1
  20. package/schematics/apigen/metadata/csdl/csdl-reference.js +1 -2
  21. package/schematics/apigen/metadata/csdl/csdl-reference.js.map +1 -1
  22. package/schematics/apigen/metadata/csdl/csdl-schema.js +1 -2
  23. package/schematics/apigen/metadata/csdl/csdl-schema.js.map +1 -1
  24. package/schematics/apigen/metadata/csdl/csdl-singleton.js.map +1 -1
  25. package/schematics/apigen/metadata/csdl/csdl-structural-property.d.ts +1 -1
  26. package/schematics/apigen/metadata/csdl/csdl-structural-property.js +2 -3
  27. package/schematics/apigen/metadata/csdl/csdl-structural-property.js.map +1 -1
  28. package/schematics/apigen/metadata/csdl/csdl-structured-type.d.ts +1 -1
  29. package/schematics/apigen/metadata/csdl/csdl-structured-type.js +1 -2
  30. package/schematics/apigen/metadata/csdl/csdl-structured-type.js.map +1 -1
  31. package/schematics/apigen/metadata/parser.js +1 -3
  32. package/schematics/apigen/metadata/parser.js.map +1 -1
  33. package/schematics/apigen/utils.js +2 -4
  34. package/schematics/apigen/utils.js.map +1 -1
  35. package/esm2022/angular-odata.mjs +0 -5
  36. package/esm2022/lib/annotations.mjs +0 -146
  37. package/esm2022/lib/api.mjs +0 -439
  38. package/esm2022/lib/cache/cache.mjs +0 -177
  39. package/esm2022/lib/cache/index.mjs +0 -4
  40. package/esm2022/lib/cache/memory.mjs +0 -30
  41. package/esm2022/lib/cache/storage.mjs +0 -57
  42. package/esm2022/lib/client.mjs +0 -215
  43. package/esm2022/lib/constants.mjs +0 -95
  44. package/esm2022/lib/helper.mjs +0 -288
  45. package/esm2022/lib/index.mjs +0 -22
  46. package/esm2022/lib/loaders.mjs +0 -43
  47. package/esm2022/lib/metadata/csdl/csdl-annotation.mjs +0 -273
  48. package/esm2022/lib/metadata/csdl/csdl-entity-container.mjs +0 -59
  49. package/esm2022/lib/metadata/csdl/csdl-entity-set.mjs +0 -50
  50. package/esm2022/lib/metadata/csdl/csdl-enum-type.mjs +0 -74
  51. package/esm2022/lib/metadata/csdl/csdl-function-action.mjs +0 -204
  52. package/esm2022/lib/metadata/csdl/csdl-navigation-property-binding.mjs +0 -15
  53. package/esm2022/lib/metadata/csdl/csdl-reference.mjs +0 -76
  54. package/esm2022/lib/metadata/csdl/csdl-schema.mjs +0 -87
  55. package/esm2022/lib/metadata/csdl/csdl-singleton.mjs +0 -37
  56. package/esm2022/lib/metadata/csdl/csdl-structural-property.mjs +0 -145
  57. package/esm2022/lib/metadata/csdl/csdl-structured-type.mjs +0 -159
  58. package/esm2022/lib/metadata/csdl/csdl-type-definition.mjs +0 -46
  59. package/esm2022/lib/metadata/index.mjs +0 -3
  60. package/esm2022/lib/metadata/metadata.mjs +0 -41
  61. package/esm2022/lib/metadata/parser.mjs +0 -564
  62. package/esm2022/lib/models/collection.mjs +0 -816
  63. package/esm2022/lib/models/index.mjs +0 -4
  64. package/esm2022/lib/models/model.mjs +0 -577
  65. package/esm2022/lib/models/options.mjs +0 -1227
  66. package/esm2022/lib/module.mjs +0 -55
  67. package/esm2022/lib/options.mjs +0 -91
  68. package/esm2022/lib/resources/index.mjs +0 -7
  69. package/esm2022/lib/resources/options.mjs +0 -66
  70. package/esm2022/lib/resources/path/handlers.mjs +0 -81
  71. package/esm2022/lib/resources/path/index.mjs +0 -3
  72. package/esm2022/lib/resources/path/segments.mjs +0 -149
  73. package/esm2022/lib/resources/query/builder.mjs +0 -645
  74. package/esm2022/lib/resources/query/expressions/apply.mjs +0 -238
  75. package/esm2022/lib/resources/query/expressions/base.mjs +0 -26
  76. package/esm2022/lib/resources/query/expressions/compute.mjs +0 -55
  77. package/esm2022/lib/resources/query/expressions/count.mjs +0 -118
  78. package/esm2022/lib/resources/query/expressions/expand.mjs +0 -154
  79. package/esm2022/lib/resources/query/expressions/filter.mjs +0 -180
  80. package/esm2022/lib/resources/query/expressions/index.mjs +0 -10
  81. package/esm2022/lib/resources/query/expressions/orderby.mjs +0 -81
  82. package/esm2022/lib/resources/query/expressions/search.mjs +0 -144
  83. package/esm2022/lib/resources/query/expressions/select.mjs +0 -49
  84. package/esm2022/lib/resources/query/expressions/syntax.mjs +0 -770
  85. package/esm2022/lib/resources/query/handlers.mjs +0 -423
  86. package/esm2022/lib/resources/query/index.mjs +0 -5
  87. package/esm2022/lib/resources/query/options.mjs +0 -140
  88. package/esm2022/lib/resources/request.mjs +0 -210
  89. package/esm2022/lib/resources/resource.mjs +0 -316
  90. package/esm2022/lib/resources/response.mjs +0 -180
  91. package/esm2022/lib/resources/types/action.mjs +0 -118
  92. package/esm2022/lib/resources/types/batch.mjs +0 -428
  93. package/esm2022/lib/resources/types/count.mjs +0 -33
  94. package/esm2022/lib/resources/types/entity-set.mjs +0 -131
  95. package/esm2022/lib/resources/types/entity.mjs +0 -112
  96. package/esm2022/lib/resources/types/function.mjs +0 -149
  97. package/esm2022/lib/resources/types/index.mjs +0 -15
  98. package/esm2022/lib/resources/types/media.mjs +0 -44
  99. package/esm2022/lib/resources/types/metadata.mjs +0 -35
  100. package/esm2022/lib/resources/types/navigation-property.mjs +0 -246
  101. package/esm2022/lib/resources/types/options.mjs +0 -2
  102. package/esm2022/lib/resources/types/property.mjs +0 -187
  103. package/esm2022/lib/resources/types/reference.mjs +0 -87
  104. package/esm2022/lib/resources/types/singleton.mjs +0 -125
  105. package/esm2022/lib/resources/types/value.mjs +0 -48
  106. package/esm2022/lib/schema/annotation.mjs +0 -44
  107. package/esm2022/lib/schema/callable.mjs +0 -69
  108. package/esm2022/lib/schema/element.mjs +0 -70
  109. package/esm2022/lib/schema/entity-container.mjs +0 -13
  110. package/esm2022/lib/schema/entity-set.mjs +0 -11
  111. package/esm2022/lib/schema/enum-type.mjs +0 -69
  112. package/esm2022/lib/schema/index.mjs +0 -9
  113. package/esm2022/lib/schema/parsers/callable.mjs +0 -123
  114. package/esm2022/lib/schema/parsers/edm.mjs +0 -101
  115. package/esm2022/lib/schema/parsers/enum-type.mjs +0 -148
  116. package/esm2022/lib/schema/parsers/index.mjs +0 -5
  117. package/esm2022/lib/schema/parsers/structured-type.mjs +0 -548
  118. package/esm2022/lib/schema/schema.mjs +0 -52
  119. package/esm2022/lib/schema/singleton.mjs +0 -11
  120. package/esm2022/lib/schema/structured-type.mjs +0 -220
  121. package/esm2022/lib/services/base.mjs +0 -32
  122. package/esm2022/lib/services/entity-set.mjs +0 -161
  123. package/esm2022/lib/services/entity.mjs +0 -12
  124. package/esm2022/lib/services/factory.mjs +0 -39
  125. package/esm2022/lib/services/index.mjs +0 -5
  126. package/esm2022/lib/services/singleton.mjs +0 -55
  127. package/esm2022/lib/settings.mjs +0 -113
  128. package/esm2022/lib/types.mjs +0 -118
  129. package/esm2022/lib/utils/arraybuffers.mjs +0 -46
  130. package/esm2022/lib/utils/arrays.mjs +0 -10
  131. package/esm2022/lib/utils/dates.mjs +0 -18
  132. package/esm2022/lib/utils/durations.mjs +0 -40
  133. package/esm2022/lib/utils/enums.mjs +0 -61
  134. package/esm2022/lib/utils/http.mjs +0 -95
  135. package/esm2022/lib/utils/index.mjs +0 -10
  136. package/esm2022/lib/utils/objects.mjs +0 -204
  137. package/esm2022/lib/utils/odata.mjs +0 -22
  138. package/esm2022/lib/utils/strings.mjs +0 -20
  139. package/esm2022/lib/utils/types.mjs +0 -136
  140. package/esm2022/lib/utils/urls.mjs +0 -24
  141. package/esm2022/public-api.mjs +0 -5
  142. package/lib/annotations.d.ts +0 -75
  143. package/lib/api.d.ts +0 -108
  144. package/lib/cache/cache.d.ts +0 -104
  145. package/lib/cache/index.d.ts +0 -3
  146. package/lib/cache/memory.d.ts +0 -19
  147. package/lib/cache/storage.d.ts +0 -35
  148. package/lib/client.d.ts +0 -613
  149. package/lib/constants.d.ts +0 -70
  150. package/lib/helper.d.ts +0 -75
  151. package/lib/index.d.ts +0 -14
  152. package/lib/loaders.d.ts +0 -21
  153. package/lib/metadata/csdl/csdl-annotation.d.ts +0 -159
  154. package/lib/metadata/csdl/csdl-entity-container.d.ts +0 -31
  155. package/lib/metadata/csdl/csdl-entity-set.d.ts +0 -25
  156. package/lib/metadata/csdl/csdl-enum-type.d.ts +0 -37
  157. package/lib/metadata/csdl/csdl-function-action.d.ts +0 -148
  158. package/lib/metadata/csdl/csdl-navigation-property-binding.d.ts +0 -12
  159. package/lib/metadata/csdl/csdl-reference.d.ts +0 -53
  160. package/lib/metadata/csdl/csdl-schema.d.ts +0 -37
  161. package/lib/metadata/csdl/csdl-singleton.d.ts +0 -21
  162. package/lib/metadata/csdl/csdl-structural-property.d.ts +0 -86
  163. package/lib/metadata/csdl/csdl-structured-type.d.ts +0 -94
  164. package/lib/metadata/csdl/csdl-type-definition.d.ts +0 -25
  165. package/lib/metadata/index.d.ts +0 -2
  166. package/lib/metadata/metadata.d.ts +0 -23
  167. package/lib/metadata/parser.d.ts +0 -110
  168. package/lib/models/collection.d.ts +0 -183
  169. package/lib/models/index.d.ts +0 -3
  170. package/lib/models/model.d.ts +0 -176
  171. package/lib/models/options.d.ts +0 -368
  172. package/lib/module.d.ts +0 -19
  173. package/lib/options.d.ts +0 -101
  174. package/lib/resources/index.d.ts +0 -6
  175. package/lib/resources/options.d.ts +0 -18
  176. package/lib/resources/path/handlers.d.ts +0 -29
  177. package/lib/resources/path/index.d.ts +0 -2
  178. package/lib/resources/path/segments.d.ts +0 -54
  179. package/lib/resources/query/builder.d.ts +0 -103
  180. package/lib/resources/query/expressions/apply.d.ts +0 -125
  181. package/lib/resources/query/expressions/base.d.ts +0 -25
  182. package/lib/resources/query/expressions/compute.d.ts +0 -39
  183. package/lib/resources/query/expressions/count.d.ts +0 -58
  184. package/lib/resources/query/expressions/expand.d.ts +0 -68
  185. package/lib/resources/query/expressions/filter.d.ts +0 -76
  186. package/lib/resources/query/expressions/index.d.ts +0 -9
  187. package/lib/resources/query/expressions/orderby.d.ts +0 -54
  188. package/lib/resources/query/expressions/search.d.ts +0 -62
  189. package/lib/resources/query/expressions/select.d.ts +0 -33
  190. package/lib/resources/query/expressions/syntax.d.ts +0 -313
  191. package/lib/resources/query/handlers.d.ts +0 -258
  192. package/lib/resources/query/index.d.ts +0 -4
  193. package/lib/resources/query/options.d.ts +0 -60
  194. package/lib/resources/request.d.ts +0 -64
  195. package/lib/resources/resource.d.ts +0 -161
  196. package/lib/resources/response.d.ts +0 -82
  197. package/lib/resources/types/action.d.ts +0 -84
  198. package/lib/resources/types/batch.d.ts +0 -62
  199. package/lib/resources/types/count.d.ts +0 -20
  200. package/lib/resources/types/entity-set.d.ts +0 -79
  201. package/lib/resources/types/entity.d.ts +0 -54
  202. package/lib/resources/types/function.d.ts +0 -108
  203. package/lib/resources/types/index.d.ts +0 -14
  204. package/lib/resources/types/media.d.ts +0 -28
  205. package/lib/resources/types/metadata.d.ts +0 -13
  206. package/lib/resources/types/navigation-property.d.ts +0 -157
  207. package/lib/resources/types/options.d.ts +0 -32
  208. package/lib/resources/types/property.d.ts +0 -115
  209. package/lib/resources/types/reference.d.ts +0 -74
  210. package/lib/resources/types/singleton.d.ts +0 -87
  211. package/lib/resources/types/value.d.ts +0 -19
  212. package/lib/schema/annotation.d.ts +0 -28
  213. package/lib/schema/callable.d.ts +0 -41
  214. package/lib/schema/element.d.ts +0 -52
  215. package/lib/schema/entity-container.d.ts +0 -10
  216. package/lib/schema/entity-set.d.ts +0 -10
  217. package/lib/schema/enum-type.d.ts +0 -55
  218. package/lib/schema/index.d.ts +0 -8
  219. package/lib/schema/parsers/callable.d.ts +0 -47
  220. package/lib/schema/parsers/edm.d.ts +0 -4
  221. package/lib/schema/parsers/enum-type.d.ts +0 -56
  222. package/lib/schema/parsers/index.d.ts +0 -4
  223. package/lib/schema/parsers/structured-type.d.ts +0 -172
  224. package/lib/schema/schema.d.ts +0 -26
  225. package/lib/schema/singleton.d.ts +0 -10
  226. package/lib/schema/structured-type.d.ts +0 -152
  227. package/lib/services/base.d.ts +0 -20
  228. package/lib/services/entity-set.d.ts +0 -120
  229. package/lib/services/entity.d.ts +0 -11
  230. package/lib/services/factory.d.ts +0 -33
  231. package/lib/services/index.d.ts +0 -4
  232. package/lib/services/singleton.d.ts +0 -44
  233. package/lib/settings.d.ts +0 -26
  234. package/lib/types.d.ts +0 -283
  235. package/lib/utils/arraybuffers.d.ts +0 -4
  236. package/lib/utils/arrays.d.ts +0 -3
  237. package/lib/utils/dates.d.ts +0 -3
  238. package/lib/utils/durations.d.ts +0 -14
  239. package/lib/utils/enums.d.ts +0 -23
  240. package/lib/utils/http.d.ts +0 -22
  241. package/lib/utils/index.d.ts +0 -9
  242. package/lib/utils/objects.d.ts +0 -37
  243. package/lib/utils/odata.d.ts +0 -4
  244. package/lib/utils/strings.d.ts +0 -7
  245. package/lib/utils/types.d.ts +0 -11
  246. package/lib/utils/urls.d.ts +0 -4
  247. package/public-api.d.ts +0 -1
@@ -1,75 +0,0 @@
1
- import { ODataContext, ODataVersionHelper } from './helper';
2
- import { ODataMetadataType } from './types';
3
- export declare abstract class ODataAnnotations<T> {
4
- helper: ODataVersionHelper;
5
- protected annotations: Map<string, any>;
6
- protected context?: ODataContext | undefined;
7
- constructor(helper: ODataVersionHelper, annotations?: Map<string, any>, context?: ODataContext | undefined);
8
- attributes(data: {
9
- [name: string]: any;
10
- }, metadata: ODataMetadataType): Partial<T>;
11
- update(data: {
12
- [name: string]: any;
13
- }): void;
14
- get entitySet(): string | undefined;
15
- get type(): string | undefined;
16
- abstract union(other: ODataAnnotations<any>): ODataAnnotations<any>;
17
- abstract clone(): ODataAnnotations<any>;
18
- abstract data(data: {
19
- [name: string]: any;
20
- }): {
21
- [name: string]: any;
22
- };
23
- }
24
- export declare class ODataPropertyAnnotations<T> extends ODataAnnotations<T> {
25
- union(other: ODataPropertyAnnotations<any>): ODataPropertyAnnotations<any>;
26
- clone(): ODataPropertyAnnotations<any>;
27
- data(data: {
28
- [name: string]: any;
29
- }): any;
30
- }
31
- export declare class ODataEntityAnnotations<T> extends ODataAnnotations<T> {
32
- union(other: ODataEntityAnnotations<any>): ODataEntityAnnotations<any>;
33
- clone(): ODataEntityAnnotations<any>;
34
- data(data: {
35
- [name: string]: any;
36
- }): any;
37
- get id(): string | undefined;
38
- get etag(): string | undefined;
39
- get mediaEtag(): string | undefined;
40
- get metadataEtag(): string | undefined;
41
- get readLink(): string | undefined;
42
- get editLink(): string | undefined;
43
- get mediaReadLink(): string | undefined;
44
- get mediaEditLink(): string | undefined;
45
- get mediaContentType(): string | undefined;
46
- private _properties?;
47
- get properties(): Map<keyof T, Map<string, any>>;
48
- property<F>(name: keyof T, type: 'collection'): ODataEntitiesAnnotations<F>;
49
- property<F>(name: keyof T, type: 'single'): ODataEntityAnnotations<F>;
50
- private _functions?;
51
- get functions(): {
52
- [name: string]: any;
53
- };
54
- function(name: string): any;
55
- }
56
- export declare class ODataEntitiesAnnotations<T> extends ODataAnnotations<T> {
57
- union(other: ODataEntitiesAnnotations<any>): ODataEntitiesAnnotations<any>;
58
- clone(): ODataEntitiesAnnotations<any>;
59
- data(data: {
60
- [name: string]: any;
61
- }): any;
62
- get readLink(): string | undefined;
63
- get count(): number | undefined;
64
- get nextLink(): string | undefined;
65
- get deltaLink(): string | undefined;
66
- get top(): number | undefined;
67
- get skip(): number | undefined;
68
- get skiptoken(): string | undefined;
69
- private _functions?;
70
- get functions(): {
71
- [name: string]: any;
72
- };
73
- function(name: string): any;
74
- entity(): ODataEntityAnnotations<T>;
75
- }
package/lib/api.d.ts DELETED
@@ -1,108 +0,0 @@
1
- import { Observable } from 'rxjs';
2
- import { ODataCache } from './cache';
3
- import { ModelOptions, ODataCollection, ODataModel, ODataModelOptions } from './models';
4
- import { ODataApiOptions } from './options';
5
- import { ODataOptions, ODataResource, ODataSegment } from './resources';
6
- import { ODataRequest, ODataBatchResource, ODataMetadataResource, ODataActionResource, ODataFunctionResource, ODataEntityResource, ODataEntitySetResource, ODataSingletonResource, ODataNavigationPropertyResource } from './resources';
7
- import { ODataCallable, ODataEntitySet, ODataEnumType, ODataSchema, ODataSingleton, ODataStructuredType } from './schema';
8
- import { ApiConfig, EdmType, ODataVersion, Parser, QueryOption, SchemaConfig } from './types';
9
- import { ODataMetadata } from './metadata/metadata';
10
- /**
11
- * Api abstraction for consuming OData services.
12
- */
13
- export declare class ODataApi {
14
- requester?: (request: ODataRequest<any>) => Observable<any>;
15
- serviceRootUrl: string;
16
- metadataUrl: string;
17
- name?: string;
18
- version: ODataVersion;
19
- default: boolean;
20
- creation: Date;
21
- options: ODataApiOptions;
22
- cache: ODataCache;
23
- errorHandler?: (error: any, caught: Observable<any>) => Observable<never>;
24
- parsers: Map<string, Parser<any>>;
25
- schemas: ODataSchema[];
26
- constructor(config: ApiConfig);
27
- configure(settings?: {
28
- requester?: (request: ODataRequest<any>) => Observable<any>;
29
- }): void;
30
- populate(metadata: ODataMetadata): void;
31
- fromJson<P, R>(json: {
32
- segments: ODataSegment[];
33
- options: {
34
- [name: string]: any;
35
- };
36
- }): ODataActionResource<P, R> | ODataFunctionResource<P, R>;
37
- fromJson<E>(json: {
38
- segments: ODataSegment[];
39
- options: {
40
- [name: string]: any;
41
- };
42
- }): ODataEntityResource<E> | ODataEntitySetResource<E> | ODataNavigationPropertyResource<E> | ODataSingletonResource<E>;
43
- /**
44
- * Build a metadata resource.
45
- * @returns ODataMetadataResource
46
- */
47
- metadata(): ODataMetadataResource;
48
- /**
49
- * Build a batch resource.
50
- * @returns ODataBatchResource
51
- */
52
- batch(): ODataBatchResource;
53
- /**
54
- * Build a singleton resource.
55
- * @param path Name of the singleton
56
- * @returns
57
- */
58
- singleton<T>(name: string): ODataSingletonResource<T>;
59
- /**
60
- * Build an entity set resource.
61
- * @param path Name of the entity set
62
- * @returns
63
- */
64
- entitySet<T>(name: string): ODataEntitySetResource<T>;
65
- /**
66
- * Unbound Action
67
- * @param {string} path?
68
- * @returns ODataActionResource
69
- */
70
- action<P, R>(path: string): ODataActionResource<P, R>;
71
- /**
72
- * Unbound Function
73
- * @param {string} path?
74
- * @returns ODataFunctionResource
75
- */
76
- function<P, R>(path: string): ODataFunctionResource<P, R>;
77
- callable<T>(type: string): ODataCallable<T> | undefined;
78
- enumType<T>(type: string): ODataEnumType<T> | undefined;
79
- structuredType<T>(type: string): ODataStructuredType<T> | undefined;
80
- request<T>(method: string, resource: ODataResource<any>, options: ODataOptions & {
81
- body?: any;
82
- etag?: string;
83
- responseType?: 'arraybuffer' | 'blob' | 'json' | 'text' | 'value' | 'property' | 'entity' | 'entities';
84
- observe?: 'body' | 'events' | 'response';
85
- withCount?: boolean;
86
- bodyQueryOptions?: QueryOption[];
87
- }): Observable<any>;
88
- private memo;
89
- createSchema(config: SchemaConfig): ODataSchema;
90
- findSchema(type: string): ODataSchema | undefined;
91
- findEnumType<T>(value: string): ODataEnumType<T> | undefined;
92
- findStructuredType<T>(value: string): ODataStructuredType<T> | undefined;
93
- findCallable<R>(value: string, bindingType?: string): ODataCallable<R> | undefined;
94
- findEntitySet(value: string): ODataEntitySet | undefined;
95
- findSingleton(value: string): ODataSingleton | undefined;
96
- findModel(type: string): typeof ODataModel | undefined;
97
- createModel(structured: ODataStructuredType<any>): typeof ODataModel;
98
- modelForType(type: string): typeof ODataModel;
99
- findCollection(type: string): typeof ODataCollection | undefined;
100
- createCollection(structured: ODataStructuredType<any>, model?: typeof ODataModel<any>): typeof ODataCollection;
101
- collectionForType(type: string): typeof ODataCollection;
102
- findEntitySetForEntityType(entityType: string): ODataEntitySet | undefined;
103
- parserForType<T>(type: string | EdmType, bindingType?: string): Parser<T>;
104
- optionsForType<T>(type: string, { structuredType, config, }?: {
105
- structuredType?: ODataStructuredType<T>;
106
- config?: ModelOptions;
107
- }): ODataModelOptions<T> | undefined;
108
- }
@@ -1,104 +0,0 @@
1
- import { Observable } from 'rxjs';
2
- import { ODataRequest, ODataResponse } from '../resources';
3
- import { Cache } from '../types';
4
- /**
5
- * A cache entry that holds a payload, a last read time, and a timeout for the entry.
6
- * @param payload The payload to cache.
7
- * @param lastRead The last read time.
8
- * @param timeout The timeout.
9
- * @param tags Some tags to identify the entry.
10
- */
11
- export interface ODataCacheEntry<T> {
12
- payload: T;
13
- lastRead: number;
14
- timeout: number;
15
- tags: string[];
16
- }
17
- export declare abstract class ODataCache implements Cache {
18
- timeout: number;
19
- entries: Map<string, ODataCacheEntry<any>>;
20
- constructor({ timeout }: {
21
- timeout?: number;
22
- });
23
- abstract getResponse(req: ODataRequest<any>): ODataResponse<any> | undefined;
24
- abstract putResponse(req: ODataRequest<any>, res: ODataResponse<any>): void;
25
- /**
26
- * Using the resource on the request build an array of string to identify the scope of the request
27
- * @param req The request with the resource to build the scope
28
- * @returns Array of string to identify the scope of the request
29
- */
30
- scope(req: ODataRequest<any>): string[];
31
- /**
32
- * Using the odata context on the response build an array of string to identify the tags of the response
33
- * @param res The response to build the tags
34
- * @returns Array of string to identify the tags of the response
35
- */
36
- tags(res: ODataResponse<any>): string[];
37
- /**
38
- * Build an entry from a payload and some options
39
- * @param payload The payload to store in the cache
40
- * @param timeout The timeout for the entry
41
- * @param tags The tags for the entry
42
- * @returns The entry to store in the cache
43
- */
44
- buildEntry<T>(payload: T, { timeout, tags }: {
45
- timeout?: number;
46
- tags?: string[];
47
- }): ODataCacheEntry<T>;
48
- /**
49
- * Build a key from store an entry in the cache
50
- * @param names The names of the entry
51
- * @returns The key for the entry
52
- */
53
- buildKey(names: string[]): string;
54
- /**
55
- * Put some payload in the cache
56
- * @param name The name for the entry
57
- * @param payload The payload to store in the cache
58
- * @param timeout The timeout for the entry
59
- * @param scope The scope for the entry
60
- * @param tags The tags for the entry
61
- */
62
- put<T>(name: string, payload: T, { timeout, scope, tags, }?: {
63
- timeout?: number;
64
- scope?: string[];
65
- tags?: string[];
66
- }): void;
67
- /**
68
- * Return the payload from the cache if it exists and is not expired
69
- * @param name The name of the entry
70
- * @param scope The scope of the entry
71
- * @returns The payload of the entry
72
- */
73
- get<T>(name: string, { scope }?: {
74
- scope?: string[];
75
- }): T;
76
- /**
77
- * Remove all cache entries that are matching with the given options
78
- * @param options The options to forget
79
- */
80
- forget({ name, scope, tags, }?: {
81
- name?: string;
82
- scope?: string[];
83
- tags?: string[];
84
- }): void;
85
- /**
86
- * Remove all cache entries
87
- */
88
- flush(): void;
89
- /**
90
- * Check if the entry is expired
91
- * @param entry The cache entry
92
- * @returns Boolean indicating if the entry is expired
93
- */
94
- isExpired(entry: ODataCacheEntry<any>): boolean;
95
- /**
96
- * Using the request, handle the fetching of the response
97
- * @param req The request to fetch
98
- * @param res$ Observable of the response
99
- * @returns
100
- */
101
- handleRequest(req: ODataRequest<any>, res$: Observable<ODataResponse<any>>): Observable<ODataResponse<any>>;
102
- private handleFetch;
103
- private handleMutate;
104
- }
@@ -1,3 +0,0 @@
1
- export * from './cache';
2
- export * from './memory';
3
- export * from './storage';
@@ -1,19 +0,0 @@
1
- import { ODataRequest, ODataResponse } from '../resources';
2
- import { ODataCache } from './cache';
3
- export declare class ODataInMemoryCache extends ODataCache {
4
- constructor({ timeout }?: {
5
- timeout?: number;
6
- });
7
- /**
8
- * Store the response in the cache
9
- * @param req The request with the resource to store the response
10
- * @param res The response to store in the cache
11
- */
12
- putResponse(req: ODataRequest<any>, res: ODataResponse<any>): void;
13
- /**
14
- * Restore the response from the cache
15
- * @param req The request with the resource to get the response
16
- * @returns The response from the cache
17
- */
18
- getResponse(req: ODataRequest<any>): ODataResponse<any> | undefined;
19
- }
@@ -1,35 +0,0 @@
1
- import { ODataRequest, ODataResponse } from '../resources';
2
- import { ODataCache } from './cache';
3
- export declare class ODataInStorageCache extends ODataCache {
4
- name: string;
5
- storage: Storage;
6
- constructor({ name, storage, timeout, }: {
7
- timeout?: number;
8
- name: string;
9
- storage?: Storage;
10
- });
11
- /**
12
- * Store the cache in the storage
13
- */
14
- store(): void;
15
- /**
16
- * Restore the cache from the storage
17
- */
18
- restore(): void;
19
- /**
20
- * Flush the cache and clean the storage
21
- */
22
- flush(): void;
23
- /**
24
- * Store the response in the cache
25
- * @param req The request with the resource to store the response
26
- * @param res The response to store in the cache
27
- */
28
- putResponse(req: ODataRequest<any>, res: ODataResponse<any>): void;
29
- /**
30
- * Restore the response from the cache
31
- * @param req The request with the resource to get the response
32
- * @returns The response from the cache
33
- */
34
- getResponse(req: ODataRequest<any>): ODataResponse<any> | undefined;
35
- }