@sanity/client 7.16.0 → 7.17.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 (44) hide show
  1. package/dist/_chunks-cjs/config.cjs.map +1 -1
  2. package/dist/_chunks-cjs/isRecord.cjs.map +1 -1
  3. package/dist/_chunks-cjs/resolveEditInfo.cjs +1 -1
  4. package/dist/_chunks-cjs/resolveEditInfo.cjs.map +1 -1
  5. package/dist/_chunks-cjs/stegaClean.cjs.map +1 -1
  6. package/dist/_chunks-cjs/stegaEncodeSourceMap.cjs +1 -1
  7. package/dist/_chunks-cjs/stegaEncodeSourceMap.cjs.map +1 -1
  8. package/dist/_chunks-es/config.js.map +1 -1
  9. package/dist/_chunks-es/isRecord.js.map +1 -1
  10. package/dist/_chunks-es/resolveEditInfo.js +1 -1
  11. package/dist/_chunks-es/resolveEditInfo.js.map +1 -1
  12. package/dist/_chunks-es/stegaClean.js.map +1 -1
  13. package/dist/_chunks-es/stegaEncodeSourceMap.js +1 -1
  14. package/dist/_chunks-es/stegaEncodeSourceMap.js.map +1 -1
  15. package/dist/csm.cjs.map +1 -1
  16. package/dist/csm.js.map +1 -1
  17. package/dist/index.browser.cjs +2 -2
  18. package/dist/index.browser.cjs.map +1 -1
  19. package/dist/index.browser.d.cts +14 -2
  20. package/dist/index.browser.d.ts +14 -2
  21. package/dist/index.browser.js +3 -3
  22. package/dist/index.browser.js.map +1 -1
  23. package/dist/index.cjs +3 -3
  24. package/dist/index.cjs.map +1 -1
  25. package/dist/index.d.cts +14 -2
  26. package/dist/index.d.ts +14 -2
  27. package/dist/index.js +4 -4
  28. package/dist/index.js.map +1 -1
  29. package/dist/media-library.cjs.map +1 -1
  30. package/dist/media-library.js.map +1 -1
  31. package/dist/stega.browser.cjs.map +1 -1
  32. package/dist/stega.browser.d.cts +14 -2
  33. package/dist/stega.browser.d.ts +14 -2
  34. package/dist/stega.browser.js +1 -1
  35. package/dist/stega.browser.js.map +1 -1
  36. package/dist/stega.cjs.map +1 -1
  37. package/dist/stega.d.cts +14 -2
  38. package/dist/stega.d.ts +14 -2
  39. package/dist/stega.js +1 -1
  40. package/dist/stega.js.map +1 -1
  41. package/package.json +1 -1
  42. package/src/projects/ProjectsClient.ts +22 -2
  43. package/umd/sanityClient.js +11 -11
  44. package/umd/sanityClient.min.js +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"media-library.cjs","sources":["../src/media-library.ts"],"sourcesContent":["import type {\n VideoPlaybackInfo,\n VideoPlaybackInfoItem,\n VideoPlaybackInfoItemSigned,\n VideoPlaybackInfoSigned,\n VideoPlaybackTokens,\n} from './types'\n\n/**\n * Check if a playback info item (stream/thumbnail/etc) has a signed token\n * @internal\n */\nfunction isSignedPlayback(item: VideoPlaybackInfoItem): item is VideoPlaybackInfoItemSigned {\n return 'token' in item\n}\n\n/**\n * Check if the entire playback info response requires signed URLs\n * @public\n */\nexport function isSignedPlaybackInfo(\n playbackInfo: VideoPlaybackInfo,\n): playbackInfo is VideoPlaybackInfoSigned {\n return isSignedPlayback(playbackInfo.stream)\n}\n\n/**\n * Extract playback tokens from signed video playback info\n * @param playbackInfo - The video playback info\n * @returns The playback tokens or undefined if the response is not signed\n * @public\n * @example\n * const tokens = getPlaybackTokens(playbackInfo)\n * console.log(tokens)\n * ```json\n * {\n * stream: \"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...\",\n * thumbnail: \"eyJ0a2VuIjoiVGh1bWJuYWlsVG9rZW4tMTIz...\",\n * animated: \"eyJ0a2VuIjoiQW5pbWF0ZWRUb2tlbi1kZWY...\",\n * storyboard: \"eyJ0a2VuIjoiU3Rvcnlib2FyZFRva2VuLTc4...\"\n * }\n * ```\n */\nexport function getPlaybackTokens(\n playbackInfo: VideoPlaybackInfo,\n): VideoPlaybackTokens | undefined {\n if (isSignedPlaybackInfo(playbackInfo)) {\n return {\n stream: playbackInfo.stream.token,\n thumbnail: playbackInfo.thumbnail.token,\n storyboard: playbackInfo.storyboard.token,\n animated: playbackInfo.animated.token,\n }\n }\n\n return undefined\n}\n"],"names":[],"mappings":";;AAYA,SAAS,iBAAiB,MAAkE;AAC1F,SAAO,WAAW;AACpB;AAMO,SAAS,qBACd,cACyC;AAClC,SAAA,iBAAiB,aAAa,MAAM;AAC7C;AAmBO,SAAS,kBACd,cACiC;AACjC,MAAI,qBAAqB,YAAY;AAC5B,WAAA;AAAA,MACL,QAAQ,aAAa,OAAO;AAAA,MAC5B,WAAW,aAAa,UAAU;AAAA,MAClC,YAAY,aAAa,WAAW;AAAA,MACpC,UAAU,aAAa,SAAS;AAAA,IAClC;AAIJ;;;"}
