musora-content-services 1.0.147 → 1.0.150
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/CHANGELOG.md +6 -0
- package/docs/config.js.html +2 -2
- package/docs/index.html +2 -2
- package/docs/module-Config.html +2 -2
- package/docs/module-Railcontent-Services.html +2593 -221
- package/docs/module-Sanity-Services.html +30 -30
- package/docs/railcontent.js.html +308 -5
- package/docs/sanity.js.html +7 -3
- package/link_mcs.sh +0 -0
- package/package.json +1 -1
- package/src/contentTypeConfig.js +3 -0
- package/src/index.d.ts +61 -4
- package/src/index.js +61 -4
- package/src/services/contentLikes.js +11 -11
- package/src/services/contentProgress.js +153 -0
- package/src/services/dataContext.js +3 -2
- package/src/services/railcontent.js +363 -6
- package/src/services/sanity.js +74 -0
- package/test/contentLikes.test.js +1 -1
- package/test/contentProgress.test.js +56 -0
- package/test/sanityQueryService.test.js +84 -49
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
<nav >
|
|
30
30
|
|
|
31
31
|
|
|
32
|
-
<h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-Config.html">Config</a><ul class='methods'><li data-type='method'><a href="module-Config.html#~initializeService">initializeService</a></li></ul></li><li><a href="module-Railcontent-Services.html">Railcontent-Services</a><ul class='methods'><li data-type='method'><a href="module-Railcontent-Services.html#.fetchAllCompletedStates">fetchAllCompletedStates</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchCompletedContent">fetchCompletedContent</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchCompletedState">fetchCompletedState</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchContentInProgress">fetchContentInProgress</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchContentPageUserData">fetchContentPageUserData</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchSongsInProgress">fetchSongsInProgress</a></li></ul></li><li><a href="module-Sanity-Services.html">Sanity-Services</a><ul class='methods'><li data-type='method'><a href="module-Sanity-Services.html#.fetchAll">fetchAll</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchAllFilterOptions">fetchAllFilterOptions</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchAllPacks">fetchAllPacks</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchAllSongs">fetchAllSongs</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchArtistLessons">fetchArtistLessons</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchArtists">fetchArtists</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchByRailContentId">fetchByRailContentId</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchByRailContentIds">fetchByRailContentIds</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchByReference">fetchByReference</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchCatalogMetadata">fetchCatalogMetadata</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchChallengeOverview">fetchChallengeOverview</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchChildren">fetchChildren</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchCoachLessons">fetchCoachLessons</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchCourseOverview">fetchCourseOverview</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchFoundation">fetchFoundation</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchGenreLessons">fetchGenreLessons</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchLessonContent">fetchLessonContent</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchMetadata">fetchMetadata</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchMethod">fetchMethod</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchMethodChildren">fetchMethodChildren</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchMethodChildrenIds">fetchMethodChildrenIds</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchMethodNextLesson">fetchMethodNextLesson</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchMethodPreviousNextLesson">fetchMethodPreviousNextLesson</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchMethods">fetchMethods</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchNewReleases">fetchNewReleases</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchNextPreviousLesson">fetchNextPreviousLesson</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchPackAll">fetchPackAll</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchPackChildren">fetchPackChildren</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchPackData">fetchPackData</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchParentByRailContentId">fetchParentByRailContentId</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchParentForDownload">fetchParentForDownload</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchRelatedLessons">fetchRelatedLessons</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchRelatedMethodLessons">fetchRelatedMethodLessons</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchRelatedSongs">fetchRelatedSongs</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchSanity">fetchSanity</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchScheduledReleases">fetchScheduledReleases</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchShowsData">fetchShowsData</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchSongArtistCount">fetchSongArtistCount</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchSongById">fetchSongById</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchSongCount">fetchSongCount</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchSongFilterOptions">fetchSongFilterOptions</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchUpcomingEvents">fetchUpcomingEvents</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchWorkouts">fetchWorkouts</a></li></ul></li></ul>
|
|
32
|
+
<h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-Config.html">Config</a><ul class='methods'><li data-type='method'><a href="module-Config.html#~initializeService">initializeService</a></li></ul></li><li><a href="module-Railcontent-Services.html">Railcontent-Services</a><ul class='methods'><li data-type='method'><a href="module-Railcontent-Services.html#.createPlaylist">createPlaylist</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.deletePlaylist">deletePlaylist</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.deletePlaylistLike">deletePlaylistLike</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.duplicatePlaylist">duplicatePlaylist</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchAllCompletedStates">fetchAllCompletedStates</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchCompletedContent">fetchCompletedContent</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchCompletedState">fetchCompletedState</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchContentInProgress">fetchContentInProgress</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchContentPageUserData">fetchContentPageUserData</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchPlaylist">fetchPlaylist</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchPlaylistItems">fetchPlaylistItems</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchSongsInProgress">fetchSongsInProgress</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchUserPlaylists">fetchUserPlaylists</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.likePlaylist">likePlaylist</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.updatePlaylist">updatePlaylist</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.updatePlaylistItem">updatePlaylistItem</a></li></ul></li><li><a href="module-Sanity-Services.html">Sanity-Services</a><ul class='methods'><li data-type='method'><a href="module-Sanity-Services.html#.fetchAll">fetchAll</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchAllFilterOptions">fetchAllFilterOptions</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchAllPacks">fetchAllPacks</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchAllSongs">fetchAllSongs</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchArtistLessons">fetchArtistLessons</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchArtists">fetchArtists</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchByRailContentId">fetchByRailContentId</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchByRailContentIds">fetchByRailContentIds</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchByReference">fetchByReference</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchCatalogMetadata">fetchCatalogMetadata</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchChallengeOverview">fetchChallengeOverview</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchChildren">fetchChildren</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchCoachLessons">fetchCoachLessons</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchCourseOverview">fetchCourseOverview</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchFoundation">fetchFoundation</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchGenreLessons">fetchGenreLessons</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchLessonContent">fetchLessonContent</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchMetadata">fetchMetadata</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchMethod">fetchMethod</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchMethodChildren">fetchMethodChildren</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchMethodChildrenIds">fetchMethodChildrenIds</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchMethodNextLesson">fetchMethodNextLesson</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchMethodPreviousNextLesson">fetchMethodPreviousNextLesson</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchMethods">fetchMethods</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchNewReleases">fetchNewReleases</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchNextPreviousLesson">fetchNextPreviousLesson</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchPackAll">fetchPackAll</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchPackChildren">fetchPackChildren</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchPackData">fetchPackData</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchParentByRailContentId">fetchParentByRailContentId</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchParentForDownload">fetchParentForDownload</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchRelatedLessons">fetchRelatedLessons</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchRelatedMethodLessons">fetchRelatedMethodLessons</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchRelatedSongs">fetchRelatedSongs</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchSanity">fetchSanity</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchScheduledReleases">fetchScheduledReleases</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchShowsData">fetchShowsData</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchSongArtistCount">fetchSongArtistCount</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchSongById">fetchSongById</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchSongCount">fetchSongCount</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchSongFilterOptions">fetchSongFilterOptions</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchUpcomingEvents">fetchUpcomingEvents</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchWorkouts">fetchWorkouts</a></li></ul></li></ul>
|
|
33
33
|
|
|
34
34
|
</nav>
|
|
35
35
|
|
|
@@ -166,7 +166,7 @@
|
|
|
166
166
|
|
|
167
167
|
|
|
168
168
|
|
|
169
|
-
<h4 class="name" id=".
|
|
169
|
+
<h4 class="name" id=".createPlaylist"><span class="type-signature type-signature-static">(static) </span>createPlaylist<span class="signature">(playlistData)</span><span class="type-signature"> → {Promise.<Object>}</span></h4>
|
|
170
170
|
|
|
171
171
|
|
|
172
172
|
|
|
@@ -176,13 +176,16 @@
|
|
|
176
176
|
<dl class="details">
|
|
177
177
|
|
|
178
178
|
<dt class="tag-description">Description:</dt>
|
|
179
|
-
<dd class="tag-description"><ul class="dummy"><li>
|
|
179
|
+
<dd class="tag-description"><ul class="dummy"><li>Creates a new user playlist by sending a POST request with playlist data to the API.
|
|
180
|
+
|
|
181
|
+
This function calls the `/playlists/playlist` endpoint, where the server validates the incoming data and associates
|
|
182
|
+
the new playlist with the authenticated user. The `name` field is required, while other fields are optional.</li></ul></dd>
|
|
180
183
|
|
|
181
184
|
|
|
182
185
|
|
|
183
186
|
<dt class="tag-source">Source:</dt>
|
|
184
187
|
<dd class="tag-source"><ul class="dummy"><li>
|
|
185
|
-
<a href="railcontent.js.html">railcontent.js</a>, <a href="railcontent.js.html#
|
|
188
|
+
<a href="railcontent.js.html">railcontent.js</a>, <a href="railcontent.js.html#line483">line 483</a>
|
|
186
189
|
</li></ul></dd>
|
|
187
190
|
|
|
188
191
|
|
|
@@ -229,9 +232,9 @@
|
|
|
229
232
|
|
|
230
233
|
<h5 class="h5-examples">Example</h5>
|
|
231
234
|
|
|
232
|
-
<pre class="prettyprint"><code>
|
|
233
|
-
.then(
|
|
234
|
-
.catch(error => console.error(error));</code></pre>
|
|
235
|
+
<pre class="prettyprint"><code>createPlaylist({ name: "My Playlist", description: "A cool playlist", private: true })
|
|
236
|
+
.then(response => console.log(response.message))
|
|
237
|
+
.catch(error => console.error('Error creating playlist:', error));</code></pre>
|
|
235
238
|
|
|
236
239
|
|
|
237
240
|
|
|
@@ -261,13 +264,13 @@
|
|
|
261
264
|
|
|
262
265
|
<tr>
|
|
263
266
|
|
|
264
|
-
<td class="name"><code>
|
|
267
|
+
<td class="name"><code>playlistData</code></td>
|
|
265
268
|
|
|
266
269
|
|
|
267
270
|
<td class="type">
|
|
268
271
|
|
|
269
272
|
|
|
270
|
-
<span class="param-type">
|
|
273
|
+
<span class="param-type">Object</span>
|
|
271
274
|
|
|
272
275
|
|
|
273
276
|
|
|
@@ -278,7 +281,13 @@
|
|
|
278
281
|
|
|
279
282
|
|
|
280
283
|
|
|
281
|
-
<td class="description last">An
|
|
284
|
+
<td class="description last">An object containing data to create the playlist. The fields include:
|
|
285
|
+
- `name` (string): The name of the new playlist (required, max 255 characters).
|
|
286
|
+
- `description` (string): A description of the playlist (optional, max 1000 characters).
|
|
287
|
+
- `category` (string): The category of the playlist.
|
|
288
|
+
- `thumbnail_url` (string): The URL of the playlist thumbnail (optional, must be a valid URL).
|
|
289
|
+
- `private` (boolean): Whether the playlist is private (optional, defaults to true).
|
|
290
|
+
- `brand` (string): Brand identifier for the playlist.</td>
|
|
282
291
|
</tr>
|
|
283
292
|
|
|
284
293
|
|
|
@@ -304,7 +313,11 @@
|
|
|
304
313
|
|
|
305
314
|
|
|
306
315
|
<div class="param-desc">
|
|
307
|
-
-
|
|
316
|
+
- A promise that resolves to the created playlist data if successful, or an error response if validation fails.
|
|
317
|
+
|
|
318
|
+
The server response includes:
|
|
319
|
+
- `message`: Success message indicating playlist creation (e.g., "Playlist created successfully").
|
|
320
|
+
- `playlist`: The data for the created playlist, including the `user_id` of the authenticated user.
|
|
308
321
|
</div>
|
|
309
322
|
|
|
310
323
|
|
|
@@ -315,7 +328,7 @@
|
|
|
315
328
|
</dt>
|
|
316
329
|
<dd>
|
|
317
330
|
|
|
318
|
-
<span class="param-type">Promise.<
|
|
331
|
+
<span class="param-type">Promise.<Object></span>
|
|
319
332
|
|
|
320
333
|
|
|
321
334
|
|
|
@@ -331,7 +344,7 @@
|
|
|
331
344
|
|
|
332
345
|
|
|
333
346
|
|
|
334
|
-
<h4 class="name" id=".
|
|
347
|
+
<h4 class="name" id=".deletePlaylist"><span class="type-signature type-signature-static">(static) </span>deletePlaylist<span class="signature">(playlistId)</span><span class="type-signature"> → {Promise.<Object>}</span></h4>
|
|
335
348
|
|
|
336
349
|
|
|
337
350
|
|
|
@@ -341,13 +354,16 @@
|
|
|
341
354
|
<dl class="details">
|
|
342
355
|
|
|
343
356
|
<dt class="tag-description">Description:</dt>
|
|
344
|
-
<dd class="tag-description"><ul class="dummy"><li>
|
|
357
|
+
<dd class="tag-description"><ul class="dummy"><li>Deletes a user’s playlist along with all associated items by sending a DELETE request to the API.
|
|
358
|
+
|
|
359
|
+
This function calls the `/playlists/playlist` endpoint, where the server verifies the user’s ownership of the specified playlist.
|
|
360
|
+
If the user is authorized, it deletes both the playlist and its associated items.</li></ul></dd>
|
|
345
361
|
|
|
346
362
|
|
|
347
363
|
|
|
348
364
|
<dt class="tag-source">Source:</dt>
|
|
349
365
|
<dd class="tag-source"><ul class="dummy"><li>
|
|
350
|
-
<a href="railcontent.js.html">railcontent.js</a>, <a href="railcontent.js.html#
|
|
366
|
+
<a href="railcontent.js.html">railcontent.js</a>, <a href="railcontent.js.html#line417">line 417</a>
|
|
351
367
|
</li></ul></dd>
|
|
352
368
|
|
|
353
369
|
|
|
@@ -394,9 +410,13 @@
|
|
|
394
410
|
|
|
395
411
|
<h5 class="h5-examples">Example</h5>
|
|
396
412
|
|
|
397
|
-
<pre class="prettyprint"><code>
|
|
398
|
-
.then(
|
|
399
|
-
|
|
413
|
+
<pre class="prettyprint"><code>deletePlaylist(12345)
|
|
414
|
+
.then(response => {
|
|
415
|
+
if (response.success) {
|
|
416
|
+
console.log(response.message);
|
|
417
|
+
}
|
|
418
|
+
})
|
|
419
|
+
.catch(error => console.error('Error deleting playlist:', error));</code></pre>
|
|
400
420
|
|
|
401
421
|
|
|
402
422
|
|
|
@@ -414,12 +434,8 @@
|
|
|
414
434
|
<th>Type</th>
|
|
415
435
|
|
|
416
436
|
|
|
417
|
-
<th>Attributes</th>
|
|
418
|
-
|
|
419
437
|
|
|
420
438
|
|
|
421
|
-
<th>Default</th>
|
|
422
|
-
|
|
423
439
|
|
|
424
440
|
<th class="last">Description</th>
|
|
425
441
|
</tr>
|
|
@@ -430,124 +446,15 @@
|
|
|
430
446
|
|
|
431
447
|
<tr>
|
|
432
448
|
|
|
433
|
-
<td class="name"><code>
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
<td class="type">
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
<span class="param-type">string</span>
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
</td>
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
<td class="attributes">
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
</td>
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
<td class="default">
|
|
458
|
-
|
|
459
|
-
</td>
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
<td class="description last">The content type associated with the content.</td>
|
|
463
|
-
</tr>
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
<tr>
|
|
468
|
-
|
|
469
|
-
<td class="name"><code>brand</code></td>
|
|
449
|
+
<td class="name"><code>playlistId</code></td>
|
|
470
450
|
|
|
471
451
|
|
|
472
452
|
<td class="type">
|
|
473
453
|
|
|
474
454
|
|
|
475
455
|
<span class="param-type">string</span>
|
|
456
|
+
|
|
|
476
457
|
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
</td>
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
<td class="attributes">
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
</td>
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
<td class="default">
|
|
494
|
-
|
|
495
|
-
</td>
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
<td class="description last">The brand associated with the content.</td>
|
|
499
|
-
</tr>
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
<tr>
|
|
504
|
-
|
|
505
|
-
<td class="name"><code>params.limit</code></td>
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
<td class="type">
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
<span class="param-type">number</span>
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
</td>
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
<td class="attributes">
|
|
520
|
-
|
|
521
|
-
<optional><br>
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
</td>
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
<td class="default">
|
|
532
|
-
|
|
533
|
-
<code>20</code>
|
|
534
|
-
|
|
535
|
-
</td>
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
<td class="description last">The limit of results per page.</td>
|
|
539
|
-
</tr>
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
<tr>
|
|
544
|
-
|
|
545
|
-
<td class="name"><code>params.page</code></td>
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
<td class="type">
|
|
549
|
-
|
|
550
|
-
|
|
551
458
|
<span class="param-type">number</span>
|
|
552
459
|
|
|
553
460
|
|
|
@@ -556,26 +463,10 @@
|
|
|
556
463
|
</td>
|
|
557
464
|
|
|
558
465
|
|
|
559
|
-
<td class="attributes">
|
|
560
|
-
|
|
561
|
-
<optional><br>
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
</td>
|
|
568
|
-
|
|
569
466
|
|
|
570
467
|
|
|
571
|
-
<td class="default">
|
|
572
|
-
|
|
573
|
-
<code>1</code>
|
|
574
|
-
|
|
575
|
-
</td>
|
|
576
|
-
|
|
577
468
|
|
|
578
|
-
<td class="description last">The
|
|
469
|
+
<td class="description last">The unique identifier of the playlist to be deleted.</td>
|
|
579
470
|
</tr>
|
|
580
471
|
|
|
581
472
|
|
|
@@ -601,7 +492,11 @@
|
|
|
601
492
|
|
|
602
493
|
|
|
603
494
|
<div class="param-desc">
|
|
604
|
-
-
|
|
495
|
+
- A promise that resolves to an object containing:
|
|
496
|
+
- `success` (boolean): Indicates if the deletion was successful (`true` for success).
|
|
497
|
+
- `message` (string): Success confirmation message (e.g., "Playlist and associated items deleted successfully").
|
|
498
|
+
|
|
499
|
+
If the user is unauthorized or the playlist does not exist, the promise rejects with an error.
|
|
605
500
|
</div>
|
|
606
501
|
|
|
607
502
|
|
|
@@ -612,7 +507,7 @@
|
|
|
612
507
|
</dt>
|
|
613
508
|
<dd>
|
|
614
509
|
|
|
615
|
-
<span class="param-type">Promise.<
|
|
510
|
+
<span class="param-type">Promise.<Object></span>
|
|
616
511
|
|
|
617
512
|
|
|
618
513
|
|
|
@@ -628,7 +523,7 @@
|
|
|
628
523
|
|
|
629
524
|
|
|
630
525
|
|
|
631
|
-
<h4 class="name" id=".
|
|
526
|
+
<h4 class="name" id=".deletePlaylistLike"><span class="type-signature type-signature-static">(static) </span>deletePlaylistLike<span class="signature">(playlistId)</span><span class="type-signature"> → {Promise.<Object>}</span></h4>
|
|
632
527
|
|
|
633
528
|
|
|
634
529
|
|
|
@@ -638,13 +533,16 @@
|
|
|
638
533
|
<dl class="details">
|
|
639
534
|
|
|
640
535
|
<dt class="tag-description">Description:</dt>
|
|
641
|
-
<dd class="tag-description"><ul class="dummy"><li>
|
|
536
|
+
<dd class="tag-description"><ul class="dummy"><li>Removes a "like" from a playlist for the authenticated user.
|
|
537
|
+
|
|
538
|
+
This function sends a DELETE request to the `/playlists/like` endpoint, where the server validates the `playlist_id`
|
|
539
|
+
and checks if a like by the authenticated user already exists for the specified playlist. If so, it deletes the like.</li></ul></dd>
|
|
642
540
|
|
|
643
541
|
|
|
644
542
|
|
|
645
543
|
<dt class="tag-source">Source:</dt>
|
|
646
544
|
<dd class="tag-source"><ul class="dummy"><li>
|
|
647
|
-
<a href="railcontent.js.html">railcontent.js</a>, <a href="railcontent.js.html#
|
|
545
|
+
<a href="railcontent.js.html">railcontent.js</a>, <a href="railcontent.js.html#line543">line 543</a>
|
|
648
546
|
</li></ul></dd>
|
|
649
547
|
|
|
650
548
|
|
|
@@ -691,9 +589,13 @@
|
|
|
691
589
|
|
|
692
590
|
<h5 class="h5-examples">Example</h5>
|
|
693
591
|
|
|
694
|
-
<pre class="prettyprint"><code>
|
|
695
|
-
.then(
|
|
696
|
-
|
|
592
|
+
<pre class="prettyprint"><code>deletePlaylistLike(12345)
|
|
593
|
+
.then(response => {
|
|
594
|
+
if (response.success) {
|
|
595
|
+
console.log(response.message);
|
|
596
|
+
}
|
|
597
|
+
})
|
|
598
|
+
.catch(error => console.error('Error removing playlist like:', error));</code></pre>
|
|
697
599
|
|
|
698
600
|
|
|
699
601
|
|
|
@@ -723,13 +625,16 @@
|
|
|
723
625
|
|
|
724
626
|
<tr>
|
|
725
627
|
|
|
726
|
-
<td class="name"><code>
|
|
628
|
+
<td class="name"><code>playlistId</code></td>
|
|
727
629
|
|
|
728
630
|
|
|
729
631
|
<td class="type">
|
|
730
632
|
|
|
731
633
|
|
|
732
634
|
<span class="param-type">string</span>
|
|
635
|
+
|
|
|
636
|
+
|
|
637
|
+
<span class="param-type">number</span>
|
|
733
638
|
|
|
734
639
|
|
|
735
640
|
|
|
@@ -740,7 +645,7 @@
|
|
|
740
645
|
|
|
741
646
|
|
|
742
647
|
|
|
743
|
-
<td class="description last">The
|
|
648
|
+
<td class="description last">The unique identifier of the playlist whose like is to be removed.</td>
|
|
744
649
|
</tr>
|
|
745
650
|
|
|
746
651
|
|
|
@@ -766,7 +671,9 @@
|
|
|
766
671
|
|
|
767
672
|
|
|
768
673
|
<div class="param-desc">
|
|
769
|
-
-
|
|
674
|
+
- A promise that resolves with the response from the API. The response contains:
|
|
675
|
+
- `success` (boolean): Indicates if the removal was successful (`true` for success).
|
|
676
|
+
- `message` (string): A success message if the playlist like is removed successfully or a notification if the playlist was not previously liked.
|
|
770
677
|
</div>
|
|
771
678
|
|
|
772
679
|
|
|
@@ -777,7 +684,7 @@
|
|
|
777
684
|
</dt>
|
|
778
685
|
<dd>
|
|
779
686
|
|
|
780
|
-
<span class="param-type">Promise.<
|
|
687
|
+
<span class="param-type">Promise.<Object></span>
|
|
781
688
|
|
|
782
689
|
|
|
783
690
|
|
|
@@ -793,7 +700,7 @@
|
|
|
793
700
|
|
|
794
701
|
|
|
795
702
|
|
|
796
|
-
<h4 class="name" id=".
|
|
703
|
+
<h4 class="name" id=".duplicatePlaylist"><span class="type-signature type-signature-static">(static) </span>duplicatePlaylist<span class="signature">(playlistId, playlistData<span class="signature-attributes">opt</span>)</span><span class="type-signature"> → {Promise.<Object>}</span></h4>
|
|
797
704
|
|
|
798
705
|
|
|
799
706
|
|
|
@@ -803,13 +710,17 @@
|
|
|
803
710
|
<dl class="details">
|
|
804
711
|
|
|
805
712
|
<dt class="tag-description">Description:</dt>
|
|
806
|
-
<dd class="tag-description"><ul class="dummy"><li>
|
|
713
|
+
<dd class="tag-description"><ul class="dummy"><li>Duplicates an existing playlist by sending a POST request to the API.
|
|
714
|
+
|
|
715
|
+
This function calls the `/playlists/duplicate` endpoint, where the server replicates the specified playlist,
|
|
716
|
+
including its items. Optionally, new `name`, `description`, `category`, or `thumbnail_url` parameters can be provided
|
|
717
|
+
to customize the duplicated playlist. If a new name is not provided, the server appends " (Duplicate)" to the original name.</li></ul></dd>
|
|
807
718
|
|
|
808
719
|
|
|
809
720
|
|
|
810
721
|
<dt class="tag-source">Source:</dt>
|
|
811
722
|
<dd class="tag-source"><ul class="dummy"><li>
|
|
812
|
-
<a href="railcontent.js.html">railcontent.js</a>, <a href="railcontent.js.html#
|
|
723
|
+
<a href="railcontent.js.html">railcontent.js</a>, <a href="railcontent.js.html#line389">line 389</a>
|
|
813
724
|
</li></ul></dd>
|
|
814
725
|
|
|
815
726
|
|
|
@@ -856,9 +767,9 @@
|
|
|
856
767
|
|
|
857
768
|
<h5 class="h5-examples">Example</h5>
|
|
858
769
|
|
|
859
|
-
<pre class="prettyprint"><code>
|
|
860
|
-
.then(
|
|
861
|
-
.catch(error => console.error(error));</code></pre>
|
|
770
|
+
<pre class="prettyprint"><code>duplicatePlaylist(12345, { name: "My New Playlist" })
|
|
771
|
+
.then(duplicatedPlaylist => console.log(duplicatedPlaylist))
|
|
772
|
+
.catch(error => console.error('Error duplicating playlist:', error));</code></pre>
|
|
862
773
|
|
|
863
774
|
|
|
864
775
|
|
|
@@ -880,8 +791,6 @@
|
|
|
880
791
|
|
|
881
792
|
|
|
882
793
|
|
|
883
|
-
<th>Default</th>
|
|
884
|
-
|
|
885
794
|
|
|
886
795
|
<th class="last">Description</th>
|
|
887
796
|
</tr>
|
|
@@ -892,13 +801,16 @@
|
|
|
892
801
|
|
|
893
802
|
<tr>
|
|
894
803
|
|
|
895
|
-
<td class="name"><code>
|
|
804
|
+
<td class="name"><code>playlistId</code></td>
|
|
896
805
|
|
|
897
806
|
|
|
898
807
|
<td class="type">
|
|
899
808
|
|
|
900
809
|
|
|
901
810
|
<span class="param-type">string</span>
|
|
811
|
+
|
|
|
812
|
+
|
|
813
|
+
<span class="param-type">number</span>
|
|
902
814
|
|
|
903
815
|
|
|
904
816
|
|
|
@@ -916,25 +828,21 @@
|
|
|
916
828
|
|
|
917
829
|
|
|
918
830
|
|
|
919
|
-
<td class="default">
|
|
920
|
-
|
|
921
|
-
</td>
|
|
922
|
-
|
|
923
831
|
|
|
924
|
-
<td class="description last">The
|
|
832
|
+
<td class="description last">The unique identifier of the playlist to be duplicated.</td>
|
|
925
833
|
</tr>
|
|
926
834
|
|
|
927
835
|
|
|
928
836
|
|
|
929
837
|
<tr>
|
|
930
838
|
|
|
931
|
-
<td class="name"><code>
|
|
839
|
+
<td class="name"><code>playlistData</code></td>
|
|
932
840
|
|
|
933
841
|
|
|
934
842
|
<td class="type">
|
|
935
843
|
|
|
936
844
|
|
|
937
|
-
<span class="param-type">
|
|
845
|
+
<span class="param-type">Object</span>
|
|
938
846
|
|
|
939
847
|
|
|
940
848
|
|
|
@@ -944,6 +852,8 @@
|
|
|
944
852
|
|
|
945
853
|
<td class="attributes">
|
|
946
854
|
|
|
855
|
+
<optional><br>
|
|
856
|
+
|
|
947
857
|
|
|
948
858
|
|
|
949
859
|
|
|
@@ -952,25 +862,42 @@
|
|
|
952
862
|
|
|
953
863
|
|
|
954
864
|
|
|
955
|
-
|
|
865
|
+
|
|
866
|
+
<td class="description last">Optional data to customize the duplicated playlist.
|
|
867
|
+
<h6>Properties</h6>
|
|
956
868
|
|
|
957
|
-
</td>
|
|
958
|
-
|
|
959
869
|
|
|
960
|
-
|
|
961
|
-
|
|
870
|
+
<table class="params">
|
|
871
|
+
<thead>
|
|
872
|
+
<tr>
|
|
873
|
+
|
|
874
|
+
<th>Name</th>
|
|
875
|
+
|
|
876
|
+
|
|
877
|
+
<th>Type</th>
|
|
878
|
+
|
|
879
|
+
|
|
880
|
+
<th>Attributes</th>
|
|
881
|
+
|
|
882
|
+
|
|
883
|
+
|
|
884
|
+
|
|
885
|
+
<th class="last">Description</th>
|
|
886
|
+
</tr>
|
|
887
|
+
</thead>
|
|
962
888
|
|
|
889
|
+
<tbody>
|
|
963
890
|
|
|
964
891
|
|
|
965
892
|
<tr>
|
|
966
893
|
|
|
967
|
-
<td class="name"><code>
|
|
894
|
+
<td class="name"><code>name</code></td>
|
|
968
895
|
|
|
969
896
|
|
|
970
897
|
<td class="type">
|
|
971
898
|
|
|
972
899
|
|
|
973
|
-
<span class="param-type">
|
|
900
|
+
<span class="param-type">string</span>
|
|
974
901
|
|
|
975
902
|
|
|
976
903
|
|
|
@@ -990,27 +917,21 @@
|
|
|
990
917
|
|
|
991
918
|
|
|
992
919
|
|
|
993
|
-
<td class="default">
|
|
994
|
-
|
|
995
|
-
<code>20</code>
|
|
996
|
-
|
|
997
|
-
</td>
|
|
998
|
-
|
|
999
920
|
|
|
1000
|
-
<td class="description last">
|
|
921
|
+
<td class="description last">New name for the duplicated playlist (default is original name + " (Duplicate)").</td>
|
|
1001
922
|
</tr>
|
|
1002
923
|
|
|
1003
924
|
|
|
1004
925
|
|
|
1005
926
|
<tr>
|
|
1006
927
|
|
|
1007
|
-
<td class="name"><code>
|
|
928
|
+
<td class="name"><code>description</code></td>
|
|
1008
929
|
|
|
1009
930
|
|
|
1010
931
|
<td class="type">
|
|
1011
932
|
|
|
1012
933
|
|
|
1013
|
-
<span class="param-type">
|
|
934
|
+
<span class="param-type">string</span>
|
|
1014
935
|
|
|
1015
936
|
|
|
1016
937
|
|
|
@@ -1030,19 +951,88 @@
|
|
|
1030
951
|
|
|
1031
952
|
|
|
1032
953
|
|
|
1033
|
-
<td class="default">
|
|
1034
|
-
|
|
1035
|
-
<code>1</code>
|
|
1036
|
-
|
|
1037
|
-
</td>
|
|
1038
|
-
|
|
1039
954
|
|
|
1040
|
-
<td class="description last">
|
|
955
|
+
<td class="description last">New description for the duplicated playlist (defaults to original description).</td>
|
|
1041
956
|
</tr>
|
|
1042
957
|
|
|
1043
958
|
|
|
1044
|
-
|
|
1045
|
-
|
|
959
|
+
|
|
960
|
+
<tr>
|
|
961
|
+
|
|
962
|
+
<td class="name"><code>category</code></td>
|
|
963
|
+
|
|
964
|
+
|
|
965
|
+
<td class="type">
|
|
966
|
+
|
|
967
|
+
|
|
968
|
+
<span class="param-type">string</span>
|
|
969
|
+
|
|
970
|
+
|
|
971
|
+
|
|
972
|
+
|
|
973
|
+
</td>
|
|
974
|
+
|
|
975
|
+
|
|
976
|
+
<td class="attributes">
|
|
977
|
+
|
|
978
|
+
<optional><br>
|
|
979
|
+
|
|
980
|
+
|
|
981
|
+
|
|
982
|
+
|
|
983
|
+
|
|
984
|
+
</td>
|
|
985
|
+
|
|
986
|
+
|
|
987
|
+
|
|
988
|
+
|
|
989
|
+
<td class="description last">New category for the duplicated playlist (defaults to original category).</td>
|
|
990
|
+
</tr>
|
|
991
|
+
|
|
992
|
+
|
|
993
|
+
|
|
994
|
+
<tr>
|
|
995
|
+
|
|
996
|
+
<td class="name"><code>thumbnail_url</code></td>
|
|
997
|
+
|
|
998
|
+
|
|
999
|
+
<td class="type">
|
|
1000
|
+
|
|
1001
|
+
|
|
1002
|
+
<span class="param-type">string</span>
|
|
1003
|
+
|
|
1004
|
+
|
|
1005
|
+
|
|
1006
|
+
|
|
1007
|
+
</td>
|
|
1008
|
+
|
|
1009
|
+
|
|
1010
|
+
<td class="attributes">
|
|
1011
|
+
|
|
1012
|
+
<optional><br>
|
|
1013
|
+
|
|
1014
|
+
|
|
1015
|
+
|
|
1016
|
+
|
|
1017
|
+
|
|
1018
|
+
</td>
|
|
1019
|
+
|
|
1020
|
+
|
|
1021
|
+
|
|
1022
|
+
|
|
1023
|
+
<td class="description last">New URL for the duplicated playlist thumbnail (defaults to original thumbnail).</td>
|
|
1024
|
+
</tr>
|
|
1025
|
+
|
|
1026
|
+
|
|
1027
|
+
</tbody>
|
|
1028
|
+
</table>
|
|
1029
|
+
|
|
1030
|
+
</td>
|
|
1031
|
+
</tr>
|
|
1032
|
+
|
|
1033
|
+
|
|
1034
|
+
</tbody>
|
|
1035
|
+
</table>
|
|
1046
1036
|
|
|
1047
1037
|
|
|
1048
1038
|
|
|
@@ -1063,7 +1053,14 @@
|
|
|
1063
1053
|
|
|
1064
1054
|
|
|
1065
1055
|
<div class="param-desc">
|
|
1066
|
-
-
|
|
1056
|
+
- A promise that resolves to the duplicated playlist data, or rejects with an error if the duplication fails.
|
|
1057
|
+
|
|
1058
|
+
The duplicated playlist contains:
|
|
1059
|
+
- `name` (string): Name of the new playlist.
|
|
1060
|
+
- `description` (string|null): Description of the duplicated playlist.
|
|
1061
|
+
- `category` (string|null): Category of the duplicated playlist.
|
|
1062
|
+
- `thumbnail_url` (string|null): URL of the playlist thumbnail.
|
|
1063
|
+
- `items` (Array): A list of items (e.g., songs, tracks) copied from the original playlist.
|
|
1067
1064
|
</div>
|
|
1068
1065
|
|
|
1069
1066
|
|
|
@@ -1074,7 +1071,7 @@
|
|
|
1074
1071
|
</dt>
|
|
1075
1072
|
<dd>
|
|
1076
1073
|
|
|
1077
|
-
<span class="param-type">Promise.<
|
|
1074
|
+
<span class="param-type">Promise.<Object></span>
|
|
1078
1075
|
|
|
1079
1076
|
|
|
1080
1077
|
|
|
@@ -1090,7 +1087,7 @@
|
|
|
1090
1087
|
|
|
1091
1088
|
|
|
1092
1089
|
|
|
1093
|
-
<h4 class="name" id=".
|
|
1090
|
+
<h4 class="name" id=".fetchAllCompletedStates"><span class="type-signature type-signature-static">(static) </span>fetchAllCompletedStates<span class="signature">(contentIds)</span><span class="type-signature"> → {Promise.<(Object|null)>}</span></h4>
|
|
1094
1091
|
|
|
1095
1092
|
|
|
1096
1093
|
|
|
@@ -1100,13 +1097,13 @@
|
|
|
1100
1097
|
<dl class="details">
|
|
1101
1098
|
|
|
1102
1099
|
<dt class="tag-description">Description:</dt>
|
|
1103
|
-
<dd class="tag-description"><ul class="dummy"><li>Fetches
|
|
1100
|
+
<dd class="tag-description"><ul class="dummy"><li>Fetches the completion status for multiple songs for the current user.</li></ul></dd>
|
|
1104
1101
|
|
|
1105
1102
|
|
|
1106
1103
|
|
|
1107
1104
|
<dt class="tag-source">Source:</dt>
|
|
1108
1105
|
<dd class="tag-source"><ul class="dummy"><li>
|
|
1109
|
-
<a href="railcontent.js.html">railcontent.js</a>, <a href="railcontent.js.html#
|
|
1106
|
+
<a href="railcontent.js.html">railcontent.js</a>, <a href="railcontent.js.html#line59">line 59</a>
|
|
1110
1107
|
</li></ul></dd>
|
|
1111
1108
|
|
|
1112
1109
|
|
|
@@ -1153,8 +1150,8 @@
|
|
|
1153
1150
|
|
|
1154
1151
|
<h5 class="h5-examples">Example</h5>
|
|
1155
1152
|
|
|
1156
|
-
<pre class="prettyprint"><code>
|
|
1157
|
-
.then(
|
|
1153
|
+
<pre class="prettyprint"><code>fetchAllCompletedStates('user123', ['song456', 'song789'], 'csrf-token')
|
|
1154
|
+
.then(statuses => console.log(statuses))
|
|
1158
1155
|
.catch(error => console.error(error));</code></pre>
|
|
1159
1156
|
|
|
1160
1157
|
|
|
@@ -1185,13 +1182,13 @@
|
|
|
1185
1182
|
|
|
1186
1183
|
<tr>
|
|
1187
1184
|
|
|
1188
|
-
<td class="name"><code>
|
|
1185
|
+
<td class="name"><code>contentIds</code></td>
|
|
1189
1186
|
|
|
1190
1187
|
|
|
1191
1188
|
<td class="type">
|
|
1192
1189
|
|
|
1193
1190
|
|
|
1194
|
-
<span class="param-type">
|
|
1191
|
+
<span class="param-type">Array.<string></span>
|
|
1195
1192
|
|
|
1196
1193
|
|
|
1197
1194
|
|
|
@@ -1202,7 +1199,7 @@
|
|
|
1202
1199
|
|
|
1203
1200
|
|
|
1204
1201
|
|
|
1205
|
-
<td class="description last">
|
|
1202
|
+
<td class="description last">An array of content IDs to check.</td>
|
|
1206
1203
|
</tr>
|
|
1207
1204
|
|
|
1208
1205
|
|
|
@@ -1228,7 +1225,7 @@
|
|
|
1228
1225
|
|
|
1229
1226
|
|
|
1230
1227
|
<div class="param-desc">
|
|
1231
|
-
- Returns an object containing
|
|
1228
|
+
- Returns an object containing completion statuses keyed by content ID, or null if an error occurs.
|
|
1232
1229
|
</div>
|
|
1233
1230
|
|
|
1234
1231
|
|
|
@@ -1255,7 +1252,7 @@
|
|
|
1255
1252
|
|
|
1256
1253
|
|
|
1257
1254
|
|
|
1258
|
-
<h4 class="name" id=".
|
|
1255
|
+
<h4 class="name" id=".fetchCompletedContent"><span class="type-signature type-signature-static">(static) </span>fetchCompletedContent<span class="signature">(type, brand)</span><span class="type-signature"> → {Promise.<(Object|null)>}</span></h4>
|
|
1259
1256
|
|
|
1260
1257
|
|
|
1261
1258
|
|
|
@@ -1265,13 +1262,13 @@
|
|
|
1265
1262
|
<dl class="details">
|
|
1266
1263
|
|
|
1267
1264
|
<dt class="tag-description">Description:</dt>
|
|
1268
|
-
<dd class="tag-description"><ul class="dummy"><li>Fetches a list of
|
|
1265
|
+
<dd class="tag-description"><ul class="dummy"><li>Fetches a list of content that has been completed for the current user.</li></ul></dd>
|
|
1269
1266
|
|
|
1270
1267
|
|
|
1271
1268
|
|
|
1272
1269
|
<dt class="tag-source">Source:</dt>
|
|
1273
1270
|
<dd class="tag-source"><ul class="dummy"><li>
|
|
1274
|
-
<a href="railcontent.js.html">railcontent.js</a>, <a href="railcontent.js.html#
|
|
1271
|
+
<a href="railcontent.js.html">railcontent.js</a>, <a href="railcontent.js.html#line169">line 169</a>
|
|
1275
1272
|
</li></ul></dd>
|
|
1276
1273
|
|
|
1277
1274
|
|
|
@@ -1318,7 +1315,7 @@
|
|
|
1318
1315
|
|
|
1319
1316
|
<h5 class="h5-examples">Example</h5>
|
|
1320
1317
|
|
|
1321
|
-
<pre class="prettyprint"><code>
|
|
1318
|
+
<pre class="prettyprint"><code>fetchCompletedContent('song', 'drumeo')
|
|
1322
1319
|
.then(songs => console.log(songs))
|
|
1323
1320
|
.catch(error => console.error(error));</code></pre>
|
|
1324
1321
|
|
|
@@ -1338,8 +1335,12 @@
|
|
|
1338
1335
|
<th>Type</th>
|
|
1339
1336
|
|
|
1340
1337
|
|
|
1338
|
+
<th>Attributes</th>
|
|
1339
|
+
|
|
1341
1340
|
|
|
1342
1341
|
|
|
1342
|
+
<th>Default</th>
|
|
1343
|
+
|
|
1343
1344
|
|
|
1344
1345
|
<th class="last">Description</th>
|
|
1345
1346
|
</tr>
|
|
@@ -1348,6 +1349,42 @@
|
|
|
1348
1349
|
<tbody>
|
|
1349
1350
|
|
|
1350
1351
|
|
|
1352
|
+
<tr>
|
|
1353
|
+
|
|
1354
|
+
<td class="name"><code>type</code></td>
|
|
1355
|
+
|
|
1356
|
+
|
|
1357
|
+
<td class="type">
|
|
1358
|
+
|
|
1359
|
+
|
|
1360
|
+
<span class="param-type">string</span>
|
|
1361
|
+
|
|
1362
|
+
|
|
1363
|
+
|
|
1364
|
+
|
|
1365
|
+
</td>
|
|
1366
|
+
|
|
1367
|
+
|
|
1368
|
+
<td class="attributes">
|
|
1369
|
+
|
|
1370
|
+
|
|
1371
|
+
|
|
1372
|
+
|
|
1373
|
+
|
|
1374
|
+
</td>
|
|
1375
|
+
|
|
1376
|
+
|
|
1377
|
+
|
|
1378
|
+
<td class="default">
|
|
1379
|
+
|
|
1380
|
+
</td>
|
|
1381
|
+
|
|
1382
|
+
|
|
1383
|
+
<td class="description last">The content type associated with the content.</td>
|
|
1384
|
+
</tr>
|
|
1385
|
+
|
|
1386
|
+
|
|
1387
|
+
|
|
1351
1388
|
<tr>
|
|
1352
1389
|
|
|
1353
1390
|
<td class="name"><code>brand</code></td>
|
|
@@ -1364,10 +1401,102 @@
|
|
|
1364
1401
|
</td>
|
|
1365
1402
|
|
|
1366
1403
|
|
|
1404
|
+
<td class="attributes">
|
|
1405
|
+
|
|
1406
|
+
|
|
1407
|
+
|
|
1367
1408
|
|
|
1409
|
+
|
|
1410
|
+
</td>
|
|
1368
1411
|
|
|
1369
1412
|
|
|
1370
|
-
|
|
1413
|
+
|
|
1414
|
+
<td class="default">
|
|
1415
|
+
|
|
1416
|
+
</td>
|
|
1417
|
+
|
|
1418
|
+
|
|
1419
|
+
<td class="description last">The brand associated with the content.</td>
|
|
1420
|
+
</tr>
|
|
1421
|
+
|
|
1422
|
+
|
|
1423
|
+
|
|
1424
|
+
<tr>
|
|
1425
|
+
|
|
1426
|
+
<td class="name"><code>params.limit</code></td>
|
|
1427
|
+
|
|
1428
|
+
|
|
1429
|
+
<td class="type">
|
|
1430
|
+
|
|
1431
|
+
|
|
1432
|
+
<span class="param-type">number</span>
|
|
1433
|
+
|
|
1434
|
+
|
|
1435
|
+
|
|
1436
|
+
|
|
1437
|
+
</td>
|
|
1438
|
+
|
|
1439
|
+
|
|
1440
|
+
<td class="attributes">
|
|
1441
|
+
|
|
1442
|
+
<optional><br>
|
|
1443
|
+
|
|
1444
|
+
|
|
1445
|
+
|
|
1446
|
+
|
|
1447
|
+
|
|
1448
|
+
</td>
|
|
1449
|
+
|
|
1450
|
+
|
|
1451
|
+
|
|
1452
|
+
<td class="default">
|
|
1453
|
+
|
|
1454
|
+
<code>20</code>
|
|
1455
|
+
|
|
1456
|
+
</td>
|
|
1457
|
+
|
|
1458
|
+
|
|
1459
|
+
<td class="description last">The limit of results per page.</td>
|
|
1460
|
+
</tr>
|
|
1461
|
+
|
|
1462
|
+
|
|
1463
|
+
|
|
1464
|
+
<tr>
|
|
1465
|
+
|
|
1466
|
+
<td class="name"><code>params.page</code></td>
|
|
1467
|
+
|
|
1468
|
+
|
|
1469
|
+
<td class="type">
|
|
1470
|
+
|
|
1471
|
+
|
|
1472
|
+
<span class="param-type">number</span>
|
|
1473
|
+
|
|
1474
|
+
|
|
1475
|
+
|
|
1476
|
+
|
|
1477
|
+
</td>
|
|
1478
|
+
|
|
1479
|
+
|
|
1480
|
+
<td class="attributes">
|
|
1481
|
+
|
|
1482
|
+
<optional><br>
|
|
1483
|
+
|
|
1484
|
+
|
|
1485
|
+
|
|
1486
|
+
|
|
1487
|
+
|
|
1488
|
+
</td>
|
|
1489
|
+
|
|
1490
|
+
|
|
1491
|
+
|
|
1492
|
+
<td class="default">
|
|
1493
|
+
|
|
1494
|
+
<code>1</code>
|
|
1495
|
+
|
|
1496
|
+
</td>
|
|
1497
|
+
|
|
1498
|
+
|
|
1499
|
+
<td class="description last">The page number for pagination.</td>
|
|
1371
1500
|
</tr>
|
|
1372
1501
|
|
|
1373
1502
|
|
|
@@ -1393,7 +1522,2250 @@
|
|
|
1393
1522
|
|
|
1394
1523
|
|
|
1395
1524
|
<div class="param-desc">
|
|
1396
|
-
- Returns an object containing in-progress
|
|
1525
|
+
- Returns an object containing in-progress content if found, otherwise null.
|
|
1526
|
+
</div>
|
|
1527
|
+
|
|
1528
|
+
|
|
1529
|
+
|
|
1530
|
+
<dl class="param-type">
|
|
1531
|
+
<dt>
|
|
1532
|
+
Type
|
|
1533
|
+
</dt>
|
|
1534
|
+
<dd>
|
|
1535
|
+
|
|
1536
|
+
<span class="param-type">Promise.<(Object|null)></span>
|
|
1537
|
+
|
|
1538
|
+
|
|
1539
|
+
|
|
1540
|
+
</dd>
|
|
1541
|
+
</dl>
|
|
1542
|
+
|
|
1543
|
+
|
|
1544
|
+
|
|
1545
|
+
|
|
1546
|
+
|
|
1547
|
+
|
|
1548
|
+
|
|
1549
|
+
|
|
1550
|
+
|
|
1551
|
+
|
|
1552
|
+
<h4 class="name" id=".fetchCompletedState"><span class="type-signature type-signature-static">(static) </span>fetchCompletedState<span class="signature">(content_id)</span><span class="type-signature"> → {Promise.<(Object|null)>}</span></h4>
|
|
1553
|
+
|
|
1554
|
+
|
|
1555
|
+
|
|
1556
|
+
|
|
1557
|
+
|
|
1558
|
+
|
|
1559
|
+
<dl class="details">
|
|
1560
|
+
|
|
1561
|
+
<dt class="tag-description">Description:</dt>
|
|
1562
|
+
<dd class="tag-description"><ul class="dummy"><li>Fetches the completion status of a specific lesson for the current user.</li></ul></dd>
|
|
1563
|
+
|
|
1564
|
+
|
|
1565
|
+
|
|
1566
|
+
<dt class="tag-source">Source:</dt>
|
|
1567
|
+
<dd class="tag-source"><ul class="dummy"><li>
|
|
1568
|
+
<a href="railcontent.js.html">railcontent.js</a>, <a href="railcontent.js.html#line25">line 25</a>
|
|
1569
|
+
</li></ul></dd>
|
|
1570
|
+
|
|
1571
|
+
|
|
1572
|
+
|
|
1573
|
+
|
|
1574
|
+
|
|
1575
|
+
|
|
1576
|
+
|
|
1577
|
+
|
|
1578
|
+
|
|
1579
|
+
|
|
1580
|
+
|
|
1581
|
+
|
|
1582
|
+
|
|
1583
|
+
|
|
1584
|
+
|
|
1585
|
+
|
|
1586
|
+
|
|
1587
|
+
|
|
1588
|
+
|
|
1589
|
+
|
|
1590
|
+
|
|
1591
|
+
|
|
1592
|
+
|
|
1593
|
+
|
|
1594
|
+
|
|
1595
|
+
|
|
1596
|
+
|
|
1597
|
+
|
|
1598
|
+
|
|
1599
|
+
|
|
1600
|
+
|
|
1601
|
+
</dl>
|
|
1602
|
+
|
|
1603
|
+
|
|
1604
|
+
|
|
1605
|
+
|
|
1606
|
+
|
|
1607
|
+
|
|
1608
|
+
|
|
1609
|
+
|
|
1610
|
+
|
|
1611
|
+
|
|
1612
|
+
|
|
1613
|
+
<h5 class="h5-examples">Example</h5>
|
|
1614
|
+
|
|
1615
|
+
<pre class="prettyprint"><code>fetchCurrentSongComplete('user123', 'lesson456', 'csrf-token')
|
|
1616
|
+
.then(status => console.log(status))
|
|
1617
|
+
.catch(error => console.error(error));</code></pre>
|
|
1618
|
+
|
|
1619
|
+
|
|
1620
|
+
|
|
1621
|
+
|
|
1622
|
+
<h5 class="h5-parameters">Parameters:</h5>
|
|
1623
|
+
|
|
1624
|
+
|
|
1625
|
+
<table class="params">
|
|
1626
|
+
<thead>
|
|
1627
|
+
<tr>
|
|
1628
|
+
|
|
1629
|
+
<th>Name</th>
|
|
1630
|
+
|
|
1631
|
+
|
|
1632
|
+
<th>Type</th>
|
|
1633
|
+
|
|
1634
|
+
|
|
1635
|
+
|
|
1636
|
+
|
|
1637
|
+
|
|
1638
|
+
<th class="last">Description</th>
|
|
1639
|
+
</tr>
|
|
1640
|
+
</thead>
|
|
1641
|
+
|
|
1642
|
+
<tbody>
|
|
1643
|
+
|
|
1644
|
+
|
|
1645
|
+
<tr>
|
|
1646
|
+
|
|
1647
|
+
<td class="name"><code>content_id</code></td>
|
|
1648
|
+
|
|
1649
|
+
|
|
1650
|
+
<td class="type">
|
|
1651
|
+
|
|
1652
|
+
|
|
1653
|
+
<span class="param-type">string</span>
|
|
1654
|
+
|
|
1655
|
+
|
|
1656
|
+
|
|
1657
|
+
|
|
1658
|
+
</td>
|
|
1659
|
+
|
|
1660
|
+
|
|
1661
|
+
|
|
1662
|
+
|
|
1663
|
+
|
|
1664
|
+
<td class="description last">The ID of the lesson content to check.</td>
|
|
1665
|
+
</tr>
|
|
1666
|
+
|
|
1667
|
+
|
|
1668
|
+
</tbody>
|
|
1669
|
+
</table>
|
|
1670
|
+
|
|
1671
|
+
|
|
1672
|
+
|
|
1673
|
+
|
|
1674
|
+
|
|
1675
|
+
|
|
1676
|
+
|
|
1677
|
+
|
|
1678
|
+
|
|
1679
|
+
|
|
1680
|
+
|
|
1681
|
+
|
|
1682
|
+
|
|
1683
|
+
|
|
1684
|
+
|
|
1685
|
+
|
|
1686
|
+
<h5 class="h5-returns">Returns:</h5>
|
|
1687
|
+
|
|
1688
|
+
|
|
1689
|
+
<div class="param-desc">
|
|
1690
|
+
- Returns the completion status object if found, otherwise null.
|
|
1691
|
+
</div>
|
|
1692
|
+
|
|
1693
|
+
|
|
1694
|
+
|
|
1695
|
+
<dl class="param-type">
|
|
1696
|
+
<dt>
|
|
1697
|
+
Type
|
|
1698
|
+
</dt>
|
|
1699
|
+
<dd>
|
|
1700
|
+
|
|
1701
|
+
<span class="param-type">Promise.<(Object|null)></span>
|
|
1702
|
+
|
|
1703
|
+
|
|
1704
|
+
|
|
1705
|
+
</dd>
|
|
1706
|
+
</dl>
|
|
1707
|
+
|
|
1708
|
+
|
|
1709
|
+
|
|
1710
|
+
|
|
1711
|
+
|
|
1712
|
+
|
|
1713
|
+
|
|
1714
|
+
|
|
1715
|
+
|
|
1716
|
+
|
|
1717
|
+
<h4 class="name" id=".fetchContentInProgress"><span class="type-signature type-signature-static">(static) </span>fetchContentInProgress<span class="signature">(type, brand)</span><span class="type-signature"> → {Promise.<(Object|null)>}</span></h4>
|
|
1718
|
+
|
|
1719
|
+
|
|
1720
|
+
|
|
1721
|
+
|
|
1722
|
+
|
|
1723
|
+
|
|
1724
|
+
<dl class="details">
|
|
1725
|
+
|
|
1726
|
+
<dt class="tag-description">Description:</dt>
|
|
1727
|
+
<dd class="tag-description"><ul class="dummy"><li>Fetches a list of content that is currently in progress for the current user.</li></ul></dd>
|
|
1728
|
+
|
|
1729
|
+
|
|
1730
|
+
|
|
1731
|
+
<dt class="tag-source">Source:</dt>
|
|
1732
|
+
<dd class="tag-source"><ul class="dummy"><li>
|
|
1733
|
+
<a href="railcontent.js.html">railcontent.js</a>, <a href="railcontent.js.html#line127">line 127</a>
|
|
1734
|
+
</li></ul></dd>
|
|
1735
|
+
|
|
1736
|
+
|
|
1737
|
+
|
|
1738
|
+
|
|
1739
|
+
|
|
1740
|
+
|
|
1741
|
+
|
|
1742
|
+
|
|
1743
|
+
|
|
1744
|
+
|
|
1745
|
+
|
|
1746
|
+
|
|
1747
|
+
|
|
1748
|
+
|
|
1749
|
+
|
|
1750
|
+
|
|
1751
|
+
|
|
1752
|
+
|
|
1753
|
+
|
|
1754
|
+
|
|
1755
|
+
|
|
1756
|
+
|
|
1757
|
+
|
|
1758
|
+
|
|
1759
|
+
|
|
1760
|
+
|
|
1761
|
+
|
|
1762
|
+
|
|
1763
|
+
|
|
1764
|
+
|
|
1765
|
+
|
|
1766
|
+
</dl>
|
|
1767
|
+
|
|
1768
|
+
|
|
1769
|
+
|
|
1770
|
+
|
|
1771
|
+
|
|
1772
|
+
|
|
1773
|
+
|
|
1774
|
+
|
|
1775
|
+
|
|
1776
|
+
|
|
1777
|
+
|
|
1778
|
+
<h5 class="h5-examples">Example</h5>
|
|
1779
|
+
|
|
1780
|
+
<pre class="prettyprint"><code>fetchContentInProgress('song', 'drumeo')
|
|
1781
|
+
.then(songs => console.log(songs))
|
|
1782
|
+
.catch(error => console.error(error));</code></pre>
|
|
1783
|
+
|
|
1784
|
+
|
|
1785
|
+
|
|
1786
|
+
|
|
1787
|
+
<h5 class="h5-parameters">Parameters:</h5>
|
|
1788
|
+
|
|
1789
|
+
|
|
1790
|
+
<table class="params">
|
|
1791
|
+
<thead>
|
|
1792
|
+
<tr>
|
|
1793
|
+
|
|
1794
|
+
<th>Name</th>
|
|
1795
|
+
|
|
1796
|
+
|
|
1797
|
+
<th>Type</th>
|
|
1798
|
+
|
|
1799
|
+
|
|
1800
|
+
<th>Attributes</th>
|
|
1801
|
+
|
|
1802
|
+
|
|
1803
|
+
|
|
1804
|
+
<th>Default</th>
|
|
1805
|
+
|
|
1806
|
+
|
|
1807
|
+
<th class="last">Description</th>
|
|
1808
|
+
</tr>
|
|
1809
|
+
</thead>
|
|
1810
|
+
|
|
1811
|
+
<tbody>
|
|
1812
|
+
|
|
1813
|
+
|
|
1814
|
+
<tr>
|
|
1815
|
+
|
|
1816
|
+
<td class="name"><code>type</code></td>
|
|
1817
|
+
|
|
1818
|
+
|
|
1819
|
+
<td class="type">
|
|
1820
|
+
|
|
1821
|
+
|
|
1822
|
+
<span class="param-type">string</span>
|
|
1823
|
+
|
|
1824
|
+
|
|
1825
|
+
|
|
1826
|
+
|
|
1827
|
+
</td>
|
|
1828
|
+
|
|
1829
|
+
|
|
1830
|
+
<td class="attributes">
|
|
1831
|
+
|
|
1832
|
+
|
|
1833
|
+
|
|
1834
|
+
|
|
1835
|
+
|
|
1836
|
+
</td>
|
|
1837
|
+
|
|
1838
|
+
|
|
1839
|
+
|
|
1840
|
+
<td class="default">
|
|
1841
|
+
|
|
1842
|
+
</td>
|
|
1843
|
+
|
|
1844
|
+
|
|
1845
|
+
<td class="description last">The content type associated with the content.</td>
|
|
1846
|
+
</tr>
|
|
1847
|
+
|
|
1848
|
+
|
|
1849
|
+
|
|
1850
|
+
<tr>
|
|
1851
|
+
|
|
1852
|
+
<td class="name"><code>brand</code></td>
|
|
1853
|
+
|
|
1854
|
+
|
|
1855
|
+
<td class="type">
|
|
1856
|
+
|
|
1857
|
+
|
|
1858
|
+
<span class="param-type">string</span>
|
|
1859
|
+
|
|
1860
|
+
|
|
1861
|
+
|
|
1862
|
+
|
|
1863
|
+
</td>
|
|
1864
|
+
|
|
1865
|
+
|
|
1866
|
+
<td class="attributes">
|
|
1867
|
+
|
|
1868
|
+
|
|
1869
|
+
|
|
1870
|
+
|
|
1871
|
+
|
|
1872
|
+
</td>
|
|
1873
|
+
|
|
1874
|
+
|
|
1875
|
+
|
|
1876
|
+
<td class="default">
|
|
1877
|
+
|
|
1878
|
+
</td>
|
|
1879
|
+
|
|
1880
|
+
|
|
1881
|
+
<td class="description last">The brand associated with the content.</td>
|
|
1882
|
+
</tr>
|
|
1883
|
+
|
|
1884
|
+
|
|
1885
|
+
|
|
1886
|
+
<tr>
|
|
1887
|
+
|
|
1888
|
+
<td class="name"><code>params.limit</code></td>
|
|
1889
|
+
|
|
1890
|
+
|
|
1891
|
+
<td class="type">
|
|
1892
|
+
|
|
1893
|
+
|
|
1894
|
+
<span class="param-type">number</span>
|
|
1895
|
+
|
|
1896
|
+
|
|
1897
|
+
|
|
1898
|
+
|
|
1899
|
+
</td>
|
|
1900
|
+
|
|
1901
|
+
|
|
1902
|
+
<td class="attributes">
|
|
1903
|
+
|
|
1904
|
+
<optional><br>
|
|
1905
|
+
|
|
1906
|
+
|
|
1907
|
+
|
|
1908
|
+
|
|
1909
|
+
|
|
1910
|
+
</td>
|
|
1911
|
+
|
|
1912
|
+
|
|
1913
|
+
|
|
1914
|
+
<td class="default">
|
|
1915
|
+
|
|
1916
|
+
<code>20</code>
|
|
1917
|
+
|
|
1918
|
+
</td>
|
|
1919
|
+
|
|
1920
|
+
|
|
1921
|
+
<td class="description last">The limit of results per page.</td>
|
|
1922
|
+
</tr>
|
|
1923
|
+
|
|
1924
|
+
|
|
1925
|
+
|
|
1926
|
+
<tr>
|
|
1927
|
+
|
|
1928
|
+
<td class="name"><code>params.page</code></td>
|
|
1929
|
+
|
|
1930
|
+
|
|
1931
|
+
<td class="type">
|
|
1932
|
+
|
|
1933
|
+
|
|
1934
|
+
<span class="param-type">number</span>
|
|
1935
|
+
|
|
1936
|
+
|
|
1937
|
+
|
|
1938
|
+
|
|
1939
|
+
</td>
|
|
1940
|
+
|
|
1941
|
+
|
|
1942
|
+
<td class="attributes">
|
|
1943
|
+
|
|
1944
|
+
<optional><br>
|
|
1945
|
+
|
|
1946
|
+
|
|
1947
|
+
|
|
1948
|
+
|
|
1949
|
+
|
|
1950
|
+
</td>
|
|
1951
|
+
|
|
1952
|
+
|
|
1953
|
+
|
|
1954
|
+
<td class="default">
|
|
1955
|
+
|
|
1956
|
+
<code>1</code>
|
|
1957
|
+
|
|
1958
|
+
</td>
|
|
1959
|
+
|
|
1960
|
+
|
|
1961
|
+
<td class="description last">The page number for pagination.</td>
|
|
1962
|
+
</tr>
|
|
1963
|
+
|
|
1964
|
+
|
|
1965
|
+
</tbody>
|
|
1966
|
+
</table>
|
|
1967
|
+
|
|
1968
|
+
|
|
1969
|
+
|
|
1970
|
+
|
|
1971
|
+
|
|
1972
|
+
|
|
1973
|
+
|
|
1974
|
+
|
|
1975
|
+
|
|
1976
|
+
|
|
1977
|
+
|
|
1978
|
+
|
|
1979
|
+
|
|
1980
|
+
|
|
1981
|
+
|
|
1982
|
+
|
|
1983
|
+
<h5 class="h5-returns">Returns:</h5>
|
|
1984
|
+
|
|
1985
|
+
|
|
1986
|
+
<div class="param-desc">
|
|
1987
|
+
- Returns an object containing in-progress content if found, otherwise null.
|
|
1988
|
+
</div>
|
|
1989
|
+
|
|
1990
|
+
|
|
1991
|
+
|
|
1992
|
+
<dl class="param-type">
|
|
1993
|
+
<dt>
|
|
1994
|
+
Type
|
|
1995
|
+
</dt>
|
|
1996
|
+
<dd>
|
|
1997
|
+
|
|
1998
|
+
<span class="param-type">Promise.<(Object|null)></span>
|
|
1999
|
+
|
|
2000
|
+
|
|
2001
|
+
|
|
2002
|
+
</dd>
|
|
2003
|
+
</dl>
|
|
2004
|
+
|
|
2005
|
+
|
|
2006
|
+
|
|
2007
|
+
|
|
2008
|
+
|
|
2009
|
+
|
|
2010
|
+
|
|
2011
|
+
|
|
2012
|
+
|
|
2013
|
+
|
|
2014
|
+
<h4 class="name" id=".fetchContentPageUserData"><span class="type-signature type-signature-static">(static) </span>fetchContentPageUserData<span class="signature">(contentId)</span><span class="type-signature"> → {Promise.<(Object|null)>}</span></h4>
|
|
2015
|
+
|
|
2016
|
+
|
|
2017
|
+
|
|
2018
|
+
|
|
2019
|
+
|
|
2020
|
+
|
|
2021
|
+
<dl class="details">
|
|
2022
|
+
|
|
2023
|
+
<dt class="tag-description">Description:</dt>
|
|
2024
|
+
<dd class="tag-description"><ul class="dummy"><li>Fetches user context data for a specific piece of content.</li></ul></dd>
|
|
2025
|
+
|
|
2026
|
+
|
|
2027
|
+
|
|
2028
|
+
<dt class="tag-source">Source:</dt>
|
|
2029
|
+
<dd class="tag-source"><ul class="dummy"><li>
|
|
2030
|
+
<a href="railcontent.js.html">railcontent.js</a>, <a href="railcontent.js.html#line209">line 209</a>
|
|
2031
|
+
</li></ul></dd>
|
|
2032
|
+
|
|
2033
|
+
|
|
2034
|
+
|
|
2035
|
+
|
|
2036
|
+
|
|
2037
|
+
|
|
2038
|
+
|
|
2039
|
+
|
|
2040
|
+
|
|
2041
|
+
|
|
2042
|
+
|
|
2043
|
+
|
|
2044
|
+
|
|
2045
|
+
|
|
2046
|
+
|
|
2047
|
+
|
|
2048
|
+
|
|
2049
|
+
|
|
2050
|
+
|
|
2051
|
+
|
|
2052
|
+
|
|
2053
|
+
|
|
2054
|
+
|
|
2055
|
+
|
|
2056
|
+
|
|
2057
|
+
|
|
2058
|
+
|
|
2059
|
+
|
|
2060
|
+
|
|
2061
|
+
|
|
2062
|
+
|
|
2063
|
+
</dl>
|
|
2064
|
+
|
|
2065
|
+
|
|
2066
|
+
|
|
2067
|
+
|
|
2068
|
+
|
|
2069
|
+
|
|
2070
|
+
|
|
2071
|
+
|
|
2072
|
+
|
|
2073
|
+
|
|
2074
|
+
|
|
2075
|
+
<h5 class="h5-examples">Example</h5>
|
|
2076
|
+
|
|
2077
|
+
<pre class="prettyprint"><code>fetchContentPageUserData(406548)
|
|
2078
|
+
.then(data => console.log(data))
|
|
2079
|
+
.catch(error => console.error(error));</code></pre>
|
|
2080
|
+
|
|
2081
|
+
|
|
2082
|
+
|
|
2083
|
+
|
|
2084
|
+
<h5 class="h5-parameters">Parameters:</h5>
|
|
2085
|
+
|
|
2086
|
+
|
|
2087
|
+
<table class="params">
|
|
2088
|
+
<thead>
|
|
2089
|
+
<tr>
|
|
2090
|
+
|
|
2091
|
+
<th>Name</th>
|
|
2092
|
+
|
|
2093
|
+
|
|
2094
|
+
<th>Type</th>
|
|
2095
|
+
|
|
2096
|
+
|
|
2097
|
+
|
|
2098
|
+
|
|
2099
|
+
|
|
2100
|
+
<th class="last">Description</th>
|
|
2101
|
+
</tr>
|
|
2102
|
+
</thead>
|
|
2103
|
+
|
|
2104
|
+
<tbody>
|
|
2105
|
+
|
|
2106
|
+
|
|
2107
|
+
<tr>
|
|
2108
|
+
|
|
2109
|
+
<td class="name"><code>contentId</code></td>
|
|
2110
|
+
|
|
2111
|
+
|
|
2112
|
+
<td class="type">
|
|
2113
|
+
|
|
2114
|
+
|
|
2115
|
+
<span class="param-type">int</span>
|
|
2116
|
+
|
|
2117
|
+
|
|
2118
|
+
|
|
2119
|
+
|
|
2120
|
+
</td>
|
|
2121
|
+
|
|
2122
|
+
|
|
2123
|
+
|
|
2124
|
+
|
|
2125
|
+
|
|
2126
|
+
<td class="description last">The content id.</td>
|
|
2127
|
+
</tr>
|
|
2128
|
+
|
|
2129
|
+
|
|
2130
|
+
</tbody>
|
|
2131
|
+
</table>
|
|
2132
|
+
|
|
2133
|
+
|
|
2134
|
+
|
|
2135
|
+
|
|
2136
|
+
|
|
2137
|
+
|
|
2138
|
+
|
|
2139
|
+
|
|
2140
|
+
|
|
2141
|
+
|
|
2142
|
+
|
|
2143
|
+
|
|
2144
|
+
|
|
2145
|
+
|
|
2146
|
+
|
|
2147
|
+
|
|
2148
|
+
<h5 class="h5-returns">Returns:</h5>
|
|
2149
|
+
|
|
2150
|
+
|
|
2151
|
+
<div class="param-desc">
|
|
2152
|
+
- Returns an object containing user context data if found, otherwise null.
|
|
2153
|
+
</div>
|
|
2154
|
+
|
|
2155
|
+
|
|
2156
|
+
|
|
2157
|
+
<dl class="param-type">
|
|
2158
|
+
<dt>
|
|
2159
|
+
Type
|
|
2160
|
+
</dt>
|
|
2161
|
+
<dd>
|
|
2162
|
+
|
|
2163
|
+
<span class="param-type">Promise.<(Object|null)></span>
|
|
2164
|
+
|
|
2165
|
+
|
|
2166
|
+
|
|
2167
|
+
</dd>
|
|
2168
|
+
</dl>
|
|
2169
|
+
|
|
2170
|
+
|
|
2171
|
+
|
|
2172
|
+
|
|
2173
|
+
|
|
2174
|
+
|
|
2175
|
+
|
|
2176
|
+
|
|
2177
|
+
|
|
2178
|
+
|
|
2179
|
+
<h4 class="name" id=".fetchPlaylist"><span class="type-signature type-signature-static">(static) </span>fetchPlaylist<span class="signature">(playlistId)</span><span class="type-signature"> → {Promise.<Object>}</span></h4>
|
|
2180
|
+
|
|
2181
|
+
|
|
2182
|
+
|
|
2183
|
+
|
|
2184
|
+
|
|
2185
|
+
|
|
2186
|
+
<dl class="details">
|
|
2187
|
+
|
|
2188
|
+
<dt class="tag-description">Description:</dt>
|
|
2189
|
+
<dd class="tag-description"><ul class="dummy"><li>Retrieves details of a specific playlist by its ID.
|
|
2190
|
+
|
|
2191
|
+
This function sends a GET request to the `/playlists/playlist` endpoint with a specified playlist ID.
|
|
2192
|
+
The server validates the user's access to the playlist and returns playlist details if the user is authorized.</li></ul></dd>
|
|
2193
|
+
|
|
2194
|
+
|
|
2195
|
+
|
|
2196
|
+
<dt class="tag-source">Source:</dt>
|
|
2197
|
+
<dd class="tag-source"><ul class="dummy"><li>
|
|
2198
|
+
<a href="railcontent.js.html">railcontent.js</a>, <a href="railcontent.js.html#line565">line 565</a>
|
|
2199
|
+
</li></ul></dd>
|
|
2200
|
+
|
|
2201
|
+
|
|
2202
|
+
|
|
2203
|
+
|
|
2204
|
+
|
|
2205
|
+
|
|
2206
|
+
|
|
2207
|
+
|
|
2208
|
+
|
|
2209
|
+
|
|
2210
|
+
|
|
2211
|
+
|
|
2212
|
+
|
|
2213
|
+
|
|
2214
|
+
|
|
2215
|
+
|
|
2216
|
+
|
|
2217
|
+
|
|
2218
|
+
|
|
2219
|
+
|
|
2220
|
+
|
|
2221
|
+
|
|
2222
|
+
|
|
2223
|
+
|
|
2224
|
+
|
|
2225
|
+
|
|
2226
|
+
|
|
2227
|
+
|
|
2228
|
+
|
|
2229
|
+
|
|
2230
|
+
|
|
2231
|
+
</dl>
|
|
2232
|
+
|
|
2233
|
+
|
|
2234
|
+
|
|
2235
|
+
|
|
2236
|
+
|
|
2237
|
+
|
|
2238
|
+
|
|
2239
|
+
|
|
2240
|
+
|
|
2241
|
+
|
|
2242
|
+
|
|
2243
|
+
<h5 class="h5-examples">Example</h5>
|
|
2244
|
+
|
|
2245
|
+
<pre class="prettyprint"><code>fetchPlaylist(12345)
|
|
2246
|
+
.then(response => console.log(response.data))
|
|
2247
|
+
.catch(error => console.error('Error fetching playlist:', error));</code></pre>
|
|
2248
|
+
|
|
2249
|
+
|
|
2250
|
+
|
|
2251
|
+
|
|
2252
|
+
<h5 class="h5-parameters">Parameters:</h5>
|
|
2253
|
+
|
|
2254
|
+
|
|
2255
|
+
<table class="params">
|
|
2256
|
+
<thead>
|
|
2257
|
+
<tr>
|
|
2258
|
+
|
|
2259
|
+
<th>Name</th>
|
|
2260
|
+
|
|
2261
|
+
|
|
2262
|
+
<th>Type</th>
|
|
2263
|
+
|
|
2264
|
+
|
|
2265
|
+
|
|
2266
|
+
|
|
2267
|
+
|
|
2268
|
+
<th class="last">Description</th>
|
|
2269
|
+
</tr>
|
|
2270
|
+
</thead>
|
|
2271
|
+
|
|
2272
|
+
<tbody>
|
|
2273
|
+
|
|
2274
|
+
|
|
2275
|
+
<tr>
|
|
2276
|
+
|
|
2277
|
+
<td class="name"><code>playlistId</code></td>
|
|
2278
|
+
|
|
2279
|
+
|
|
2280
|
+
<td class="type">
|
|
2281
|
+
|
|
2282
|
+
|
|
2283
|
+
<span class="param-type">string</span>
|
|
2284
|
+
|
|
|
2285
|
+
|
|
2286
|
+
<span class="param-type">number</span>
|
|
2287
|
+
|
|
2288
|
+
|
|
2289
|
+
|
|
2290
|
+
|
|
2291
|
+
</td>
|
|
2292
|
+
|
|
2293
|
+
|
|
2294
|
+
|
|
2295
|
+
|
|
2296
|
+
|
|
2297
|
+
<td class="description last">The unique identifier of the playlist to retrieve.</td>
|
|
2298
|
+
</tr>
|
|
2299
|
+
|
|
2300
|
+
|
|
2301
|
+
</tbody>
|
|
2302
|
+
</table>
|
|
2303
|
+
|
|
2304
|
+
|
|
2305
|
+
|
|
2306
|
+
|
|
2307
|
+
|
|
2308
|
+
|
|
2309
|
+
|
|
2310
|
+
|
|
2311
|
+
|
|
2312
|
+
|
|
2313
|
+
|
|
2314
|
+
|
|
2315
|
+
|
|
2316
|
+
|
|
2317
|
+
|
|
2318
|
+
|
|
2319
|
+
<h5 class="h5-returns">Returns:</h5>
|
|
2320
|
+
|
|
2321
|
+
|
|
2322
|
+
<div class="param-desc">
|
|
2323
|
+
- A promise that resolves to the response from the API, containing:
|
|
2324
|
+
- `data` (Object): The playlist details, or an error message if access is denied or the playlist is not found.
|
|
2325
|
+
</div>
|
|
2326
|
+
|
|
2327
|
+
|
|
2328
|
+
|
|
2329
|
+
<dl class="param-type">
|
|
2330
|
+
<dt>
|
|
2331
|
+
Type
|
|
2332
|
+
</dt>
|
|
2333
|
+
<dd>
|
|
2334
|
+
|
|
2335
|
+
<span class="param-type">Promise.<Object></span>
|
|
2336
|
+
|
|
2337
|
+
|
|
2338
|
+
|
|
2339
|
+
</dd>
|
|
2340
|
+
</dl>
|
|
2341
|
+
|
|
2342
|
+
|
|
2343
|
+
|
|
2344
|
+
|
|
2345
|
+
|
|
2346
|
+
|
|
2347
|
+
|
|
2348
|
+
|
|
2349
|
+
|
|
2350
|
+
|
|
2351
|
+
<h4 class="name" id=".fetchPlaylistItems"><span class="type-signature type-signature-static">(static) </span>fetchPlaylistItems<span class="signature">(playlistId)</span><span class="type-signature"> → {Promise.<Array.<Object>>}</span></h4>
|
|
2352
|
+
|
|
2353
|
+
|
|
2354
|
+
|
|
2355
|
+
|
|
2356
|
+
|
|
2357
|
+
|
|
2358
|
+
<dl class="details">
|
|
2359
|
+
|
|
2360
|
+
<dt class="tag-description">Description:</dt>
|
|
2361
|
+
<dd class="tag-description"><ul class="dummy"><li>Retrieves items within a specified playlist by playlist ID.
|
|
2362
|
+
|
|
2363
|
+
This function sends a GET request to the `/playlists/playlist-lessons` endpoint to fetch items in the given playlist.
|
|
2364
|
+
The server combines data from the playlist and additional metadata from Sanity to enhance item details.</li></ul></dd>
|
|
2365
|
+
|
|
2366
|
+
|
|
2367
|
+
|
|
2368
|
+
<dt class="tag-source">Source:</dt>
|
|
2369
|
+
<dd class="tag-source"><ul class="dummy"><li>
|
|
2370
|
+
<a href="railcontent.js.html">railcontent.js</a>, <a href="railcontent.js.html#line585">line 585</a>
|
|
2371
|
+
</li></ul></dd>
|
|
2372
|
+
|
|
2373
|
+
|
|
2374
|
+
|
|
2375
|
+
|
|
2376
|
+
|
|
2377
|
+
|
|
2378
|
+
|
|
2379
|
+
|
|
2380
|
+
|
|
2381
|
+
|
|
2382
|
+
|
|
2383
|
+
|
|
2384
|
+
|
|
2385
|
+
|
|
2386
|
+
|
|
2387
|
+
|
|
2388
|
+
|
|
2389
|
+
|
|
2390
|
+
|
|
2391
|
+
|
|
2392
|
+
|
|
2393
|
+
|
|
2394
|
+
|
|
2395
|
+
|
|
2396
|
+
|
|
2397
|
+
|
|
2398
|
+
|
|
2399
|
+
|
|
2400
|
+
|
|
2401
|
+
|
|
2402
|
+
|
|
2403
|
+
</dl>
|
|
2404
|
+
|
|
2405
|
+
|
|
2406
|
+
|
|
2407
|
+
|
|
2408
|
+
|
|
2409
|
+
|
|
2410
|
+
|
|
2411
|
+
|
|
2412
|
+
|
|
2413
|
+
|
|
2414
|
+
|
|
2415
|
+
<h5 class="h5-examples">Example</h5>
|
|
2416
|
+
|
|
2417
|
+
<pre class="prettyprint"><code>fetchPlaylistItems(12345)
|
|
2418
|
+
.then(items => console.log(items))
|
|
2419
|
+
.catch(error => console.error('Error fetching playlist items:', error));</code></pre>
|
|
2420
|
+
|
|
2421
|
+
|
|
2422
|
+
|
|
2423
|
+
|
|
2424
|
+
<h5 class="h5-parameters">Parameters:</h5>
|
|
2425
|
+
|
|
2426
|
+
|
|
2427
|
+
<table class="params">
|
|
2428
|
+
<thead>
|
|
2429
|
+
<tr>
|
|
2430
|
+
|
|
2431
|
+
<th>Name</th>
|
|
2432
|
+
|
|
2433
|
+
|
|
2434
|
+
<th>Type</th>
|
|
2435
|
+
|
|
2436
|
+
|
|
2437
|
+
|
|
2438
|
+
|
|
2439
|
+
|
|
2440
|
+
<th class="last">Description</th>
|
|
2441
|
+
</tr>
|
|
2442
|
+
</thead>
|
|
2443
|
+
|
|
2444
|
+
<tbody>
|
|
2445
|
+
|
|
2446
|
+
|
|
2447
|
+
<tr>
|
|
2448
|
+
|
|
2449
|
+
<td class="name"><code>playlistId</code></td>
|
|
2450
|
+
|
|
2451
|
+
|
|
2452
|
+
<td class="type">
|
|
2453
|
+
|
|
2454
|
+
|
|
2455
|
+
<span class="param-type">string</span>
|
|
2456
|
+
|
|
|
2457
|
+
|
|
2458
|
+
<span class="param-type">number</span>
|
|
2459
|
+
|
|
2460
|
+
|
|
2461
|
+
|
|
2462
|
+
|
|
2463
|
+
</td>
|
|
2464
|
+
|
|
2465
|
+
|
|
2466
|
+
|
|
2467
|
+
|
|
2468
|
+
|
|
2469
|
+
<td class="description last">The unique identifier of the playlist whose items are to be fetched.</td>
|
|
2470
|
+
</tr>
|
|
2471
|
+
|
|
2472
|
+
|
|
2473
|
+
</tbody>
|
|
2474
|
+
</table>
|
|
2475
|
+
|
|
2476
|
+
|
|
2477
|
+
|
|
2478
|
+
|
|
2479
|
+
|
|
2480
|
+
|
|
2481
|
+
|
|
2482
|
+
|
|
2483
|
+
|
|
2484
|
+
|
|
2485
|
+
|
|
2486
|
+
|
|
2487
|
+
|
|
2488
|
+
|
|
2489
|
+
|
|
2490
|
+
|
|
2491
|
+
<h5 class="h5-returns">Returns:</h5>
|
|
2492
|
+
|
|
2493
|
+
|
|
2494
|
+
<div class="param-desc">
|
|
2495
|
+
- A promise that resolves to an array of playlist items
|
|
2496
|
+
</div>
|
|
2497
|
+
|
|
2498
|
+
|
|
2499
|
+
|
|
2500
|
+
<dl class="param-type">
|
|
2501
|
+
<dt>
|
|
2502
|
+
Type
|
|
2503
|
+
</dt>
|
|
2504
|
+
<dd>
|
|
2505
|
+
|
|
2506
|
+
<span class="param-type">Promise.<Array.<Object>></span>
|
|
2507
|
+
|
|
2508
|
+
|
|
2509
|
+
|
|
2510
|
+
</dd>
|
|
2511
|
+
</dl>
|
|
2512
|
+
|
|
2513
|
+
|
|
2514
|
+
|
|
2515
|
+
|
|
2516
|
+
|
|
2517
|
+
|
|
2518
|
+
|
|
2519
|
+
|
|
2520
|
+
|
|
2521
|
+
|
|
2522
|
+
<h4 class="name" id=".fetchSongsInProgress"><span class="type-signature type-signature-static">(static) </span>fetchSongsInProgress<span class="signature">(brand)</span><span class="type-signature"> → {Promise.<(Object|null)>}</span></h4>
|
|
2523
|
+
|
|
2524
|
+
|
|
2525
|
+
|
|
2526
|
+
|
|
2527
|
+
|
|
2528
|
+
|
|
2529
|
+
<dl class="details">
|
|
2530
|
+
|
|
2531
|
+
<dt class="tag-description">Description:</dt>
|
|
2532
|
+
<dd class="tag-description"><ul class="dummy"><li>Fetches a list of songs that are currently in progress for the current user.</li></ul></dd>
|
|
2533
|
+
|
|
2534
|
+
|
|
2535
|
+
|
|
2536
|
+
<dt class="tag-source">Source:</dt>
|
|
2537
|
+
<dd class="tag-source"><ul class="dummy"><li>
|
|
2538
|
+
<a href="railcontent.js.html">railcontent.js</a>, <a href="railcontent.js.html#line91">line 91</a>
|
|
2539
|
+
</li></ul></dd>
|
|
2540
|
+
|
|
2541
|
+
|
|
2542
|
+
|
|
2543
|
+
|
|
2544
|
+
|
|
2545
|
+
|
|
2546
|
+
|
|
2547
|
+
|
|
2548
|
+
|
|
2549
|
+
|
|
2550
|
+
|
|
2551
|
+
|
|
2552
|
+
|
|
2553
|
+
|
|
2554
|
+
|
|
2555
|
+
|
|
2556
|
+
|
|
2557
|
+
|
|
2558
|
+
|
|
2559
|
+
|
|
2560
|
+
|
|
2561
|
+
|
|
2562
|
+
|
|
2563
|
+
|
|
2564
|
+
|
|
2565
|
+
|
|
2566
|
+
|
|
2567
|
+
|
|
2568
|
+
|
|
2569
|
+
|
|
2570
|
+
|
|
2571
|
+
</dl>
|
|
2572
|
+
|
|
2573
|
+
|
|
2574
|
+
|
|
2575
|
+
|
|
2576
|
+
|
|
2577
|
+
|
|
2578
|
+
|
|
2579
|
+
|
|
2580
|
+
|
|
2581
|
+
|
|
2582
|
+
|
|
2583
|
+
<h5 class="h5-examples">Example</h5>
|
|
2584
|
+
|
|
2585
|
+
<pre class="prettyprint"><code>fetchSongsInProgress('drumeo')
|
|
2586
|
+
.then(songs => console.log(songs))
|
|
2587
|
+
.catch(error => console.error(error));</code></pre>
|
|
2588
|
+
|
|
2589
|
+
|
|
2590
|
+
|
|
2591
|
+
|
|
2592
|
+
<h5 class="h5-parameters">Parameters:</h5>
|
|
2593
|
+
|
|
2594
|
+
|
|
2595
|
+
<table class="params">
|
|
2596
|
+
<thead>
|
|
2597
|
+
<tr>
|
|
2598
|
+
|
|
2599
|
+
<th>Name</th>
|
|
2600
|
+
|
|
2601
|
+
|
|
2602
|
+
<th>Type</th>
|
|
2603
|
+
|
|
2604
|
+
|
|
2605
|
+
|
|
2606
|
+
|
|
2607
|
+
|
|
2608
|
+
<th class="last">Description</th>
|
|
2609
|
+
</tr>
|
|
2610
|
+
</thead>
|
|
2611
|
+
|
|
2612
|
+
<tbody>
|
|
2613
|
+
|
|
2614
|
+
|
|
2615
|
+
<tr>
|
|
2616
|
+
|
|
2617
|
+
<td class="name"><code>brand</code></td>
|
|
2618
|
+
|
|
2619
|
+
|
|
2620
|
+
<td class="type">
|
|
2621
|
+
|
|
2622
|
+
|
|
2623
|
+
<span class="param-type">string</span>
|
|
2624
|
+
|
|
2625
|
+
|
|
2626
|
+
|
|
2627
|
+
|
|
2628
|
+
</td>
|
|
2629
|
+
|
|
2630
|
+
|
|
2631
|
+
|
|
2632
|
+
|
|
2633
|
+
|
|
2634
|
+
<td class="description last">The brand associated with the songs.</td>
|
|
2635
|
+
</tr>
|
|
2636
|
+
|
|
2637
|
+
|
|
2638
|
+
</tbody>
|
|
2639
|
+
</table>
|
|
2640
|
+
|
|
2641
|
+
|
|
2642
|
+
|
|
2643
|
+
|
|
2644
|
+
|
|
2645
|
+
|
|
2646
|
+
|
|
2647
|
+
|
|
2648
|
+
|
|
2649
|
+
|
|
2650
|
+
|
|
2651
|
+
|
|
2652
|
+
|
|
2653
|
+
|
|
2654
|
+
|
|
2655
|
+
|
|
2656
|
+
<h5 class="h5-returns">Returns:</h5>
|
|
2657
|
+
|
|
2658
|
+
|
|
2659
|
+
<div class="param-desc">
|
|
2660
|
+
- Returns an object containing in-progress songs if found, otherwise null.
|
|
2661
|
+
</div>
|
|
2662
|
+
|
|
2663
|
+
|
|
2664
|
+
|
|
2665
|
+
<dl class="param-type">
|
|
2666
|
+
<dt>
|
|
2667
|
+
Type
|
|
2668
|
+
</dt>
|
|
2669
|
+
<dd>
|
|
2670
|
+
|
|
2671
|
+
<span class="param-type">Promise.<(Object|null)></span>
|
|
2672
|
+
|
|
2673
|
+
|
|
2674
|
+
|
|
2675
|
+
</dd>
|
|
2676
|
+
</dl>
|
|
2677
|
+
|
|
2678
|
+
|
|
2679
|
+
|
|
2680
|
+
|
|
2681
|
+
|
|
2682
|
+
|
|
2683
|
+
|
|
2684
|
+
|
|
2685
|
+
|
|
2686
|
+
|
|
2687
|
+
<h4 class="name" id=".fetchUserPlaylists"><span class="type-signature type-signature-static">(static) </span>fetchUserPlaylists<span class="signature">(brand)</span><span class="type-signature"> → {Promise.<(Object|null)>}</span></h4>
|
|
2688
|
+
|
|
2689
|
+
|
|
2690
|
+
|
|
2691
|
+
|
|
2692
|
+
|
|
2693
|
+
|
|
2694
|
+
<dl class="details">
|
|
2695
|
+
|
|
2696
|
+
<dt class="tag-description">Description:</dt>
|
|
2697
|
+
<dd class="tag-description"><ul class="dummy"><li>Fetches user playlists for a specific brand.
|
|
2698
|
+
|
|
2699
|
+
Allows optional pagination, sorting, and search parameters to control the result set.</li></ul></dd>
|
|
2700
|
+
|
|
2701
|
+
|
|
2702
|
+
|
|
2703
|
+
<dt class="tag-source">Source:</dt>
|
|
2704
|
+
<dd class="tag-source"><ul class="dummy"><li>
|
|
2705
|
+
<a href="railcontent.js.html">railcontent.js</a>, <a href="railcontent.js.html#line351">line 351</a>
|
|
2706
|
+
</li></ul></dd>
|
|
2707
|
+
|
|
2708
|
+
|
|
2709
|
+
|
|
2710
|
+
|
|
2711
|
+
|
|
2712
|
+
|
|
2713
|
+
|
|
2714
|
+
|
|
2715
|
+
|
|
2716
|
+
|
|
2717
|
+
|
|
2718
|
+
|
|
2719
|
+
|
|
2720
|
+
|
|
2721
|
+
|
|
2722
|
+
|
|
2723
|
+
|
|
2724
|
+
|
|
2725
|
+
|
|
2726
|
+
|
|
2727
|
+
|
|
2728
|
+
|
|
2729
|
+
|
|
2730
|
+
|
|
2731
|
+
|
|
2732
|
+
|
|
2733
|
+
|
|
2734
|
+
|
|
2735
|
+
|
|
2736
|
+
|
|
2737
|
+
|
|
2738
|
+
</dl>
|
|
2739
|
+
|
|
2740
|
+
|
|
2741
|
+
|
|
2742
|
+
|
|
2743
|
+
|
|
2744
|
+
|
|
2745
|
+
|
|
2746
|
+
|
|
2747
|
+
|
|
2748
|
+
|
|
2749
|
+
|
|
2750
|
+
<h5 class="h5-examples">Example</h5>
|
|
2751
|
+
|
|
2752
|
+
<pre class="prettyprint"><code>fetchUserPlaylists('drumeo', { page: 1, sort: 'name', searchTerm: 'rock' })
|
|
2753
|
+
.then(playlists => console.log(playlists))
|
|
2754
|
+
.catch(error => console.error(error));</code></pre>
|
|
2755
|
+
|
|
2756
|
+
|
|
2757
|
+
|
|
2758
|
+
|
|
2759
|
+
<h5 class="h5-parameters">Parameters:</h5>
|
|
2760
|
+
|
|
2761
|
+
|
|
2762
|
+
<table class="params">
|
|
2763
|
+
<thead>
|
|
2764
|
+
<tr>
|
|
2765
|
+
|
|
2766
|
+
<th>Name</th>
|
|
2767
|
+
|
|
2768
|
+
|
|
2769
|
+
<th>Type</th>
|
|
2770
|
+
|
|
2771
|
+
|
|
2772
|
+
<th>Attributes</th>
|
|
2773
|
+
|
|
2774
|
+
|
|
2775
|
+
|
|
2776
|
+
<th>Default</th>
|
|
2777
|
+
|
|
2778
|
+
|
|
2779
|
+
<th class="last">Description</th>
|
|
2780
|
+
</tr>
|
|
2781
|
+
</thead>
|
|
2782
|
+
|
|
2783
|
+
<tbody>
|
|
2784
|
+
|
|
2785
|
+
|
|
2786
|
+
<tr>
|
|
2787
|
+
|
|
2788
|
+
<td class="name"><code>brand</code></td>
|
|
2789
|
+
|
|
2790
|
+
|
|
2791
|
+
<td class="type">
|
|
2792
|
+
|
|
2793
|
+
|
|
2794
|
+
<span class="param-type">string</span>
|
|
2795
|
+
|
|
2796
|
+
|
|
2797
|
+
|
|
2798
|
+
|
|
2799
|
+
</td>
|
|
2800
|
+
|
|
2801
|
+
|
|
2802
|
+
<td class="attributes">
|
|
2803
|
+
|
|
2804
|
+
|
|
2805
|
+
|
|
2806
|
+
|
|
2807
|
+
|
|
2808
|
+
</td>
|
|
2809
|
+
|
|
2810
|
+
|
|
2811
|
+
|
|
2812
|
+
<td class="default">
|
|
2813
|
+
|
|
2814
|
+
</td>
|
|
2815
|
+
|
|
2816
|
+
|
|
2817
|
+
<td class="description last">The brand identifier for which playlists are being fetched.</td>
|
|
2818
|
+
</tr>
|
|
2819
|
+
|
|
2820
|
+
|
|
2821
|
+
|
|
2822
|
+
<tr>
|
|
2823
|
+
|
|
2824
|
+
<td class="name"><code>params.limit</code></td>
|
|
2825
|
+
|
|
2826
|
+
|
|
2827
|
+
<td class="type">
|
|
2828
|
+
|
|
2829
|
+
|
|
2830
|
+
<span class="param-type">number</span>
|
|
2831
|
+
|
|
2832
|
+
|
|
2833
|
+
|
|
2834
|
+
|
|
2835
|
+
</td>
|
|
2836
|
+
|
|
2837
|
+
|
|
2838
|
+
<td class="attributes">
|
|
2839
|
+
|
|
2840
|
+
<optional><br>
|
|
2841
|
+
|
|
2842
|
+
|
|
2843
|
+
|
|
2844
|
+
|
|
2845
|
+
|
|
2846
|
+
</td>
|
|
2847
|
+
|
|
2848
|
+
|
|
2849
|
+
|
|
2850
|
+
<td class="default">
|
|
2851
|
+
|
|
2852
|
+
<code>10</code>
|
|
2853
|
+
|
|
2854
|
+
</td>
|
|
2855
|
+
|
|
2856
|
+
|
|
2857
|
+
<td class="description last">The maximum number of playlists to return per page (default is 10).</td>
|
|
2858
|
+
</tr>
|
|
2859
|
+
|
|
2860
|
+
|
|
2861
|
+
|
|
2862
|
+
<tr>
|
|
2863
|
+
|
|
2864
|
+
<td class="name"><code>params.page</code></td>
|
|
2865
|
+
|
|
2866
|
+
|
|
2867
|
+
<td class="type">
|
|
2868
|
+
|
|
2869
|
+
|
|
2870
|
+
<span class="param-type">number</span>
|
|
2871
|
+
|
|
2872
|
+
|
|
2873
|
+
|
|
2874
|
+
|
|
2875
|
+
</td>
|
|
2876
|
+
|
|
2877
|
+
|
|
2878
|
+
<td class="attributes">
|
|
2879
|
+
|
|
2880
|
+
<optional><br>
|
|
2881
|
+
|
|
2882
|
+
|
|
2883
|
+
|
|
2884
|
+
|
|
2885
|
+
|
|
2886
|
+
</td>
|
|
2887
|
+
|
|
2888
|
+
|
|
2889
|
+
|
|
2890
|
+
<td class="default">
|
|
2891
|
+
|
|
2892
|
+
<code>1</code>
|
|
2893
|
+
|
|
2894
|
+
</td>
|
|
2895
|
+
|
|
2896
|
+
|
|
2897
|
+
<td class="description last">The page number for pagination.</td>
|
|
2898
|
+
</tr>
|
|
2899
|
+
|
|
2900
|
+
|
|
2901
|
+
|
|
2902
|
+
<tr>
|
|
2903
|
+
|
|
2904
|
+
<td class="name"><code>params.sort</code></td>
|
|
2905
|
+
|
|
2906
|
+
|
|
2907
|
+
<td class="type">
|
|
2908
|
+
|
|
2909
|
+
|
|
2910
|
+
<span class="param-type">string</span>
|
|
2911
|
+
|
|
2912
|
+
|
|
2913
|
+
|
|
2914
|
+
|
|
2915
|
+
</td>
|
|
2916
|
+
|
|
2917
|
+
|
|
2918
|
+
<td class="attributes">
|
|
2919
|
+
|
|
2920
|
+
<optional><br>
|
|
2921
|
+
|
|
2922
|
+
|
|
2923
|
+
|
|
2924
|
+
|
|
2925
|
+
|
|
2926
|
+
</td>
|
|
2927
|
+
|
|
2928
|
+
|
|
2929
|
+
|
|
2930
|
+
<td class="default">
|
|
2931
|
+
|
|
2932
|
+
<code>'-created_at'</code>
|
|
2933
|
+
|
|
2934
|
+
</td>
|
|
2935
|
+
|
|
2936
|
+
|
|
2937
|
+
<td class="description last">The sorting order for the playlists (default is by created_at in descending order).</td>
|
|
2938
|
+
</tr>
|
|
2939
|
+
|
|
2940
|
+
|
|
2941
|
+
|
|
2942
|
+
<tr>
|
|
2943
|
+
|
|
2944
|
+
<td class="name"><code>params.searchTerm</code></td>
|
|
2945
|
+
|
|
2946
|
+
|
|
2947
|
+
<td class="type">
|
|
2948
|
+
|
|
2949
|
+
|
|
2950
|
+
<span class="param-type">string</span>
|
|
2951
|
+
|
|
2952
|
+
|
|
2953
|
+
|
|
2954
|
+
|
|
2955
|
+
</td>
|
|
2956
|
+
|
|
2957
|
+
|
|
2958
|
+
<td class="attributes">
|
|
2959
|
+
|
|
2960
|
+
<optional><br>
|
|
2961
|
+
|
|
2962
|
+
|
|
2963
|
+
|
|
2964
|
+
|
|
2965
|
+
|
|
2966
|
+
</td>
|
|
2967
|
+
|
|
2968
|
+
|
|
2969
|
+
|
|
2970
|
+
<td class="default">
|
|
2971
|
+
|
|
2972
|
+
</td>
|
|
2973
|
+
|
|
2974
|
+
|
|
2975
|
+
<td class="description last">A search term to filter playlists by name.</td>
|
|
2976
|
+
</tr>
|
|
2977
|
+
|
|
2978
|
+
|
|
2979
|
+
</tbody>
|
|
2980
|
+
</table>
|
|
2981
|
+
|
|
2982
|
+
|
|
2983
|
+
|
|
2984
|
+
|
|
2985
|
+
|
|
2986
|
+
|
|
2987
|
+
|
|
2988
|
+
|
|
2989
|
+
|
|
2990
|
+
|
|
2991
|
+
|
|
2992
|
+
|
|
2993
|
+
|
|
2994
|
+
|
|
2995
|
+
|
|
2996
|
+
|
|
2997
|
+
<h5 class="h5-returns">Returns:</h5>
|
|
2998
|
+
|
|
2999
|
+
|
|
3000
|
+
<div class="param-desc">
|
|
3001
|
+
- A promise that resolves to the response from the API, containing the user playlists data.
|
|
3002
|
+
</div>
|
|
3003
|
+
|
|
3004
|
+
|
|
3005
|
+
|
|
3006
|
+
<dl class="param-type">
|
|
3007
|
+
<dt>
|
|
3008
|
+
Type
|
|
3009
|
+
</dt>
|
|
3010
|
+
<dd>
|
|
3011
|
+
|
|
3012
|
+
<span class="param-type">Promise.<(Object|null)></span>
|
|
3013
|
+
|
|
3014
|
+
|
|
3015
|
+
|
|
3016
|
+
</dd>
|
|
3017
|
+
</dl>
|
|
3018
|
+
|
|
3019
|
+
|
|
3020
|
+
|
|
3021
|
+
|
|
3022
|
+
|
|
3023
|
+
|
|
3024
|
+
|
|
3025
|
+
|
|
3026
|
+
|
|
3027
|
+
|
|
3028
|
+
<h4 class="name" id=".likePlaylist"><span class="type-signature type-signature-static">(static) </span>likePlaylist<span class="signature">(playlistId)</span><span class="type-signature"> → {Promise.<Object>}</span></h4>
|
|
3029
|
+
|
|
3030
|
+
|
|
3031
|
+
|
|
3032
|
+
|
|
3033
|
+
|
|
3034
|
+
|
|
3035
|
+
<dl class="details">
|
|
3036
|
+
|
|
3037
|
+
<dt class="tag-description">Description:</dt>
|
|
3038
|
+
<dd class="tag-description"><ul class="dummy"><li>Sends a request to "like" a playlist on behalf of the authenticated user.
|
|
3039
|
+
|
|
3040
|
+
This function calls the `/playlists/playlist/like` endpoint, where the server validates the `playlist_id` and checks
|
|
3041
|
+
if the authenticated user has already liked the playlist. If not, it creates a new "like" entry associated with the playlist.</li></ul></dd>
|
|
3042
|
+
|
|
3043
|
+
|
|
3044
|
+
|
|
3045
|
+
<dt class="tag-source">Source:</dt>
|
|
3046
|
+
<dd class="tag-source"><ul class="dummy"><li>
|
|
3047
|
+
<a href="railcontent.js.html">railcontent.js</a>, <a href="railcontent.js.html#line516">line 516</a>
|
|
3048
|
+
</li></ul></dd>
|
|
3049
|
+
|
|
3050
|
+
|
|
3051
|
+
|
|
3052
|
+
|
|
3053
|
+
|
|
3054
|
+
|
|
3055
|
+
|
|
3056
|
+
|
|
3057
|
+
|
|
3058
|
+
|
|
3059
|
+
|
|
3060
|
+
|
|
3061
|
+
|
|
3062
|
+
|
|
3063
|
+
|
|
3064
|
+
|
|
3065
|
+
|
|
3066
|
+
|
|
3067
|
+
|
|
3068
|
+
|
|
3069
|
+
|
|
3070
|
+
|
|
3071
|
+
|
|
3072
|
+
|
|
3073
|
+
|
|
3074
|
+
|
|
3075
|
+
|
|
3076
|
+
|
|
3077
|
+
|
|
3078
|
+
|
|
3079
|
+
|
|
3080
|
+
</dl>
|
|
3081
|
+
|
|
3082
|
+
|
|
3083
|
+
|
|
3084
|
+
|
|
3085
|
+
|
|
3086
|
+
|
|
3087
|
+
|
|
3088
|
+
|
|
3089
|
+
|
|
3090
|
+
|
|
3091
|
+
|
|
3092
|
+
<h5 class="h5-examples">Example</h5>
|
|
3093
|
+
|
|
3094
|
+
<pre class="prettyprint"><code>likePlaylist(12345)
|
|
3095
|
+
.then(response => {
|
|
3096
|
+
if (response.success) {
|
|
3097
|
+
console.log(response.message);
|
|
3098
|
+
}
|
|
3099
|
+
})
|
|
3100
|
+
.catch(error => console.error('Error liking playlist:', error));</code></pre>
|
|
3101
|
+
|
|
3102
|
+
|
|
3103
|
+
|
|
3104
|
+
|
|
3105
|
+
<h5 class="h5-parameters">Parameters:</h5>
|
|
3106
|
+
|
|
3107
|
+
|
|
3108
|
+
<table class="params">
|
|
3109
|
+
<thead>
|
|
3110
|
+
<tr>
|
|
3111
|
+
|
|
3112
|
+
<th>Name</th>
|
|
3113
|
+
|
|
3114
|
+
|
|
3115
|
+
<th>Type</th>
|
|
3116
|
+
|
|
3117
|
+
|
|
3118
|
+
|
|
3119
|
+
|
|
3120
|
+
|
|
3121
|
+
<th class="last">Description</th>
|
|
3122
|
+
</tr>
|
|
3123
|
+
</thead>
|
|
3124
|
+
|
|
3125
|
+
<tbody>
|
|
3126
|
+
|
|
3127
|
+
|
|
3128
|
+
<tr>
|
|
3129
|
+
|
|
3130
|
+
<td class="name"><code>playlistId</code></td>
|
|
3131
|
+
|
|
3132
|
+
|
|
3133
|
+
<td class="type">
|
|
3134
|
+
|
|
3135
|
+
|
|
3136
|
+
<span class="param-type">string</span>
|
|
3137
|
+
|
|
|
3138
|
+
|
|
3139
|
+
<span class="param-type">number</span>
|
|
3140
|
+
|
|
3141
|
+
|
|
3142
|
+
|
|
3143
|
+
|
|
3144
|
+
</td>
|
|
3145
|
+
|
|
3146
|
+
|
|
3147
|
+
|
|
3148
|
+
|
|
3149
|
+
|
|
3150
|
+
<td class="description last">The unique identifier of the playlist to be liked.</td>
|
|
3151
|
+
</tr>
|
|
3152
|
+
|
|
3153
|
+
|
|
3154
|
+
</tbody>
|
|
3155
|
+
</table>
|
|
3156
|
+
|
|
3157
|
+
|
|
3158
|
+
|
|
3159
|
+
|
|
3160
|
+
|
|
3161
|
+
|
|
3162
|
+
|
|
3163
|
+
|
|
3164
|
+
|
|
3165
|
+
|
|
3166
|
+
|
|
3167
|
+
|
|
3168
|
+
|
|
3169
|
+
|
|
3170
|
+
|
|
3171
|
+
|
|
3172
|
+
<h5 class="h5-returns">Returns:</h5>
|
|
3173
|
+
|
|
3174
|
+
|
|
3175
|
+
<div class="param-desc">
|
|
3176
|
+
- A promise that resolves with the response from the API. The response contains:
|
|
3177
|
+
- `success` (boolean): Indicates if the like action was successful (`true` for success).
|
|
3178
|
+
- `message` (string): A success message if the playlist is liked successfully, or a notification if it was already liked.
|
|
3179
|
+
- `like` (Object|null): Details of the created "like" entry if the playlist is newly liked, or null if it was already liked.
|
|
3180
|
+
|
|
3181
|
+
The `like` object in the response includes:
|
|
3182
|
+
- `playlist_id`: The ID of the liked playlist.
|
|
3183
|
+
- `user_id`: The ID of the user who liked the playlist.
|
|
3184
|
+
- `brand`: The brand associated with the like.
|
|
3185
|
+
- `created_at`: Timestamp of when the like was created.
|
|
3186
|
+
</div>
|
|
3187
|
+
|
|
3188
|
+
|
|
3189
|
+
|
|
3190
|
+
<dl class="param-type">
|
|
3191
|
+
<dt>
|
|
3192
|
+
Type
|
|
3193
|
+
</dt>
|
|
3194
|
+
<dd>
|
|
3195
|
+
|
|
3196
|
+
<span class="param-type">Promise.<Object></span>
|
|
3197
|
+
|
|
3198
|
+
|
|
3199
|
+
|
|
3200
|
+
</dd>
|
|
3201
|
+
</dl>
|
|
3202
|
+
|
|
3203
|
+
|
|
3204
|
+
|
|
3205
|
+
|
|
3206
|
+
|
|
3207
|
+
|
|
3208
|
+
|
|
3209
|
+
|
|
3210
|
+
|
|
3211
|
+
|
|
3212
|
+
<h4 class="name" id=".updatePlaylist"><span class="type-signature type-signature-static">(static) </span>updatePlaylist<span class="signature">(playlistId, updatedData)</span><span class="type-signature"> → {Promise.<Object>}</span></h4>
|
|
3213
|
+
|
|
3214
|
+
|
|
3215
|
+
|
|
3216
|
+
|
|
3217
|
+
|
|
3218
|
+
|
|
3219
|
+
<dl class="details">
|
|
3220
|
+
|
|
3221
|
+
<dt class="tag-description">Description:</dt>
|
|
3222
|
+
<dd class="tag-description"><ul class="dummy"><li>Updates a user’s playlist by sending a PUT request with updated data to the API.
|
|
3223
|
+
|
|
3224
|
+
This function calls the `/playlists/playlist/{playlistId}` endpoint, where the server validates the incoming data
|
|
3225
|
+
and verifies that the authenticated user is the playlist owner. If authorized, it updates the playlist details with the provided data.</li></ul></dd>
|
|
3226
|
+
|
|
3227
|
+
|
|
3228
|
+
|
|
3229
|
+
<dt class="tag-source">Source:</dt>
|
|
3230
|
+
<dd class="tag-source"><ul class="dummy"><li>
|
|
3231
|
+
<a href="railcontent.js.html">railcontent.js</a>, <a href="railcontent.js.html#line453">line 453</a>
|
|
3232
|
+
</li></ul></dd>
|
|
3233
|
+
|
|
3234
|
+
|
|
3235
|
+
|
|
3236
|
+
|
|
3237
|
+
|
|
3238
|
+
|
|
3239
|
+
|
|
3240
|
+
|
|
3241
|
+
|
|
3242
|
+
|
|
3243
|
+
|
|
3244
|
+
|
|
3245
|
+
|
|
3246
|
+
|
|
3247
|
+
|
|
3248
|
+
|
|
3249
|
+
|
|
3250
|
+
|
|
3251
|
+
|
|
3252
|
+
|
|
3253
|
+
|
|
3254
|
+
|
|
3255
|
+
|
|
3256
|
+
|
|
3257
|
+
|
|
3258
|
+
|
|
3259
|
+
|
|
3260
|
+
|
|
3261
|
+
|
|
3262
|
+
|
|
3263
|
+
|
|
3264
|
+
</dl>
|
|
3265
|
+
|
|
3266
|
+
|
|
3267
|
+
|
|
3268
|
+
|
|
3269
|
+
|
|
3270
|
+
|
|
3271
|
+
|
|
3272
|
+
|
|
3273
|
+
|
|
3274
|
+
|
|
3275
|
+
|
|
3276
|
+
<h5 class="h5-examples">Example</h5>
|
|
3277
|
+
|
|
3278
|
+
<pre class="prettyprint"><code>updatePlaylist(12345, { name: "My New Playlist Name", description: "Updated description" })
|
|
3279
|
+
.then(response => {
|
|
3280
|
+
if (response.success) {
|
|
3281
|
+
console.log(response.message);
|
|
3282
|
+
}
|
|
3283
|
+
})
|
|
3284
|
+
.catch(error => console.error('Error updating playlist:', error));</code></pre>
|
|
3285
|
+
|
|
3286
|
+
|
|
3287
|
+
|
|
3288
|
+
|
|
3289
|
+
<h5 class="h5-parameters">Parameters:</h5>
|
|
3290
|
+
|
|
3291
|
+
|
|
3292
|
+
<table class="params">
|
|
3293
|
+
<thead>
|
|
3294
|
+
<tr>
|
|
3295
|
+
|
|
3296
|
+
<th>Name</th>
|
|
3297
|
+
|
|
3298
|
+
|
|
3299
|
+
<th>Type</th>
|
|
3300
|
+
|
|
3301
|
+
|
|
3302
|
+
|
|
3303
|
+
|
|
3304
|
+
|
|
3305
|
+
<th class="last">Description</th>
|
|
3306
|
+
</tr>
|
|
3307
|
+
</thead>
|
|
3308
|
+
|
|
3309
|
+
<tbody>
|
|
3310
|
+
|
|
3311
|
+
|
|
3312
|
+
<tr>
|
|
3313
|
+
|
|
3314
|
+
<td class="name"><code>playlistId</code></td>
|
|
3315
|
+
|
|
3316
|
+
|
|
3317
|
+
<td class="type">
|
|
3318
|
+
|
|
3319
|
+
|
|
3320
|
+
<span class="param-type">string</span>
|
|
3321
|
+
|
|
|
3322
|
+
|
|
3323
|
+
<span class="param-type">number</span>
|
|
3324
|
+
|
|
3325
|
+
|
|
3326
|
+
|
|
3327
|
+
|
|
3328
|
+
</td>
|
|
3329
|
+
|
|
3330
|
+
|
|
3331
|
+
|
|
3332
|
+
|
|
3333
|
+
|
|
3334
|
+
<td class="description last">The unique identifier of the playlist to be updated.</td>
|
|
3335
|
+
</tr>
|
|
3336
|
+
|
|
3337
|
+
|
|
3338
|
+
|
|
3339
|
+
<tr>
|
|
3340
|
+
|
|
3341
|
+
<td class="name"><code>updatedData</code></td>
|
|
3342
|
+
|
|
3343
|
+
|
|
3344
|
+
<td class="type">
|
|
3345
|
+
|
|
3346
|
+
|
|
3347
|
+
<span class="param-type">Object</span>
|
|
3348
|
+
|
|
3349
|
+
|
|
3350
|
+
|
|
3351
|
+
|
|
3352
|
+
</td>
|
|
3353
|
+
|
|
3354
|
+
|
|
3355
|
+
|
|
3356
|
+
|
|
3357
|
+
|
|
3358
|
+
<td class="description last">An object containing the playlist data to update. The possible fields include:
|
|
3359
|
+
- `name` (string): The new name of the playlist (max 255 characters).
|
|
3360
|
+
- `description` (string): A new description for the playlist (max 1000 characters).
|
|
3361
|
+
- `category` (string): The updated category of the playlist (max 255 characters).
|
|
3362
|
+
- `private` (boolean): Whether the playlist is private.
|
|
3363
|
+
- `thumbnail_url` (string): The URL of the playlist thumbnail.</td>
|
|
3364
|
+
</tr>
|
|
3365
|
+
|
|
3366
|
+
|
|
3367
|
+
</tbody>
|
|
3368
|
+
</table>
|
|
3369
|
+
|
|
3370
|
+
|
|
3371
|
+
|
|
3372
|
+
|
|
3373
|
+
|
|
3374
|
+
|
|
3375
|
+
|
|
3376
|
+
|
|
3377
|
+
|
|
3378
|
+
|
|
3379
|
+
|
|
3380
|
+
|
|
3381
|
+
|
|
3382
|
+
|
|
3383
|
+
|
|
3384
|
+
|
|
3385
|
+
<h5 class="h5-returns">Returns:</h5>
|
|
3386
|
+
|
|
3387
|
+
|
|
3388
|
+
<div class="param-desc">
|
|
3389
|
+
- A promise that resolves to an object containing:
|
|
3390
|
+
- `success` (boolean): Indicates if the update was successful (`true` for success).
|
|
3391
|
+
- `message` (string): Success confirmation message if the update is successful.
|
|
3392
|
+
- Other fields containing the updated playlist data.
|
|
3393
|
+
|
|
3394
|
+
If the user is unauthorized or the data validation fails, the promise rejects with an error.
|
|
3395
|
+
</div>
|
|
3396
|
+
|
|
3397
|
+
|
|
3398
|
+
|
|
3399
|
+
<dl class="param-type">
|
|
3400
|
+
<dt>
|
|
3401
|
+
Type
|
|
3402
|
+
</dt>
|
|
3403
|
+
<dd>
|
|
3404
|
+
|
|
3405
|
+
<span class="param-type">Promise.<Object></span>
|
|
3406
|
+
|
|
3407
|
+
|
|
3408
|
+
|
|
3409
|
+
</dd>
|
|
3410
|
+
</dl>
|
|
3411
|
+
|
|
3412
|
+
|
|
3413
|
+
|
|
3414
|
+
|
|
3415
|
+
|
|
3416
|
+
|
|
3417
|
+
|
|
3418
|
+
|
|
3419
|
+
|
|
3420
|
+
|
|
3421
|
+
<h4 class="name" id=".updatePlaylistItem"><span class="type-signature type-signature-static">(static) </span>updatePlaylistItem<span class="signature">(updatedData)</span><span class="type-signature"> → {Promise.<(Object|null)>}</span></h4>
|
|
3422
|
+
|
|
3423
|
+
|
|
3424
|
+
|
|
3425
|
+
|
|
3426
|
+
|
|
3427
|
+
|
|
3428
|
+
<dl class="details">
|
|
3429
|
+
|
|
3430
|
+
<dt class="tag-description">Description:</dt>
|
|
3431
|
+
<dd class="tag-description"><ul class="dummy"><li>Updates a playlist item with the provided data.</li></ul></dd>
|
|
3432
|
+
|
|
3433
|
+
|
|
3434
|
+
|
|
3435
|
+
<dt class="tag-source">Source:</dt>
|
|
3436
|
+
<dd class="tag-source"><ul class="dummy"><li>
|
|
3437
|
+
<a href="railcontent.js.html">railcontent.js</a>, <a href="railcontent.js.html#line623">line 623</a>
|
|
3438
|
+
</li></ul></dd>
|
|
3439
|
+
|
|
3440
|
+
|
|
3441
|
+
|
|
3442
|
+
|
|
3443
|
+
|
|
3444
|
+
|
|
3445
|
+
|
|
3446
|
+
|
|
3447
|
+
|
|
3448
|
+
|
|
3449
|
+
|
|
3450
|
+
|
|
3451
|
+
|
|
3452
|
+
|
|
3453
|
+
|
|
3454
|
+
|
|
3455
|
+
|
|
3456
|
+
|
|
3457
|
+
|
|
3458
|
+
|
|
3459
|
+
|
|
3460
|
+
|
|
3461
|
+
|
|
3462
|
+
|
|
3463
|
+
|
|
3464
|
+
|
|
3465
|
+
|
|
3466
|
+
|
|
3467
|
+
|
|
3468
|
+
|
|
3469
|
+
|
|
3470
|
+
</dl>
|
|
3471
|
+
|
|
3472
|
+
|
|
3473
|
+
|
|
3474
|
+
|
|
3475
|
+
|
|
3476
|
+
|
|
3477
|
+
|
|
3478
|
+
|
|
3479
|
+
|
|
3480
|
+
|
|
3481
|
+
|
|
3482
|
+
<h5 class="h5-examples">Example</h5>
|
|
3483
|
+
|
|
3484
|
+
<pre class="prettyprint"><code>const updatedData = {
|
|
3485
|
+
user_playlist_item_id: 123,
|
|
3486
|
+
start_second: 30,
|
|
3487
|
+
end_second: 120,
|
|
3488
|
+
playlist_item_name: "Updated Playlist Item Name"
|
|
3489
|
+
};
|
|
3490
|
+
|
|
3491
|
+
updatePlaylistItem(updatedData)
|
|
3492
|
+
.then(response => {
|
|
3493
|
+
if (response.success) {
|
|
3494
|
+
console.log("Playlist item updated successfully:", response.data);
|
|
3495
|
+
}
|
|
3496
|
+
})
|
|
3497
|
+
.catch(error => {
|
|
3498
|
+
console.error("Error updating playlist item:", error);
|
|
3499
|
+
});</code></pre>
|
|
3500
|
+
|
|
3501
|
+
|
|
3502
|
+
|
|
3503
|
+
|
|
3504
|
+
<h5 class="h5-parameters">Parameters:</h5>
|
|
3505
|
+
|
|
3506
|
+
|
|
3507
|
+
<table class="params">
|
|
3508
|
+
<thead>
|
|
3509
|
+
<tr>
|
|
3510
|
+
|
|
3511
|
+
<th>Name</th>
|
|
3512
|
+
|
|
3513
|
+
|
|
3514
|
+
<th>Type</th>
|
|
3515
|
+
|
|
3516
|
+
|
|
3517
|
+
|
|
3518
|
+
|
|
3519
|
+
|
|
3520
|
+
<th class="last">Description</th>
|
|
3521
|
+
</tr>
|
|
3522
|
+
</thead>
|
|
3523
|
+
|
|
3524
|
+
<tbody>
|
|
3525
|
+
|
|
3526
|
+
|
|
3527
|
+
<tr>
|
|
3528
|
+
|
|
3529
|
+
<td class="name"><code>updatedData</code></td>
|
|
3530
|
+
|
|
3531
|
+
|
|
3532
|
+
<td class="type">
|
|
3533
|
+
|
|
3534
|
+
|
|
3535
|
+
<span class="param-type">Object</span>
|
|
3536
|
+
|
|
3537
|
+
|
|
3538
|
+
|
|
3539
|
+
|
|
3540
|
+
</td>
|
|
3541
|
+
|
|
3542
|
+
|
|
3543
|
+
|
|
3544
|
+
|
|
3545
|
+
|
|
3546
|
+
<td class="description last">The data to update the playlist item with.
|
|
3547
|
+
<h6>Properties</h6>
|
|
3548
|
+
|
|
3549
|
+
|
|
3550
|
+
<table class="params">
|
|
3551
|
+
<thead>
|
|
3552
|
+
<tr>
|
|
3553
|
+
|
|
3554
|
+
<th>Name</th>
|
|
3555
|
+
|
|
3556
|
+
|
|
3557
|
+
<th>Type</th>
|
|
3558
|
+
|
|
3559
|
+
|
|
3560
|
+
<th>Attributes</th>
|
|
3561
|
+
|
|
3562
|
+
|
|
3563
|
+
|
|
3564
|
+
|
|
3565
|
+
<th class="last">Description</th>
|
|
3566
|
+
</tr>
|
|
3567
|
+
</thead>
|
|
3568
|
+
|
|
3569
|
+
<tbody>
|
|
3570
|
+
|
|
3571
|
+
|
|
3572
|
+
<tr>
|
|
3573
|
+
|
|
3574
|
+
<td class="name"><code>user_playlist_item_id</code></td>
|
|
3575
|
+
|
|
3576
|
+
|
|
3577
|
+
<td class="type">
|
|
3578
|
+
|
|
3579
|
+
|
|
3580
|
+
<span class="param-type">number</span>
|
|
3581
|
+
|
|
3582
|
+
|
|
3583
|
+
|
|
3584
|
+
|
|
3585
|
+
</td>
|
|
3586
|
+
|
|
3587
|
+
|
|
3588
|
+
<td class="attributes">
|
|
3589
|
+
|
|
3590
|
+
|
|
3591
|
+
|
|
3592
|
+
|
|
3593
|
+
|
|
3594
|
+
</td>
|
|
3595
|
+
|
|
3596
|
+
|
|
3597
|
+
|
|
3598
|
+
|
|
3599
|
+
<td class="description last">The ID of the playlist item to update.</td>
|
|
3600
|
+
</tr>
|
|
3601
|
+
|
|
3602
|
+
|
|
3603
|
+
|
|
3604
|
+
<tr>
|
|
3605
|
+
|
|
3606
|
+
<td class="name"><code>start_second</code></td>
|
|
3607
|
+
|
|
3608
|
+
|
|
3609
|
+
<td class="type">
|
|
3610
|
+
|
|
3611
|
+
|
|
3612
|
+
<span class="param-type">number</span>
|
|
3613
|
+
|
|
3614
|
+
|
|
3615
|
+
|
|
3616
|
+
|
|
3617
|
+
</td>
|
|
3618
|
+
|
|
3619
|
+
|
|
3620
|
+
<td class="attributes">
|
|
3621
|
+
|
|
3622
|
+
<optional><br>
|
|
3623
|
+
|
|
3624
|
+
|
|
3625
|
+
|
|
3626
|
+
|
|
3627
|
+
|
|
3628
|
+
</td>
|
|
3629
|
+
|
|
3630
|
+
|
|
3631
|
+
|
|
3632
|
+
|
|
3633
|
+
<td class="description last">(Optional) The start time in seconds for the item.</td>
|
|
3634
|
+
</tr>
|
|
3635
|
+
|
|
3636
|
+
|
|
3637
|
+
|
|
3638
|
+
<tr>
|
|
3639
|
+
|
|
3640
|
+
<td class="name"><code>end_second</code></td>
|
|
3641
|
+
|
|
3642
|
+
|
|
3643
|
+
<td class="type">
|
|
3644
|
+
|
|
3645
|
+
|
|
3646
|
+
<span class="param-type">number</span>
|
|
3647
|
+
|
|
3648
|
+
|
|
3649
|
+
|
|
3650
|
+
|
|
3651
|
+
</td>
|
|
3652
|
+
|
|
3653
|
+
|
|
3654
|
+
<td class="attributes">
|
|
3655
|
+
|
|
3656
|
+
<optional><br>
|
|
3657
|
+
|
|
3658
|
+
|
|
3659
|
+
|
|
3660
|
+
|
|
3661
|
+
|
|
3662
|
+
</td>
|
|
3663
|
+
|
|
3664
|
+
|
|
3665
|
+
|
|
3666
|
+
|
|
3667
|
+
<td class="description last">(Optional) The end time in seconds for the item.</td>
|
|
3668
|
+
</tr>
|
|
3669
|
+
|
|
3670
|
+
|
|
3671
|
+
|
|
3672
|
+
<tr>
|
|
3673
|
+
|
|
3674
|
+
<td class="name"><code>playlist_item_name</code></td>
|
|
3675
|
+
|
|
3676
|
+
|
|
3677
|
+
<td class="type">
|
|
3678
|
+
|
|
3679
|
+
|
|
3680
|
+
<span class="param-type">string</span>
|
|
3681
|
+
|
|
3682
|
+
|
|
3683
|
+
|
|
3684
|
+
|
|
3685
|
+
</td>
|
|
3686
|
+
|
|
3687
|
+
|
|
3688
|
+
<td class="attributes">
|
|
3689
|
+
|
|
3690
|
+
<optional><br>
|
|
3691
|
+
|
|
3692
|
+
|
|
3693
|
+
|
|
3694
|
+
|
|
3695
|
+
|
|
3696
|
+
</td>
|
|
3697
|
+
|
|
3698
|
+
|
|
3699
|
+
|
|
3700
|
+
|
|
3701
|
+
<td class="description last">(Optional) The new name for the playlist item.</td>
|
|
3702
|
+
</tr>
|
|
3703
|
+
|
|
3704
|
+
|
|
3705
|
+
</tbody>
|
|
3706
|
+
</table>
|
|
3707
|
+
|
|
3708
|
+
</td>
|
|
3709
|
+
</tr>
|
|
3710
|
+
|
|
3711
|
+
|
|
3712
|
+
</tbody>
|
|
3713
|
+
</table>
|
|
3714
|
+
|
|
3715
|
+
|
|
3716
|
+
|
|
3717
|
+
|
|
3718
|
+
|
|
3719
|
+
|
|
3720
|
+
|
|
3721
|
+
|
|
3722
|
+
|
|
3723
|
+
|
|
3724
|
+
|
|
3725
|
+
|
|
3726
|
+
|
|
3727
|
+
|
|
3728
|
+
<h5 class="h5-throws">Throws:</h5>
|
|
3729
|
+
|
|
3730
|
+
|
|
3731
|
+
|
|
3732
|
+
<dl>
|
|
3733
|
+
<dt>
|
|
3734
|
+
<div class="param-desc usertext">
|
|
3735
|
+
- Throws an error if the request fails.
|
|
3736
|
+
</div>
|
|
3737
|
+
</dt>
|
|
3738
|
+
<dd></dd>
|
|
3739
|
+
<dt>
|
|
3740
|
+
<dl class="param-type">
|
|
3741
|
+
<dt>
|
|
3742
|
+
Type
|
|
3743
|
+
</dt>
|
|
3744
|
+
<dd>
|
|
3745
|
+
|
|
3746
|
+
<span class="param-type">Error</span>
|
|
3747
|
+
|
|
3748
|
+
|
|
3749
|
+
|
|
3750
|
+
</dd>
|
|
3751
|
+
</dl>
|
|
3752
|
+
</dt>
|
|
3753
|
+
<dd></dd>
|
|
3754
|
+
</dl>
|
|
3755
|
+
|
|
3756
|
+
|
|
3757
|
+
|
|
3758
|
+
|
|
3759
|
+
|
|
3760
|
+
<h5 class="h5-returns">Returns:</h5>
|
|
3761
|
+
|
|
3762
|
+
|
|
3763
|
+
<div class="param-desc">
|
|
3764
|
+
- A promise that resolves to an object containing:
|
|
3765
|
+
- `success` (boolean): Indicates if the update was successful (`true` for success).
|
|
3766
|
+
- `data` (Object): The updated playlist item data.
|
|
3767
|
+
|
|
3768
|
+
Resolves to `null` if the request fails.
|
|
1397
3769
|
</div>
|
|
1398
3770
|
|
|
1399
3771
|
|
|
@@ -1435,7 +3807,7 @@
|
|
|
1435
3807
|
<br class="clear">
|
|
1436
3808
|
|
|
1437
3809
|
<footer>
|
|
1438
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.3</a> on Thu Oct
|
|
3810
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.3</a> on Thu Oct 31 2024 13:45:42 GMT+0000 (Coordinated Universal Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
1439
3811
|
</footer>
|
|
1440
3812
|
|
|
1441
3813
|
<script>prettyPrint();</script>
|