@sanity/sdk 2.9.0 → 2.10.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.
Files changed (50) hide show
  1. package/dist/_chunks-dts/utils.d.ts +105 -51
  2. package/dist/_chunks-es/createGroqSearchFilter.js +131 -54
  3. package/dist/_chunks-es/createGroqSearchFilter.js.map +1 -1
  4. package/dist/_chunks-es/version.js +1 -1
  5. package/dist/_exports/_internal.d.ts +1 -1
  6. package/dist/index.d.ts +2 -2
  7. package/dist/index.js +119 -73
  8. package/dist/index.js.map +1 -1
  9. package/package.json +8 -10
  10. package/src/_exports/index.ts +8 -0
  11. package/src/client/clientStore.test.ts +30 -30
  12. package/src/client/clientStore.ts +47 -47
  13. package/src/comlink/controller/actions/getOrCreateChannel.ts +2 -2
  14. package/src/comlink/node/actions/getOrCreateNode.ts +2 -2
  15. package/src/config/sanityConfig.ts +72 -12
  16. package/src/document/applyDocumentActions.test.ts +7 -7
  17. package/src/document/applyDocumentActions.ts +5 -5
  18. package/src/document/documentStore.test.ts +68 -62
  19. package/src/document/documentStore.ts +36 -36
  20. package/src/document/processActions.ts +2 -2
  21. package/src/document/reducers.ts +4 -4
  22. package/src/document/sharedListener.ts +7 -7
  23. package/src/presence/bifurTransport.test.ts +46 -6
  24. package/src/presence/bifurTransport.ts +13 -1
  25. package/src/presence/presenceStore.test.ts +96 -0
  26. package/src/presence/presenceStore.ts +96 -24
  27. package/src/preview/getPreviewState.ts +1 -1
  28. package/src/preview/previewProjectionUtils.test.ts +4 -4
  29. package/src/preview/previewProjectionUtils.ts +7 -7
  30. package/src/preview/resolvePreview.ts +5 -1
  31. package/src/projection/getProjectionState.ts +4 -4
  32. package/src/projection/projectionStore.test.ts +2 -2
  33. package/src/projection/resolveProjection.ts +2 -2
  34. package/src/projection/subscribeToStateAndFetchBatches.test.ts +1 -1
  35. package/src/projection/subscribeToStateAndFetchBatches.ts +12 -11
  36. package/src/query/queryStore.test.ts +12 -12
  37. package/src/query/queryStore.ts +10 -10
  38. package/src/query/reducers.ts +3 -3
  39. package/src/releases/getPerspectiveState.ts +5 -5
  40. package/src/releases/releasesStore.test.ts +6 -6
  41. package/src/releases/releasesStore.ts +9 -9
  42. package/src/store/createActionBinder.test.ts +31 -31
  43. package/src/store/createActionBinder.ts +43 -38
  44. package/src/store/createSanityInstance.ts +2 -3
  45. package/src/users/reducers.ts +3 -4
  46. package/src/utils/createFetcherStore.ts +6 -4
  47. package/src/utils/isImportError.test.ts +72 -0
  48. package/src/utils/isImportError.ts +34 -0
  49. package/src/utils/object.test.ts +95 -0
  50. package/src/utils/object.ts +142 -0
@@ -1,18 +1,26 @@
1
- import { pick, omit, isObject } from "lodash-es";
2
1
  import { createClient, CorsOriginError } from "@sanity/client";
3
- import { Observable, map, distinctUntilChanged, shareReplay, skip, defer, finalize, filter, exhaustMap, from, timer, switchMap, takeWhile, firstValueFrom, fromEvent, EMPTY, catchError, NEVER, first, race, startWith, pairwise, mergeMap, groupBy, of, combineLatest, tap, share } from "rxjs";
2
+ import { Observable, map, distinctUntilChanged, shareReplay, skip, defer, finalize, filter, exhaustMap, timer, switchMap, takeWhile, from, firstValueFrom, EMPTY, fromEvent, catchError, NEVER, first, race, startWith, pairwise, mergeMap, groupBy, of, combineLatest, tap, share } from "rxjs";
4
3
  import { createSelector } from "reselect";