1
+ {"version":3,"file":"media-library.cjs","sources":["../src/media-library.ts"],"sourcesContent":["import type {\n VideoPlaybackInfo,\n VideoPlaybackInfoItem,\n VideoPlaybackInfoItemSigned,\n VideoPlaybackInfoSigned,\n VideoPlaybackTokens,\n} from './types'\n\n/**\n * Check if a playback info item (stream/thumbnail/etc) has a signed token\n * @internal\n */\nfunction isSignedPlayback(item: VideoPlaybackInfoItem): item is VideoPlaybackInfoItemSigned {\n return 'token' in item\n}\n\n/**\n * Check if the entire playback info response requires signed URLs\n * @public\n */\nexport function isSignedPlaybackInfo(\n playbackInfo: VideoPlaybackInfo,\n): playbackInfo is VideoPlaybackInfoSigned {\n return isSignedPlayback(playbackInfo.stream)\n}\n\n/**\n * Extract playback tokens from signed video playback info\n * @param playbackInfo - The video playback info\n * @returns The playback tokens or undefined if the response is not signed\n * @public\n * @example\n * const tokens = getPlaybackTokens(playbackInfo)\n * console.log(tokens)\n * ```json\n * {\n * stream: \"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...\",\n * thumbnail: \"eyJ0a2VuIjoiVGh1bWJuYWlsVG9rZW4tMTIz...\",\n * animated: \"eyJ0a2VuIjoiQW5pbWF0ZWRUb2tlbi1kZWY...\",\n * storyboard: \"eyJ0a2VuIjoiU3Rvcnlib2FyZFRva2VuLTc4...\"\n * }\n * ```\n */\nexport function getPlaybackTokens(\n playbackInfo: VideoPlaybackInfo,\n): VideoPlaybackTokens | undefined {\n if (isSignedPlaybackInfo(playbackInfo)) {\n return {\n stream: playbackInfo.stream.token,\n thumbnail: playbackInfo.thumbnail.token,\n storyboard: playbackInfo.storyboard.token,\n animated: playbackInfo.animated.token,\n }\n }\n\n return undefined\n}\n"],"names":[],"mappings":";;AAYA,SAAS,iBAAiB,MAAkE;AAC1F,SAAO,WAAW;AACpB;AAMO,SAAS,qBACd,cACyC;AACzC,SAAO,iBAAiB,aAAa,MAAM;AAC7C;AAmBO,SAAS,kBACd,cACiC;AACjC,MAAI,qBAAqB,YAAY;AACnC,WAAO;AAAA,MACL,QAAQ,aAAa,OAAO;AAAA,MAC5B,WAAW,aAAa,UAAU;AAAA,MAClC,YAAY,aAAa,WAAW;AAAA,MACpC,UAAU,aAAa,SAAS;AAAA,IAAA;AAKtC;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"media-library.js","sources":["../src/media-library.ts"],"sourcesContent":["import type {\n VideoPlaybackInfo,\n VideoPlaybackInfoItem,\n VideoPlaybackInfoItemSigned,\n VideoPlaybackInfoSigned,\n VideoPlaybackTokens,\n} from './types'\n\n/**\n * Check if a playback info item (stream/thumbnail/etc) has a signed token\n * @internal\n */\nfunction isSignedPlayback(item: VideoPlaybackInfoItem): item is VideoPlaybackInfoItemSigned {\n return 'token' in item\n}\n\n/**\n * Check if the entire playback info response requires signed URLs\n * @public\n */\nexport function isSignedPlaybackInfo(\n playbackInfo: VideoPlaybackInfo,\n): playbackInfo is VideoPlaybackInfoSigned {\n return isSignedPlayback(playbackInfo.stream)\n}\n\n/**\n * Extract playback tokens from signed video playback info\n * @param playbackInfo - The video playback info\n * @returns The playback tokens or undefined if the response is not signed\n * @public\n * @example\n * const tokens = getPlaybackTokens(playbackInfo)\n * console.log(tokens)\n * ```json\n * {\n * stream: \"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...\",\n * thumbnail: \"eyJ0a2VuIjoiVGh1bWJuYWlsVG9rZW4tMTIz...\",\n * animated: \"eyJ0a2VuIjoiQW5pbWF0ZWRUb2tlbi1kZWY...\",\n * storyboard: \"eyJ0a2VuIjoiU3Rvcnlib2FyZFRva2VuLTc4...\"\n * }\n * ```\n */\nexport function getPlaybackTokens(\n playbackInfo: VideoPlaybackInfo,\n): VideoPlaybackTokens | undefined {\n if (isSignedPlaybackInfo(playbackInfo)) {\n return {\n stream: playbackInfo.stream.token,\n thumbnail: playbackInfo.thumbnail.token,\n storyboard: playbackInfo.storyboard.token,\n animated: playbackInfo.animated.token,\n }\n }\n\n return undefined\n}\n"],"names":[],"mappings":"AAYA,SAAS,iBAAiB,MAAkE;AAC1F,SAAO,WAAW;AACpB;AAMO,SAAS,qBACd,cACyC;AAClC,SAAA,iBAAiB,aAAa,MAAM;AAC7C;AAmBO,SAAS,kBACd,cACiC;AACjC,MAAI,qBAAqB,YAAY;AAC5B,WAAA;AAAA,MACL,QAAQ,aAAa,OAAO;AAAA,MAC5B,WAAW,aAAa,UAAU;AAAA,MAClC,YAAY,aAAa,WAAW;AAAA,MACpC,UAAU,aAAa,SAAS;AAAA,IAClC;AAIJ;"}
1
+ {"version":3,"file":"media-library.js","sources":["../src/media-library.ts"],"sourcesContent":["import type {\n VideoPlaybackInfo,\n VideoPlaybackInfoItem,\n VideoPlaybackInfoItemSigned,\n VideoPlaybackInfoSigned,\n VideoPlaybackTokens,\n} from './types'\n\n/**\n * Check if a playback info item (stream/thumbnail/etc) has a signed token\n * @internal\n */\nfunction isSignedPlayback(item: VideoPlaybackInfoItem): item is VideoPlaybackInfoItemSigned {\n return 'token' in item\n}\n\n/**\n * Check if the entire playback info response requires signed URLs\n * @public\n */\nexport function isSignedPlaybackInfo(\n playbackInfo: VideoPlaybackInfo,\n): playbackInfo is VideoPlaybackInfoSigned {\n return isSignedPlayback(playbackInfo.stream)\n}\n\n/**\n * Extract playback tokens from signed video playback info\n * @param playbackInfo - The video playback info\n * @returns The playback tokens or undefined if the response is not signed\n * @public\n * @example\n * const tokens = getPlaybackTokens(playbackInfo)\n * console.log(tokens)\n * ```json\n * {\n * stream: \"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...\",\n * thumbnail: \"eyJ0a2VuIjoiVGh1bWJuYWlsVG9rZW4tMTIz...\",\n * animated: \"eyJ0a2VuIjoiQW5pbWF0ZWRUb2tlbi1kZWY...\",\n * storyboard: \"eyJ0a2VuIjoiU3Rvcnlib2FyZFRva2VuLTc4...\"\n * }\n * ```\n */\nexport function getPlaybackTokens(\n playbackInfo: VideoPlaybackInfo,\n): VideoPlaybackTokens | undefined {\n if (isSignedPlaybackInfo(playbackInfo)) {\n return {\n stream: playbackInfo.stream.token,\n thumbnail: playbackInfo.thumbnail.token,\n storyboard: playbackInfo.storyboard.token,\n animated: playbackInfo.animated.token,\n }\n }\n\n return undefined\n}\n"],"names":[],"mappings":"AAYA,SAAS,iBAAiB,MAAkE;AAC1F,SAAO,WAAW;AACpB;AAMO,SAAS,qBACd,cACyC;AACzC,SAAO,iBAAiB,aAAa,MAAM;AAC7C;AAmBO,SAAS,kBACd,cACiC;AACjC,MAAI,qBAAqB,YAAY;AACnC,WAAO;AAAA,MACL,QAAQ,aAAa,OAAO;AAAA,MAC5B,WAAW,aAAa,UAAU;AAAA,MAClC,YAAY,aAAa,WAAW;AAAA,MACpC,UAAU,aAAa,SAAS;AAAA,IAAA;AAKtC;"}
@@ -1 +1 @@
1
- {"version":3,"file":"stega.browser.cjs","sources":["../src/stega/index.ts"],"sourcesContent":["export * from '@sanity/client'\nimport {\n createClient as originalCreateClient,\n ObservableSanityClient,\n requester as originalRequester,\n SanityClient,\n} from '@sanity/client'\n\nexport {encodeIntoResult} from './encodeIntoResult'\nexport {stegaClean, vercelStegaCleanAll} from './stegaClean'\nexport {stegaEncodeSourceMap} from './stegaEncodeSourceMap'\nexport * from './types'\n\n/**\n * @deprecated -- Use `import {SanityClient} from '@sanity/client'` instead\n * @public\n */\nexport class SanityStegaClient extends SanityClient {}\n\n/**\n * @deprecated -- Use `import {ObservableSanityClient} from '@sanity/client'` instead\n * @public\n */\nexport class ObservableSanityStegaClient extends ObservableSanityClient {}\n\n/**\n * @deprecated -- Use `import {requester} from '@sanity/client'` instead\n * @public\n */\nexport const requester = originalRequester\n\n/**\n * @deprecated -- Use `import {createClient} from '@sanity/client'` instead\n * @public\n */\nexport const createClient = originalCreateClient\n"],"names":["SanityClient","ObservableSanityClient","originalRequester","originalCreateClient"],"mappings":";;;AAiBO,MAAM,0BAA0BA,OAAAA,aAAa;AAAC;AAM9C,MAAM,oCAAoCC,OAAAA,uBAAuB;AAAC;AAM5D,MAAA,YAAYC,OAAAA,WAMZ,eAAeC,OAAAA;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"stega.browser.cjs","sources":["../src/stega/index.ts"],"sourcesContent":["export * from '@sanity/client'\nimport {\n createClient as originalCreateClient,\n ObservableSanityClient,\n requester as originalRequester,\n SanityClient,\n} from '@sanity/client'\n\nexport {encodeIntoResult} from './encodeIntoResult'\nexport {stegaClean, vercelStegaCleanAll} from './stegaClean'\nexport {stegaEncodeSourceMap} from './stegaEncodeSourceMap'\nexport * from './types'\n\n/**\n * @deprecated -- Use `import {SanityClient} from '@sanity/client'` instead\n * @public\n */\nexport class SanityStegaClient extends SanityClient {}\n\n/**\n * @deprecated -- Use `import {ObservableSanityClient} from '@sanity/client'` instead\n * @public\n */\nexport class ObservableSanityStegaClient extends ObservableSanityClient {}\n\n/**\n * @deprecated -- Use `import {requester} from '@sanity/client'` instead\n * @public\n */\nexport const requester = originalRequester\n\n/**\n * @deprecated -- Use `import {createClient} from '@sanity/client'` instead\n * @public\n */\nexport const createClient = originalCreateClient\n"],"names":["SanityClient","ObservableSanityClient","originalRequester","originalCreateClient"],"mappings":";;;AAiBO,MAAM,0BAA0BA,OAAAA,aAAa;AAAC;AAM9C,MAAM,oCAAoCC,OAAAA,uBAAuB;AAAC;AAMlE,MAAM,YAAYC,OAAAA,WAMZ,eAAeC,OAAAA;;;;;;;;;;;;;;;;;"}
@@ -2863,11 +2863,17 @@ export declare class ObservableProjectsClient {
2863
2863
  * @param options - Options for the list request
2864
2864
  * - `includeMembers` - Whether to include members in the response (default: true)
2865
2865
  * - `organizationId` - ID of the organization to fetch projects for
2866
+ * - `onlyExplicitMembership` - Only include projects where the user has explicit membership (default: false)
2866
2867
  */
2867
- list(options?: {includeMembers?: true; organizationId?: string}): Observable<SanityProject[]>
2868
+ list(options?: {
2869
+ includeMembers?: true
2870
+ organizationId?: string
2871
+ onlyExplicitMembership?: boolean
2872
+ }): Observable<SanityProject[]>
2868
2873
  list(options?: {
2869
2874
  includeMembers?: false
2870
2875
  organizationId?: string
2876
+ onlyExplicitMembership?: boolean
2871
2877
  }): Observable<Omit<SanityProject, 'members'>[]>
2872
2878
  /**
2873
2879
  * Fetch a project by project ID
@@ -4246,11 +4252,17 @@ export declare class ProjectsClient {
4246
4252
  * @param options - Options for the list request
4247
4253
  * - `includeMembers` - Whether to include members in the response (default: true)
4248
4254
  * - `organizationId` - ID of the organization to fetch projects for
4255
+ * - `onlyExplicitMembership` - Only include projects where the user has explicit membership (default: false)
4249
4256
  */
4250
- list(options?: {includeMembers?: true; organizationId?: string}): Promise<SanityProject[]>
4257
+ list(options?: {
4258
+ includeMembers?: true
4259
+ organizationId?: string
4260
+ onlyExplicitMembership?: boolean
4261
+ }): Promise<SanityProject[]>
4251
4262
  list(options?: {
4252
4263
  includeMembers?: false
4253
4264
  organizationId?: string
4265
+ onlyExplicitMembership?: boolean
4254
4266
  }): Promise<Omit<SanityProject, 'members'>[]>
4255
4267
  /**
4256
4268
  * Fetch a project by project ID
@@ -2863,11 +2863,17 @@ export declare class ObservableProjectsClient {
2863
2863
  * @param options - Options for the list request
2864
2864
  * - `includeMembers` - Whether to include members in the response (default: true)
2865
2865
  * - `organizationId` - ID of the organization to fetch projects for
2866
+ * - `onlyExplicitMembership` - Only include projects where the user has explicit membership (default: false)
2866
2867
  */
2867
- list(options?: {includeMembers?: true; organizationId?: string}): Observable<SanityProject[]>
2868
+ list(options?: {
2869
+ includeMembers?: true
2870
+ organizationId?: string
2871
+ onlyExplicitMembership?: boolean
2872
+ }): Observable<SanityProject[]>
2868
2873
  list(options?: {
2869
2874
  includeMembers?: false
2870
2875
  organizationId?: string
2876
+ onlyExplicitMembership?: boolean
2871
2877
  }): Observable<Omit<SanityProject, 'members'>[]>
2872
2878
  /**
2873
2879
  * Fetch a project by project ID
@@ -4246,11 +4252,17 @@ export declare class ProjectsClient {
4246
4252
  * @param options - Options for the list request
4247
4253
  * - `includeMembers` - Whether to include members in the response (default: true)
4248
4254
  * - `organizationId` - ID of the organization to fetch projects for
4255
+ * - `onlyExplicitMembership` - Only include projects where the user has explicit membership (default: false)
4249
4256
  */
4250
- list(options?: {includeMembers?: true; organizationId?: string}): Promise<SanityProject[]>
4257
+ list(options?: {
4258
+ includeMembers?: true
4259
+ organizationId?: string
4260
+ onlyExplicitMembership?: boolean
4261
+ }): Promise<SanityProject[]>
4251
4262
  list(options?: {
4252
4263
  includeMembers?: false
4253
4264
  organizationId?: string
4265
+ onlyExplicitMembership?: boolean
4254
4266
  }): Promise<Omit<SanityProject, 'members'>[]>
4255
4267
  /**
4256
4268
  * Fetch a project by project ID
@@ -1,4 +1,4 @@
1
- import { requester as requester$1, createClient as createClient$1, SanityClient, ObservableSanityClient } from "@sanity/client";
1
+ import { createClient as createClient$1, requester as requester$1, ObservableSanityClient, SanityClient } from "@sanity/client";
2
2
  export * from "@sanity/client";
3
3
  import { encodeIntoResult, stegaEncodeSourceMap } from "./_chunks-es/stegaEncodeSourceMap.js";
4
4
  import { stegaClean, vercelStegaCleanAll } from "./_chunks-es/stegaClean.js";
@@ -1 +1 @@
1
- {"version":3,"file":"stega.browser.js","sources":["../src/stega/index.ts"],"sourcesContent":["export * from '@sanity/client'\nimport {\n createClient as originalCreateClient,\n ObservableSanityClient,\n requester as originalRequester,\n SanityClient,\n} from '@sanity/client'\n\nexport {encodeIntoResult} from './encodeIntoResult'\nexport {stegaClean, vercelStegaCleanAll} from './stegaClean'\nexport {stegaEncodeSourceMap} from './stegaEncodeSourceMap'\nexport * from './types'\n\n/**\n * @deprecated -- Use `import {SanityClient} from '@sanity/client'` instead\n * @public\n */\nexport class SanityStegaClient extends SanityClient {}\n\n/**\n * @deprecated -- Use `import {ObservableSanityClient} from '@sanity/client'` instead\n * @public\n */\nexport class ObservableSanityStegaClient extends ObservableSanityClient {}\n\n/**\n * @deprecated -- Use `import {requester} from '@sanity/client'` instead\n * @public\n */\nexport const requester = originalRequester\n\n/**\n * @deprecated -- Use `import {createClient} from '@sanity/client'` instead\n * @public\n */\nexport const createClient = originalCreateClient\n"],"names":["originalRequester","originalCreateClient"],"mappings":";;;;AAiBO,MAAM,0BAA0B,aAAa;AAAC;AAM9C,MAAM,oCAAoC,uBAAuB;AAAC;AAM5D,MAAA,YAAYA,aAMZ,eAAeC;"}
1
+ {"version":3,"file":"stega.browser.js","sources":["../src/stega/index.ts"],"sourcesContent":["export * from '@sanity/client'\nimport {\n createClient as originalCreateClient,\n ObservableSanityClient,\n requester as originalRequester,\n SanityClient,\n} from '@sanity/client'\n\nexport {encodeIntoResult} from './encodeIntoResult'\nexport {stegaClean, vercelStegaCleanAll} from './stegaClean'\nexport {stegaEncodeSourceMap} from './stegaEncodeSourceMap'\nexport * from './types'\n\n/**\n * @deprecated -- Use `import {SanityClient} from '@sanity/client'` instead\n * @public\n */\nexport class SanityStegaClient extends SanityClient {}\n\n/**\n * @deprecated -- Use `import {ObservableSanityClient} from '@sanity/client'` instead\n * @public\n */\nexport class ObservableSanityStegaClient extends ObservableSanityClient {}\n\n/**\n * @deprecated -- Use `import {requester} from '@sanity/client'` instead\n * @public\n */\nexport const requester = originalRequester\n\n/**\n * @deprecated -- Use `import {createClient} from '@sanity/client'` instead\n * @public\n */\nexport const createClient = originalCreateClient\n"],"names":["originalRequester","originalCreateClient"],"mappings":";;;;AAiBO,MAAM,0BAA0B,aAAa;AAAC;AAM9C,MAAM,oCAAoC,uBAAuB;AAAC;AAMlE,MAAM,YAAYA,aAMZ,eAAeC;"}
@@ -1 +1 @@
1
- {"version":3,"file":"stega.cjs","sources":["../src/stega/index.ts"],"sourcesContent":["export * from '@sanity/client'\nimport {\n createClient as originalCreateClient,\n ObservableSanityClient,\n requester as originalRequester,\n SanityClient,\n} from '@sanity/client'\n\nexport {encodeIntoResult} from './encodeIntoResult'\nexport {stegaClean, vercelStegaCleanAll} from './stegaClean'\nexport {stegaEncodeSourceMap} from './stegaEncodeSourceMap'\nexport * from './types'\n\n/**\n * @deprecated -- Use `import {SanityClient} from '@sanity/client'` instead\n * @public\n */\nexport class SanityStegaClient extends SanityClient {}\n\n/**\n * @deprecated -- Use `import {ObservableSanityClient} from '@sanity/client'` instead\n * @public\n */\nexport class ObservableSanityStegaClient extends ObservableSanityClient {}\n\n/**\n * @deprecated -- Use `import {requester} from '@sanity/client'` instead\n * @public\n */\nexport const requester = originalRequester\n\n/**\n * @deprecated -- Use `import {createClient} from '@sanity/client'` instead\n * @public\n */\nexport const createClient = originalCreateClient\n"],"names":["SanityClient","ObservableSanityClient","originalRequester","originalCreateClient"],"mappings":";;;AAiBO,MAAM,0BAA0BA,OAAAA,aAAa;AAAC;AAM9C,MAAM,oCAAoCC,OAAAA,uBAAuB;AAAC;AAM5D,MAAA,YAAYC,OAAAA,WAMZ,eAAeC,OAAAA;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"stega.cjs","sources":["../src/stega/index.ts"],"sourcesContent":["export * from '@sanity/client'\nimport {\n createClient as originalCreateClient,\n ObservableSanityClient,\n requester as originalRequester,\n SanityClient,\n} from '@sanity/client'\n\nexport {encodeIntoResult} from './encodeIntoResult'\nexport {stegaClean, vercelStegaCleanAll} from './stegaClean'\nexport {stegaEncodeSourceMap} from './stegaEncodeSourceMap'\nexport * from './types'\n\n/**\n * @deprecated -- Use `import {SanityClient} from '@sanity/client'` instead\n * @public\n */\nexport class SanityStegaClient extends SanityClient {}\n\n/**\n * @deprecated -- Use `import {ObservableSanityClient} from '@sanity/client'` instead\n * @public\n */\nexport class ObservableSanityStegaClient extends ObservableSanityClient {}\n\n/**\n * @deprecated -- Use `import {requester} from '@sanity/client'` instead\n * @public\n */\nexport const requester = originalRequester\n\n/**\n * @deprecated -- Use `import {createClient} from '@sanity/client'` instead\n * @public\n */\nexport const createClient = originalCreateClient\n"],"names":["SanityClient","ObservableSanityClient","originalRequester","originalCreateClient"],"mappings":";;;AAiBO,MAAM,0BAA0BA,OAAAA,aAAa;AAAC;AAM9C,MAAM,oCAAoCC,OAAAA,uBAAuB;AAAC;AAMlE,MAAM,YAAYC,OAAAA,WAMZ,eAAeC,OAAAA;;;;;;;;;;;;;;;;;"}
package/dist/stega.d.cts CHANGED
@@ -2863,11 +2863,17 @@ export declare class ObservableProjectsClient {
2863
2863
  * @param options - Options for the list request
2864
2864
  * - `includeMembers` - Whether to include members in the response (default: true)
2865
2865
  * - `organizationId` - ID of the organization to fetch projects for
2866
+ * - `onlyExplicitMembership` - Only include projects where the user has explicit membership (default: false)
2866
2867
  */
2867
- list(options?: {includeMembers?: true; organizationId?: string}): Observable<SanityProject[]>
2868
+ list(options?: {
2869
+ includeMembers?: true
2870
+ organizationId?: string
2871
+ onlyExplicitMembership?: boolean
2872
+ }): Observable<SanityProject[]>
2868
2873
  list(options?: {
2869
2874
  includeMembers?: false
2870
2875
  organizationId?: string
2876
+ onlyExplicitMembership?: boolean
2871
2877
  }): Observable<Omit<SanityProject, 'members'>[]>
2872
2878
  /**
2873
2879
  * Fetch a project by project ID
@@ -4246,11 +4252,17 @@ export declare class ProjectsClient {
4246
4252
  * @param options - Options for the list request
4247
4253
  * - `includeMembers` - Whether to include members in the response (default: true)
4248
4254
  * - `organizationId` - ID of the organization to fetch projects for
4255
+ * - `onlyExplicitMembership` - Only include projects where the user has explicit membership (default: false)
4249
4256
  */
4250
- list(options?: {includeMembers?: true; organizationId?: string}): Promise<SanityProject[]>
4257
+ list(options?: {
4258
+ includeMembers?: true
4259
+ organizationId?: string
4260
+ onlyExplicitMembership?: boolean
4261
+ }): Promise<SanityProject[]>
4251
4262
  list(options?: {
4252
4263
  includeMembers?: false
4253
4264
  organizationId?: string
4265
+ onlyExplicitMembership?: boolean
4254
4266
  }): Promise<Omit<SanityProject, 'members'>[]>
4255
4267
  /**
4256
4268
  * Fetch a project by project ID
package/dist/stega.d.ts CHANGED
@@ -2863,11 +2863,17 @@ export declare class ObservableProjectsClient {
2863
2863
  * @param options - Options for the list request
2864
2864
  * - `includeMembers` - Whether to include members in the response (default: true)
2865
2865
  * - `organizationId` - ID of the organization to fetch projects for
2866
+ * - `onlyExplicitMembership` - Only include projects where the user has explicit membership (default: false)
2866
2867
  */
2867
- list(options?: {includeMembers?: true; organizationId?: string}): Observable<SanityProject[]>
2868
+ list(options?: {
2869
+ includeMembers?: true
2870
+ organizationId?: string
2871
+ onlyExplicitMembership?: boolean
2872
+ }): Observable<SanityProject[]>
2868
2873
  list(options?: {
2869
2874
  includeMembers?: false
2870
2875
  organizationId?: string
2876
+ onlyExplicitMembership?: boolean
2871
2877
  }): Observable<Omit<SanityProject, 'members'>[]>
2872
2878
  /**
2873
2879
  * Fetch a project by project ID
@@ -4246,11 +4252,17 @@ export declare class ProjectsClient {
4246
4252
  * @param options - Options for the list request
4247
4253
  * - `includeMembers` - Whether to include members in the response (default: true)
4248
4254
  * - `organizationId` - ID of the organization to fetch projects for
4255
+ * - `onlyExplicitMembership` - Only include projects where the user has explicit membership (default: false)
4249
4256
  */
4250
- list(options?: {includeMembers?: true; organizationId?: string}): Promise<SanityProject[]>
4257
+ list(options?: {
4258
+ includeMembers?: true
4259
+ organizationId?: string
4260
+ onlyExplicitMembership?: boolean
4261
+ }): Promise<SanityProject[]>
4251
4262
  list(options?: {
4252
4263
  includeMembers?: false
4253
4264
  organizationId?: string
4265
+ onlyExplicitMembership?: boolean
4254
4266
  }): Promise<Omit<SanityProject, 'members'>[]>
4255
4267
  /**
4256
4268
  * Fetch a project by project ID
package/dist/stega.js CHANGED
@@ -1,4 +1,4 @@
1
- import { requester as requester$1, createClient as createClient$1, SanityClient, ObservableSanityClient } from "@sanity/client";
1
+ import { createClient as createClient$1, requester as requester$1, ObservableSanityClient, SanityClient } from "@sanity/client";
2
2
  export * from "@sanity/client";
3
3
  import { encodeIntoResult, stegaEncodeSourceMap } from "./_chunks-es/stegaEncodeSourceMap.js";
4
4
  import { stegaClean, vercelStegaCleanAll } from "./_chunks-es/stegaClean.js";
package/dist/stega.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"stega.js","sources":["../src/stega/index.ts"],"sourcesContent":["export * from '@sanity/client'\nimport {\n createClient as originalCreateClient,\n ObservableSanityClient,\n requester as originalRequester,\n SanityClient,\n} from '@sanity/client'\n\nexport {encodeIntoResult} from './encodeIntoResult'\nexport {stegaClean, vercelStegaCleanAll} from './stegaClean'\nexport {stegaEncodeSourceMap} from './stegaEncodeSourceMap'\nexport * from './types'\n\n/**\n * @deprecated -- Use `import {SanityClient} from '@sanity/client'` instead\n * @public\n */\nexport class SanityStegaClient extends SanityClient {}\n\n/**\n * @deprecated -- Use `import {ObservableSanityClient} from '@sanity/client'` instead\n * @public\n */\nexport class ObservableSanityStegaClient extends ObservableSanityClient {}\n\n/**\n * @deprecated -- Use `import {requester} from '@sanity/client'` instead\n * @public\n */\nexport const requester = originalRequester\n\n/**\n * @deprecated -- Use `import {createClient} from '@sanity/client'` instead\n * @public\n */\nexport const createClient = originalCreateClient\n"],"names":["originalRequester","originalCreateClient"],"mappings":";;;;AAiBO,MAAM,0BAA0B,aAAa;AAAC;AAM9C,MAAM,oCAAoC,uBAAuB;AAAC;AAM5D,MAAA,YAAYA,aAMZ,eAAeC;"}
1
+ {"version":3,"file":"stega.js","sources":["../src/stega/index.ts"],"sourcesContent":["export * from '@sanity/client'\nimport {\n createClient as originalCreateClient,\n ObservableSanityClient,\n requester as originalRequester,\n SanityClient,\n} from '@sanity/client'\n\nexport {encodeIntoResult} from './encodeIntoResult'\nexport {stegaClean, vercelStegaCleanAll} from './stegaClean'\nexport {stegaEncodeSourceMap} from './stegaEncodeSourceMap'\nexport * from './types'\n\n/**\n * @deprecated -- Use `import {SanityClient} from '@sanity/client'` instead\n * @public\n */\nexport class SanityStegaClient extends SanityClient {}\n\n/**\n * @deprecated -- Use `import {ObservableSanityClient} from '@sanity/client'` instead\n * @public\n */\nexport class ObservableSanityStegaClient extends ObservableSanityClient {}\n\n/**\n * @deprecated -- Use `import {requester} from '@sanity/client'` instead\n * @public\n */\nexport const requester = originalRequester\n\n/**\n * @deprecated -- Use `import {createClient} from '@sanity/client'` instead\n * @public\n */\nexport const createClient = originalCreateClient\n"],"names":["originalRequester","originalCreateClient"],"mappings":";;;;AAiBO,MAAM,0BAA0B,aAAa;AAAC;AAM9C,MAAM,oCAAoC,uBAAuB;AAAC;AAMlE,MAAM,YAAYA,aAMZ,eAAeC;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sanity/client",
3
- "version": "7.16.0",
3
+ "version": "7.17.0",
4
4
  "description": "Client for retrieving, creating and patching data from Sanity.io",
5
5
  "keywords": [
6
6
  "sanity",
@@ -19,15 +19,22 @@ export class ObservableProjectsClient {
19
19
  * @param options - Options for the list request
20
20
  * - `includeMembers` - Whether to include members in the response (default: true)
21
21
  * - `organizationId` - ID of the organization to fetch projects for
22
+ * - `onlyExplicitMembership` - Only include projects where the user has explicit membership (default: false)
22
23
  */
23
- list(options?: {includeMembers?: true; organizationId?: string}): Observable<SanityProject[]>
24
+ list(options?: {
25
+ includeMembers?: true
26
+ organizationId?: string
27
+ onlyExplicitMembership?: boolean
28
+ }): Observable<SanityProject[]>
24
29
  list(options?: {
25
30
  includeMembers?: false
26
31
  organizationId?: string
32
+ onlyExplicitMembership?: boolean
27
33
  }): Observable<Omit<SanityProject, 'members'>[]>
28
34
  list(options?: {
29
35
  includeMembers?: boolean
30
36
  organizationId?: string
37
+ onlyExplicitMembership?: boolean
31
38
  }): Observable<SanityProject[] | Omit<SanityProject, 'members'>[]> {
32
39
  const query: Record<string, string> = {}
33
40
  const uri = '/projects'
@@ -37,6 +44,9 @@ export class ObservableProjectsClient {
37
44
  if (options?.organizationId) {
38
45
  query.organizationId = options.organizationId
39
46
  }
47
+ if (options?.onlyExplicitMembership === true) {
48
+ query.onlyExplicitMembership = 'true'
49
+ }
40
50
 
41
51
  return _request<SanityProject[]>(this.#client, this.#httpRequest, {uri, query})
42
52
  }
@@ -66,15 +76,22 @@ export class ProjectsClient {
66
76
  * @param options - Options for the list request
67
77
  * - `includeMembers` - Whether to include members in the response (default: true)
68
78
  * - `organizationId` - ID of the organization to fetch projects for
79
+ * - `onlyExplicitMembership` - Only include projects where the user has explicit membership (default: false)
69
80
  */
70
- list(options?: {includeMembers?: true; organizationId?: string}): Promise<SanityProject[]>
81
+ list(options?: {
82
+ includeMembers?: true
83
+ organizationId?: string
84
+ onlyExplicitMembership?: boolean
85
+ }): Promise<SanityProject[]>
71
86
  list(options?: {
72
87
  includeMembers?: false
73
88
  organizationId?: string
89
+ onlyExplicitMembership?: boolean
74
90
  }): Promise<Omit<SanityProject, 'members'>[]>
75
91
  list(options?: {
76
92
  includeMembers?: boolean
77
93
  organizationId?: string
94
+ onlyExplicitMembership?: boolean
78
95
  }): Promise<SanityProject[] | Omit<SanityProject, 'members'>[]> {
79
96
  const query: Record<string, string> = {}
80
97
  const uri = '/projects'
@@ -84,6 +101,9 @@ export class ProjectsClient {
84
101
  if (options?.organizationId) {
85
102
  query.organizationId = options.organizationId
86
103
  }
104
+ if (options?.onlyExplicitMembership === true) {
105
+ query.onlyExplicitMembership = 'true'
106
+ }
87
107
  return lastValueFrom(_request<SanityProject[]>(this.#client, this.#httpRequest, {uri, query}))
88
108
  }
89
109
 
@@ -1661,7 +1661,7 @@
1661
1661
  function timer(dueTime, intervalOrScheduler, scheduler) {
1662
1662
  if (scheduler === void 0) { scheduler = async; }
1663
1663
  return new Observable(function (subscriber) {
1664
- var due = isValidDate$1(dueTime) ? 1e3 - scheduler.now() : dueTime;
1664
+ var due = isValidDate$1(dueTime) ? +dueTime - scheduler.now() : dueTime;
1665
1665
  if (due < 0) {
1666
1666
  due = 0;
1667
1667
  }
@@ -1933,7 +1933,7 @@
1933
1933
  }
1934
1934
  function getVersionFromId$1(id) {
1935
1935
  if (!isVersionId$1(id)) return;
1936
- const [_versionPrefix, versionId, ..._publishedId] = id.split(PATH_SEPARATOR$1);
1936
+ const [_versionPrefix, versionId] = id.split(PATH_SEPARATOR$1);
1937
1937
  return versionId;
1938
1938
  }
1939
1939
  function getPublishedId$1(id) {
@@ -3726,7 +3726,7 @@ ${selectionOpts}`);
3726
3726
  }
3727
3727
  list(options) {
3728
3728
  const query = {}, uri = "/projects";
3729
- return options?.includeMembers === false && (query.includeMembers = "false"), options?.organizationId && (query.organizationId = options.organizationId), _request(this.#client, this.#httpRequest, { uri, query });
3729
+ return options?.includeMembers === false && (query.includeMembers = "false"), options?.organizationId && (query.organizationId = options.organizationId), options?.onlyExplicitMembership === true && (query.onlyExplicitMembership = "true"), _request(this.#client, this.#httpRequest, { uri, query });
3730
3730
  }
3731
3731
  /**
3732
3732
  * Fetch a project by project ID
@@ -3745,7 +3745,7 @@ ${selectionOpts}`);
3745
3745
  }
3746
3746
  list(options) {
3747
3747
  const query = {}, uri = "/projects";
3748
- return options?.includeMembers === false && (query.includeMembers = "false"), options?.organizationId && (query.organizationId = options.organizationId), lastValueFrom(_request(this.#client, this.#httpRequest, { uri, query }));
3748
+ return options?.includeMembers === false && (query.includeMembers = "false"), options?.organizationId && (query.organizationId = options.organizationId), options?.onlyExplicitMembership === true && (query.onlyExplicitMembership = "true"), lastValueFrom(_request(this.#client, this.#httpRequest, { uri, query }));
3749
3749
  }
3750
3750
  /**
3751
3751
  * Fetch a project by project ID
@@ -5035,7 +5035,7 @@ ${selectionOpts}`);
5035
5035
  }
5036
5036
  function getVersionFromId(id) {
5037
5037
  if (!isVersionId(id)) return;
5038
- const [_versionPrefix, versionId, ..._publishedId] = id.split(PATH_SEPARATOR);
5038
+ const [_versionPrefix, versionId] = id.split(PATH_SEPARATOR);
5039
5039
  return versionId;
5040
5040
  }
5041
5041
  function getPublishedId(id) {
@@ -5335,7 +5335,7 @@ ${selectionOpts}`);
5335
5335
  function requireEventsource () {
5336
5336
  if (hasRequiredEventsource) return eventsource$1.exports;
5337
5337
  hasRequiredEventsource = 1;
5338
- (function (module, exports) {
5338
+ (function (module, exports$1) {
5339
5339
  /*jslint indent: 2, vars: true, plusplus: true */
5340
5340
  /*global setTimeout, clearTimeout */
5341
5341
 
@@ -6362,13 +6362,13 @@ ${selectionOpts}`);
6362
6362
 
6363
6363
  (function (factory) {
6364
6364
  {
6365
- var v = factory(exports);
6365
+ var v = factory(exports$1);
6366
6366
  if (v !== undefined) module.exports = v;
6367
6367
  }
6368
- })(function (exports) {
6369
- exports.EventSourcePolyfill = EventSourcePolyfill;
6370
- exports.NativeEventSource = NativeEventSource;
6371
- exports.EventSource = R;
6368
+ })(function (exports$1) {
6369
+ exports$1.EventSourcePolyfill = EventSourcePolyfill;
6370
+ exports$1.NativeEventSource = NativeEventSource;
6371
+ exports$1.EventSource = R;
6372
6372
  });
6373
6373
  }(typeof globalThis === 'undefined' ? (typeof window !== 'undefined' ? window : typeof self !== 'undefined' ? self : eventsource) : globalThis));
6374
6374
  } (eventsource$1, eventsource$1.exports));