musora-content-services 1.2.3 → 1.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/docs/config.js.html +8 -11
- package/docs/index.html +2 -2
- package/docs/module-Config.html +29 -5
- package/docs/module-Railcontent-Services.html +376 -38
- package/docs/module-Sanity-Services.html +1132 -3781
- package/docs/railcontent.js.html +54 -9
- package/docs/sanity.js.html +172 -343
- package/package.json +1 -1
- package/src/contentMetaData.js +1 -0
- package/src/contentTypeConfig.js +18 -6
- package/src/index.d.ts +0 -28
- package/src/index.js +0 -28
- package/src/services/contentProgress.js +1 -1
- package/src/services/sanity.js +0 -285
- package/test/contentProgress.test.js +0 -0
- package/test/sanityQueryService.test.js +0 -99
- package/tools/generate-index.cjs +0 -0
|
@@ -2,7 +2,6 @@ import {getFieldsForContentType} from "../src/contentTypeConfig";
|
|
|
2
2
|
const railContentModule = require('../src/services/railcontent.js')
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
|
-
fetchAssignments,
|
|
6
5
|
fetchCommentModContentData,
|
|
7
6
|
fetchMethodPreviousNextLesson,
|
|
8
7
|
fetchSanity
|
|
@@ -17,9 +16,6 @@ const {
|
|
|
17
16
|
fetchArtists,
|
|
18
17
|
fetchSongArtistCount,
|
|
19
18
|
fetchRelatedSongs,
|
|
20
|
-
fetchAllSongs,
|
|
21
|
-
fetchSongFilterOptions,
|
|
22
|
-
fetchSongCount,
|
|
23
19
|
fetchNewReleases,
|
|
24
20
|
fetchUpcomingEvents,
|
|
25
21
|
fetchByRailContentId,
|
|
@@ -28,17 +24,12 @@ const {
|
|
|
28
24
|
fetchAllOld,
|
|
29
25
|
fetchAllFilterOptions,
|
|
30
26
|
fetchFoundation,
|
|
31
|
-
fetchMethods,
|
|
32
27
|
fetchMethod,
|
|
33
28
|
fetchRelatedLessons,
|
|
34
29
|
fetchAllPacks,
|
|
35
30
|
fetchPackAll,
|
|
36
31
|
fetchLessonContent,
|
|
37
|
-
fetchCourseOverview,
|
|
38
|
-
fetchChildren,
|
|
39
|
-
fetchParentByRailContentId,
|
|
40
32
|
fetchLiveEvent,
|
|
41
|
-
fetchChallengeOverview,
|
|
42
33
|
fetchCoachLessons,
|
|
43
34
|
fetchByReference,
|
|
44
35
|
fetchScheduledReleases,
|
|
@@ -110,14 +101,6 @@ describe('Sanity Queries', function () {
|
|
|
110
101
|
expect(response.id).toBe(id);
|
|
111
102
|
});
|
|
112
103
|
|
|
113
|
-
test('fetchChallengeOverview', async () => {
|
|
114
|
-
const id = 402197;
|
|
115
|
-
const response = await fetchChallengeOverview(id);
|
|
116
|
-
expect(response.lessons).toBeDefined();
|
|
117
|
-
expect(response.id).toBe(id);
|
|
118
|
-
|
|
119
|
-
});
|
|
120
|
-
|
|
121
104
|
test('fetchByRailContentIds', async () => {
|
|
122
105
|
const id = 380094;
|
|
123
106
|
const id2 = 402204;
|
|
@@ -155,27 +138,6 @@ describe('Sanity Queries', function () {
|
|
|
155
138
|
expect(response.id).toBe(id);
|
|
156
139
|
});
|
|
157
140
|
|
|
158
|
-
|
|
159
|
-
test('fetchCourseOverview', async () => {
|
|
160
|
-
const id = 310414;
|
|
161
|
-
const response = await fetchCourseOverview(id);
|
|
162
|
-
expect(response.id).toBe(id);
|
|
163
|
-
expect(response.type).toBe('course');
|
|
164
|
-
});
|
|
165
|
-
|
|
166
|
-
test('fetchSongCount', async () => {
|
|
167
|
-
const response = await fetchSongCount('drumeo');
|
|
168
|
-
expect(response).toBeGreaterThan(1000);
|
|
169
|
-
});
|
|
170
|
-
|
|
171
|
-
test('fetchAllSongs', async () => {
|
|
172
|
-
const response = await fetchAllSongs('drumeo', {});
|
|
173
|
-
log(response);
|
|
174
|
-
expect(response.entity[0].soundslice).toBeDefined();
|
|
175
|
-
expect(response.entity[0].artist_name).toBeDefined();
|
|
176
|
-
expect(response.entity[0].instrumentless).toBeDefined();
|
|
177
|
-
});
|
|
178
|
-
|
|
179
141
|
test('fetchAllSongsInProgress', async () => {
|
|
180
142
|
var mock = jest.spyOn(dataContext, 'fetchData');
|
|
181
143
|
var json = JSON.parse(`{"version":1,"config":{"key":1,"enabled":1,"checkInterval":1,"refreshInterval":2},"data":{"412941":{"s":"started","p":6,"t":20,"u":1731108082}}}`);
|
|
@@ -205,21 +167,6 @@ describe('Sanity Queries', function () {
|
|
|
205
167
|
// expect(response.entity[0].id).not.toBe(231622);
|
|
206
168
|
// });
|
|
207
169
|
|
|
208
|
-
test('fetchSongFilterOptions', async () => {
|
|
209
|
-
const response = await fetchSongFilterOptions('drumeo', {});
|
|
210
|
-
log(response);
|
|
211
|
-
expect(response.genre).toBeDefined();
|
|
212
|
-
expect(response.difficulty).toBeDefined();
|
|
213
|
-
});
|
|
214
|
-
|
|
215
|
-
test('fetchAllSongsGroupByArtist', async () => {
|
|
216
|
-
const response = await fetchAllSongs('drumeo', {groupBy: "artist"});
|
|
217
|
-
expect(response.entity[0].lessons[0].soundslice).toBeDefined();
|
|
218
|
-
expect(response.entity[0].lessons[0].artist_name).toBeDefined();
|
|
219
|
-
expect(response.entity[0].lessons[0].instrumentless).toBeDefined();
|
|
220
|
-
}, 100000);
|
|
221
|
-
|
|
222
|
-
|
|
223
170
|
test('fetchNewReleases', async () => {
|
|
224
171
|
const response = await fetchNewReleases('drumeo');
|
|
225
172
|
log(response);
|
|
@@ -361,29 +308,6 @@ describe('Sanity Queries', function () {
|
|
|
361
308
|
)).toBe(true);
|
|
362
309
|
}, 10000);
|
|
363
310
|
|
|
364
|
-
test('fetchChildren', async () => {
|
|
365
|
-
// complement test to fetchParentByRailContentId
|
|
366
|
-
const id = 191338; ////https://web-staging-one.musora.com/admin/studio/publishing/structure/play-along;play-along_191338
|
|
367
|
-
const expectedChildID = 191492;
|
|
368
|
-
const response = await fetchChildren(id);
|
|
369
|
-
log('num children', response.length);
|
|
370
|
-
log(response);
|
|
371
|
-
|
|
372
|
-
expect(response.length > 0).toBeTruthy();
|
|
373
|
-
const foundExpectedChild = response.some((child) => {
|
|
374
|
-
return child['id'] = expectedChildID;
|
|
375
|
-
});
|
|
376
|
-
expect(foundExpectedChild).toBeTruthy();
|
|
377
|
-
});
|
|
378
|
-
|
|
379
|
-
test('fetchParentByRailContentId', async () => {
|
|
380
|
-
// complement test to fetchChildren
|
|
381
|
-
const childId = 191492; // child of https://web-staging-one.musora.com/admin/studio/publishing/structure/play-along;play-along_191338
|
|
382
|
-
const expectedParent = 191338;
|
|
383
|
-
const response = await fetchParentByRailContentId(childId);
|
|
384
|
-
expect(response['id']).toBe(expectedParent);
|
|
385
|
-
});
|
|
386
|
-
|
|
387
311
|
test('getSortOrder', () => {
|
|
388
312
|
let sort = getSortOrder()
|
|
389
313
|
expect(sort).toBe('published_on desc');
|
|
@@ -404,13 +328,6 @@ describe('Sanity Queries', function () {
|
|
|
404
328
|
expect(response.levels.length).toBeGreaterThan(0);
|
|
405
329
|
});
|
|
406
330
|
|
|
407
|
-
test('fetchMethods', async () => {
|
|
408
|
-
const response = await fetchMethods('drumeo');
|
|
409
|
-
log(response);
|
|
410
|
-
expect(response.length).toBeGreaterThan(0);
|
|
411
|
-
expect(response[0].type).toBe('learning-path');
|
|
412
|
-
});
|
|
413
|
-
|
|
414
331
|
test('fetchAll-WithProgress', async () => {
|
|
415
332
|
const ids = [410213, 410215];
|
|
416
333
|
let response = await fetchAll('drumeo', 'song', {
|
|
@@ -571,16 +488,6 @@ describe('Sanity Queries', function () {
|
|
|
571
488
|
expect(response.tabs.length).toBeGreaterThan(0);
|
|
572
489
|
});
|
|
573
490
|
|
|
574
|
-
test('fetchChallengesV2Fields', async () => {
|
|
575
|
-
const id = 402197;
|
|
576
|
-
const response = await fetchChallengeOverview(id);
|
|
577
|
-
log(response);
|
|
578
|
-
expect(response.award).toBeDefined();
|
|
579
|
-
expect(response.award_custom_text).toBeDefined();
|
|
580
|
-
expect(response.lessons[0].is_always_unlocked_for_challenge).toBeDefined();
|
|
581
|
-
expect(response.lessons[0].is_bonus_content_for_challenge).toBeDefined();
|
|
582
|
-
});
|
|
583
|
-
|
|
584
491
|
test('fetchShowsData-OddTimes', async () => {
|
|
585
492
|
const response = await fetchShowsData('drumeo');
|
|
586
493
|
log(response);
|
|
@@ -690,12 +597,6 @@ describe('Sanity Queries', function () {
|
|
|
690
597
|
expect(data[241251].parentTitle).toBe("Gear");
|
|
691
598
|
expect(data[241252].title).toBe("Setting Up Your Pedals & Throne");
|
|
692
599
|
});
|
|
693
|
-
|
|
694
|
-
test('fetchAssignments', async()=>{
|
|
695
|
-
let data = await fetchAssignments(241250);
|
|
696
|
-
expect(data).toContain(241676);
|
|
697
|
-
});
|
|
698
|
-
|
|
699
600
|
});
|
|
700
601
|
|
|
701
602
|
describe('Filter Builder', function () {
|
package/tools/generate-index.cjs
CHANGED
|
File without changes
|