5
4
  import { createImageUrlBuilder } from "@sanity/image-url";
6
5
  import { devtools } from "zustand/middleware";
7
6
  import { createStore } from "zustand/vanilla";
7
+ function isDatasetResource(resource) {
8
+ return "projectId" in resource && "dataset" in resource;
9
+ }
10
+ function isMediaLibraryResource(resource) {
11
+ return "mediaLibraryId" in resource;
12
+ }
13
+ function isCanvasResource(resource) {
14
+ return "canvasId" in resource;
15
+ }
8
16
  function isDatasetSource(source) {
9
- return "projectId" in source && "dataset" in source;
17
+ return isDatasetResource(source);
10
18
  }
11
19
  function isMediaLibrarySource(source) {
12
- return "mediaLibraryId" in source;
20
+ return isMediaLibraryResource(source);
13
21
  }
14
22
  function isCanvasSource(source) {
15
- return "canvasId" in source;
23
+ return isCanvasResource(source);
16
24
  }
17
25
  const isReleasePerspective = (perspective) => typeof perspective == "object" && perspective !== null && "releaseName" in perspective;
18
26
  function insecureRandomId() {
@@ -132,6 +140,73 @@ function createLogger(namespace, baseContext) {
132
140
  getInstanceContext: () => baseContext?.instanceContext
133
141
  };
134
142
  }
143
+ function isObject(value) {
144
+ return typeof value == "object" && value !== null;
145
+ }
146
+ const hasOwn = (value, key) => Object.prototype.hasOwnProperty.call(value, key), isPlainObject = (value) => {
147
+ if (!isObject(value)) return !1;
148
+ const prototype = Object.getPrototypeOf(value);
149
+ return prototype === Object.prototype || prototype === null;
150
+ };
151
+ function omitProperty(value, key) {
152
+ if (!value) return {};
153
+ const { [key]: _omitted, ...rest } = value;
154
+ return rest;
155
+ }
156
+ function pickProperties(value, keys) {
157
+ const result = {};
158
+ for (const key of keys)
159
+ hasOwn(value, key) && (result[key] = value[key]);
160
+ return result;
161
+ }
162
+ const areSetsEqual = (left, right) => {
163
+ if (left.size !== right.size) return !1;
164
+ const unmatched = [...right];
165
+ outer: for (const leftValue of left) {
166
+ for (let index = 0; index < unmatched.length; index++)
167
+ if (isDeepEqual(leftValue, unmatched[index])) {
168
+ unmatched.splice(index, 1);
169
+ continue outer;
170
+ }
171
+ return !1;
172
+ }
173
+ return unmatched.length === 0;
174
+ }, areMapsEqual = (left, right) => {
175
+ if (left.size !== right.size) return !1;
176
+ const unmatched = [...right.entries()];
177
+ outer: for (const [leftKey, leftValue] of left) {
178
+ for (let index = 0; index < unmatched.length; index++) {
179
+ const [rightKey, rightValue] = unmatched[index];
180
+ if (isDeepEqual(leftKey, rightKey) && isDeepEqual(leftValue, rightValue)) {
181
+ unmatched.splice(index, 1);
182
+ continue outer;
183
+ }
184
+ }
185
+ return !1;
186
+ }
187
+ return unmatched.length === 0;
188
+ };
189
+ function isDeepEqual(left, right) {
190
+ if (Object.is(left, right)) return !0;
191
+ if (!isObject(left) || !isObject(right)) return !1;
192
+ if (left instanceof Date && right instanceof Date)
193
+ return left.getTime() === right.getTime();
194
+ if (left instanceof RegExp && right instanceof RegExp)
195
+ return left.source === right.source && left.flags === right.flags;
196
+ if (left instanceof Set && right instanceof Set)
197
+ return areSetsEqual(left, right);
198
+ if (left instanceof Map && right instanceof Map)
199
+ return areMapsEqual(left, right);
200
+ if (Array.isArray(left) || Array.isArray(right))
201
+ return !Array.isArray(left) || !Array.isArray(right) || left.length !== right.length ? !1 : left.every((value, index) => isDeepEqual(value, right[index]));
202
+ if (!isPlainObject(left) || !isPlainObject(right)) return !1;
203
+ const leftKeys = Object.keys(left), rightKeys = Object.keys(right);
204
+ if (leftKeys.length !== rightKeys.length) return !1;
205
+ for (const key of leftKeys)
206
+ if (!hasOwn(right, key) || !isDeepEqual(left[key], right[key]))
207
+ return !1;
208
+ return !0;
209
+ }
135
210
  function getEnv(key) {
136
211
  if (typeof import.meta < "u" && import.meta.env)
137
212
  return import.meta.env[key];
@@ -186,36 +261,31 @@ function createActionBinder(keyFn) {
186
261
  };
187
262
  };
