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
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
import type { BaseAdapter } from './config.js';
|
|
2
|
+
import { MappingContext } from '../query/mapping-context.js';
|
|
3
|
+
import { EntityQuery } from '../query/entity-query.js';
|
|
4
|
+
import { MetadataStore } from '../metadata/entity-metadata.js';
|
|
5
|
+
import { JsonResultsAdapter, DataService } from '../metadata/data-service.js';
|
|
6
|
+
import { Entity } from '../entity/entity-aspect.js';
|
|
7
|
+
import { SaveContext, SaveBundle, QueryResult, SaveResult, HttpResponse } from '../manager/entity-manager.js';
|
|
8
|
+
export { InterfaceRegistry } from './config.js';
|
|
9
|
+
/** Adapter names for the deprecated `config.initializeAdapterInstances`. Each is the name of a previously registered adapter. */
|
|
10
|
+
export interface InterfaceRegistryConfig {
|
|
11
|
+
/** e.g. `'fetch'` */
|
|
12
|
+
ajax?: string;
|
|
13
|
+
/** e.g. `'backingStore'` */
|
|
14
|
+
modelLibrary?: string;
|
|
15
|
+
/** e.g. `'webApi'` */
|
|
16
|
+
dataService?: string;
|
|
17
|
+
/** e.g. `'json'` */
|
|
18
|
+
uriBuilder?: string;
|
|
19
|
+
}
|
|
20
|
+
/** DataServiceAdapter Ajax request configuration */
|
|
21
|
+
export interface AjaxConfig {
|
|
22
|
+
/** The request URL, without `params`: `{serviceName}/Metadata`, the save URL, or the query URL the {@link UriBuilderAdapter} built. */
|
|
23
|
+
url: string;
|
|
24
|
+
/** GET, POST, etc. */
|
|
25
|
+
type?: string;
|
|
26
|
+
/** json, etc. */
|
|
27
|
+
dataType?: string;
|
|
28
|
+
/** The `Content-Type` of the request body. The fetch transport sends it only for a request with a body (not GET or HEAD), defaulting to `application/json`. */
|
|
29
|
+
contentType?: string;
|
|
30
|
+
/** Not used by Breeze's own transport. Set to `true` for the deprecated `useJsonp` option, for a registered ajax adapter that acts on it. */
|
|
31
|
+
crossDomain?: string | boolean;
|
|
32
|
+
/** Additional request headers, merged over the `Content-Type` header. Breeze's own adapters do not set any. */
|
|
33
|
+
headers?: {};
|
|
34
|
+
/** The request body. A string is sent as it is; anything else is sent as `JSON.stringify(data)`. Ignored for GET and HEAD. */
|
|
35
|
+
data?: any;
|
|
36
|
+
/** Query-string parameters to append to `url`: the values given to {@link EntityQuery.withParameters}. A `Date` is sent as its ISO string. */
|
|
37
|
+
params?: {};
|
|
38
|
+
/** Called with the response when the request succeeds: a 2xx status and a body that parses as JSON. */
|
|
39
|
+
success: (res: HttpResponse) => void;
|
|
40
|
+
/** Called with the response when the request fails: a non-2xx status, a body that cannot be read, or no response at all (status 0). */
|
|
41
|
+
error: (res: (HttpResponse | Error)) => void;
|
|
42
|
+
}
|
|
43
|
+
/** Request sent by AjaxAdapter.
|
|
44
|
+
@deprecated Part of the ajax adapter contract, which Breeze 3 no longer needs. */
|
|
45
|
+
export interface AjaxRequest {
|
|
46
|
+
/** AjaxAdapter that initiated the request */
|
|
47
|
+
adapter: AjaxAdapter;
|
|
48
|
+
/** Request configuration */
|
|
49
|
+
config: RequestInit;
|
|
50
|
+
/** config from the DataServiceAdapter that called the AjaxAdapter */
|
|
51
|
+
dsaConfig: AjaxConfig;
|
|
52
|
+
/** Function called on response error */
|
|
53
|
+
error: (status: number, statusText: string, body: string | null, response: Response | null, errorThrown: any) => void;
|
|
54
|
+
/** Function called on response success */
|
|
55
|
+
success: (data: any, statusText: string, response: Response) => void;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* A fetch-compatible function. This is the seam for supplying your own transport:
|
|
59
|
+
* add auth headers, retry, request signing, route through a framework HTTP client
|
|
60
|
+
* (Angular's HttpClient, so requests pass through its interceptors), or stub it in
|
|
61
|
+
* tests. Defaults to `globalThis.fetch`.
|
|
62
|
+
*/
|
|
63
|
+
export type BreezeFetch = (input: RequestInfo | URL, init?: RequestInit) => Promise<Response>;
|
|
64
|
+
/** Handles AJAX requests to server.
|
|
65
|
+
@deprecated Breeze 3 needs no ajax adapter: requests go through `config.fetch`. Set it with
|
|
66
|
+
`configureBreeze({ fetch })`. */
|
|
67
|
+
export interface AjaxAdapter extends BaseAdapter {
|
|
68
|
+
/** Function that performs the ajax request and calls the success or error function */
|
|
69
|
+
ajax(config: AjaxConfig): void;
|
|
70
|
+
/** Container for headers to be added to each request */
|
|
71
|
+
defaultSettings: {
|
|
72
|
+
/** Headers to add to every request, by name. */
|
|
73
|
+
headers?: {
|
|
74
|
+
[name: string]: string;
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
/** Function to allow manipulating the request before sending */
|
|
78
|
+
requestInterceptor?: (req: AjaxRequest) => void;
|
|
79
|
+
}
|
|
80
|
+
/** Adapts breeze change-tracking to the UI framework */
|
|
81
|
+
export interface ModelLibraryAdapter extends BaseAdapter {
|
|
82
|
+
/** Returns the names of the properties on an instance of an entity or complex type that the model library would track. Breeze calls it on a new instance of the type's constructor when it prepares the constructor, and adds any names the metadata does not know as unmapped properties. */
|
|
83
|
+
getTrackablePropertyNames: (entity: any) => string[];
|
|
84
|
+
/** Prepares the prototype of an entity or complex type constructor for tracking - for the backing store, adding `getProperty`, `setProperty` and a property accessor for each mapped property. Called when Breeze first sets up a type's constructor, and again when a property is added to a type whose prototype has already been prepared. */
|
|
85
|
+
initializeEntityPrototype(proto: Object): void;
|
|
86
|
+
/** Starts tracking one new entity or complex object - for the backing store, moving its initial values into the backing store and giving each unset property its default value. Called once per instance, when its `EntityAspect` or `ComplexAspect` is created. Despite the parameter's name, Breeze passes the constructor's prototype as the second argument. */
|
|
87
|
+
startTracking(entity: any, entityCtor: Function): void;
|
|
88
|
+
/** Optional. The stored value of a property, without creating anything that reading it would
|
|
89
|
+
create - the backing store builds a collection navigation's array on first read. Breeze
|
|
90
|
+
falls back to `getProperty` for an adapter that does not implement this, which simply
|
|
91
|
+
means the array is created as it always was. */
|
|
92
|
+
peekProperty?(entity: any, propertyName: string): any;
|
|
93
|
+
/** Optional. Called with the {@link EntityType} or {@link ComplexType} to create a constructor for a type that has none registered. Without it, Breeze creates an empty constructor. */
|
|
94
|
+
createCtor?: Function;
|
|
95
|
+
}
|
|
96
|
+
/** Reshapes data moving between breeze and server */
|
|
97
|
+
export interface DataServiceAdapter extends BaseAdapter {
|
|
98
|
+
/**
|
|
99
|
+
Fetches the metadata for a service and imports it into the `MetadataStore`. Called by
|
|
100
|
+
`MetadataStore.fetchMetadata`, and before the first query to a service that has server metadata.
|
|
101
|
+
Resolves with the raw metadata, or with a string saying why there is none (for example, that
|
|
102
|
+
another request already fetched it). Rejects with the server error if the request fails.
|
|
103
|
+
*/
|
|
104
|
+
fetchMetadata(metadataStore: MetadataStore, dataService: DataService): Promise<any>;
|
|
105
|
+
/**
|
|
106
|
+
Sends the query in `mappingContext` to the server. Resolves with the raw results, the inline count
|
|
107
|
+
if one was asked for, and the `httpResponse`; Breeze then merges the results into the cache
|
|
108
|
+
through the {@link JsonResultsAdapter}.
|
|
109
|
+
*/
|
|
110
|
+
executeQuery(mappingContext: MappingContext): Promise<QueryResult>;
|
|
111
|
+
/**
|
|
112
|
+
Sends the entities in `saveBundle` to the server and resolves with the saved entities and any
|
|
113
|
+
key mappings. Called by `EntityManager.saveChanges`. Rejects with the server error, including
|
|
114
|
+
any per-entity errors, if the save fails.
|
|
115
|
+
*/
|
|
116
|
+
saveChanges(saveContext: SaveContext, saveBundle: SaveBundle): Promise<SaveResult>;
|
|
117
|
+
/**
|
|
118
|
+
The constructor of the {@link ChangeRequestInterceptor} the adapter creates for each save, to let
|
|
119
|
+
an application change each entity's save request and the finished array of requests without
|
|
120
|
+
writing its own adapter. Defaults to a no-op interceptor.
|
|
121
|
+
*/
|
|
122
|
+
changeRequestInterceptor: ChangeRequestInterceptorCtor;
|
|
123
|
+
/**
|
|
124
|
+
The {@link JsonResultsAdapter} used to read this adapter's query and save results, unless the
|
|
125
|
+
{@link DataService} names one of its own.
|
|
126
|
+
*/
|
|
127
|
+
jsonResultsAdapter: JsonResultsAdapter;
|
|
128
|
+
}
|
|
129
|
+
/** Function called by AjaxAdapter before sending request.
|
|
130
|
+
@deprecated Wrap the fetch function instead - see `configureBreeze({ fetch })`. */
|
|
131
|
+
export interface AjaxRequestInterceptor {
|
|
132
|
+
(req: AjaxRequest): void;
|
|
133
|
+
/** Whether to remove the interceptor after it is called */
|
|
134
|
+
oneTime: boolean;
|
|
135
|
+
}
|
|
136
|
+
/** Builds URI for performing queries. Serializes the EntityQuery according to the URI syntax. */
|
|
137
|
+
export interface UriBuilderAdapter extends BaseAdapter {
|
|
138
|
+
/** Returns the URL for the query, relative to the service: its resource name followed by the query in this adapter's syntax. Breeze qualifies it with the service name, and sends the query's `withParameters` values separately, as request params. */
|
|
139
|
+
buildUri(query: EntityQuery, metadataStore: MetadataStore): string;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
The constructor a {@link DataServiceAdapter} calls to create a {@link ChangeRequestInterceptor}
|
|
143
|
+
for one save. Assign your own to the adapter's `changeRequestInterceptor` property.
|
|
144
|
+
*/
|
|
145
|
+
export interface ChangeRequestInterceptorCtor {
|
|
146
|
+
/** Creates the interceptor for one save, given that save's context and the bundle about to be sent. */
|
|
147
|
+
new (saveContext: SaveContext, saveBundle: SaveBundle): ChangeRequestInterceptor;
|
|
148
|
+
}
|
|
149
|
+
/** Allows manipulating data in DataServiceAdapter before sending to server */
|
|
150
|
+
export interface ChangeRequestInterceptor {
|
|
151
|
+
/** Whether to intercept only one save. If set, the adapter goes back to its no-op interceptor after creating this one. */
|
|
152
|
+
oneTime?: boolean;
|
|
153
|
+
/**
|
|
154
|
+
Prepare and return the save data for an entity change-set.
|
|
155
|
+
|
|
156
|
+
The adapter calls this method for each entity in the change-set,
|
|
157
|
+
after it has prepared a "change request" for that object.
|
|
158
|
+
|
|
159
|
+
The method can do anything to the request but it must return a valid, non-null request.
|
|
160
|
+
@example
|
|
161
|
+
this.getRequest = function (request, entity, index) {
|
|
162
|
+
// alter the request that the adapter prepared for this entity
|
|
163
|
+
// based on the entity, saveContext, and saveBundle
|
|
164
|
+
// e.g., add a custom header or prune the originalValuesMap
|
|
165
|
+
return request;
|
|
166
|
+
};
|
|
167
|
+
@param request {Object} The object representing the adapter's request to save this entity.
|
|
168
|
+
@param entity {Entity} The entity-to-be-save as it is in cache
|
|
169
|
+
@param index {Integer} The zero-based index of this entity in the change-set array
|
|
170
|
+
@returns {Function} The potentially revised request.
|
|
171
|
+
*/
|
|
172
|
+
getRequest(request: any, entity: Entity, index: number): any;
|
|
173
|
+
/**
|
|
174
|
+
Last chance to change anything about the 'requests' array
|
|
175
|
+
after it has been built with requests for all of the entities-to-be-saved.
|
|
176
|
+
|
|
177
|
+
The 'requests' array is the same as 'saveBundle.entities' in many implementations
|
|
178
|
+
|
|
179
|
+
This method can do anything to the array including add and remove requests.
|
|
180
|
+
It's up to you to ensure that server will accept the requests array data as valid.
|
|
181
|
+
|
|
182
|
+
Returned value is ignored.
|
|
183
|
+
@example
|
|
184
|
+
this.done = function (requests) {
|
|
185
|
+
// alter the array of requests representing the entire change-set
|
|
186
|
+
// based on the saveContext and saveBundle
|
|
187
|
+
};
|
|
188
|
+
@param requests {Array of Object} The adapter's array of request for this changeset.
|
|
189
|
+
*/
|
|
190
|
+
done(requests: Object[]): void;
|
|
191
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
// InterfaceRegistry - and config.interfaceRegistry and config.initializeAdapterInstances with it -
|
|
2
|
+
// is defined in config.ts: every adapter lookup needs it, and a bundler may drop this module,
|
|
3
|
+
// which holds only types. See "sideEffects" in CHANGES-DEV.md.
|
|
4
|
+
export { InterfaceRegistry } from './config.js';
|
|
5
|
+
//# sourceMappingURL=interface-registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interface-registry.js","sourceRoot":"","sources":["../../src/config/interface-registry.ts"],"names":[],"mappings":"AAQA,mGAAmG;AACnG,8FAA8F;AAC9F,+DAA+D;AAC/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC","sourcesContent":["import type { BaseAdapter } from './config.js';\r\nimport { MappingContext } from '../query/mapping-context.js';\r\nimport { EntityQuery } from '../query/entity-query.js';\r\nimport { MetadataStore } from '../metadata/entity-metadata.js';\r\nimport { JsonResultsAdapter, DataService } from '../metadata/data-service.js';\r\nimport { Entity } from '../entity/entity-aspect.js';\r\nimport { SaveContext, SaveBundle, QueryResult, SaveResult, HttpResponse } from '../manager/entity-manager.js';\r\n\r\n// InterfaceRegistry - and config.interfaceRegistry and config.initializeAdapterInstances with it -\r\n// is defined in config.ts: every adapter lookup needs it, and a bundler may drop this module,\r\n// which holds only types. See \"sideEffects\" in CHANGES-DEV.md.\r\nexport { InterfaceRegistry } from './config.js';\r\n\r\n/** Adapter names for the deprecated `config.initializeAdapterInstances`. Each is the name of a previously registered adapter. */\r\nexport interface InterfaceRegistryConfig {\r\n /** e.g. `'fetch'` */\r\n ajax?: string;\r\n /** e.g. `'backingStore'` */\r\n modelLibrary?: string;\r\n /** e.g. `'webApi'` */\r\n dataService?: string;\r\n /** e.g. `'json'` */\r\n uriBuilder?: string;\r\n}\r\n\r\n/** DataServiceAdapter Ajax request configuration */\r\nexport interface AjaxConfig {\r\n /** The request URL, without `params`: `{serviceName}/Metadata`, the save URL, or the query URL the {@link UriBuilderAdapter} built. */\r\n url: string;\r\n /** GET, POST, etc. */\r\n type?: string;\r\n /** json, etc. */\r\n dataType?: string;\r\n /** The `Content-Type` of the request body. The fetch transport sends it only for a request with a body (not GET or HEAD), defaulting to `application/json`. */\r\n contentType?: string;\r\n /** Not used by Breeze's own transport. Set to `true` for the deprecated `useJsonp` option, for a registered ajax adapter that acts on it. */\r\n crossDomain?: string | boolean;\r\n /** Additional request headers, merged over the `Content-Type` header. Breeze's own adapters do not set any. */\r\n headers?: {};\r\n /** The request body. A string is sent as it is; anything else is sent as `JSON.stringify(data)`. Ignored for GET and HEAD. */\r\n data?: any;\r\n /** Query-string parameters to append to `url`: the values given to {@link EntityQuery.withParameters}. A `Date` is sent as its ISO string. */\r\n params?: {};\r\n /** Called with the response when the request succeeds: a 2xx status and a body that parses as JSON. */\r\n success: (res: HttpResponse) => void;\r\n /** Called with the response when the request fails: a non-2xx status, a body that cannot be read, or no response at all (status 0). */\r\n error: (res: (HttpResponse | Error)) => void;\r\n}\r\n\r\n/** Request sent by AjaxAdapter.\r\n @deprecated Part of the ajax adapter contract, which Breeze 3 no longer needs. */\r\nexport interface AjaxRequest {\r\n /** AjaxAdapter that initiated the request */\r\n adapter: AjaxAdapter;\r\n /** Request configuration */\r\n config: RequestInit;\r\n /** config from the DataServiceAdapter that called the AjaxAdapter */\r\n dsaConfig: AjaxConfig;\r\n /** Function called on response error */\r\n error: (status: number, statusText: string, body: string | null, response: Response | null, errorThrown: any) => void;\r\n /** Function called on response success */\r\n success: (data: any, statusText: string, response: Response) => void;\r\n}\r\n\r\n/**\r\n * A fetch-compatible function. This is the seam for supplying your own transport:\r\n * add auth headers, retry, request signing, route through a framework HTTP client\r\n * (Angular's HttpClient, so requests pass through its interceptors), or stub it in\r\n * tests. Defaults to `globalThis.fetch`.\r\n */\r\nexport type BreezeFetch = (input: RequestInfo | URL, init?: RequestInit) => Promise<Response>;\r\n\r\n/** Handles AJAX requests to server.\r\n @deprecated Breeze 3 needs no ajax adapter: requests go through `config.fetch`. Set it with\r\n `configureBreeze({ fetch })`. */\r\nexport interface AjaxAdapter extends BaseAdapter {\r\n /** Function that performs the ajax request and calls the success or error function */\r\n ajax(config: AjaxConfig): void;\r\n /** Container for headers to be added to each request */\r\n defaultSettings: {\r\n /** Headers to add to every request, by name. */\r\n headers?: { [name: string]: string }\r\n };\r\n /** Function to allow manipulating the request before sending */\r\n requestInterceptor?: (req: AjaxRequest) => void;\r\n}\r\n\r\n/** Adapts breeze change-tracking to the UI framework */\r\nexport interface ModelLibraryAdapter extends BaseAdapter {\r\n /** Returns the names of the properties on an instance of an entity or complex type that the model library would track. Breeze calls it on a new instance of the type's constructor when it prepares the constructor, and adds any names the metadata does not know as unmapped properties. */\r\n getTrackablePropertyNames: (entity: any) => string[];\r\n /** Prepares the prototype of an entity or complex type constructor for tracking - for the backing store, adding `getProperty`, `setProperty` and a property accessor for each mapped property. Called when Breeze first sets up a type's constructor, and again when a property is added to a type whose prototype has already been prepared. */\r\n initializeEntityPrototype(proto: Object): void;\r\n /** Starts tracking one new entity or complex object - for the backing store, moving its initial values into the backing store and giving each unset property its default value. Called once per instance, when its `EntityAspect` or `ComplexAspect` is created. Despite the parameter's name, Breeze passes the constructor's prototype as the second argument. */\r\n startTracking(entity: any, entityCtor: Function): void;\r\n /** Optional. The stored value of a property, without creating anything that reading it would\r\n create - the backing store builds a collection navigation's array on first read. Breeze\r\n falls back to `getProperty` for an adapter that does not implement this, which simply\r\n means the array is created as it always was. */\r\n peekProperty?(entity: any, propertyName: string): any;\r\n /** Optional. Called with the {@link EntityType} or {@link ComplexType} to create a constructor for a type that has none registered. Without it, Breeze creates an empty constructor. */\r\n createCtor?: Function;\r\n}\r\n\r\n/** Reshapes data moving between breeze and server */\r\nexport interface DataServiceAdapter extends BaseAdapter {\r\n /**\r\n Fetches the metadata for a service and imports it into the `MetadataStore`. Called by\r\n `MetadataStore.fetchMetadata`, and before the first query to a service that has server metadata.\r\n Resolves with the raw metadata, or with a string saying why there is none (for example, that\r\n another request already fetched it). Rejects with the server error if the request fails.\r\n */\r\n fetchMetadata(metadataStore: MetadataStore, dataService: DataService): Promise<any>; // result of Promise is either rawMetadata or a string explaining why not.\r\n /**\r\n Sends the query in `mappingContext` to the server. Resolves with the raw results, the inline count\r\n if one was asked for, and the `httpResponse`; Breeze then merges the results into the cache\r\n through the {@link JsonResultsAdapter}.\r\n */\r\n executeQuery(mappingContext: MappingContext): Promise<QueryResult>; // result of executeQuery will get passed to JsonResultsAdapter extractResults method\r\n /**\r\n Sends the entities in `saveBundle` to the server and resolves with the saved entities and any\r\n key mappings. Called by `EntityManager.saveChanges`. Rejects with the server error, including\r\n any per-entity errors, if the save fails.\r\n */\r\n saveChanges(saveContext: SaveContext, saveBundle: SaveBundle): Promise<SaveResult>;\r\n /**\r\n The constructor of the {@link ChangeRequestInterceptor} the adapter creates for each save, to let\r\n an application change each entity's save request and the finished array of requests without\r\n writing its own adapter. Defaults to a no-op interceptor.\r\n */\r\n changeRequestInterceptor: ChangeRequestInterceptorCtor;\r\n /**\r\n The {@link JsonResultsAdapter} used to read this adapter's query and save results, unless the\r\n {@link DataService} names one of its own.\r\n */\r\n jsonResultsAdapter: JsonResultsAdapter;\r\n}\r\n\r\n/** Function called by AjaxAdapter before sending request.\r\n @deprecated Wrap the fetch function instead - see `configureBreeze({ fetch })`. */\r\nexport interface AjaxRequestInterceptor {\r\n (req: AjaxRequest) : void;\r\n /** Whether to remove the interceptor after it is called */\r\n oneTime: boolean;\r\n}\r\n\r\n/** Builds URI for performing queries. Serializes the EntityQuery according to the URI syntax. */\r\nexport interface UriBuilderAdapter extends BaseAdapter {\r\n /** Returns the URL for the query, relative to the service: its resource name followed by the query in this adapter's syntax. Breeze qualifies it with the service name, and sends the query's `withParameters` values separately, as request params. */\r\n buildUri(query: EntityQuery, metadataStore: MetadataStore): string;\r\n}\r\n\r\n// -----------------------------------\r\n\r\n/**\r\nThe constructor a {@link DataServiceAdapter} calls to create a {@link ChangeRequestInterceptor}\r\nfor one save. Assign your own to the adapter's `changeRequestInterceptor` property.\r\n*/\r\nexport interface ChangeRequestInterceptorCtor {\r\n /** Creates the interceptor for one save, given that save's context and the bundle about to be sent. */\r\n new (saveContext: SaveContext, saveBundle: SaveBundle): ChangeRequestInterceptor;\r\n}\r\n\r\n/** Allows manipulating data in DataServiceAdapter before sending to server */\r\nexport interface ChangeRequestInterceptor {\r\n /** Whether to intercept only one save. If set, the adapter goes back to its no-op interceptor after creating this one. */\r\n oneTime?: boolean;\r\n /**\r\n Prepare and return the save data for an entity change-set.\r\n \r\n The adapter calls this method for each entity in the change-set,\r\n after it has prepared a \"change request\" for that object.\r\n \r\n The method can do anything to the request but it must return a valid, non-null request.\r\n @example\r\n this.getRequest = function (request, entity, index) {\r\n // alter the request that the adapter prepared for this entity\r\n // based on the entity, saveContext, and saveBundle\r\n // e.g., add a custom header or prune the originalValuesMap\r\n return request;\r\n };\r\n @param request {Object} The object representing the adapter's request to save this entity.\r\n @param entity {Entity} The entity-to-be-save as it is in cache\r\n @param index {Integer} The zero-based index of this entity in the change-set array\r\n @returns {Function} The potentially revised request.\r\n */\r\n getRequest(request: any, entity: Entity, index: number): any;\r\n\r\n /**\r\n Last chance to change anything about the 'requests' array\r\n after it has been built with requests for all of the entities-to-be-saved.\r\n \r\n The 'requests' array is the same as 'saveBundle.entities' in many implementations\r\n \r\n This method can do anything to the array including add and remove requests.\r\n It's up to you to ensure that server will accept the requests array data as valid.\r\n \r\n Returned value is ignored.\r\n @example\r\n this.done = function (requests) {\r\n // alter the array of requests representing the entire change-set\r\n // based on the saveContext and saveBundle\r\n };\r\n @param requests {Array of Object} The adapter's array of request for this changeset.\r\n */\r\n done(requests: Object[]): void;\r\n}"]}
|
|
@@ -1,60 +1,52 @@
|
|
|
1
|
-
import { BreezeEnum } from './enum';
|
|
2
|
-
/** @hidden
|
|
3
|
-
export interface IParamContext {
|
|
4
|
-
typeName?: string;
|
|
5
|
-
type?: Function;
|
|
6
|
-
prevContext?: IParamContext;
|
|
7
|
-
msg?: string | ((context: IParamContext, v: any) => string);
|
|
8
|
-
mustNotBeEmpty?: boolean;
|
|
9
|
-
enumType?: BreezeEnum;
|
|
10
|
-
propertyName?: string;
|
|
11
|
-
allowNull?: boolean;
|
|
12
|
-
fn?(context: IParamContext, v: any): boolean;
|
|
13
|
-
}
|
|
14
|
-
/** @hidden
|
|
15
|
-
export interface IConfigParam {
|
|
16
|
-
config: any;
|
|
17
|
-
params: Param[];
|
|
18
|
-
whereParam: (propName: string) => Param;
|
|
19
|
-
}
|
|
20
|
-
/** @hidden
|
|
21
|
-
export declare class Param {
|
|
22
|
-
v: any;
|
|
23
|
-
name: string;
|
|
24
|
-
defaultValue: any;
|
|
25
|
-
parent: IConfigParam;
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
/** @hidden @internal */
|
|
54
|
-
_applyOne: (this: Param, instance: any) => void;
|
|
55
|
-
MESSAGE_PREFIX: string;
|
|
56
|
-
}
|
|
57
|
-
/** @hidden @internal */
|
|
58
|
-
export declare let assertParam: (v: any, name: string) => Param;
|
|
59
|
-
/** @hidden @internal */
|
|
60
|
-
export declare let assertConfig: (config: Object) => IConfigParam;
|
|
1
|
+
import { BreezeEnum } from './enum.js';
|
|
2
|
+
/** @hidden */
|
|
3
|
+
export interface IParamContext {
|
|
4
|
+
typeName?: string;
|
|
5
|
+
type?: Function;
|
|
6
|
+
prevContext?: IParamContext;
|
|
7
|
+
msg?: string | ((context: IParamContext, v: any) => string);
|
|
8
|
+
mustNotBeEmpty?: boolean;
|
|
9
|
+
enumType?: BreezeEnum;
|
|
10
|
+
propertyName?: string;
|
|
11
|
+
allowNull?: boolean;
|
|
12
|
+
fn?(context: IParamContext, v: any): boolean;
|
|
13
|
+
}
|
|
14
|
+
/** @hidden */
|
|
15
|
+
export interface IConfigParam {
|
|
16
|
+
config: any;
|
|
17
|
+
params: Param[];
|
|
18
|
+
whereParam: (propName: string) => Param;
|
|
19
|
+
}
|
|
20
|
+
/** @hidden */
|
|
21
|
+
export declare class Param {
|
|
22
|
+
v: any;
|
|
23
|
+
name: string;
|
|
24
|
+
defaultValue: any;
|
|
25
|
+
parent: IConfigParam;
|
|
26
|
+
constructor(v: any, name: string);
|
|
27
|
+
isObject(): Param;
|
|
28
|
+
isBoolean(): Param;
|
|
29
|
+
isString(): Param;
|
|
30
|
+
isNumber(): Param;
|
|
31
|
+
isFunction(): Param;
|
|
32
|
+
isNonEmptyString(): Param;
|
|
33
|
+
isTypeOf(typeName: string): Param;
|
|
34
|
+
isInstanceOf(type: Function, typeName?: string): Param;
|
|
35
|
+
hasProperty(propertyName: string): Param;
|
|
36
|
+
isEnumOf(enumType: any): Param;
|
|
37
|
+
isRequired(allowNull?: boolean): Param;
|
|
38
|
+
isOptional(): Param;
|
|
39
|
+
isNonEmptyArray(): Param;
|
|
40
|
+
isArray(mustNotBeEmpty?: boolean): Param;
|
|
41
|
+
or(): this;
|
|
42
|
+
check(defaultValue?: any): any;
|
|
43
|
+
getMessage(): string;
|
|
44
|
+
withDefault(defaultValue: any): this;
|
|
45
|
+
whereParam(propName: string): Param;
|
|
46
|
+
applyAll(instance: any, checkOnly?: boolean): void;
|
|
47
|
+
MESSAGE_PREFIX: string;
|
|
48
|
+
}
|
|
49
|
+
/** @hidden */
|
|
50
|
+
export declare let assertParam: (v: any, name: string) => Param;
|
|
51
|
+
/** @hidden */
|
|
52
|
+
export declare let assertConfig: (config: Object) => IConfigParam;
|