@sanity/client 7.16.0 → 7.18.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 (53) hide show
  1. package/README.md +46 -2
  2. package/dist/_chunks-cjs/config.cjs.map +1 -1
  3. package/dist/_chunks-cjs/isRecord.cjs.map +1 -1
  4. package/dist/_chunks-cjs/resolveEditInfo.cjs +1 -1
  5. package/dist/_chunks-cjs/resolveEditInfo.cjs.map +1 -1
  6. package/dist/_chunks-cjs/stegaClean.cjs +34 -12
  7. package/dist/_chunks-cjs/stegaClean.cjs.map +1 -1
  8. package/dist/_chunks-cjs/stegaEncodeSourceMap.cjs +3 -57
  9. package/dist/_chunks-cjs/stegaEncodeSourceMap.cjs.map +1 -1
  10. package/dist/_chunks-es/config.js.map +1 -1
  11. package/dist/_chunks-es/isRecord.js.map +1 -1
  12. package/dist/_chunks-es/resolveEditInfo.js +1 -1
  13. package/dist/_chunks-es/resolveEditInfo.js.map +1 -1
  14. package/dist/_chunks-es/stegaClean.js +35 -13
  15. package/dist/_chunks-es/stegaClean.js.map +1 -1
  16. package/dist/_chunks-es/stegaEncodeSourceMap.js +4 -58
  17. package/dist/_chunks-es/stegaEncodeSourceMap.js.map +1 -1
  18. package/dist/csm.cjs.map +1 -1
  19. package/dist/csm.js.map +1 -1
  20. package/dist/index.browser.cjs +2 -2
  21. package/dist/index.browser.cjs.map +1 -1
  22. package/dist/index.browser.d.cts +37 -2
  23. package/dist/index.browser.d.ts +37 -2
  24. package/dist/index.browser.js +3 -3
  25. package/dist/index.browser.js.map +1 -1
  26. package/dist/index.cjs +3 -3
  27. package/dist/index.cjs.map +1 -1
  28. package/dist/index.d.cts +37 -2
  29. package/dist/index.d.ts +37 -2
  30. package/dist/index.js +4 -4
  31. package/dist/index.js.map +1 -1
  32. package/dist/media-library.cjs.map +1 -1
  33. package/dist/media-library.d.cts +26 -1
  34. package/dist/media-library.d.ts +26 -1
  35. package/dist/media-library.js.map +1 -1
  36. package/dist/stega.browser.cjs.map +1 -1
  37. package/dist/stega.browser.d.cts +37 -2
  38. package/dist/stega.browser.d.ts +37 -2
  39. package/dist/stega.browser.js +1 -1
  40. package/dist/stega.browser.js.map +1 -1
  41. package/dist/stega.cjs.map +1 -1
  42. package/dist/stega.d.cts +37 -2
  43. package/dist/stega.d.ts +37 -2
  44. package/dist/stega.js +1 -1
  45. package/dist/stega.js.map +1 -1
  46. package/package.json +2 -2
  47. package/src/media-library.ts +2 -0
  48. package/src/projects/ProjectsClient.ts +22 -2
  49. package/src/stega/stegaEncodeSourceMap.ts +4 -3
  50. package/src/types.ts +26 -1
  51. package/umd/sanityClient.js +55 -88
  52. package/umd/sanityClient.min.js +2 -2
  53. package/src/stega/stega.ts +0 -163
