rest-client-vue 1.1.1-b9 → 1.2.0-b2
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/dist/index.d.ts +24 -11
- package/dist/rest-client-vue.js +416 -355
- package/dist/rest-client-vue.umd.cjs +1 -1
- package/dist/src/rest-collection-resources.d.ts +1 -0
- package/dist/src/rest-collection-resources.d.ts.map +1 -1
- package/dist/src/rest-collection.d.ts +21 -11
- package/dist/src/rest-collection.d.ts.map +1 -1
- package/dist/src/rest-resource.d.ts +1 -0
- package/dist/src/rest-resource.d.ts.map +1 -1
- package/dist/src/stores/rest-collection-store.d.ts +30 -5
- package/dist/src/stores/rest-collection-store.d.ts.map +1 -1
- package/dist/src/stores/rest-resource-store.d.ts +23 -1
- package/dist/src/stores/rest-resource-store.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
@@ -31,7 +31,7 @@ export declare interface ConcreteRestCollectionStoreOptionsInput {
|
|
31
31
|
pageSize?: number | null;
|
32
32
|
};
|
33
33
|
order?: [any, string][];
|
34
|
-
|
34
|
+
propertiesToExclude?: string[];
|
35
35
|
referencePathsToExpand?: string[];
|
36
36
|
restCollectionUrl?: string | null;
|
37
37
|
}
|
@@ -66,6 +66,8 @@ export declare type Resource = object;
|
|
66
66
|
*/
|
67
67
|
export declare type ResourceId<T = string | number> = T;
|
68
68
|
|
69
|
+
export declare type ResourcePropertyUpdate = object;
|
70
|
+
|
69
71
|
/** A subcollection belonging to each resource of a certain type. */
|
70
72
|
export declare interface ResourceSubcollection {
|
71
73
|
/** The subcollection name, which is used in constructing its path. */
|
@@ -128,16 +130,17 @@ export declare interface RestCollection<T extends Resource = Resource> {
|
|
128
130
|
*/
|
129
131
|
resourceType: Ref<ResourceType | undefined>;
|
130
132
|
/**
|
131
|
-
* The REST collection URL
|
132
|
-
*
|
133
|
-
*
|
134
|
-
*
|
135
|
-
* -
|
136
|
-
*
|
137
|
-
*
|
138
|
-
*
|
133
|
+
* The REST collection URL.
|
134
|
+
*
|
135
|
+
* This is reported by the actual Pinia store. It may be arrived at in three ways:
|
136
|
+
* - It may have been specified in {@link RestCollectionOptions.options}.
|
137
|
+
* - It may have been calculated from the entity type and draft batch ID. This is the most common scenario.
|
138
|
+
* - Or this RestCollection may reference an existing store, in which case the URL was determined by the collection
|
139
|
+
* that originally created the store.
|
140
|
+
*
|
141
|
+
* It defaults to null when no store is present.
|
139
142
|
*/
|
140
|
-
restCollectionUrl: Ref<string | null
|
143
|
+
restCollectionUrl: Ref<string | null>;
|
141
144
|
/** A status indicating whether resources have been loaded yet from the REST API. */
|
142
145
|
status: Ref<RestCollectionStatus>;
|
143
146
|
batchSaveAttempted: Ref<boolean>;
|
@@ -283,6 +286,15 @@ export declare interface RestCollection<T extends Resource = Resource> {
|
|
283
286
|
* @param params TODO
|
284
287
|
*/
|
285
288
|
saveResources: (resources: T[]) => Promise<T[] | undefined>;
|
289
|
+
/**
|
290
|
+
* Partial update of one or more resources.
|
291
|
+
*
|
292
|
+
* If you call this with await, it will return once the API call has completed, and if the APi call succeeded, it will
|
293
|
+
* return the updated items.
|
294
|
+
*
|
295
|
+
* @param resourcePropertyUpdates A list of resource IDs, property paths, values, and update methods to apply.
|
296
|
+
*/
|
297
|
+
updateResources: (resourcePropertyUpdates: T[]) => Promise<T[] | undefined>;
|
286
298
|
/**
|
287
299
|
* Record which resources have failed validation.
|
288
300
|
*
|
@@ -378,7 +390,7 @@ export declare interface RestCollectionStoreOptionsInput {
|
|
378
390
|
pageSize?: number | null;
|
379
391
|
};
|
380
392
|
order?: [any, string][];
|
381
|
-
|
393
|
+
propertiesToExclude?: string[] | ((resourceType: ResourceType) => string[]);
|
382
394
|
referencePathsToExpand?: string[] | ((resourceType: ResourceType) => string[]);
|
383
395
|
restCollectionUrl?: string | null;
|
384
396
|
}
|
@@ -470,6 +482,7 @@ export declare interface RestResourceClient<T extends Resource = Resource> {
|
|
470
482
|
refreshResource: () => Promise<T | null | undefined>;
|
471
483
|
deleteResource: () => Promise<void>;
|
472
484
|
saveResource: (resource: T) => Promise<T | null | undefined>;
|
485
|
+
updateResource: (resourcePropertyUpdates: T[]) => Promise<T | null | undefined>;
|
473
486
|
makeCustomApiRequest: (params: MakeCustomApiRequestParams) => Promise<any>;
|
474
487
|
}
|
475
488
|
|