musora-content-services 2.0.2 → 2.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. package/.github/workflows/node.js.yml +0 -0
  2. package/.prettierignore +0 -0
  3. package/.prettierrc +0 -0
  4. package/CHANGELOG.md +8 -0
  5. package/README.md +0 -0
  6. package/babel.config.cjs +0 -0
  7. package/docs/Content-Organization.html +245 -0
  8. package/docs/Playlists.html +192 -0
  9. package/docs/config.js.html +2 -2
  10. package/docs/content-org_playlists-types.js.html +109 -0
  11. package/docs/content-org_playlists.js.html +194 -0
  12. package/docs/content-org_types.js.html +112 -0
  13. package/docs/content.js.html +22 -4
  14. package/docs/fonts/Montserrat/Montserrat-Bold.eot +0 -0
  15. package/docs/fonts/Montserrat/Montserrat-Bold.ttf +0 -0
  16. package/docs/fonts/Montserrat/Montserrat-Bold.woff +0 -0
  17. package/docs/fonts/Montserrat/Montserrat-Bold.woff2 +0 -0
  18. package/docs/fonts/Montserrat/Montserrat-Regular.eot +0 -0
  19. package/docs/fonts/Montserrat/Montserrat-Regular.ttf +0 -0
  20. package/docs/fonts/Montserrat/Montserrat-Regular.woff +0 -0
  21. package/docs/fonts/Montserrat/Montserrat-Regular.woff2 +0 -0
  22. package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.eot +0 -0
  23. package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.svg +0 -0
  24. package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.ttf +0 -0
  25. package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.woff +0 -0
  26. package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.woff2 +0 -0
  27. package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.eot +0 -0
  28. package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.svg +0 -0
  29. package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.ttf +0 -0
  30. package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.woff +0 -0
  31. package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.woff2 +0 -0
  32. package/docs/global.html +854 -2
  33. package/docs/index.html +2 -2
  34. package/docs/module-Config.html +2 -2
  35. package/docs/module-Content-Organization-Playlists.html +194 -0
  36. package/docs/module-Content-Organization.html +976 -0
  37. package/docs/module-Content-Services-V2.html +3 -3
  38. package/docs/module-Playlists.html +969 -0
  39. package/docs/module-Railcontent-Services.html +2074 -1533
  40. package/docs/module-Sanity-Services.html +14 -14
  41. package/docs/module-Session-Management.html +2 -2
  42. package/docs/module-User-Permissions.html +2 -2
  43. package/docs/module-playlists.html +1878 -0
  44. package/docs/module-playlists_.html +108 -0
  45. package/docs/railcontent.js.html +122 -122
  46. package/docs/sanity.js.html +9 -8
  47. package/docs/scripts/collapse.js +0 -0
  48. package/docs/scripts/commonNav.js +0 -0
  49. package/docs/scripts/linenumber.js +0 -0
  50. package/docs/scripts/nav.js +0 -0
  51. package/docs/scripts/polyfill.js +0 -0
  52. package/docs/scripts/prettify/Apache-License-2.0.txt +0 -0
  53. package/docs/scripts/prettify/lang-css.js +0 -0
  54. package/docs/scripts/prettify/prettify.js +0 -0
  55. package/docs/scripts/search.js +0 -0
  56. package/docs/styles/jsdoc.css +0 -0
  57. package/docs/styles/prettify.css +0 -0
  58. package/docs/user_permissions.js.html +2 -2
  59. package/docs/user_sessions.js.html +2 -2
  60. package/docs/user_types.js.html +2 -2
  61. package/jest.config.js +0 -0
  62. package/jsdoc.json +1 -0
  63. package/package.json +1 -1
  64. package/src/index.d.ts +6 -3
  65. package/src/index.js +6 -3
  66. package/src/services/config.js +0 -0
  67. package/src/services/content-org/playlists-types.js +37 -0
  68. package/src/services/content-org/playlists.js +122 -0
  69. package/src/services/contentLikes.js +0 -0
  70. package/src/services/contentProgress.js +0 -0
  71. package/src/services/dataContext.js +0 -0
  72. package/src/services/railcontent.js +8 -121
  73. package/test/contentLikes.test.js +0 -0
  74. package/test/live/contentProgressLive.test.js +0 -0
  75. package/test/live/railcontentLive.test.js +0 -0
  76. package/test/localStorageMock.js +0 -0
  77. package/test/log.js +0 -0
