breeze-client 2.2.2 → 3.0.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 (299) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +83 -63
  3. package/adapters/abstract-data-service-adapter.d.ts +120 -0
  4. package/adapters/abstract-data-service-adapter.js +395 -0
  5. package/adapters/abstract-data-service-adapter.js.map +1 -0
  6. package/adapters/adapter-ajax-fetch.d.ts +12 -0
  7. package/adapters/adapter-ajax-fetch.js +13 -0
  8. package/adapters/adapter-ajax-fetch.js.map +1 -0
  9. package/{adapter-ajax-post → adapters}/adapter-ajax-post.d.ts +40 -36
  10. package/{fesm2022/breeze-client-adapter-ajax-post.mjs → adapters/adapter-ajax-post.js} +80 -82
  11. package/adapters/adapter-ajax-post.js.map +1 -0
  12. package/{adapter-ajax-fetch → adapters}/adapter-core.d.ts +4 -4
  13. package/{fesm2022/breeze-client-adapter-uri-builder-json.mjs → adapters/adapter-core.js} +48 -91
  14. package/adapters/adapter-core.js.map +1 -0
  15. package/adapters/adapter-data-service-webapi.d.ts +9 -0
  16. package/{fesm2022/breeze-client-adapter-data-service-webapi.mjs → adapters/adapter-data-service-webapi.js} +105 -107
  17. package/adapters/adapter-data-service-webapi.js.map +1 -0
  18. package/adapters/adapter-model-library-backing-store.d.ts +32 -0
  19. package/adapters/adapter-model-library-backing-store.js +321 -0
  20. package/adapters/adapter-model-library-backing-store.js.map +1 -0
  21. package/adapters/adapter-uri-builder-json.d.ts +11 -0
  22. package/adapters/adapter-uri-builder-json.js +40 -0
  23. package/adapters/adapter-uri-builder-json.js.map +1 -0
  24. package/adapters/http.d.ts +52 -0
  25. package/adapters/http.js +202 -0
  26. package/adapters/http.js.map +1 -0
  27. package/angular/adapter-angular-httpclient.d.ts +21 -0
  28. package/angular/adapter-angular-httpclient.js +70 -0
  29. package/angular/adapter-angular-httpclient.js.map +1 -0
  30. package/breeze.d.ts +215 -0
  31. package/breeze.js +141 -0
  32. package/breeze.js.map +1 -0
  33. package/config/config.d.ts +212 -0
  34. package/config/config.js +392 -0
  35. package/config/config.js.map +1 -0
  36. package/config/configure.d.ts +66 -0
  37. package/config/configure.js +46 -0
  38. package/config/configure.js.map +1 -0
  39. package/config/default-adapters.d.ts +1 -0
  40. package/config/default-adapters.js +40 -0
  41. package/config/default-adapters.js.map +1 -0
  42. package/config/interface-registry.d.ts +191 -0
  43. package/config/interface-registry.js +5 -0
  44. package/config/interface-registry.js.map +1 -0
  45. package/{src → core}/assert-param.d.ts +52 -60
  46. package/core/assert-param.js +390 -0
  47. package/core/assert-param.js.map +1 -0
  48. package/core/core.d.ts +285 -0
  49. package/core/core.js +772 -0
  50. package/core/core.js.map +1 -0
  51. package/core/enum.d.ts +116 -0
  52. package/core/enum.js +167 -0
  53. package/core/enum.js.map +1 -0
  54. package/core/event.d.ts +169 -0
  55. package/core/event.js +338 -0
  56. package/core/event.js.map +1 -0
  57. package/entity/array.d.ts +3 -0
  58. package/entity/array.js +4 -0
  59. package/entity/array.js.map +1 -0
  60. package/entity/complex-array.d.ts +17 -0
  61. package/entity/complex-array.js +104 -0
  62. package/entity/complex-array.js.map +1 -0
  63. package/entity/default-property-interceptor.d.ts +1 -0
  64. package/entity/default-property-interceptor.js +496 -0
  65. package/entity/default-property-interceptor.js.map +1 -0
  66. package/{src → entity}/entity-action.d.ts +36 -42
  67. package/entity/entity-action.js +45 -0
  68. package/entity/entity-action.js.map +1 -0
  69. package/entity/entity-aspect.d.ts +457 -0
  70. package/entity/entity-aspect.js +1262 -0
  71. package/entity/entity-aspect.js.map +1 -0
  72. package/entity/entity-base.d.ts +55 -0
  73. package/entity/entity-base.js +41 -0
  74. package/entity/entity-base.js.map +1 -0
  75. package/entity/entity-group.d.ts +1 -0
  76. package/entity/entity-group.js +224 -0
  77. package/entity/entity-group.js.map +1 -0
  78. package/entity/entity-key.d.ts +95 -0
  79. package/entity/entity-key.js +189 -0
  80. package/entity/entity-key.js.map +1 -0
  81. package/{src → entity}/entity-state.d.ts +112 -84
  82. package/entity/entity-state.js +135 -0
  83. package/entity/entity-state.js.map +1 -0
  84. package/entity/key-generator.d.ts +57 -0
  85. package/entity/key-generator.js +155 -0
  86. package/entity/key-generator.js.map +1 -0
  87. package/entity/observable-array.d.ts +25 -0
  88. package/entity/observable-array.js +230 -0
  89. package/entity/observable-array.js.map +1 -0
  90. package/entity/primitive-array.d.ts +12 -0
  91. package/entity/primitive-array.js +71 -0
  92. package/entity/primitive-array.js.map +1 -0
  93. package/entity/relation-array.d.ts +24 -0
  94. package/entity/relation-array.js +176 -0
  95. package/entity/relation-array.js.map +1 -0
  96. package/entity/unattached-children-map.d.ts +1 -0
  97. package/entity/unattached-children-map.js +105 -0
  98. package/entity/unattached-children-map.js.map +1 -0
  99. package/generate-entity-classes.js +1176 -0
  100. package/manager/entity-manager.d.ts +801 -0
  101. package/manager/entity-manager.js +2395 -0
  102. package/manager/entity-manager.js.map +1 -0
  103. package/{src → manager}/save-options.d.ts +48 -42
  104. package/manager/save-options.js +51 -0
  105. package/manager/save-options.js.map +1 -0
  106. package/{src → metadata}/data-service.d.ts +229 -184
  107. package/metadata/data-service.js +246 -0
  108. package/metadata/data-service.js.map +1 -0
  109. package/metadata/data-type.d.ts +122 -0
  110. package/metadata/data-type.js +465 -0
  111. package/metadata/data-type.js.map +1 -0
  112. package/metadata/entity-metadata.d.ts +1193 -0
  113. package/metadata/entity-metadata.js +2502 -0
  114. package/metadata/entity-metadata.js.map +1 -0
  115. package/{src → metadata}/local-query-comparison-options.d.ts +65 -59
  116. package/metadata/local-query-comparison-options.js +69 -0
  117. package/metadata/local-query-comparison-options.js.map +1 -0
  118. package/{src → metadata}/naming-convention.d.ts +75 -72
  119. package/metadata/naming-convention.js +97 -0
  120. package/metadata/naming-convention.js.map +1 -0
  121. package/mixins/mixin-get-entity-graph.d.ts +63 -0
  122. package/{fesm2022/breeze-client-mixin-get-entity-graph.mjs → mixins/mixin-get-entity-graph.js} +331 -253
  123. package/mixins/mixin-get-entity-graph.js.map +1 -0
  124. package/mixins/mixin-save-queuing.d.ts +98 -0
  125. package/{fesm2022/breeze-client-mixin-save-queuing.mjs → mixins/mixin-save-queuing.js} +493 -365
  126. package/mixins/mixin-save-queuing.js.map +1 -0
  127. package/package.json +63 -94
  128. package/query/entity-query.d.ts +521 -0
  129. package/query/entity-query.js +1149 -0
  130. package/query/entity-query.js.map +1 -0
  131. package/{src → query}/mapping-context.d.ts +44 -46
  132. package/query/mapping-context.js +412 -0
  133. package/query/mapping-context.js.map +1 -0
  134. package/query/predicate.d.ts +394 -0
  135. package/query/predicate.js +1294 -0
  136. package/query/predicate.js.map +1 -0
  137. package/query/property-path.d.ts +252 -0
  138. package/query/property-path.js +2 -0
  139. package/query/property-path.js.map +1 -0
  140. package/{src → query}/query-options.d.ts +143 -119
  141. package/query/query-options.js +180 -0
  142. package/query/query-options.js.map +1 -0
  143. package/rxjs/breeze-rxjs.d.ts +72 -0
  144. package/rxjs/breeze-rxjs.js +117 -0
  145. package/rxjs/breeze-rxjs.js.map +1 -0
  146. package/validation/validate.d.ts +583 -0
  147. package/validation/validate.js +961 -0
  148. package/validation/validate.js.map +1 -0
  149. package/{src → validation}/validation-options.d.ts +67 -63
  150. package/validation/validation-options.js +70 -0
  151. package/validation/validation-options.js.map +1 -0
  152. package/adapter-ajax-angularjs/adapter-ajax-angularjs.d.ts +0 -17
  153. package/adapter-ajax-angularjs/adapter-core.d.ts +0 -4
  154. package/adapter-ajax-angularjs/index.d.ts +0 -5
  155. package/adapter-ajax-fetch/adapter-ajax-fetch.d.ts +0 -18
  156. package/adapter-ajax-fetch/index.d.ts +0 -5
  157. package/adapter-ajax-httpclient/adapter-ajax-httpclient.d.ts +0 -13
  158. package/adapter-ajax-httpclient/adapter-core.d.ts +0 -4
  159. package/adapter-ajax-httpclient/index.d.ts +0 -5
  160. package/adapter-ajax-jquery/adapter-ajax-jquery.d.ts +0 -15
  161. package/adapter-ajax-jquery/index.d.ts +0 -5
  162. package/adapter-ajax-post/index.d.ts +0 -5
  163. package/adapter-data-service-odata/adapter-core.d.ts +0 -4
  164. package/adapter-data-service-odata/adapter-data-service-odata.d.ts +0 -17
  165. package/adapter-data-service-odata/index.d.ts +0 -5
  166. package/adapter-data-service-webapi/adapter-data-service-webapi.d.ts +0 -15
  167. package/adapter-data-service-webapi/index.d.ts +0 -5
  168. package/adapter-model-library-backing-store/adapter-model-library-backing-store.d.ts +0 -10
  169. package/adapter-model-library-backing-store/index.d.ts +0 -5
  170. package/adapter-model-library-ko/adapter-model-library-ko.d.ts +0 -10
  171. package/adapter-model-library-ko/index.d.ts +0 -5
  172. package/adapter-uri-builder-json/adapter-core.d.ts +0 -4
  173. package/adapter-uri-builder-json/adapter-uri-builder-json.d.ts +0 -8
  174. package/adapter-uri-builder-json/index.d.ts +0 -5
  175. package/adapter-uri-builder-odata/adapter-core.d.ts +0 -4
  176. package/adapter-uri-builder-odata/adapter-uri-builder-odata.d.ts +0 -8
  177. package/adapter-uri-builder-odata/index.d.ts +0 -5
  178. package/esm2022/adapter-ajax-angularjs/adapter-ajax-angularjs.mjs +0 -135
  179. package/esm2022/adapter-ajax-angularjs/adapter-core.mjs +0 -49
  180. package/esm2022/adapter-ajax-angularjs/breeze-client-adapter-ajax-angularjs.mjs +0 -5
  181. package/esm2022/adapter-ajax-fetch/adapter-ajax-fetch.mjs +0 -135
  182. package/esm2022/adapter-ajax-fetch/adapter-core.mjs +0 -49
  183. package/esm2022/adapter-ajax-fetch/breeze-client-adapter-ajax-fetch.mjs +0 -5
  184. package/esm2022/adapter-ajax-httpclient/adapter-ajax-httpclient.mjs +0 -139
  185. package/esm2022/adapter-ajax-httpclient/adapter-core.mjs +0 -49
  186. package/esm2022/adapter-ajax-httpclient/breeze-client-adapter-ajax-httpclient.mjs +0 -5
  187. package/esm2022/adapter-ajax-jquery/adapter-ajax-jquery.mjs +0 -107
  188. package/esm2022/adapter-ajax-jquery/breeze-client-adapter-ajax-jquery.mjs +0 -5
  189. package/esm2022/adapter-ajax-post/adapter-ajax-post.mjs +0 -77
  190. package/esm2022/adapter-ajax-post/breeze-client-adapter-ajax-post.mjs +0 -5
  191. package/esm2022/adapter-data-service-odata/adapter-core.mjs +0 -49
  192. package/esm2022/adapter-data-service-odata/adapter-data-service-odata.mjs +0 -461
  193. package/esm2022/adapter-data-service-odata/breeze-client-adapter-data-service-odata.mjs +0 -5
  194. package/esm2022/adapter-data-service-webapi/adapter-data-service-webapi.mjs +0 -100
  195. package/esm2022/adapter-data-service-webapi/breeze-client-adapter-data-service-webapi.mjs +0 -5
  196. package/esm2022/adapter-model-library-backing-store/adapter-model-library-backing-store.mjs +0 -269
  197. package/esm2022/adapter-model-library-backing-store/breeze-client-adapter-model-library-backing-store.mjs +0 -5
  198. package/esm2022/adapter-model-library-ko/adapter-model-library-ko.mjs +0 -241
  199. package/esm2022/adapter-model-library-ko/breeze-client-adapter-model-library-ko.mjs +0 -5
  200. package/esm2022/adapter-uri-builder-json/adapter-core.mjs +0 -49
  201. package/esm2022/adapter-uri-builder-json/adapter-uri-builder-json.mjs +0 -37
  202. package/esm2022/adapter-uri-builder-json/breeze-client-adapter-uri-builder-json.mjs +0 -5
  203. package/esm2022/adapter-uri-builder-odata/adapter-core.mjs +0 -49
  204. package/esm2022/adapter-uri-builder-odata/adapter-uri-builder-odata.mjs +0 -191
  205. package/esm2022/adapter-uri-builder-odata/breeze-client-adapter-uri-builder-odata.mjs +0 -5
  206. package/esm2022/breeze-client.mjs +0 -5
  207. package/esm2022/index.mjs +0 -2
  208. package/esm2022/mixin-get-entity-graph/breeze-client-mixin-get-entity-graph.mjs +0 -5
  209. package/esm2022/mixin-get-entity-graph/mixin-get-entity-graph.mjs +0 -269
  210. package/esm2022/mixin-save-queuing/breeze-client-mixin-save-queuing.mjs +0 -5
  211. package/esm2022/mixin-save-queuing/mixin-save-queuing.mjs +0 -421
  212. package/esm2022/src/abstract-data-service-adapter.mjs +0 -325
  213. package/esm2022/src/array.mjs +0 -4
  214. package/esm2022/src/assert-param.mjs +0 -330
  215. package/esm2022/src/breeze.mjs +0 -85
  216. package/esm2022/src/complex-array.mjs +0 -117
  217. package/esm2022/src/config.mjs +0 -232
  218. package/esm2022/src/core.mjs +0 -712
  219. package/esm2022/src/csdl-metadata-parser.mjs +0 -385
  220. package/esm2022/src/data-service.mjs +0 -221
  221. package/esm2022/src/data-type.mjs +0 -510
  222. package/esm2022/src/default-property-interceptor.mjs +0 -460
  223. package/esm2022/src/entity-action.mjs +0 -45
  224. package/esm2022/src/entity-aspect.mjs +0 -897
  225. package/esm2022/src/entity-group.mjs +0 -192
  226. package/esm2022/src/entity-key.mjs +0 -125
  227. package/esm2022/src/entity-manager.mjs +0 -2163
  228. package/esm2022/src/entity-metadata.mjs +0 -2242
  229. package/esm2022/src/entity-query.mjs +0 -1024
  230. package/esm2022/src/entity-state.mjs +0 -107
  231. package/esm2022/src/enum.mjs +0 -143
  232. package/esm2022/src/event.mjs +0 -264
  233. package/esm2022/src/interface-registry.mjs +0 -39
  234. package/esm2022/src/key-generator.mjs +0 -110
  235. package/esm2022/src/local-query-comparison-options.mjs +0 -65
  236. package/esm2022/src/mapping-context.mjs +0 -411
  237. package/esm2022/src/naming-convention.mjs +0 -92
  238. package/esm2022/src/observable-array.mjs +0 -183
  239. package/esm2022/src/predicate.mjs +0 -1259
  240. package/esm2022/src/primitive-array.mjs +0 -85
  241. package/esm2022/src/query-options.mjs +0 -152
  242. package/esm2022/src/relation-array.mjs +0 -173
  243. package/esm2022/src/save-options.mjs +0 -41
  244. package/esm2022/src/unattached-children-map.mjs +0 -56
  245. package/esm2022/src/validate.mjs +0 -995
  246. package/esm2022/src/validation-options.mjs +0 -64
  247. package/fesm2022/breeze-client-adapter-ajax-angularjs.mjs +0 -190
  248. package/fesm2022/breeze-client-adapter-ajax-angularjs.mjs.map +0 -1
  249. package/fesm2022/breeze-client-adapter-ajax-fetch.mjs +0 -190
  250. package/fesm2022/breeze-client-adapter-ajax-fetch.mjs.map +0 -1
  251. package/fesm2022/breeze-client-adapter-ajax-httpclient.mjs +0 -194
  252. package/fesm2022/breeze-client-adapter-ajax-httpclient.mjs.map +0 -1
  253. package/fesm2022/breeze-client-adapter-ajax-jquery.mjs +0 -114
  254. package/fesm2022/breeze-client-adapter-ajax-jquery.mjs.map +0 -1
  255. package/fesm2022/breeze-client-adapter-ajax-post.mjs.map +0 -1
  256. package/fesm2022/breeze-client-adapter-data-service-odata.mjs +0 -516
  257. package/fesm2022/breeze-client-adapter-data-service-odata.mjs.map +0 -1
  258. package/fesm2022/breeze-client-adapter-data-service-webapi.mjs.map +0 -1
  259. package/fesm2022/breeze-client-adapter-model-library-backing-store.mjs +0 -276
  260. package/fesm2022/breeze-client-adapter-model-library-backing-store.mjs.map +0 -1
  261. package/fesm2022/breeze-client-adapter-model-library-ko.mjs +0 -248
  262. package/fesm2022/breeze-client-adapter-model-library-ko.mjs.map +0 -1
  263. package/fesm2022/breeze-client-adapter-uri-builder-json.mjs.map +0 -1
  264. package/fesm2022/breeze-client-adapter-uri-builder-odata.mjs +0 -246
  265. package/fesm2022/breeze-client-adapter-uri-builder-odata.mjs.map +0 -1
  266. package/fesm2022/breeze-client-mixin-get-entity-graph.mjs.map +0 -1
  267. package/fesm2022/breeze-client-mixin-save-queuing.mjs.map +0 -1
  268. package/fesm2022/breeze-client.mjs +0 -14144
  269. package/fesm2022/breeze-client.mjs.map +0 -1
  270. package/index.d.ts +0 -1
  271. package/mixin-get-entity-graph/index.d.ts +0 -5
  272. package/mixin-get-entity-graph/mixin-get-entity-graph.d.ts +0 -31
  273. package/mixin-save-queuing/index.d.ts +0 -5
  274. package/mixin-save-queuing/mixin-save-queuing.d.ts +0 -32
  275. package/src/abstract-data-service-adapter.d.ts +0 -84
  276. package/src/array.d.ts +0 -3
  277. package/src/breeze.d.ts +0 -139
  278. package/src/complex-array.d.ts +0 -13
  279. package/src/config.d.ts +0 -104
  280. package/src/core.d.ts +0 -164
  281. package/src/csdl-metadata-parser.d.ts +0 -7
  282. package/src/data-type.d.ts +0 -89
  283. package/src/default-property-interceptor.d.ts +0 -4
  284. package/src/entity-aspect.d.ts +0 -332
  285. package/src/entity-group.d.ts +0 -28
  286. package/src/entity-key.d.ts +0 -77
  287. package/src/entity-manager.d.ts +0 -680
  288. package/src/entity-metadata.d.ts +0 -988
  289. package/src/entity-query.d.ts +0 -444
  290. package/src/enum.d.ts +0 -100
  291. package/src/event.d.ts +0 -142
  292. package/src/interface-registry.d.ts +0 -150
  293. package/src/key-generator.d.ts +0 -12
  294. package/src/observable-array.d.ts +0 -52
  295. package/src/predicate.d.ts +0 -376
  296. package/src/primitive-array.d.ts +0 -7
  297. package/src/relation-array.d.ts +0 -18
  298. package/src/unattached-children-map.d.ts +0 -19
  299. package/src/validate.d.ts +0 -650
