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 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
  }
@@ -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, 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.
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 | undefined>;
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
- propertyBlacklist?: string[] | ((resourceType: ResourceType) => string[]);
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