musora-content-services 1.0.148 → 1.0.152

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.
@@ -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#.deletePlaylistItem">deletePlaylistItem</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#.fetchPlaylistItem">fetchPlaylistItem</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=".fetchAllCompletedStates"><span class="type-signature type-signature-static">(static) </span>fetchAllCompletedStates<span class="signature">(contentIds)</span><span class="type-signature"> &rarr; {Promise.&lt;(Object|null)>}</span></h4>
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"> &rarr; {Promise.&lt;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>Fetches the completion status for multiple songs for the current user.</li></ul></dd>
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#line59">line 59</a>
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>fetchAllCompletedStates('user123', ['song456', 'song789'], 'csrf-token')
233
- .then(statuses => console.log(statuses))
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>contentIds</code></td>
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">Array.&lt;string></span>
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 array of content IDs to check.</td>
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
- - Returns an object containing completion statuses keyed by content ID, or null if an error occurs.
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.&lt;(Object|null)></span>
331
+ <span class="param-type">Promise.&lt;Object></span>
319
332
 
320
333
 
321
334
 
@@ -331,7 +344,7 @@
331
344
 
332
345
 
333
346
 
334
- <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"> &rarr; {Promise.&lt;(Object|null)>}</span></h4>
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"> &rarr; {Promise.&lt;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>Fetches a list of content that has been completed for the current user.</li></ul></dd>
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#line169">line 169</a>
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>fetchCompletedContent('song', 'drumeo')
398
- .then(songs => console.log(songs))
399
- .catch(error => console.error(error));</code></pre>
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>type</code></td>
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
- &lt;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
- &lt;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 page number for pagination.</td>
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
- - Returns an object containing in-progress content if found, otherwise null.
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.&lt;(Object|null)></span>
510
+ <span class="param-type">Promise.&lt;Object></span>
616
511
 
617
512
 
618
513
 
@@ -628,7 +523,7 @@
628
523
 
629
524
 
630
525
 
631
- <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"> &rarr; {Promise.&lt;(Object|null)>}</span></h4>
526
+ <h4 class="name" id=".deletePlaylistItem"><span class="type-signature type-signature-static">(static) </span>deletePlaylistItem<span class="signature">(payload)</span><span class="type-signature"> &rarr; {Promise.&lt;(Object|null)>}</span></h4>
632
527
 
633
528
 
634
529
 
@@ -638,13 +533,13 @@
638
533
  <dl class="details">
639
534
 
640
535
  <dt class="tag-description">Description:</dt>
641
- <dd class="tag-description"><ul class="dummy"><li>Fetches the completion status of a specific lesson for the current user.</li></ul></dd>
536
+ <dd class="tag-description"><ul class="dummy"><li>Deletes a playlist item and repositions other items in the playlist if necessary.</li></ul></dd>
642
537
 
643
538
 
644
539
 
645
540
  <dt class="tag-source">Source:</dt>
646
541
  <dd class="tag-source"><ul class="dummy"><li>
647
- <a href="railcontent.js.html">railcontent.js</a>, <a href="railcontent.js.html#line25">line 25</a>
542
+ <a href="railcontent.js.html">railcontent.js</a>, <a href="railcontent.js.html#line660">line 660</a>
648
543
  </li></ul></dd>
649
544
 
650
545
 
@@ -691,9 +586,21 @@
691
586
 
692
587
  <h5 class="h5-examples">Example</h5>
693
588
 
694
- <pre class="prettyprint"><code>fetchCurrentSongComplete('user123', 'lesson456', 'csrf-token')
695
- .then(status => console.log(status))
696
- .catch(error => console.error(error));</code></pre>
589
+ <pre class="prettyprint"><code>const payload = {
590
+ user_playlist_item_id: 123
591
+ };
592
+
593
+ deletePlaylistItem(payload)
594
+ .then(response => {
595
+ if (response.success) {
596
+ console.log("Playlist item deleted successfully:", response.message);
597
+ } else {
598
+ console.error("Error:", response.error);
599
+ }
600
+ })
601
+ .catch(error => {
602
+ console.error("Error deleting playlist item:", error);
603
+ });</code></pre>
697
604
 
698
605
 
699
606
 
@@ -723,13 +630,13 @@
723
630
 
724
631
  <tr>
725
632
 
726
- <td class="name"><code>content_id</code></td>
633
+ <td class="name"><code>payload</code></td>
727
634
 
728
635
 
729
636
  <td class="type">
730
637
 
731
638
 
732
- <span class="param-type">string</span>
639
+ <span class="param-type">Object</span>
733
640
 
734
641
 
735
642
 
@@ -740,7 +647,57 @@
740
647
 
741
648
 
742
649
 
743
- <td class="description last">The ID of the lesson content to check.</td>
650
+ <td class="description last">The data required to delete the playlist item.
651
+ <h6>Properties</h6>
652
+
653
+
654
+ <table class="params">
655
+ <thead>
656
+ <tr>
657
+
658
+ <th>Name</th>
659
+
660
+
661
+ <th>Type</th>
662
+
663
+
664
+
665
+
666
+
667
+ <th class="last">Description</th>
668
+ </tr>
669
+ </thead>
670
+
671
+ <tbody>
672
+
673
+
674
+ <tr>
675
+
676
+ <td class="name"><code>user_playlist_item_id</code></td>
677
+
678
+
679
+ <td class="type">
680
+
681
+
682
+ <span class="param-type">number</span>
683
+
684
+
685
+
686
+
687
+ </td>
688
+
689
+
690
+
691
+
692
+
693
+ <td class="description last">The ID of the playlist item to delete.</td>
694
+ </tr>
695
+
696
+
697
+ </tbody>
698
+ </table>
699
+
700
+ </td>
744
701
  </tr>
745
702
 
746
703
 
@@ -760,13 +717,48 @@
760
717
 
761
718
 
762
719
 
720
+ <h5 class="h5-throws">Throws:</h5>
721
+
722
+
723
+
724
+ <dl>
725
+ <dt>
726
+ <div class="param-desc usertext">
727
+ - Throws an error if the request fails.
728
+ </div>
729
+ </dt>
730
+ <dd></dd>
731
+ <dt>
732
+ <dl class="param-type">
733
+ <dt>
734
+ Type
735
+ </dt>
736
+ <dd>
737
+
738
+ <span class="param-type">Error</span>
739
+
740
+
741
+
742
+ </dd>
743
+ </dl>
744
+ </dt>
745
+ <dd></dd>
746
+ </dl>
747
+
748
+
749
+
763
750
 
764
751
 
765
752
  <h5 class="h5-returns">Returns:</h5>
766
753
 
767
754
 
768
755
  <div class="param-desc">
769
- - Returns the completion status object if found, otherwise null.
756
+ - A promise that resolves to an object containing:
757
+ - `success` (boolean): Indicates if the deletion was successful (`true` for success).
758
+ - `message` (string): A success message if the item is deleted successfully.
759
+ - `error` (string): An error message if the deletion fails.
760
+
761
+ Resolves to `null` if the request fails.
770
762
  </div>
771
763
 
772
764
 
@@ -793,7 +785,7 @@
793
785
 
794
786
 
795
787
 
796
- <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"> &rarr; {Promise.&lt;(Object|null)>}</span></h4>
788
+ <h4 class="name" id=".deletePlaylistLike"><span class="type-signature type-signature-static">(static) </span>deletePlaylistLike<span class="signature">(playlistId)</span><span class="type-signature"> &rarr; {Promise.&lt;Object>}</span></h4>
797
789
 
798
790
 
799
791
 
@@ -803,13 +795,16 @@
803
795
  <dl class="details">
804
796
 
805
797
  <dt class="tag-description">Description:</dt>
806
- <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>
798
+ <dd class="tag-description"><ul class="dummy"><li>Removes a "like" from a playlist for the authenticated user.
799
+
800
+ This function sends a DELETE request to the `/playlists/like` endpoint, where the server validates the `playlist_id`
801
+ and checks if a like by the authenticated user already exists for the specified playlist. If so, it deletes the like.</li></ul></dd>
807
802
 
808
803
 
809
804
 
810
805
  <dt class="tag-source">Source:</dt>
811
806
  <dd class="tag-source"><ul class="dummy"><li>
812
- <a href="railcontent.js.html">railcontent.js</a>, <a href="railcontent.js.html#line127">line 127</a>
807
+ <a href="railcontent.js.html">railcontent.js</a>, <a href="railcontent.js.html#line543">line 543</a>
813
808
  </li></ul></dd>
814
809
 
815
810
 
@@ -856,9 +851,13 @@
856
851
 
857
852
  <h5 class="h5-examples">Example</h5>
858
853
 
859
- <pre class="prettyprint"><code>fetchContentInProgress('song', 'drumeo')
860
- .then(songs => console.log(songs))
861
- .catch(error => console.error(error));</code></pre>
854
+ <pre class="prettyprint"><code>deletePlaylistLike(12345)
855
+ .then(response => {
856
+ if (response.success) {
857
+ console.log(response.message);
858
+ }
859
+ })
860
+ .catch(error => console.error('Error removing playlist like:', error));</code></pre>
862
861
 
863
862
 
864
863
 
@@ -876,12 +875,8 @@
876
875
  <th>Type</th>
877
876
 
878
877
 
879
- <th>Attributes</th>
880
-
881
878
 
882
879
 
883
- <th>Default</th>
884
-
885
880
 
886
881
  <th class="last">Description</th>
887
882
  </tr>
@@ -892,13 +887,16 @@
892
887
 
893
888
  <tr>
894
889
 
895
- <td class="name"><code>type</code></td>
890
+ <td class="name"><code>playlistId</code></td>
896
891
 
897
892
 
898
893
  <td class="type">
899
894
 
900
895
 
901
896
  <span class="param-type">string</span>
897
+ |
898
+
899
+ <span class="param-type">number</span>
902
900
 
903
901
 
904
902
 
@@ -906,20 +904,1205 @@
906
904
  </td>
907
905
 
908
906
 
909
- <td class="attributes">
910
-
911
-
912
-
913
907
 
914
-
915
- </td>
916
908
 
917
909
 
