rest-client-vue 1.1.1-b9 → 1.2.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/dist/index.d.ts +31 -11
- package/dist/rest-client-vue.js +478 -391
- package/dist/rest-client-vue.umd.cjs +1 -1
- package/dist/src/rest-collection.d.ts +30 -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 +51 -4
- package/dist/src/stores/rest-collection-store.d.ts.map +1 -1
- package/dist/src/stores/rest-resource-store.d.ts +22 -0
- 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
|
}
|
@@ -128,16 +128,17 @@ export declare interface RestCollection<T extends Resource = Resource> {
|
|
128
128
|
*/
|
129
129
|
resourceType: Ref<ResourceType | undefined>;
|
130
130
|
/**
|
131
|
-
* The REST collection URL
|
132
|
-
*
|
133
|
-
*
|
134
|
-
*
|
135
|
-
* -
|
136
|
-
*
|
137
|
-
*
|
138
|
-
*
|
131
|
+
* The REST collection URL.
|
132
|
+
*
|
133
|
+
* This is reported by the actual Pinia store. It may be arrived at in three ways:
|
134
|
+
* - It may have been specified in {@link RestCollectionOptions.options}.
|
135
|
+
* - It may have been calculated from the entity type and draft batch ID. This is the most common scenario.
|
136
|
+
* - Or this RestCollection may reference an existing store, in which case the URL was determined by the collection
|
137
|
+
* that originally created the store.
|
138
|
+
*
|
139
|
+
* It defaults to null when no store is present.
|
139
140
|
*/
|
140
|
-
restCollectionUrl: Ref<string | null
|
141
|
+
restCollectionUrl: Ref<string | null>;
|
141
142
|
/** A status indicating whether resources have been loaded yet from the REST API. */
|
142
143
|
status: Ref<RestCollectionStatus>;
|
143
144
|
batchSaveAttempted: Ref<boolean>;
|
@@ -283,6 +284,24 @@ export declare interface RestCollection<T extends Resource = Resource> {
|
|
283
284
|
* @param params TODO
|
284
285
|
*/
|
285
286
|
saveResources: (resources: T[]) => Promise<T[] | undefined>;
|
287
|
+
/**
|
288
|
+
* Partial update of one resource.
|
289
|
+
*
|
290
|
+
* If you call this with await, it will return once the API call has completed, and if the APi call succeeded, it will
|
291
|
+
* return the newly saved item.
|
292
|
+
*
|
293
|
+
* @param partialResource The partial resource to update.
|
294
|
+
*/
|
295
|
+
updateResource: (partialResource: T) => Promise<T | null | undefined>;
|
296
|
+
/**
|
297
|
+
* Partial update of multiple resources.
|
298
|
+
*
|
299
|
+
* If you call this with await, it will return once the API call has completed, and if the APi call succeeded, it will
|
300
|
+
* return the saved items.
|
301
|
+
*
|
302
|
+
* @param partialResources The partial resources to update.
|
303
|
+
*/
|
304
|
+
updateResources: (partialResources: T[]) => Promise<T[] | undefined>;
|
286
305
|
/**
|
287
306
|
* Record which resources have failed validation.
|
288
307
|
*
|
@@ -378,7 +397,7 @@ export declare interface RestCollectionStoreOptionsInput {
|
|
378
397
|
pageSize?: number | null;
|
379
398
|
};
|
380
399
|
order?: [any, string][];
|
381
|
-
|
400
|
+
propertiesToExclude?: string[] | ((resourceType: ResourceType) => string[]);
|
382
401
|
referencePathsToExpand?: string[] | ((resourceType: ResourceType) => string[]);
|
383
402
|
restCollectionUrl?: string | null;
|
384
403
|
}
|
@@ -470,6 +489,7 @@ export declare interface RestResourceClient<T extends Resource = Resource> {
|
|
470
489
|
refreshResource: () => Promise<T | null | undefined>;
|
471
490
|
deleteResource: () => Promise<void>;
|
472
491
|
saveResource: (resource: T) => Promise<T | null | undefined>;
|
492
|
+
updateResource: (partialResource: T) => Promise<T | null | undefined>;
|
473
493
|
makeCustomApiRequest: (params: MakeCustomApiRequestParams) => Promise<any>;
|
474
494
|
}
|
475
495
|
|