musora-content-services 1.0.219 → 1.0.221
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/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/jsdoc.json +0 -0
- package/link_mcs.sh +0 -0
- package/package.json +1 -1
- package/src/contentTypeConfig.js +31 -23
- package/src/services/config.js +0 -0
- package/src/services/contentLikes.js +0 -0
- package/src/services/contentProgress.js +5 -2
- package/src/services/lastUpdated.js +0 -0
- package/src/services/userPermissions.js +0 -0
- package/test/contentLikes.test.js +0 -0
- package/test/contentProgress.test.js +10 -0
- package/test/initializeTests.js +0 -0
- package/test/lastUpdated.test.js +0 -0
- package/test/localStorageMock.js +0 -0
- package/test/log.js +0 -0
- 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.221](https://github.com/railroadmedia/musora-content-services/compare/v1.0.220...v1.0.221) (2024-12-06)
|
|
6
|
+
|
|
7
|
+
### [1.0.220](https://github.com/railroadmedia/musora-content-services/compare/v1.0.219...v1.0.220) (2024-12-06)
|
|
8
|
+
|
|
5
9
|
### [1.0.219](https://github.com/railroadmedia/musora-content-services/compare/v1.0.218...v1.0.219) (2024-12-05)
|
|
6
10
|
|
|
7
11
|
### [1.0.218](https://github.com/railroadmedia/musora-content-services/compare/v1.0.209...v1.0.218) (2024-12-05)
|
package/README.md
CHANGED
|
File without changes
|
package/babel.config.js
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/jsdoc.json
CHANGED
|
File without changes
|
package/link_mcs.sh
CHANGED
|
File without changes
|
package/package.json
CHANGED
package/src/contentTypeConfig.js
CHANGED
|
@@ -46,8 +46,8 @@ const contentWithSortField = {
|
|
|
46
46
|
]
|
|
47
47
|
}
|
|
48
48
|
const showsTypes = {
|
|
49
|
-
'drumeo': ['odd-times','drum-fest-international-2022', 'spotlight', 'the-history-of-electronic-drums', 'backstage-secret', 'quick-tips', 'question-and-answer', 'student-collaboration',
|
|
50
|
-
|
|
49
|
+
'drumeo': ['odd-times', 'drum-fest-international-2022', 'spotlight', 'the-history-of-electronic-drums', 'backstage-secret', 'quick-tips', 'question-and-answer', 'student-collaboration',
|
|
50
|
+
'live', 'podcast', 'solo', 'boot-camp', 'gear-guide', 'performance', 'in-rhythm', 'challenges', 'on-the-road', 'diy-drum-experiment', 'rhythmic-adventures-of-captain-carson',
|
|
51
51
|
'study-the-greats', 'rhythms-from-another-planet', 'tama', 'paiste-cymbals', 'behind-the-scenes', 'exploring-beats', 'sonor'
|
|
52
52
|
],
|
|
53
53
|
'pianote': ['student-review', 'question-and-answer'],
|
|
@@ -70,7 +70,7 @@ let contentTypeConfig = {
|
|
|
70
70
|
isOneToOne: true
|
|
71
71
|
}
|
|
72
72
|
},
|
|
73
|
-
'slug':'songs',
|
|
73
|
+
'slug': 'songs',
|
|
74
74
|
},
|
|
75
75
|
'song-tutorial': {
|
|
76
76
|
'fields': [
|
|
@@ -89,7 +89,7 @@ let contentTypeConfig = {
|
|
|
89
89
|
}
|
|
90
90
|
},
|
|
91
91
|
},
|
|
92
|
-
'challenge':{
|
|
92
|
+
'challenge': {
|
|
93
93
|
'fields': [
|
|
94
94
|
'enrollment_start_time',
|
|
95
95
|
'enrollment_end_time',
|
|
@@ -141,7 +141,7 @@ let contentTypeConfig = {
|
|
|
141
141
|
length_in_seconds,
|
|
142
142
|
}`,
|
|
143
143
|
],
|
|
144
|
-
'slug':'courses',
|
|
144
|
+
'slug': 'courses',
|
|
145
145
|
},
|
|
146
146
|
'parent-download': {
|
|
147
147
|
'fields': [
|
|
@@ -244,7 +244,7 @@ let contentTypeConfig = {
|
|
|
244
244
|
'fields': [
|
|
245
245
|
artistOrInstructorNameAsArray(),
|
|
246
246
|
],
|
|
247
|
-
'slug':'workouts',
|
|
247
|
+
'slug': 'workouts',
|
|
248
248
|
},
|
|
249
249
|
'play-along': {
|
|
250
250
|
'fields': [
|
|
@@ -255,7 +255,7 @@ let contentTypeConfig = {
|
|
|
255
255
|
'mp3_yes_drums_no_click_url',
|
|
256
256
|
'bpm',
|
|
257
257
|
],
|
|
258
|
-
'slug':'play-alongs',
|
|
258
|
+
'slug': 'play-alongs',
|
|
259
259
|
},
|
|
260
260
|
'pack': {
|
|
261
261
|
'fields': [
|
|
@@ -281,15 +281,15 @@ let contentTypeConfig = {
|
|
|
281
281
|
'fields': [
|
|
282
282
|
'sheet_music_thumbnail_url',
|
|
283
283
|
],
|
|
284
|
-
'slug':'rudiments',
|
|
284
|
+
'slug': 'rudiments',
|
|
285
285
|
},
|
|
286
|
-
'routine':{
|
|
286
|
+
'routine': {
|
|
287
287
|
'fields': [
|
|
288
288
|
`"description": ${descriptionField}`,
|
|
289
289
|
'high_soundslice_slug',
|
|
290
290
|
'low_soundslice_slug'
|
|
291
291
|
],
|
|
292
|
-
'slug':'routines',
|
|
292
|
+
'slug': 'routines',
|
|
293
293
|
},
|
|
294
294
|
'pack-children': {
|
|
295
295
|
'fields': [
|
|
@@ -369,8 +369,8 @@ let contentTypeConfig = {
|
|
|
369
369
|
'backstage-secret': contentWithInstructorsField,
|
|
370
370
|
'question-and-answer': contentWithInstructorsField,
|
|
371
371
|
'student-collaboration': contentWithInstructorsField,
|
|
372
|
-
'live': {
|
|
373
|
-
'solo': {
|
|
372
|
+
'live': {...contentWithInstructorsField, 'slug': 'live-streams'},
|
|
373
|
+
'solo': {...contentWithInstructorsField, 'slug': 'solos'},
|
|
374
374
|
'boot-camp': contentWithInstructorsField,
|
|
375
375
|
'gear-guids': contentWithInstructorsField,
|
|
376
376
|
'performance': contentWithInstructorsField,
|
|
@@ -391,22 +391,22 @@ let contentTypeConfig = {
|
|
|
391
391
|
|
|
392
392
|
function getNewReleasesTypes(brand) {
|
|
393
393
|
const baseNewTypes = ["student-review", "student-review", "student-focus", "coach-stream", "live", "question-and-answer", "boot-camps", "quick-tips", "workout", "challenge", "challenge-part", "podcasts", "pack", "song", "learning-path-level", "play-along", "course", "unit"];
|
|
394
|
-
switch(brand) {
|
|
394
|
+
switch (brand) {
|
|
395
395
|
case 'drumeo':
|
|
396
396
|
return [...baseNewTypes, "drum-fest-international-2022", "spotlight", "the-history-of-electronic-drums", "backstage-secrets", "student-collaborations", "live", "solos", "gear-guides", "performances", "in-rhythm", "challenges", "on-the-road", "diy-drum-experiments", "rhythmic-adventures-of-captain-carson", "study-the-greats", "rhythms-from-another-planet", "tama-drums", "paiste-cymbals", "behind-the-scenes", "exploring-beats", "sonor"];
|
|
397
|
-
case 'guitareo':
|
|
397
|
+
case 'guitareo':
|
|
398
398
|
return [...baseNewTypes, "archives", "recording", "chords-and-scales"];
|
|
399
|
-
case 'pianote':
|
|
399
|
+
case 'pianote':
|
|
400
400
|
case 'singeo':
|
|
401
401
|
default:
|
|
402
402
|
return baseNewTypes
|
|
403
|
-
|
|
403
|
+
}
|
|
404
404
|
}
|
|
405
405
|
|
|
406
406
|
function getUpcomingEventsTypes(brand) {
|
|
407
407
|
const baseLiveTypes = ["student-review", "student-review", "student-focus", "coach-stream", "live", "question-and-answer", "boot-camps", "quick-tips", "recording", "pack-bundle-lesson"];
|
|
408
|
-
switch(brand) {
|
|
409
|
-
case 'drumeo':
|
|
408
|
+
switch (brand) {
|
|
409
|
+
case 'drumeo':
|
|
410
410
|
return [...baseLiveTypes, "drum-fest-international-2022", "spotlight", "the-history-of-electronic-drums", "backstage-secrets", "student-collaborations", "live", "podcasts", "solos", "gear-guides", "performances", "in-rhythm", "challenges", "on-the-road", "diy-drum-experiments", "rhythmic-adventures-of-captain-carson", "study-the-greats", "rhythms-from-another-planet", "tama-drums", "paiste-cymbals", "behind-the-scenes", "exploring-beats", "sonor"];
|
|
411
411
|
case 'guitareo':
|
|
412
412
|
return [...baseLiveTypes, "archives"];
|
|
@@ -414,21 +414,22 @@ function getUpcomingEventsTypes(brand) {
|
|
|
414
414
|
case 'singeo':
|
|
415
415
|
default:
|
|
416
416
|
return baseLiveTypes;
|
|
417
|
-
|
|
417
|
+
}
|
|
418
418
|
}
|
|
419
419
|
|
|
420
|
-
function artistOrInstructorName(key='artist_name') {
|
|
420
|
+
function artistOrInstructorName(key = 'artist_name') {
|
|
421
421
|
return `'${key}': coalesce(artist->name, instructor[0]->name)`;
|
|
422
422
|
}
|
|
423
423
|
|
|
424
|
-
function artistOrInstructorNameAsArray(key='artists') {
|
|
424
|
+
function artistOrInstructorNameAsArray(key = 'artists') {
|
|
425
425
|
return `'${key}': select(artist->name != null => [artist->name], instructor[]->name)`;
|
|
426
426
|
}
|
|
427
427
|
|
|
428
|
-
function getFieldsForContentType(contentType, asQueryString=true) {
|
|
428
|
+
function getFieldsForContentType(contentType, asQueryString = true) {
|
|
429
429
|
const fields = contentType ? DEFAULT_FIELDS.concat(contentTypeConfig?.[contentType]?.fields ?? []) : DEFAULT_FIELDS;
|
|
430
430
|
return asQueryString ? fields.toString() + ',' : fields;
|
|
431
431
|
}
|
|
432
|
+
|
|
432
433
|
/**
|
|
433
434
|
* Takes the included fields array and returns a string that can be used in a groq query.
|
|
434
435
|
* @param {Array<string>} filters - An array of strings that represent applied filters. This should be in the format of a key,value array. eg. ['difficulty,Intermediate',
|
|
@@ -459,7 +460,13 @@ function filtersToGroq(filters, selectedFilters = []) {
|
|
|
459
460
|
} else if (key === 'gear' && !selectedFilters.includes('gear')) {
|
|
460
461
|
return `gear match "${value}"`;
|
|
461
462
|
} else if (key === 'instrumentless' && !selectedFilters.includes(key)) {
|
|
462
|
-
|
|
463
|
+
if (value === "Full Song Only") {
|
|
464
|
+
return `(!instrumentless || instrumentless != null)`;
|
|
465
|
+
} else if (value === "Instrument Removed") {
|
|
466
|
+
return `instrumentless`;
|
|
467
|
+
} else {
|
|
468
|
+
return `instrumentless == ${value}`;
|
|
469
|
+
}
|
|
463
470
|
} else if (key === 'difficulty' && !selectedFilters.includes(key)) {
|
|
464
471
|
return `difficulty_string == "${value}"`;
|
|
465
472
|
} else if (key === 'type' && !selectedFilters.includes(key)) {
|
|
@@ -485,6 +492,7 @@ function filtersToGroq(filters, selectedFilters = []) {
|
|
|
485
492
|
|
|
486
493
|
return filterClauses;
|
|
487
494
|
}
|
|
495
|
+
|
|
488
496
|
function groupFilters(filters) {
|
|
489
497
|
if (filters.length === 0) return {};
|
|
490
498
|
|
package/src/services/config.js
CHANGED
|
File without changes
|
|
File without changes
|
|
@@ -135,8 +135,11 @@ function saveContentProgress(localContext, contentId, progress, currentSeconds,
|
|
|
135
135
|
}
|
|
136
136
|
|
|
137
137
|
let data = localContext.data[contentId] ?? {};
|
|
138
|
-
data[
|
|
139
|
-
|
|
138
|
+
const currentProgress = data[DATA_KEY_STATUS];
|
|
139
|
+
if (!currentProgress || currentProgress !== STATE_COMPLETED) {
|
|
140
|
+
data[DATA_KEY_PROGRESS] = progress;
|
|
141
|
+
data[DATA_KEY_STATUS] = STATE_STARTED;
|
|
142
|
+
}
|
|
140
143
|
data[DATA_KEY_RESUME_TIME] = currentSeconds;
|
|
141
144
|
data[DATA_KEY_LAST_UPDATED_TIME] = Math.round(new Date().getTime() / 1000);
|
|
142
145
|
localContext.data[contentId] = data;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -131,6 +131,16 @@ describe('contentProgressDataContext', function () {
|
|
|
131
131
|
|
|
132
132
|
});
|
|
133
133
|
|
|
134
|
+
// test('completedProgressNotOverwritten', async () => {
|
|
135
|
+
// const contentId = 241262;
|
|
136
|
+
// let progress = await getProgressPercentage(241250); //force load context
|
|
137
|
+
// await contentStatusCompleted(contentId);
|
|
138
|
+
// await recordWatchSession(contentId, "video", "vimeo", 100, 50, 50);
|
|
139
|
+
// progress = await getProgressPercentage(contentId);
|
|
140
|
+
// expect(progress).toBe(100);
|
|
141
|
+
// });
|
|
142
|
+
|
|
143
|
+
|
|
134
144
|
test('assignmentCompleteBubbling', async () => {
|
|
135
145
|
let assignmentId = 286048;
|
|
136
146
|
let contentId = 286047;
|
package/test/initializeTests.js
CHANGED
|
File without changes
|
package/test/lastUpdated.test.js
CHANGED
|
File without changes
|
package/test/localStorageMock.js
CHANGED
|
File without changes
|
package/test/log.js
CHANGED
|
File without changes
|
|
File without changes
|
package/tools/generate-index.js
CHANGED
|
File without changes
|