@@ -2699,11 +2699,17 @@ export declare class ObservableProjectsClient {
2699
2699
  * @param options - Options for the list request
2700
2700
  * - `includeMembers` - Whether to include members in the response (default: true)
2701
2701
  * - `organizationId` - ID of the organization to fetch projects for
2702
+ * - `onlyExplicitMembership` - Only include projects where the user has explicit membership (default: false)
2702
2703
  */
2703
- list(options?: {includeMembers?: true; organizationId?: string}): Observable<SanityProject[]>
2704
+ list(options?: {
2705
+ includeMembers?: true
2706
+ organizationId?: string
2707
+ onlyExplicitMembership?: boolean
2708
+ }): Observable<SanityProject[]>
2704
2709
  list(options?: {
2705
2710
  includeMembers?: false
2706
2711
  organizationId?: string
2712
+ onlyExplicitMembership?: boolean
2707
2713
  }): Observable<Omit<SanityProject, 'members'>[]>
2708
2714
  /**
2709
2715
  * Fetch a project by project ID
@@ -4076,11 +4082,17 @@ export declare class ProjectsClient {
4076
4082
  * @param options - Options for the list request
4077
4083
  * - `includeMembers` - Whether to include members in the response (default: true)
4078
4084
  * - `organizationId` - ID of the organization to fetch projects for
4085
+ * - `onlyExplicitMembership` - Only include projects where the user has explicit membership (default: false)
4079
4086
  */
4080
- list(options?: {includeMembers?: true; organizationId?: string}): Promise<SanityProject[]>
4087
+ list(options?: {
4088
+ includeMembers?: true
4089
+ organizationId?: string
4090
+ onlyExplicitMembership?: boolean
4091
+ }): Promise<SanityProject[]>
4081
4092
  list(options?: {
4082
4093
  includeMembers?: false
4083
4094
  organizationId?: string
4095
+ onlyExplicitMembership?: boolean
4084
4096
  }): Promise<Omit<SanityProject, 'members'>[]>
4085
4097
  /**
4086
4098
  * Fetch a project by project ID
@@ -6549,6 +6561,9 @@ export declare type VersionAction =
6549
6561
  /** @public */
6550
6562
  export declare interface VideoPlaybackInfo<
6551
6563
  T extends VideoPlaybackInfoItem = VideoPlaybackInfoItem,
6564
+ R extends VideoRenditionInfo = T extends VideoPlaybackInfoItemSigned
6565
+ ? VideoRenditionInfoSigned
6566
+ : VideoRenditionInfo,
6552
6567
  > {
6553
6568
  id: string
6554
6569
  thumbnail: T
@@ -6557,6 +6572,7 @@ export declare interface VideoPlaybackInfo<
6557
6572
  stream: T
6558
6573
  duration: number
6559
6574
  aspectRatio: number
6575
+ renditions?: R[]
6560
6576
  }
6561
6577
 
6562
6578
  /** @public */
@@ -6588,6 +6604,25 @@ export declare interface VideoPlaybackTokens {
6588
6604
  animated?: string
6589
6605
  }
6590
6606
 
6607
+ /** @public */
6608
+ export declare type VideoRenditionInfo = VideoRenditionInfoPublic | VideoRenditionInfoSigned
6609
+
6610
+ /** @public */
6611
+ export declare interface VideoRenditionInfoPublic {
6612
+ /** URL to the MP4 rendition (redirects to CDN) */
6613
+ url: string
6614
+ /** Resolution identifier, e.g. "1080p", "480p", "270p" */
6615
+ resolution: '1080p' | '480p' | '270p' | (string & {})
6616
+ }
6617
+
6618
+ /** @public */
6619
+ export declare interface VideoRenditionInfoSigned extends VideoRenditionInfoPublic {
6620
+ /** Authentication token for signed playback */
6621
+ token: string
6622
+ /** Token expiration time in ISO 8601 format */
6623
+ expiresAt: string
6624
+ }
6625
+
6591
6626
  /**
6592
6627
  * Emitted when the listener reconnects and successfully resumes from
6593
6628
  * its previous position.
@@ -2699,11 +2699,17 @@ export declare class ObservableProjectsClient {
2699
2699
  * @param options - Options for the list request
2700
2700
  * - `includeMembers` - Whether to include members in the response (default: true)
2701
2701
  * - `organizationId` - ID of the organization to fetch projects for
2702
+ * - `onlyExplicitMembership` - Only include projects where the user has explicit membership (default: false)
2702
2703
  */
2703
- list(options?: {includeMembers?: true; organizationId?: string}): Observable<SanityProject[]>
2704
+ list(options?: {
2705
+ includeMembers?: true
2706
+ organizationId?: string
2707
+ onlyExplicitMembership?: boolean
2708
+ }): Observable<SanityProject[]>
2704
2709
  list(options?: {
2705
2710
  includeMembers?: false
2706
2711
  organizationId?: string
2712
+ onlyExplicitMembership?: boolean
2707
2713
  }): Observable<Omit<SanityProject, 'members'>[]>
2708
2714
  /**
2709
2715
  * Fetch a project by project ID
@@ -4076,11 +4082,17 @@ export declare class ProjectsClient {
4076
4082
  * @param options - Options for the list request
4077
4083
  * - `includeMembers` - Whether to include members in the response (default: true)
4078
4084
  * - `organizationId` - ID of the organization to fetch projects for
4085
+ * - `onlyExplicitMembership` - Only include projects where the user has explicit membership (default: false)
4079
4086
  */
4080
- list(options?: {includeMembers?: true; organizationId?: string}): Promise<SanityProject[]>
4087
+ list(options?: {
4088
+ includeMembers?: true
4089
+ organizationId?: string
4090
+ onlyExplicitMembership?: boolean
4091
+ }): Promise<SanityProject[]>
4081
4092
  list(options?: {
4082
4093
  includeMembers?: false
4083
4094
  organizationId?: string
4095
+ onlyExplicitMembership?: boolean
4084
4096
  }): Promise<Omit<SanityProject, 'members'>[]>
4085
4097
  /**
4086
4098
  * Fetch a project by project ID
@@ -6549,6 +6561,9 @@ export declare type VersionAction =
6549
6561
  /** @public */
6550
6562
  export declare interface VideoPlaybackInfo<
6551
6563
  T extends VideoPlaybackInfoItem = VideoPlaybackInfoItem,
6564
+ R extends VideoRenditionInfo = T extends VideoPlaybackInfoItemSigned
6565
+ ? VideoRenditionInfoSigned
6566
+ : VideoRenditionInfo,
6552
6567
  > {
6553
6568
  id: string
6554
6569
  thumbnail: T
@@ -6557,6 +6572,7 @@ export declare interface VideoPlaybackInfo<
6557
6572
  stream: T
6558
6573
  duration: number
6559
6574
  aspectRatio: number
6575
+ renditions?: R[]
6560
6576
  }
6561
6577
 
6562
6578
  /** @public */
@@ -6588,6 +6604,25 @@ export declare interface VideoPlaybackTokens {
6588
6604
  animated?: string
6589
6605
  }
6590
6606
 
6607
+ /** @public */
6608
+ export declare type VideoRenditionInfo = VideoRenditionInfoPublic | VideoRenditionInfoSigned
6609
+
6610
+ /** @public */
6611
+ export declare interface VideoRenditionInfoPublic {
6612
+ /** URL to the MP4 rendition (redirects to CDN) */
6613
+ url: string
6614
+ /** Resolution identifier, e.g. "1080p", "480p", "270p" */
6615
+ resolution: '1080p' | '480p' | '270p' | (string & {})
6616
+ }
6617
+
6618
+ /** @public */
6619
+ export declare interface VideoRenditionInfoSigned extends VideoRenditionInfoPublic {
6620
+ /** Authentication token for signed playback */
6621
+ token: string
6622
+ /** Token expiration time in ISO 8601 format */
6623
+ expiresAt: string
6624
+ }
6625
+
6591
6626
  /**
6592
6627
  * Emitted when the listener reconnects and successfully resumes from
6593
6628
  * its previous position.
@@ -1,7 +1,7 @@
1
1
  import { getIt } from "get-it";
2
2
  import { adapter, environment } from "get-it";
3
3
  import { retry, jsonRequest, jsonResponse, progress, observable } from "get-it/middleware";
4
- import { Observable, defer, of, isObservable, mergeMap, from, lastValueFrom, shareReplay, catchError, concat, throwError, timer, tap, finalize, share, merge, map as map$1, firstValueFrom } from "rxjs";
4
+ import { Observable, defer, isObservable, of, mergeMap, from, lastValueFrom, shareReplay, catchError, concat, timer, throwError, tap, finalize, share, merge, map as map$1, firstValueFrom } from "rxjs";
5
5
  import { isRecord, stegaClean } from "./_chunks-es/stegaClean.js";
6
6
  import { combineLatestWith, map, filter, finalize as finalize$1 } from "rxjs/operators";
7
7
  import { getVersionFromId, isDraftId, getVersionId, getDraftId, isVersionId, getPublishedId } from "@sanity/client/csm";
@@ -1773,7 +1773,7 @@ class ObservableProjectsClient {
1773
1773
  }
1774
1774
  list(options) {
1775
1775
  const query = {}, uri = "/projects";
1776
- return options?.includeMembers === !1 && (query.includeMembers = "false"), options?.organizationId && (query.organizationId = options.organizationId), _request(this.#client, this.#httpRequest, { uri, query });
1776
+ return options?.includeMembers === !1 && (query.includeMembers = "false"), options?.organizationId && (query.organizationId = options.organizationId), options?.onlyExplicitMembership === !0 && (query.onlyExplicitMembership = "true"), _request(this.#client, this.#httpRequest, { uri, query });
1777
1777
  }
1778
1778
  /**
1779
1779
  * Fetch a project by project ID
@@ -1792,7 +1792,7 @@ class ProjectsClient {
1792
1792
  }
1793
1793
  list(options) {
1794
1794
  const query = {}, uri = "/projects";
1795
- return options?.includeMembers === !1 && (query.includeMembers = "false"), options?.organizationId && (query.organizationId = options.organizationId), lastValueFrom(_request(this.#client, this.#httpRequest, { uri, query }));
1795
+ return options?.includeMembers === !1 && (query.includeMembers = "false"), options?.organizationId && (query.organizationId = options.organizationId), options?.onlyExplicitMembership === !0 && (query.onlyExplicitMembership = "true"), lastValueFrom(_request(this.#client, this.#httpRequest, { uri, query }));
1796
1796
  }
1797
1797
  /**
1798
1798
  * Fetch a project by project ID