918
-
919
- <td class="default">
920
-
921
- </td>
922
-
910
+ <td class="description last">The unique identifier of the playlist whose like is to be removed.</td>
911
+ </tr>
912
+
913
+
914
+ </tbody>
915
+ </table>
916
+
917
+
918
+
919
+
920
+
921
+
922
+
923
+
924
+
925
+
926
+
927
+
928
+
929
+
930
+
931
+
932
+ <h5 class="h5-returns">Returns:</h5>
933
+
934
+
935
+ <div class="param-desc">
936
+ - A promise that resolves with the response from the API. The response contains:
937
+ - `success` (boolean): Indicates if the removal was successful (`true` for success).
938
+ - `message` (string): A success message if the playlist like is removed successfully or a notification if the playlist was not previously liked.
939
+ </div>
940
+
941
+
942
+
943
+ <dl class="param-type">
944
+ <dt>
945
+ Type
946
+ </dt>
947
+ <dd>
948
+
949
+ <span class="param-type">Promise.&lt;Object></span>
950
+
951
+
952
+
953
+ </dd>
954
+ </dl>
955
+
956
+
957
+
958
+
959
+
960
+
961
+
962
+
963
+
964
+
965
+ <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"> &rarr; {Promise.&lt;Object>}</span></h4>
966
+
967
+
968
+
969
+
970
+
971
+
972
+ <dl class="details">
973
+
974
+ <dt class="tag-description">Description:</dt>
975
+ <dd class="tag-description"><ul class="dummy"><li>Duplicates an existing playlist by sending a POST request to the API.
976
+
977
+ This function calls the `/playlists/duplicate` endpoint, where the server replicates the specified playlist,
978
+ including its items. Optionally, new `name`, `description`, `category`, or `thumbnail_url` parameters can be provided
979
+ to customize the duplicated playlist. If a new name is not provided, the server appends " (Duplicate)" to the original name.</li></ul></dd>
980
+
981
+
982
+
983
+ <dt class="tag-source">Source:</dt>
984
+ <dd class="tag-source"><ul class="dummy"><li>
985
+ <a href="railcontent.js.html">railcontent.js</a>, <a href="railcontent.js.html#line389">line 389</a>
986
+ </li></ul></dd>
987
+
988
+
989
+
990
+
991
+
992
+
993
+
994
+
995
+
996
+
997
+
998
+
999
+
1000
+
1001
+
1002
+
1003
+
1004
+
1005
+
1006
+
1007
+
1008
+
1009
+
1010
+
1011
+
1012
+
1013
+
1014
+
1015
+
1016
+
1017
+
1018
+ </dl>
1019
+
1020
+
1021
+
1022
+
1023
+
1024
+
1025
+
1026
+
1027
+
1028
+
1029
+
1030
+ <h5 class="h5-examples">Example</h5>
1031
+
1032
+ <pre class="prettyprint"><code>duplicatePlaylist(12345, { name: "My New Playlist" })
1033
+ .then(duplicatedPlaylist => console.log(duplicatedPlaylist))
1034
+ .catch(error => console.error('Error duplicating playlist:', error));</code></pre>
1035
+
1036
+
1037
+
1038
+
1039
+ <h5 class="h5-parameters">Parameters:</h5>
1040
+
1041
+
1042
+ <table class="params">
1043
+ <thead>
1044
+ <tr>
1045
+
1046
+ <th>Name</th>
1047
+
1048
+
1049
+ <th>Type</th>
1050
+
1051
+
1052
+ <th>Attributes</th>
1053
+
1054
+
1055
+
1056
+
1057
+ <th class="last">Description</th>
1058
+ </tr>
1059
+ </thead>
1060
+
1061
+ <tbody>
1062
+
1063
+
1064
+ <tr>
1065
+
1066
+ <td class="name"><code>playlistId</code></td>
1067
+
1068
+
1069
+ <td class="type">
1070
+
1071
+
1072
+ <span class="param-type">string</span>
1073
+ |
1074
+
1075
+ <span class="param-type">number</span>
1076
+
1077
+
1078
+
1079
+
1080
+ </td>
1081
+
1082
+
1083
+ <td class="attributes">
1084
+
1085
+
1086
+
1087
+
1088
+
1089
+ </td>
1090
+
1091
+
1092
+
1093
+
1094
+ <td class="description last">The unique identifier of the playlist to be duplicated.</td>
1095
+ </tr>
1096
+
1097
+
1098
+
1099
+ <tr>
1100
+
1101
+ <td class="name"><code>playlistData</code></td>
1102
+
1103
+
1104
+ <td class="type">
1105
+
1106
+
1107
+ <span class="param-type">Object</span>
1108
+
1109
+
1110
+
1111
+
1112
+ </td>
1113
+
1114
+
1115
+ <td class="attributes">
1116
+
1117
+ &lt;optional><br>
1118
+
1119
+
1120
+
1121
+
1122
+
1123
+ </td>
1124
+
1125
+
1126
+
1127
+
1128
+ <td class="description last">Optional data to customize the duplicated playlist.
1129
+ <h6>Properties</h6>
1130
+
1131
+
1132
+ <table class="params">
1133
+ <thead>
1134
+ <tr>
1135
+
1136
+ <th>Name</th>
1137
+
1138
+
1139
+ <th>Type</th>
1140
+
1141
+
1142
+ <th>Attributes</th>
1143
+
1144
+
1145
+
1146
+
1147
+ <th class="last">Description</th>
1148
+ </tr>
1149
+ </thead>
1150
+
1151
+ <tbody>
1152
+
1153
+
1154
+ <tr>
1155
+
1156
+ <td class="name"><code>name</code></td>
1157
+
1158
+
1159
+ <td class="type">
1160
+
1161
+
1162
+ <span class="param-type">string</span>
1163
+
1164
+
1165
+
1166
+
1167
+ </td>
1168
+
1169
+
1170
+ <td class="attributes">
1171
+
1172
+ &lt;optional><br>
1173
+
1174
+
1175
+
1176
+
1177
+
1178
+ </td>
1179
+
1180
+
1181
+
1182
+
1183
+ <td class="description last">New name for the duplicated playlist (default is original name + " (Duplicate)").</td>
1184
+ </tr>
1185
+
1186
+
1187
+
1188
+ <tr>
1189
+
1190
+ <td class="name"><code>description</code></td>
1191
+
1192
+
1193
+ <td class="type">
1194
+
1195
+
1196
+ <span class="param-type">string</span>
1197
+
1198
+
1199
+
1200
+
1201
+ </td>
1202
+
1203
+
1204
+ <td class="attributes">
1205
+
1206
+ &lt;optional><br>
1207
+
1208
+
1209
+
1210
+
1211
+
1212
+ </td>
1213
+
1214
+
1215
+
1216
+
1217
+ <td class="description last">New description for the duplicated playlist (defaults to original description).</td>
1218
+ </tr>
1219
+
1220
+
1221
+
1222
+ <tr>
1223
+
1224
+ <td class="name"><code>category</code></td>
1225
+
1226
+
1227
+ <td class="type">
1228
+
1229
+
1230
+ <span class="param-type">string</span>
1231
+
1232
+
1233
+
1234
+
1235
+ </td>
1236
+
1237
+
1238
+ <td class="attributes">
1239
+
1240
+ &lt;optional><br>
1241
+
1242
+
1243
+
1244
+
1245
+
1246
+ </td>
1247
+
1248
+
1249
+
1250
+
1251
+ <td class="description last">New category for the duplicated playlist (defaults to original category).</td>
1252
+ </tr>
1253
+
1254
+
1255
+
1256
+ <tr>
1257
+
1258
+ <td class="name"><code>thumbnail_url</code></td>
1259
+
1260
+
1261
+ <td class="type">
1262
+
1263
+
1264
+ <span class="param-type">string</span>
1265
+
1266
+
1267
+
1268
+
1269
+ </td>
1270
+
1271
+
1272
+ <td class="attributes">
1273
+
1274
+ &lt;optional><br>
1275
+
1276
+
1277
+
1278
+
1279
+
1280
+ </td>
1281
+
1282
+
1283
+
1284
+
1285
+ <td class="description last">New URL for the duplicated playlist thumbnail (defaults to original thumbnail).</td>
1286
+ </tr>
1287
+
1288
+
1289
+ </tbody>
1290
+ </table>
1291
+
1292
+ </td>
1293
+ </tr>
1294
+
1295
+
1296
+ </tbody>
1297
+ </table>
1298
+
1299
+
1300
+
1301
+
1302
+
1303
+
1304
+
1305
+
1306
+
1307
+
1308
+
1309
+
1310
+
1311
+
1312
+
1313
+
1314
+ <h5 class="h5-returns">Returns:</h5>
1315
+
1316
+
1317
+ <div class="param-desc">
1318
+ - A promise that resolves to the duplicated playlist data, or rejects with an error if the duplication fails.
1319
+
1320
+ The duplicated playlist contains:
1321
+ - `name` (string): Name of the new playlist.
1322
+ - `description` (string|null): Description of the duplicated playlist.
1323
+ - `category` (string|null): Category of the duplicated playlist.
1324
+ - `thumbnail_url` (string|null): URL of the playlist thumbnail.
1325
+ - `items` (Array): A list of items (e.g., songs, tracks) copied from the original playlist.
1326
+ </div>
1327
+
1328
+
1329
+
1330
+ <dl class="param-type">
1331
+ <dt>
1332
+ Type
1333
+ </dt>
1334
+ <dd>
1335
+
1336
+ <span class="param-type">Promise.&lt;Object></span>
1337
+
1338
+
1339
+
1340
+ </dd>
1341
+ </dl>
1342
+
1343
+
1344
+
1345
+
1346
+
1347
+
1348
+
1349
+
1350
+
1351
+
1352
+ <h4 class="name" id=".fetchAllCompletedStates"><span class="type-signature type-signature-static">(static) </span>fetchAllCompletedStates<span class="signature">(contentIds)</span><span class="type-signature"> &rarr; {Promise.&lt;(Object|null)>}</span></h4>
1353
+
1354
+
1355
+
1356
+
1357
+
1358
+
1359
+ <dl class="details">
1360
+
1361
+ <dt class="tag-description">Description:</dt>
1362
+ <dd class="tag-description"><ul class="dummy"><li>Fetches the completion status for multiple songs for the current user.</li></ul></dd>
1363
+
1364
+
1365
+
1366
+ <dt class="tag-source">Source:</dt>
1367
+ <dd class="tag-source"><ul class="dummy"><li>
1368
+ <a href="railcontent.js.html">railcontent.js</a>, <a href="railcontent.js.html#line59">line 59</a>
1369
+ </li></ul></dd>
1370
+
1371
+
1372
+
1373
+
1374
+
1375
+
1376
+
1377
+
1378
+
1379
+
1380
+
1381
+
1382
+
1383
+
1384
+
1385
+
1386
+
1387
+
1388
+
1389
+
1390
+
1391
+
1392
+
1393
+
1394
+
1395
+
1396
+
1397
+
1398
+
1399
+
1400
+
1401
+ </dl>
1402
+
1403
+
1404
+
1405
+
1406
+
1407
+
1408
+
1409
+
1410
+
1411
+
1412
+
1413
+ <h5 class="h5-examples">Example</h5>
1414
+
1415
+ <pre class="prettyprint"><code>fetchAllCompletedStates('user123', ['song456', 'song789'], 'csrf-token')
1416
+ .then(statuses => console.log(statuses))
1417
+ .catch(error => console.error(error));</code></pre>
1418
+
1419
+
1420
+
1421
+
1422
+ <h5 class="h5-parameters">Parameters:</h5>
1423
+
1424
+
1425
+ <table class="params">
1426
+ <thead>
1427
+ <tr>
1428
+
1429
+ <th>Name</th>
1430
+
1431
+
1432
+ <th>Type</th>
1433
+
1434
+
1435
+
1436
+
1437
+
1438
+ <th class="last">Description</th>
1439
+ </tr>
1440
+ </thead>
1441
+
1442
+ <tbody>
1443
+
1444
+
1445
+ <tr>
1446
+
1447
+ <td class="name"><code>contentIds</code></td>
1448
+
1449
+
1450
+ <td class="type">
1451
+
1452
+
1453
+ <span class="param-type">Array.&lt;string></span>
1454
+
1455
+
1456
+
1457
+
1458
+ </td>
1459
+
1460
+
1461
+
1462
+
1463
+
1464
+ <td class="description last">An array of content IDs to check.</td>
1465
+ </tr>
1466
+
1467
+
1468
+ </tbody>
1469
+ </table>
1470
+
1471
+
1472
+
1473
+
1474
+
1475
+
1476
+
1477
+
1478
+
1479
+
1480
+
1481
+
1482
+
1483
+
1484
+
1485
+
1486
+ <h5 class="h5-returns">Returns:</h5>
1487
+
1488
+
1489
+ <div class="param-desc">
1490
+ - Returns an object containing completion statuses keyed by content ID, or null if an error occurs.
1491
+ </div>
1492
+
1493
+
1494
+
1495
+ <dl class="param-type">
1496
+ <dt>
1497
+ Type
1498
+ </dt>
1499
+ <dd>
1500
+
1501
+ <span class="param-type">Promise.&lt;(Object|null)></span>
1502
+
1503
+
1504
+
1505
+ </dd>
1506
+ </dl>
1507
+
1508
+
1509
+
1510
+
1511
+
1512
+
1513
+
1514
+
1515
+
1516
+
1517
+ <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"> &rarr; {Promise.&lt;(Object|null)>}</span></h4>
1518
+
1519
+
1520
+
1521
+
1522
+
1523
+
1524
+ <dl class="details">
1525
+
1526
+ <dt class="tag-description">Description:</dt>
1527
+ <dd class="tag-description"><ul class="dummy"><li>Fetches a list of content that has been completed for the current user.</li></ul></dd>
1528
+
1529
+
1530
+
1531
+ <dt class="tag-source">Source:</dt>
1532
+ <dd class="tag-source"><ul class="dummy"><li>
1533
+ <a href="railcontent.js.html">railcontent.js</a>, <a href="railcontent.js.html#line169">line 169</a>
1534
+ </li></ul></dd>
1535
+
1536
+
1537
+
1538
+
1539
+
1540
+
1541
+
1542
+
1543
+
1544
+
1545
+
1546
+
1547
+
1548
+
1549
+
1550
+
1551
+
1552
+
1553
+
1554
+
1555
+
1556
+
1557
+
1558
+
1559
+
1560
+
1561
+
1562
+
1563
+
1564
+
1565
+
1566
+ </dl>
1567
+
1568
+
1569
+
1570
+
1571
+
1572
+
1573
+
1574
+
1575
+
1576
+
1577
+
1578
+ <h5 class="h5-examples">Example</h5>
1579
+
1580
+ <pre class="prettyprint"><code>fetchCompletedContent('song', 'drumeo')
1581
+ .then(songs => console.log(songs))
1582
+ .catch(error => console.error(error));</code></pre>
1583
+
1584
+
1585
+
1586
+
1587
+ <h5 class="h5-parameters">Parameters:</h5>
1588
+
1589
+
1590
+ <table class="params">
1591
+ <thead>
1592
+ <tr>
1593
+
1594
+ <th>Name</th>
1595
+
1596
+
1597
+ <th>Type</th>
1598
+
1599
+
1600
+ <th>Attributes</th>
1601
+
1602
+
1603
+
1604
+ <th>Default</th>
1605
+
1606
+
1607
+ <th class="last">Description</th>
1608
+ </tr>
1609
+ </thead>
1610
+
1611
+ <tbody>
1612
+
1613
+
1614
+ <tr>
1615
+
1616
+ <td class="name"><code>type</code></td>
1617
+
1618
+
1619
+ <td class="type">
1620
+
1621
+
1622
+ <span class="param-type">string</span>
1623
+
1624
+
1625
+
1626
+
1627
+ </td>
1628
+
1629
+
1630
+ <td class="attributes">
1631
+
1632
+
1633
+
1634
+
1635
+
1636
+ </td>
1637
+
1638
+
1639
+
1640
+ <td class="default">
1641
+
1642
+ </td>
1643
+
1644
+
1645
+ <td class="description last">The content type associated with the content.</td>
1646
+ </tr>
1647
+
1648
+
1649
+
1650
+ <tr>
1651
+
1652
+ <td class="name"><code>brand</code></td>
1653
+
1654
+
1655
+ <td class="type">
1656
+
1657
+
1658
+ <span class="param-type">string</span>
1659
+
1660
+
1661
+
1662
+
1663
+ </td>
1664
+
1665
+
1666
+ <td class="attributes">
1667
+
1668
+
1669
+
1670
+
1671
+
1672
+ </td>
1673
+
1674
+
1675
+
1676
+ <td class="default">
1677
+
1678
+ </td>
1679
+
1680
+
1681
+ <td class="description last">The brand associated with the content.</td>
1682
+ </tr>
1683
+
1684
+
1685
+
1686
+ <tr>
1687
+
1688
+ <td class="name"><code>params.limit</code></td>
1689
+
1690
+
1691
+ <td class="type">
1692
+
1693
+
1694
+ <span class="param-type">number</span>
1695
+
1696
+
1697
+
1698
+
1699
+ </td>
1700
+
1701
+
1702
+ <td class="attributes">
1703
+
1704
+ &lt;optional><br>
1705
+
1706
+
1707
+
1708
+
1709
+
1710
+ </td>
1711
+
1712
+
1713
+
1714
+ <td class="default">
1715
+
1716
+ <code>20</code>
1717
+
1718
+ </td>
1719
+
1720
+
1721
+ <td class="description last">The limit of results per page.</td>
1722
+ </tr>
1723
+
1724
+
1725
+
1726
+ <tr>
1727
+
1728
+ <td class="name"><code>params.page</code></td>
1729
+
1730
+
1731
+ <td class="type">
1732
+
1733
+
1734
+ <span class="param-type">number</span>
1735
+
1736
+
1737
+
1738
+
1739
+ </td>
1740
+
1741
+
1742
+ <td class="attributes">
1743
+
1744
+ &lt;optional><br>
1745
+
1746
+
1747
+
1748
+
1749
+
1750
+ </td>
1751
+
1752
+
1753
+
1754
+ <td class="default">
1755
+
1756
+ <code>1</code>
1757
+
1758
+ </td>
1759
+
1760
+
1761
+ <td class="description last">The page number for pagination.</td>
1762
+ </tr>
1763
+
1764
+
1765
+ </tbody>
1766
+ </table>
1767
+
1768
+
1769
+
1770
+
1771
+
1772
+
1773
+
1774
+
1775
+
1776
+
1777
+
1778
+
1779
+
1780
+
1781
+
1782
+
1783
+ <h5 class="h5-returns">Returns:</h5>
1784
+
1785
+
1786
+ <div class="param-desc">
1787
+ - Returns an object containing in-progress content if found, otherwise null.
1788
+ </div>
1789
+
1790
+
1791
+
1792
+ <dl class="param-type">
1793
+ <dt>
1794
+ Type
1795
+ </dt>
1796
+ <dd>
1797
+
1798
+ <span class="param-type">Promise.&lt;(Object|null)></span>
1799
+
1800
+
1801
+
1802
+ </dd>
1803
+ </dl>
1804
+
1805
+
1806
+
1807
+
1808
+
1809
+
1810
+
1811
+
1812
+
1813
+
1814
+ <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"> &rarr; {Promise.&lt;(Object|null)>}</span></h4>
1815
+
1816
+
1817
+
1818
+
1819
+
1820
+
1821
+ <dl class="details">
1822
+
1823
+ <dt class="tag-description">Description:</dt>
1824
+ <dd class="tag-description"><ul class="dummy"><li>Fetches the completion status of a specific lesson for the current user.</li></ul></dd>
1825
+
1826
+
1827
+
1828
+ <dt class="tag-source">Source:</dt>
1829
+ <dd class="tag-source"><ul class="dummy"><li>
1830
+ <a href="railcontent.js.html">railcontent.js</a>, <a href="railcontent.js.html#line25">line 25</a>
1831
+ </li></ul></dd>
1832
+
1833
+
1834
+
1835
+
1836
+
1837
+
1838
+
1839
+
1840
+
1841
+
1842
+
1843
+
1844
+
1845
+
1846
+
1847
+
1848
+
1849
+
1850
+
1851
+
1852
+
1853
+
1854
+
1855
+
1856
+
1857
+
1858
+
1859
+
1860
+
1861
+
1862
+
1863
+ </dl>
1864
+
1865
+
1866
+
1867
+
1868
+
1869
+
1870
+
1871
+
1872
+
1873
+
1874
+
1875
+ <h5 class="h5-examples">Example</h5>
1876
+
1877
+ <pre class="prettyprint"><code>fetchCurrentSongComplete('user123', 'lesson456', 'csrf-token')
1878
+ .then(status => console.log(status))
1879
+ .catch(error => console.error(error));</code></pre>
1880
+
1881
+
1882
+
1883
+
1884
+ <h5 class="h5-parameters">Parameters:</h5>
1885
+
1886
+
1887
+ <table class="params">
1888
+ <thead>
1889
+ <tr>
1890
+
1891
+ <th>Name</th>
1892
+
1893
+
1894
+ <th>Type</th>
1895
+
1896
+
1897
+
1898
+
1899
+
1900
+ <th class="last">Description</th>
1901
+ </tr>
1902
+ </thead>
1903
+
1904
+ <tbody>
1905
+
1906
+
1907
+ <tr>
1908
+
1909
+ <td class="name"><code>content_id</code></td>
1910
+
1911
+
1912
+ <td class="type">
1913
+
1914
+
1915
+ <span class="param-type">string</span>
1916
+
1917
+
1918
+
1919
+
1920
+ </td>
1921
+
1922
+
1923
+
1924
+
1925
+
1926
+ <td class="description last">The ID of the lesson content to check.</td>
1927
+ </tr>
1928
+
1929
+
1930
+ </tbody>
1931
+ </table>
1932
+
1933
+
1934
+
1935
+
1936
+
1937
+
1938
+
1939
+
1940
+
1941
+
1942
+
1943
+
1944
+
1945
+
1946
+
1947
+
1948
+ <h5 class="h5-returns">Returns:</h5>
1949
+
1950
+
1951
+ <div class="param-desc">
1952
+ - Returns the completion status object if found, otherwise null.
1953
+ </div>
1954
+
1955
+
1956
+
1957
+ <dl class="param-type">
1958
+ <dt>
1959
+ Type
1960
+ </dt>
1961
+ <dd>
1962
+
1963
+ <span class="param-type">Promise.&lt;(Object|null)></span>
1964
+
1965
+
1966
+
1967
+ </dd>
1968
+ </dl>
1969
+
1970
+
1971
+
1972
+
1973
+
1974
+
1975
+
1976
+
1977
+
1978
+
1979
+ <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"> &rarr; {Promise.&lt;(Object|null)>}</span></h4>
1980
+
1981
+
1982
+
1983
+
1984
+
1985
+
1986
+ <dl class="details">
1987
+
1988
+ <dt class="tag-description">Description:</dt>
1989
+ <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>
1990
+
1991
+
1992
+
1993
+ <dt class="tag-source">Source:</dt>
1994
+ <dd class="tag-source"><ul class="dummy"><li>
1995
+ <a href="railcontent.js.html">railcontent.js</a>, <a href="railcontent.js.html#line127">line 127</a>
1996
+ </li></ul></dd>
1997
+
1998
+
1999
+
2000
+
2001
+
2002
+
2003
+
2004
+
2005
+
2006
+
2007
+
2008
+
2009
+
2010
+
2011
+
2012
+
2013
+
2014
+
2015
+
2016
+
2017
+
2018
+
2019
+
2020
+
2021
+
2022
+
2023
+
2024
+
2025
+
2026
+
2027
+
2028
+ </dl>
2029
+
2030
+
2031
+
2032
+
2033
+
2034
+
2035
+
2036
+
2037
+
2038
+
2039
+
2040
+ <h5 class="h5-examples">Example</h5>
2041
+
2042
+ <pre class="prettyprint"><code>fetchContentInProgress('song', 'drumeo')
2043
+ .then(songs => console.log(songs))
2044
+ .catch(error => console.error(error));</code></pre>
2045
+
2046
+
2047
+
2048
+
2049
+ <h5 class="h5-parameters">Parameters:</h5>
2050
+
2051
+
2052
+ <table class="params">
2053
+ <thead>
2054
+ <tr>
2055
+
2056
+ <th>Name</th>
2057
+
2058
+
2059
+ <th>Type</th>
2060
+
2061
+
2062
+ <th>Attributes</th>
2063
+
2064
+
2065
+
2066
+ <th>Default</th>
2067
+
2068
+
2069
+ <th class="last">Description</th>
2070
+ </tr>
2071
+ </thead>
2072
+
2073
+ <tbody>
2074
+
2075
+
2076
+ <tr>
2077
+
2078
+ <td class="name"><code>type</code></td>
2079
+
2080
+
2081
+ <td class="type">
2082
+
2083
+
2084
+ <span class="param-type">string</span>
2085
+
2086
+
2087
+
2088
+
2089
+ </td>
2090
+
2091
+
2092
+ <td class="attributes">
2093
+
2094
+
2095
+
2096
+
2097
+
2098
+ </td>
2099
+
2100
+
2101
+
2102
+ <td class="default">
2103
+
2104
+ </td>
2105
+
923
2106
 
