@sanity/client 6.15.14 → 6.15.15

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.
@@ -18,17 +18,17 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
18
18
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target,
19
19
  mod
20
20
  ));
21
- var getIt = require("get-it"), middleware = require("get-it/middleware"), rxjs = require("rxjs"), operators = require("rxjs/operators");
21
+ var getIt = require("get-it"), middleware = require("get-it/middleware"), rxjs = require("rxjs"), operators = require("rxjs/operators"), __defProp$3 = Object.defineProperty, __defNormalProp$3 = (obj, key, value) => key in obj ? __defProp$3(obj, key, { enumerable: !0, configurable: !0, writable: !0, value }) : obj[key] = value, __publicField$3 = (obj, key, value) => (__defNormalProp$3(obj, typeof key != "symbol" ? key + "" : key, value), value);
22
22
  class ClientError extends Error {
23
23
  constructor(res) {
24
24
  const props = extractErrorProps(res);
25
- super(props.message), this.statusCode = 400, Object.assign(this, props);
25
+ super(props.message), __publicField$3(this, "response"), __publicField$3(this, "statusCode", 400), __publicField$3(this, "responseBody"), __publicField$3(this, "details"), Object.assign(this, props);
26
26
  }
27
27
  }
28
28
  class ServerError extends Error {
29
29
  constructor(res) {
30
30
  const props = extractErrorProps(res);
31
- super(props.message), this.statusCode = 500, Object.assign(this, props);
31
+ super(props.message), __publicField$3(this, "response"), __publicField$3(this, "statusCode", 500), __publicField$3(this, "responseBody"), __publicField$3(this, "details"), Object.assign(this, props);
32
32
  }
33
33
  }
34
34
  function extractErrorProps(res) {
@@ -169,7 +169,7 @@ const VALID_ASSET_TYPES = ["image", "file"], VALID_INSERT_LOCATIONS = ["before",
169
169
  );
170
170
  return tag;
171
171
  };
