@objectstack/client 4.1.1 → 4.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.mjs CHANGED
@@ -2623,11 +2623,14 @@ var ObjectStackClient = class {
2623
2623
  });
2624
2624
  return this.unwrapResponse(res);
2625
2625
  },
2626
- update: async (object, id, data) => {
2626
+ update: async (object, id, data, opts) => {
2627
2627
  const route = this.getRoute("data");
2628
+ const headers = {};
2629
+ if (opts?.ifMatch) headers["If-Match"] = String(opts.ifMatch);
2628
2630
  const res = await this.fetch(`${this.baseUrl}${route}/${object}/${id}`, {
2629
2631
  method: "PATCH",
2630
- body: JSON.stringify(data)
2632
+ body: JSON.stringify(data),
2633
+ ...Object.keys(headers).length ? { headers } : {}
2631
2634
  });
2632
2635
  return this.unwrapResponse(res);
2633
2636
  },
@@ -2659,10 +2662,13 @@ var ObjectStackClient = class {
2659
2662
  });
2660
2663
  return this.unwrapResponse(res);
2661
2664
  },
2662
- delete: async (object, id) => {
2665
+ delete: async (object, id, opts) => {
2663
2666
  const route = this.getRoute("data");
2667
+ const headers = {};
2668
+ if (opts?.ifMatch) headers["If-Match"] = String(opts.ifMatch);
2664
2669
  const res = await this.fetch(`${this.baseUrl}${route}/${object}/${id}`, {
2665
- method: "DELETE"
2670
+ method: "DELETE",
2671
+ ...Object.keys(headers).length ? { headers } : {}
2666
2672
  });
2667
2673
  return this.unwrapResponse(res);
2668
2674
  },