musora-content-services 1.3.3 → 1.3.7
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 +8 -0
- package/README.md +0 -0
- package/babel.config.cjs +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/package.json +1 -1
- package/src/contentMetaData.js +90 -0
- package/src/contentTypeConfig.js +24 -0
- package/src/filterBuilder.js +0 -0
- package/src/index.d.ts +250 -227
- package/src/index.js +249 -226
- 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 +1 -1
- package/src/services/sanity.js +112 -10
- 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 +23 -0
- package/test/userPermissions.test.js +0 -0
- package/tools/generate-index.cjs +0 -0
- package/.yarnrc.yml +0 -1
|
File without changes
|
package/.prettierignore
CHANGED
|
File without changes
|
package/.prettierrc
CHANGED
|
File without changes
|
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,14 @@
|
|
|
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.3.7](https://github.com/railroadmedia/musora-content-services/compare/v1.3.6...v1.3.7) (2025-02-20)
|
|
6
|
+
|
|
7
|
+
### [1.3.6](https://github.com/railroadmedia/musora-content-services/compare/v1.3.5...v1.3.6) (2025-02-18)
|
|
8
|
+
|
|
9
|
+
### [1.3.5](https://github.com/railroadmedia/musora-content-services/compare/v1.3.4...v1.3.5) (2025-02-14)
|
|
10
|
+
|
|
11
|
+
### [1.3.4](https://github.com/railroadmedia/musora-content-services/compare/v1.3.2...v1.3.4) (2025-02-14)
|
|
12
|
+
|
|
5
13
|
### [1.3.3](https://github.com/railroadmedia/musora-content-services/compare/v1.3.2...v1.3.3) (2025-01-31)
|
|
6
14
|
|
|
7
15
|
### [1.3.2](https://github.com/railroadmedia/musora-content-services/compare/v1.3.1...v1.3.2) (2025-01-30)
|
package/README.md
CHANGED
|
File without changes
|
package/babel.config.cjs
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/package.json
CHANGED
package/src/contentMetaData.js
CHANGED
|
@@ -266,6 +266,36 @@ const contentMetadata = {
|
|
|
266
266
|
song: {
|
|
267
267
|
sortBy: '-published_on',
|
|
268
268
|
},
|
|
269
|
+
'song-tutorial': {
|
|
270
|
+
name: 'Song Tutorials',
|
|
271
|
+
thumbnailUrl: 'https://dpwjbsxqtam5n.cloudfront.net/shows/pianote/songs.jpg',
|
|
272
|
+
allowableFilters: ['difficulty', 'genre'],
|
|
273
|
+
sortBy: '-published_on',
|
|
274
|
+
shortname: 'song tutorials',
|
|
275
|
+
icon: 'play-progress',
|
|
276
|
+
description: '',
|
|
277
|
+
amountOfFutureLessonsToShow: 3,
|
|
278
|
+
showFutureLessonAtTopOrBottom: 'bottom',
|
|
279
|
+
tabs: [
|
|
280
|
+
{
|
|
281
|
+
name: 'Lessons',
|
|
282
|
+
short_name: 'Lessons',
|
|
283
|
+
value: '',
|
|
284
|
+
},
|
|
285
|
+
{
|
|
286
|
+
name: 'Artists',
|
|
287
|
+
short_name: 'ARTISTS',
|
|
288
|
+
is_group_by: true,
|
|
289
|
+
value: 'artist',
|
|
290
|
+
},
|
|
291
|
+
{
|
|
292
|
+
name: 'Genres',
|
|
293
|
+
short_name: 'Genres',
|
|
294
|
+
is_group_by: true,
|
|
295
|
+
value: 'genre',
|
|
296
|
+
},
|
|
297
|
+
],
|
|
298
|
+
},
|
|
269
299
|
'student-review': null,
|
|
270
300
|
'student-focus': {
|
|
271
301
|
name: 'Student Focus',
|
|
@@ -1013,6 +1043,36 @@ const contentMetadata = {
|
|
|
1013
1043
|
song: {
|
|
1014
1044
|
allowableFilters: ['difficulty', 'genre', 'lifestyle', 'instrumentless'],
|
|
1015
1045
|
},
|
|
1046
|
+
'song-tutorial': {
|
|
1047
|
+
name: 'Song Tutorials',
|
|
1048
|
+
thumbnailUrl: 'https://dpwjbsxqtam5n.cloudfront.net/shows/pianote/songs.jpg',
|
|
1049
|
+
allowableFilters: ['difficulty', 'genre'],
|
|
1050
|
+
sortBy: '-published_on',
|
|
1051
|
+
shortname: 'song tutorials',
|
|
1052
|
+
icon: 'play-progress',
|
|
1053
|
+
description: '',
|
|
1054
|
+
amountOfFutureLessonsToShow: 3,
|
|
1055
|
+
showFutureLessonAtTopOrBottom: 'bottom',
|
|
1056
|
+
tabs: [
|
|
1057
|
+
{
|
|
1058
|
+
name: 'Lessons',
|
|
1059
|
+
short_name: 'Lessons',
|
|
1060
|
+
value: '',
|
|
1061
|
+
},
|
|
1062
|
+
{
|
|
1063
|
+
name: 'Artists',
|
|
1064
|
+
short_name: 'ARTISTS',
|
|
1065
|
+
is_group_by: true,
|
|
1066
|
+
value: 'artist',
|
|
1067
|
+
},
|
|
1068
|
+
{
|
|
1069
|
+
name: 'Genres',
|
|
1070
|
+
short_name: 'Genres',
|
|
1071
|
+
is_group_by: true,
|
|
1072
|
+
value: 'genre',
|
|
1073
|
+
},
|
|
1074
|
+
],
|
|
1075
|
+
},
|
|
1016
1076
|
'play-along': {
|
|
1017
1077
|
name: 'Play Alongs',
|
|
1018
1078
|
icon: 'icon-play-alongs',
|
|
@@ -1138,6 +1198,36 @@ const contentMetadata = {
|
|
|
1138
1198
|
description:
|
|
1139
1199
|
'Want feedback on your singing? Submit a video for student review. We will watch your submission and then provide helpful encouragement and feedback. This is a great way to build accountability and benefit from the expertise of our teachers.',
|
|
1140
1200
|
},
|
|
1201
|
+
'song-tutorial': {
|
|
1202
|
+
name: 'Song Tutorials',
|
|
1203
|
+
thumbnailUrl: 'https://dpwjbsxqtam5n.cloudfront.net/shows/pianote/songs.jpg',
|
|
1204
|
+
allowableFilters: ['difficulty', 'genre'],
|
|
1205
|
+
sortBy: '-published_on',
|
|
1206
|
+
shortname: 'song tutorials',
|
|
1207
|
+
icon: 'play-progress',
|
|
1208
|
+
description: '',
|
|
1209
|
+
amountOfFutureLessonsToShow: 3,
|
|
1210
|
+
showFutureLessonAtTopOrBottom: 'bottom',
|
|
1211
|
+
tabs: [
|
|
1212
|
+
{
|
|
1213
|
+
name: 'Lessons',
|
|
1214
|
+
short_name: 'Lessons',
|
|
1215
|
+
value: '',
|
|
1216
|
+
},
|
|
1217
|
+
{
|
|
1218
|
+
name: 'Artists',
|
|
1219
|
+
short_name: 'ARTISTS',
|
|
1220
|
+
is_group_by: true,
|
|
1221
|
+
value: 'artist',
|
|
1222
|
+
},
|
|
1223
|
+
{
|
|
1224
|
+
name: 'Genres',
|
|
1225
|
+
short_name: 'Genres',
|
|
1226
|
+
is_group_by: true,
|
|
1227
|
+
value: 'genre',
|
|
1228
|
+
},
|
|
1229
|
+
],
|
|
1230
|
+
},
|
|
1141
1231
|
routine: {
|
|
1142
1232
|
name: 'Routines',
|
|
1143
1233
|
icon: 'icon-shows',
|
package/src/contentTypeConfig.js
CHANGED
|
@@ -26,6 +26,13 @@ export const DEFAULT_FIELDS = [
|
|
|
26
26
|
'xp',
|
|
27
27
|
'child_count',
|
|
28
28
|
]
|
|
29
|
+
export const DEFAULT_CHILD_FIELDS = [
|
|
30
|
+
`"id": railcontent_id`,
|
|
31
|
+
`title`,
|
|
32
|
+
`"image": thumbnail.asset->url`,
|
|
33
|
+
`"instructors": instructor[]->name`,
|
|
34
|
+
`length_in_seconds`,
|
|
35
|
+
]
|
|
29
36
|
|
|
30
37
|
export const descriptionField = 'description[0].children[0].text'
|
|
31
38
|
// this pulls both any defined resources for the document as well as any resources in the parent document
|
|
@@ -111,6 +118,14 @@ export const coachLessonsTypes = [
|
|
|
111
118
|
'workout',
|
|
112
119
|
]
|
|
113
120
|
|
|
121
|
+
export const childContentTypeConfig = {
|
|
122
|
+
'song-tutorial': [
|
|
123
|
+
`"genre": genre[]->name`,
|
|
124
|
+
`difficulty_string`,
|
|
125
|
+
`"type": _type`,
|
|
126
|
+
]
|
|
127
|
+
}
|
|
128
|
+
|
|
114
129
|
export let contentTypeConfig = {
|
|
115
130
|
song: {
|
|
116
131
|
fields: ['album', 'soundslice', 'instrumentless', `"resources": ${resourcesField}`],
|
|
@@ -130,7 +145,9 @@ export let contentTypeConfig = {
|
|
|
130
145
|
"image": thumbnail.asset->url,
|
|
131
146
|
"instructors": instructor[]->name,
|
|
132
147
|
length_in_seconds,
|
|
148
|
+
web_url_path,
|
|
133
149
|
}`,
|
|
150
|
+
'"instructors": instructor[]->name',
|
|
134
151
|
],
|
|
135
152
|
relationships: {
|
|
136
153
|
artist: {
|
|
@@ -560,6 +577,13 @@ export function getFieldsForContentType(contentType, asQueryString = true) {
|
|
|
560
577
|
return asQueryString ? fields.toString() + ',' : fields
|
|
561
578
|
}
|
|
562
579
|
|
|
580
|
+
export function getChildFieldsForContentType(contentType, asQueryString = true) {
|
|
581
|
+
const fields = contentType
|
|
582
|
+
? DEFAULT_CHILD_FIELDS.concat(childContentTypeConfig?.[contentType] ?? [])
|
|
583
|
+
: DEFAULT_CHILD_FIELDS
|
|
584
|
+
return asQueryString ? fields.toString() + ',' : fields
|
|
585
|
+
}
|
|
586
|
+
|
|
563
587
|
/**
|
|
564
588
|
* Takes the included fields array and returns a string that can be used in a groq query.
|
|
565
589
|
* @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',
|
package/src/filterBuilder.js
CHANGED
|
File without changes
|