@sanity/client 6.17.3 → 6.18.0-canary.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.
@@ -159,14 +159,14 @@ const VALID_ASSET_TYPES = ["image", "file"], VALID_INSERT_LOCATIONS = ["before",
159
159
  );
160
160
  return tag;
161
161
  };
162
- 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) => {
162
+ 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$7 = (obj, member, msg) => {
163
163
  if (!member.has(obj))
164
164
  throw TypeError("Cannot " + msg);
165
- }, __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) => {
165
+ }, __privateGet$7 = (obj, member, getter) => (__accessCheck$7(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj)), __privateAdd$7 = (obj, member, value) => {
166
166
  if (member.has(obj))
167
167
  throw TypeError("Cannot add the same private member more than once");
168
168
  member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
169
- }, __privateSet$6 = (obj, member, value, setter) => (__accessCheck$6(obj, member, "write to private field"), member.set(obj, value), value);
169
+ }, __privateSet$7 = (obj, member, value, setter) => (__accessCheck$7(obj, member, "write to private field"), member.set(obj, value), value);
170
170
  class BasePatch {
171
171
  constructor(selection, operations = {}) {
172
172
  __publicField$2(this, "selection"), __publicField$2(this, "operations"), this.selection = selection, this.operations = operations;
@@ -300,58 +300,58 @@ class BasePatch {
300
300
  return this._assign(op, props, !1);
301
301
  }
302
302
  }
303
- var _client$5;
303
+ var _client$6;
304
304
  const _ObservablePatch = class _ObservablePatch2 extends BasePatch {
305
305
  constructor(selection, operations, client) {
306
- super(selection, operations), __privateAdd$6(this, _client$5, void 0), __privateSet$6(this, _client$5, client);
306
+ super(selection, operations), __privateAdd$7(this, _client$6, void 0), __privateSet$7(this, _client$6, client);
307
307
  }
308
308
  /**
309
309
  * Clones the patch
310
310
  */
311
311
  clone() {
312
- return new _ObservablePatch2(this.selection, { ...this.operations }, __privateGet$6(this, _client$5));
312
+ return new _ObservablePatch2(this.selection, { ...this.operations }, __privateGet$7(this, _client$6));
313
313
  }
314
314
  commit(options) {
315
- if (!__privateGet$6(this, _client$5))
315
+ if (!__privateGet$7(this, _client$6))
316
316
  throw new Error(
317
317
  "No `client` passed to patch, either provide one or pass the patch to a clients `mutate()` method"
318
318
  );
319
319
  const returnFirst = typeof this.selection == "string", opts = Object.assign({ returnFirst, returnDocuments: !0 }, options);
320
- return __privateGet$6(this, _client$5).mutate({ patch: this.serialize() }, opts);
320
+ return __privateGet$7(this, _client$6).mutate({ patch: this.serialize() }, opts);
321
321
  }
322
322
  };
323
- _client$5 = /* @__PURE__ */ new WeakMap();
323
+ _client$6 = /* @__PURE__ */ new WeakMap();
324
324
  let ObservablePatch = _ObservablePatch;
325
325
  var _client2$5;
326
326
  const _Patch = class _Patch2 extends BasePatch {
327
327
  constructor(selection, operations, client) {
328
- super(selection, operations), __privateAdd$6(this, _client2$5, void 0), __privateSet$6(this, _client2$5, client);
328
+ super(selection, operations), __privateAdd$7(this, _client2$5, void 0), __privateSet$7(this, _client2$5, client);
329
329
  }
330
330
  /**
331
331
  * Clones the patch
332
332
  */
333
333
  clone() {
334
- return new _Patch2(this.selection, { ...this.operations }, __privateGet$6(this, _client2$5));
334
+ return new _Patch2(this.selection, { ...this.operations }, __privateGet$7(this, _client2$5));
335
335
  }
336
336
  commit(options) {
337
- if (!__privateGet$6(this, _client2$5))
337
+ if (!__privateGet$7(this, _client2$5))
338
338
  throw new Error(
339
339
  "No `client` passed to patch, either provide one or pass the patch to a clients `mutate()` method"
340
340
  );
341
341
  const returnFirst = typeof this.selection == "string", opts = Object.assign({ returnFirst, returnDocuments: !0 }, options);
342
- return __privateGet$6(this, _client2$5).mutate({ patch: this.serialize() }, opts);
342
+ return __privateGet$7(this, _client2$5).mutate({ patch: this.serialize() }, opts);
343
343
  }
344
344
  };
345
345
  _client2$5 = /* @__PURE__ */ new WeakMap();
346
346
  let Patch = _Patch;
347
- 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) => {
347
+ 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$6 = (obj, member, msg) => {
348
348
  if (!member.has(obj))
349
349
  throw TypeError("Cannot " + msg);
350
- }, __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) => {
350
+ }, __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) => {
351
351
  if (member.has(obj))
352
352
  throw TypeError("Cannot add the same private member more than once");
353
353
  member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
354
- }, __privateSet$5 = (obj, member, value, setter) => (__accessCheck$5(obj, member, "write to private field"), member.set(obj, value), value);
354
+ }, __privateSet$6 = (obj, member, value, setter) => (__accessCheck$6(obj, member, "write to private field"), member.set(obj, value), value);
355
355
  const defaultMutateOptions = { returnDocuments: !1 };
