musora-content-services 2.3.19 → 2.3.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/node.js.yml +0 -0
- package/.prettierignore +0 -0
- package/.prettierrc +0 -0
- package/CHANGELOG.md +4 -0
- package/README.md +0 -0
- package/babel.config.cjs +0 -0
- package/docs/fonts/Montserrat/Montserrat-Bold.eot +0 -0
- package/docs/fonts/Montserrat/Montserrat-Bold.ttf +0 -0
- package/docs/fonts/Montserrat/Montserrat-Bold.woff +0 -0
- package/docs/fonts/Montserrat/Montserrat-Bold.woff2 +0 -0
- package/docs/fonts/Montserrat/Montserrat-Regular.eot +0 -0
- package/docs/fonts/Montserrat/Montserrat-Regular.ttf +0 -0
- package/docs/fonts/Montserrat/Montserrat-Regular.woff +0 -0
- package/docs/fonts/Montserrat/Montserrat-Regular.woff2 +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.eot +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.svg +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.ttf +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.woff +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.woff2 +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.eot +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.svg +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.ttf +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.woff +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.woff2 +0 -0
- package/docs/scripts/collapse.js +0 -0
- package/docs/scripts/commonNav.js +0 -0
- package/docs/scripts/linenumber.js +0 -0
- package/docs/scripts/nav.js +0 -0
- package/docs/scripts/polyfill.js +0 -0
- package/docs/scripts/prettify/Apache-License-2.0.txt +0 -0
- package/docs/scripts/prettify/lang-css.js +0 -0
- package/docs/scripts/prettify/prettify.js +0 -0
- package/docs/scripts/search.js +0 -0
- package/docs/styles/jsdoc.css +0 -0
- package/docs/styles/prettify.css +0 -0
- package/jest.config.js +0 -0
- package/link_mcs.sh +0 -0
- package/package.json +1 -1
- package/src/contentAggregator.js +0 -0
- package/src/filterBuilder.js +0 -0
- package/src/index.d.ts +4 -0
- package/src/index.js +4 -0
- package/src/lib/httpHelper.js +0 -0
- package/src/services/api/types.js +0 -0
- package/src/services/content-org/content-org.js +0 -0
- package/src/services/content-org/playlists.js +41 -41
- package/src/services/content.js +0 -0
- package/src/services/contentLikes.js +0 -0
- package/src/services/contentProgress.js +0 -0
- package/src/services/dataContext.js +0 -0
- package/src/services/dateUtils.js +0 -0
- package/src/services/forum.js +0 -0
- package/src/services/gamification/awards.js +0 -0
- package/src/services/gamification/gamification.js +0 -0
- package/src/services/gamification/types.js +0 -0
- package/src/services/imageSRCBuilder.js +1 -1
- package/src/services/imageSRCVerify.js +0 -0
- package/src/services/recommendations.js +0 -0
- package/src/services/types.js +0 -0
- package/src/services/user/management.js +0 -0
- package/src/services/user/sessions.js +0 -0
- package/src/services/user/types.js +0 -0
- package/src/services/user/user-management-system.js +0 -0
- package/src/services/userActivity.js +0 -0
- package/test/imageSRCBuilder.test.js +1 -1
- package/test/live/contentProgressLive.test.js +0 -0
- package/test/live/railcontentLive.test.js +0 -0
- package/test/localStorageMock.js +0 -0
- package/test/log.js +0 -0
|
File without changes
|
package/.prettierignore
CHANGED
|
File without changes
|
package/.prettierrc
CHANGED
|
File without changes
|
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [2.3.21](https://github.com/railroadmedia/musora-content-services/compare/v2.3.20...v2.3.21) (2025-05-02)
|
|
6
|
+
|
|
7
|
+
### [2.3.20](https://github.com/railroadmedia/musora-content-services/compare/v2.3.19...v2.3.20) (2025-04-30)
|
|
8
|
+
|
|
5
9
|
### [2.3.19](https://github.com/railroadmedia/musora-content-services/compare/v2.3.18...v2.3.19) (2025-04-30)
|
|
6
10
|
|
|
7
11
|
### [2.3.18](https://github.com/railroadmedia/musora-content-services/compare/v2.3.16...v2.3.18) (2025-04-30)
|
package/README.md
CHANGED
|
File without changes
|
package/babel.config.cjs
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/docs/scripts/collapse.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/docs/scripts/nav.js
CHANGED
|
File without changes
|
package/docs/scripts/polyfill.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/docs/scripts/search.js
CHANGED
|
File without changes
|
package/docs/styles/jsdoc.css
CHANGED
|
File without changes
|
package/docs/styles/prettify.css
CHANGED
|
File without changes
|
package/jest.config.js
CHANGED
|
File without changes
|
package/link_mcs.sh
CHANGED
|
File without changes
|
package/package.json
CHANGED
package/src/contentAggregator.js
CHANGED
|
File without changes
|
package/src/filterBuilder.js
CHANGED
|
File without changes
|
package/src/index.d.ts
CHANGED
|
@@ -9,6 +9,8 @@ import {
|
|
|
9
9
|
addItemToPlaylist,
|
|
10
10
|
createPlaylist,
|
|
11
11
|
duplicatePlaylist,
|
|
12
|
+
fetchPlaylist,
|
|
13
|
+
fetchPlaylistItems,
|
|
12
14
|
fetchUserPlaylists,
|
|
13
15
|
likePlaylist,
|
|
14
16
|
reorderPlaylistItems,
|
|
@@ -300,6 +302,8 @@ declare module 'musora-content-services' {
|
|
|
300
302
|
fetchPackData,
|
|
301
303
|
fetchParentForDownload,
|
|
302
304
|
fetchPlayAlongsCount,
|
|
305
|
+
fetchPlaylist,
|
|
306
|
+
fetchPlaylistItems,
|
|
303
307
|
fetchRecent,
|
|
304
308
|
fetchRelatedLessons,
|
|
305
309
|
fetchRelatedRecommendedContent,
|
package/src/index.js
CHANGED
|
@@ -9,6 +9,8 @@ import {
|
|
|
9
9
|
addItemToPlaylist,
|
|
10
10
|
createPlaylist,
|
|
11
11
|
duplicatePlaylist,
|
|
12
|
+
fetchPlaylist,
|
|
13
|
+
fetchPlaylistItems,
|
|
12
14
|
fetchUserPlaylists,
|
|
13
15
|
likePlaylist,
|
|
14
16
|
reorderPlaylistItems,
|
|
@@ -299,6 +301,8 @@ export {
|
|
|
299
301
|
fetchPackData,
|
|
300
302
|
fetchParentForDownload,
|
|
301
303
|
fetchPlayAlongsCount,
|
|
304
|
+
fetchPlaylist,
|
|
305
|
+
fetchPlaylistItems,
|
|
302
306
|
fetchRecent,
|
|
303
307
|
fetchRelatedLessons,
|
|
304
308
|
fetchRelatedRecommendedContent,
|
package/src/lib/httpHelper.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -254,6 +254,47 @@ export async function duplicatePlaylist(playlistId, playlistData) {
|
|
|
254
254
|
return await fetchHandler(url, 'POST', null, playlistData)
|
|
255
255
|
}
|
|
256
256
|
|
|
257
|
+
/**
|
|
258
|
+
* Retrieves details of a specific playlist by its ID.
|
|
259
|
+
*
|
|
260
|
+
* This function sends a GET request to the `/playlists/playlist` endpoint with a specified playlist ID.
|
|
261
|
+
* The server validates the user's access to the playlist and returns playlist details if the user is authorized.
|
|
262
|
+
*
|
|
263
|
+
* @param {string|number} playlistId - The unique identifier of the playlist to retrieve.
|
|
264
|
+
*
|
|
265
|
+
* @returns {Promise<Object>} - A promise that resolves to the response from the API, containing:
|
|
266
|
+
* - `data` (Object): The playlist details, or an error message if access is denied or the playlist is not found.
|
|
267
|
+
*
|
|
268
|
+
* @example
|
|
269
|
+
* fetchPlaylist(12345)
|
|
270
|
+
* .then(response => console.log(response.data))
|
|
271
|
+
* .catch(error => console.error('Error fetching playlist:', error));
|
|
272
|
+
*/
|
|
273
|
+
export async function fetchPlaylist(playlistId) {
|
|
274
|
+
const url = `${BASE_PATH}/v1/user/playlists/${playlistId}`
|
|
275
|
+
return await fetchHandler(url, 'GET')
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
/**
|
|
279
|
+
* Retrieves items within a specified playlist by playlist ID.
|
|
280
|
+
*
|
|
281
|
+
* This function sends a GET request to the `/playlists/playlist-lessons` endpoint to fetch items in the given playlist.
|
|
282
|
+
* The server combines data from the playlist and additional metadata from Sanity to enhance item details.
|
|
283
|
+
*
|
|
284
|
+
* @param {string|number} playlistId - The unique identifier of the playlist whose items are to be fetched.
|
|
285
|
+
*
|
|
286
|
+
* @returns {Promise<Array<Object>>} - A promise that resolves to an array of playlist items
|
|
287
|
+
*
|
|
288
|
+
* @example
|
|
289
|
+
* fetchPlaylistItems(12345)
|
|
290
|
+
* .then(items => console.log(items))
|
|
291
|
+
* .catch(error => console.error('Error fetching playlist items:', error));
|
|
292
|
+
*/
|
|
293
|
+
export async function fetchPlaylistItems(playlistId) {
|
|
294
|
+
const url = `${BASE_PATH}/v1/user/playlists/items/${playlistId}`
|
|
295
|
+
return await fetchHandler(url, 'GET')
|
|
296
|
+
}
|
|
297
|
+
|
|
257
298
|
// Unsupported playlist endpoints are here and will need to be implemented one by one
|
|
258
299
|
//
|
|
259
300
|
//
|
|
@@ -321,47 +362,6 @@ export async function duplicatePlaylist(playlistId, playlistData) {
|
|
|
321
362
|
// }
|
|
322
363
|
//
|
|
323
364
|
//
|
|
324
|
-
// /**
|
|
325
|
-
// * Retrieves details of a specific playlist by its ID.
|
|
326
|
-
// *
|
|
327
|
-
// * This function sends a GET request to the `/playlists/playlist` endpoint with a specified playlist ID.
|
|
328
|
-
// * The server validates the user's access to the playlist and returns playlist details if the user is authorized.
|
|
329
|
-
// *
|
|
330
|
-
// * @param {string|number} playlistId - The unique identifier of the playlist to retrieve.
|
|
331
|
-
// *
|
|
332
|
-
// * @returns {Promise<Object>} - A promise that resolves to the response from the API, containing:
|
|
333
|
-
// * - `data` (Object): The playlist details, or an error message if access is denied or the playlist is not found.
|
|
334
|
-
// *
|
|
335
|
-
// * @example
|
|
336
|
-
// * fetchPlaylist(12345)
|
|
337
|
-
// * .then(response => console.log(response.data))
|
|
338
|
-
// * .catch(error => console.error('Error fetching playlist:', error));
|
|
339
|
-
// */
|
|
340
|
-
// export async function fetchPlaylist(playlistId) {
|
|
341
|
-
// const url = `/playlists/playlist/${playlistId}`
|
|
342
|
-
// return await fetchHandler(url, 'GET')
|
|
343
|
-
// }
|
|
344
|
-
//
|
|
345
|
-
// /**
|
|
346
|
-
// * Retrieves items within a specified playlist by playlist ID.
|
|
347
|
-
// *
|
|
348
|
-
// * This function sends a GET request to the `/playlists/playlist-lessons` endpoint to fetch items in the given playlist.
|
|
349
|
-
// * The server combines data from the playlist and additional metadata from Sanity to enhance item details.
|
|
350
|
-
// *
|
|
351
|
-
// * @param {string|number} playlistId - The unique identifier of the playlist whose items are to be fetched.
|
|
352
|
-
// *
|
|
353
|
-
// * @returns {Promise<Array<Object>>} - A promise that resolves to an array of playlist items
|
|
354
|
-
// *
|
|
355
|
-
// * @example
|
|
356
|
-
// * fetchPlaylistItems(12345)
|
|
357
|
-
// * .then(items => console.log(items))
|
|
358
|
-
// * .catch(error => console.error('Error fetching playlist items:', error));
|
|
359
|
-
// */
|
|
360
|
-
// export async function fetchPlaylistItems(playlistId, { sort } = {}) {
|
|
361
|
-
// const sortString = sort ? `&sort=${sort}` : ''
|
|
362
|
-
// const url = `/playlists/playlist-lessons?playlist_id=${playlistId}${sortString}`
|
|
363
|
-
// return await fetchHandler(url, 'GET')
|
|
364
|
-
// }
|
|
365
365
|
//
|
|
366
366
|
// /**
|
|
367
367
|
// * Updates a playlist item with the provided data.
|
package/src/services/content.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/src/services/forum.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -55,7 +55,7 @@ export function buildImageSRC(url, options = {}) {
|
|
|
55
55
|
export function applySanityTransformations(url, options) {
|
|
56
56
|
const { width, height, quality } = options
|
|
57
57
|
|
|
58
|
-
const sanityOptions = ['
|
|
58
|
+
const sanityOptions = ['fm=webp']
|
|
59
59
|
|
|
60
60
|
// Dimensions
|
|
61
61
|
if (width) sanityOptions.push(`w=${width}`)
|
|
File without changes
|
|
File without changes
|
package/src/services/types.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -14,7 +14,7 @@ describe('imageSRCBuilder', function () {
|
|
|
14
14
|
quality: quality,
|
|
15
15
|
height: height,
|
|
16
16
|
})
|
|
17
|
-
const expected = `${url}?
|
|
17
|
+
const expected = `${url}?fm=webp&w=${width}&h=${height}&q=${quality}`
|
|
18
18
|
|
|
19
19
|
expect(resultingURL).toStrictEqual(expected)
|
|
20
20
|
})
|
|
File without changes
|
|
File without changes
|
package/test/localStorageMock.js
CHANGED
|
File without changes
|
package/test/log.js
CHANGED
|
File without changes
|