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
package/index.d.ts DELETED
@@ -1 +0,0 @@
1
- export * from './src/breeze';
@@ -1,5 +0,0 @@
1
- /**
2
- * Generated bundle index. Do not edit.
3
- */
4
- /// <amd-module name="breeze-client/mixin-get-entity-graph" />
5
- export * from './mixin-get-entity-graph';
@@ -1,31 +0,0 @@
1
- import { Entity, EntityManager, EntityQuery, ExpandClause } from 'breeze-client';
2
- export interface HasEntityGraph extends EntityManager {
3
- /**
4
- Get related entities of root entity (or root entities) as specified by expand.
5
- @example
6
- var graph = breeze.EntityManager.getEntityGraph(customer, 'Orders.OrderDetails');
7
- // graph will be the customer, all of its orders and their details even if deleted.
8
- @method getEntityGraph
9
- @param roots {Entity|Array of Entity} The root entity or root entities.
10
- @param expand {String|Array of String|Object} an expand string, a query expand clause, or array of string paths
11
- @return {Array of Entity} root entities and their related entities, including deleted entities. Duplicates are removed and entity order is indeterminate.
12
- **/
13
- getEntityGraph(roots: Entity | Array<Entity>, expand: string | Array<string> | ExpandClause): Array<Entity>;
14
- /**
15
- Execute query locally and return both the query results and their related entities as specified by the optional expand parameter or the query's expand clause.
16
- @example
17
- var query = breeze.EntityQuery.from('Customers')
18
- .where('CompanyName', 'startsWith', 'Alfred')
19
- .expand('Orders.OrderDetails');
20
- var graph = manager.getEntityGraph(query);
21
- // graph will be the 'Alfred' customers, their orders and their details even if deleted.
22
- @method getEntityGraph
23
- @param query {EntityQuery} A query to be executed against the manager's local cache.
24
- @param [expand] {String|Array of String|Object} an expand string, a query expand clause, or array of string paths
25
- @return {Array of Entity} local queried root entities and their related entities, including deleted entities. Duplicates are removed and entity order is indeterminate.
26
- **/
27
- getEntityGraph(query: EntityQuery, expand: string | Array<string> | ExpandClause): Array<Entity>;
28
- }
29
- export declare function mixinEntityGraph(emclass: {
30
- new (): EntityManager;
31
- }): void;
@@ -1,5 +0,0 @@
1
- /**
2
- * Generated bundle index. Do not edit.
3
- */
4
- /// <amd-module name="breeze-client/mixin-save-queuing" />
5
- export * from './mixin-save-queuing';
@@ -1,32 +0,0 @@
1
- import { Entity, EntityManager, KeyMapping } from 'breeze-client';
2
- export declare function enableSaveQueuing(em: EntityManager, enable?: boolean): void;
3
- export declare class QueuedSaveFailedError extends Error {
4
- name: string;
5
- innerError: Error;
6
- message: string;
7
- failedSaveMemo: SaveMemo;
8
- nextSaveMemo: SaveMemo;
9
- constructor(errObject: Error, saveQueuing: any);
10
- }
11
- declare class SaveMemo {
12
- entityMemos: {
13
- [key: string]: EntityMemo;
14
- };
15
- queuedChanges: Entity[];
16
- constructor();
17
- applyToSavedEntities(entityManager: EntityManager, savedEntities: Entity[]): void;
18
- private disableManagerPublishing;
19
- pkFixup(keyMappings: KeyMapping[]): void;
20
- makeEntityMemoKey(entity: Entity): string;
21
- updateEntityMemos(changes: Entity[]): void;
22
- }
23
- declare class EntityMemo {
24
- entity: Entity;
25
- pendingChanges: any;
26
- isDeleted: boolean;
27
- constructor(entity: Entity);
28
- applyToSavedEntity(saved: Entity): boolean;
29
- fkFixup(keyMapping: KeyMapping): void;
30
- update(): void;
31
- }
32
- export {};
@@ -1,84 +0,0 @@
1
- import { DataServiceAdapter, AjaxAdapter, ChangeRequestInterceptorCtor, ChangeRequestInterceptor } from './interface-registry';
2
- import { MappingContext } from './mapping-context';
3
- import { DataService, JsonResultsAdapter } from './data-service';
4
- import { SaveContext, SaveBundle, ServerError, SaveResult, QueryResult } from './entity-manager';
5
- import { MetadataStore } from './entity-metadata';
6
- /** For use by breeze plugin authors only. The class is used as the base class for most [[IDataServiceAdapter]] implementations
7
- @adapter (see [[IDataServiceAdapter]])
8
- @hidden
9
- */
10
- export declare abstract class AbstractDataServiceAdapter implements DataServiceAdapter {
11
- /** @hidden @internal */
12
- _$impl?: any;
13
- /** The name of this adapter. */
14
- name: string;
15
- /** The [[IAjaxAdapter]] used by this [[IDataServiceAdapter]]. */
16
- ajaxImpl: AjaxAdapter;
17
- checkForRecomposition(interfaceInitializedArgs: any): void;
18
- initialize(): void;
19
- fetchMetadata(metadataStore: MetadataStore, dataService: DataService): Promise<unknown>;
20
- /** Execute the query in the mappingContext using the ajaxImpl. */
21
- executeQuery(mappingContext: MappingContext): Promise<QueryResult>;
22
- /** Set up ajax parameters for query GET. This puts the query into the request querystring in either JSON or OData-style syntax, depending upon the UriBuilder. */
23
- _makeQueryGetParams(mappingContext: MappingContext): {
24
- type: string;
25
- url: string;
26
- params: Object;
27
- dataType: string;
28
- crossDomain: boolean;
29
- };
30
- /** Set up ajax parameters for query POST. This put the query into the request body as JSON. */
31
- _makeQueryPostParams(mappingContext: MappingContext): {
32
- type: string;
33
- url: string;
34
- params: Object;
35
- dataType: string;
36
- processData: boolean;
37
- contentType: string;
38
- data: string;
39
- crossDomain: boolean;
40
- };
41
- saveChanges(saveContext: SaveContext, saveBundle: SaveBundle): Promise<SaveResult>;
42
- /** Abstract method that needs to be overwritten in any concrete DataServiceAdapter subclass.
43
- The return value from this method should be a serializable object that will be sent to the server after calling JSON.stringify on it.
44
- */
45
- _prepareSaveBundle(saveContext: SaveContext, saveBundle: SaveBundle): any;
46
- /**
47
- Returns a constructor function for a "ChangeRequestInterceptor"
48
- that can tweak the saveBundle both as it is built and when it is completed
49
- by a concrete DataServiceAdapater.
50
-
51
- Initialized with a default, no-op implementation that developers can replace with a
52
- substantive implementation that changes the individual entity change requests
53
- or aspects of the entire 'saveBundle' without having to write their own DataService adapters.
54
- > let adapter = breeze.config.getAdapterInstance('dataService');
55
- > adapter.changeRequestInterceptor = function (saveContext, saveBundle) {
56
- > this.getRequest = function (request, entity, index) {
57
- > // alter the request that the adapter prepared for this entity
58
- > // based on the entity, saveContext, and saveBundle
59
- > // e.g., add a custom header or prune the originalValuesMap
60
- > return request;
61
- > };
62
- > this.done = function (requests) {
63
- > // alter the array of requests representing the entire change-set
64
- > // based on the saveContext and saveBundle
65
- > };
66
- > }
67
-
68
- @param saveContext - The BreezeJS "context" for the save operation.
69
- @param saveBundle - Contains the array of entities-to-be-saved (AKA, the entity change-set).
70
- @return Constructor for a "ChangeRequestInterceptor".
71
- **/
72
- changeRequestInterceptor: ChangeRequestInterceptorCtor;
73
- /** @hidden @internal */
74
- _createChangeRequestInterceptor(saveContext: SaveContext, saveBundle: SaveBundle): ChangeRequestInterceptor;
75
- /** Abstract method that needs to be overwritten in any concrete DataServiceAdapter sublclass.
76
- This method needs to take the result returned the server and convert it into an ISaveResult.
77
- */
78
- _prepareSaveResult(saveContext: SaveContext, data: any): SaveResult;
79
- /** Utility method that may be used in any concrete DataServiceAdapter sublclass to handle any
80
- http connection issues.
81
- */
82
- static _catchNoConnectionError(err: ServerError): void;
83
- jsonResultsAdapter: JsonResultsAdapter;
84
- }
package/src/array.d.ts DELETED
@@ -1,3 +0,0 @@
1
- export { makeRelationArray } from './relation-array';
2
- export { makeComplexArray } from './complex-array';
3
- export { makePrimitiveArray } from './primitive-array';
package/src/breeze.d.ts DELETED
@@ -1,139 +0,0 @@
1
- import { AbstractDataServiceAdapter } from './abstract-data-service-adapter';
2
- import { assertParam, assertConfig, Param } from './assert-param';
3
- import { BreezeConfig } from './config';
4
- import { BreezeEnum } from './enum';
5
- import { BreezeEvent } from './event';
6
- import { ComplexArray } from './complex-array';
7
- import { DataService, DataServiceConfig, JsonResultsAdapter, JsonResultsAdapterConfig, NodeContext, NodeMeta } from './data-service';
8
- import { DataType } from './data-type';
9
- import { EntityAction } from './entity-action';
10
- import { EntityAspect, ComplexAspect, Entity, ComplexObject, StructuralObject, PropertyChangedEventArgs } from './entity-aspect';
11
- import { EntityKey } from './entity-key';
12
- import { EntityManager, EntityManagerConfig, EntityError, EntityChangedEventArgs, SaveContext, SaveBundle, HttpResponse, KeyMapping, ServerError, SaveResult, QueryResult, ValidationErrorsChangedEventArgs, HasChangesChangedEventArgs } from './entity-manager';
13
- import { EntityQuery, FilterQueryOp, BooleanQueryOp, OrderByClause, ExpandClause, SelectClause } from './entity-query';
14
- import { EntityState } from './entity-state';
15
- import { InterfaceRegistry, AjaxAdapter, AjaxConfig, DataServiceAdapter, ModelLibraryAdapter, ChangeRequestInterceptor, UriBuilderAdapter, InterfaceRegistryConfig, AjaxRequestInterceptor } from './interface-registry';
16
- import { KeyGenerator } from './key-generator';
17
- import { LocalQueryComparisonOptions } from './local-query-comparison-options';
18
- import { MappingContext } from './mapping-context';
19
- import { MetadataStore, EntityType, ComplexType, StructuralType, DataProperty, EntityProperty, NavigationProperty, AutoGeneratedKeyType } from './entity-metadata';
20
- import { NamingConvention } from './naming-convention';
21
- import { Predicate, VisitContext, Visitor, ExpressionContext, UnaryPredicate, BinaryPredicate, AnyAllPredicate, AndOrPredicate, LitExpr, FnExpr, PropExpr } from './predicate';
22
- import { QueryOptions, FetchStrategy, MergeStrategy } from './query-options';
23
- import { SaveOptions } from './save-options';
24
- import { ValidationError, Validator } from './validate';
25
- import { ValidationOptions } from './validation-options';
26
- import { config, BaseAdapter } from './config';
27
- import { core, Callback, ErrorCallback } from './core';
28
- import { makeRelationArray, makePrimitiveArray, makeComplexArray } from './array';
29
- import { RelationArray } from './relation-array';
30
- import { ArrayChangedArgs } from './observable-array';
31
- export { BreezeConfig, ComplexArray, RelationArray };
32
- export { AbstractDataServiceAdapter, AjaxAdapter, AjaxConfig, AjaxRequestInterceptor, AndOrPredicate, AnyAllPredicate, ArrayChangedArgs, assertConfig, assertParam, AutoGeneratedKeyType, BaseAdapter, BinaryPredicate, BreezeEnum, BreezeEvent, Callback, ChangeRequestInterceptor, ComplexAspect, ComplexObject, ComplexType, config, core, DataProperty, DataService, DataServiceAdapter, DataServiceConfig, DataType, Entity, EntityAction, EntityAspect, EntityChangedEventArgs, EntityError, EntityKey, EntityManager, EntityManagerConfig, EntityProperty, EntityQuery, EntityState, EntityType, ErrorCallback, ExpandClause, ExpressionContext, FetchStrategy, FilterQueryOp, FnExpr, HasChangesChangedEventArgs, HttpResponse, InterfaceRegistry, InterfaceRegistryConfig, JsonResultsAdapter, JsonResultsAdapterConfig, KeyGenerator, KeyMapping, LitExpr, LocalQueryComparisonOptions, makeComplexArray, makePrimitiveArray, makeRelationArray, MappingContext, MergeStrategy, MetadataStore, ModelLibraryAdapter, NamingConvention, NavigationProperty, NodeContext, NodeMeta, OrderByClause, Predicate, PropertyChangedEventArgs, PropExpr, QueryOptions, QueryResult, SaveBundle, SaveContext, SaveOptions, SaveResult, SelectClause, ServerError, StructuralObject, StructuralType, UnaryPredicate, UriBuilderAdapter, ValidationErrorsChangedEventArgs, ValidationError, ValidationOptions, Validator, VisitContext, Visitor, };
33
- export declare const breeze: {
34
- AbstractDataServiceAdapter: typeof AbstractDataServiceAdapter;
35
- assertConfig: any;
36
- assertParam: any;
37
- AutoGeneratedKeyType: typeof AutoGeneratedKeyType;
38
- BooleanQueryOp: typeof BooleanQueryOp;
39
- ComplexAspect: typeof ComplexAspect;
40
- ComplexType: typeof ComplexType;
41
- config: BreezeConfig;
42
- core: {
43
- isES5Supported: boolean;
44
- hasOwnProperty: (obj: Object, key: string) => boolean;
45
- getOwnPropertyValues: (source: Object) => any[];
46
- getPropertyDescriptor: (obj: Object, propertyName: string) => PropertyDescriptor;
47
- objectForEach: (obj: Object, kvFn: (key: string, val: any) => any) => void;
48
- objectFirst: (obj: Object, kvPredicate: (key: string, val: any) => boolean) => {
49
- key: string;
50
- value: any;
51
- };
52
- objectMap: (obj: Object, kvFn?: (key: string, val: any) => any) => any[];
53
- extend: (target: Object, source: Object, propNames?: string[]) => Object;
54
- propEq: (propertyName: string, value: any) => (obj: Object) => boolean;
55
- propsEq: (property1Name: string, property2Name: string, value: any) => (obj: Object) => boolean;
56
- pluck: (propertyName: any) => (obj: Object) => any;
57
- map: <T>(items: T | T[], fn: (v: T, ix?: number) => any, includeNull?: boolean) => any;
58
- resolveProperties: (sources: Object[], propertyNames: string[]) => any;
59
- setAsDefault: (target: Object, ctor: {
60
- new (...args: any[]): any;
61
- defaultInstance?: any;
62
- }) => any;
63
- updateWithDefaults: (target: Object, defaults: Object) => any;
64
- getArray: (source: Object, propName: string) => any[];
65
- toArray: (item: any) => any[];
66
- arrayEquals: (a1: any[], a2: any[], equalsFn?: (x1: any, x2: any) => boolean) => boolean;
67
- arraySlice: (ar: any[], start?: number, end?: number) => any[];
68
- arrayFirst: <T_1>(array: T_1[], predicate: (i: any) => boolean) => T_1;
69
- arrayIndexOf: <T_2>(array: T_2[], predicate: (i: any) => boolean) => number;
70
- arrayRemoveItem: <T_3>(array: T_3[], predicateOrItem: T_3 | ((i: T_3) => boolean), shouldRemoveMultiple?: boolean) => boolean;
71
- arrayZip: (a1: any[], a2: any[], callback: (x1: any, x2: any) => any) => any[];
72
- arrayAddItemUnique: <T_4>(array: T_4[], item: T_4) => void;
73
- arrayFlatMap: <T_5, U>(arr: T_5[], mapFn: (arg: T_5) => U[]) => U[];
74
- requireLib: (libNames: string, errMessage?: string) => any;
75
- using: (obj: Object, property: string, tempValue: any, fn: () => any) => any;
76
- wrapExecution: (startFn: () => any, endFn: (state: any) => any, fn: () => any) => any;
77
- memoize: (fn: any) => any;
78
- getUuid: () => string;
79
- durationToSeconds: (duration: string) => number;
80
- isSettable: (obj: Object, propertyName: string) => boolean;
81
- isDate: (o: any) => boolean;
82
- isDateString: (s: string) => boolean;
83
- isGuid: (value: any) => boolean;
84
- isDuration: (value: any) => boolean;
85
- isFunction: (o: any) => boolean;
86
- isEmpty: (obj: any) => boolean;
87
- isNumeric: (n: any) => boolean;
88
- identity: (x: any) => any;
89
- noop: () => void;
90
- stringStartsWith: (str: string, prefix: string) => boolean;
91
- stringEndsWith: (str: string, suffix: string) => boolean;
92
- formatString: (str: string, ...params: any[]) => string;
93
- titleCase: (text: string) => string;
94
- toJson: (source: Object, template: Object, target?: Object) => Object;
95
- toJSONSafe: (obj: any, replacer?: (prop: string, value: any) => any) => any;
96
- toJSONSafeReplacer: (prop: string, val: any) => any;
97
- strings: {
98
- TO_TYPE: string;
99
- };
100
- };
101
- DataProperty: typeof DataProperty;
102
- DataService: typeof DataService;
103
- DataType: typeof DataType;
104
- EntityAction: typeof EntityAction;
105
- EntityAspect: typeof EntityAspect;
106
- EntityKey: typeof EntityKey;
107
- EntityManager: typeof EntityManager;
108
- EntityQuery: typeof EntityQuery;
109
- EntityState: typeof EntityState;
110
- EntityType: typeof EntityType;
111
- Event: typeof BreezeEvent;
112
- FetchStrategy: typeof FetchStrategy;
113
- FilterQueryOp: typeof FilterQueryOp;
114
- InterfaceRegistry: typeof InterfaceRegistry;
115
- JsonResultsAdapter: typeof JsonResultsAdapter;
116
- KeyGenerator: typeof KeyGenerator;
117
- LocalQueryComparisonOptions: typeof LocalQueryComparisonOptions;
118
- makeComplexArray: typeof makeComplexArray;
119
- makePrimitiveArray: typeof makePrimitiveArray;
120
- makeRelationArray: typeof makeRelationArray;
121
- MergeStrategy: typeof MergeStrategy;
122
- MetadataStore: typeof MetadataStore;
123
- NamingConvention: typeof NamingConvention;
124
- NavigationProperty: typeof NavigationProperty;
125
- OrderByClause: typeof OrderByClause;
126
- Param: typeof Param;
127
- Predicate: typeof Predicate;
128
- QueryOptions: typeof QueryOptions;
129
- SaveOptions: typeof SaveOptions;
130
- ValidationError: typeof ValidationError;
131
- ValidationOptions: typeof ValidationOptions;
132
- Validator: typeof Validator;
133
- version: string;
134
- };
135
- export declare namespace promises {
136
- /** no-op for backward compatibility with breeze-bridge2-angular */
137
- interface IPromiseService {
138
- }
139
- }
@@ -1,13 +0,0 @@
1
- import { ObservableArray } from './observable-array';
2
- import { ComplexObject, StructuralObject } from './entity-aspect';
3
- import { DataProperty } from './entity-metadata';
4
- export interface ComplexArray extends ObservableArray {
5
- [index: number]: ComplexObject;
6
- parent?: StructuralObject;
7
- parentProperty?: DataProperty;
8
- }
9
- /** For use by breeze plugin authors only. The class is for use in building a [[IModelLibraryAdapter]] implementation.
10
- @adapter (see [[IModelLibraryAdapter]])
11
- @hidden
12
- */
13
- export declare function makeComplexArray(arr: any[], parent: StructuralObject, parentProperty: DataProperty): ComplexArray;
package/src/config.d.ts DELETED
@@ -1,104 +0,0 @@
1
- import { BreezeEvent } from './event';
2
- /** @hidden */
3
- export interface AdapterCtor<T extends BaseAdapter> {
4
- new (...args: any[]): T;
5
- }
6
- /** @hidden */
7
- export interface IDef<T extends BaseAdapter> {
8
- ctor: AdapterCtor<T>;
9
- defaultInstance?: T;
10
- }
11
- export type AdapterType = 'dataService' | 'modelLibrary' | 'ajax' | 'uriBuilder';
12
- export declare class InterfaceDef<T extends BaseAdapter> {
13
- name: string;
14
- defaultInstance?: T;
15
- /** @hidden @internal */
16
- _implMap: {
17
- [name: string]: IDef<T>;
18
- };
19
- constructor(name: string);
20
- /** Define an implementation of the given adaptername */
21
- registerCtor(adapterName: string, ctor: AdapterCtor<T>): void;
22
- /** Return the definition for the given adapterName */
23
- getImpl(adapterName: string): IDef<T>;
24
- /** Return the first implementation for this InterfaceDef */
25
- getFirstImpl(): IDef<T>;
26
- getDefaultInstance(): T;
27
- }
28
- export interface BaseAdapter {
29
- /** @hidden @internal */
30
- _$impl?: any;
31
- name: string;
32
- initialize(): void;
33
- checkForRecomposition?: (context: any) => void;
34
- }
35
- export declare class BreezeConfig {
36
- functionRegistry: {};
37
- typeRegistry: {};
38
- objectRegistry: {};
39
- interfaceInitialized: BreezeEvent<{
40
- interfaceName: string;
41
- instance: BaseAdapter;
42
- isDefault: boolean;
43
- }>;
44
- stringifyPad: string;
45
- /** whether to prohibit eval() and Function() in breeze code */
46
- noEval: boolean;
47
- /** @hidden @internal */
48
- _interfaceRegistry: any;
49
- constructor();
50
- /**
51
- Method use to register implementations of standard breeze interfaces. Calls to this method are usually
52
- made as the last step within an adapter implementation.
53
- @method registerAdapter
54
- @param interfaceName {String} - one of the following interface names: "ajax", "dataService", "modelLibrary", "uriBuilder"
55
- @param adapterCtor {Function} - an ctor function that returns an instance of the specified interface.
56
- **/
57
- registerAdapter<T extends BaseAdapter>(interfaceName: AdapterType, adapterCtor: AdapterCtor<T>): void;
58
- /**
59
- Returns the ctor function used to implement a specific interface with a specific adapter name.
60
- @method getAdapter
61
- @param interfaceName {String} One of the following interface names: "ajax", "dataService", "modelLibrary", "uriBuilder"
62
- @param [adapterName] {String} The name of any previously registered adapter. If this parameter is omitted then
63
- this method returns the "default" adapter for this interface. If there is no default adapter, then a null is returned.
64
- @return {Function|null} Returns either a ctor function or null.
65
- **/
66
- getAdapter(interfaceName: AdapterType, adapterName: string): any;
67
- /**
68
- Initializes a single adapter implementation. Initialization means either newing a instance of the
69
- specified interface and then calling "initialize" on it or simply calling "initialize" on the instance
70
- if it already exists.
71
- @method initializeAdapterInstance
72
- @param interfaceName {String} The name of the interface to which the adapter to initialize belongs.
73
- @param adapterName {String} - The name of a previously registered adapter to initialize.
74
- @param [isDefault=true] {Boolean} - Whether to make this the default "adapter" for this interface.
75
- @return {an instance of the specified adapter}
76
- **/
77
- initializeAdapterInstance(interfaceName: AdapterType, adapterName: string, isDefault?: boolean): BaseAdapter;
78
- /**
79
- Returns the adapter instance corresponding to the specified interface and adapter names.
80
- @method getAdapterInstance
81
- @param interfaceName {String} The name of the interface.
82
- @param [adapterName] {String} - The name of a previously registered adapter. If this parameter is
83
- omitted then the default implementation of the specified interface is returned. If there is
84
- no defaultInstance of this interface, then the first registered instance of this interface is returned.
85
- @return {an instance of the specified adapter}
86
- @internal
87
- **/
88
- getAdapterInstance<T extends BaseAdapter>(interfaceName: AdapterType, adapterName?: string): T;
89
- /** this is needed for reflection purposes when deserializing an object that needs a fn or ctor.
90
- Used to register validators. */
91
- registerFunction(fn: Function, fnName: string): void;
92
- registerType(ctor: Function, typeName: string): void;
93
- getRegisteredFunction(fnName: string): any;
94
- getInterfaceDef<T extends BaseAdapter>(interfaceName: string): InterfaceDef<T>;
95
- /** @deprecated @internal no-op kept for backward compatibility */
96
- setQ(q: any): void;
97
- /** @hidden @internal */
98
- _storeObject(obj: Object, type: string | Function, name: string): void;
99
- /** @hidden @internal */
100
- _fetchObject(type: string | Function, name: string): any;
101
- /** @hidden @internal */
102
- _initializeAdapterInstanceCore<T extends BaseAdapter>(interfaceDef: InterfaceDef<T>, impl: IDef<T>, isDefault: boolean): T;
103
- }
104
- export declare const config: BreezeConfig;
package/src/core.d.ts DELETED
@@ -1,164 +0,0 @@
1
- export interface ErrorCallback {
2
- (error: Error): void;
3
- }
4
- export interface Callback {
5
- (data: any): void;
6
- }
7
- type Predicate<T> = (i: T) => boolean;
8
- declare function objectForEach(obj: Object, kvFn: (key: string, val: any) => any): void;
9
- declare function objectMap(obj: Object, kvFn?: (key: string, val: any) => any): any[];
10
- declare function objectFirst(obj: Object, kvPredicate: (key: string, val: any) => boolean): {
11
- key: string;
12
- value: any;
13
- } | null;
14
- declare function arrayFlatMap<T, U>(arr: T[], mapFn: (arg: T) => U[]): U[];
15
- declare function isSettable(obj: Object, propertyName: string): boolean;
16
- declare function getPropDescriptor(obj: Object, propertyName: string): PropertyDescriptor | undefined;
17
- /** can be used like: persons.filter(propEq("firstName", "John")) */
18
- declare function propEq(propertyName: string, value: any): (obj: Object) => boolean;
19
- /** can be used like: persons.filter(propEq("firstName", "FirstName", "John")) */
20
- declare function propsEq(property1Name: string, property2Name: string, value: any): (obj: Object) => boolean;
21
- /** can be used like persons.map(pluck("firstName")) */
22
- declare function pluck(propertyName: any): (obj: Object) => any;
23
- /** Return an array of property values from source */
24
- declare function getOwnPropertyValues(source: Object): any[];
25
- /** Copy properties from source to target. Returns target. */
26
- declare function extend(target: Object, source: Object, propNames?: string[]): Object;
27
- /** Copy properties from defaults iff undefined on target. Returns target. */
28
- declare function updateWithDefaults(target: Object, defaults: Object): any;
29
- /** Set ctor.defaultInstance to an instance of ctor with properties from target.
30
- We want to insure that the object returned by ctor.defaultInstance is always immutable
31
- Use 'target' as the primary template for the ctor.defaultInstance;
32
- Use current 'ctor.defaultInstance' as the template for any missing properties
33
- creates a new instance for ctor.defaultInstance
34
- returns target unchanged */
35
- declare function setAsDefault(target: Object, ctor: {
36
- new (...args: any[]): any;
37
- defaultInstance?: any;
38
- }): any;
39
- /**
40
- 'source' is an object that will be transformed into another
41
- 'template' is a map where the
42
- keys: are the keys to return
43
- if a key contains ','s then the key is treated as a delimited string with first of the
44
- keys being the key to return and the others all valid aliases for this key
45
- 'values' are either
46
- 1) the 'default' value of the key
47
- 2) a function that takes in the source value and should return the value to set
48
- The value from the source is then set on the target,
49
- after first passing thru the fn, if provided, UNLESS:
50
- 1) it is the default value
51
- 2) it is undefined ( nulls WILL be set)
52
- 'target' is optional
53
- - if it exists then properties of the target will be set ( overwritten if the exist)
54
- - if it does not exist then a new object will be created as filled.
55
- 'target is returned.
56
- */
57
- declare function toJson(source: Object, template: Object, target?: Object): Object;
58
- /** Replacer function for toJSONSafe, when serializing entities. Excludes entityAspect and other internal properties. */
59
- declare function toJSONSafeReplacer(prop: string, val: any): any;
60
- /** Safely perform toJSON logic on objects with cycles. */
61
- declare function toJSONSafe(obj: any, replacer?: (prop: string, value: any) => any): any;
62
- /** Resolves the values of a list of properties by checking each property in multiple sources until a value is found. */
63
- declare function resolveProperties(sources: Object[], propertyNames: string[]): any;
64
- declare function toArray(item: any): any[];
65
- /** a version of Array.map that doesn't require an array, i.e. works on arrays and scalars. */
66
- declare function map<T>(items: T | T[], fn: (v: T, ix?: number) => any, includeNull?: boolean): any | any[];
67
- /** Return first element matching predicate */
68
- declare function arrayFirst<T>(array: T[], predicate: Predicate<any>): T;
69
- /** Return index of first element matching predicate */
70
- declare function arrayIndexOf<T>(array: T[], predicate: Predicate<any>): number;
71
- /** Add item if not already in array */
72
- declare function arrayAddItemUnique<T>(array: T[], item: T): void;
73
- /** Remove items from the array
74
- * @param array
75
- * @param predicateOrItem - item to remove, or function to determine matching item
76
- * @param shouldRemoveMultiple - true to keep removing after first match, false otherwise
77
- */
78
- declare function arrayRemoveItem<T>(array: T[], predicateOrItem: T | Predicate<T>, shouldRemoveMultiple?: boolean): boolean;
79
- /** Combine array elements using the callback. Returns array with length == min(a1.length, a2.length) */
80
- declare function arrayZip(a1: any[], a2: any[], callback: (x1: any, x2: any) => any): any[];
81
- declare function arrayEquals(a1: any[], a2: any[], equalsFn?: (x1: any, x2: any) => boolean): boolean;
82
- /** Returns an array for a source and a prop, and creates the prop if needed. */
83
- declare function getArray(source: Object, propName: string): any[];
84
- /** Calls requireLibCore on semicolon-separated libNames */
85
- declare function requireLib(libNames: string, errMessage?: string): any;
86
- /** Execute fn while obj has tempValue for property */
87
- declare function using(obj: Object, property: string, tempValue: any, fn: () => any): any;
88
- /** Call state = startFn(), call fn(), call endFn(state) */
89
- declare function wrapExecution(startFn: () => any, endFn: (state: any) => any, fn: () => any): any;
90
- /** Remember & return the value of fn() when it was called with its current args */
91
- declare function memoize(fn: any): any;
92
- declare function getUuid(): string;
93
- declare function durationToSeconds(duration: string): number;
94
- declare function noop(): void;
95
- declare function identity(x: any): any;
96
- declare function isDate(o: any): boolean;
97
- declare function isDateString(s: string): boolean;
98
- declare function isFunction(o: any): boolean;
99
- declare function isGuid(value: any): boolean;
100
- declare function isDuration(value: any): boolean;
101
- declare function isEmpty(obj: any): boolean;
102
- declare function isNumeric(n: any): boolean;
103
- declare function stringStartsWith(str: string, prefix: string): boolean;
104
- declare function stringEndsWith(str: string, suffix: string): boolean;
105
- /** format("a %1 and a %2", "cat", "dog") -> "a cat and a dog" */
106
- declare function formatString(str: string, ...params: any[]): string;
107
- declare function titleCaseSpace(text: string): string;
108
- export declare const core: {
109
- isES5Supported: boolean;
110
- hasOwnProperty: (obj: Object, key: string) => boolean;
111
- getOwnPropertyValues: typeof getOwnPropertyValues;
112
- getPropertyDescriptor: typeof getPropDescriptor;
113
- objectForEach: typeof objectForEach;
114
- objectFirst: typeof objectFirst;
115
- objectMap: typeof objectMap;
116
- extend: typeof extend;
117
- propEq: typeof propEq;
118
- propsEq: typeof propsEq;
119
- pluck: typeof pluck;
120
- map: typeof map;
121
- resolveProperties: typeof resolveProperties;
122
- setAsDefault: typeof setAsDefault;
123
- updateWithDefaults: typeof updateWithDefaults;
124
- getArray: typeof getArray;
125
- toArray: typeof toArray;
126
- arrayEquals: typeof arrayEquals;
127
- arraySlice: (ar: any[], start?: number, end?: number) => any[];
128
- arrayFirst: typeof arrayFirst;
129
- arrayIndexOf: typeof arrayIndexOf;
130
- arrayRemoveItem: typeof arrayRemoveItem;
131
- arrayZip: typeof arrayZip;
132
- arrayAddItemUnique: typeof arrayAddItemUnique;
133
- arrayFlatMap: typeof arrayFlatMap;
134
- requireLib: typeof requireLib;
135
- using: typeof using;
136
- wrapExecution: typeof wrapExecution;
137
- memoize: typeof memoize;
138
- getUuid: typeof getUuid;
139
- durationToSeconds: typeof durationToSeconds;
140
- isSettable: typeof isSettable;
141
- isDate: typeof isDate;
142
- isDateString: typeof isDateString;
143
- isGuid: typeof isGuid;
144
- isDuration: typeof isDuration;
145
- isFunction: typeof isFunction;
146
- isEmpty: typeof isEmpty;
147
- isNumeric: typeof isNumeric;
148
- identity: typeof identity;
149
- noop: typeof noop;
150
- stringStartsWith: typeof stringStartsWith;
151
- stringEndsWith: typeof stringEndsWith;
152
- formatString: typeof formatString;
153
- titleCase: typeof titleCaseSpace;
154
- toJson: typeof toJson;
155
- toJSONSafe: typeof toJSONSafe;
156
- toJSONSafeReplacer: typeof toJSONSafeReplacer;
157
- strings: {
158
- TO_TYPE: string;
159
- };
160
- };
161
- export interface ErrorCallback {
162
- (error: any): void;
163
- }
164
- export {};
@@ -1,7 +0,0 @@
1
- import { MetadataStore } from './entity-metadata';
2
- declare function parse(metadataStore: MetadataStore, schemas: any, altMetadata: any): MetadataStore;
3
- /** @hidden @internal */
4
- export declare const CsdlMetadataParser: {
5
- parse: typeof parse;
6
- };
7
- export {};