@sanity/client 7.17.0 → 7.19.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.
- package/README.md +46 -2
- package/dist/_chunks-cjs/stegaClean.cjs +34 -12
- package/dist/_chunks-cjs/stegaClean.cjs.map +1 -1
- package/dist/_chunks-cjs/stegaEncodeSourceMap.cjs +2 -56
- package/dist/_chunks-cjs/stegaEncodeSourceMap.cjs.map +1 -1
- package/dist/_chunks-es/stegaClean.js +35 -13
- package/dist/_chunks-es/stegaClean.js.map +1 -1
- package/dist/_chunks-es/stegaEncodeSourceMap.js +3 -57
- package/dist/_chunks-es/stegaEncodeSourceMap.js.map +1 -1
- package/dist/index.browser.cjs.map +1 -1
- package/dist/index.browser.d.cts +50 -0
- package/dist/index.browser.d.ts +50 -0
- package/dist/index.browser.js.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +50 -0
- package/dist/index.d.ts +50 -0
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/media-library.cjs.map +1 -1
- package/dist/media-library.d.cts +53 -1
- package/dist/media-library.d.ts +53 -1
- package/dist/media-library.js.map +1 -1
- package/dist/stega.browser.d.cts +50 -0
- package/dist/stega.browser.d.ts +50 -0
- package/dist/stega.d.cts +50 -0
- package/dist/stega.d.ts +50 -0
- package/package.json +2 -2
- package/src/media-library.ts +3 -0
- package/src/stega/stegaEncodeSourceMap.ts +4 -3
- package/src/types.ts +53 -1
- package/umd/sanityClient.js +44 -77
- package/umd/sanityClient.min.js +2 -2
- package/src/stega/stega.ts +0 -163
|
@@ -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":";;
|
|
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\nexport type {VideoRenditionInfo, VideoRenditionInfoPublic, VideoRenditionInfoSigned} from './types'\nexport type {VideoSubtitleInfo, VideoSubtitleInfoPublic, VideoSubtitleInfoSigned} 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":";;AAeA,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;;;"}
|
package/dist/media-library.d.cts
CHANGED
|
@@ -28,7 +28,15 @@ export declare function isSignedPlaybackInfo(
|
|
|
28
28
|
): playbackInfo is VideoPlaybackInfoSigned
|
|
29
29
|
|
|
30
30
|
/** @public */
|
|
31
|
-
declare interface VideoPlaybackInfo<
|
|
31
|
+
declare interface VideoPlaybackInfo<
|
|
32
|
+
T extends VideoPlaybackInfoItem = VideoPlaybackInfoItem,
|
|
33
|
+
R extends VideoRenditionInfo = T extends VideoPlaybackInfoItemSigned
|
|
34
|
+
? VideoRenditionInfoSigned
|
|
35
|
+
: VideoRenditionInfo,
|
|
36
|
+
S extends VideoSubtitleInfo = T extends VideoPlaybackInfoItemSigned
|
|
37
|
+
? VideoSubtitleInfoSigned
|
|
38
|
+
: VideoSubtitleInfo,
|
|
39
|
+
> {
|
|
32
40
|
id: string
|
|
33
41
|
thumbnail: T
|
|
34
42
|
animated: T
|
|
@@ -36,6 +44,8 @@ declare interface VideoPlaybackInfo<T extends VideoPlaybackInfoItem = VideoPlayb
|
|
|
36
44
|
stream: T
|
|
37
45
|
duration: number
|
|
38
46
|
aspectRatio: number
|
|
47
|
+
renditions?: R[]
|
|
48
|
+
subtitles?: S[]
|
|
39
49
|
}
|
|
40
50
|
|
|
41
51
|
/** @public */
|
|
@@ -62,4 +72,46 @@ declare interface VideoPlaybackTokens {
|
|
|
62
72
|
animated?: string
|
|
63
73
|
}
|
|
64
74
|
|
|
75
|
+
/** @public */
|
|
76
|
+
export declare type VideoRenditionInfo = VideoRenditionInfoPublic | VideoRenditionInfoSigned
|
|
77
|
+
|
|
78
|
+
/** @public */
|
|
79
|
+
export declare interface VideoRenditionInfoPublic {
|
|
80
|
+
/** URL to the MP4 rendition (redirects to CDN) */
|
|
81
|
+
url: string
|
|
82
|
+
/** Resolution identifier, e.g. "1080p", "480p", "270p" */
|
|
83
|
+
resolution: '1080p' | '480p' | '270p' | (string & {})
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/** @public */
|
|
87
|
+
export declare interface VideoRenditionInfoSigned extends VideoRenditionInfoPublic {
|
|
88
|
+
/** Authentication token for signed playback */
|
|
89
|
+
token: string
|
|
90
|
+
/** Token expiration time in ISO 8601 format */
|
|
91
|
+
expiresAt: string
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/** @public */
|
|
95
|
+
export declare type VideoSubtitleInfo = VideoSubtitleInfoPublic | VideoSubtitleInfoSigned
|
|
96
|
+
|
|
97
|
+
/** @public */
|
|
98
|
+
export declare interface VideoSubtitleInfoPublic {
|
|
99
|
+
/** Subtitle track identifier */
|
|
100
|
+
trackId: string
|
|
101
|
+
/** ISO 639-1 language code */
|
|
102
|
+
languageCode: string
|
|
103
|
+
/** URL to the subtitle file */
|
|
104
|
+
url: string
|
|
105
|
+
/** Whether this track contains closed captions */
|
|
106
|
+
closedCaptions: boolean
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/** @public */
|
|
110
|
+
export declare interface VideoSubtitleInfoSigned extends VideoSubtitleInfoPublic {
|
|
111
|
+
/** Authentication token for signed playback */
|
|
112
|
+
token: string
|
|
113
|
+
/** Token expiration time in ISO 8601 format */
|
|
114
|
+
expiresAt: string
|
|
115
|
+
}
|
|
116
|
+
|
|
65
117
|
export {}
|
package/dist/media-library.d.ts
CHANGED
|
@@ -28,7 +28,15 @@ export declare function isSignedPlaybackInfo(
|
|
|
28
28
|
): playbackInfo is VideoPlaybackInfoSigned
|
|
29
29
|
|
|
30
30
|
/** @public */
|
|
31
|
-
declare interface VideoPlaybackInfo<
|
|
31
|
+
declare interface VideoPlaybackInfo<
|
|
32
|
+
T extends VideoPlaybackInfoItem = VideoPlaybackInfoItem,
|
|
33
|
+
R extends VideoRenditionInfo = T extends VideoPlaybackInfoItemSigned
|
|
34
|
+
? VideoRenditionInfoSigned
|
|
35
|
+
: VideoRenditionInfo,
|
|
36
|
+
S extends VideoSubtitleInfo = T extends VideoPlaybackInfoItemSigned
|
|
37
|
+
? VideoSubtitleInfoSigned
|
|
38
|
+
: VideoSubtitleInfo,
|
|
39
|
+
> {
|
|
32
40
|
id: string
|
|
33
41
|
thumbnail: T
|
|
34
42
|
animated: T
|
|
@@ -36,6 +44,8 @@ declare interface VideoPlaybackInfo<T extends VideoPlaybackInfoItem = VideoPlayb
|
|
|
36
44
|
stream: T
|
|
37
45
|
duration: number
|
|
38
46
|
aspectRatio: number
|
|
47
|
+
renditions?: R[]
|
|
48
|
+
subtitles?: S[]
|
|
39
49
|
}
|
|
40
50
|
|
|
41
51
|
/** @public */
|
|
@@ -62,4 +72,46 @@ declare interface VideoPlaybackTokens {
|
|
|
62
72
|
animated?: string
|
|
63
73
|
}
|
|
64
74
|
|
|
75
|
+
/** @public */
|
|
76
|
+
export declare type VideoRenditionInfo = VideoRenditionInfoPublic | VideoRenditionInfoSigned
|
|
77
|
+
|
|
78
|
+
/** @public */
|
|
79
|
+
export declare interface VideoRenditionInfoPublic {
|
|
80
|
+
/** URL to the MP4 rendition (redirects to CDN) */
|
|
81
|
+
url: string
|
|
82
|
+
/** Resolution identifier, e.g. "1080p", "480p", "270p" */
|
|
83
|
+
resolution: '1080p' | '480p' | '270p' | (string & {})
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/** @public */
|
|
87
|
+
export declare interface VideoRenditionInfoSigned extends VideoRenditionInfoPublic {
|
|
88
|
+
/** Authentication token for signed playback */
|
|
89
|
+
token: string
|
|
90
|
+
/** Token expiration time in ISO 8601 format */
|
|
91
|
+
expiresAt: string
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/** @public */
|
|
95
|
+
export declare type VideoSubtitleInfo = VideoSubtitleInfoPublic | VideoSubtitleInfoSigned
|
|
96
|
+
|
|
97
|
+
/** @public */
|
|
98
|
+
export declare interface VideoSubtitleInfoPublic {
|
|
99
|
+
/** Subtitle track identifier */
|
|
100
|
+
trackId: string
|
|
101
|
+
/** ISO 639-1 language code */
|
|
102
|
+
languageCode: string
|
|
103
|
+
/** URL to the subtitle file */
|
|
104
|
+
url: string
|
|
105
|
+
/** Whether this track contains closed captions */
|
|
106
|
+
closedCaptions: boolean
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/** @public */
|
|
110
|
+
export declare interface VideoSubtitleInfoSigned extends VideoSubtitleInfoPublic {
|
|
111
|
+
/** Authentication token for signed playback */
|
|
112
|
+
token: string
|
|
113
|
+
/** Token expiration time in ISO 8601 format */
|
|
114
|
+
expiresAt: string
|
|
115
|
+
}
|
|
116
|
+
|
|
65
117
|
export {}
|
|
@@ -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":"
|
|
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\nexport type {VideoRenditionInfo, VideoRenditionInfoPublic, VideoRenditionInfoSigned} from './types'\nexport type {VideoSubtitleInfo, VideoSubtitleInfoPublic, VideoSubtitleInfoSigned} 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":"AAeA,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;"}
|
package/dist/stega.browser.d.cts
CHANGED
|
@@ -6811,6 +6811,12 @@ export declare type VersionAction =
|
|
|
6811
6811
|
/** @public */
|
|
6812
6812
|
export declare interface VideoPlaybackInfo<
|
|
6813
6813
|
T extends VideoPlaybackInfoItem = VideoPlaybackInfoItem,
|
|
6814
|
+
R extends VideoRenditionInfo = T extends VideoPlaybackInfoItemSigned
|
|
6815
|
+
? VideoRenditionInfoSigned
|
|
6816
|
+
: VideoRenditionInfo,
|
|
6817
|
+
S extends VideoSubtitleInfo = T extends VideoPlaybackInfoItemSigned
|
|
6818
|
+
? VideoSubtitleInfoSigned
|
|
6819
|
+
: VideoSubtitleInfo,
|
|
6814
6820
|
> {
|
|
6815
6821
|
id: string
|
|
6816
6822
|
thumbnail: T
|
|
@@ -6819,6 +6825,8 @@ export declare interface VideoPlaybackInfo<
|
|
|
6819
6825
|
stream: T
|
|
6820
6826
|
duration: number
|
|
6821
6827
|
aspectRatio: number
|
|
6828
|
+
renditions?: R[]
|
|
6829
|
+
subtitles?: S[]
|
|
6822
6830
|
}
|
|
6823
6831
|
|
|
6824
6832
|
/** @public */
|
|
@@ -6850,6 +6858,48 @@ export declare interface VideoPlaybackTokens {
|
|
|
6850
6858
|
animated?: string
|
|
6851
6859
|
}
|
|
6852
6860
|
|
|
6861
|
+
/** @public */
|
|
6862
|
+
export declare type VideoRenditionInfo = VideoRenditionInfoPublic | VideoRenditionInfoSigned
|
|
6863
|
+
|
|
6864
|
+
/** @public */
|
|
6865
|
+
export declare interface VideoRenditionInfoPublic {
|
|
6866
|
+
/** URL to the MP4 rendition (redirects to CDN) */
|
|
6867
|
+
url: string
|
|
6868
|
+
/** Resolution identifier, e.g. "1080p", "480p", "270p" */
|
|
6869
|
+
resolution: '1080p' | '480p' | '270p' | (string & {})
|
|
6870
|
+
}
|
|
6871
|
+
|
|
6872
|
+
/** @public */
|
|
6873
|
+
export declare interface VideoRenditionInfoSigned extends VideoRenditionInfoPublic {
|
|
6874
|
+
/** Authentication token for signed playback */
|
|
6875
|
+
token: string
|
|
6876
|
+
/** Token expiration time in ISO 8601 format */
|
|
6877
|
+
expiresAt: string
|
|
6878
|
+
}
|
|
6879
|
+
|
|
6880
|
+
/** @public */
|
|
6881
|
+
export declare type VideoSubtitleInfo = VideoSubtitleInfoPublic | VideoSubtitleInfoSigned
|
|
6882
|
+
|
|
6883
|
+
/** @public */
|
|
6884
|
+
export declare interface VideoSubtitleInfoPublic {
|
|
6885
|
+
/** Subtitle track identifier */
|
|
6886
|
+
trackId: string
|
|
6887
|
+
/** ISO 639-1 language code */
|
|
6888
|
+
languageCode: string
|
|
6889
|
+
/** URL to the subtitle file */
|
|
6890
|
+
url: string
|
|
6891
|
+
/** Whether this track contains closed captions */
|
|
6892
|
+
closedCaptions: boolean
|
|
6893
|
+
}
|
|
6894
|
+
|
|
6895
|
+
/** @public */
|
|
6896
|
+
export declare interface VideoSubtitleInfoSigned extends VideoSubtitleInfoPublic {
|
|
6897
|
+
/** Authentication token for signed playback */
|
|
6898
|
+
token: string
|
|
6899
|
+
/** Token expiration time in ISO 8601 format */
|
|
6900
|
+
expiresAt: string
|
|
6901
|
+
}
|
|
6902
|
+
|
|
6853
6903
|
/**
|
|
6854
6904
|
* Emitted when the listener reconnects and successfully resumes from
|
|
6855
6905
|
* its previous position.
|
package/dist/stega.browser.d.ts
CHANGED
|
@@ -6811,6 +6811,12 @@ export declare type VersionAction =
|
|
|
6811
6811
|
/** @public */
|
|
6812
6812
|
export declare interface VideoPlaybackInfo<
|
|
6813
6813
|
T extends VideoPlaybackInfoItem = VideoPlaybackInfoItem,
|
|
6814
|
+
R extends VideoRenditionInfo = T extends VideoPlaybackInfoItemSigned
|
|
6815
|
+
? VideoRenditionInfoSigned
|
|
6816
|
+
: VideoRenditionInfo,
|
|
6817
|
+
S extends VideoSubtitleInfo = T extends VideoPlaybackInfoItemSigned
|
|
6818
|
+
? VideoSubtitleInfoSigned
|
|
6819
|
+
: VideoSubtitleInfo,
|
|
6814
6820
|
> {
|
|
6815
6821
|
id: string
|
|
6816
6822
|
thumbnail: T
|
|
@@ -6819,6 +6825,8 @@ export declare interface VideoPlaybackInfo<
|
|
|
6819
6825
|
stream: T
|
|
6820
6826
|
duration: number
|
|
6821
6827
|
aspectRatio: number
|
|
6828
|
+
renditions?: R[]
|
|
6829
|
+
subtitles?: S[]
|
|
6822
6830
|
}
|
|
6823
6831
|
|
|
6824
6832
|
/** @public */
|
|
@@ -6850,6 +6858,48 @@ export declare interface VideoPlaybackTokens {
|
|
|
6850
6858
|
animated?: string
|
|
6851
6859
|
}
|
|
6852
6860
|
|
|
6861
|
+
/** @public */
|
|
6862
|
+
export declare type VideoRenditionInfo = VideoRenditionInfoPublic | VideoRenditionInfoSigned
|
|
6863
|
+
|
|
6864
|
+
/** @public */
|
|
6865
|
+
export declare interface VideoRenditionInfoPublic {
|
|
6866
|
+
/** URL to the MP4 rendition (redirects to CDN) */
|
|
6867
|
+
url: string
|
|
6868
|
+
/** Resolution identifier, e.g. "1080p", "480p", "270p" */
|
|
6869
|
+
resolution: '1080p' | '480p' | '270p' | (string & {})
|
|
6870
|
+
}
|
|
6871
|
+
|
|
6872
|
+
/** @public */
|
|
6873
|
+
export declare interface VideoRenditionInfoSigned extends VideoRenditionInfoPublic {
|
|
6874
|
+
/** Authentication token for signed playback */
|
|
6875
|
+
token: string
|
|
6876
|
+
/** Token expiration time in ISO 8601 format */
|
|
6877
|
+
expiresAt: string
|
|
6878
|
+
}
|
|
6879
|
+
|
|
6880
|
+
/** @public */
|
|
6881
|
+
export declare type VideoSubtitleInfo = VideoSubtitleInfoPublic | VideoSubtitleInfoSigned
|
|
6882
|
+
|
|
6883
|
+
/** @public */
|
|
6884
|
+
export declare interface VideoSubtitleInfoPublic {
|
|
6885
|
+
/** Subtitle track identifier */
|
|
6886
|
+
trackId: string
|
|
6887
|
+
/** ISO 639-1 language code */
|
|
6888
|
+
languageCode: string
|
|
6889
|
+
/** URL to the subtitle file */
|
|
6890
|
+
url: string
|
|
6891
|
+
/** Whether this track contains closed captions */
|
|
6892
|
+
closedCaptions: boolean
|
|
6893
|
+
}
|
|
6894
|
+
|
|
6895
|
+
/** @public */
|
|
6896
|
+
export declare interface VideoSubtitleInfoSigned extends VideoSubtitleInfoPublic {
|
|
6897
|
+
/** Authentication token for signed playback */
|
|
6898
|
+
token: string
|
|
6899
|
+
/** Token expiration time in ISO 8601 format */
|
|
6900
|
+
expiresAt: string
|
|
6901
|
+
}
|
|
6902
|
+
|
|
6853
6903
|
/**
|
|
6854
6904
|
* Emitted when the listener reconnects and successfully resumes from
|
|
6855
6905
|
* its previous position.
|
package/dist/stega.d.cts
CHANGED
|
@@ -6811,6 +6811,12 @@ export declare type VersionAction =
|
|
|
6811
6811
|
/** @public */
|
|
6812
6812
|
export declare interface VideoPlaybackInfo<
|
|
6813
6813
|
T extends VideoPlaybackInfoItem = VideoPlaybackInfoItem,
|
|
6814
|
+
R extends VideoRenditionInfo = T extends VideoPlaybackInfoItemSigned
|
|
6815
|
+
? VideoRenditionInfoSigned
|
|
6816
|
+
: VideoRenditionInfo,
|
|
6817
|
+
S extends VideoSubtitleInfo = T extends VideoPlaybackInfoItemSigned
|
|
6818
|
+
? VideoSubtitleInfoSigned
|
|
6819
|
+
: VideoSubtitleInfo,
|
|
6814
6820
|
> {
|
|
6815
6821
|
id: string
|
|
6816
6822
|
thumbnail: T
|
|
@@ -6819,6 +6825,8 @@ export declare interface VideoPlaybackInfo<
|
|
|
6819
6825
|
stream: T
|
|
6820
6826
|
duration: number
|
|
6821
6827
|
aspectRatio: number
|
|
6828
|
+
renditions?: R[]
|
|
6829
|
+
subtitles?: S[]
|
|
6822
6830
|
}
|
|
6823
6831
|
|
|
6824
6832
|
/** @public */
|
|
@@ -6850,6 +6858,48 @@ export declare interface VideoPlaybackTokens {
|
|
|
6850
6858
|
animated?: string
|
|
6851
6859
|
}
|
|
6852
6860
|
|
|
6861
|
+
/** @public */
|
|
6862
|
+
export declare type VideoRenditionInfo = VideoRenditionInfoPublic | VideoRenditionInfoSigned
|
|
6863
|
+
|
|
6864
|
+
/** @public */
|
|
6865
|
+
export declare interface VideoRenditionInfoPublic {
|
|
6866
|
+
/** URL to the MP4 rendition (redirects to CDN) */
|
|
6867
|
+
url: string
|
|
6868
|
+
/** Resolution identifier, e.g. "1080p", "480p", "270p" */
|
|
6869
|
+
resolution: '1080p' | '480p' | '270p' | (string & {})
|
|
6870
|
+
}
|
|
6871
|
+
|
|
6872
|
+
/** @public */
|
|
6873
|
+
export declare interface VideoRenditionInfoSigned extends VideoRenditionInfoPublic {
|
|
6874
|
+
/** Authentication token for signed playback */
|
|
6875
|
+
token: string
|
|
6876
|
+
/** Token expiration time in ISO 8601 format */
|
|
6877
|
+
expiresAt: string
|
|
6878
|
+
}
|
|
6879
|
+
|
|
6880
|
+
/** @public */
|
|
6881
|
+
export declare type VideoSubtitleInfo = VideoSubtitleInfoPublic | VideoSubtitleInfoSigned
|
|
6882
|
+
|
|
6883
|
+
/** @public */
|
|
6884
|
+
export declare interface VideoSubtitleInfoPublic {
|
|
6885
|
+
/** Subtitle track identifier */
|
|
6886
|
+
trackId: string
|
|
6887
|
+
/** ISO 639-1 language code */
|
|
6888
|
+
languageCode: string
|
|
6889
|
+
/** URL to the subtitle file */
|
|
6890
|
+
url: string
|
|
6891
|
+
/** Whether this track contains closed captions */
|
|
6892
|
+
closedCaptions: boolean
|
|
6893
|
+
}
|
|
6894
|
+
|
|
6895
|
+
/** @public */
|
|
6896
|
+
export declare interface VideoSubtitleInfoSigned extends VideoSubtitleInfoPublic {
|
|
6897
|
+
/** Authentication token for signed playback */
|
|
6898
|
+
token: string
|
|
6899
|
+
/** Token expiration time in ISO 8601 format */
|
|
6900
|
+
expiresAt: string
|
|
6901
|
+
}
|
|
6902
|
+
|
|
6853
6903
|
/**
|
|
6854
6904
|
* Emitted when the listener reconnects and successfully resumes from
|
|
6855
6905
|
* its previous position.
|
package/dist/stega.d.ts
CHANGED
|
@@ -6811,6 +6811,12 @@ export declare type VersionAction =
|
|
|
6811
6811
|
/** @public */
|
|
6812
6812
|
export declare interface VideoPlaybackInfo<
|
|
6813
6813
|
T extends VideoPlaybackInfoItem = VideoPlaybackInfoItem,
|
|
6814
|
+
R extends VideoRenditionInfo = T extends VideoPlaybackInfoItemSigned
|
|
6815
|
+
? VideoRenditionInfoSigned
|
|
6816
|
+
: VideoRenditionInfo,
|
|
6817
|
+
S extends VideoSubtitleInfo = T extends VideoPlaybackInfoItemSigned
|
|
6818
|
+
? VideoSubtitleInfoSigned
|
|
6819
|
+
: VideoSubtitleInfo,
|
|
6814
6820
|
> {
|
|
6815
6821
|
id: string
|
|
6816
6822
|
thumbnail: T
|
|
@@ -6819,6 +6825,8 @@ export declare interface VideoPlaybackInfo<
|
|
|
6819
6825
|
stream: T
|
|
6820
6826
|
duration: number
|
|
6821
6827
|
aspectRatio: number
|
|
6828
|
+
renditions?: R[]
|
|
6829
|
+
subtitles?: S[]
|
|
6822
6830
|
}
|
|
6823
6831
|
|
|
6824
6832
|
/** @public */
|
|
@@ -6850,6 +6858,48 @@ export declare interface VideoPlaybackTokens {
|
|
|
6850
6858
|
animated?: string
|
|
6851
6859
|
}
|
|
6852
6860
|
|
|
6861
|
+
/** @public */
|
|
6862
|
+
export declare type VideoRenditionInfo = VideoRenditionInfoPublic | VideoRenditionInfoSigned
|
|
6863
|
+
|
|
6864
|
+
/** @public */
|
|
6865
|
+
export declare interface VideoRenditionInfoPublic {
|
|
6866
|
+
/** URL to the MP4 rendition (redirects to CDN) */
|
|
6867
|
+
url: string
|
|
6868
|
+
/** Resolution identifier, e.g. "1080p", "480p", "270p" */
|
|
6869
|
+
resolution: '1080p' | '480p' | '270p' | (string & {})
|
|
6870
|
+
}
|
|
6871
|
+
|
|
6872
|
+
/** @public */
|
|
6873
|
+
export declare interface VideoRenditionInfoSigned extends VideoRenditionInfoPublic {
|
|
6874
|
+
/** Authentication token for signed playback */
|
|
6875
|
+
token: string
|
|
6876
|
+
/** Token expiration time in ISO 8601 format */
|
|
6877
|
+
expiresAt: string
|
|
6878
|
+
}
|
|
6879
|
+
|
|
6880
|
+
/** @public */
|
|
6881
|
+
export declare type VideoSubtitleInfo = VideoSubtitleInfoPublic | VideoSubtitleInfoSigned
|
|
6882
|
+
|
|
6883
|
+
/** @public */
|
|
6884
|
+
export declare interface VideoSubtitleInfoPublic {
|
|
6885
|
+
/** Subtitle track identifier */
|
|
6886
|
+
trackId: string
|
|
6887
|
+
/** ISO 639-1 language code */
|
|
6888
|
+
languageCode: string
|
|
6889
|
+
/** URL to the subtitle file */
|
|
6890
|
+
url: string
|
|
6891
|
+
/** Whether this track contains closed captions */
|
|
6892
|
+
closedCaptions: boolean
|
|
6893
|
+
}
|
|
6894
|
+
|
|
6895
|
+
/** @public */
|
|
6896
|
+
export declare interface VideoSubtitleInfoSigned extends VideoSubtitleInfoPublic {
|
|
6897
|
+
/** Authentication token for signed playback */
|
|
6898
|
+
token: string
|
|
6899
|
+
/** Token expiration time in ISO 8601 format */
|
|
6900
|
+
expiresAt: string
|
|
6901
|
+
}
|
|
6902
|
+
|
|
6853
6903
|
/**
|
|
6854
6904
|
* Emitted when the listener reconnects and successfully resumes from
|
|
6855
6905
|
* its previous position.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sanity/client",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.19.0",
|
|
4
4
|
"description": "Client for retrieving, creating and patching data from Sanity.io",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"sanity",
|
|
@@ -147,7 +147,7 @@
|
|
|
147
147
|
"@types/node": "^22.9.0",
|
|
148
148
|
"@typescript-eslint/eslint-plugin": "^8.29.1",
|
|
149
149
|
"@typescript-eslint/parser": "^8.29.1",
|
|
150
|
-
"@vercel/stega": "
|
|
150
|
+
"@vercel/stega": "1.1.0",
|
|
151
151
|
"@vitest/coverage-v8": "3.1.1",
|
|
152
152
|
"eslint": "^9.24.0",
|
|
153
153
|
"eslint-config-prettier": "^10.1.1",
|
package/src/media-library.ts
CHANGED
|
@@ -6,6 +6,9 @@ import type {
|
|
|
6
6
|
VideoPlaybackTokens,
|
|
7
7
|
} from './types'
|
|
8
8
|
|
|
9
|
+
export type {VideoRenditionInfo, VideoRenditionInfoPublic, VideoRenditionInfoSigned} from './types'
|
|
10
|
+
export type {VideoSubtitleInfo, VideoSubtitleInfoPublic, VideoSubtitleInfoSigned} from './types'
|
|
11
|
+
|
|
9
12
|
/**
|
|
10
13
|
* Check if a playback info item (stream/thumbnail/etc) has a signed token
|
|
11
14
|
* @internal
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import {vercelStegaCombine} from '@vercel/stega'
|
|
2
|
+
|
|
1
3
|
import {createEditUrl} from '../csm/createEditUrl'
|
|
2
4
|
import {jsonPathToStudioPath} from '../csm/jsonPath'
|
|
3
5
|
import {resolveStudioBaseRoute} from '../csm/resolveEditInfo'
|
|
4
6
|
import {reKeySegment, toString as studioPathToString} from '../csm/studioPath'
|
|
5
7
|
import {encodeIntoResult} from './encodeIntoResult'
|
|
6
8
|
import {filterDefault} from './filterDefault'
|
|
7
|
-
import {stegaCombine} from './stega'
|
|
8
9
|
import {
|
|
9
10
|
type ContentSourceMap,
|
|
10
11
|
type ContentSourceMapParsedPath,
|
|
@@ -89,7 +90,7 @@ export function stegaEncodeSourceMap<Result = unknown>(
|
|
|
89
90
|
if (!baseUrl) return value
|
|
90
91
|
const {_id: id, _type: type, _projectId: projectId, _dataset: dataset} = sourceDocument
|
|
91
92
|
|
|
92
|
-
return
|
|
93
|
+
return vercelStegaCombine(
|
|
93
94
|
value,
|
|
94
95
|
{
|
|
95
96
|
origin: 'sanity.io',
|
|
@@ -104,7 +105,7 @@ export function stegaEncodeSourceMap<Result = unknown>(
|
|
|
104
105
|
}),
|
|
105
106
|
},
|
|
106
107
|
// We use custom logic to determine if we should skip encoding
|
|
107
|
-
|
|
108
|
+
false,
|
|
108
109
|
)
|
|
109
110
|
},
|
|
110
111
|
)
|
package/src/types.ts
CHANGED
|
@@ -1978,7 +1978,57 @@ export interface VideoPlaybackInfoItemSigned extends VideoPlaybackInfoItemPublic
|
|
|
1978
1978
|
export type VideoPlaybackInfoItem = VideoPlaybackInfoItemPublic | VideoPlaybackInfoItemSigned
|
|
1979
1979
|
|
|
1980
1980
|
/** @public */
|
|
1981
|
-
export interface
|
|
1981
|
+
export interface VideoRenditionInfoPublic {
|
|
1982
|
+
/** URL to the MP4 rendition (redirects to CDN) */
|
|
1983
|
+
url: string
|
|
1984
|
+
/** Resolution identifier, e.g. "1080p", "480p", "270p" */
|
|
1985
|
+
resolution: '1080p' | '480p' | '270p' | (string & {})
|
|
1986
|
+
}
|
|
1987
|
+
|
|
1988
|
+
/** @public */
|
|
1989
|
+
export interface VideoRenditionInfoSigned extends VideoRenditionInfoPublic {
|
|
1990
|
+
/** Authentication token for signed playback */
|
|
1991
|
+
token: string
|
|
1992
|
+
/** Token expiration time in ISO 8601 format */
|
|
1993
|
+
expiresAt: string
|
|
1994
|
+
}
|
|
1995
|
+
|
|
1996
|
+
/** @public */
|
|
1997
|
+
export type VideoRenditionInfo = VideoRenditionInfoPublic | VideoRenditionInfoSigned
|
|
1998
|
+
|
|
1999
|
+
/** @public */
|
|
2000
|
+
export interface VideoSubtitleInfoPublic {
|
|
2001
|
+
/** Subtitle track identifier */
|
|
2002
|
+
trackId: string
|
|
2003
|
+
/** ISO 639-1 language code */
|
|
2004
|
+
languageCode: string
|
|
2005
|
+
/** URL to the subtitle file */
|
|
2006
|
+
url: string
|
|
2007
|
+
/** Whether this track contains closed captions */
|
|
2008
|
+
closedCaptions: boolean
|
|
2009
|
+
}
|
|
2010
|
+
|
|
2011
|
+
/** @public */
|
|
2012
|
+
export interface VideoSubtitleInfoSigned extends VideoSubtitleInfoPublic {
|
|
2013
|
+
/** Authentication token for signed playback */
|
|
2014
|
+
token: string
|
|
2015
|
+
/** Token expiration time in ISO 8601 format */
|
|
2016
|
+
expiresAt: string
|
|
2017
|
+
}
|
|
2018
|
+
|
|
2019
|
+
/** @public */
|
|
2020
|
+
export type VideoSubtitleInfo = VideoSubtitleInfoPublic | VideoSubtitleInfoSigned
|
|
2021
|
+
|
|
2022
|
+
/** @public */
|
|
2023
|
+
export interface VideoPlaybackInfo<
|
|
2024
|
+
T extends VideoPlaybackInfoItem = VideoPlaybackInfoItem,
|
|
2025
|
+
R extends VideoRenditionInfo = T extends VideoPlaybackInfoItemSigned
|
|
2026
|
+
? VideoRenditionInfoSigned
|
|
2027
|
+
: VideoRenditionInfo,
|
|
2028
|
+
S extends VideoSubtitleInfo = T extends VideoPlaybackInfoItemSigned
|
|
2029
|
+
? VideoSubtitleInfoSigned
|
|
2030
|
+
: VideoSubtitleInfo,
|
|
2031
|
+
> {
|
|
1982
2032
|
id: string
|
|
1983
2033
|
thumbnail: T
|
|
1984
2034
|
animated: T
|
|
@@ -1986,6 +2036,8 @@ export interface VideoPlaybackInfo<T extends VideoPlaybackInfoItem = VideoPlayba
|
|
|
1986
2036
|
stream: T
|
|
1987
2037
|
duration: number
|
|
1988
2038
|
aspectRatio: number
|
|
2039
|
+
renditions?: R[]
|
|
2040
|
+
subtitles?: S[]
|
|
1989
2041
|
}
|
|
1990
2042
|
|
|
1991
2043
|
/** @public */
|