yoto-nodejs-client 0.0.1 → 0.0.2
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/bin/lib/cli-helpers.d.ts +32 -0
- package/bin/lib/cli-helpers.d.ts.map +1 -1
- package/bin/lib/token-helpers.d.ts +32 -0
- package/bin/lib/token-helpers.d.ts.map +1 -1
- package/index.d.ts +368 -0
- package/index.d.ts.map +1 -1
- package/lib/api-endpoints/auth.d.ts +85 -0
- package/lib/api-endpoints/auth.d.ts.map +1 -1
- package/lib/api-endpoints/constants.d.ts +22 -0
- package/lib/api-endpoints/constants.d.ts.map +1 -1
- package/lib/api-endpoints/content.d.ts +760 -0
- package/lib/api-endpoints/content.d.ts.map +1 -1
- package/lib/api-endpoints/devices.d.ts +581 -0
- package/lib/api-endpoints/devices.d.ts.map +1 -1
- package/lib/api-endpoints/family-library-groups.d.ts +187 -0
- package/lib/api-endpoints/family-library-groups.d.ts.map +1 -1
- package/lib/api-endpoints/family.d.ts +88 -0
- package/lib/api-endpoints/family.d.ts.map +1 -1
- package/lib/api-endpoints/helpers.d.ts +37 -3
- package/lib/api-endpoints/helpers.d.ts.map +1 -1
- package/lib/api-endpoints/icons.d.ts +196 -0
- package/lib/api-endpoints/icons.d.ts.map +1 -1
- package/lib/api-endpoints/media.d.ts +83 -0
- package/lib/api-endpoints/media.d.ts.map +1 -1
- package/lib/api-endpoints/test-helpers.d.ts +21 -0
- package/lib/api-endpoints/test-helpers.d.ts.map +1 -1
- package/lib/mqtt/client.d.ts +277 -0
- package/lib/mqtt/client.d.ts.map +1 -1
- package/lib/mqtt/commands.d.ts +195 -0
- package/lib/mqtt/commands.d.ts.map +1 -1
- package/lib/mqtt/factory.d.ts +43 -0
- package/lib/mqtt/factory.d.ts.map +1 -1
- package/lib/mqtt/topics.d.ts +157 -0
- package/lib/mqtt/topics.d.ts.map +1 -1
- package/lib/token.d.ts +88 -0
- package/lib/token.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,3 +1,235 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @see https://yoto.dev/reference/card-content-schema/
|
|
3
|
+
* @typedef {'none' | 'stories' | 'music' | 'radio' | 'podcast' | 'sfx' | 'activities' | 'alarms'} YotoCategory
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @see https://yoto.dev/reference/card-content-schema/
|
|
7
|
+
* @typedef {'mp3' | 'aac' | 'opus' | 'ogg'} YotoAudioFormat
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* @see https://yoto.dev/reference/card-content-schema/
|
|
11
|
+
* @typedef {'en' | 'en-gb' | 'en-us' | 'fr' | 'fr-fr' | 'es' | 'es-es' | 'es-419' | 'de' | 'it'} YotoLanguage
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* @see https://yoto.dev/reference/card-content-schema/
|
|
15
|
+
* @typedef {'new' | 'inprogress' | 'complete' | 'live' | 'archived'} YotoStatusName
|
|
16
|
+
*/
|
|
17
|
+
/**
|
|
18
|
+
* @see https://yoto.dev/reference/card-content-schema/
|
|
19
|
+
* @typedef {'DESC' | 'ASC'} YotoPlaybackDirection
|
|
20
|
+
*/
|
|
21
|
+
/**
|
|
22
|
+
* @see https://yoto.dev/reference/card-content-schema/
|
|
23
|
+
* @typedef {'linear' | 'interactive'} YotoPlaybackType
|
|
24
|
+
*/
|
|
25
|
+
/**
|
|
26
|
+
* @see https://yoto.dev/myo/how-playlists-work/
|
|
27
|
+
* @typedef {Object} YotoTrackDisplay
|
|
28
|
+
* @property {string} icon16x16 - Track icon (16x16px) in format "yoto:#<sha256-hash>"
|
|
29
|
+
*/
|
|
30
|
+
/**
|
|
31
|
+
* @see https://yoto.dev/myo/how-playlists-work/
|
|
32
|
+
* @typedef {'audio' | 'stream'} YotoTrackType
|
|
33
|
+
*/
|
|
34
|
+
/**
|
|
35
|
+
* @see https://yoto.dev/myo/how-playlists-work/
|
|
36
|
+
* @typedef {'stereo' | 'mono'} YotoChannels
|
|
37
|
+
*/
|
|
38
|
+
/**
|
|
39
|
+
* A track represents a single audio file within a chapter.
|
|
40
|
+
* Tracks within a chapter play in sequence.
|
|
41
|
+
* @see https://yoto.dev/myo/how-playlists-work/
|
|
42
|
+
* @see https://yoto.dev/api/getcontent/
|
|
43
|
+
* @see https://yoto.dev/api/getusersmyocontent/
|
|
44
|
+
* @see https://yoto.dev/reference/card-content-schema/
|
|
45
|
+
* @typedef {Object} YotoTrack
|
|
46
|
+
* @property {string} key - Track identifier
|
|
47
|
+
* @property {string} title - Track title
|
|
48
|
+
* @property {string} trackUrl - Track URL in format "yoto:#<sha256-hash>"
|
|
49
|
+
* @property {YotoAudioFormat} format - Audio format
|
|
50
|
+
* @property {YotoTrackType} type - Track type ("audio" or "stream")
|
|
51
|
+
* @property {string} overlayLabel - Display label shown on player
|
|
52
|
+
* @property {number} duration - Track duration in seconds
|
|
53
|
+
* @property {number} fileSize - File size in bytes
|
|
54
|
+
* @property {YotoChannels} channels - Audio channels (stereo or mono)
|
|
55
|
+
* @property {any | null} ambient - Ambient setting for track
|
|
56
|
+
* @property {YotoTrackDisplay} display - Display configuration with icon
|
|
57
|
+
* @property {string | null} [uid] - Optional unique identifier
|
|
58
|
+
* @property {string | null} [overlayLabelOverride] - Optional override for overlay label
|
|
59
|
+
*/
|
|
60
|
+
/**
|
|
61
|
+
* @see https://yoto.dev/myo/how-playlists-work/
|
|
62
|
+
* @typedef {Object} YotoChapterDisplay
|
|
63
|
+
* @property {string} icon16x16 - Chapter icon (16x16px) in format "yoto:#<sha256-hash>"
|
|
64
|
+
*/
|
|
65
|
+
/**
|
|
66
|
+
* A chapter contains one or more tracks and has its own title and icon.
|
|
67
|
+
* A playlist is made up of one or more chapters.
|
|
68
|
+
* @see https://yoto.dev/myo/how-playlists-work/
|
|
69
|
+
* @see https://yoto.dev/api/getcontent/
|
|
70
|
+
* @see https://yoto.dev/api/getusersmyocontent/
|
|
71
|
+
* @typedef {Object} YotoChapter
|
|
72
|
+
* @property {string} key - Chapter identifier
|
|
73
|
+
* @property {string} title - Chapter title
|
|
74
|
+
* @property {YotoTrack[]} tracks - Array of tracks in this chapter
|
|
75
|
+
* @property {YotoChapterDisplay} display - Display configuration with icon
|
|
76
|
+
* @property {string} overlayLabel - Overlay label shown on player
|
|
77
|
+
* @property {number} duration - Total chapter duration in seconds
|
|
78
|
+
* @property {number} fileSize - Total chapter file size in bytes
|
|
79
|
+
* @property {any | null} availableFrom - Availability date/time
|
|
80
|
+
* @property {any | null} ambient - Ambient setting for chapter
|
|
81
|
+
* @property {string | null} defaultTrackDisplay - Default track display setting
|
|
82
|
+
* @property {string | null} defaultTrackAmbient - Default track ambient setting
|
|
83
|
+
* @property {string | null} [overlayLabelOverride] - Optional override for overlay label
|
|
84
|
+
* @property {number} [startTime] - Chapter start time (for API compatibility)
|
|
85
|
+
*/
|
|
86
|
+
/**
|
|
87
|
+
* @see https://yoto.dev/api/getcontent/
|
|
88
|
+
* @typedef {Object} YotoEditSettings
|
|
89
|
+
* @property {string} autoOverlayLabels
|
|
90
|
+
* @property {boolean} editKeys
|
|
91
|
+
* @property {boolean} transcodeAudioUploads
|
|
92
|
+
*/
|
|
93
|
+
/**
|
|
94
|
+
* @see https://yoto.dev/api/getcontent/
|
|
95
|
+
* @see https://yoto.dev/reference/card-content-schema/
|
|
96
|
+
* @typedef {Object} YotoMetadata
|
|
97
|
+
* @property {YotoCategory} category - Content category
|
|
98
|
+
* @property {Object} cover - Cover image
|
|
99
|
+
* @property {string | null} cover.imageL - Large cover image URL
|
|
100
|
+
* @property {YotoMedia} media - Media information
|
|
101
|
+
* @property {string} [accent] - Accent (e.g., "British")
|
|
102
|
+
* @property {boolean} [addToFamilyLibrary] - Whether to add to family library
|
|
103
|
+
* @property {string} [author] - Author name
|
|
104
|
+
* @property {string} [copyright] - Copyright information
|
|
105
|
+
* @property {string} [description] - Content description
|
|
106
|
+
* @property {string[]} [genre] - Genre tags (e.g., ["Adventure", "Fantasy"])
|
|
107
|
+
* @property {YotoLanguage[]} [languages] - Language codes
|
|
108
|
+
* @property {number} [maxAge] - Maximum recommended age
|
|
109
|
+
* @property {number} [minAge] - Minimum recommended age
|
|
110
|
+
* @property {string[]} [musicType] - Music types (e.g., ["Classical", "Instrumental"])
|
|
111
|
+
* @property {string} [note] - Additional notes
|
|
112
|
+
* @property {string} [order] - Order (e.g., "featured")
|
|
113
|
+
* @property {string} [audioPreviewUrl] - Preview audio URL
|
|
114
|
+
* @property {string} [readBy] - Narrator name
|
|
115
|
+
* @property {boolean} [share] - Whether sharing is enabled
|
|
116
|
+
* @property {YotoStatus} [status] - Content status
|
|
117
|
+
* @property {string[]} [tags] - Content tags
|
|
118
|
+
* @property {string} [feedUrl] - Podcast feed URL
|
|
119
|
+
* @property {number} [numEpisodes] - Number of episodes (for podcasts)
|
|
120
|
+
* @property {YotoPlaybackDirection} [playbackDirection] - Playback direction for podcasts
|
|
121
|
+
*/
|
|
122
|
+
/**
|
|
123
|
+
* @see https://yoto.dev/api/getcontent/
|
|
124
|
+
* @see https://yoto.dev/api/getusersmyocontent/
|
|
125
|
+
* @typedef {Object} YotoMedia
|
|
126
|
+
* @property {number} duration
|
|
127
|
+
* @property {number} fileSize
|
|
128
|
+
* @property {boolean} hasStreams
|
|
129
|
+
*/
|
|
130
|
+
/**
|
|
131
|
+
* @see https://yoto.dev/api/getusersmyocontent/
|
|
132
|
+
* @see https://yoto.dev/reference/card-content-schema/
|
|
133
|
+
* @typedef {Object} YotoContentConfig
|
|
134
|
+
* @property {string} [autoadvance] - Auto-advance setting
|
|
135
|
+
* @property {boolean} [onlineOnly] - Whether content requires online access
|
|
136
|
+
* @property {YotoShuffle[]} [shuffle] - Shuffle configuration
|
|
137
|
+
* @property {number} [trackNumberOverlayTimeout] - Track number overlay timeout in seconds
|
|
138
|
+
* @property {number} [resumeTimeout] - Resume timeout in seconds
|
|
139
|
+
* @property {boolean} [systemActivity] - System activity setting
|
|
140
|
+
*/
|
|
141
|
+
/**
|
|
142
|
+
* @see https://yoto.dev/api/getusersmyocontent/
|
|
143
|
+
* @typedef {Object} YotoShuffle
|
|
144
|
+
* @property {number} end
|
|
145
|
+
* @property {number} limit
|
|
146
|
+
* @property {number} start
|
|
147
|
+
*/
|
|
148
|
+
/**
|
|
149
|
+
* @see https://yoto.dev/api/getusersmyocontent/
|
|
150
|
+
* @typedef {Object} YotoContentCover
|
|
151
|
+
* @property {string | null} imageL
|
|
152
|
+
*/
|
|
153
|
+
/**
|
|
154
|
+
* @see https://yoto.dev/api/getusersmyocontent/
|
|
155
|
+
* @typedef {Object} YotoMyoEditSettings
|
|
156
|
+
* @property {string} autoOverlayLabels
|
|
157
|
+
* @property {boolean} editKeys
|
|
158
|
+
* @property {YotoPodcastTrackDisplay} [podcastTrackDisplay]
|
|
159
|
+
* @property {string} [podcastType]
|
|
160
|
+
*/
|
|
161
|
+
/**
|
|
162
|
+
* @see https://yoto.dev/api/getusersmyocontent/
|
|
163
|
+
* @typedef {Object} YotoPodcastTrackDisplay
|
|
164
|
+
* @property {string} icon16x16
|
|
165
|
+
*/
|
|
166
|
+
/**
|
|
167
|
+
* @see https://yoto.dev/api/getusersmyocontent/
|
|
168
|
+
* @see https://yoto.dev/reference/card-content-schema/
|
|
169
|
+
* @typedef {Object} YotoStatus
|
|
170
|
+
* @property {YotoStatusName} name - Status name
|
|
171
|
+
* @property {string} updatedAt - Last update timestamp
|
|
172
|
+
*/
|
|
173
|
+
/**
|
|
174
|
+
* @see https://yoto.dev/api/getusersmyocontent/
|
|
175
|
+
* @typedef {Object} YotoSharing
|
|
176
|
+
* @property {string} linkCreatedAt
|
|
177
|
+
* @property {string} linkUrl
|
|
178
|
+
* @property {number} shareCount
|
|
179
|
+
* @property {number} shareLimit
|
|
180
|
+
*/
|
|
181
|
+
/**
|
|
182
|
+
* @see https://yoto.dev/api/getusersmyocontent/
|
|
183
|
+
* @typedef {Object} YotoClubAvailability
|
|
184
|
+
* @property {string} store
|
|
185
|
+
*/
|
|
186
|
+
/**
|
|
187
|
+
* @see https://yoto.dev/api/getcontent/
|
|
188
|
+
* @typedef {Object} YotoContentResponse
|
|
189
|
+
* @property {YotoCard} card
|
|
190
|
+
*/
|
|
191
|
+
/**
|
|
192
|
+
* @see https://yoto.dev/api/getcontent/
|
|
193
|
+
* @see https://yoto.dev/reference/card-content-schema/
|
|
194
|
+
* @typedef {Object} YotoCard
|
|
195
|
+
* @property {string} cardId - Unique card identifier
|
|
196
|
+
* @property {YotoContent} content - Card content and chapters
|
|
197
|
+
* @property {string} createdAt - Creation timestamp
|
|
198
|
+
* @property {string} creatorEmail - Creator email address
|
|
199
|
+
* @property {boolean} deleted - Whether card is deleted
|
|
200
|
+
* @property {YotoMetadata} metadata - Card metadata
|
|
201
|
+
* @property {number} shareLimit - Share limit count
|
|
202
|
+
* @property {string} shareLinkCreatedAt - Share link creation timestamp
|
|
203
|
+
* @property {string} slug - URL-friendly slug
|
|
204
|
+
* @property {string} title - Card title
|
|
205
|
+
* @property {string} updatedAt - Last update timestamp
|
|
206
|
+
* @property {string} userId - Owner user ID
|
|
207
|
+
* @property {string[]} [tags] - Top-level tags
|
|
208
|
+
*/
|
|
209
|
+
/**
|
|
210
|
+
* @see https://yoto.dev/api/getcontent/
|
|
211
|
+
* @see https://yoto.dev/reference/card-content-schema/
|
|
212
|
+
* @typedef {Object} YotoContent
|
|
213
|
+
* @property {string} activity - Activity type
|
|
214
|
+
* @property {YotoChapter[]} chapters - Array of chapters
|
|
215
|
+
* @property {YotoContentConfig} config - Content configuration
|
|
216
|
+
* @property {YotoEditSettings} editSettings - Edit settings
|
|
217
|
+
* @property {string} version - Content version
|
|
218
|
+
* @property {YotoPlaybackType} [playbackType] - Playback type (linear or interactive)
|
|
219
|
+
*/
|
|
220
|
+
/**
|
|
221
|
+
* Returns a piece of content from the Yoto API.
|
|
222
|
+
* @see https://yoto.dev/api/getcontent/
|
|
223
|
+
* @param {object} options
|
|
224
|
+
* @param {string} options.accessToken The API token to request with
|
|
225
|
+
* @param {string} options.cardId The card ID to fetch content for
|
|
226
|
+
* @param {string} [options.timezone] Timezone identifier (e.g., 'Pacific/Auckland'). See https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
|
|
227
|
+
* @param {string} [options.signingType] The type of playable signed URLs returned. Use with `playable`. Example: 's3'
|
|
228
|
+
* @param {boolean} [options.playable] Return playable signed URLs
|
|
229
|
+
* @param {string} [options.userAgent] Optional user agent string
|
|
230
|
+
* @param {RequestOptions} [options.requestOptions] Additional undici request options
|
|
231
|
+
* @return {Promise<YotoContentResponse>} The fetched content
|
|
232
|
+
*/
|
|
1
233
|
export function getContent({ accessToken, userAgent, requestOptions, cardId, timezone, signingType, playable }: {
|
|
2
234
|
accessToken: string;
|
|
3
235
|
cardId: string;
|
|
@@ -9,6 +241,84 @@ export function getContent({ accessToken, userAgent, requestOptions, cardId, tim
|
|
|
9
241
|
dispatcher?: import("undici").Dispatcher;
|
|
10
242
|
} & Omit<import("undici").Dispatcher.RequestOptions<unknown>, "origin" | "path" | "method"> & Partial<Pick<import("undici").Dispatcher.RequestOptions<null>, "method">>) | undefined;
|
|
11
243
|
}): Promise<YotoContentResponse>;
|
|
244
|
+
/**
|
|
245
|
+
* @see https://yoto.dev/api/getusersmyocontent/
|
|
246
|
+
* @typedef {Object} YotoMyoContentResponse
|
|
247
|
+
* @property {YotoMyoCard[]} cards
|
|
248
|
+
*/
|
|
249
|
+
/**
|
|
250
|
+
* @see https://yoto.dev/api/getusersmyocontent/
|
|
251
|
+
* @typedef {Object} YotoMyoCard
|
|
252
|
+
* @property {string} availability
|
|
253
|
+
* @property {string} cardId
|
|
254
|
+
* @property {YotoClubAvailability[]} [clubAvailability]
|
|
255
|
+
* @property {YotoMyoContent} content
|
|
256
|
+
* @property {string} createdAt
|
|
257
|
+
* @property {boolean} deleted
|
|
258
|
+
* @property {YotoMyoMetadata} metadata
|
|
259
|
+
* @property {string} [shareLinkCreatedAt]
|
|
260
|
+
* @property {string} [shareLinkUrl]
|
|
261
|
+
* @property {YotoSharing} [sharing]
|
|
262
|
+
* @property {string} slug
|
|
263
|
+
* @property {string} [sortkey]
|
|
264
|
+
* @property {string} title
|
|
265
|
+
* @property {string} updatedAt
|
|
266
|
+
* @property {string} userId
|
|
267
|
+
*/
|
|
268
|
+
/**
|
|
269
|
+
* @see https://yoto.dev/api/getusersmyocontent/
|
|
270
|
+
* @see https://yoto.dev/reference/card-content-schema/
|
|
271
|
+
* @typedef {Object} YotoMyoContent
|
|
272
|
+
* @property {string} activity - Activity type
|
|
273
|
+
* @property {YotoContentConfig} config - Content configuration
|
|
274
|
+
* @property {YotoContentCover} [cover] - Cover image
|
|
275
|
+
* @property {YotoMyoEditSettings} editSettings - Edit settings
|
|
276
|
+
* @property {boolean} [hidden] - Whether content is hidden
|
|
277
|
+
* @property {boolean} [restricted] - Whether content is restricted
|
|
278
|
+
* @property {string} version - Content version
|
|
279
|
+
* @property {YotoPlaybackType} [playbackType] - Playback type (linear or interactive)
|
|
280
|
+
*/
|
|
281
|
+
/**
|
|
282
|
+
* @see https://yoto.dev/api/getusersmyocontent/
|
|
283
|
+
* @see https://yoto.dev/reference/card-content-schema/
|
|
284
|
+
* @typedef {Object} YotoMyoMetadata
|
|
285
|
+
* @property {YotoCategory} category - Content category
|
|
286
|
+
* @property {YotoContentCover} [cover] - Cover image
|
|
287
|
+
* @property {YotoMedia} media - Media information
|
|
288
|
+
* @property {string} [accent] - Accent (e.g., "British")
|
|
289
|
+
* @property {boolean} [addToFamilyLibrary] - Whether to add to family library
|
|
290
|
+
* @property {string} [author] - Author name
|
|
291
|
+
* @property {string} [copyright] - Copyright information
|
|
292
|
+
* @property {string} [description] - Content description
|
|
293
|
+
* @property {string[]} [genre] - Genre tags (e.g., ["Adventure", "Fantasy"])
|
|
294
|
+
* @property {YotoLanguage[]} [languages] - Language codes
|
|
295
|
+
* @property {number} [maxAge] - Maximum recommended age
|
|
296
|
+
* @property {number} [minAge] - Minimum recommended age
|
|
297
|
+
* @property {string[]} [musicType] - Music types (e.g., ["Classical", "Instrumental"])
|
|
298
|
+
* @property {string} [note] - Additional notes
|
|
299
|
+
* @property {any} [order] - Order
|
|
300
|
+
* @property {string} [previewAudio] - Preview audio URL
|
|
301
|
+
* @property {string} [audioPreviewUrl] - Audio preview URL (alternative field name)
|
|
302
|
+
* @property {string} [readBy] - Narrator name
|
|
303
|
+
* @property {boolean} [share] - Whether sharing is enabled
|
|
304
|
+
* @property {YotoStatus} [status] - Content status
|
|
305
|
+
* @property {string[]} [tags] - Content tags
|
|
306
|
+
* @property {string | null} [feedUrl] - Podcast feed URL
|
|
307
|
+
* @property {number} [numEpisodes] - Number of episodes (for podcasts)
|
|
308
|
+
* @property {YotoPlaybackDirection} [playbackDirection] - Playback direction for podcasts
|
|
309
|
+
* @property {boolean} [hidden] - Whether content is hidden
|
|
310
|
+
* @property {any[]} [list] - List data
|
|
311
|
+
*/
|
|
312
|
+
/**
|
|
313
|
+
* Returns the MYO cards belonging to the authenticated user.
|
|
314
|
+
* @see https://yoto.dev/api/getusersmyocontent/
|
|
315
|
+
* @param {object} options
|
|
316
|
+
* @param {string} options.accessToken The API token to request with
|
|
317
|
+
* @param {boolean} [options.showDeleted=false] Show owned cards that have been deleted
|
|
318
|
+
* @param {string} [options.userAgent] Optional user agent string
|
|
319
|
+
* @param {RequestOptions} [options.requestOptions] Additional undici request options
|
|
320
|
+
* @return {Promise<YotoMyoContentResponse>} The user's MYO content
|
|
321
|
+
*/
|
|
12
322
|
export function getUserMyoContent({ accessToken, userAgent, requestOptions, showDeleted }: {
|
|
13
323
|
accessToken: string;
|
|
14
324
|
showDeleted?: boolean | undefined;
|
|
@@ -17,6 +327,61 @@ export function getUserMyoContent({ accessToken, userAgent, requestOptions, show
|
|
|
17
327
|
dispatcher?: import("undici").Dispatcher;
|
|
18
328
|
} & Omit<import("undici").Dispatcher.RequestOptions<unknown>, "origin" | "path" | "method"> & Partial<Pick<import("undici").Dispatcher.RequestOptions<null>, "method">>) | undefined;
|
|
19
329
|
}): Promise<YotoMyoContentResponse>;
|
|
330
|
+
/**
|
|
331
|
+
* @see https://yoto.dev/api/createorupdatecontent/
|
|
332
|
+
* @typedef {Object} YotoCreateOrUpdateContentRequest
|
|
333
|
+
* @property {string} [cardId] - Card ID for updating existing content (omit for creating new)
|
|
334
|
+
* @property {string} title - Card title
|
|
335
|
+
* @property {YotoContentInput} content - Content configuration
|
|
336
|
+
* @property {YotoMetadataInput} [metadata] - Card metadata
|
|
337
|
+
*/
|
|
338
|
+
/**
|
|
339
|
+
* @see https://yoto.dev/api/createorupdatecontent/
|
|
340
|
+
* @typedef {Object} YotoContentInput
|
|
341
|
+
* @property {YotoChapter[]} [chapters] - Array of chapters
|
|
342
|
+
* @property {YotoContentConfig} [config] - Content configuration
|
|
343
|
+
* @property {string} [playbackType] - Playback type (e.g., 'linear')
|
|
344
|
+
*/
|
|
345
|
+
/**
|
|
346
|
+
* @see https://yoto.dev/api/createorupdatecontent/
|
|
347
|
+
* @typedef {Object} YotoMetadataInput
|
|
348
|
+
* @property {string} [description] - Content description
|
|
349
|
+
* @property {string} [title] - Metadata title
|
|
350
|
+
*/
|
|
351
|
+
/**
|
|
352
|
+
* @see https://yoto.dev/api/createorupdatecontent/
|
|
353
|
+
* @typedef {Object} YotoCreateOrUpdateContentResponse
|
|
354
|
+
* @property {YotoCreatedCard} card
|
|
355
|
+
*/
|
|
356
|
+
/**
|
|
357
|
+
* @see https://yoto.dev/api/createorupdatecontent/
|
|
358
|
+
* @typedef {Object} YotoCreatedCard
|
|
359
|
+
* @property {string} _id - MongoDB document ID
|
|
360
|
+
* @property {string} cardId - Card ID
|
|
361
|
+
* @property {YotoCreatedContent} content
|
|
362
|
+
* @property {string} createdAt
|
|
363
|
+
* @property {Object} metadata
|
|
364
|
+
* @property {string} title
|
|
365
|
+
* @property {string} updatedAt
|
|
366
|
+
* @property {string} userId
|
|
367
|
+
*/
|
|
368
|
+
/**
|
|
369
|
+
* @see https://yoto.dev/api/createorupdatecontent/
|
|
370
|
+
* @typedef {Object} YotoCreatedContent
|
|
371
|
+
* @property {YotoChapter[]} chapters
|
|
372
|
+
* @property {YotoContentConfig} config
|
|
373
|
+
* @property {string} playbackType
|
|
374
|
+
*/
|
|
375
|
+
/**
|
|
376
|
+
* Create new content or update existing content.
|
|
377
|
+
* @see https://yoto.dev/api/createorupdatecontent/
|
|
378
|
+
* @param {object} options
|
|
379
|
+
* @param {string} options.accessToken The API token to request with
|
|
380
|
+
* @param {YotoCreateOrUpdateContentRequest} options.content The content to create or update
|
|
381
|
+
* @param {string} [options.userAgent] Optional user agent string
|
|
382
|
+
* @param {RequestOptions} [options.requestOptions] Additional undici request options
|
|
383
|
+
* @return {Promise<YotoCreateOrUpdateContentResponse>} The created or updated content
|
|
384
|
+
*/
|
|
20
385
|
export function createOrUpdateContent({ accessToken, userAgent, requestOptions, content }: {
|
|
21
386
|
accessToken: string;
|
|
22
387
|
content: YotoCreateOrUpdateContentRequest;
|
|
@@ -25,6 +390,21 @@ export function createOrUpdateContent({ accessToken, userAgent, requestOptions,
|
|
|
25
390
|
dispatcher?: import("undici").Dispatcher;
|
|
26
391
|
} & Omit<import("undici").Dispatcher.RequestOptions<unknown>, "origin" | "path" | "method"> & Partial<Pick<import("undici").Dispatcher.RequestOptions<null>, "method">>) | undefined;
|
|
27
392
|
}): Promise<YotoCreateOrUpdateContentResponse>;
|
|
393
|
+
/**
|
|
394
|
+
* @see https://yoto.dev/api/deletecontent/
|
|
395
|
+
* @typedef {Object} YotoDeleteContentResponse
|
|
396
|
+
* @property {string} status - Status of the delete operation (e.g., 'ok')
|
|
397
|
+
*/
|
|
398
|
+
/**
|
|
399
|
+
* Delete a piece of content.
|
|
400
|
+
* @see https://yoto.dev/api/deletecontent/
|
|
401
|
+
* @param {object} options
|
|
402
|
+
* @param {string} options.accessToken The API token to request with
|
|
403
|
+
* @param {string} options.cardId The card ID to delete
|
|
404
|
+
* @param {string} [options.userAgent] Optional user agent string
|
|
405
|
+
* @param {RequestOptions} [options.requestOptions] Additional undici request options
|
|
406
|
+
* @return {Promise<YotoDeleteContentResponse>} The delete response
|
|
407
|
+
*/
|
|
28
408
|
export function deleteContent({ accessToken, userAgent, requestOptions, cardId }: {
|
|
29
409
|
accessToken: string;
|
|
30
410
|
cardId: string;
|
|
@@ -40,41 +420,133 @@ export type YotoStatusName = "new" | "inprogress" | "complete" | "live" | "archi
|
|
|
40
420
|
export type YotoPlaybackDirection = "DESC" | "ASC";
|
|
41
421
|
export type YotoPlaybackType = "linear" | "interactive";
|
|
42
422
|
export type YotoTrackDisplay = {
|
|
423
|
+
/**
|
|
424
|
+
* - Track icon (16x16px) in format "yoto:#<sha256-hash>"
|
|
425
|
+
*/
|
|
43
426
|
icon16x16: string;
|
|
44
427
|
};
|
|
45
428
|
export type YotoTrackType = "audio" | "stream";
|
|
46
429
|
export type YotoChannels = "stereo" | "mono";
|
|
430
|
+
/**
|
|
431
|
+
* A track represents a single audio file within a chapter.
|
|
432
|
+
* Tracks within a chapter play in sequence.
|
|
433
|
+
*/
|
|
47
434
|
export type YotoTrack = {
|
|
435
|
+
/**
|
|
436
|
+
* - Track identifier
|
|
437
|
+
*/
|
|
48
438
|
key: string;
|
|
439
|
+
/**
|
|
440
|
+
* - Track title
|
|
441
|
+
*/
|
|
49
442
|
title: string;
|
|
443
|
+
/**
|
|
444
|
+
* - Track URL in format "yoto:#<sha256-hash>"
|
|
445
|
+
*/
|
|
50
446
|
trackUrl: string;
|
|
447
|
+
/**
|
|
448
|
+
* - Audio format
|
|
449
|
+
*/
|
|
51
450
|
format: YotoAudioFormat;
|
|
451
|
+
/**
|
|
452
|
+
* - Track type ("audio" or "stream")
|
|
453
|
+
*/
|
|
52
454
|
type: YotoTrackType;
|
|
455
|
+
/**
|
|
456
|
+
* - Display label shown on player
|
|
457
|
+
*/
|
|
53
458
|
overlayLabel: string;
|
|
459
|
+
/**
|
|
460
|
+
* - Track duration in seconds
|
|
461
|
+
*/
|
|
54
462
|
duration: number;
|
|
463
|
+
/**
|
|
464
|
+
* - File size in bytes
|
|
465
|
+
*/
|
|
55
466
|
fileSize: number;
|
|
467
|
+
/**
|
|
468
|
+
* - Audio channels (stereo or mono)
|
|
469
|
+
*/
|
|
56
470
|
channels: YotoChannels;
|
|
471
|
+
/**
|
|
472
|
+
* - Ambient setting for track
|
|
473
|
+
*/
|
|
57
474
|
ambient: any | null;
|
|
475
|
+
/**
|
|
476
|
+
* - Display configuration with icon
|
|
477
|
+
*/
|
|
58
478
|
display: YotoTrackDisplay;
|
|
479
|
+
/**
|
|
480
|
+
* - Optional unique identifier
|
|
481
|
+
*/
|
|
59
482
|
uid?: string | null;
|
|
483
|
+
/**
|
|
484
|
+
* - Optional override for overlay label
|
|
485
|
+
*/
|
|
60
486
|
overlayLabelOverride?: string | null;
|
|
61
487
|
};
|
|
62
488
|
export type YotoChapterDisplay = {
|
|
489
|
+
/**
|
|
490
|
+
* - Chapter icon (16x16px) in format "yoto:#<sha256-hash>"
|
|
491
|
+
*/
|
|
63
492
|
icon16x16: string;
|
|
64
493
|
};
|
|
494
|
+
/**
|
|
495
|
+
* A chapter contains one or more tracks and has its own title and icon.
|
|
496
|
+
* A playlist is made up of one or more chapters.
|
|
497
|
+
*/
|
|
65
498
|
export type YotoChapter = {
|
|
499
|
+
/**
|
|
500
|
+
* - Chapter identifier
|
|
501
|
+
*/
|
|
66
502
|
key: string;
|
|
503
|
+
/**
|
|
504
|
+
* - Chapter title
|
|
505
|
+
*/
|
|
67
506
|
title: string;
|
|
507
|
+
/**
|
|
508
|
+
* - Array of tracks in this chapter
|
|
509
|
+
*/
|
|
68
510
|
tracks: YotoTrack[];
|
|
511
|
+
/**
|
|
512
|
+
* - Display configuration with icon
|
|
513
|
+
*/
|
|
69
514
|
display: YotoChapterDisplay;
|
|
515
|
+
/**
|
|
516
|
+
* - Overlay label shown on player
|
|
517
|
+
*/
|
|
70
518
|
overlayLabel: string;
|
|
519
|
+
/**
|
|
520
|
+
* - Total chapter duration in seconds
|
|
521
|
+
*/
|
|
71
522
|
duration: number;
|
|
523
|
+
/**
|
|
524
|
+
* - Total chapter file size in bytes
|
|
525
|
+
*/
|
|
72
526
|
fileSize: number;
|
|
527
|
+
/**
|
|
528
|
+
* - Availability date/time
|
|
529
|
+
*/
|
|
73
530
|
availableFrom: any | null;
|
|
531
|
+
/**
|
|
532
|
+
* - Ambient setting for chapter
|
|
533
|
+
*/
|
|
74
534
|
ambient: any | null;
|
|
535
|
+
/**
|
|
536
|
+
* - Default track display setting
|
|
537
|
+
*/
|
|
75
538
|
defaultTrackDisplay: string | null;
|
|
539
|
+
/**
|
|
540
|
+
* - Default track ambient setting
|
|
541
|
+
*/
|
|
76
542
|
defaultTrackAmbient: string | null;
|
|
543
|
+
/**
|
|
544
|
+
* - Optional override for overlay label
|
|
545
|
+
*/
|
|
77
546
|
overlayLabelOverride?: string | null;
|
|
547
|
+
/**
|
|
548
|
+
* - Chapter start time (for API compatibility)
|
|
549
|
+
*/
|
|
78
550
|
startTime?: number;
|
|
79
551
|
};
|
|
80
552
|
export type YotoEditSettings = {
|
|
@@ -83,30 +555,99 @@ export type YotoEditSettings = {
|
|
|
83
555
|
transcodeAudioUploads: boolean;
|
|
84
556
|
};
|
|
85
557
|
export type YotoMetadata = {
|
|
558
|
+
/**
|
|
559
|
+
* - Content category
|
|
560
|
+
*/
|
|
86
561
|
category: YotoCategory;
|
|
562
|
+
/**
|
|
563
|
+
* - Cover image
|
|
564
|
+
*/
|
|
87
565
|
cover: {
|
|
88
566
|
imageL: string | null;
|
|
89
567
|
};
|
|
568
|
+
/**
|
|
569
|
+
* - Media information
|
|
570
|
+
*/
|
|
90
571
|
media: YotoMedia;
|
|
572
|
+
/**
|
|
573
|
+
* - Accent (e.g., "British")
|
|
574
|
+
*/
|
|
91
575
|
accent?: string;
|
|
576
|
+
/**
|
|
577
|
+
* - Whether to add to family library
|
|
578
|
+
*/
|
|
92
579
|
addToFamilyLibrary?: boolean;
|
|
580
|
+
/**
|
|
581
|
+
* - Author name
|
|
582
|
+
*/
|
|
93
583
|
author?: string;
|
|
584
|
+
/**
|
|
585
|
+
* - Copyright information
|
|
586
|
+
*/
|
|
94
587
|
copyright?: string;
|
|
588
|
+
/**
|
|
589
|
+
* - Content description
|
|
590
|
+
*/
|
|
95
591
|
description?: string;
|
|
592
|
+
/**
|
|
593
|
+
* - Genre tags (e.g., ["Adventure", "Fantasy"])
|
|
594
|
+
*/
|
|
96
595
|
genre?: string[];
|
|
596
|
+
/**
|
|
597
|
+
* - Language codes
|
|
598
|
+
*/
|
|
97
599
|
languages?: YotoLanguage[];
|
|
600
|
+
/**
|
|
601
|
+
* - Maximum recommended age
|
|
602
|
+
*/
|
|
98
603
|
maxAge?: number;
|
|
604
|
+
/**
|
|
605
|
+
* - Minimum recommended age
|
|
606
|
+
*/
|
|
99
607
|
minAge?: number;
|
|
608
|
+
/**
|
|
609
|
+
* - Music types (e.g., ["Classical", "Instrumental"])
|
|
610
|
+
*/
|
|
100
611
|
musicType?: string[];
|
|
612
|
+
/**
|
|
613
|
+
* - Additional notes
|
|
614
|
+
*/
|
|
101
615
|
note?: string;
|
|
616
|
+
/**
|
|
617
|
+
* - Order (e.g., "featured")
|
|
618
|
+
*/
|
|
102
619
|
order?: string;
|
|
620
|
+
/**
|
|
621
|
+
* - Preview audio URL
|
|
622
|
+
*/
|
|
103
623
|
audioPreviewUrl?: string;
|
|
624
|
+
/**
|
|
625
|
+
* - Narrator name
|
|
626
|
+
*/
|
|
104
627
|
readBy?: string;
|
|
628
|
+
/**
|
|
629
|
+
* - Whether sharing is enabled
|
|
630
|
+
*/
|
|
105
631
|
share?: boolean;
|
|
632
|
+
/**
|
|
633
|
+
* - Content status
|
|
634
|
+
*/
|
|
106
635
|
status?: YotoStatus;
|
|
636
|
+
/**
|
|
637
|
+
* - Content tags
|
|
638
|
+
*/
|
|
107
639
|
tags?: string[];
|
|
640
|
+
/**
|
|
641
|
+
* - Podcast feed URL
|
|
642
|
+
*/
|
|
108
643
|
feedUrl?: string;
|
|
644
|
+
/**
|
|
645
|
+
* - Number of episodes (for podcasts)
|
|
646
|
+
*/
|
|
109
647
|
numEpisodes?: number;
|
|
648
|
+
/**
|
|
649
|
+
* - Playback direction for podcasts
|
|
650
|
+
*/
|
|
110
651
|
playbackDirection?: YotoPlaybackDirection;
|
|
111
652
|
};
|
|
112
653
|
export type YotoMedia = {
|
|
@@ -115,11 +656,29 @@ export type YotoMedia = {
|
|
|
115
656
|
hasStreams: boolean;
|
|
116
657
|
};
|
|
117
658
|
export type YotoContentConfig = {
|
|
659
|
+
/**
|
|
660
|
+
* - Auto-advance setting
|
|
661
|
+
*/
|
|
118
662
|
autoadvance?: string;
|
|
663
|
+
/**
|
|
664
|
+
* - Whether content requires online access
|
|
665
|
+
*/
|
|
119
666
|
onlineOnly?: boolean;
|
|
667
|
+
/**
|
|
668
|
+
* - Shuffle configuration
|
|
669
|
+
*/
|
|
120
670
|
shuffle?: YotoShuffle[];
|
|
671
|
+
/**
|
|
672
|
+
* - Track number overlay timeout in seconds
|
|
673
|
+
*/
|
|
121
674
|
trackNumberOverlayTimeout?: number;
|
|
675
|
+
/**
|
|
676
|
+
* - Resume timeout in seconds
|
|
677
|
+
*/
|
|
122
678
|
resumeTimeout?: number;
|
|
679
|
+
/**
|
|
680
|
+
* - System activity setting
|
|
681
|
+
*/
|
|
123
682
|
systemActivity?: boolean;
|
|
124
683
|
};
|
|
125
684
|
export type YotoShuffle = {
|
|
@@ -140,7 +699,13 @@ export type YotoPodcastTrackDisplay = {
|
|
|
140
699
|
icon16x16: string;
|
|
141
700
|
};
|
|
142
701
|
export type YotoStatus = {
|
|
702
|
+
/**
|
|
703
|
+
* - Status name
|
|
704
|
+
*/
|
|
143
705
|
name: YotoStatusName;
|
|
706
|
+
/**
|
|
707
|
+
* - Last update timestamp
|
|
708
|
+
*/
|
|
144
709
|
updatedAt: string;
|
|
145
710
|
};
|
|
146
711
|
export type YotoSharing = {
|
|
@@ -156,26 +721,83 @@ export type YotoContentResponse = {
|
|
|
156
721
|
card: YotoCard;
|
|
157
722
|
};
|
|
158
723
|
export type YotoCard = {
|
|
724
|
+
/**
|
|
725
|
+
* - Unique card identifier
|
|
726
|
+
*/
|
|
159
727
|
cardId: string;
|
|
728
|
+
/**
|
|
729
|
+
* - Card content and chapters
|
|
730
|
+
*/
|
|
160
731
|
content: YotoContent;
|
|
732
|
+
/**
|
|
733
|
+
* - Creation timestamp
|
|
734
|
+
*/
|
|
161
735
|
createdAt: string;
|
|
736
|
+
/**
|
|
737
|
+
* - Creator email address
|
|
738
|
+
*/
|
|
162
739
|
creatorEmail: string;
|
|
740
|
+
/**
|
|
741
|
+
* - Whether card is deleted
|
|
742
|
+
*/
|
|
163
743
|
deleted: boolean;
|
|
744
|
+
/**
|
|
745
|
+
* - Card metadata
|
|
746
|
+
*/
|
|
164
747
|
metadata: YotoMetadata;
|
|
748
|
+
/**
|
|
749
|
+
* - Share limit count
|
|
750
|
+
*/
|
|
165
751
|
shareLimit: number;
|
|
752
|
+
/**
|
|
753
|
+
* - Share link creation timestamp
|
|
754
|
+
*/
|
|
166
755
|
shareLinkCreatedAt: string;
|
|
756
|
+
/**
|
|
757
|
+
* - URL-friendly slug
|
|
758
|
+
*/
|
|
167
759
|
slug: string;
|
|
760
|
+
/**
|
|
761
|
+
* - Card title
|
|
762
|
+
*/
|
|
168
763
|
title: string;
|
|
764
|
+
/**
|
|
765
|
+
* - Last update timestamp
|
|
766
|
+
*/
|
|
169
767
|
updatedAt: string;
|
|
768
|
+
/**
|
|
769
|
+
* - Owner user ID
|
|
770
|
+
*/
|
|
170
771
|
userId: string;
|
|
772
|
+
/**
|
|
773
|
+
* - Top-level tags
|
|
774
|
+
*/
|
|
171
775
|
tags?: string[];
|
|
172
776
|
};
|
|
173
777
|
export type YotoContent = {
|
|
778
|
+
/**
|
|
779
|
+
* - Activity type
|
|
780
|
+
*/
|
|
174
781
|
activity: string;
|
|
782
|
+
/**
|
|
783
|
+
* - Array of chapters
|
|
784
|
+
*/
|
|
175
785
|
chapters: YotoChapter[];
|
|
786
|
+
/**
|
|
787
|
+
* - Content configuration
|
|
788
|
+
*/
|
|
176
789
|
config: YotoContentConfig;
|
|
790
|
+
/**
|
|
791
|
+
* - Edit settings
|
|
792
|
+
*/
|
|
177
793
|
editSettings: YotoEditSettings;
|
|
794
|
+
/**
|
|
795
|
+
* - Content version
|
|
796
|
+
*/
|
|
178
797
|
version: string;
|
|
798
|
+
/**
|
|
799
|
+
* - Playback type (linear or interactive)
|
|
800
|
+
*/
|
|
179
801
|
playbackType?: YotoPlaybackType;
|
|
180
802
|
};
|
|
181
803
|
export type YotoMyoContentResponse = {
|
|
@@ -199,63 +821,198 @@ export type YotoMyoCard = {
|
|
|
199
821
|
userId: string;
|
|
200
822
|
};
|
|
201
823
|
export type YotoMyoContent = {
|
|
824
|
+
/**
|
|
825
|
+
* - Activity type
|
|
826
|
+
*/
|
|
202
827
|
activity: string;
|
|
828
|
+
/**
|
|
829
|
+
* - Content configuration
|
|
830
|
+
*/
|
|
203
831
|
config: YotoContentConfig;
|
|
832
|
+
/**
|
|
833
|
+
* - Cover image
|
|
834
|
+
*/
|
|
204
835
|
cover?: YotoContentCover;
|
|
836
|
+
/**
|
|
837
|
+
* - Edit settings
|
|
838
|
+
*/
|
|
205
839
|
editSettings: YotoMyoEditSettings;
|
|
840
|
+
/**
|
|
841
|
+
* - Whether content is hidden
|
|
842
|
+
*/
|
|
206
843
|
hidden?: boolean;
|
|
844
|
+
/**
|
|
845
|
+
* - Whether content is restricted
|
|
846
|
+
*/
|
|
207
847
|
restricted?: boolean;
|
|
848
|
+
/**
|
|
849
|
+
* - Content version
|
|
850
|
+
*/
|
|
208
851
|
version: string;
|
|
852
|
+
/**
|
|
853
|
+
* - Playback type (linear or interactive)
|
|
854
|
+
*/
|
|
209
855
|
playbackType?: YotoPlaybackType;
|
|
210
856
|
};
|
|
211
857
|
export type YotoMyoMetadata = {
|
|
858
|
+
/**
|
|
859
|
+
* - Content category
|
|
860
|
+
*/
|
|
212
861
|
category: YotoCategory;
|
|
862
|
+
/**
|
|
863
|
+
* - Cover image
|
|
864
|
+
*/
|
|
213
865
|
cover?: YotoContentCover;
|
|
866
|
+
/**
|
|
867
|
+
* - Media information
|
|
868
|
+
*/
|
|
214
869
|
media: YotoMedia;
|
|
870
|
+
/**
|
|
871
|
+
* - Accent (e.g., "British")
|
|
872
|
+
*/
|
|
215
873
|
accent?: string;
|
|
874
|
+
/**
|
|
875
|
+
* - Whether to add to family library
|
|
876
|
+
*/
|
|
216
877
|
addToFamilyLibrary?: boolean;
|
|
878
|
+
/**
|
|
879
|
+
* - Author name
|
|
880
|
+
*/
|
|
217
881
|
author?: string;
|
|
882
|
+
/**
|
|
883
|
+
* - Copyright information
|
|
884
|
+
*/
|
|
218
885
|
copyright?: string;
|
|
886
|
+
/**
|
|
887
|
+
* - Content description
|
|
888
|
+
*/
|
|
219
889
|
description?: string;
|
|
890
|
+
/**
|
|
891
|
+
* - Genre tags (e.g., ["Adventure", "Fantasy"])
|
|
892
|
+
*/
|
|
220
893
|
genre?: string[];
|
|
894
|
+
/**
|
|
895
|
+
* - Language codes
|
|
896
|
+
*/
|
|
221
897
|
languages?: YotoLanguage[];
|
|
898
|
+
/**
|
|
899
|
+
* - Maximum recommended age
|
|
900
|
+
*/
|
|
222
901
|
maxAge?: number;
|
|
902
|
+
/**
|
|
903
|
+
* - Minimum recommended age
|
|
904
|
+
*/
|
|
223
905
|
minAge?: number;
|
|
906
|
+
/**
|
|
907
|
+
* - Music types (e.g., ["Classical", "Instrumental"])
|
|
908
|
+
*/
|
|
224
909
|
musicType?: string[];
|
|
910
|
+
/**
|
|
911
|
+
* - Additional notes
|
|
912
|
+
*/
|
|
225
913
|
note?: string;
|
|
914
|
+
/**
|
|
915
|
+
* - Order
|
|
916
|
+
*/
|
|
226
917
|
order?: any;
|
|
918
|
+
/**
|
|
919
|
+
* - Preview audio URL
|
|
920
|
+
*/
|
|
227
921
|
previewAudio?: string;
|
|
922
|
+
/**
|
|
923
|
+
* - Audio preview URL (alternative field name)
|
|
924
|
+
*/
|
|
228
925
|
audioPreviewUrl?: string;
|
|
926
|
+
/**
|
|
927
|
+
* - Narrator name
|
|
928
|
+
*/
|
|
229
929
|
readBy?: string;
|
|
930
|
+
/**
|
|
931
|
+
* - Whether sharing is enabled
|
|
932
|
+
*/
|
|
230
933
|
share?: boolean;
|
|
934
|
+
/**
|
|
935
|
+
* - Content status
|
|
936
|
+
*/
|
|
231
937
|
status?: YotoStatus;
|
|
938
|
+
/**
|
|
939
|
+
* - Content tags
|
|
940
|
+
*/
|
|
232
941
|
tags?: string[];
|
|
942
|
+
/**
|
|
943
|
+
* - Podcast feed URL
|
|
944
|
+
*/
|
|
233
945
|
feedUrl?: string | null;
|
|
946
|
+
/**
|
|
947
|
+
* - Number of episodes (for podcasts)
|
|
948
|
+
*/
|
|
234
949
|
numEpisodes?: number;
|
|
950
|
+
/**
|
|
951
|
+
* - Playback direction for podcasts
|
|
952
|
+
*/
|
|
235
953
|
playbackDirection?: YotoPlaybackDirection;
|
|
954
|
+
/**
|
|
955
|
+
* - Whether content is hidden
|
|
956
|
+
*/
|
|
236
957
|
hidden?: boolean;
|
|
958
|
+
/**
|
|
959
|
+
* - List data
|
|
960
|
+
*/
|
|
237
961
|
list?: any[];
|
|
238
962
|
};
|
|
239
963
|
export type YotoCreateOrUpdateContentRequest = {
|
|
964
|
+
/**
|
|
965
|
+
* - Card ID for updating existing content (omit for creating new)
|
|
966
|
+
*/
|
|
240
967
|
cardId?: string;
|
|
968
|
+
/**
|
|
969
|
+
* - Card title
|
|
970
|
+
*/
|
|
241
971
|
title: string;
|
|
972
|
+
/**
|
|
973
|
+
* - Content configuration
|
|
974
|
+
*/
|
|
242
975
|
content: YotoContentInput;
|
|
976
|
+
/**
|
|
977
|
+
* - Card metadata
|
|
978
|
+
*/
|
|
243
979
|
metadata?: YotoMetadataInput;
|
|
244
980
|
};
|
|
245
981
|
export type YotoContentInput = {
|
|
982
|
+
/**
|
|
983
|
+
* - Array of chapters
|
|
984
|
+
*/
|
|
246
985
|
chapters?: YotoChapter[];
|
|
986
|
+
/**
|
|
987
|
+
* - Content configuration
|
|
988
|
+
*/
|
|
247
989
|
config?: YotoContentConfig;
|
|
990
|
+
/**
|
|
991
|
+
* - Playback type (e.g., 'linear')
|
|
992
|
+
*/
|
|
248
993
|
playbackType?: string;
|
|
249
994
|
};
|
|
250
995
|
export type YotoMetadataInput = {
|
|
996
|
+
/**
|
|
997
|
+
* - Content description
|
|
998
|
+
*/
|
|
251
999
|
description?: string;
|
|
1000
|
+
/**
|
|
1001
|
+
* - Metadata title
|
|
1002
|
+
*/
|
|
252
1003
|
title?: string;
|
|
253
1004
|
};
|
|
254
1005
|
export type YotoCreateOrUpdateContentResponse = {
|
|
255
1006
|
card: YotoCreatedCard;
|
|
256
1007
|
};
|
|
257
1008
|
export type YotoCreatedCard = {
|
|
1009
|
+
/**
|
|
1010
|
+
* - MongoDB document ID
|
|
1011
|
+
*/
|
|
258
1012
|
_id: string;
|
|
1013
|
+
/**
|
|
1014
|
+
* - Card ID
|
|
1015
|
+
*/
|
|
259
1016
|
cardId: string;
|
|
260
1017
|
content: YotoCreatedContent;
|
|
261
1018
|
createdAt: string;
|
|
@@ -270,6 +1027,9 @@ export type YotoCreatedContent = {
|
|
|
270
1027
|
playbackType: string;
|
|
271
1028
|
};
|
|
272
1029
|
export type YotoDeleteContentResponse = {
|
|
1030
|
+
/**
|
|
1031
|
+
* - Status of the delete operation (e.g., 'ok')
|
|
1032
|
+
*/
|
|
273
1033
|
status: string;
|
|
274
1034
|
};
|
|
275
1035
|
//# sourceMappingURL=content.d.ts.map
|