924
2107
  <td class="description last">The content type associated with the content.</td>
925
2108
  </tr>
@@ -957,7 +2140,1200 @@
957
2140
  </td>
958
2141
 
959
2142
 
960
- <td class="description last">The brand associated with the content.</td>
2143
+ <td class="description last">The brand associated with the content.</td>
2144
+ </tr>
2145
+
2146
+
2147
+
2148
+ <tr>
2149
+
2150
+ <td class="name"><code>params.limit</code></td>
2151
+
2152
+
2153
+ <td class="type">
2154
+
2155
+
2156
+ <span class="param-type">number</span>
2157
+
2158
+
2159
+
2160
+
2161
+ </td>
2162
+
2163
+
2164
+ <td class="attributes">
2165
+
2166
+ &lt;optional><br>
2167
+
2168
+
2169
+
2170
+
2171
+
2172
+ </td>
2173
+
2174
+
2175
+
2176
+ <td class="default">
2177
+
2178
+ <code>20</code>
2179
+
2180
+ </td>
2181
+
2182
+
2183
+ <td class="description last">The limit of results per page.</td>
2184
+ </tr>
2185
+
2186
+
2187
+
2188
+ <tr>
2189
+
2190
+ <td class="name"><code>params.page</code></td>
2191
+
2192
+
2193
+ <td class="type">
2194
+
2195
+
2196
+ <span class="param-type">number</span>
2197
+
2198
+
2199
+
2200
+
2201
+ </td>
2202
+
2203
+
2204
+ <td class="attributes">
2205
+
2206
+ &lt;optional><br>
2207
+
2208
+
2209
+
2210
+
2211
+
2212
+ </td>
2213
+
2214
+
2215
+
2216
+ <td class="default">
2217
+
2218
+ <code>1</code>
2219
+
2220
+ </td>
2221
+
2222
+
2223
+ <td class="description last">The page number for pagination.</td>
2224
+ </tr>
2225
+
2226
+
2227
+ </tbody>
2228
+ </table>
2229
+
2230
+
2231
+
2232
+
2233
+
2234
+
2235
+
2236
+
2237
+
2238
+
2239
+
2240
+
2241
+
2242
+
2243
+
2244
+
2245
+ <h5 class="h5-returns">Returns:</h5>
2246
+
2247
+
2248
+ <div class="param-desc">
2249
+ - Returns an object containing in-progress content if found, otherwise null.
2250
+ </div>
2251
+
2252
+
2253
+
2254
+ <dl class="param-type">
2255
+ <dt>
2256
+ Type
2257
+ </dt>
2258
+ <dd>
2259
+
2260
+ <span class="param-type">Promise.&lt;(Object|null)></span>
2261
+
2262
+
2263
+
2264
+ </dd>
2265
+ </dl>
2266
+
2267
+
2268
+
2269
+
2270
+
2271
+
2272
+
2273
+
2274
+
2275
+
2276
+ <h4 class="name" id=".fetchContentPageUserData"><span class="type-signature type-signature-static">(static) </span>fetchContentPageUserData<span class="signature">(contentId)</span><span class="type-signature"> &rarr; {Promise.&lt;(Object|null)>}</span></h4>
2277
+
2278
+
2279
+
2280
+
2281
+
2282
+
2283
+ <dl class="details">
2284
+
2285
+ <dt class="tag-description">Description:</dt>
2286
+ <dd class="tag-description"><ul class="dummy"><li>Fetches user context data for a specific piece of content.</li></ul></dd>
2287
+
2288
+
2289
+
2290
+ <dt class="tag-source">Source:</dt>
2291
+ <dd class="tag-source"><ul class="dummy"><li>
2292
+ <a href="railcontent.js.html">railcontent.js</a>, <a href="railcontent.js.html#line209">line 209</a>
2293
+ </li></ul></dd>
2294
+
2295
+
2296
+
2297
+
2298
+
2299
+
2300
+
2301
+
2302
+
2303
+
2304
+
2305
+
2306
+
2307
+
2308
+
2309
+
2310
+
2311
+
2312
+
2313
+
2314
+
2315
+
2316
+
2317
+
2318
+
2319
+
2320
+
2321
+
2322
+
2323
+
2324
+
2325
+ </dl>
2326
+
2327
+
2328
+
2329
+
2330
+
2331
+
2332
+
2333
+
2334
+
2335
+
2336
+
2337
+ <h5 class="h5-examples">Example</h5>
2338
+
2339
+ <pre class="prettyprint"><code>fetchContentPageUserData(406548)
2340
+ .then(data => console.log(data))
2341
+ .catch(error => console.error(error));</code></pre>
2342
+
2343
+
2344
+
2345
+
2346
+ <h5 class="h5-parameters">Parameters:</h5>
2347
+
2348
+
2349
+ <table class="params">
2350
+ <thead>
2351
+ <tr>
2352
+
2353
+ <th>Name</th>
2354
+
2355
+
2356
+ <th>Type</th>
2357
+
2358
+
2359
+
2360
+
2361
+
2362
+ <th class="last">Description</th>
2363
+ </tr>
2364
+ </thead>
2365
+
2366
+ <tbody>
2367
+
2368
+
2369
+ <tr>
2370
+
2371
+ <td class="name"><code>contentId</code></td>
2372
+
2373
+
2374
+ <td class="type">
2375
+
2376
+
2377
+ <span class="param-type">int</span>
2378
+
2379
+
2380
+
2381
+
2382
+ </td>
2383
+
2384
+
2385
+
2386
+
2387
+
2388
+ <td class="description last">The content id.</td>
2389
+ </tr>
2390
+
2391
+
2392
+ </tbody>
2393
+ </table>
2394
+
2395
+
2396
+
2397
+
2398
+
2399
+
2400
+
2401
+
2402
+
2403
+
2404
+
2405
+
2406
+
2407
+
2408
+
2409
+
2410
+ <h5 class="h5-returns">Returns:</h5>
2411
+
2412
+
2413
+ <div class="param-desc">
2414
+ - Returns an object containing user context data if found, otherwise null.
2415
+ </div>
2416
+
2417
+
2418
+
2419
+ <dl class="param-type">
2420
+ <dt>
2421
+ Type
2422
+ </dt>
2423
+ <dd>
2424
+
2425
+ <span class="param-type">Promise.&lt;(Object|null)></span>
2426
+
2427
+
2428
+
2429
+ </dd>
2430
+ </dl>
2431
+
2432
+
2433
+
2434
+
2435
+
2436
+
2437
+
2438
+
2439
+
2440
+
2441
+ <h4 class="name" id=".fetchPlaylist"><span class="type-signature type-signature-static">(static) </span>fetchPlaylist<span class="signature">(playlistId)</span><span class="type-signature"> &rarr; {Promise.&lt;Object>}</span></h4>
2442
+
2443
+
2444
+
2445
+
2446
+
2447
+
2448
+ <dl class="details">
2449
+
2450
+ <dt class="tag-description">Description:</dt>
2451
+ <dd class="tag-description"><ul class="dummy"><li>Retrieves details of a specific playlist by its ID.
2452
+
2453
+ This function sends a GET request to the `/playlists/playlist` endpoint with a specified playlist ID.
2454
+ The server validates the user's access to the playlist and returns playlist details if the user is authorized.</li></ul></dd>
2455
+
2456
+
2457
+
2458
+ <dt class="tag-source">Source:</dt>
2459
+ <dd class="tag-source"><ul class="dummy"><li>
2460
+ <a href="railcontent.js.html">railcontent.js</a>, <a href="railcontent.js.html#line565">line 565</a>
2461
+ </li></ul></dd>
2462
+
2463
+
2464
+
2465
+
2466
+
2467
+
2468
+
2469
+
2470
+
2471
+
2472
+
2473
+
2474
+
2475
+
2476
+
2477
+
2478
+
2479
+
2480
+
2481
+
2482
+
2483
+
2484
+
2485
+
2486
+
2487
+
2488
+
2489
+
2490
+
2491
+
2492
+
2493
+ </dl>
2494
+
2495
+
2496
+
2497
+
2498
+
2499
+
2500
+
2501
+
2502
+
2503
+
2504
+
2505
+ <h5 class="h5-examples">Example</h5>
2506
+
2507
+ <pre class="prettyprint"><code>fetchPlaylist(12345)
2508
+ .then(response => console.log(response.data))
2509
+ .catch(error => console.error('Error fetching playlist:', error));</code></pre>
2510
+
2511
+
2512
+
2513
+
2514
+ <h5 class="h5-parameters">Parameters:</h5>
2515
+
2516
+
2517
+ <table class="params">
2518
+ <thead>
2519
+ <tr>
2520
+
2521
+ <th>Name</th>
2522
+
2523
+
2524
+ <th>Type</th>
2525
+
2526
+
2527
+
2528
+
2529
+
2530
+ <th class="last">Description</th>
2531
+ </tr>
2532
+ </thead>
2533
+
2534
+ <tbody>
2535
+
2536
+
2537
+ <tr>
2538
+
2539
+ <td class="name"><code>playlistId</code></td>
2540
+
2541
+
2542
+ <td class="type">
2543
+
2544
+
2545
+ <span class="param-type">string</span>
2546
+ |
2547
+
2548
+ <span class="param-type">number</span>
2549
+
2550
+
2551
+
2552
+
2553
+ </td>
2554
+
2555
+
2556
+
2557
+
2558
+
2559
+ <td class="description last">The unique identifier of the playlist to retrieve.</td>
2560
+ </tr>
2561
+
2562
+
2563
+ </tbody>
2564
+ </table>
2565
+
2566
+
2567
+
2568
+
2569
+
2570
+
2571
+
2572
+
2573
+
2574
+
2575
+
2576
+
2577
+
2578
+
2579
+
2580
+
2581
+ <h5 class="h5-returns">Returns:</h5>
2582
+
2583
+
2584
+ <div class="param-desc">
2585
+ - A promise that resolves to the response from the API, containing:
2586
+ - `data` (Object): The playlist details, or an error message if access is denied or the playlist is not found.
2587
+ </div>
2588
+
2589
+
2590
+
2591
+ <dl class="param-type">
2592
+ <dt>
2593
+ Type
2594
+ </dt>
2595
+ <dd>
2596
+
2597
+ <span class="param-type">Promise.&lt;Object></span>
2598
+
2599
+
2600
+
2601
+ </dd>
2602
+ </dl>
2603
+
2604
+
2605
+
2606
+
2607
+
2608
+
2609
+
2610
+
2611
+
2612
+
2613
+ <h4 class="name" id=".fetchPlaylistItem"><span class="type-signature type-signature-static">(static) </span>fetchPlaylistItem<span class="signature">(payload)</span><span class="type-signature"> &rarr; {Promise.&lt;(Object|null)>}</span></h4>
2614
+
2615
+
2616
+
2617
+
2618
+
2619
+
2620
+ <dl class="details">
2621
+
2622
+ <dt class="tag-description">Description:</dt>
2623
+ <dd class="tag-description"><ul class="dummy"><li>Fetches detailed data for a specific playlist item, including associated Sanity and Assignment information if available.</li></ul></dd>
2624
+
2625
+
2626
+
2627
+ <dt class="tag-source">Source:</dt>
2628
+ <dd class="tag-source"><ul class="dummy"><li>
2629
+ <a href="railcontent.js.html">railcontent.js</a>, <a href="railcontent.js.html#line690">line 690</a>
2630
+ </li></ul></dd>
2631
+
2632
+
2633
+
2634
+
2635
+
2636
+
2637
+
2638
+
2639
+
2640
+
2641
+
2642
+
2643
+
2644
+
2645
+
2646
+
2647
+
2648
+
2649
+
2650
+
2651
+
2652
+
2653
+
2654
+
2655
+
2656
+
2657
+
2658
+
2659
+
2660
+
2661
+
2662
+ </dl>
2663
+
2664
+
2665
+
2666
+
2667
+
2668
+
2669
+
2670
+
2671
+
2672
+
2673
+
2674
+ <h5 class="h5-examples">Example</h5>
2675
+
2676
+ <pre class="prettyprint"><code>const payload = { user_playlist_item_id: 123 };
2677
+
2678
+ fetchPlaylistItem(payload)
2679
+ .then(response => {
2680
+ if (response.success) {
2681
+ console.log("Fetched playlist item data:", response.data);
2682
+ }
2683
+ })
2684
+ .catch(error => {
2685
+ console.error("Error fetching playlist item:", error);
2686
+ });</code></pre>
2687
+
2688
+
2689
+
2690
+
2691
+ <h5 class="h5-parameters">Parameters:</h5>
2692
+
2693
+
2694
+ <table class="params">
2695
+ <thead>
2696
+ <tr>
2697
+
2698
+ <th>Name</th>
2699
+
2700
+
2701
+ <th>Type</th>
2702
+
2703
+
2704
+
2705
+
2706
+
2707
+ <th class="last">Description</th>
2708
+ </tr>
2709
+ </thead>
2710
+
2711
+ <tbody>
2712
+
2713
+
2714
+ <tr>
2715
+
2716
+ <td class="name"><code>payload</code></td>
2717
+
2718
+
2719
+ <td class="type">
2720
+
2721
+
2722
+ <span class="param-type">Object</span>
2723
+
2724
+
2725
+
2726
+
2727
+ </td>
2728
+
2729
+
2730
+
2731
+
2732
+
2733
+ <td class="description last">The request payload containing necessary parameters.
2734
+ <h6>Properties</h6>
2735
+
2736
+
2737
+ <table class="params">
2738
+ <thead>
2739
+ <tr>
2740
+
2741
+ <th>Name</th>
2742
+
2743
+
2744
+ <th>Type</th>
2745
+
2746
+
2747
+
2748
+
2749
+
2750
+ <th class="last">Description</th>
2751
+ </tr>
2752
+ </thead>
2753
+
2754
+ <tbody>
2755
+
2756
+
2757
+ <tr>
2758
+
2759
+ <td class="name"><code>user_playlist_item_id</code></td>
2760
+
2761
+
2762
+ <td class="type">
2763
+
2764
+
2765
+ <span class="param-type">number</span>
2766
+
2767
+
2768
+
2769
+
2770
+ </td>
2771
+
2772
+
2773
+
2774
+
2775
+
2776
+ <td class="description last">The ID of the playlist item to fetch.</td>
2777
+ </tr>
2778
+
2779
+
2780
+ </tbody>
2781
+ </table>
2782
+
2783
+ </td>
2784
+ </tr>
2785
+
2786
+
2787
+ </tbody>
2788
+ </table>
2789
+
2790
+
2791
+
2792
+
2793
+
2794
+
2795
+
2796
+
2797
+
2798
+
2799
+
2800
+
2801
+
2802
+
2803
+ <h5 class="h5-throws">Throws:</h5>
2804
+
2805
+
2806
+
2807
+ <dl>
2808
+ <dt>
2809
+ <div class="param-desc usertext">
2810
+ - Throws an error if the request fails.
2811
+ </div>
2812
+ </dt>
2813
+ <dd></dd>
2814
+ <dt>
2815
+ <dl class="param-type">
2816
+ <dt>
2817
+ Type
2818
+ </dt>
2819
+ <dd>
2820
+
2821
+ <span class="param-type">Error</span>
2822
+
2823
+
2824
+
2825
+ </dd>
2826
+ </dl>
2827
+ </dt>
2828
+ <dd></dd>
2829
+ </dl>
2830
+
2831
+
2832
+
2833
+
2834
+
2835
+ <h5 class="h5-returns">Returns:</h5>
2836
+
2837
+
2838
+ <div class="param-desc">
2839
+ - A promise that resolves to an object containing the playlist item data, including:
2840
+ - `success` (boolean): Indicates if the retrieval was successful (`true` for success).
2841
+ - `data` (Object): The playlist item data enriched with Sanity and Assignment details.
2842
+
2843
+ Resolves to `null` if the request fails.
2844
+ </div>
2845
+
2846
+
2847
+
2848
+ <dl class="param-type">
2849
+ <dt>
2850
+ Type
2851
+ </dt>
2852
+ <dd>
2853
+
2854
+ <span class="param-type">Promise.&lt;(Object|null)></span>
2855
+
2856
+
2857
+
2858
+ </dd>
2859
+ </dl>
2860
+
2861
+
2862
+
2863
+
2864
+
2865
+
2866
+
2867
+
2868
+
2869
+
2870
+ <h4 class="name" id=".fetchPlaylistItems"><span class="type-signature type-signature-static">(static) </span>fetchPlaylistItems<span class="signature">(playlistId)</span><span class="type-signature"> &rarr; {Promise.&lt;Array.&lt;Object>>}</span></h4>
2871
+
2872
+
2873
+
2874
+
2875
+
2876
+
2877
+ <dl class="details">
2878
+
2879
+ <dt class="tag-description">Description:</dt>
2880
+ <dd class="tag-description"><ul class="dummy"><li>Retrieves items within a specified playlist by playlist ID.
2881
+
2882
+ This function sends a GET request to the `/playlists/playlist-lessons` endpoint to fetch items in the given playlist.
2883
+ The server combines data from the playlist and additional metadata from Sanity to enhance item details.</li></ul></dd>
2884
+
2885
+
2886
+
2887
+ <dt class="tag-source">Source:</dt>
2888
+ <dd class="tag-source"><ul class="dummy"><li>
2889
+ <a href="railcontent.js.html">railcontent.js</a>, <a href="railcontent.js.html#line585">line 585</a>
2890
+ </li></ul></dd>
2891
+
2892
+
2893
+
2894
+
2895
+
2896
+
2897
+
2898
+
2899
+
2900
+
2901
+
2902
+
2903
+
2904
+
2905
+
2906
+
2907
+
2908
+
2909
+
2910
+
2911
+
2912
+
2913
+
2914
+
2915
+
2916
+
2917
+
2918
+
2919
+
2920
+
2921
+
2922
+ </dl>
2923
+
2924
+
2925
+
2926
+
2927
+
2928
+
2929
+
2930
+
2931
+
2932
+
2933
+
2934
+ <h5 class="h5-examples">Example</h5>
2935
+
2936
+ <pre class="prettyprint"><code>fetchPlaylistItems(12345)
2937
+ .then(items => console.log(items))
2938
+ .catch(error => console.error('Error fetching playlist items:', error));</code></pre>
2939
+
2940
+
2941
+
2942
+
2943
+ <h5 class="h5-parameters">Parameters:</h5>
2944
+
2945
+
2946
+ <table class="params">
2947
+ <thead>
2948
+ <tr>
2949
+
2950
+ <th>Name</th>
2951
+
2952
+
2953
+ <th>Type</th>
2954
+
2955
+
2956
+
2957
+
2958
+
2959
+ <th class="last">Description</th>
2960
+ </tr>
2961
+ </thead>
2962
+
2963
+ <tbody>
2964
+
2965
+
2966
+ <tr>
2967
+
2968
+ <td class="name"><code>playlistId</code></td>
2969
+
2970
+
2971
+ <td class="type">
2972
+
2973
+
2974
+ <span class="param-type">string</span>
2975
+ |
2976
+
2977
+ <span class="param-type">number</span>
2978
+
2979
+
2980
+
2981
+
2982
+ </td>
2983
+
2984
+
2985
+
2986
+
2987
+
2988
+ <td class="description last">The unique identifier of the playlist whose items are to be fetched.</td>
2989
+ </tr>
2990
+
2991
+
2992
+ </tbody>
2993
+ </table>
2994
+
2995
+
2996
+
2997
+
2998
+
2999
+
3000
+
3001
+
3002
+
3003
+
3004
+
3005
+
3006
+
3007
+
3008
+
3009
+
3010
+ <h5 class="h5-returns">Returns:</h5>
3011
+
3012
+
3013
+ <div class="param-desc">
3014
+ - A promise that resolves to an array of playlist items
3015
+ </div>
3016
+
3017
+
3018
+
3019
+ <dl class="param-type">
3020
+ <dt>
3021
+ Type
3022
+ </dt>
3023
+ <dd>
3024
+
3025
+ <span class="param-type">Promise.&lt;Array.&lt;Object>></span>
3026
+
3027
+
3028
+
3029
+ </dd>
3030
+ </dl>
3031
+
3032
+
3033
+
3034
+
3035
+
3036
+
3037
+
3038
+
3039
+
3040
+
3041
+ <h4 class="name" id=".fetchSongsInProgress"><span class="type-signature type-signature-static">(static) </span>fetchSongsInProgress<span class="signature">(brand)</span><span class="type-signature"> &rarr; {Promise.&lt;(Object|null)>}</span></h4>
3042
+
3043
+
3044
+
3045
+
3046
+
3047
+
3048
+ <dl class="details">
3049
+
3050
+ <dt class="tag-description">Description:</dt>
3051
+ <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>
3052
+
3053
+
3054
+
3055
+ <dt class="tag-source">Source:</dt>
3056
+ <dd class="tag-source"><ul class="dummy"><li>
3057
+ <a href="railcontent.js.html">railcontent.js</a>, <a href="railcontent.js.html#line91">line 91</a>
3058
+ </li></ul></dd>
3059
+
3060
+
3061
+
3062
+
3063
+
3064
+
3065
+
3066
+
3067
+
3068
+
3069
+
3070
+
3071
+
3072
+
3073
+
3074
+
3075
+
3076
+
3077
+
3078
+
3079
+
3080
+
3081
+
3082
+
3083
+
3084
+
3085
+
3086
+
3087
+
3088
+
3089
+
3090
+ </dl>
3091
+
3092
+
3093
+
3094
+
3095
+
3096
+
3097
+
3098
+
3099
+
3100
+
3101
+
3102
+ <h5 class="h5-examples">Example</h5>
3103
+
3104
+ <pre class="prettyprint"><code>fetchSongsInProgress('drumeo')
3105
+ .then(songs => console.log(songs))
3106
+ .catch(error => console.error(error));</code></pre>
3107
+
3108
+
3109
+
3110
+
3111
+ <h5 class="h5-parameters">Parameters:</h5>
3112
+
3113
+
3114
+ <table class="params">
3115
+ <thead>
3116
+ <tr>
3117
+
3118
+ <th>Name</th>
3119
+
3120
+
3121
+ <th>Type</th>
3122
+
3123
+
3124
+
3125
+
3126
+
3127
+ <th class="last">Description</th>
3128
+ </tr>
3129
+ </thead>
3130
+
3131
+ <tbody>
3132
+
3133
+
3134
+ <tr>
3135
+
3136
+ <td class="name"><code>brand</code></td>
3137
+
3138
+
3139
+ <td class="type">
3140
+
3141
+
3142
+ <span class="param-type">string</span>
3143
+
3144
+
3145
+
3146
+
3147
+ </td>
3148
+
3149
+
3150
+
3151
+
3152
+
3153
+ <td class="description last">The brand associated with the songs.</td>
3154
+ </tr>
3155
+
3156
+
3157
+ </tbody>
3158
+ </table>
3159
+
3160
+
3161
+
3162
+
3163
+
3164
+
3165
+
3166
+
3167
+
3168
+
3169
+
3170
+
3171
+
3172
+
3173
+
3174
+
3175
+ <h5 class="h5-returns">Returns:</h5>
3176
+
3177
+
3178
+ <div class="param-desc">
3179
+ - Returns an object containing in-progress songs if found, otherwise null.
3180
+ </div>
3181
+
3182
+
3183
+
3184
+ <dl class="param-type">
3185
+ <dt>
3186
+ Type
3187
+ </dt>
3188
+ <dd>
3189
+
3190
+ <span class="param-type">Promise.&lt;(Object|null)></span>
3191
+
3192
+
3193
+
3194
+ </dd>
3195
+ </dl>
3196
+
3197
+
3198
+
3199
+
3200
+
3201
+
3202
+
3203
+
3204
+
3205
+
3206
+ <h4 class="name" id=".fetchUserPlaylists"><span class="type-signature type-signature-static">(static) </span>fetchUserPlaylists<span class="signature">(brand)</span><span class="type-signature"> &rarr; {Promise.&lt;(Object|null)>}</span></h4>
3207
+
3208
+
3209
+
3210
+
3211
+
3212
+
3213
+ <dl class="details">
3214
+
3215
+ <dt class="tag-description">Description:</dt>
3216
+ <dd class="tag-description"><ul class="dummy"><li>Fetches user playlists for a specific brand.
3217
+
3218
+ Allows optional pagination, sorting, and search parameters to control the result set.</li></ul></dd>
3219
+
3220
+
3221
+
3222
+ <dt class="tag-source">Source:</dt>
3223
+ <dd class="tag-source"><ul class="dummy"><li>
3224
+ <a href="railcontent.js.html">railcontent.js</a>, <a href="railcontent.js.html#line351">line 351</a>
3225
+ </li></ul></dd>
3226
+
3227
+
3228
+
3229
+
3230
+
3231
+
3232
+
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
+ </dl>
3258
+
3259
+
3260
+
3261
+
3262
+
3263
+
3264
+
3265
+
3266
+
3267
+
3268
+
3269
+ <h5 class="h5-examples">Example</h5>
3270
+
3271
+ <pre class="prettyprint"><code>fetchUserPlaylists('drumeo', { page: 1, sort: 'name', searchTerm: 'rock' })
3272
+ .then(playlists => console.log(playlists))
3273
+ .catch(error => console.error(error));</code></pre>
3274
+
3275
+
3276
+
3277
+
3278
+ <h5 class="h5-parameters">Parameters:</h5>
3279
+
3280
+
3281
+ <table class="params">
3282
+ <thead>
3283
+ <tr>
3284
+
3285
+ <th>Name</th>
3286
+
3287
+
3288
+ <th>Type</th>
3289
+
3290
+
3291
+ <th>Attributes</th>
3292
+
3293
+
3294
+
3295
+ <th>Default</th>
3296
+
3297
+
3298
+ <th class="last">Description</th>
3299
+ </tr>
3300
+ </thead>
3301
+
3302
+ <tbody>
3303
+
3304
+
3305
+ <tr>
3306
+
3307
+ <td class="name"><code>brand</code></td>
3308
+
3309
+
3310
+ <td class="type">
3311
+
3312
+
3313
+ <span class="param-type">string</span>
3314
+
3315
+
3316
+
3317
+
3318
+ </td>
3319
+
3320
+
3321
+ <td class="attributes">
3322
+
3323
+
3324
+
3325
+
3326
+
3327
+ </td>
3328
+
3329
+
3330
+
3331
+ <td class="default">
3332
+
3333
+ </td>
3334
+
3335
+
3336
+ <td class="description last">The brand identifier for which playlists are being fetched.</td>
961
3337
  </tr>
