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 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. */
@@ -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, either as specified in {@link RestCollectionOptions.options} or calculated from the entity
132
- * type and draft batch ID.
133
- *
134
- * Two special cases arise:
135
- * - restCollectionUrl is undefined when the REST collection is configured to use an existing store. (This may be
136
- * addressed in future work.)
137
- * - restCollectionUrl is null when the URL could not be calculated because the entity type was missing or lacked a
138
- * REST collection name. In this case the collection will not be functional.
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 | undefined>;
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
- propertyBlacklist?: string[] | ((resourceType: ResourceType) => string[]);
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