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.
Files changed (70) hide show
  1. package/.github/workflows/node.js.yml +0 -0
  2. package/.prettierignore +0 -0
  3. package/.prettierrc +0 -0
  4. package/CHANGELOG.md +8 -0
  5. package/README.md +0 -0
  6. package/babel.config.cjs +0 -0
  7. package/docs/config.js.html +0 -0
  8. package/docs/fonts/Montserrat/Montserrat-Bold.eot +0 -0
  9. package/docs/fonts/Montserrat/Montserrat-Bold.ttf +0 -0
  10. package/docs/fonts/Montserrat/Montserrat-Bold.woff +0 -0
  11. package/docs/fonts/Montserrat/Montserrat-Bold.woff2 +0 -0
  12. package/docs/fonts/Montserrat/Montserrat-Regular.eot +0 -0
  13. package/docs/fonts/Montserrat/Montserrat-Regular.ttf +0 -0
  14. package/docs/fonts/Montserrat/Montserrat-Regular.woff +0 -0
  15. package/docs/fonts/Montserrat/Montserrat-Regular.woff2 +0 -0
  16. package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.eot +0 -0
  17. package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.svg +0 -0
  18. package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.ttf +0 -0
  19. package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.woff +0 -0
  20. package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.woff2 +0 -0
  21. package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.eot +0 -0
  22. package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.svg +0 -0
  23. package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.ttf +0 -0
  24. package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.woff +0 -0
  25. package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.woff2 +0 -0
  26. package/docs/index.html +0 -0
  27. package/docs/module-Config.html +0 -0
  28. package/docs/module-Railcontent-Services.html +0 -0
  29. package/docs/module-Sanity-Services.html +0 -0
  30. package/docs/railcontent.js.html +0 -0
  31. package/docs/sanity.js.html +0 -0
  32. package/docs/scripts/collapse.js +0 -0
  33. package/docs/scripts/commonNav.js +0 -0
  34. package/docs/scripts/linenumber.js +0 -0
  35. package/docs/scripts/nav.js +0 -0
  36. package/docs/scripts/polyfill.js +0 -0
  37. package/docs/scripts/prettify/Apache-License-2.0.txt +0 -0
  38. package/docs/scripts/prettify/lang-css.js +0 -0
  39. package/docs/scripts/prettify/prettify.js +0 -0
  40. package/docs/scripts/search.js +0 -0
  41. package/docs/styles/jsdoc.css +0 -0
  42. package/docs/styles/prettify.css +0 -0
  43. package/jest.config.js +0 -0
  44. package/jsdoc.json +0 -0
  45. package/package.json +1 -1
  46. package/src/contentMetaData.js +90 -0
  47. package/src/contentTypeConfig.js +24 -0
  48. package/src/filterBuilder.js +0 -0
  49. package/src/index.d.ts +250 -227
  50. package/src/index.js +249 -226
  51. package/src/services/config.js +0 -0
  52. package/src/services/contentLikes.js +0 -0
  53. package/src/services/contentProgress.js +0 -0
  54. package/src/services/dataContext.js +0 -0
  55. package/src/services/lastUpdated.js +0 -0
  56. package/src/services/railcontent.js +1 -1
  57. package/src/services/sanity.js +112 -10
  58. package/src/services/userPermissions.js +0 -0
  59. package/test/contentLikes.test.js +0 -0
  60. package/test/contentProgress.test.js +0 -0
  61. package/test/initializeTests.js +0 -0
  62. package/test/lastUpdated.test.js +0 -0
  63. package/test/live/contentProgressLive.test.js +0 -0
  64. package/test/live/railcontentLive.test.js +0 -0
  65. package/test/localStorageMock.js +0 -0
  66. package/test/log.js +0 -0
  67. package/test/sanityQueryService.test.js +23 -0
  68. package/test/userPermissions.test.js +0 -0
  69. package/tools/generate-index.cjs +0 -0
  70. 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
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
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/jest.config.js CHANGED
File without changes
package/jsdoc.json CHANGED
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "musora-content-services",
3
- "version": "1.3.3",
3
+ "version": "1.3.7",
4
4
  "description": "A package for Musoras content services ",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
@@ -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',
@@ -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',
File without changes