962
3338
 
963
3339
 
@@ -992,12 +3368,12 @@
992
3368
 
993
3369
  <td class="default">
994
3370
 
995
- <code>20</code>
3371
+ <code>10</code>
996
3372
 
997
3373
  </td>
998
3374
 
999
3375
 
1000
- <td class="description last">The limit of results per page.</td>
3376
+ <td class="description last">The maximum number of playlists to return per page (default is 10).</td>
1001
3377
  </tr>
1002
3378
 
1003
3379
 
@@ -1037,7 +3413,260 @@
1037
3413
  </td>
1038
3414
 
1039
3415
 
1040
- <td class="description last">The page number for pagination.</td>
3416
+ <td class="description last">The page number for pagination.</td>
3417
+ </tr>
3418
+
3419
+
3420
+
3421
+ <tr>
3422
+
3423
+ <td class="name"><code>params.sort</code></td>
3424
+
3425
+
3426
+ <td class="type">
3427
+
3428
+
3429
+ <span class="param-type">string</span>
3430
+
3431
+
3432
+
3433
+
3434
+ </td>
3435
+
3436
+
3437
+ <td class="attributes">
3438
+
3439
+ &lt;optional><br>
3440
+
3441
+
3442
+
3443
+
3444
+
3445
+ </td>
3446
+
3447
+
3448
+
3449
+ <td class="default">
3450
+
3451
+ <code>'-created_at'</code>
3452
+
3453
+ </td>
3454
+
3455
+
3456
+ <td class="description last">The sorting order for the playlists (default is by created_at in descending order).</td>
3457
+ </tr>
3458
+
3459
+
3460
+
3461
+ <tr>
3462
+
3463
+ <td class="name"><code>params.searchTerm</code></td>
3464
+
3465
+
3466
+ <td class="type">
3467
+
3468
+
3469
+ <span class="param-type">string</span>
3470
+
3471
+
3472
+
3473
+
3474
+ </td>
3475
+
3476
+
3477
+ <td class="attributes">
3478
+
3479
+ &lt;optional><br>
3480
+
3481
+
3482
+
3483
+
3484
+
3485
+ </td>
3486
+
3487
+
3488
+
3489
+ <td class="default">
3490
+
3491
+ </td>
3492
+
3493
+
3494
+ <td class="description last">A search term to filter playlists by name.</td>
3495
+ </tr>
3496
+
3497
+
3498
+ </tbody>
3499
+ </table>
3500
+
3501
+
3502
+
3503
+
3504
+
3505
+
3506
+
3507
+
3508
+
3509
+
3510
+
3511
+
3512
+
3513
+
3514
+
3515
+
3516
+ <h5 class="h5-returns">Returns:</h5>
3517
+
3518
+
3519
+ <div class="param-desc">
3520
+ - A promise that resolves to the response from the API, containing the user playlists data.
3521
+ </div>
3522
+
3523
+
3524
+
3525
+ <dl class="param-type">
3526
+ <dt>
3527
+ Type
3528
+ </dt>
3529
+ <dd>
3530
+
3531
+ <span class="param-type">Promise.&lt;(Object|null)></span>
3532
+
3533
+
3534
+
3535
+ </dd>
3536
+ </dl>
3537
+
3538
+
3539
+
3540
+
3541
+
3542
+
3543
+
3544
+
3545
+
3546
+
3547
+ <h4 class="name" id=".likePlaylist"><span class="type-signature type-signature-static">(static) </span>likePlaylist<span class="signature">(playlistId)</span><span class="type-signature"> &rarr; {Promise.&lt;Object>}</span></h4>
3548
+
3549
+
3550
+
3551
+
3552
+
3553
+
3554
+ <dl class="details">
3555
+
3556
+ <dt class="tag-description">Description:</dt>
3557
+ <dd class="tag-description"><ul class="dummy"><li>Sends a request to "like" a playlist on behalf of the authenticated user.
3558
+
3559
+ This function calls the `/playlists/playlist/like` endpoint, where the server validates the `playlist_id` and checks
3560
+ if the authenticated user has already liked the playlist. If not, it creates a new "like" entry associated with the playlist.</li></ul></dd>
3561
+
3562
+
3563
+
3564
+ <dt class="tag-source">Source:</dt>
3565
+ <dd class="tag-source"><ul class="dummy"><li>
3566
+ <a href="railcontent.js.html">railcontent.js</a>, <a href="railcontent.js.html#line516">line 516</a>
3567
+ </li></ul></dd>
3568
+
3569
+
3570
+
3571
+
3572
+
3573
+
3574
+
3575
+
3576
+
3577
+
3578
+
3579
+
3580
+
3581
+
3582
+
3583
+
3584
+
3585
+
3586
+
3587
+
3588
+
3589
+
3590
+
3591
+
3592
+
3593
+
3594
+
3595
+
3596
+
3597
+
3598
+
3599
+ </dl>
3600
+
3601
+
3602
+
3603
+
3604
+
3605
+
3606
+
3607
+
3608
+
3609
+
3610
+
3611
+ <h5 class="h5-examples">Example</h5>
3612
+
3613
+ <pre class="prettyprint"><code>likePlaylist(12345)
3614
+ .then(response => {
3615
+ if (response.success) {
3616
+ console.log(response.message);
3617
+ }
3618
+ })
3619
+ .catch(error => console.error('Error liking playlist:', error));</code></pre>
3620
+
3621
+
3622
+
3623
+
3624
+ <h5 class="h5-parameters">Parameters:</h5>
3625
+
3626
+
3627
+ <table class="params">
3628
+ <thead>
3629
+ <tr>
3630
+
3631
+ <th>Name</th>
3632
+
3633
+
3634
+ <th>Type</th>
3635
+
3636
+
3637
+
3638
+
3639
+
3640
+ <th class="last">Description</th>
3641
+ </tr>
3642
+ </thead>
3643
+
3644
+ <tbody>
3645
+
3646
+
3647
+ <tr>
3648
+
3649
+ <td class="name"><code>playlistId</code></td>
3650
+
3651
+
3652
+ <td class="type">
3653
+
3654
+
3655
+ <span class="param-type">string</span>
3656
+ |
3657
+
3658
+ <span class="param-type">number</span>
3659
+
3660
+
3661
+
3662
+
3663
+ </td>
3664
+
3665
+
3666
+
3667
+
3668
+
3669
+ <td class="description last">The unique identifier of the playlist to be liked.</td>
1041
3670
  </tr>