188
263
  }
189
- const bindActionByDataset = createActionBinder((instance, options) => {
190
- const projectId = options?.projectId ?? instance.config.projectId, dataset = options?.dataset ?? instance.config.dataset;
191
- if (!projectId || !dataset)
192
- throw new Error("This API requires a project ID and dataset configured.");
193
- return { name: `${projectId}.${dataset}`, projectId, dataset };
194
- }), createSourceKey = (instance, source) => {
195
- let name, sourceForKey;
196
- if (source) {
197
- if (sourceForKey = source, isDatasetSource(source))
198
- name = `${source.projectId}.${source.dataset}`;
199
- else if (isMediaLibrarySource(source))
200
- name = `media-library:${source.mediaLibraryId}`;
201
- else if (isCanvasSource(source))
202
- name = `canvas:${source.canvasId}`;
264
+ const createResourceKey = (instance, resource) => {
265
+ let name, resourceForKey;
266
+ if (resource) {
267
+ if (resourceForKey = resource, isDatasetResource(resource))
268
+ name = `${resource.projectId}.${resource.dataset}`;
269
+ else if (isMediaLibraryResource(resource))
270
+ name = `media-library:${resource.mediaLibraryId}`;
271
+ else if (isCanvasResource(resource))
272
+ name = `canvas:${resource.canvasId}`;
203
273
  else
204
- throw new Error(`Received invalid source: ${JSON.stringify(source)}`);
205
- return { name, source: sourceForKey };
274
+ throw new Error(`Received invalid resource: ${JSON.stringify(resource)}`);
275
+ return { name, resource: resourceForKey };
206
276
  }
207
277
  const { projectId, dataset } = instance.config;
208
278
  if (!projectId || !dataset)
209
279
  throw new Error("This API requires a project ID and dataset configured.");
210
- return { name: `${projectId}.${dataset}`, source: { projectId, dataset } };
211
- }, bindActionBySource = createActionBinder((instance, { source }) => createSourceKey(instance, source)), bindActionBySourceAndPerspective = createActionBinder((instance, options) => {
212
- const { source, perspective } = options, utilizedPerspective = perspective ?? instance.config.perspective ?? "drafts";
280
+ return { name: `${projectId}.${dataset}`, resource: { projectId, dataset } };
281
+ }, bindActionByResource = createActionBinder((instance, { resource }) => createResourceKey(instance, resource)), bindActionByResourceAndPerspective = createActionBinder((instance, options) => {
282
+ const { resource, perspective } = options, utilizedPerspective = perspective ?? instance.config.perspective ?? "drafts";
213
283
  let perspectiveKey;
214
284
  isReleasePerspective(utilizedPerspective) ? perspectiveKey = utilizedPerspective.releaseName : typeof utilizedPerspective == "string" ? perspectiveKey = utilizedPerspective : perspectiveKey = JSON.stringify(utilizedPerspective);
215
- const sourceKey = createSourceKey(instance, source);
285
+ const sourceKey = createResourceKey(instance, resource);
216
286
  return {
217
287
  name: `${sourceKey.name}:${perspectiveKey}`,
218
- source: sourceKey.source,
288
+ resource: sourceKey.resource,
219
289
  perspective: utilizedPerspective
220
290
  };
221
291
  }), bindActionGlobally = createActionBinder((..._rest) => ({ name: "global" }));
@@ -931,8 +1001,7 @@ const DEFAULT_API_VERSION = "2024-11-12", DEFAULT_REQUEST_TAG_PREFIX = "sanity.s
931
1001
  apiVersion: null,
932
1002
  requestTagPrefix: null,
933
1003
  useProjectHostname: null,
934
- "~experimental_resource": null,
935
- source: null
1004
+ resource: null
936
1005
  }), DEFAULT_CLIENT_CONFIG = {
937
1006
  apiVersion: DEFAULT_API_VERSION,
938
1007
  useCdn: !1,
@@ -955,7 +1024,7 @@ const DEFAULT_API_VERSION = "2024-11-12", DEFAULT_REQUEST_TAG_PREFIX = "sanity.s
955
1024
  state.set("setTokenAndResetClients", { token, clients: {} });
956
1025
  }), listenToAuthMethod = ({ instance, state }) => getAuthMethodState(instance).observable.subscribe((authMethod) => {
957
1026
  state.set("setAuthMethod", { authMethod });
958
- }), getClientConfigKey = (options) => JSON.stringify(pick(options, ...allowedKeys)), getClient = bindActionGlobally(
1027
+ }), getClientConfigKey = (options) => JSON.stringify(pickProperties(options, allowedKeys)), getClient = bindActionGlobally(
959
1028
  clientStore,
960
1029
  ({ state, instance }, options) => {
961
1030
  if (!options || typeof options != "object")
@@ -971,7 +1040,10 @@ const DEFAULT_API_VERSION = "2024-11-12", DEFAULT_REQUEST_TAG_PREFIX = "sanity.s
971
1040
  }
972
1041
  const tokenFromState = state.get().token, { clients, authMethod } = state.get();
973
1042
  let resource;
974
- options.source && (isDatasetSource(options.source) ? resource = { type: "dataset", id: `${options.source.projectId}.${options.source.dataset}` } : isMediaLibrarySource(options.source) ? resource = { type: "media-library", id: options.source.mediaLibraryId } : isCanvasSource(options.source) && (resource = { type: "canvas", id: options.source.canvasId }));
1043
+ options.resource && (isDatasetResource(options.resource) ? resource = {
1044
+ type: "dataset",
1045
+ id: `${options.resource.projectId}.${options.resource.dataset}`
1046
+ } : isMediaLibraryResource(options.resource) ? resource = { type: "media-library", id: options.resource.mediaLibraryId } : isCanvasResource(options.resource) && (resource = { type: "canvas", id: options.resource.canvasId }));
975
1047
  const projectId = options.projectId ?? instance.config.projectId, dataset = options.dataset ?? instance.config.dataset, apiHost = options.apiHost ?? instance.config.auth?.apiHost ?? getStagingApiHost(), effectiveOptions = {
976
1048
  ...DEFAULT_CLIENT_CONFIG,
977
1049
  ...(options.scope === "global" || !projectId || resource) && { useProjectHostname: !1 },
@@ -979,11 +1051,11 @@ const DEFAULT_API_VERSION = "2024-11-12", DEFAULT_REQUEST_TAG_PREFIX = "sanity.s
979
1051
  ...options,
980
1052
  ...projectId && { projectId },
981
1053
  ...dataset && { dataset },
982
- ...apiHost && { apiHost },
983
- ...resource && { "~experimental_resource": resource }
1054
+ ...resource ? { resource } : { resource: void 0 },
1055
+ ...apiHost && { apiHost }
984
1056
  };
985
1057
  resource && ((options.projectId || options.dataset) && console.warn(
986
- "Both source and explicit projectId/dataset are provided. The source will be used and projectId/dataset will be ignored."
1058
+ "Both resource and explicit projectId/dataset are provided. The resource will be used and projectId/dataset will be ignored."
987
1059
  ), delete effectiveOptions.projectId, delete effectiveOptions.dataset), effectiveOptions.token === null || typeof effectiveOptions.token > "u" ? (delete effectiveOptions.token, authMethod === "cookie" && (effectiveOptions.withCredentials = !0)) : delete effectiveOptions.withCredentials;
988
1060
  const key = getClientConfigKey(effectiveOptions);
989
1061
  if (clients[key]) return clients[key];
@@ -1022,7 +1094,7 @@ const API_VERSION$1 = "vX", PROJECT_API_VERSION = "2025-07-18", USERS_STATE_CLEA
1022
1094
  const group = prev.users[key];
1023
1095
  if (!group) return prev;
1024
1096
  const subscriptions = group.subscriptions.filter((id) => id !== subscriptionId);
1025
- return subscriptions.length ? { ...prev, users: { ...prev.users, [key]: { ...group, subscriptions } } } : { ...prev, users: omit(prev.users, key) };
1097
+ return subscriptions.length ? { ...prev, users: { ...prev.users, [key]: { ...group, subscriptions } } } : { ...prev, users: omitProperty(prev.users, key) };
1026
1098
  }, setUsersData = (key, { data, nextCursor, totalCount }) => (prev) => {
1027
1099
  const group = prev.users[key];
1028
1100
  if (!group) return prev;
@@ -1036,7 +1108,7 @@ const API_VERSION$1 = "vX", PROJECT_API_VERSION = "2025-07-18", USERS_STATE_CLEA
1036
1108
  return group ? { ...prev, users: { ...prev.users, [key]: { ...group, error } } } : prev;
1037
1109
  }, cancelRequest = (key) => (prev) => {
1038
1110
  const group = prev.users[key];
1039
- return !group || group.subscriptions.length ? prev : { ...prev, users: omit(prev.users, key) };
1111
+ return !group || group.subscriptions.length ? prev : { ...prev, users: omitProperty(prev.users, key) };
1040
1112
  }, initializeRequest = (key) => (prev) => prev.users[key] ? prev : { ...prev, users: { ...prev.users, [key]: { subscriptions: [] } } };
