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.
- package/LICENSE +1 -1
- package/README.md +83 -63
- package/adapters/abstract-data-service-adapter.d.ts +120 -0
- package/adapters/abstract-data-service-adapter.js +395 -0
- package/adapters/abstract-data-service-adapter.js.map +1 -0
- package/adapters/adapter-ajax-fetch.d.ts +12 -0
- package/adapters/adapter-ajax-fetch.js +13 -0
- package/adapters/adapter-ajax-fetch.js.map +1 -0
- package/{adapter-ajax-post → adapters}/adapter-ajax-post.d.ts +40 -36
- package/{fesm2022/breeze-client-adapter-ajax-post.mjs → adapters/adapter-ajax-post.js} +80 -82
- package/adapters/adapter-ajax-post.js.map +1 -0
- package/{adapter-ajax-fetch → adapters}/adapter-core.d.ts +4 -4
- package/{fesm2022/breeze-client-adapter-uri-builder-json.mjs → adapters/adapter-core.js} +48 -91
- package/adapters/adapter-core.js.map +1 -0
- package/adapters/adapter-data-service-webapi.d.ts +9 -0
- package/{fesm2022/breeze-client-adapter-data-service-webapi.mjs → adapters/adapter-data-service-webapi.js} +105 -107
- package/adapters/adapter-data-service-webapi.js.map +1 -0
- package/adapters/adapter-model-library-backing-store.d.ts +32 -0
- package/adapters/adapter-model-library-backing-store.js +321 -0
- package/adapters/adapter-model-library-backing-store.js.map +1 -0
- package/adapters/adapter-uri-builder-json.d.ts +11 -0
- package/adapters/adapter-uri-builder-json.js +40 -0
- package/adapters/adapter-uri-builder-json.js.map +1 -0
- package/adapters/http.d.ts +52 -0
- package/adapters/http.js +202 -0
- package/adapters/http.js.map +1 -0
- package/angular/adapter-angular-httpclient.d.ts +21 -0
- package/angular/adapter-angular-httpclient.js +70 -0
- package/angular/adapter-angular-httpclient.js.map +1 -0
- package/breeze.d.ts +215 -0
- package/breeze.js +141 -0
- package/breeze.js.map +1 -0
- package/config/config.d.ts +212 -0
- package/config/config.js +392 -0
- package/config/config.js.map +1 -0
- package/config/configure.d.ts +66 -0
- package/config/configure.js +46 -0
- package/config/configure.js.map +1 -0
- package/config/default-adapters.d.ts +1 -0
- package/config/default-adapters.js +40 -0
- package/config/default-adapters.js.map +1 -0
- package/config/interface-registry.d.ts +191 -0
- package/config/interface-registry.js +5 -0
- package/config/interface-registry.js.map +1 -0
- package/{src → core}/assert-param.d.ts +52 -60
- package/core/assert-param.js +390 -0
- package/core/assert-param.js.map +1 -0
- package/core/core.d.ts +285 -0
- package/core/core.js +772 -0
- package/core/core.js.map +1 -0
- package/core/enum.d.ts +116 -0
- package/core/enum.js +167 -0
- package/core/enum.js.map +1 -0
- package/core/event.d.ts +169 -0
- package/core/event.js +338 -0
- package/core/event.js.map +1 -0
- package/entity/array.d.ts +3 -0
- package/entity/array.js +4 -0
- package/entity/array.js.map +1 -0
- package/entity/complex-array.d.ts +17 -0
- package/entity/complex-array.js +104 -0
- package/entity/complex-array.js.map +1 -0
- package/entity/default-property-interceptor.d.ts +1 -0
- package/entity/default-property-interceptor.js +496 -0
- package/entity/default-property-interceptor.js.map +1 -0
- package/{src → entity}/entity-action.d.ts +36 -42
- package/entity/entity-action.js +45 -0
- package/entity/entity-action.js.map +1 -0
- package/entity/entity-aspect.d.ts +457 -0
- package/entity/entity-aspect.js +1262 -0
- package/entity/entity-aspect.js.map +1 -0
- package/entity/entity-base.d.ts +55 -0
- package/entity/entity-base.js +41 -0
- package/entity/entity-base.js.map +1 -0
- package/entity/entity-group.d.ts +1 -0
- package/entity/entity-group.js +224 -0
- package/entity/entity-group.js.map +1 -0
- package/entity/entity-key.d.ts +95 -0
- package/entity/entity-key.js +189 -0
- package/entity/entity-key.js.map +1 -0
- package/{src → entity}/entity-state.d.ts +112 -84
- package/entity/entity-state.js +135 -0
- package/entity/entity-state.js.map +1 -0
- package/entity/key-generator.d.ts +57 -0
- package/entity/key-generator.js +155 -0
- package/entity/key-generator.js.map +1 -0
- package/entity/observable-array.d.ts +25 -0
- package/entity/observable-array.js +230 -0
- package/entity/observable-array.js.map +1 -0
- package/entity/primitive-array.d.ts +12 -0
- package/entity/primitive-array.js +71 -0
- package/entity/primitive-array.js.map +1 -0
- package/entity/relation-array.d.ts +24 -0
- package/entity/relation-array.js +176 -0
- package/entity/relation-array.js.map +1 -0
- package/entity/unattached-children-map.d.ts +1 -0
- package/entity/unattached-children-map.js +105 -0
- package/entity/unattached-children-map.js.map +1 -0
- package/generate-entity-classes.js +1176 -0
- package/manager/entity-manager.d.ts +801 -0
- package/manager/entity-manager.js +2395 -0
- package/manager/entity-manager.js.map +1 -0
- package/{src → manager}/save-options.d.ts +48 -42
- package/manager/save-options.js +51 -0
- package/manager/save-options.js.map +1 -0
- package/{src → metadata}/data-service.d.ts +229 -184
- package/metadata/data-service.js +246 -0
- package/metadata/data-service.js.map +1 -0
- package/metadata/data-type.d.ts +122 -0
- package/metadata/data-type.js +465 -0
- package/metadata/data-type.js.map +1 -0
- package/metadata/entity-metadata.d.ts +1193 -0
- package/metadata/entity-metadata.js +2502 -0
- package/metadata/entity-metadata.js.map +1 -0
- package/{src → metadata}/local-query-comparison-options.d.ts +65 -59
- package/metadata/local-query-comparison-options.js +69 -0
- package/metadata/local-query-comparison-options.js.map +1 -0
- package/{src → metadata}/naming-convention.d.ts +75 -72
- package/metadata/naming-convention.js +97 -0
- package/metadata/naming-convention.js.map +1 -0
- package/mixins/mixin-get-entity-graph.d.ts +63 -0
- package/{fesm2022/breeze-client-mixin-get-entity-graph.mjs → mixins/mixin-get-entity-graph.js} +331 -253
- package/mixins/mixin-get-entity-graph.js.map +1 -0
- package/mixins/mixin-save-queuing.d.ts +98 -0
- package/{fesm2022/breeze-client-mixin-save-queuing.mjs → mixins/mixin-save-queuing.js} +493 -365
- package/mixins/mixin-save-queuing.js.map +1 -0
- package/package.json +63 -94
- package/query/entity-query.d.ts +521 -0
- package/query/entity-query.js +1149 -0
- package/query/entity-query.js.map +1 -0
- package/{src → query}/mapping-context.d.ts +44 -46
- package/query/mapping-context.js +412 -0
- package/query/mapping-context.js.map +1 -0
- package/query/predicate.d.ts +394 -0
- package/query/predicate.js +1294 -0
- package/query/predicate.js.map +1 -0
- package/query/property-path.d.ts +252 -0
- package/query/property-path.js +2 -0
- package/query/property-path.js.map +1 -0
- package/{src → query}/query-options.d.ts +143 -119
- package/query/query-options.js +180 -0
- package/query/query-options.js.map +1 -0
- package/rxjs/breeze-rxjs.d.ts +72 -0
- package/rxjs/breeze-rxjs.js +117 -0
- package/rxjs/breeze-rxjs.js.map +1 -0
- package/validation/validate.d.ts +583 -0
- package/validation/validate.js +961 -0
- package/validation/validate.js.map +1 -0
- package/{src → validation}/validation-options.d.ts +67 -63
- package/validation/validation-options.js +70 -0
- package/validation/validation-options.js.map +1 -0
- package/adapter-ajax-angularjs/adapter-ajax-angularjs.d.ts +0 -17
- package/adapter-ajax-angularjs/adapter-core.d.ts +0 -4
- package/adapter-ajax-angularjs/index.d.ts +0 -5
- package/adapter-ajax-fetch/adapter-ajax-fetch.d.ts +0 -18
- package/adapter-ajax-fetch/index.d.ts +0 -5
- package/adapter-ajax-httpclient/adapter-ajax-httpclient.d.ts +0 -13
- package/adapter-ajax-httpclient/adapter-core.d.ts +0 -4
- package/adapter-ajax-httpclient/index.d.ts +0 -5
- package/adapter-ajax-jquery/adapter-ajax-jquery.d.ts +0 -15
- package/adapter-ajax-jquery/index.d.ts +0 -5
- package/adapter-ajax-post/index.d.ts +0 -5
- package/adapter-data-service-odata/adapter-core.d.ts +0 -4
- package/adapter-data-service-odata/adapter-data-service-odata.d.ts +0 -17
- package/adapter-data-service-odata/index.d.ts +0 -5
- package/adapter-data-service-webapi/adapter-data-service-webapi.d.ts +0 -15
- package/adapter-data-service-webapi/index.d.ts +0 -5
- package/adapter-model-library-backing-store/adapter-model-library-backing-store.d.ts +0 -10
- package/adapter-model-library-backing-store/index.d.ts +0 -5
- package/adapter-model-library-ko/adapter-model-library-ko.d.ts +0 -10
- package/adapter-model-library-ko/index.d.ts +0 -5
- package/adapter-uri-builder-json/adapter-core.d.ts +0 -4
- package/adapter-uri-builder-json/adapter-uri-builder-json.d.ts +0 -8
- package/adapter-uri-builder-json/index.d.ts +0 -5
- package/adapter-uri-builder-odata/adapter-core.d.ts +0 -4
- package/adapter-uri-builder-odata/adapter-uri-builder-odata.d.ts +0 -8
- package/adapter-uri-builder-odata/index.d.ts +0 -5
- package/esm2022/adapter-ajax-angularjs/adapter-ajax-angularjs.mjs +0 -135
- package/esm2022/adapter-ajax-angularjs/adapter-core.mjs +0 -49
- package/esm2022/adapter-ajax-angularjs/breeze-client-adapter-ajax-angularjs.mjs +0 -5
- package/esm2022/adapter-ajax-fetch/adapter-ajax-fetch.mjs +0 -135
- package/esm2022/adapter-ajax-fetch/adapter-core.mjs +0 -49
- package/esm2022/adapter-ajax-fetch/breeze-client-adapter-ajax-fetch.mjs +0 -5
- package/esm2022/adapter-ajax-httpclient/adapter-ajax-httpclient.mjs +0 -139
- package/esm2022/adapter-ajax-httpclient/adapter-core.mjs +0 -49
- package/esm2022/adapter-ajax-httpclient/breeze-client-adapter-ajax-httpclient.mjs +0 -5
- package/esm2022/adapter-ajax-jquery/adapter-ajax-jquery.mjs +0 -107
- package/esm2022/adapter-ajax-jquery/breeze-client-adapter-ajax-jquery.mjs +0 -5
- package/esm2022/adapter-ajax-post/adapter-ajax-post.mjs +0 -77
- package/esm2022/adapter-ajax-post/breeze-client-adapter-ajax-post.mjs +0 -5
- package/esm2022/adapter-data-service-odata/adapter-core.mjs +0 -49
- package/esm2022/adapter-data-service-odata/adapter-data-service-odata.mjs +0 -461
- package/esm2022/adapter-data-service-odata/breeze-client-adapter-data-service-odata.mjs +0 -5
- package/esm2022/adapter-data-service-webapi/adapter-data-service-webapi.mjs +0 -100
- package/esm2022/adapter-data-service-webapi/breeze-client-adapter-data-service-webapi.mjs +0 -5
- package/esm2022/adapter-model-library-backing-store/adapter-model-library-backing-store.mjs +0 -269
- package/esm2022/adapter-model-library-backing-store/breeze-client-adapter-model-library-backing-store.mjs +0 -5
- package/esm2022/adapter-model-library-ko/adapter-model-library-ko.mjs +0 -241
- package/esm2022/adapter-model-library-ko/breeze-client-adapter-model-library-ko.mjs +0 -5
- package/esm2022/adapter-uri-builder-json/adapter-core.mjs +0 -49
- package/esm2022/adapter-uri-builder-json/adapter-uri-builder-json.mjs +0 -37
- package/esm2022/adapter-uri-builder-json/breeze-client-adapter-uri-builder-json.mjs +0 -5
- package/esm2022/adapter-uri-builder-odata/adapter-core.mjs +0 -49
- package/esm2022/adapter-uri-builder-odata/adapter-uri-builder-odata.mjs +0 -191
- package/esm2022/adapter-uri-builder-odata/breeze-client-adapter-uri-builder-odata.mjs +0 -5
- package/esm2022/breeze-client.mjs +0 -5
- package/esm2022/index.mjs +0 -2
- package/esm2022/mixin-get-entity-graph/breeze-client-mixin-get-entity-graph.mjs +0 -5
- package/esm2022/mixin-get-entity-graph/mixin-get-entity-graph.mjs +0 -269
- package/esm2022/mixin-save-queuing/breeze-client-mixin-save-queuing.mjs +0 -5
- package/esm2022/mixin-save-queuing/mixin-save-queuing.mjs +0 -421
- package/esm2022/src/abstract-data-service-adapter.mjs +0 -325
- package/esm2022/src/array.mjs +0 -4
- package/esm2022/src/assert-param.mjs +0 -330
- package/esm2022/src/breeze.mjs +0 -85
- package/esm2022/src/complex-array.mjs +0 -117
- package/esm2022/src/config.mjs +0 -232
- package/esm2022/src/core.mjs +0 -712
- package/esm2022/src/csdl-metadata-parser.mjs +0 -385
- package/esm2022/src/data-service.mjs +0 -221
- package/esm2022/src/data-type.mjs +0 -510
- package/esm2022/src/default-property-interceptor.mjs +0 -460
- package/esm2022/src/entity-action.mjs +0 -45
- package/esm2022/src/entity-aspect.mjs +0 -897
- package/esm2022/src/entity-group.mjs +0 -192
- package/esm2022/src/entity-key.mjs +0 -125
- package/esm2022/src/entity-manager.mjs +0 -2163
- package/esm2022/src/entity-metadata.mjs +0 -2242
- package/esm2022/src/entity-query.mjs +0 -1024
- package/esm2022/src/entity-state.mjs +0 -107
- package/esm2022/src/enum.mjs +0 -143
- package/esm2022/src/event.mjs +0 -264
- package/esm2022/src/interface-registry.mjs +0 -39
- package/esm2022/src/key-generator.mjs +0 -110
- package/esm2022/src/local-query-comparison-options.mjs +0 -65
- package/esm2022/src/mapping-context.mjs +0 -411
- package/esm2022/src/naming-convention.mjs +0 -92
- package/esm2022/src/observable-array.mjs +0 -183
- package/esm2022/src/predicate.mjs +0 -1259
- package/esm2022/src/primitive-array.mjs +0 -85
- package/esm2022/src/query-options.mjs +0 -152
- package/esm2022/src/relation-array.mjs +0 -173
- package/esm2022/src/save-options.mjs +0 -41
- package/esm2022/src/unattached-children-map.mjs +0 -56
- package/esm2022/src/validate.mjs +0 -995
- package/esm2022/src/validation-options.mjs +0 -64
- package/fesm2022/breeze-client-adapter-ajax-angularjs.mjs +0 -190
- package/fesm2022/breeze-client-adapter-ajax-angularjs.mjs.map +0 -1
- package/fesm2022/breeze-client-adapter-ajax-fetch.mjs +0 -190
- package/fesm2022/breeze-client-adapter-ajax-fetch.mjs.map +0 -1
- package/fesm2022/breeze-client-adapter-ajax-httpclient.mjs +0 -194
- package/fesm2022/breeze-client-adapter-ajax-httpclient.mjs.map +0 -1
- package/fesm2022/breeze-client-adapter-ajax-jquery.mjs +0 -114
- package/fesm2022/breeze-client-adapter-ajax-jquery.mjs.map +0 -1
- package/fesm2022/breeze-client-adapter-ajax-post.mjs.map +0 -1
- package/fesm2022/breeze-client-adapter-data-service-odata.mjs +0 -516
- package/fesm2022/breeze-client-adapter-data-service-odata.mjs.map +0 -1
- package/fesm2022/breeze-client-adapter-data-service-webapi.mjs.map +0 -1
- package/fesm2022/breeze-client-adapter-model-library-backing-store.mjs +0 -276
- package/fesm2022/breeze-client-adapter-model-library-backing-store.mjs.map +0 -1
- package/fesm2022/breeze-client-adapter-model-library-ko.mjs +0 -248
- package/fesm2022/breeze-client-adapter-model-library-ko.mjs.map +0 -1
- package/fesm2022/breeze-client-adapter-uri-builder-json.mjs.map +0 -1
- package/fesm2022/breeze-client-adapter-uri-builder-odata.mjs +0 -246
- package/fesm2022/breeze-client-adapter-uri-builder-odata.mjs.map +0 -1
- package/fesm2022/breeze-client-mixin-get-entity-graph.mjs.map +0 -1
- package/fesm2022/breeze-client-mixin-save-queuing.mjs.map +0 -1
- package/fesm2022/breeze-client.mjs +0 -14144
- package/fesm2022/breeze-client.mjs.map +0 -1
- package/index.d.ts +0 -1
- package/mixin-get-entity-graph/index.d.ts +0 -5
- package/mixin-get-entity-graph/mixin-get-entity-graph.d.ts +0 -31
- package/mixin-save-queuing/index.d.ts +0 -5
- package/mixin-save-queuing/mixin-save-queuing.d.ts +0 -32
- package/src/abstract-data-service-adapter.d.ts +0 -84
- package/src/array.d.ts +0 -3
- package/src/breeze.d.ts +0 -139
- package/src/complex-array.d.ts +0 -13
- package/src/config.d.ts +0 -104
- package/src/core.d.ts +0 -164
- package/src/csdl-metadata-parser.d.ts +0 -7
- package/src/data-type.d.ts +0 -89
- package/src/default-property-interceptor.d.ts +0 -4
- package/src/entity-aspect.d.ts +0 -332
- package/src/entity-group.d.ts +0 -28
- package/src/entity-key.d.ts +0 -77
- package/src/entity-manager.d.ts +0 -680
- package/src/entity-metadata.d.ts +0 -988
- package/src/entity-query.d.ts +0 -444
- package/src/enum.d.ts +0 -100
- package/src/event.d.ts +0 -142
- package/src/interface-registry.d.ts +0 -150
- package/src/key-generator.d.ts +0 -12
- package/src/observable-array.d.ts +0 -52
- package/src/predicate.d.ts +0 -376
- package/src/primitive-array.d.ts +0 -7
- package/src/relation-array.d.ts +0 -18
- package/src/unattached-children-map.d.ts +0 -19
- package/src/validate.d.ts +0 -650
package/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './src/breeze';
|
|
@@ -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,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
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
|
-
}
|
package/src/complex-array.d.ts
DELETED
|
@@ -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 {};
|