1042
3671
 
1043
3672
 
@@ -1063,7 +3692,16 @@
1063
3692
 
1064
3693
 
1065
3694
  <div class="param-desc">
1066
- - Returns an object containing in-progress content if found, otherwise null.
3695
+ - A promise that resolves with the response from the API. The response contains:
3696
+ - `success` (boolean): Indicates if the like action was successful (`true` for success).
3697
+ - `message` (string): A success message if the playlist is liked successfully, or a notification if it was already liked.
3698
+ - `like` (Object|null): Details of the created "like" entry if the playlist is newly liked, or null if it was already liked.
3699
+
3700
+ The `like` object in the response includes:
3701
+ - `playlist_id`: The ID of the liked playlist.
3702
+ - `user_id`: The ID of the user who liked the playlist.
3703
+ - `brand`: The brand associated with the like.
3704
+ - `created_at`: Timestamp of when the like was created.
1067
3705
  </div>
1068
3706
 
1069
3707
 
@@ -1074,7 +3712,7 @@
1074
3712
  </dt>
1075
3713
  <dd>
1076
3714
 
1077
- <span class="param-type">Promise.&lt;(Object|null)></span>
3715
+ <span class="param-type">Promise.&lt;Object></span>
1078
3716
 
1079
3717
 
1080
3718
 
