rest-client-vue 1.1.1-b7 → 1.2.0-b1

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 CHANGED
@@ -31,7 +31,7 @@ export declare interface ConcreteRestCollectionStoreOptionsInput {
31
31
  pageSize?: number | null;
32
32
  };
33
33
  order?: [any, string][];
34
- propertyBlacklist?: string[];
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. */
@@ -127,6 +129,18 @@ export declare interface RestCollection<T extends Resource = Resource> {
127
129
  * To allow for asynchronous loading of resource types, this may be undefined.
128
130
  */
129
131
  resourceType: Ref<ResourceType | undefined>;
132
+ /**
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.
142
+ */
143
+ restCollectionUrl: Ref<string | null>;
130
144
  /** A status indicating whether resources have been loaded yet from the REST API. */
131
145
  status: Ref<RestCollectionStatus>;
132
146
  batchSaveAttempted: Ref<boolean>;
@@ -272,6 +286,15 @@ export declare interface RestCollection<T extends Resource = Resource> {
272
286
  * @param params TODO
273
287
  */
274
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>;
275
298
  /**
276
299
  * Record which resources have failed validation.
277
300
  *
@@ -367,7 +390,7 @@ export declare interface RestCollectionStoreOptionsInput {
367
390
  pageSize?: number | null;
368
391
  };
369
392
  order?: [any, string][];
370
- propertyBlacklist?: string[] | ((resourceType: ResourceType) => string[]);
393
+ propertiesToExclude?: string[] | ((resourceType: ResourceType) => string[]);
371
394
  referencePathsToExpand?: string[] | ((resourceType: ResourceType) => string[]);
372
395
  restCollectionUrl?: string | null;
373
396
  }
@@ -459,6 +482,7 @@ export declare interface RestResourceClient<T extends Resource = Resource> {
459
482
  refreshResource: () => Promise<T | null | undefined>;
460
483
  deleteResource: () => Promise<void>;
461
484
  saveResource: (resource: T) => Promise<T | null | undefined>;
485
+ updateResource: (resourcePropertyUpdates: T[]) => Promise<T | null | undefined>;
462
486
  makeCustomApiRequest: (params: MakeCustomApiRequestParams) => Promise<any>;
463
487
  }
464
488