356
356
  class BaseTransaction {
357
357
  constructor(operations = [], transactionId) {
@@ -420,23 +420,23 @@ class BaseTransaction {
420
420
  return this.operations.push(mut), this;
421
421
  }
422
422
  }
423
- var _client$4;
423
+ var _client$5;
424
424
  const _Transaction = class _Transaction2 extends BaseTransaction {
425
425
  constructor(operations, client, transactionId) {
426
- super(operations, transactionId), __privateAdd$5(this, _client$4, void 0), __privateSet$5(this, _client$4, client);
426
+ super(operations, transactionId), __privateAdd$6(this, _client$5, void 0), __privateSet$6(this, _client$5, client);
427
427
  }
428
428
  /**
429
429
  * Clones the transaction
430
430
  */
431
431
  clone() {
432
- return new _Transaction2([...this.operations], __privateGet$5(this, _client$4), this.trxId);
432
+ return new _Transaction2([...this.operations], __privateGet$6(this, _client$5), this.trxId);
433
433
  }
434
434
  commit(options) {
435
- if (!__privateGet$5(this, _client$4))
435
+ if (!__privateGet$6(this, _client$5))
436
436
  throw new Error(
437
437
  "No `client` passed to transaction, either provide one or pass the transaction to a clients `mutate()` method"
438
438
  );
439
- return __privateGet$5(this, _client$4).mutate(
439
+ return __privateGet$6(this, _client$5).mutate(
440
440
  this.serialize(),
441
441
  Object.assign({ transactionId: this.trxId }, defaultMutateOptions, options || {})
442
442
  );
@@ -446,7 +446,7 @@ const _Transaction = class _Transaction2 extends BaseTransaction {
446
446
  if (typeof patchOrDocumentId != "string" && patchOrDocumentId instanceof Patch)
447
447
  return this._add({ patch: patchOrDocumentId.serialize() });
448
448
  if (isBuilder) {
449
- const patch = patchOps(new Patch(patchOrDocumentId, {}, __privateGet$5(this, _client$4)));
449
+ const patch = patchOps(new Patch(patchOrDocumentId, {}, __privateGet$6(this, _client$5)));
450
450
  if (!(patch instanceof Patch))
451
451
  throw new Error("function passed to `patch()` must return the patch");
452
452
  return this._add({ patch: patch.serialize() });
@@ -454,25 +454,25 @@ const _Transaction = class _Transaction2 extends BaseTransaction {
454
454
  return this._add({ patch: { id: patchOrDocumentId, ...patchOps } });
455
455
  }
456
456
  };
457
- _client$4 = /* @__PURE__ */ new WeakMap();
457
+ _client$5 = /* @__PURE__ */ new WeakMap();
458
458
  let Transaction = _Transaction;
459
459
  var _client2$4;
460
460
  const _ObservableTransaction = class _ObservableTransaction2 extends BaseTransaction {
461
461
  constructor(operations, client, transactionId) {
462
- super(operations, transactionId), __privateAdd$5(this, _client2$4, void 0), __privateSet$5(this, _client2$4, client);
462
+ super(operations, transactionId), __privateAdd$6(this, _client2$4, void 0), __privateSet$6(this, _client2$4, client);
463
463
  }
464
464
  /**
465
465
  * Clones the transaction
466
466
  */
467
467
  clone() {
468
- return new _ObservableTransaction2([...this.operations], __privateGet$5(this, _client2$4), this.trxId);
468
+ return new _ObservableTransaction2([...this.operations], __privateGet$6(this, _client2$4), this.trxId);
469
469
  }
470
470
  commit(options) {
471
- if (!__privateGet$5(this, _client2$4))
471
+ if (!__privateGet$6(this, _client2$4))
472
472
  throw new Error(
473
473
  "No `client` passed to transaction, either provide one or pass the transaction to a clients `mutate()` method"
474
474
  );
475
- return __privateGet$5(this, _client2$4).mutate(
475
+ return __privateGet$6(this, _client2$4).mutate(
476
476
  this.serialize(),
477
477
  Object.assign({ transactionId: this.trxId }, defaultMutateOptions, options || {})
478
478
  );
@@ -482,7 +482,7 @@ const _ObservableTransaction = class _ObservableTransaction2 extends BaseTransac
482
482
  if (typeof patchOrDocumentId != "string" && patchOrDocumentId instanceof ObservablePatch)
483
483
  return this._add({ patch: patchOrDocumentId.serialize() });
484
484
  if (isBuilder) {
485
- const patch = patchOps(new ObservablePatch(patchOrDocumentId, {}, __privateGet$5(this, _client2$4)));
485
+ const patch = patchOps(new ObservablePatch(patchOrDocumentId, {}, __privateGet$6(this, _client2$4)));
486
486
  if (!(patch instanceof ObservablePatch))
487
487
  throw new Error("function passed to `patch()` must return the patch");
488
488
  return this._add({ patch: patch.serialize() });
@@ -692,7 +692,7 @@ function _mutate(client, httpRequest, mutations, options) {
692
692
  return _dataRequest(client, httpRequest, "mutate", { mutations: muts, transactionId }, options);
693
693
  }
694
694
  function _dataRequest(client, httpRequest, endpoint, body, options = {}) {
695
- const isMutation = endpoint === "mutate", isQuery = endpoint === "query", strQuery = isMutation ? "" : encodeQueryString(body), useGet = !isMutation && strQuery.length < getQuerySizeLimit, stringQuery = useGet ? strQuery : "", returnFirst = options.returnFirst, { timeout, token, tag, headers, returnQuery } = options, uri = _getDataUrl(client, endpoint, stringQuery), reqOptions = {
695
+ const isMutation = endpoint === "mutate", isQuery = endpoint === "query", strQuery = isMutation ? "" : encodeQueryString(body), useGet = !isMutation && strQuery.length < getQuerySizeLimit, stringQuery = useGet ? strQuery : "", returnFirst = options.returnFirst, { timeout, token, tag, headers, returnQuery, lastLiveEventId } = options, uri = _getDataUrl(client, endpoint, stringQuery), reqOptions = {
696
696
  method: useGet ? "GET" : "POST",
697
697
  uri,
698
698
  json: !0,
@@ -705,6 +705,7 @@ function _dataRequest(client, httpRequest, endpoint, body, options = {}) {
705
705
  returnQuery,
706
706
  perspective: options.perspective,
707
707
  resultSourceMap: options.resultSourceMap,
708
+ lastLiveEventId: Array.isArray(lastLiveEventId) ? lastLiveEventId[0] : lastLiveEventId,
708
709
  canUseCdn: isQuery,
709
710
  signal: options.signal,
710
711
  fetch: options.fetch,
@@ -742,7 +743,7 @@ function _requestObservable(client, httpRequest, options) {
742
743
  const resultSourceMap = (_b = options.resultSourceMap) != null ? _b : config.resultSourceMap;
743
744
  resultSourceMap !== void 0 && resultSourceMap !== !1 && (options.query = { resultSourceMap, ...options.query });
744
745
  const perspective = options.perspective || config.perspective;
745
- typeof perspective == "string" && perspective !== "raw" && (validateApiPerspective(perspective), options.query = { perspective, ...options.query }, perspective === "previewDrafts" && useCdn && (useCdn = !1, printCdnPreviewDraftsWarning())), options.returnQuery === !1 && (options.query = { returnQuery: "false", ...options.query });
746
+ typeof perspective == "string" && perspective !== "raw" && (validateApiPerspective(perspective), options.query = { perspective, ...options.query }, perspective === "previewDrafts" && useCdn && (useCdn = !1, printCdnPreviewDraftsWarning())), options.lastLiveEventId && (options.query = { ...options.query, lastLiveEventId: options.lastLiveEventId }), options.returnQuery === !1 && (options.query = { returnQuery: "false", ...options.query });
746
747
  }
747
748
  const reqOptions = requestOptions(
748
749
  config,
@@ -789,30 +790,30 @@ function _createAbortError(signal) {
789
790
  const error = new Error((_b = signal == null ? void 0 : signal.reason) != null ? _b : "The operation was aborted.");
790
791
  return error.name = "AbortError", error;
791
792
  }
792
- var __accessCheck$4 = (obj, member, msg) => {
793
+ var __accessCheck$5 = (obj, member, msg) => {
793
794
  if (!member.has(obj))
794
795
  throw TypeError("Cannot " + msg);
795
- }, __privateGet$4 = (obj, member, getter) => (__accessCheck$4(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj)), __privateAdd$4 = (obj, member, value) => {
796
+ }, __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) => {
796
797
  if (member.has(obj))
797
798
  throw TypeError("Cannot add the same private member more than once");
798
799
  member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
799
- }, __privateSet$4 = (obj, member, value, setter) => (__accessCheck$4(obj, member, "write to private field"), member.set(obj, value), value), _client$3, _httpRequest$4;
800
+ }, __privateSet$5 = (obj, member, value, setter) => (__accessCheck$5(obj, member, "write to private field"), member.set(obj, value), value), _client$4, _httpRequest$4;
800
801
  class ObservableAssetsClient {
801
802
  constructor(client, httpRequest) {
802
- __privateAdd$4(this, _client$3, void 0), __privateAdd$4(this, _httpRequest$4, void 0), __privateSet$4(this, _client$3, client), __privateSet$4(this, _httpRequest$4, httpRequest);
803
+ __privateAdd$5(this, _client$4, void 0), __privateAdd$5(this, _httpRequest$4, void 0), __privateSet$5(this, _client$4, client), __privateSet$5(this, _httpRequest$4, httpRequest);
803
804
  }
804
805
  upload(assetType, body, options) {
805
- return _upload(__privateGet$4(this, _client$3), __privateGet$4(this, _httpRequest$4), assetType, body, options);
806
+ return _upload(__privateGet$5(this, _client$4), __privateGet$5(this, _httpRequest$4), assetType, body, options);
806
807
  }
807
808
  }
808
- _client$3 = /* @__PURE__ */ new WeakMap(), _httpRequest$4 = /* @__PURE__ */ new WeakMap();
809
+ _client$4 = /* @__PURE__ */ new WeakMap(), _httpRequest$4 = /* @__PURE__ */ new WeakMap();
809
810
  var _client2$3, _httpRequest2$4;
810
811
  class AssetsClient {
811
812
  constructor(client, httpRequest) {
812
- __privateAdd$4(this, _client2$3, void 0), __privateAdd$4(this, _httpRequest2$4, void 0), __privateSet$4(this, _client2$3, client), __privateSet$4(this, _httpRequest2$4, httpRequest);
813
+ __privateAdd$5(this, _client2$3, void 0), __privateAdd$5(this, _httpRequest2$4, void 0), __privateSet$5(this, _client2$3, client), __privateSet$5(this, _httpRequest2$4, httpRequest);
813
814
  }
814
815
  upload(assetType, body, options) {
815
- const observable = _upload(__privateGet$4(this, _client2$3), __privateGet$4(this, _httpRequest2$4), assetType, body, options);
816
+ const observable = _upload(__privateGet$5(this, _client2$3), __privateGet$5(this, _httpRequest2$4), assetType, body, options);
816
817
  return rxjs.lastValueFrom(
817
818
  observable.pipe(
818
819
  operators.filter((event) => event.type === "response"),
@@ -882,7 +883,7 @@ function _listen(query, params, opts = {}) {
882
883
  observer.error(cooerceError(err));
883
884
  }
884
885
  function onMessage(evt) {
885
- const event = parseEvent(evt);
886
+ const event = parseEvent$1(evt);
886
887
  return event instanceof Error ? observer.error(event) : observer.next(event);
887
888
  }
888
889
  function onDisconnect() {
@@ -895,15 +896,15 @@ function _listen(query, params, opts = {}) {
895
896
  shouldEmitReconnect && observer.next({ type: "reconnect" });
896
897
  }
897
898
  async function getEventSource() {
898
- const { default: EventSource } = await import("@sanity/eventsource");
899
+ const { default: EventSource2 } = await import("@sanity/eventsource");
899
900
  if (unsubscribed)
900
901
  return;
901
- const evs = new EventSource(uri, esOptions);
902
+ const evs = new EventSource2(uri, esOptions);
902
903
  return evs.addEventListener("error", onError), evs.addEventListener("channelError", onChannelError), evs.addEventListener("disconnect", onDisconnect), listenFor.forEach((type) => evs.addEventListener(type, onMessage)), evs;
903
904
  }
904
905
  function open() {
905
906
  getEventSource().then((eventSource) => {
906
- eventSource && (es = eventSource);
907
+ eventSource && (es = eventSource, unsubscribed && unsubscribe());
907
908
  }).catch((reason) => {
908
909
  observer.error(reason), stop();
909
910
  });
@@ -914,7 +915,7 @@ function _listen(query, params, opts = {}) {
914
915
  return stop;
915
916
  });
916
917
  }
917
- function parseEvent(event) {
918
+ function parseEvent$1(event) {
918
919
  try {
919
920
  const data = event.data && JSON.parse(event.data) || {};
920
921
  return Object.assign({ type: event.type }, data);
@@ -925,12 +926,86 @@ function parseEvent(event) {
925
926
  function cooerceError(err) {
926
927
  if (err instanceof Error)
927
928
  return err;
928
- const evt = parseEvent(err);
929
+ const evt = parseEvent$1(err);
929
930
  return evt instanceof Error ? evt : new Error(extractErrorMessage(evt));
930
931
  }
931
932
  function extractErrorMessage(err) {
932
933
  return err.error ? err.error.description ? err.error.description : typeof err.error == "string" ? err.error : JSON.stringify(err.error, null, 2) : err.message || "Unknown listener error";
933
934
  }
935
+ var __accessCheck$4 = (obj, member, msg) => {
936
+ if (!member.has(obj))
937
+ throw TypeError("Cannot " + msg);
938
+ }, __privateGet$4 = (obj, member, getter) => (__accessCheck$4(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj)), __privateAdd$4 = (obj, member, value) => {
939
+ if (member.has(obj))
940
+ throw TypeError("Cannot add the same private member more than once");
941
+ member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
942
+ }, __privateSet$4 = (obj, member, value, setter) => (__accessCheck$4(obj, member, "write to private field"), member.set(obj, value), value), _client$3;
943
+ class LiveClient {
944
+ constructor(client) {
945
+ __privateAdd$4(this, _client$3, void 0), __privateSet$4(this, _client$3, client);
946
+ }
947
+ events() {
948
+ const path = _getDataUrl(__privateGet$4(this, _client$3), "live/events"), url = new URL(__privateGet$4(this, _client$3).getUrl(path, !1)), listenFor = ["restart", "message"];
949
+ return new rxjs.Observable((observer) => {
950
+ let es, reconnectTimer, stopped = !1, unsubscribed = !1;
951
+ open();
952
+ function onError(evt) {
953
+ if (!stopped) {
954
+ if ("data" in evt)
955
+ try {
956
+ const event = parseEvent(evt);
957
+ observer.error(new Error(event.message, { cause: event }));
958
+ } catch (err) {
959
+ observer.error(err);
960
+ }
961
+ es.readyState === es.CLOSED && (unsubscribe(), clearTimeout(reconnectTimer), reconnectTimer = setTimeout(open, 100));
962
+ }
963
+ }
964
+ function onMessage(evt) {
965
+ const event = parseEvent(evt);
966
+ return event instanceof Error ? observer.error(event) : observer.next(event);
967
+ }
968
+ function unsubscribe() {
969
+ if (es) {
970
+ es.removeEventListener("error", onError);
971
+ for (const type of listenFor)
972
+ es.removeEventListener(type, onMessage);
973
+ es.close();
974
+ }
975
+ }
976
+ async function getEventSource() {
977
+ const EventSourceImplementation = typeof EventSource > "u" ? (await import("@sanity/eventsource")).default : EventSource;
978
+ if (unsubscribed)
979
+ return;
980
+ const evs = new EventSourceImplementation(url.toString());
981
+ evs.addEventListener("error", onError);
982
+ for (const type of listenFor)
983
+ evs.addEventListener(type, onMessage);
984
+ return evs;
985
+ }
986
+ function open() {
987
+ getEventSource().then((eventSource) => {
988
+ eventSource && (es = eventSource, unsubscribed && unsubscribe());
989
+ }).catch((reason) => {
990
+ observer.error(reason), stop();
991
+ });
992
+ }
993
+ function stop() {
994
+ stopped = !0, unsubscribe(), unsubscribed = !0;
995
+ }
996
+ return stop;
997
+ });
998
+ }
999
+ }
1000
+ _client$3 = /* @__PURE__ */ new WeakMap();
1001
+ function parseEvent(event) {
1002
+ try {
1003
+ const data = event.data && JSON.parse(event.data) || {};
1004
+ return { type: event.type, id: event.lastEventId, ...data };
1005
+ } catch (err) {
1006
+ return err;
1007
+ }
1008
+ }
934
1009
  var __accessCheck$3 = (obj, member, msg) => {
935
1010
  if (!member.has(obj))
936
1011
  throw TypeError("Cannot " + msg);
@@ -1135,7 +1210,7 @@ var __defProp2 = Object.defineProperty, __defNormalProp = (obj, key, value) => k
1135
1210
  }, __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), member.set(obj, value), value), _clientConfig, _httpRequest;
1136
1211
  const _ObservableSanityClient = class _ObservableSanityClient2 {
1137
1212
  constructor(httpRequest, config = defaultConfig) {
1138
- __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));
1213
+ __publicField(this, "assets"), __publicField(this, "datasets"), __publicField(this, "live"), __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.live = new LiveClient(this), this.projects = new ObservableProjectsClient(this, __privateGet(this, _httpRequest)), this.users = new ObservableUsersClient(this, __privateGet(this, _httpRequest));
1139
1214
  }
1140
1215
  /**
1141
1216
  * Clone the client - returns a new instance
@@ -1264,7 +1339,7 @@ let ObservableSanityClient = _ObservableSanityClient;
1264
1339
  var _clientConfig2, _httpRequest2;
1265
1340
  const _SanityClient = class _SanityClient2 {
1266
1341
  constructor(httpRequest, config = defaultConfig) {
1267
- __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);
1342
+ __publicField(this, "assets"), __publicField(this, "datasets"), __publicField(this, "live"), __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.live = new LiveClient(this), this.projects = new ProjectsClient(this, __privateGet(this, _httpRequest2)), this.users = new UsersClient(this, __privateGet(this, _httpRequest2)), this.observable = new ObservableSanityClient(httpRequest, config);
1268
1343
  }
1269
1344
  /**
1270
1345
  * Clone the client - returns a new instance