musora-content-services 1.0.238 → 1.0.240
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/CHANGELOG.md +4 -0
- package/README.md +0 -0
- package/babel.config.js +0 -0
- package/docs/config.js.html +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/index.html +0 -0
- package/docs/module-Config.html +0 -0
- package/docs/module-Railcontent-Services.html +0 -0
- package/docs/module-Sanity-Services.html +0 -0
- package/docs/railcontent.js.html +0 -0
- package/docs/sanity.js.html +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/jsdoc.json +0 -0
- package/link_mcs.sh +0 -0
- package/package.json +1 -1
- package/src/contentMetaData.js +0 -0
- package/src/filterBuilder.js +0 -0
- package/src/index.d.ts +2 -0
- package/src/index.js +2 -0
- package/src/services/config.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/lastUpdated.js +0 -0
- package/src/services/railcontent.js +5 -0
- package/src/services/sanity.js +15 -2
- package/src/services/userPermissions.js +0 -0
- package/test/contentLikes.test.js +0 -0
- package/test/contentProgress.test.js +0 -0
- package/test/initializeTests.js +0 -0
- package/test/lastUpdated.test.js +0 -0
- 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
- package/test/sanityQueryService.test.js +11 -2
- package/test/userPermissions.test.js +0 -0
- package/tools/generate-index.js +0 -0
|
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
|
+
### [1.0.240](https://github.com/railroadmedia/musora-content-services/compare/v1.0.239...v1.0.240) (2024-12-16)
|
|
6
|
+
|
|
7
|
+
### [1.0.239](https://github.com/railroadmedia/musora-content-services/compare/v1.0.238...v1.0.239) (2024-12-16)
|
|
8
|
+
|
|
5
9
|
### [1.0.238](https://github.com/railroadmedia/musora-content-services/compare/v1.0.237...v1.0.238) (2024-12-16)
|
|
6
10
|
|
|
7
11
|
### [1.0.237](https://github.com/railroadmedia/musora-content-services/compare/v1.0.236...v1.0.237) (2024-12-14)
|
package/README.md
CHANGED
|
File without changes
|
package/babel.config.js
CHANGED
|
File without changes
|
package/docs/config.js.html
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/index.html
CHANGED
|
File without changes
|
package/docs/module-Config.html
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/docs/railcontent.js.html
CHANGED
|
File without changes
|
package/docs/sanity.js.html
CHANGED
|
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/jsdoc.json
CHANGED
|
File without changes
|
package/link_mcs.sh
CHANGED
|
File without changes
|
package/package.json
CHANGED
package/src/contentMetaData.js
CHANGED
|
File without changes
|
package/src/filterBuilder.js
CHANGED
|
File without changes
|
package/src/index.d.ts
CHANGED
|
@@ -63,6 +63,7 @@ import {
|
|
|
63
63
|
fetchUserPlaylists,
|
|
64
64
|
likePlaylist,
|
|
65
65
|
pinPlaylist,
|
|
66
|
+
playback,
|
|
66
67
|
postChallengesCommunityNotification,
|
|
67
68
|
postChallengesCompleteLesson,
|
|
68
69
|
postChallengesEnroll,
|
|
@@ -248,6 +249,7 @@ declare module 'musora-content-services' {
|
|
|
248
249
|
likeContent,
|
|
249
250
|
likePlaylist,
|
|
250
251
|
pinPlaylist,
|
|
252
|
+
playback,
|
|
251
253
|
postChallengesCommunityNotification,
|
|
252
254
|
postChallengesCompleteLesson,
|
|
253
255
|
postChallengesEnroll,
|
package/src/index.js
CHANGED
|
@@ -63,6 +63,7 @@ import {
|
|
|
63
63
|
fetchUserPlaylists,
|
|
64
64
|
likePlaylist,
|
|
65
65
|
pinPlaylist,
|
|
66
|
+
playback,
|
|
66
67
|
postChallengesCommunityNotification,
|
|
67
68
|
postChallengesCompleteLesson,
|
|
68
69
|
postChallengesEnroll,
|
|
@@ -247,6 +248,7 @@ export {
|
|
|
247
248
|
likeContent,
|
|
248
249
|
likePlaylist,
|
|
249
250
|
pinPlaylist,
|
|
251
|
+
playback,
|
|
250
252
|
postChallengesCommunityNotification,
|
|
251
253
|
postChallengesCompleteLesson,
|
|
252
254
|
postChallengesEnroll,
|
package/src/services/config.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1162,6 +1162,11 @@ export async function reportPlaylist(playlistId, {issue} = {}) {
|
|
|
1162
1162
|
return await fetchHandler(url, "PUT");
|
|
1163
1163
|
}
|
|
1164
1164
|
|
|
1165
|
+
export async function playback(playlistId) {
|
|
1166
|
+
const url = `/playlists/play/${playlistId}`;
|
|
1167
|
+
return await fetchHandler(url, "GET");
|
|
1168
|
+
}
|
|
1169
|
+
|
|
1165
1170
|
function fetchAbsolute(url, params) {
|
|
1166
1171
|
if (globalConfig.railcontentConfig.baseUrl) {
|
|
1167
1172
|
if (url.startsWith('/')) {
|
package/src/services/sanity.js
CHANGED
|
@@ -449,7 +449,20 @@ export async function fetchByRailContentIds(ids, contentType = undefined) {
|
|
|
449
449
|
const query = `*[railcontent_id in [${idsString}]]{
|
|
450
450
|
${getFieldsForContentType(contentType)}
|
|
451
451
|
}`
|
|
452
|
-
|
|
452
|
+
const results = await fetchSanity(query, true);
|
|
453
|
+
|
|
454
|
+
const sortFuction = function compare(a,b){
|
|
455
|
+
const indexA = ids.indexOf(a['id']);
|
|
456
|
+
const indexB = ids.indexOf(b['id'])
|
|
457
|
+
if(indexA === indexB) return 0;
|
|
458
|
+
if(indexA > indexB) return 1;
|
|
459
|
+
return -1;
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
// Sort results to match the order of the input IDs
|
|
463
|
+
const sortedResults = results.sort(sortFuction);
|
|
464
|
+
|
|
465
|
+
return sortedResults;
|
|
453
466
|
}
|
|
454
467
|
|
|
455
468
|
/**
|
|
@@ -1118,7 +1131,7 @@ export async function fetchNextPreviousLesson(railcontentId) {
|
|
|
1118
1131
|
*/
|
|
1119
1132
|
export async function jumpToContinueContent(railcontentId) {
|
|
1120
1133
|
const nextContent = await fetchNextContentDataForParent(railcontentId);
|
|
1121
|
-
if (!nextContent) {
|
|
1134
|
+
if (!nextContent || !nextContent.id) {
|
|
1122
1135
|
return null;
|
|
1123
1136
|
}
|
|
1124
1137
|
let next = await fetchByRailContentId(nextContent.id, nextContent.type);
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/test/initializeTests.js
CHANGED
|
File without changes
|
package/test/lastUpdated.test.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/test/localStorageMock.js
CHANGED
|
File without changes
|
package/test/log.js
CHANGED
|
File without changes
|
|
@@ -123,10 +123,19 @@ describe('Sanity Queries', function () {
|
|
|
123
123
|
const id2 = 402204;
|
|
124
124
|
const response = await fetchByRailContentIds([id, id2]);
|
|
125
125
|
const returnedIds = response.map((x) => x.id);
|
|
126
|
-
expect(returnedIds).
|
|
127
|
-
expect(returnedIds).
|
|
126
|
+
expect(returnedIds[0]).toBe(id);
|
|
127
|
+
expect(returnedIds[1]).toBe(id2);
|
|
128
128
|
expect(returnedIds.length).toBe(2);
|
|
129
|
+
});
|
|
129
130
|
|
|
131
|
+
test('fetchByRailContentIds_Order', async () => {
|
|
132
|
+
const id = 380094;
|
|
133
|
+
const id2 = 402204;
|
|
134
|
+
const response = await fetchByRailContentIds([id2, id]);
|
|
135
|
+
const returnedIds = response.map((x) => x.id);
|
|
136
|
+
expect(returnedIds[0]).toBe(id2);
|
|
137
|
+
expect(returnedIds[1]).toBe(id);
|
|
138
|
+
expect(returnedIds.length).toBe(2);
|
|
130
139
|
});
|
|
131
140
|
|
|
132
141
|
test('fetchUpcomingEvents', async () => {
|
|
File without changes
|
package/tools/generate-index.js
CHANGED
|
File without changes
|