@@ -1,444 +0,0 @@
1
- import { Callback, ErrorCallback } from './core';
2
- import { Entity } from './entity-aspect';
3
- import { EntityKey } from './entity-key';
4
- import { BreezeEnum } from './enum';
5
- import { DataService, JsonResultsAdapter } from './data-service';
6
- import { EntityManager, QueryResult } from './entity-manager';
7
- import { MetadataStore, EntityType, NavigationProperty, EntityProperty } from './entity-metadata';
8
- import { QueryOptions, MergeStrategy, FetchStrategy } from './query-options';
9
- import { Predicate } from './predicate';
10
- export interface RecursiveArray<T> {
11
- [i: number]: T | RecursiveArray<T>;
12
- }
13
- export interface EntityQueryJsonContext {
14
- entityType?: EntityType;
15
- propertyPathFn?: Function;
16
- toNameOnServer?: boolean;
17
- }
18
- /**
19
- An EntityQuery instance is used to query entities either from a remote datasource or from a local [[EntityManager]].
20
-
21
- EntityQueries are immutable - this means that all EntityQuery methods that return an EntityQuery actually create a new EntityQuery. This means that
22
- EntityQueries can be 'modified' without affecting any current instances.
23
- @dynamic
24
- **/
25
- export declare class EntityQuery {
26
- /** @hidden @internal */
27
- _$typeName: string;
28
- /** The resource name used by this query. __Read Only__ */
29
- resourceName?: string;
30
- /** The [[EntityType]] that is associated with the 'from' clause ( resourceName) of the query. This is only guaranteed to be be set AFTER the query
31
- has been executed because it depends on the [[MetadataStore]] associated with the [[EntityManager]] that the query was executed against.
32
- This value may be null if the entityType cannot be associated with a resourceName. __Read Only__ */
33
- fromEntityType?: EntityType;
34
- /** The 'where' [[Predicate]] used by this query. __Read Only__ */
35
- wherePredicate: Predicate;
36
- /** The [[OrderByClause]] used by this query. __Read Only__ */
37
- orderByClause?: OrderByClause;
38
- /** The [[ExpandClause]] used by this query. __Read Only__ */
39
- expandClause?: ExpandClause;
40
- /** The [[SelectClause]] used by this query. __Read Only__ */
41
- selectClause?: SelectClause;
42
- /** The number of entities to 'skip' for this query. __Read Only__ */
43
- skipCount?: number;
44
- /** The number of entities to 'take' for this query. __Read Only__ */
45
- takeCount?: number;
46
- /** Any additional parameters that were added to the query via the 'withParameters' method. __Read Only__ */
47
- parameters: Object;
48
- /** Whether an inline count is returned for this query. __Read Only__ */
49
- inlineCountEnabled: boolean;
50
- /** Whether entity tracking has been disabled for this query. __Read Only__ */
51
- noTrackingEnabled: boolean;
52
- /** Whether to send query as the body of a POST request. (Server needs to accomodate POST). __Read Only__ */
53
- usePostEnabled: boolean;
54
- /** The [[QueryOptions]] for this query. __Read Only__ **/
55
- queryOptions?: QueryOptions;
56
- /** The [[DataService]] for this query. __Read Only__ **/
57
- dataService?: DataService;
58
- /** The [[EntityManager]] for this query. This may be null and can be set via the 'using' method. **/
59
- entityManager?: EntityManager;
60
- /** The entityType that will be returned by this query.
61
- This property will only be set if the 'toType' method was called. __Read Only__ */
62
- resultEntityType: EntityType | string;
63
- usesNameOnServer?: boolean;
64
- /** Constructor
65
- > let query = new EntityQuery("Customers")
66
-
67
- Usually this constructor will be followed by calls to filtering, ordering or selection methods
68
- > let query = new EntityQuery("Customers")
69
- > .where("CompanyName", "startsWith", "C")
70
- > .orderBy("Region");
71
- @param resourceName - either a resource name or a serialized EntityQuery ( created by [[EntityQuery.toJSON]])
72
- **/
73
- constructor(resourceName?: string | Object);
74
- /**
75
- Specifies the resource to query for this EntityQuery.
76
- > let query = new EntityQuery()
77
- > .from("Customers");
78
-
79
- is the same as
80
- > let query = new EntityQuery("Customers");
81
- @param resourceName - The resource to query.
82
- **/
83
- from(resourceName: string): EntityQuery;
84
- /**
85
- This is a static version of the "from" method and it creates a 'base' entityQuery for the specified resource name.
86
- > let query = EntityQuery.from("Customers");
87
-
88
- is the same as
89
- > let query = new EntityQuery("Customers");
90
- @param resourceName - The resource to query.
91
- **/
92
- static from(resourceName: string): EntityQuery;
93
- /**
94
- Specifies the top level EntityType that this query will return. Only needed when a query returns a json result that does not include type information,
95
- or when using a resource name that is not associated to an EntityType.
96
- > let query = new EntityQuery()
97
- > .from("MyCustomMethod")
98
- > .toType("Customer")
99
- @param entityType - The top level EntityType that this query will return.
100
- @summary If the json result consists of more than a simple entity or array of entities, consider using a [[JsonResultsAdapter]] instead.
101
- **/
102
- toType(entityType: string | EntityType): EntityQuery;
103
- where(predicate?: Predicate): EntityQuery;
104
- where(predicate: Object): EntityQuery;
105
- where(property: string, operator: string, value: any): EntityQuery;
106
- where(property: string, operator: FilterQueryOp, value: any): EntityQuery;
107
- where(property: string, filterop: FilterQueryOp, property2: string, filterop2: FilterQueryOp, value: any): EntityQuery;
108
- where(property: string, filterop: string, property2: string, filterop2: string, value: any): EntityQuery;
109
- where(property: string, filterop: string, property2: string, filterop2: string, property3: string, filterop3: string, value: any): EntityQuery;
110
- where(anArray: RecursiveArray<string | number | FilterQueryOp | Predicate>): EntityQuery;
111
- orderBy(propertyPaths?: string, isDescending?: boolean): EntityQuery;
112
- orderBy(propertyPaths: string[], isDescending?: boolean): EntityQuery;
113
- orderByDesc(propertyPaths: string): EntityQuery;
114
- orderByDesc(propertyPaths: string[]): EntityQuery;
115
- /**
116
- Returns a new query that selects a list of properties from the results of the original query and returns the values of just these properties. This
117
- will be referred to as a projection.
118
- If the result of this selection "projection" contains entities, these entities will automatically be added to EntityManager's cache and will
119
- be made 'observable'.
120
- Any simple properties, i.e. strings, numbers or dates within a projection will not be cached are will NOT be made 'observable'.
121
-
122
- Simple data properties can be projected
123
- > let query = new EntityQuery("Customers")
124
- > .where("CompanyName", "startsWith", "C")
125
- > .select("CompanyName");
126
-
127
- This will return an array of objects each with a single "CompanyName" property of type string.
128
- A similar query could return a navigation property instead
129
- > let query = new EntityQuery("Customers")
130
- > .where("CompanyName", "startsWith", "C")
131
- > .select("Orders");
132
-
133
- where the result would be an array of objects each with a single "Orders" property that would itself be an array of "Order" entities.
134
- Composite projections are also possible:
135
- > let query = new EntityQuery("Customers")
136
- > .where("CompanyName", "startsWith", "C")
137
- > .select("CompanyName, Orders");
138
-
139
- As well as projections involving nested property paths
140
- > let query = EntityQuery("Orders")
141
- > .where("Customer.CompanyName", "startsWith", "C")
142
- > .select("Customer.CompanyName, Customer, OrderDate");
143
- @param propertyPaths - A comma-separated (',') string of property paths or an array of property paths.
144
- If 'propertyPaths' is either null or omitted then any existing projection on the query is removed.
145
- **/
146
- select(propertyPaths?: string | string[]): EntityQuery;
147
- /**
148
- Returns a new query that skips the specified number of entities when returning results.
149
- Any existing 'skip' can be cleared by calling 'skip' with no arguments.
150
- > let query = new EntityQuery("Customers")
151
- > .where("CompanyName", "startsWith", "C")
152
- > .skip(5);
153
- @param count - The number of entities to skip over. If omitted or null any existing skip count on the query is removed.
154
- **/
155
- skip(count?: number): EntityQuery;
156
- /**
157
- Returns a new query that returns only the specified number of entities when returning results. - Same as 'take'.
158
- Any existing 'top' can be cleared by calling 'top' with no arguments.
159
- > let query = new EntityQuery("Customers")
160
- > .top(5);
161
- @param count - The number of entities to return.
162
- If 'count' is either null or omitted then any existing 'top' count on the query is removed.
163
- **/
164
- top(count?: number): EntityQuery;
165
- /**
166
- Returns a new query that returns only the specified number of entities when returning results - Same as 'top'.
167
- Any existing take can be cleared by calling take with no arguments.
168
- > let query = new EntityQuery("Customers")
169
- > .take(5);
170
- @param count - The number of entities to return.
171
- If 'count' is either null or omitted then any existing 'take' count on the query is removed.
172
- **/
173
- take(count?: number): EntityQuery;
174
- /**
175
- Returns a new query that will return related entities nested within its results. The expand method allows you to identify related entities, via navigation property
176
- names such that a graph of entities may be retrieved with a single request. Any filtering occurs before the results are 'expanded'.
177
- > let query = new EntityQuery("Customers")
178
- > .where("CompanyName", "startsWith", "C")
179
- > .expand("Orders");
180
-
181
- will return the filtered customers each with its "Orders" properties fully resolved.
182
- Multiple paths may be specified by separating the paths by a ','
183
- > let query = new EntityQuery("Orders")
184
- > .expand("Customer, Employee")
185
-
186
- and nested property paths my be specified as well
187
- > let query = new EntityQuery("Orders")
188
- > .expand("Customer, OrderDetails, OrderDetails.Product")
189
- @param propertyPaths - A comma-separated list of navigation property names or an array of navigation property names. Each Navigation Property name can be followed
190
- by a '.' and another navigation property name to enable identifying a multi-level relationship.
191
- If 'propertyPaths' is either null or omitted then any existing 'expand' clause on the query is removed.
192
- **/
193
- expand(propertyPaths?: string | string[]): EntityQuery;
194
- /**
195
- Returns a new query that includes a collection of parameters to pass to the server.
196
- > let query = EntityQuery.from("EmployeesFilteredByCountryAndBirthdate")
197
- > .withParameters({ BirthDate: "1/1/1960", Country: "USA" });
198
-
199
- will call the 'EmployeesFilteredByCountryAndBirthdate' method on the server and pass in 2 parameters. This
200
- query will be uri encoded as
201
- > {serviceApi}/EmployeesFilteredByCountryAndBirthdate?birthDate=1%2F1%2F1960&country=USA
202
-
203
- Parameters may also be mixed in with other query criteria.
204
- > let query = EntityQuery.from("EmployeesFilteredByCountryAndBirthdate")
205
- > .withParameters({ BirthDate: "1/1/1960", Country: "USA" })
206
- > .where("LastName", "startsWith", "S")
207
- > .orderBy("BirthDate");
208
- @param parameters - A parameters object where the keys are the parameter names and the values are the parameter values.
209
- **/
210
- withParameters(parameters: Object): EntityQuery;
211
- /**
212
- Returns a query with the `inlineCount` capability either enabled or disabled. With `inlineCount` enabled, an additional 'inlineCount' property
213
- will be returned with the query results that will contain the number of entities that would have been returned by this
214
- query with only the 'where'/'filter' clauses applied, i.e. without any 'skip'/'take' operators applied. For local queries this clause is ignored.
215
- > let query = new EntityQuery("Customers")
216
- > .take(20)
217
- > .orderBy("CompanyName")
218
- > .inlineCount(true);
219
-
220
- will return the first 20 customers as well as a count of _all_ of the customers in the remote store.
221
- @param enabled - (default = true) Whether or not inlineCount capability should be enabled. If this parameter is omitted, true is assumed.
222
- **/
223
- inlineCount(enabled?: boolean): EntityQuery;
224
- useNameOnServer(usesNameOnServer?: boolean): EntityQuery;
225
- /**
226
- Returns a query with the `noTracking` capability either enabled or disabled. With `noTracking` enabled, the results of this query
227
- will not be coerced into entities but will instead look like raw javascript projections. i.e. simple javascript objects.
228
- > let query = new EntityQuery("Customers")
229
- > .take(20)
230
- > .orderBy("CompanyName")
231
- > .noTracking(true);
232
- @param enabled - (default = true) Whether or not the noTracking capability should be enabled. If this parameter is omitted, true is assumed.
233
- **/
234
- noTracking(enabled?: boolean): EntityQuery;
235
- /**
236
- Returns a query with the `usePost` capability either enabled or disabled. With `usePost` enabled, the query is sent
237
- as a POST request (instead of GET) and the query expression will be sent as JSON in the body of the post.
238
- Note that the server must be able to parse the body of the request; otherwise the query expression will be ignored.
239
- > let query = new EntityQuery("Customers")
240
- > .where("companyId", "eq", 1)
241
- > .usePost(true);
242
- results in a POST request to `{host}/{path}/Customers`
243
- with body `{"where": {"companyId":{"eq":1}}}`
244
- @param enabled - (default = true) Whether or not usePost should be enabled. If this parameter is omitted, true is assumed.
245
- **/
246
- usePost(enabled?: boolean): EntityQuery;
247
- using(obj: EntityManager): EntityQuery;
248
- using(obj: DataService): EntityQuery;
249
- using(obj: JsonResultsAdapter): EntityQuery;
250
- using(obj: QueryOptions): EntityQuery;
251
- using(obj: MergeStrategy): EntityQuery;
252
- using(obj: FetchStrategy): EntityQuery;
253
- /**
254
- Executes this query. This method requires that an EntityManager has been previously specified via the "using" method.
255
-
256
- This method can be called using a 'promises' syntax ( recommended)
257
- > let em = new EntityManager(serviceName);
258
- > let query = new EntityQuery("Orders").using(em);
259
- > query.execute().then( function(data) {
260
- > ... query results processed here
261
- > }).catch( function(err) {
262
- > ... query failure processed here
263
- > });
264
-
265
- or with callbacks
266
- > let em = new EntityManager(serviceName);
267
- > let query = new EntityQuery("Orders").using(em);
268
- > query.execute(
269
- > function(data) {
270
- > let orders = data.results;
271
- > ... query results processed here
272
- > },
273
- > function(err) {
274
- > ... query failure processed here
275
- > });
276
-
277
- Either way this method is the same as calling the EntityManager 'execute' method.
278
- > let em = new EntityManager(serviceName);
279
- > let query = new EntityQuery("Orders");
280
- > em.executeQuery(query).then( function(data) {
281
- > let orders = data.results;
282
- > ... query results processed here
283
- > }).catch( function(err) {
284
- > ... query failure processed here
285
- > });
286
-
287
- @param callback - Function called on success.
288
- @param errorCallback - Function called on failure.
289
- @return Promise
290
- **/
291
- execute(callback?: Callback, errorCallback?: ErrorCallback): Promise<QueryResult>;
292
- /**
293
- Executes this query against the local cache. This method requires that an EntityManager have been previously specified via the "using" method.
294
- > // assume em is an entityManager already filled with order entities;
295
- > let query = new EntityQuery("Orders").using(em);
296
- > let orders = query.executeLocally();
297
-
298
- Note that calling this method is the same as calling [[EntityManager.executeQueryLocally]].
299
- **/
300
- executeLocally(): any[];
301
- toJSON(): Object;
302
- /** Typically only for use when building UriBuilderAdapters.
303
- @hidden @internal
304
- */
305
- toJSONExt(context?: EntityQueryJsonContext): Object;
306
- static fromEntities(entity: Entity): EntityQuery;
307
- static fromEntities(entities: Entity[]): EntityQuery;
308
- /**
309
- Creates an EntityQuery for the specified [[EntityKey]].
310
- > let empType = metadataStore.getEntityType("Employee");
311
- > let entityKey = new EntityKey(empType, 1);
312
- > let query = EntityQuery.fromEntityKey(entityKey);
313
-
314
- or
315
- > // 'employee' is a previously queried employee
316
- > let entityKey = employee.entityAspect.getKey();
317
- > let query = EntityQuery.fromEntityKey(entityKey);
318
- @param entityKey - The [[EntityKey]] for which a query will be created.
319
- **/
320
- static fromEntityKey(entityKey: EntityKey): EntityQuery;
321
- /**
322
- Creates an EntityQuery for the specified entity and [[NavigationProperty]].
323
- > // 'employee' is a previously queried employee
324
- > let ordersNavProp = employee.entityType.getProperty("Orders");
325
- > let query = EntityQuery.fromEntityNavigation(employee, ordersNavProp);
326
-
327
- will return a query for the "Orders" of the specified 'employee'.
328
- @param entity - The Entity whose navigation property will be queried.
329
- @param navigationProperty - The [[NavigationProperty]] or name of the NavigationProperty to be queried.
330
- **/
331
- static fromEntityNavigation: (entity: Entity, navigationProperty: NavigationProperty | string) => EntityQuery;
332
- /** @hidden @internal */
333
- _getFromEntityType(metadataStore: MetadataStore, throwErrorIfNotFound?: boolean): EntityType;
334
- /** @hidden @internal */
335
- _getToEntityType(metadataStore: MetadataStore, skipFromCheck?: boolean): EntityType | undefined;
336
- /** @hidden @internal */
337
- _toUri(em: EntityManager): string;
338
- }
339
- /** Base class for BooleanQueryOp and FilterQueryOp */
340
- export interface QueryOp {
341
- /** The operator for this enum. */
342
- operator: string;
343
- }
344
- /**
345
- FilterQueryOp is an 'Enum' containing all of the valid [[Predicate]]
346
- filter operators for an [[EntityQuery]].
347
- **/
348
- export declare class FilterQueryOp extends BreezeEnum implements QueryOp {
349
- /** The operator for this enum. */
350
- operator: string;
351
- /** Aliases: "eq", "==" **/
352
- static Equals: FilterQueryOp;
353
- /** Aliases: "ne", "!=" **/
354
- static NotEquals: FilterQueryOp;
355
- /** Aliases: "gt", ">" **/
356
- static GreaterThan: FilterQueryOp;
357
- /** Aliases: "lt", "<" **/
358
- static LessThan: FilterQueryOp;
359
- /** Aliases: "ge", ">=" **/
360
- static GreaterThanOrEqual: FilterQueryOp;
361
- /** Aliases: "le", "<=" **/
362
- static LessThanOrEqual: FilterQueryOp;
363
- /** String operation: Is a string a substring of another string. Aliases: "substringof" **/
364
- static Contains: FilterQueryOp;
365
- /** No aliases */
366
- static StartsWith: FilterQueryOp;
367
- /** No aliases */
368
- static EndsWith: FilterQueryOp;
369
- /** Aliases: "some" **/
370
- static Any: FilterQueryOp;
371
- /** Aliases: "every" **/
372
- static All: FilterQueryOp;
373
- /** No aliases */
374
- static In: FilterQueryOp;
375
- /** No aliases */
376
- static IsTypeOf: FilterQueryOp;
377
- }
378
- /**
379
- BooleanQueryOp is an 'Enum' containing all of the valid boolean
380
- operators for an [[EntityQuery]].
381
- **/
382
- export declare class BooleanQueryOp extends BreezeEnum implements QueryOp {
383
- /** The operator for this enum. */
384
- operator: string;
385
- static And: BooleanQueryOp;
386
- static Or: BooleanQueryOp;
387
- static Not: BooleanQueryOp;
388
- }
389
- /** For use by breeze plugin authors only. The class is used in most [[IUriBuilderAdapter]] implementations
390
- @adapter (see [[IUriBuilderAdapter]])
391
- @hidden
392
-
393
- An OrderByClause is a description of the properties and direction that the result
394
- of a query should be sorted in. OrderByClauses are immutable, which means that any
395
- method that would modify an OrderByClause actually returns a new OrderByClause.
396
-
397
- For example for an Employee object with properties of 'Company' and 'LastName' the following would be valid expressions:
398
- > let obc = new OrderByClause("Company.CompanyName, LastName")
399
-
400
- or
401
- > let obc = new OrderByClause("Company.CompanyName desc, LastName")
402
-
403
- or
404
- > let obc = new OrderByClause("Company.CompanyName, LastName", true);
405
- */
406
- export declare class OrderByClause {
407
- /** @hidden @internal */
408
- items: OrderByItem[];
409
- constructor(propertyPaths: string[] | OrderByClause[], isDesc?: boolean);
410
- validate(entityType: EntityType): void;
411
- getComparer(entityType: EntityType): (entity1: any, entity2: any) => number;
412
- toJSONExt(context: EntityQueryJsonContext): string[];
413
- }
414
- /** @hidden @internal */
415
- export declare class OrderByItem {
416
- propertyPath: string;
417
- isDesc: boolean;
418
- lastProperty: EntityProperty;
419
- constructor(propertyPath: string, isDesc?: boolean);
420
- validate(entityType: EntityType): EntityProperty | undefined;
421
- getComparer(entityType: EntityType): (entity1: any, entity2: any) => 0 | 1 | -1;
422
- }
423
- /** For use by breeze plugin authors only. The class is used in most [[IUriBuilderAdapter]] implementations
424
- @adapter (see [[IUriBuilderAdapter]])
425
- @hidden
426
- **/
427
- export declare class SelectClause {
428
- propertyPaths: string[];
429
- /** @hidden @internal */
430
- _pathNames: string[];
431
- constructor(propertyPaths: string[]);
432
- validate(entityType: EntityType): void;
433
- toFunction(): (entity: Entity) => {};
434
- toJSONExt(context: EntityQueryJsonContext): any[];
435
- }
436
- /** For use by breeze plugin authors only. The class is used in most [[IUriBuilderAdapter]] implementations
437
- @adapter (see [[IUriBuilderAdapter]])
438
- @hidden
439
- **/
440
- export declare class ExpandClause {
441
- propertyPaths: string[];
442
- constructor(propertyPaths: string[]);
443
- toJSONExt(context: EntityQueryJsonContext): any[];
444
- }
package/src/enum.d.ts DELETED
@@ -1,100 +0,0 @@
1
- /**
2
- Base class for all Breeze enumerations, such as EntityState, DataType, FetchStrategy, MergeStrategy etc.
3
- A Breeze Enum is a namespaced set of constant values. Each Enum consists of a group of related constants, called 'symbols'.
4
- Unlike enums in some other environments, each 'symbol' can have both methods and properties.
5
- > class DayOfWeek extends BreezeEnum {
6
- > dayIndex: number;
7
- > isWeekend?: boolean;
8
- > nextDay() {
9
- > let nextIndex = (this.dayIndex + 1) % 7;
10
- > return DayOfWeek.getSymbols()[nextIndex];
11
- > }
12
- >
13
- > static Monday = new DayOfWeek( { dayIndex: 0});
14
- > static Tuesday = new DayOfWeek( { dayIndex: 1 });
15
- > static Wednesday = new DayOfWeek( { dayIndex: 2 });
16
- > static Thursday = new DayOfWeek( { dayIndex: 3 });
17
- > static Friday = new DayOfWeek( { dayIndex: 4 });
18
- > static Saturday = new DayOfWeek( { dayIndex: 5, isWeekend: true });
19
- > static Sunday = new DayOfWeek( { dayIndex: 6, isWeekend: true });
20
- > }
21
- >
22
- > describe("DayOfWeek", () => {
23
- > test("should support full enum capabilities", function() {
24
- > // // custom methods
25
- > let dowSymbols = DayOfWeek.getSymbols();
26
- > expect(dowSymbols.length).toBe(7);
27
- > expect(DayOfWeek.Monday.nextDay()).toBe(DayOfWeek.Tuesday);
28
- > expect(DayOfWeek.Sunday.nextDay()).toBe(DayOfWeek.Monday);
29
- > // // custom properties
30
- > expect(DayOfWeek.Tuesday.isWeekend).toBe(undefined);
31
- > expect(DayOfWeek.Saturday.isWeekend).toBe(true);
32
- > // // Standard enum capabilities
33
- > expect(DayOfWeek.Thursday instanceof DayOfWeek).toBe(true);
34
- > expect(BreezeEnum.isSymbol(DayOfWeek.Wednesday)).toBe(true);
35
- > expect(DayOfWeek.contains(DayOfWeek.Thursday)).toBe(true);
36
- > expect(DayOfWeek.Friday.toString()).toBe("Friday");
37
- > });
38
- > });
39
- Note that we have Error['x'] = ... in some places in the code to prevent Terser from optimizing out some important calls.
40
- @dynamic
41
- */
42
- export declare class BreezeEnum {
43
- /** The name of this symbol */
44
- name: string;
45
- /** Type of the enum; set in prototype of each enum */
46
- _$typeName: string;
47
- /** @hidden @internal */
48
- static _resolvedNamesAndSymbols: {
49
- name: string;
50
- symbol: BreezeEnum;
51
- }[];
52
- /** */
53
- constructor(propertiesObj?: Object);
54
- /**
55
- Returns all of the symbols contained within this Enum.
56
- > let symbols = DayOfWeek.getSymbols();
57
- @return All of the symbols contained within this Enum.
58
- **/
59
- static getSymbols(): BreezeEnum[];
60
- /**
61
- Returns the names of all of the symbols contained within this Enum.
62
- > let symbols = DayOfWeek.getNames();
63
- @return All of the names of the symbols contained within this Enum.
64
- **/
65
- static getNames(): string[];
66
- /**
67
- Returns an Enum symbol given its name.
68
- > let dayOfWeek = DayOfWeek.from("Thursday");
69
- > // nowdayOfWeek === DayOfWeek.Thursday
70
- @param name - Name for which an enum symbol should be returned.
71
- @return The symbol that matches the name or 'undefined' if not found.
72
- **/
73
- static fromName(name: string): any;
74
- /**
75
- Seals this enum so that no more symbols may be added to it. This should only be called after all symbols
76
- have already been added to the Enum. This method also sets the 'name' property on each of the symbols.
77
- > DayOfWeek.resolveSymbols();
78
- **/
79
- static resolveSymbols(): {
80
- name: string;
81
- symbol: BreezeEnum;
82
- }[];
83
- /**
84
- Returns whether an Enum contains a specified symbol.
85
- > let symbol = DayOfWeek.Friday;
86
- > if (DayOfWeek.contains(symbol)) {
87
- > // do something
88
- > }
89
- @param sym - Object or symbol to test.
90
- @return Whether this Enum contains the specified symbol.
91
- **/
92
- static contains(sym: BreezeEnum): boolean;
93
- /** Returns the string name of this Enum */
94
- toString(): string;
95
- /** Return enum name and symbol name */
96
- toJSON(): {
97
- _$typeName: any;
98
- name: string;
99
- };
100
- }