1041
1113
  function sortReleases(releases = []) {
1042
1114
  return [...releases].sort((a, b) => {
@@ -1065,23 +1137,23 @@ const ARCHIVED_RELEASE_STATES = ["archived", "published"], STABLE_EMPTY_RELEASES
1065
1137
  const subscription = subscribeToReleases(context);
1066
1138
  return () => subscription.unsubscribe();
1067
1139
  }
1068
- }, _getActiveReleasesState = bindActionBySource(
1140
+ }, _getActiveReleasesState = bindActionByResource(
1069
1141
  releasesStore,
1070
1142
  createStateSourceAction({
1071
1143
  selector: ({ state }, _) => state.activeReleases
1072
1144
  })
1073
1145
  ), getActiveReleasesState = (instance, options) => (
1074
- // bindActionBySource keyFn destructures { source } from the first param, so pass {} when no options
1146
+ // bindActionByResource keyFn destructures { resource } from the first param, so pass {} when no options
1075
1147
  _getActiveReleasesState(instance, options ?? {})
1076
1148
  ), RELEASES_QUERY = "releases::all()", subscribeToReleases = ({
1077
1149
  instance,
1078
1150
  state,
1079
- key: { source }
1151
+ key: { resource }
1080
1152
  }) => {
1081
1153
  const { observable: releases$ } = getQueryState(instance, {
1082
1154
  query: RELEASES_QUERY,
1083
1155
  perspective: "raw",
1084
- source: source && !isDatasetSource(source) ? source : void 0,
1156
+ resource: resource && !isDatasetResource(resource) ? resource : void 0,
1085
1157
  tag: "releases"
1086
1158
  });
1087
1159
  return releases$.pipe(
@@ -1117,7 +1189,7 @@ const ARCHIVED_RELEASE_STATES = ["archived", "published"], STABLE_EMPTY_RELEASES
1117
1189
  )
1118
1190
  });