@@ -1090,7 +3728,7 @@
1090
3728
 
1091
3729
 
1092
3730
 
1093
- <h4 class="name" id=".fetchContentPageUserData"><span class="type-signature type-signature-static">(static) </span>fetchContentPageUserData<span class="signature">(contentId)</span><span class="type-signature"> &rarr; {Promise.&lt;(Object|null)>}</span></h4>
3731
+ <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"> &rarr; {Promise.&lt;Object>}</span></h4>
1094
3732
 
1095
3733
 
1096
3734
 
@@ -1100,13 +3738,16 @@
1100
3738
  <dl class="details">
1101
3739
 
1102
3740
  <dt class="tag-description">Description:</dt>
1103
- <dd class="tag-description"><ul class="dummy"><li>Fetches user context data for a specific piece of content.</li></ul></dd>
3741
+ <dd class="tag-description"><ul class="dummy"><li>Updates a user’s playlist by sending a PUT request with updated data to the API.
3742
+
3743
+ This function calls the `/playlists/playlist/{playlistId}` endpoint, where the server validates the incoming data
3744
+ and verifies that the authenticated user is the playlist owner. If authorized, it updates the playlist details with the provided data.</li></ul></dd>
1104
3745
 
1105
3746
 
1106
3747
 
1107
3748
  <dt class="tag-source">Source:</dt>