@@ -0,0 +1,1878 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+
5
+ <meta charset="utf-8">
6
+ <title>playlists - Documentation</title>
7
+
8
+
9
+ <script src="scripts/prettify/prettify.js"></script>
10
+ <script src="scripts/prettify/lang-css.js"></script>
11
+ <!--[if lt IE 9]>
12
+ <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
13
+ <![endif]-->
14
+ <link type="text/css" rel="stylesheet" href="styles/prettify.css">
15
+ <link type="text/css" rel="stylesheet" href="styles/jsdoc.css">
16
+ <script src="scripts/nav.js" defer></script>
17
+
18
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
19
+ </head>
20
+ <body>
21
+
22
+ <input type="checkbox" id="nav-trigger" class="nav-trigger" />
23
+ <label for="nav-trigger" class="navicon-button x">
24
+ <div class="navicon"></div>
25
+ </label>
26
+
27
+ <label for="nav-trigger" class="overlay"></label>
28
+
29
+ <nav >
30
+
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-Content-Services-V2.html">Content-Services-V2</a><ul class='methods'><li data-type='method'><a href="module-Content-Services-V2.html#.getContentRows">getContentRows</a></li><li data-type='method'><a href="module-Content-Services-V2.html#.getNewAndUpcoming">getNewAndUpcoming</a></li><li data-type='method'><a href="module-Content-Services-V2.html#.getRecent">getRecent</a></li><li data-type='method'><a href="module-Content-Services-V2.html#.getRecommendedForYou">getRecommendedForYou</a></li><li data-type='method'><a href="module-Content-Services-V2.html#.getScheduleContentRows">getScheduleContentRows</a></li><li data-type='method'><a href="module-Content-Services-V2.html#.getTabResults">getTabResults</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#.assignModeratorToComment">assignModeratorToComment</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.closeComment">closeComment</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.countAssignmentsAndLessons">countAssignmentsAndLessons</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.createComment">createComment</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.deleteComment">deleteComment</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#.editComment">editComment</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#.fetchCarouselCardData">fetchCarouselCardData</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchChallengeIndexMetadata">fetchChallengeIndexMetadata</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchChallengeLessonData">fetchChallengeLessonData</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchChallengeMetadata">fetchChallengeMetadata</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchChallengeUserActiveChallenges">fetchChallengeUserActiveChallenges</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchCommentRelies">fetchCommentRelies</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchComments">fetchComments</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchCompletedChallenges">fetchCompletedChallenges</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#.fetchNextContentDataForParent">fetchNextContentDataForParent</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchOwnedChallenges">fetchOwnedChallenges</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchPinnedPlaylists">fetchPinnedPlaylists</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#.fetchTopComment">fetchTopComment</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchUserAward">fetchUserAward</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchUserBadges">fetchUserBadges</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchUserChallengeProgress">fetchUserChallengeProgress</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.likeComment">likeComment</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#.openComment">openComment</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.pinPlaylist">pinPlaylist</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.postChallengesCommunityNotification">postChallengesCommunityNotification</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.postChallengesCompleteLesson">postChallengesCompleteLesson</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.postChallengesEnroll">postChallengesEnroll</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.postChallengesEnrollmentNotification">postChallengesEnrollmentNotification</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.postChallengesHideCompletedBanner">postChallengesHideCompletedBanner</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.postChallengesLeave">postChallengesLeave</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.postChallengesSetStartDate">postChallengesSetStartDate</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.postChallengesSoloNotification">postChallengesSoloNotification</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.postChallengesUnlock">postChallengesUnlock</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.replyToComment">replyToComment</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.reportPlaylist">reportPlaylist</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.setStudentViewForUser">setStudentViewForUser</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.unassignModeratorToComment">unassignModeratorToComment</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.unlikeComment">unlikeComment</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.unpinPlaylist">unpinPlaylist</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#.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#.fetchCoachLessons">fetchCoachLessons</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchComingSoon">fetchComingSoon</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchCommentModContentData">fetchCommentModContentData</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#.fetchLeaving">fetchLeaving</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#.fetchMethodPreviousNextLesson">fetchMethodPreviousNextLesson</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#.fetchPackData">fetchPackData</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#.fetchRelatedSongs">fetchRelatedSongs</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchReturning">fetchReturning</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#.fetchUpcomingEvents">fetchUpcomingEvents</a></li><li data-type='method'><a href="module-Sanity-Services.html#.jumpToContinueContent">jumpToContinueContent</a></li><li data-type='method'><a href="module-Sanity-Services.html#~getNextAndPreviousQuarterDates">getNextAndPreviousQuarterDates</a></li><li data-type='method'><a href="module-Sanity-Services.html#~getQueryFromPage">getQueryFromPage</a></li><li data-type='method'><a href="module-Sanity-Services.html#~handleCustomFetchAll">handleCustomFetchAll</a></li></ul></li><li><a href="module-Session-Management.html">Session-Management</a><ul class='methods'><li data-type='method'><a href="module-Session-Management.html#.login">login</a></li><li data-type='method'><a href="module-Session-Management.html#.logout">logout</a></li></ul></li><li><a href="module-User-Permissions.html">User-Permissions</a><ul class='methods'><li data-type='method'><a href="module-User-Permissions.html#.fetchUserPermissions">fetchUserPermissions</a></li><li data-type='method'><a href="module-User-Permissions.html#.reset">reset</a></li></ul></li><li><a href="module-playlists.html">playlists</a><ul class='methods'><li data-type='method'><a href="module-playlists.html#.addItemToPlaylist">addItemToPlaylist</a></li><li data-type='method'><a href="module-playlists.html#.createPlaylist">createPlaylist</a></li><li data-type='method'><a href="module-playlists.html#.fetchUserPlaylists">fetchUserPlaylists</a></li></ul></li><li></li></ul><h3>Namespaces</h3><ul><li><a href="Content-Organization.html">Content-Organization</a></li></ul><h3><a href="global.html">Global</a></h3>
33
+
34
+ </nav>
35
+
36
+ <div id="main">
37
+
38
+ <h1 class="page-title">playlists</h1>
39
+
40
+
41
+
42
+
43
+
44
+
45
+
46
+ <section>
47
+
48
+ <header>
49
+
50
+
51
+
52
+ </header>
53
+
54
+ <article>
55
+
56
+ <div class="container-overview">
57
+
58
+
59
+
60
+
61
+
62
+ </div>
63
+
64
+
65
+
66
+
67
+
68
+
69
+
70
+
71
+
72
+
73
+
74
+
75
+
76
+
77
+
78
+ <h3 class="subsection-title">Members</h3>
79
+
80
+
81
+
82
+ <h4 class="name" id="~excludeFromGeneratedIndex"><span class="type-signature type-signature-inner, constant">(inner, constant) </span>excludeFromGeneratedIndex<span class="type-signature"> :Array.&lt;string></span></h4>
83
+
84
+
85
+
86
+
87
+
88
+ <dl class="details">
89
+
90
+ <dt class="tag-description">Description:</dt>
91
+ <dd class="tag-description"><ul class="dummy"><li>Exported functions that are excluded from index generation.</li></ul></dd>
92
+
93
+
94
+
95
+ <dt class="tag-source">Source:</dt>
96
+ <dd class="tag-source"><ul class="dummy"><li>
97
+ <a href="content-org_playlists.js.html">content-org/playlists.js</a>, <a href="content-org_playlists.js.html#line17">line 17</a>
98
+ </li></ul></dd>
99
+
100
+
101
+
102
+
103
+
104
+
105
+
106
+
107
+
108
+
109
+
110
+
111
+
112
+
113
+
114
+
115
+
116
+
117
+
118
+
119
+
120
+
121
+
122
+
123
+
124
+
125
+
126
+
127
+
128
+
129
+
130
+ </dl>
131
+
132
+
133
+
134
+
135
+
136
+ <div class="description usertext">
137
+ Exported functions that are excluded from index generation.
138
+ </div>
139
+
140
+
141
+
142
+ <h5 class="h5-types">Type:</h5>
143
+ <ul>
144
+ <li>
145
+
146
+ <span class="param-type">Array.&lt;string></span>
147
+
148
+
149
+
150
+ </li>
151
+ </ul>
152
+
153
+
154
+
155
+
156
+
157
+
158
+
159
+
160
+
161
+
162
+ <h3 class="subsection-title">Methods</h3>
163
+
164
+
165
+
166
+
167
+
168
+
169
+ <h4 class="name" id=".addItemToPlaylist"><span class="type-signature type-signature-static">(static) </span>addItemToPlaylist<span class="signature">(payload)</span><span class="type-signature"> &rarr; {Promise.&lt;(Object|null)>}</span></h4>
170
+
171
+
172
+
173
+
174
+
175
+
176
+ <dl class="details">
177
+
178
+ <dt class="tag-description">Description:</dt>
179
+ <dd class="tag-description"><ul class="dummy"><li>Adds an item to one or more playlists by making a POST request to the `/playlists/add-item` endpoint.</li></ul></dd>
180
+
181
+
182
+
183
+ <dt class="tag-source">Source:</dt>
184
+ <dd class="tag-source"><ul class="dummy"><li>
185
+ <a href="content-org_playlists.js.html">content-org/playlists.js</a>, <a href="content-org_playlists.js.html#line119">line 119</a>
186
+ </li></ul></dd>
187
+
188
+
189
+
190
+
191
+
192
+
193
+
194
+
195
+
196
+
197
+
198
+
199
+
200
+
201
+
202
+
203
+
204
+
205
+
206
+
207
+
208
+
209
+
210
+
211
+
212
+
213
+
214
+
215
+
216
+
217
+
218
+ </dl>
219
+
220
+
221
+
222
+
223
+
224
+
225
+
226
+
227
+
228
+
229
+
230
+ <h5 class="h5-examples">Example</h5>
231
+
232
+ <pre class="prettyprint"><code>const payload = {
233
+ content_id: 123,
234
+ playlist_id: [1, 2, 3],
235
+ import_all_assignments: true
236
+ };
237
+
238
+ addItemToPlaylist(payload)
239
+ .then(response => {
240
+ if (response?.success) {
241
+ console.log("Item(s) added to playlist successfully");
242
+ }
243
+ if (response?.limit_excedeed) {
244
+ console.warn("Some playlists exceeded the item limit:", response.limit_excedeed);
245
+ }
246
+ })
247
+ .catch(error => {
248
+ console.error("Error adding item to playlist:", error);
249
+ });</code></pre>
250
+
251
+
252
+
253
+
254
+ <h5 class="h5-parameters">Parameters:</h5>
255
+
256
+
257
+ <table class="params">
258
+ <thead>
259
+ <tr>
260
+
261
+ <th>Name</th>
262
+
263
+
264
+ <th>Type</th>
265
+
266
+
267
+
268
+
269
+
270
+ <th class="last">Description</th>
271
+ </tr>
272
+ </thead>
273
+
274
+ <tbody>
275
+
276
+
277
+ <tr>
278
+
279
+ <td class="name"><code>payload</code></td>
280
+
281
+
282
+ <td class="type">
283
+
284
+
285
+ <span class="param-type"><a href="global.html#AddItemToPlaylistDTO">AddItemToPlaylistDTO</a></span>
286
+
287
+
288
+
289
+
290
+ </td>
291
+
292
+
293
+
294
+
295
+
296
+ <td class="description last">The request payload containing necessary parameters.</td>
297
+ </tr>
298
+
299
+
300
+ </tbody>
301
+ </table>
302
+
303
+
304
+
305
+
306
+
307
+
308
+
309
+
310
+
311
+
312
+
313
+
314
+
315
+
316
+ <h5 class="h5-throws">Throws:</h5>
317
+
318
+
319
+
320
+ <dl>
321
+ <dt>
322
+ <div class="param-desc usertext">
323
+ - Throws an error if the request encounters issues during the operation.
324
+ </div>
325
+ </dt>
326
+ <dd></dd>
327
+ <dt>
328
+ <dl class="param-type">
329
+ <dt>
330
+ Type
331
+ </dt>
332
+ <dd>
333
+
334
+ <span class="param-type">Error</span>
335
+
336
+
337
+
338
+ </dd>
339
+ </dl>
340
+ </dt>
341
+ <dd></dd>
342
+ </dl>
343
+
344
+
345
+
346
+
347
+
348
+ <h5 class="h5-returns">Returns:</h5>
349
+
350
+
351
+ <div class="param-desc">
352
+ - A promise that resolves to an object with the response data, including:
353
+ - `success` (boolean): Indicates if the items were added successfully (`true` on success).
354
+ - `limit_excedeed` (Array): A list of playlists where the item limit was exceeded, if any.
355
+ - `successful` (Array): A list of successfully added items (empty if none).
356
+
357
+ Resolves to `null` if the request fails.
358
+ </div>
359
+
360
+
361
+
362
+ <dl class="param-type">
363
+ <dt>
364
+ Type
365
+ </dt>
366
+ <dd>
367
+
368
+ <span class="param-type">Promise.&lt;(Object|null)></span>
369
+
370
+
371
+
372
+ </dd>
373
+ </dl>
374
+
375
+
376
+
377
+
378
+
379
+
380
+
381
+
382
+
383
+
384
+ <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;<a href="global.html#Playlist">Playlist</a>>}</span></h4>
385
+
386
+
387
+
388
+
389
+
390
+
391
+ <dl class="details">
392
+
393
+ <dt class="tag-description">Description:</dt>
394
+ <dd class="tag-description"><ul class="dummy"><li>Creates a new user playlist by sending a POST request with playlist data to the API.
395
+
396
+ This function calls the `/playlists/playlist` endpoint, where the server validates the incoming data and associates
397
+ the new playlist with the authenticated user. The `name` field is required, while other fields are optional.</li></ul></dd>
398
+
399
+
400
+
401
+ <dt class="tag-source">Source:</dt>
402
+ <dd class="tag-source"><ul class="dummy"><li>
403
+ <a href="content-org_playlists.js.html">content-org/playlists.js</a>, <a href="content-org_playlists.js.html#line81">line 81</a>
404
+ </li></ul></dd>
405
+
406
+
407
+
408
+
409
+
410
+
411
+
412
+
413
+
414
+
415
+
416
+
417
+
418
+
419
+
420
+
421
+
422
+
423
+
424
+
425
+
426
+
427
+
428
+
429
+
430
+
431
+
432
+
433
+
434
+
435
+
436
+ </dl>
437
+
438
+
439
+
440
+
441
+
442
+
443
+
444
+
445
+
446
+
447
+
448
+ <h5 class="h5-examples">Example</h5>
449
+
450
+ <pre class="prettyprint"><code>createPlaylist({ name: "My Playlist", description: "A cool playlist", private: true })
451
+ .then(response => console.log(response.message))
452
+ .catch(error => console.error('Error creating playlist:', error));</code></pre>
453
+
454
+
455
+
456
+
457
+ <h5 class="h5-parameters">Parameters:</h5>
458
+
459
+
460
+ <table class="params">
461
+ <thead>
462
+ <tr>
463
+
464
+ <th>Name</th>
465
+
466
+
467
+ <th>Type</th>
468
+
469
+
470
+
471
+
472
+
473
+ <th class="last">Description</th>
474
+ </tr>
475
+ </thead>
476
+
477
+ <tbody>
478
+
479
+
480
+ <tr>
481
+
482
+ <td class="name"><code>playlistData</code></td>
483
+
484
+
485
+ <td class="type">
486
+
487
+
488
+ <span class="param-type"><a href="global.html#CreatePlaylistDTO">CreatePlaylistDTO</a></span>
489
+
490
+
491
+
492
+
493
+ </td>
494
+
495
+
496
+
497
+
498
+
499
+ <td class="description last">An object containing data to create the playlist. The fields include:
500
+ - `name` (string): The name of the new playlist (required, max 255 characters).
501
+ - `description` (string): A description of the playlist (optional, max 1000 characters).
502
+ - `category` (string): The category of the playlist.
503
+ - `thumbnail_url` (string): The URL of the playlist thumbnail (optional, must be a valid URL).
504
+ - `private` (boolean): Whether the playlist is private (optional, defaults to true).
505
+ - `brand` (string): Brand identifier for the playlist.</td>
506
+ </tr>
507
+
508
+
509
+ </tbody>
510
+ </table>
511
+
512
+
513
+
514
+
515
+
516
+
517
+
518
+
519
+
520
+
521
+
522
+
523
+
524
+
525
+
526
+
527
+ <h5 class="h5-returns">Returns:</h5>
528
+
529
+
530
+ <div class="param-desc">
531
+ - A promise that resolves to the created playlist data if successful, or an error response if validation fails.
532
+
533
+ The server response includes:
534
+ - `message`: Success message indicating playlist creation (e.g., "Playlist created successfully").
535
+ - `playlist`: The data for the created playlist, including the `user_id` of the authenticated user.
536
+ </div>
537
+
538
+
539
+
540
+ <dl class="param-type">
541
+ <dt>
542
+ Type
543
+ </dt>
544
+ <dd>
545
+
546
+ <span class="param-type">Promise.&lt;<a href="global.html#Playlist">Playlist</a>></span>
547
+
548
+
549
+
550
+ </dd>
551
+ </dl>
552
+
553
+
554
+
555
+
556
+
557
+
558
+
559
+
560
+
561
+
562
+ <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>
563
+
564
+
565
+
566
+
567
+
568
+
569
+ <dl class="details">
570
+
571
+ <dt class="tag-description">Description:</dt>
572
+ <dd class="tag-description"><ul class="dummy"><li>Fetches user playlists for a specific brand.
573
+
574
+ Allows optional pagination, sorting, and search parameters to control the result set.</li></ul></dd>
575
+
576
+
577
+
578
+ <dt class="tag-source">Source:</dt>
579
+ <dd class="tag-source"><ul class="dummy"><li>
580
+ <a href="content-org_playlists.js.html">content-org/playlists.js</a>, <a href="content-org_playlists.js.html#line40">line 40</a>
581
+ </li></ul></dd>
582
+
583
+
584
+
585
+
586
+
587
+
588
+
589
+
590
+
591
+
592
+
593
+
594
+
595
+
596
+
597
+
598
+
599
+
600
+
601
+
602
+
603
+
604
+
605
+
606
+
607
+
608
+
609
+
610
+
611
+
612
+
613
+ </dl>
614
+
615
+
616
+
617
+
618
+
619
+
620
+
621
+
622
+
623
+
624
+
625
+ <h5 class="h5-examples">Example</h5>
626
+
627
+ <pre class="prettyprint"><code>fetchUserPlaylists('drumeo', { page: 1, sort: 'name', searchTerm: 'rock' })
628
+ .then(playlists => console.log(playlists))
629
+ .catch(error => console.error(error));</code></pre>
630
+
631
+
632
+
633
+
634
+ <h5 class="h5-parameters">Parameters:</h5>
635
+
636
+
637
+ <table class="params">
638
+ <thead>
639
+ <tr>
640
+
641
+ <th>Name</th>
642
+
643
+
644
+ <th>Type</th>
645
+
646
+
647
+ <th>Attributes</th>
648
+
649
+
650
+
651
+ <th>Default</th>
652
+
653
+
654
+ <th class="last">Description</th>
655
+ </tr>
656
+ </thead>
657
+
658
+ <tbody>
659
+
660
+
661
+ <tr>
662
+
663
+ <td class="name"><code>brand</code></td>
664
+
665
+
666
+ <td class="type">
667
+
668
+
669
+ <span class="param-type">string</span>
670
+
671
+
672
+
673
+
674
+ </td>
675
+
676
+
677
+ <td class="attributes">
678
+
679
+
680
+
681
+
682
+
683
+ </td>
684
+
685
+
686
+
687
+ <td class="default">
688
+
689
+ </td>
690
+
691
+
692
+ <td class="description last">The brand identifier for which playlists are being fetched.</td>
693
+ </tr>
694
+
695
+
696
+
697
+ <tr>
698
+
699
+ <td class="name"><code>params.limit</code></td>
700
+
701
+
702
+ <td class="type">
703
+
704
+
705
+ <span class="param-type">number</span>
706
+
707
+
708
+
709
+
710
+ </td>
711
+
712
+
713
+ <td class="attributes">
714
+
715
+ &lt;optional><br>
716
+
717
+
718
+
719
+
720
+
721
+ </td>
722
+
723
+
724
+
725
+ <td class="default">
726
+
727
+ <code>10</code>
728
+
729
+ </td>
730
+
731
+
732
+ <td class="description last">The maximum number of playlists to return per page (default is 10).</td>
733
+ </tr>
734
+
735
+
736
+
737
+ <tr>
738
+
739
+ <td class="name"><code>params.page</code></td>
740
+
741
+
742
+ <td class="type">
743
+
744
+
745
+ <span class="param-type">number</span>
746
+
747
+
748
+
749
+
750
+ </td>
751
+
752
+
753
+ <td class="attributes">
754
+
755
+ &lt;optional><br>
756
+
757
+
758
+
759
+
760
+
761
+ </td>
762
+
763
+
764
+
765
+ <td class="default">
766
+
767
+ <code>1</code>
768
+
769
+ </td>
770
+
771
+
772
+ <td class="description last">The page number for pagination.</td>
773
+ </tr>
774
+
775
+
776
+
777
+ <tr>
778
+
779
+ <td class="name"><code>params.sort</code></td>
780
+
781
+
782
+ <td class="type">
783
+
784
+
785
+ <span class="param-type">string</span>
786
+
787
+
788
+
789
+
790
+ </td>
791
+
792
+
793
+ <td class="attributes">
794
+
795
+ &lt;optional><br>
796
+
797
+
798
+
799
+
800
+
801
+ </td>
802
+
803
+
804
+
805
+ <td class="default">
806
+
807
+ <code>'-created_at'</code>
808
+
809
+ </td>
810
+
811
+
812
+ <td class="description last">The sorting order for the playlists (default is by created_at in descending order).</td>
813
+ </tr>
814
+
815
+
816
+
817
+ <tr>
818
+
819
+ <td class="name"><code>params.searchTerm</code></td>
820
+
821
+
822
+ <td class="type">
823
+
824
+
825
+ <span class="param-type">string</span>
826
+
827
+
828
+
829
+
830
+ </td>
831
+
832
+
833
+ <td class="attributes">
834
+
835
+ &lt;optional><br>
836
+
837
+
838
+
839
+
840
+
841
+ </td>
842
+
843
+
844
+
845
+ <td class="default">
846
+
847
+ </td>
848
+
849
+
850
+ <td class="description last">A search term to filter playlists by name.</td>
851
+ </tr>
852
+
853
+
854
+
855
+ <tr>
856
+
857
+ <td class="name"><code>params.content_id</code></td>
858
+
859
+
860
+ <td class="type">
861
+
862
+
863
+ <span class="param-type">int</span>
864
+ |
865
+
866
+ <span class="param-type">string</span>
867
+
868
+
869
+
870
+
871
+ </td>
872
+
873
+
874
+ <td class="attributes">
875
+
876
+ &lt;optional><br>
877
+
878
+
879
+
880
+
881
+
882
+ </td>
883
+
884
+
885
+
886
+ <td class="default">
887
+
888
+ </td>
889
+
890
+
891
+ <td class="description last">If content_id exists, the endpoint checks in each playlist if we have the content in the items.</td>
892
+ </tr>
893
+
894
+
895
+ </tbody>
896
+ </table>
897
+
898
+
899
+
900
+
901
+
902
+
903
+
904
+
905
+
906
+
907
+
908
+
909
+
910
+
911
+
912
+
913
+ <h5 class="h5-returns">Returns:</h5>
914
+
915
+
916
+ <div class="param-desc">
917
+ - A promise that resolves to the response from the API, containing the user playlists data.
918
+ </div>
919
+
920
+
921
+
922
+ <dl class="param-type">
923
+ <dt>
924
+ Type
925
+ </dt>
926
+ <dd>
927
+
928
+ <span class="param-type">Promise.&lt;(Object|null)></span>
929
+
930
+
931
+
932
+ </dd>
933
+ </dl>
934
+
935
+
936
+
937
+
938
+
939
+
940
+
941
+
942
+
943
+
944
+
945
+ </article>
946
+
947
+ </section>
948
+
949
+
950
+
951
+
952
+
953
+
954
+
955
+ <section>
956
+
957
+ <header>
958
+
959
+
960
+
961
+ </header>
962
+
963
+ <article>
964
+
965
+ <div class="container-overview">
966
+
967
+
968
+
969
+
970
+
971
+ </div>
972
+
973
+
974
+
975
+
976
+
977
+
978
+
979
+
980
+
981
+
982
+
983
+
984
+
985
+
986
+
987
+ <h3 class="subsection-title">Members</h3>
988
+
989
+
990
+
991
+ <h4 class="name" id="~excludeFromGeneratedIndex"><span class="type-signature type-signature-inner, constant">(inner, constant) </span>excludeFromGeneratedIndex<span class="type-signature"> :Array.&lt;string></span></h4>
992
+
993
+
994
+
995
+
996
+
997
+ <dl class="details">
998
+
999
+ <dt class="tag-description">Description:</dt>
1000
+ <dd class="tag-description"><ul class="dummy"><li>Exported functions that are excluded from index generation.</li></ul></dd>
1001
+
1002
+
1003
+
1004
+ <dt class="tag-source">Source:</dt>
1005
+ <dd class="tag-source"><ul class="dummy"><li>
1006
+ <a href="content-org_playlists.js.html">content-org/playlists.js</a>, <a href="content-org_playlists.js.html#line17">line 17</a>
1007
+ </li></ul></dd>
1008
+
1009
+
1010
+
1011
+
1012
+
1013
+
1014
+
1015
+
1016
+
1017
+
1018
+
1019
+
1020
+
1021
+
1022
+
1023
+
1024
+
1025
+
1026
+
1027
+
1028
+
1029
+
1030
+
1031
+
1032
+
1033
+
1034
+
1035
+
1036
+
1037
+
1038
+
1039
+ </dl>
1040
+
1041
+
1042
+
1043
+
1044
+
1045
+ <div class="description usertext">
1046
+ Exported functions that are excluded from index generation.
1047
+ </div>
1048
+
1049
+
1050
+
1051
+ <h5 class="h5-types">Type:</h5>
1052
+ <ul>
1053
+ <li>
1054
+
1055
+ <span class="param-type">Array.&lt;string></span>
1056
+
1057
+
1058
+
1059
+ </li>
1060
+ </ul>
1061
+
1062
+
1063
+
1064
+
1065
+
1066
+
1067
+
1068
+
1069
+
1070
+
1071
+ <h3 class="subsection-title">Methods</h3>
1072
+
1073
+
1074
+
1075
+
1076
+
1077
+
1078
+ <h4 class="name" id=".addItemToPlaylist"><span class="type-signature type-signature-static">(static) </span>addItemToPlaylist<span class="signature">(payload)</span><span class="type-signature"> &rarr; {Promise.&lt;(Object|null)>}</span></h4>
1079
+
1080
+
1081
+
1082
+
1083
+
1084
+
1085
+ <dl class="details">
1086
+
1087
+ <dt class="tag-description">Description:</dt>
1088
+ <dd class="tag-description"><ul class="dummy"><li>Adds an item to one or more playlists by making a POST request to the `/playlists/add-item` endpoint.</li></ul></dd>
1089
+
1090
+
1091
+
1092
+ <dt class="tag-source">Source:</dt>
1093
+ <dd class="tag-source"><ul class="dummy"><li>
1094
+ <a href="content-org_playlists.js.html">content-org/playlists.js</a>, <a href="content-org_playlists.js.html#line119">line 119</a>
1095
+ </li></ul></dd>
1096
+
1097
+
1098
+
1099
+
1100
+
1101
+
1102
+
1103
+
1104
+
1105
+
1106
+
1107
+
1108
+
1109
+
1110
+
1111
+
1112
+
1113
+
1114
+
1115
+
1116
+
1117
+
1118
+
1119
+
1120
+
1121
+
1122
+
1123
+
1124
+
1125
+
1126
+
1127
+ </dl>
1128
+
1129
+
1130
+
1131
+
1132
+
1133
+
1134
+
1135
+
1136
+
1137
+
1138
+
1139
+ <h5 class="h5-examples">Example</h5>
1140
+
1141
+ <pre class="prettyprint"><code>const payload = {
1142
+ content_id: 123,
1143
+ playlist_id: [1, 2, 3],
1144
+ import_all_assignments: true
1145
+ };
1146
+
1147
+ addItemToPlaylist(payload)
1148
+ .then(response => {
1149
+ if (response?.success) {
1150
+ console.log("Item(s) added to playlist successfully");
1151
+ }
1152
+ if (response?.limit_excedeed) {
1153
+ console.warn("Some playlists exceeded the item limit:", response.limit_excedeed);
1154
+ }
1155
+ })
1156
+ .catch(error => {
1157
+ console.error("Error adding item to playlist:", error);
1158
+ });</code></pre>
1159
+
1160
+
1161
+
1162
+
1163
+ <h5 class="h5-parameters">Parameters:</h5>
1164
+
1165
+
1166
+ <table class="params">
1167
+ <thead>
1168
+ <tr>
1169
+
1170
+ <th>Name</th>
1171
+
1172
+
1173
+ <th>Type</th>
1174
+
1175
+
1176
+
1177
+
1178
+
1179
+ <th class="last">Description</th>
1180
+ </tr>
1181
+ </thead>
1182
+
1183
+ <tbody>
1184
+
1185
+
1186
+ <tr>
1187
+
1188
+ <td class="name"><code>payload</code></td>
1189
+
1190
+
1191
+ <td class="type">
1192
+
1193
+
1194
+ <span class="param-type"><a href="global.html#AddItemToPlaylistDTO">AddItemToPlaylistDTO</a></span>
1195
+
1196
+
1197
+
1198
+
1199
+ </td>
1200
+
1201
+
1202
+
1203
+
1204
+
1205
+ <td class="description last">The request payload containing necessary parameters.</td>
1206
+ </tr>
1207
+
1208
+
1209
+ </tbody>
1210
+ </table>
1211
+
1212
+
1213
+
1214
+
1215
+
1216
+
1217
+
1218
+
1219
+
1220
+
1221
+
1222
+
1223
+
1224
+
1225
+ <h5 class="h5-throws">Throws:</h5>
1226
+
1227
+
1228
+
1229
+ <dl>
1230
+ <dt>
1231
+ <div class="param-desc usertext">
1232
+ - Throws an error if the request encounters issues during the operation.
1233
+ </div>
1234
+ </dt>
1235
+ <dd></dd>
1236
+ <dt>
1237
+ <dl class="param-type">
1238
+ <dt>
1239
+ Type
1240
+ </dt>
1241
+ <dd>
1242
+
1243
+ <span class="param-type">Error</span>
1244
+
1245
+
1246
+
1247
+ </dd>
1248
+ </dl>
1249
+ </dt>
1250
+ <dd></dd>
1251
+ </dl>
1252
+
1253
+
1254
+
1255
+
1256
+
1257
+ <h5 class="h5-returns">Returns:</h5>
1258
+
1259
+
1260
+ <div class="param-desc">
1261
+ - A promise that resolves to an object with the response data, including:
1262
+ - `success` (boolean): Indicates if the items were added successfully (`true` on success).
1263
+ - `limit_excedeed` (Array): A list of playlists where the item limit was exceeded, if any.
1264
+ - `successful` (Array): A list of successfully added items (empty if none).
1265
+
1266
+ Resolves to `null` if the request fails.
1267
+ </div>
1268
+
1269
+
1270
+
1271
+ <dl class="param-type">
1272
+ <dt>
1273
+ Type
1274
+ </dt>
1275
+ <dd>
1276
+
1277
+ <span class="param-type">Promise.&lt;(Object|null)></span>
1278
+
1279
+
1280
+
1281
+ </dd>
1282
+ </dl>
1283
+
1284
+
1285
+
1286
+
1287
+
1288
+
1289
+
1290
+
1291
+
1292
+
1293
+ <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;<a href="global.html#Playlist">Playlist</a>>}</span></h4>
1294
+
1295
+
1296
+
1297
+
1298
+
1299
+
1300
+ <dl class="details">
1301
+
1302
+ <dt class="tag-description">Description:</dt>
1303
+ <dd class="tag-description"><ul class="dummy"><li>Creates a new user playlist by sending a POST request with playlist data to the API.
1304
+
1305
+ This function calls the `/playlists/playlist` endpoint, where the server validates the incoming data and associates
1306
+ the new playlist with the authenticated user. The `name` field is required, while other fields are optional.</li></ul></dd>
1307
+
1308
+
1309
+
1310
+ <dt class="tag-source">Source:</dt>
1311
+ <dd class="tag-source"><ul class="dummy"><li>
1312
+ <a href="content-org_playlists.js.html">content-org/playlists.js</a>, <a href="content-org_playlists.js.html#line81">line 81</a>
1313
+ </li></ul></dd>
1314
+
1315
+
1316
+
1317
+
1318
+
1319
+
1320
+
1321
+
1322
+
1323
+
1324
+
1325
+
1326
+
1327
+
1328
+
1329
+
1330
+
1331
+
1332
+
1333
+
1334
+
1335
+
1336
+
1337
+
1338
+
1339
+
1340
+
1341
+
1342
+
1343
+
1344
+
1345
+ </dl>
1346
+
1347
+
1348
+
1349
+
1350
+
1351
+
1352
+
1353
+
1354
+
1355
+
1356
+
1357
+ <h5 class="h5-examples">Example</h5>
1358
+
1359
+ <pre class="prettyprint"><code>createPlaylist({ name: "My Playlist", description: "A cool playlist", private: true })
1360
+ .then(response => console.log(response.message))
1361
+ .catch(error => console.error('Error creating playlist:', error));</code></pre>
1362
+
1363
+
1364
+
1365
+
1366
+ <h5 class="h5-parameters">Parameters:</h5>
1367
+
1368
+
1369
+ <table class="params">
1370
+ <thead>
1371
+ <tr>
1372
+
1373
+ <th>Name</th>
1374
+
1375
+
1376
+ <th>Type</th>
1377
+
1378
+
1379
+
1380
+
1381
+
1382
+ <th class="last">Description</th>
1383
+ </tr>
1384
+ </thead>
1385
+
1386
+ <tbody>
1387
+
1388
+
1389
+ <tr>
1390
+
1391
+ <td class="name"><code>playlistData</code></td>
1392
+
1393
+
1394
+ <td class="type">
1395
+
1396
+
1397
+ <span class="param-type"><a href="global.html#CreatePlaylistDTO">CreatePlaylistDTO</a></span>
1398
+
1399
+
1400
+
1401
+
1402
+ </td>
1403
+
1404
+
1405
+
1406
+
1407
+
1408
+ <td class="description last">An object containing data to create the playlist. The fields include:
1409
+ - `name` (string): The name of the new playlist (required, max 255 characters).
1410
+ - `description` (string): A description of the playlist (optional, max 1000 characters).
1411
+ - `category` (string): The category of the playlist.
1412
+ - `thumbnail_url` (string): The URL of the playlist thumbnail (optional, must be a valid URL).
1413
+ - `private` (boolean): Whether the playlist is private (optional, defaults to true).
1414
+ - `brand` (string): Brand identifier for the playlist.</td>
1415
+ </tr>
1416
+
1417
+
1418
+ </tbody>
1419
+ </table>
1420
+
1421
+
1422
+
1423
+
1424
+
1425
+
1426
+
1427
+
1428
+
1429
+
1430
+
1431
+
1432
+
1433
+
1434
+
1435
+
1436
+ <h5 class="h5-returns">Returns:</h5>
1437
+
1438
+
1439
+ <div class="param-desc">
1440
+ - A promise that resolves to the created playlist data if successful, or an error response if validation fails.
1441
+
1442
+ The server response includes:
1443
+ - `message`: Success message indicating playlist creation (e.g., "Playlist created successfully").
1444
+ - `playlist`: The data for the created playlist, including the `user_id` of the authenticated user.
1445
+ </div>
1446
+
1447
+
1448
+
1449
+ <dl class="param-type">
1450
+ <dt>
1451
+ Type
1452
+ </dt>
1453
+ <dd>
1454
+
1455
+ <span class="param-type">Promise.&lt;<a href="global.html#Playlist">Playlist</a>></span>
1456
+
1457
+
1458
+
1459
+ </dd>
1460
+ </dl>
1461
+
1462
+
1463
+
1464
+
1465
+
1466
+
1467
+
1468
+
1469
+
1470
+
1471
+ <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>
1472
+
1473
+
1474
+
1475
+
1476
+
1477
+
1478
+ <dl class="details">
1479
+
1480
+ <dt class="tag-description">Description:</dt>
1481
+ <dd class="tag-description"><ul class="dummy"><li>Fetches user playlists for a specific brand.
1482
+
1483
+ Allows optional pagination, sorting, and search parameters to control the result set.</li></ul></dd>
1484
+
1485
+
1486
+
1487
+ <dt class="tag-source">Source:</dt>
1488
+ <dd class="tag-source"><ul class="dummy"><li>
1489
+ <a href="content-org_playlists.js.html">content-org/playlists.js</a>, <a href="content-org_playlists.js.html#line40">line 40</a>
1490
+ </li></ul></dd>
1491
+
1492
+
1493
+
1494
+
1495
+
1496
+
1497
+
1498
+
1499
+
1500
+
1501
+
1502
+
1503
+
1504
+
1505
+
1506
+
1507
+
1508
+
1509
+
1510
+
1511
+
1512
+
1513
+
1514
+
1515
+
1516
+
1517
+
1518
+
1519
+
1520
+
1521
+
1522
+ </dl>
1523
+
1524
+
1525
+
1526
+
1527
+
1528
+
1529
+
1530
+
1531
+
1532
+
1533
+
1534
+ <h5 class="h5-examples">Example</h5>
1535
+
1536
+ <pre class="prettyprint"><code>fetchUserPlaylists('drumeo', { page: 1, sort: 'name', searchTerm: 'rock' })
1537
+ .then(playlists => console.log(playlists))
1538
+ .catch(error => console.error(error));</code></pre>
1539
+
1540
+
1541
+
1542
+
1543
+ <h5 class="h5-parameters">Parameters:</h5>
1544
+
1545
+
1546
+ <table class="params">
1547
+ <thead>
1548
+ <tr>
1549
+
1550
+ <th>Name</th>
1551
+
1552
+
1553
+ <th>Type</th>
1554
+
1555
+
1556
+ <th>Attributes</th>
1557
+
1558
+
1559
+
1560
+ <th>Default</th>
1561
+
1562
+
1563
+ <th class="last">Description</th>
1564
+ </tr>
1565
+ </thead>
1566
+
1567
+ <tbody>
1568
+
1569
+
1570
+ <tr>
1571
+
1572
+ <td class="name"><code>brand</code></td>
1573
+
1574
+
1575
+ <td class="type">
1576
+
1577
+
1578
+ <span class="param-type">string</span>
1579
+
1580
+
1581
+
1582
+
1583
+ </td>
1584
+
1585
+
1586
+ <td class="attributes">
1587
+
1588
+
1589
+
1590
+
1591
+
1592
+ </td>
1593
+
1594
+
1595
+
1596
+ <td class="default">
1597
+
1598
+ </td>
1599
+
1600
+
1601
+ <td class="description last">The brand identifier for which playlists are being fetched.</td>
1602
+ </tr>
1603
+
1604
+
1605
+
1606
+ <tr>
1607
+
1608
+ <td class="name"><code>params.limit</code></td>
1609
+
1610
+
1611
+ <td class="type">
1612
+
1613
+
1614
+ <span class="param-type">number</span>
1615
+
1616
+
1617
+
1618
+
1619
+ </td>
1620
+
1621
+
1622
+ <td class="attributes">
1623
+
1624
+ &lt;optional><br>
1625
+
1626
+
1627
+
1628
+
1629
+
1630
+ </td>
1631
+
1632
+
1633
+
1634
+ <td class="default">
1635
+
1636
+ <code>10</code>
1637
+
1638
+ </td>
1639
+
1640
+
1641
+ <td class="description last">The maximum number of playlists to return per page (default is 10).</td>
1642
+ </tr>
1643
+
1644
+
1645
+
1646
+ <tr>
1647
+
1648
+ <td class="name"><code>params.page</code></td>
1649
+
1650
+
1651
+ <td class="type">
1652
+
1653
+
1654
+ <span class="param-type">number</span>
1655
+
1656
+
1657
+
1658
+
1659
+ </td>
1660
+
1661
+
1662
+ <td class="attributes">
1663
+
1664
+ &lt;optional><br>
1665
+
1666
+
1667
+
1668
+
1669
+
1670
+ </td>
1671
+
1672
+
1673
+
1674
+ <td class="default">
1675
+
1676
+ <code>1</code>
1677
+
1678
+ </td>
1679
+
1680
+
1681
+ <td class="description last">The page number for pagination.</td>
1682
+ </tr>
1683
+
1684
+
1685
+
1686
+ <tr>
1687
+
1688
+ <td class="name"><code>params.sort</code></td>
1689
+
1690
+
1691
+ <td class="type">
1692
+
1693
+
1694
+ <span class="param-type">string</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>'-created_at'</code>
1717
+
1718
+ </td>
1719
+
1720
+
1721
+ <td class="description last">The sorting order for the playlists (default is by created_at in descending order).</td>
1722
+ </tr>
1723
+
1724
+
1725
+
1726
+ <tr>
1727
+
1728
+ <td class="name"><code>params.searchTerm</code></td>
1729
+
1730
+
1731
+ <td class="type">
1732
+
1733
+
1734
+ <span class="param-type">string</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
+ </td>
1757
+
1758
+
1759
+ <td class="description last">A search term to filter playlists by name.</td>
1760
+ </tr>
1761
+
1762
+
1763
+
1764
+ <tr>
1765
+
1766
+ <td class="name"><code>params.content_id</code></td>
1767
+
1768
+
1769
+ <td class="type">
1770
+
1771
+
1772
+ <span class="param-type">int</span>
1773
+ |
1774
+
1775
+ <span class="param-type">string</span>
1776
+
1777
+
1778
+
1779
+
1780
+ </td>
1781
+
1782
+
1783
+ <td class="attributes">
1784
+
1785
+ &lt;optional><br>
1786
+
1787
+
1788
+
1789
+
1790
+
1791
+ </td>
1792
+
1793
+
1794
+
1795
+ <td class="default">
1796
+
1797
+ </td>
1798
+
1799
+
1800
+ <td class="description last">If content_id exists, the endpoint checks in each playlist if we have the content in the items.</td>
1801
+ </tr>
1802
+
1803
+
1804
+ </tbody>
1805
+ </table>
1806
+
1807
+
1808
+
1809
+
1810
+
1811
+
1812
+
1813
+
1814
+
1815
+
1816
+
1817
+
1818
+
1819
+
1820
+
1821
+
1822
+ <h5 class="h5-returns">Returns:</h5>
1823
+
1824
+
1825
+ <div class="param-desc">
1826
+ - A promise that resolves to the response from the API, containing the user playlists data.
1827
+ </div>
1828
+
1829
+
1830
+
1831
+ <dl class="param-type">
1832
+ <dt>
1833
+ Type
1834
+ </dt>
1835
+ <dd>
1836
+
1837
+ <span class="param-type">Promise.&lt;(Object|null)></span>
1838
+
1839
+
1840
+
1841
+ </dd>
1842
+ </dl>
1843
+
1844
+
1845
+
1846
+
1847
+
1848
+
1849
+
1850
+
1851
+
1852
+
1853
+
1854
+ </article>
1855
+
1856
+ </section>
1857
+
1858
+
1859
+
1860
+
1861
+
1862
+
1863
+ </div>
1864
+
1865
+ <br class="clear">
1866
+
1867
+ <footer>
1868
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.3</a> on Thu Mar 20 2025 22:04:07 GMT+0000 (Coordinated Universal Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
1869
+ </footer>
1870
+
1871
+ <script>prettyPrint();</script>
1872
+ <script src="scripts/polyfill.js"></script>
1873
+ <script src="scripts/linenumber.js"></script>
1874
+
1875
+
1876
+
1877
+ </body>
1878
+ </html>