1119
1191
  let _boundGetPerspectiveState;
1120
- const getPerspectiveState = (instance, ...rest) => (_boundGetPerspectiveState || (_boundGetPerspectiveState = bindActionBySource(
1192
+ const getPerspectiveState = (instance, ...rest) => (_boundGetPerspectiveState || (_boundGetPerspectiveState = bindActionByResource(
1121
1193
  releasesStore,
1122
1194
  _getPerspectiveStateSelector
1123
1195
  )), _boundGetPerspectiveState(instance, ...rest.length ? rest : [{}])), QUERY_STATE_CLEAR_DELAY = 1e3, QUERY_STORE_API_VERSION = "v2025-05-06", QUERY_STORE_DEFAULT_PERSPECTIVE = "drafts", setQueryError = (key, error) => (prev) => {
@@ -1139,10 +1211,10 @@ const getPerspectiveState = (instance, ...rest) => (_boundGetPerspectiveState ||
1139
1211
  const prevQuery = prev.queries[key];
1140
1212
  if (!prevQuery) return prev;
1141
1213
  const subscribers = prevQuery.subscribers.filter((id) => id !== subscriptionId);
1142
- return subscribers.length ? { ...prev, queries: { ...prev.queries, [key]: { ...prevQuery, subscribers } } } : { ...prev, queries: omit(prev.queries, key) };
1214
+ return subscribers.length ? { ...prev, queries: { ...prev.queries, [key]: { ...prevQuery, subscribers } } } : { ...prev, queries: omitProperty(prev.queries, key) };
1143
1215
  }, cancelQuery = (key) => (prev) => {
1144
1216
  const prevQuery = prev.queries[key];
1145
- return !prevQuery || prevQuery.subscribers.length ? prev : { ...prev, queries: omit(prev.queries, key) };
1217
+ return !prevQuery || prevQuery.subscribers.length ? prev : { ...prev, queries: omitProperty(prev.queries, key) };
1146
1218
  }, initializeQuery = (key) => (prev) => prev.queries[key] ? prev : { ...prev, queries: { ...prev.queries, [key]: { subscribers: [] } } }, EMPTY_ARRAY = [], getQueryKey = (options) => JSON.stringify(options), parseQueryKey = (key) => JSON.parse(key);
1147
1219
  function normalizeOptionsWithPerspective(instance, options) {
1148
1220
  if (options.perspective !== void 0) return options;
@@ -1191,7 +1263,7 @@ const queryStore = {
1191
1263
  projectId,
1192
1264
  dataset,
1193
1265
  tag,
1194
- source,
1266
+ resource,
1195
1267
  perspective: perspectiveFromOptions,
1196
1268
  ...restOptions
1197
1269
  } = parseQueryKey(group$.key), perspective$ = isReleasePerspective(perspectiveFromOptions) ? getPerspectiveState(instance, {
@@ -1200,7 +1272,7 @@ const queryStore = {
1200
1272
  apiVersion: QUERY_STORE_API_VERSION,
1201
1273
  projectId,
1202
1274
  dataset,
1203
- source
1275
+ resource
1204
1276
  }).observable;
1205
1277
  return combineLatest({
1206
1278
  lastLiveEventId: lastLiveEventId$,
@@ -1228,12 +1300,12 @@ const queryStore = {
1228
1300
  ).subscribe({ error: errorHandler(state) }), listenToLiveClientAndSetLastLiveEventIds = ({
1229
1301
  state,
1230
1302
  instance,
1231
- key: { source }
1303
+ key: { resource }
1232
1304
  }) => {
1233
1305
  const liveMessages$ = getClientState(instance, {
1234
1306
  apiVersion: QUERY_STORE_API_VERSION,
1235
1307
  // temporary guard here until we're ready for everything to be queried via global api
1236
- ...source && !isDatasetSource(source) ? { source } : {}
1308
+ ...resource && !isDatasetResource(resource) ? { resource } : {}
1237
1309
  }).observable.pipe(
1238
1310
  switchMap(
1239
1311
  (client) => defer(
@@ -1270,7 +1342,7 @@ const queryStore = {
1270
1342
  function getQueryState(...args) {
1271
1343
  return _getQueryState(...args);
1272
1344
  }
1273
- const _getQueryState = bindActionBySource(
1345
+ const _getQueryState = bindActionByResource(
1274
1346
  queryStore,
1275
1347
  createStateSourceAction({
1276
1348
  selector: ({ state, instance }, options) => {
@@ -1293,7 +1365,7 @@ const _getQueryState = bindActionBySource(
1293
1365
  function resolveQuery(...args) {
1294
1366
  return _resolveQuery(...args);
1295
1367
  }
1296
- const _resolveQuery = bindActionBySource(
1368
+ const _resolveQuery = bindActionByResource(
1297
1369
  queryStore,
1298
1370
  ({ state, instance }, { signal, ...options }) => {
1299
1371
  const normalized = normalizeOptionsWithPerspective(instance, options), { getCurrent } = getQueryState(instance, normalized), key = getQueryKey(normalized), aborted$ = signal ? new Observable((observer) => {
@@ -1358,11 +1430,11 @@ function findFirstDefined(fieldsToSearch, candidates, exclude) {
1358
1430
  return value;
1359
1431
  }
1360
1432
  }
1361
- function transformProjectionToPreview(instance, projectionResult, source) {
1433
+ function transformProjectionToPreview(instance, projectionResult, resource) {
1362
1434
  const title = findFirstDefined(TITLE_CANDIDATES, projectionResult.titleCandidates), subtitle = findFirstDefined(SUBTITLE_CANDIDATES, projectionResult.subtitleCandidates, title), client = getClient(instance, {
1363
1435
  apiVersion: API_VERSION,
1364
- // TODO: remove in v3 when we're ready for everything to be queried via source
1365
- source: source && !isDatasetSource(source) ? source : void 0
1436
+ // TODO: remove in v3 when we're ready for everything to be queried via resource
1437
+ resource: resource && !isDatasetResource(resource) ? resource : void 0
1366
1438
  });
1367
1439
  return {
1368
1440
  title: String(title || `${projectionResult._type}: ${projectionResult._id}`),
@@ -1405,9 +1477,8 @@ export {
1405
1477
  addSubscription,
1406
1478
  authStore,
1407
1479
  authStore$1,
1408
- bindActionByDataset,
1409
- bindActionBySource,
1410
- bindActionBySourceAndPerspective,
1480
+ bindActionByResource,
1481
+ bindActionByResourceAndPerspective,
1411
1482
  bindActionGlobally,
1412
1483
  cancelRequest,
1413
1484
  clientStore$1 as clientStore,
@@ -1440,14 +1511,20 @@ export {
1440
1511
  getUsersKey,
1441
1512
  initializeRequest,
1442
1513
  insecureRandomId,
1514
+ isCanvasResource,
1443
1515
  isCanvasSource,
1516
+ isDatasetResource,
1444
1517
  isDatasetSource,
1518
+ isDeepEqual,
1519
+ isMediaLibraryResource,
1445
1520
  isMediaLibrarySource,
1446
1521
  isProjectUserNotFoundClientError,
1447
1522
  isReleasePerspective,
1448
1523
  isStudioConfig,
1524
+ omitProperty,
1449
1525
  parseQueryKey,
1450
1526
  parseUsersKey,
1527
+ pickProperties,
1451
1528
  removeSubscription,
1452
1529
  resolveQuery,
1453
1530
  setAuthToken,