breeze-client 2.1.6 → 2.1.7
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/breeze-client.metadata.json +1 -1
- package/bundles/breeze-client.umd.js +88 -38
- package/bundles/breeze-client.umd.js.map +1 -1
- package/bundles/breeze-client.umd.min.js +1 -1
- package/bundles/breeze-client.umd.min.js.map +1 -1
- package/esm2015/src/abstract-data-service-adapter.js +68 -37
- package/esm2015/src/entity-query.js +23 -4
- package/esm5/src/abstract-data-service-adapter.js +68 -37
- package/esm5/src/entity-query.js +23 -4
- package/fesm2015/breeze-client.js +88 -38
- package/fesm2015/breeze-client.js.map +1 -1
- package/fesm5/breeze-client.js +88 -38
- package/fesm5/breeze-client.js.map +1 -1
- package/package.json +1 -1
- package/src/abstract-data-service-adapter.d.ts +20 -0
- package/src/entity-query.d.ts +17 -3
package/package.json
CHANGED
|
@@ -17,7 +17,27 @@ export declare abstract class AbstractDataServiceAdapter implements DataServiceA
|
|
|
17
17
|
checkForRecomposition(interfaceInitializedArgs: any): void;
|
|
18
18
|
initialize(): void;
|
|
19
19
|
fetchMetadata(metadataStore: MetadataStore, dataService: DataService): Promise<unknown>;
|
|
20
|
+
/** Execute the query in the mappingContext using the ajaxImpl. */
|
|
20
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
|
+
};
|
|
21
41
|
saveChanges(saveContext: SaveContext, saveBundle: SaveBundle): Promise<SaveResult>;
|
|
22
42
|
/** Abstract method that needs to be overwritten in any concrete DataServiceAdapter subclass.
|
|
23
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.
|
package/src/entity-query.d.ts
CHANGED
|
@@ -49,6 +49,8 @@ export declare class EntityQuery {
|
|
|
49
49
|
inlineCountEnabled: boolean;
|
|
50
50
|
/** Whether entity tracking has been disabled for this query. __Read Only__ */
|
|
51
51
|
noTrackingEnabled: boolean;
|
|
52
|
+
/** Whether to send query as the body of a POST request. (Server needs to accomodate POST). __Read Only__ */
|
|
53
|
+
usePostEnabled: boolean;
|
|
52
54
|
/** The [[QueryOptions]] for this query. __Read Only__ **/
|
|
53
55
|
queryOptions?: QueryOptions;
|
|
54
56
|
/** The [[DataService]] for this query. __Read Only__ **/
|
|
@@ -207,7 +209,7 @@ export declare class EntityQuery {
|
|
|
207
209
|
**/
|
|
208
210
|
withParameters(parameters: Object): EntityQuery;
|
|
209
211
|
/**
|
|
210
|
-
Returns a query with the
|
|
212
|
+
Returns a query with the `inlineCount` capability either enabled or disabled. With `inlineCount` enabled, an additional 'inlineCount' property
|
|
211
213
|
will be returned with the query results that will contain the number of entities that would have been returned by this
|
|
212
214
|
query with only the 'where'/'filter' clauses applied, i.e. without any 'skip'/'take' operators applied. For local queries this clause is ignored.
|
|
213
215
|
> let query = new EntityQuery("Customers")
|
|
@@ -215,13 +217,13 @@ export declare class EntityQuery {
|
|
|
215
217
|
> .orderBy("CompanyName")
|
|
216
218
|
> .inlineCount(true);
|
|
217
219
|
|
|
218
|
-
will return the first 20 customers as well as a count of
|
|
220
|
+
will return the first 20 customers as well as a count of _all_ of the customers in the remote store.
|
|
219
221
|
@param enabled - (default = true) Whether or not inlineCount capability should be enabled. If this parameter is omitted, true is assumed.
|
|
220
222
|
**/
|
|
221
223
|
inlineCount(enabled?: boolean): EntityQuery;
|
|
222
224
|
useNameOnServer(usesNameOnServer?: boolean): EntityQuery;
|
|
223
225
|
/**
|
|
224
|
-
Returns a query with the
|
|
226
|
+
Returns a query with the `noTracking` capability either enabled or disabled. With `noTracking` enabled, the results of this query
|
|
225
227
|
will not be coerced into entities but will instead look like raw javascript projections. i.e. simple javascript objects.
|
|
226
228
|
> let query = new EntityQuery("Customers")
|
|
227
229
|
> .take(20)
|
|
@@ -230,6 +232,18 @@ export declare class EntityQuery {
|
|
|
230
232
|
@param enabled - (default = true) Whether or not the noTracking capability should be enabled. If this parameter is omitted, true is assumed.
|
|
231
233
|
**/
|
|
232
234
|
noTracking(enabled?: boolean): EntityQuery;
|
|
235
|
+
/**
|
|
236
|
+
Returns a query with the `usePost` capability either enabled or disabled. With `usePost` enabled, the query is sent
|
|
237
|
+
as a POST request (instead of GET) and the query expression will be sent as JSON in the body of the post.
|
|
238
|
+
Note that the server must be able to parse the body of the request; otherwise the query expression will be ignored.
|
|
239
|
+
> let query = new EntityQuery("Customers")
|
|
240
|
+
> .where("companyId", "eq", 1)
|
|
241
|
+
> .usePost(true);
|
|
242
|
+
results in a POST request to `{host}/{path}/Customers`
|
|
243
|
+
with body `{"where": {"companyId":{"eq":1}}}`
|
|
244
|
+
@param enabled - (default = true) Whether or not usePost should be enabled. If this parameter is omitted, true is assumed.
|
|
245
|
+
**/
|
|
246
|
+
usePost(enabled?: boolean): EntityQuery;
|
|
233
247
|
using(obj: EntityManager): EntityQuery;
|
|
234
248
|
using(obj: DataService): EntityQuery;
|
|
235
249
|
using(obj: JsonResultsAdapter): EntityQuery;
|