1108
3749
  <dd class="tag-source"><ul class="dummy"><li>
1109
- <a href="railcontent.js.html">railcontent.js</a>, <a href="railcontent.js.html#line209">line 209</a>
3750
+ <a href="railcontent.js.html">railcontent.js</a>, <a href="railcontent.js.html#line453">line 453</a>
1110
3751
  </li></ul></dd>
1111
3752
 
1112
3753
 
@@ -1153,9 +3794,13 @@
1153
3794
 
1154
3795
  <h5 class="h5-examples">Example</h5>
1155
3796
 
1156
- <pre class="prettyprint"><code>fetchContentPageUserData(406548)
1157
- .then(data => console.log(data))
1158
- .catch(error => console.error(error));</code></pre>
3797
+ <pre class="prettyprint"><code>updatePlaylist(12345, { name: "My New Playlist Name", description: "Updated description" })
3798
+ .then(response => {
3799
+ if (response.success) {
3800
+ console.log(response.message);
3801
+ }
3802
+ })
3803
+ .catch(error => console.error('Error updating playlist:', error));</code></pre>
1159
3804
 
1160
3805
 
1161
3806
 
@@ -1185,13 +3830,16 @@
1185
3830
 
1186
3831
  <tr>
1187
3832
 
1188
- <td class="name"><code>contentId</code></td>
3833
+ <td class="name"><code>playlistId</code></td>
1189
3834
 
1190
3835
 
1191
3836
  <td class="type">
1192
3837
 
1193
3838
 
1194
- <span class="param-type">int</span>
3839
+ <span class="param-type">string</span>
3840
+ |
3841
+
3842
+ <span class="param-type">number</span>
1195
3843
 
1196
3844
 
1197
3845
 
@@ -1202,7 +3850,36 @@
1202
3850
 
1203
3851
 
1204
3852
 
