rest-client-vue 1.1.1-b7 → 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 +33 -2
- package/dist/rest-client-vue.js +478 -392
- package/dist/rest-client-vue.umd.cjs +1 -1
- package/dist/src/rest-collection.d.ts +32 -2
- 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
|
}
|
@@ -127,6 +127,18 @@ export declare interface RestCollection<T extends Resource = Resource> {
|
|
127
127
|
* To allow for asynchronous loading of resource types, this may be undefined.
|
128
128
|
*/
|
129
129
|
resourceType: Ref<ResourceType | undefined>;
|
130
|
+
/**
|
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.
|
140
|
+
*/
|
141
|
+
restCollectionUrl: Ref<string | null>;
|
130
142
|
/** A status indicating whether resources have been loaded yet from the REST API. */
|
131
143
|
status: Ref<RestCollectionStatus>;
|
132
144
|
batchSaveAttempted: Ref<boolean>;
|
@@ -272,6 +284,24 @@ export declare interface RestCollection<T extends Resource = Resource> {
|
|
272
284
|
* @param params TODO
|
273
285
|
*/
|
274
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>;
|
275
305
|
/**
|
276
306
|
* Record which resources have failed validation.
|
277
307
|
*
|
@@ -367,7 +397,7 @@ export declare interface RestCollectionStoreOptionsInput {
|
|
367
397
|
pageSize?: number | null;
|
368
398
|
};
|
369
399
|
order?: [any, string][];
|
370
|
-
|
400
|
+
propertiesToExclude?: string[] | ((resourceType: ResourceType) => string[]);
|
371
401
|
referencePathsToExpand?: string[] | ((resourceType: ResourceType) => string[]);
|
372
402
|
restCollectionUrl?: string | null;
|
373
403
|
}
|
@@ -459,6 +489,7 @@ export declare interface RestResourceClient<T extends Resource = Resource> {
|
|
459
489
|
refreshResource: () => Promise<T | null | undefined>;
|
460
490
|
deleteResource: () => Promise<void>;
|
461
491
|
saveResource: (resource: T) => Promise<T | null | undefined>;
|
492
|
+
updateResource: (partialResource: T) => Promise<T | null | undefined>;
|
462
493
|
makeCustomApiRequest: (params: MakeCustomApiRequestParams) => Promise<any>;
|
463
494
|
}
|
464
495
|
|