172
- var __accessCheck$6 = (obj, member, msg) => {
172
+ var __defProp$2 = Object.defineProperty, __defNormalProp$2 = (obj, key, value) => key in obj ? __defProp$2(obj, key, { enumerable: !0, configurable: !0, writable: !0, value }) : obj[key] = value, __publicField$2 = (obj, key, value) => (__defNormalProp$2(obj, typeof key != "symbol" ? key + "" : key, value), value), __accessCheck$6 = (obj, member, msg) => {
173
173
  if (!member.has(obj))
174
174
  throw TypeError("Cannot " + msg);
175
175
  }, __privateGet$6 = (obj, member, getter) => (__accessCheck$6(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj)), __privateAdd$6 = (obj, member, value) => {
@@ -179,7 +179,7 @@ var __accessCheck$6 = (obj, member, msg) => {
179
179
  }, __privateSet$6 = (obj, member, value, setter) => (__accessCheck$6(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
180
180
  class BasePatch {
181
181
  constructor(selection, operations = {}) {
182
- this.selection = selection, this.operations = operations;
182
+ __publicField$2(this, "selection"), __publicField$2(this, "operations"), this.selection = selection, this.operations = operations;
183
183
  }
184
184
  /**
185
185
  * Sets the given attributes to the document. Does NOT merge objects.
@@ -354,7 +354,7 @@ const _Patch = class _Patch2 extends BasePatch {
354
354
  };
355
355
  _client2$5 = /* @__PURE__ */ new WeakMap();
356
356
  let Patch = _Patch;
357
- var __accessCheck$5 = (obj, member, msg) => {
357
+ var __defProp$1 = Object.defineProperty, __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$1(obj, key, { enumerable: !0, configurable: !0, writable: !0, value }) : obj[key] = value, __publicField$1 = (obj, key, value) => (__defNormalProp$1(obj, typeof key != "symbol" ? key + "" : key, value), value), __accessCheck$5 = (obj, member, msg) => {
358
358
  if (!member.has(obj))
359
359
  throw TypeError("Cannot " + msg);
360
360
  }, __privateGet$5 = (obj, member, getter) => (__accessCheck$5(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj)), __privateAdd$5 = (obj, member, value) => {
@@ -365,7 +365,7 @@ var __accessCheck$5 = (obj, member, msg) => {
365
365
  const defaultMutateOptions = { returnDocuments: !1 };
366
366
  class BaseTransaction {
367
367
  constructor(operations = [], transactionId) {
368
- this.operations = operations, this.trxId = transactionId;
368
+ __publicField$1(this, "operations"), __publicField$1(this, "trxId"), this.operations = operations, this.trxId = transactionId;
369
369
  }
370
370
  /**
371
371
  * Creates a new Sanity document. If `_id` is provided and already exists, the mutation will fail. If no `_id` is given, one will automatically be generated by the database.
@@ -1177,7 +1177,7 @@ class UsersClient {
1177
1177
  }
1178
1178
  }
1179
1179
  _client2 = /* @__PURE__ */ new WeakMap(), _httpRequest2$1 = /* @__PURE__ */ new WeakMap();
1180
- var __accessCheck = (obj, member, msg) => {
1180
+ var __defProp2 = Object.defineProperty, __defNormalProp = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: !0, configurable: !0, writable: !0, value }) : obj[key] = value, __publicField = (obj, key, value) => (__defNormalProp(obj, typeof key != "symbol" ? key + "" : key, value), value), __accessCheck = (obj, member, msg) => {
1181
1181
  if (!member.has(obj))
1182
1182
  throw TypeError("Cannot " + msg);
1183
1183
  }, __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj)), __privateAdd = (obj, member, value) => {
@@ -1187,7 +1187,7 @@ var __accessCheck = (obj, member, msg) => {
1187
1187
  }, __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value), _clientConfig, _httpRequest;
1188
1188
  const _ObservableSanityClient = class _ObservableSanityClient2 {
1189
1189
  constructor(httpRequest, config = defaultConfig) {
1190
- __privateAdd(this, _clientConfig, void 0), __privateAdd(this, _httpRequest, void 0), this.listen = _listen, this.config(config), __privateSet(this, _httpRequest, httpRequest), this.assets = new ObservableAssetsClient(this, __privateGet(this, _httpRequest)), this.datasets = new ObservableDatasetsClient(this, __privateGet(this, _httpRequest)), this.projects = new ObservableProjectsClient(this, __privateGet(this, _httpRequest)), this.users = new ObservableUsersClient(this, __privateGet(this, _httpRequest));
1190
+ __publicField(this, "assets"), __publicField(this, "datasets"), __publicField(this, "projects"), __publicField(this, "users"), __privateAdd(this, _clientConfig, void 0), __privateAdd(this, _httpRequest, void 0), __publicField(this, "listen", _listen), this.config(config), __privateSet(this, _httpRequest, httpRequest), this.assets = new ObservableAssetsClient(this, __privateGet(this, _httpRequest)), this.datasets = new ObservableDatasetsClient(this, __privateGet(this, _httpRequest)), this.projects = new ObservableProjectsClient(this, __privateGet(this, _httpRequest)), this.users = new ObservableUsersClient(this, __privateGet(this, _httpRequest));
1191
1191
  }
1192
1192
  /**
1193
1193
  * Clone the client - returns a new instance
@@ -1316,7 +1316,7 @@ let ObservableSanityClient = _ObservableSanityClient;
1316
1316
  var _clientConfig2, _httpRequest2;
1317
1317
  const _SanityClient = class _SanityClient2 {
1318
1318
  constructor(httpRequest, config = defaultConfig) {
1319
- __privateAdd(this, _clientConfig2, void 0), __privateAdd(this, _httpRequest2, void 0), this.listen = _listen, this.config(config), __privateSet(this, _httpRequest2, httpRequest), this.assets = new AssetsClient(this, __privateGet(this, _httpRequest2)), this.datasets = new DatasetsClient(this, __privateGet(this, _httpRequest2)), this.projects = new ProjectsClient(this, __privateGet(this, _httpRequest2)), this.users = new UsersClient(this, __privateGet(this, _httpRequest2)), this.observable = new ObservableSanityClient(httpRequest, config);
1319
+ __publicField(this, "assets"), __publicField(this, "datasets"), __publicField(this, "projects"), __publicField(this, "users"), __publicField(this, "observable"), __privateAdd(this, _clientConfig2, void 0), __privateAdd(this, _httpRequest2, void 0), __publicField(this, "listen", _listen), this.config(config), __privateSet(this, _httpRequest2, httpRequest), this.assets = new AssetsClient(this, __privateGet(this, _httpRequest2)), this.datasets = new DatasetsClient(this, __privateGet(this, _httpRequest2)), this.projects = new ProjectsClient(this, __privateGet(this, _httpRequest2)), this.users = new UsersClient(this, __privateGet(this, _httpRequest2)), this.observable = new ObservableSanityClient(httpRequest, config);
1320
1320
  }
1321
1321
  /**
1322
1322
  * Clone the client - returns a new instance