1205
- <td class="description last">The content id.</td>
3853
+ <td class="description last">The unique identifier of the playlist to be updated.</td>
3854
+ </tr>
3855
+
3856
+
3857
+
3858
+ <tr>
3859
+
3860
+ <td class="name"><code>updatedData</code></td>
3861
+
3862
+
3863
+ <td class="type">
3864
+
3865
+
3866
+ <span class="param-type">Object</span>
3867
+
3868
+
3869
+
3870
+
3871
+ </td>
3872
+
3873
+
3874
+
3875
+
3876
+
3877
+ <td class="description last">An object containing the playlist data to update. The possible fields include:
3878
+ - `name` (string): The new name of the playlist (max 255 characters).
3879
+ - `description` (string): A new description for the playlist (max 1000 characters).
3880
+ - `category` (string): The updated category of the playlist (max 255 characters).
3881
+ - `private` (boolean): Whether the playlist is private.
3882
+ - `thumbnail_url` (string): The URL of the playlist thumbnail.</td>
1206
3883
  </tr>
1207
3884
 
1208
3885
 
@@ -1228,7 +3905,12 @@
1228
3905
 
1229
3906
 
1230
3907
  <div class="param-desc">
1231
- - Returns an object containing user context data if found, otherwise null.
3908
+ - A promise that resolves to an object containing:
3909
+ - `success` (boolean): Indicates if the update was successful (`true` for success).
3910
+ - `message` (string): Success confirmation message if the update is successful.
3911
+ - Other fields containing the updated playlist data.
3912
+
3913
+ If the user is unauthorized or the data validation fails, the promise rejects with an error.
1232
3914
  </div>
1233
3915
 
1234
3916
 
@@ -1239,7 +3921,7 @@
1239
3921
  </dt>
1240
3922
  <dd>
1241
3923
 
1242
- <span class="param-type">Promise.&lt;(Object|null)></span>
3924
+ <span class="param-type">Promise.&lt;Object></span>
1243
3925
 
1244
3926
 
1245
3927
 
@@ -1255,7 +3937,7 @@
1255
3937
 
1256
3938
 
1257
3939
 
1258
- <h4 class="name" id=".fetchSongsInProgress"><span class="type-signature type-signature-static">(static) </span>fetchSongsInProgress<span class="signature">(brand)</span><span class="type-signature"> &rarr; {Promise.&lt;(Object|null)>}</span></h4>
3940
+ <h4 class="name" id=".updatePlaylistItem"><span class="type-signature type-signature-static">(static) </span>updatePlaylistItem<span class="signature">(updatedData)</span><span class="type-signature"> &rarr; {Promise.&lt;(Object|null)>}</span></h4>
1259
3941
 
1260
3942
 
1261
3943
 
@@ -1265,13 +3947,13 @@
1265
3947
  <dl class="details">
1266
3948
 
1267
3949
  <dt class="tag-description">Description:</dt>
1268
- <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>
3950
+ <dd class="tag-description"><ul class="dummy"><li>Updates a playlist item with the provided data.</li></ul></dd>
1269
3951
 
1270
3952
 
1271
3953
 
1272
3954
  <dt class="tag-source">Source:</dt>
1273
3955
  <dd class="tag-source"><ul class="dummy"><li>
1274
- <a href="railcontent.js.html">railcontent.js</a>, <a href="railcontent.js.html#line91">line 91</a>
3956
+ <a href="railcontent.js.html">railcontent.js</a>, <a href="railcontent.js.html#line625">line 625</a>
1275
3957
  </li></ul></dd>
1276
3958
 
1277
3959
 
@@ -1318,9 +4000,23 @@
1318
4000
 
1319
4001
  <h5 class="h5-examples">Example</h5>
1320
4002
 
1321
- <pre class="prettyprint"><code>fetchSongsInProgress('drumeo')
1322
- .then(songs => console.log(songs))
1323
- .catch(error => console.error(error));</code></pre>
4003
+ <pre class="prettyprint"><code>const updatedData = {
4004
+ user_playlist_item_id: 123,
4005
+ start_second: 30,
4006
+ end_second: 120,
4007
+ playlist_item_name: "Updated Playlist Item Name",
4008
+ position: 2
4009
+ };
4010
+
4011
+ updatePlaylistItem(updatedData)
4012
+ .then(response => {
4013
+ if (response.success) {
4014
+ console.log("Playlist item updated successfully:", response.data);
4015
+ }
4016
+ })
4017
+ .catch(error => {
4018
+ console.error("Error updating playlist item:", error);
4019
+ });</code></pre>
1324
4020
 
1325
4021
 
1326
4022
 
@@ -1350,7 +4046,152 @@
1350
4046
 
1351
4047
  <tr>
1352
4048
 
1353
- <td class="name"><code>brand</code></td>
4049
+ <td class="name"><code>updatedData</code></td>
4050
+
4051
+
4052
+ <td class="type">
4053
+
4054
+
4055
+ <span class="param-type">Object</span>
4056
+
4057
+
4058
+
4059
+
4060
+ </td>
4061
+
4062
+
4063
+
4064
+
4065
+
4066
+ <td class="description last">The data to update the playlist item with.
4067
+ <h6>Properties</h6>
4068
+
4069
+
4070
+ <table class="params">
4071
+ <thead>
4072
+ <tr>
4073
+
4074
+ <th>Name</th>
4075
+
4076
+
4077
+ <th>Type</th>
4078
+
4079
+
4080
+ <th>Attributes</th>
4081
+
4082
+
4083
+
4084
+
4085
+ <th class="last">Description</th>
4086
+ </tr>
4087
+ </thead>
4088
+
4089
+ <tbody>
4090
+
4091
+
4092
+ <tr>
4093
+
4094
+ <td class="name"><code>user_playlist_item_id</code></td>
4095
+
4096
+
4097
+ <td class="type">
4098
+
4099
+
4100
+ <span class="param-type">number</span>
4101
+
4102
+
4103
+
4104
+
4105
+ </td>
4106
+
4107
+
4108
+ <td class="attributes">
4109
+
4110
+
4111
+
4112
+
4113
+
4114
+ </td>
4115
+
4116
+
4117
+
4118
+
4119
+ <td class="description last">The ID of the playlist item to update.</td>
4120
+ </tr>
4121
+
4122
+
4123
+
4124
+ <tr>
4125
+
4126
+ <td class="name"><code>start_second</code></td>
4127
+
4128
+
4129
+ <td class="type">
4130
+
4131
+
4132
+ <span class="param-type">number</span>
4133
+
4134
+
4135
+
4136
+
4137
+ </td>
4138
+
4139
+
4140
+ <td class="attributes">
4141
+
4142
+ &lt;optional><br>
4143
+
4144
+
4145
+
4146
+
4147
+
4148
+ </td>
4149
+
4150
+
4151
+
4152
+
4153
+ <td class="description last">(Optional) The start time in seconds for the item.</td>
4154
+ </tr>
4155
+
4156
+
4157
+
4158
+ <tr>
4159
+
4160
+ <td class="name"><code>end_second</code></td>
4161
+
4162
+
4163
+ <td class="type">
4164
+
4165
+
4166
+ <span class="param-type">number</span>
4167
+
4168
+
4169
+
4170
+
4171
+ </td>
4172
+
4173
+
4174
+ <td class="attributes">
4175
+
4176
+ &lt;optional><br>
4177
+
4178
+
4179
+
4180
+
4181
+
4182
+ </td>
4183
+
4184
+
4185
+
4186
+
4187
+ <td class="description last">(Optional) The end time in seconds for the item.</td>
4188
+ </tr>
4189
+
4190
+
4191
+
4192
+ <tr>
4193
+
4194
+ <td class="name"><code>playlist_item_name</code></td>
1354
4195
 
1355
4196
 
1356
4197
  <td class="type">
@@ -1364,10 +4205,61 @@
1364
4205
  </td>
1365
4206
 
1366
4207
 
4208
+ <td class="attributes">
4209
+
4210
+ &lt;optional><br>
4211
+
4212
+
4213
+
4214
+
4215
+
4216
+ </td>
4217
+
4218
+
4219
+
4220
+
4221
+ <td class="description last">(Optional) The new name for the playlist item.</td>
4222
+ </tr>
4223
+
4224
+
4225
+
4226
+ <tr>
4227
+
4228
+ <td class="name"><code>position</code></td>
4229
+
4230
+
4231
+ <td class="type">
4232
+
4233
+
4234
+ <span class="param-type">number</span>
4235
+
4236
+
4237
+
4238
+
4239
+ </td>
4240
+
4241
+
4242
+ <td class="attributes">
4243
+
4244
+ &lt;optional><br>
4245
+
4246
+
4247
+
4248
+
4249
+
4250
+ </td>
4251
+
1367
4252
 
1368
4253
 
1369
4254
 
1370
- <td class="description last">The brand associated with the songs.</td>
4255
+ <td class="description last">(Optional) The new position for the playlist item within the playlist.</td>
4256
+ </tr>
4257
+
4258
+
4259
+ </tbody>
4260
+ </table>
4261
+
4262
+ </td>
1371
4263
  </tr>
1372
4264
 
1373
4265
 
@@ -1387,13 +4279,47 @@
1387
4279
 
1388
4280
 
1389
4281
 
4282
+ <h5 class="h5-throws">Throws:</h5>
4283
+
4284
+
4285
+
4286
+ <dl>
4287
+ <dt>
4288
+ <div class="param-desc usertext">
4289
+ - Throws an error if the request fails.
4290
+ </div>
4291
+ </dt>
4292
+ <dd></dd>
4293
+ <dt>
4294
+ <dl class="param-type">
4295
+ <dt>
4296
+ Type
4297
+ </dt>
4298
+ <dd>
4299
+
4300
+ <span class="param-type">Error</span>
4301
+
4302
+
4303
+
4304
+ </dd>
4305
+ </dl>
4306
+ </dt>
4307
+ <dd></dd>
4308
+ </dl>
4309
+
4310
+
4311
+
1390
4312
 
1391
4313
 
1392
4314
  <h5 class="h5-returns">Returns:</h5>
1393
4315
 
1394
4316
 
1395
4317
  <div class="param-desc">
1396
- - Returns an object containing in-progress songs if found, otherwise null.
4318
+ - A promise that resolves to an object containing:
4319
+ - `success` (boolean): Indicates if the update was successful (`true` for success).
4320
+ - `data` (Object): The updated playlist item data.
4321
+
4322
+ Resolves to `null` if the request fails.
1397
4323
  </div>
1398
4324
 
1399
4325
 
@@ -1435,7 +4361,7 @@
1435
4361
  <br class="clear">
1436
4362
 
1437
4363
  <footer>
1438
- Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.3</a> on Thu Oct 24 2024 18:49:53 GMT+0000 (Coordinated Universal Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
4364
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.3</a> on Fri Nov 01 2024 14:03:54 GMT+0000 (Coordinated Universal Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
1439
4365
  </footer>
1440
4366
 
1441
4367
  <script>prettyPrint();</script>