musora-content-services 1.0.130 → 1.0.132

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 (59) hide show
  1. package/.github/workflows/node.js.yml +0 -0
  2. package/CHANGELOG.md +4 -0
  3. package/README.md +0 -0
  4. package/babel.config.js +0 -0
  5. package/docs/config.js.html +0 -0
  6. package/docs/fonts/Montserrat/Montserrat-Bold.eot +0 -0
  7. package/docs/fonts/Montserrat/Montserrat-Bold.ttf +0 -0
  8. package/docs/fonts/Montserrat/Montserrat-Bold.woff +0 -0
  9. package/docs/fonts/Montserrat/Montserrat-Bold.woff2 +0 -0
  10. package/docs/fonts/Montserrat/Montserrat-Regular.eot +0 -0
  11. package/docs/fonts/Montserrat/Montserrat-Regular.ttf +0 -0
  12. package/docs/fonts/Montserrat/Montserrat-Regular.woff +0 -0
  13. package/docs/fonts/Montserrat/Montserrat-Regular.woff2 +0 -0
  14. package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.eot +0 -0
  15. package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.svg +0 -0
  16. package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.ttf +0 -0
  17. package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.woff +0 -0
  18. package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.woff2 +0 -0
  19. package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.eot +0 -0
  20. package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.svg +0 -0
  21. package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.ttf +0 -0
  22. package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.woff +0 -0
  23. package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.woff2 +0 -0
  24. package/docs/index.html +0 -0
  25. package/docs/module-Config.html +0 -0
  26. package/docs/module-Railcontent-Services.html +0 -0
  27. package/docs/module-Sanity-Services.html +0 -0
  28. package/docs/railcontent.js.html +0 -0
  29. package/docs/sanity.js.html +0 -0
  30. package/docs/scripts/collapse.js +0 -0
  31. package/docs/scripts/commonNav.js +0 -0
  32. package/docs/scripts/linenumber.js +0 -0
  33. package/docs/scripts/nav.js +0 -0
  34. package/docs/scripts/polyfill.js +0 -0
  35. package/docs/scripts/prettify/Apache-License-2.0.txt +0 -0
  36. package/docs/scripts/prettify/lang-css.js +0 -0
  37. package/docs/scripts/prettify/prettify.js +0 -0
  38. package/docs/scripts/search.js +0 -0
  39. package/docs/styles/jsdoc.css +0 -0
  40. package/docs/styles/prettify.css +0 -0
  41. package/jest.config.js +0 -0
  42. package/jsdoc.json +0 -0
  43. package/link_mcs.sh +0 -0
  44. package/package.json +1 -1
  45. package/src/contentMetaData.js +0 -0
  46. package/src/contentTypeConfig.js +0 -0
  47. package/src/filterBuilder.js +0 -0
  48. package/src/index.d.ts +0 -0
  49. package/src/index.js +0 -0
  50. package/src/services/config.js +0 -0
  51. package/src/services/contentLikes.js +0 -0
  52. package/src/services/dataContext.js +0 -0
  53. package/src/services/railcontent.js +0 -0
  54. package/src/services/sanity.js +10 -14
  55. package/test/contentLikes.test.js +0 -0
  56. package/test/localStorageMock.js +0 -0
  57. package/test/log.js +0 -0
  58. package/test/sanityQueryService.test.js +0 -0
  59. 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.132](https://github.com/railroadmedia/musora-content-services/compare/v1.0.131...v1.0.132) (2024-10-10)
6
+
7
+ ### [1.0.131](https://github.com/railroadmedia/musora-content-services/compare/v1.0.130...v1.0.131) (2024-10-10)
8
+
5
9
  ### [1.0.130](https://github.com/railroadmedia/musora-content-services/compare/v1.0.129...v1.0.130) (2024-10-09)
6
10
 
7
11
  ### [1.0.129](https://github.com/railroadmedia/musora-content-services/compare/v1.0.127...v1.0.129) (2024-10-09)
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
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/link_mcs.sh CHANGED
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "musora-content-services",
3
- "version": "1.0.130",
3
+ "version": "1.0.132",
4
4
  "description": "A package for Musoras content services ",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
File without changes
File without changes
File without changes
package/src/index.d.ts CHANGED
File without changes
package/src/index.js CHANGED
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -518,7 +518,7 @@ export async function fetchAll(brand, type, {
518
518
  const webUrlPath = 'artists';
519
519
  const lessonsFilter = `_type == '${type}' && brand == '${brand}' && ^._id == ${groupBy}._ref ${searchFilter} ${includedFieldsFilter} ${progressFilter}`;
520
520
  entityFieldsString = `
521
- 'id': _id,
521
+ 'id': railcontent_id,
522
522
  'type': _type,
523
523
  name,
524
524
  'head_shot_picture_url': thumbnail_url.asset->url,
@@ -534,7 +534,7 @@ export async function fetchAll(brand, type, {
534
534
  const webUrlPath = (groupBy == 'genre')?'/genres':'';
535
535
  const lessonsFilter = `brand == '${brand}' && ^._id in ${groupBy}[]._ref ${typeFilter} ${searchFilter} ${includedFieldsFilter} ${progressFilter}`;
536
536
  entityFieldsString = `
537
- 'id': _id,
537
+ 'id': railcontent_id,
538
538
  'type': _type,
539
539
  name,
540
540
  'head_shot_picture_url': thumbnail_url.asset->url,
@@ -927,19 +927,15 @@ export async function fetchLessonContent(railContentId) {
927
927
  chapter_timecode,
928
928
  "chapter_thumbnail_url": chapter_thumbnail_url.asset->url
929
929
  },
930
- "coaches": instructor[]-> {
931
- name,
932
- "id":_id,
933
- "coach_profile_image":thumbnail_url.asset->url
934
- },
935
930
  "instructors":instructor[]->name,
936
931
  "instructor": instructor[]->{
937
- "id":_id,
932
+ "id":railcontent_id,
938
933
  name,
939
934
  short_bio,
940
935
  "biography": short_bio[0].children[0].text,
941
936
  web_url_path,
942
937
  "coach_card_image": coach_card_image.asset->url,
938
+ "coach_profile_image":thumbnail_url.asset->url
943
939
  },
944
940
  ${assignmentsField}
945
941
  video,
@@ -971,11 +967,11 @@ export async function fetchRelatedLessons(railContentId, brand) {
971
967
  _type, parent_type, railcontent_id,
972
968
  "related_lessons" : array::unique([
973
969
  ...(*[references(^._id)][0].child[]->{_id, "id":railcontent_id, published_on, title, "thumbnail_url":thumbnail.asset->url, difficulty_string, railcontent_id, artist->,"permission_id": permission[]->railcontent_id,_type}),
974
- ...(*[_type=="song" && _type==^._type && brand == "${brand}" && references(^.artist->_id) && railcontent_id !=${railContentId}]{_id, "id":railcontent_id, published_on, title, "thumbnail_url":thumbnail.asset->url, difficulty_string, railcontent_id, artist->,"permission_id": permission[]->railcontent_id,_type}|order(published_on desc, title asc)[0...11]),
975
- ...(*[_type=="song" && _type==^._type && brand == "${brand}" && references(^.genre[]->_id) && railcontent_id !=${railContentId}]{_id, "id":railcontent_id, published_on, title, "thumbnail_url":thumbnail.asset->url, difficulty_string, railcontent_id, artist->,"permission_id": permission[]->railcontent_id,_type}|order(published_on desc, title asc)[0...11]),
976
- ...(*[_type==^._type && _type in ${JSON.stringify(typeWithSortOrder)} && brand == "${brand}" && railcontent_id !=${railContentId}]{_id, "id":railcontent_id, published_on, title, "thumbnail_url":thumbnail.asset->url, difficulty_string, railcontent_id, artist->,"permission_id": permission[]->railcontent_id,_type, sort}|order(sort asc, title asc)[0...11]),
977
- ...(*[_type==^._type && !(_type in ${JSON.stringify(typeWithSortOrder)}) && brand == "${brand}" && railcontent_id !=${railContentId}]{_id, "id":railcontent_id, published_on, title, "thumbnail_url":thumbnail.asset->url, difficulty_string, railcontent_id, artist->,"permission_id": permission[]->railcontent_id,_type}|order(published_on desc, title asc)[0...11]),
978
- ])[0...11]}`;
970
+ ...(*[_type=="song" && _type==^._type && brand == "${brand}" && references(^.artist->_id) && railcontent_id !=${railContentId}]{_id, "id":railcontent_id, published_on, title, "thumbnail_url":thumbnail.asset->url, difficulty_string, railcontent_id, artist->,"permission_id": permission[]->railcontent_id,_type}|order(published_on desc, title asc)[0...10]),
971
+ ...(*[_type=="song" && _type==^._type && brand == "${brand}" && references(^.genre[]->_id) && railcontent_id !=${railContentId}]{_id, "id":railcontent_id, published_on, title, "thumbnail_url":thumbnail.asset->url, difficulty_string, railcontent_id, artist->,"permission_id": permission[]->railcontent_id,_type}|order(published_on desc, title asc)[0...10]),
972
+ ...(*[_type==^._type && _type in ${JSON.stringify(typeWithSortOrder)} && brand == "${brand}" && railcontent_id !=${railContentId}]{_id, "id":railcontent_id, published_on, title, "thumbnail_url":thumbnail.asset->url, difficulty_string, railcontent_id, artist->,"permission_id": permission[]->railcontent_id,_type, sort}|order(sort asc, title asc)[0...10]),
973
+ ...(*[_type==^._type && !(_type in ${JSON.stringify(typeWithSortOrder)}) && !(defined(parent_type)) && brand == "${brand}" && railcontent_id !=${railContentId}]{_id, "id":railcontent_id, published_on, title, "thumbnail_url":thumbnail.asset->url, difficulty_string, railcontent_id, artist->,"permission_id": permission[]->railcontent_id,_type}|order(published_on desc, title asc)[0...10]),
974
+ ])[0...10]}`;
979
975
 
980
976
  return fetchSanity(query, false);
981
977
  }
@@ -1377,7 +1373,7 @@ async function needsAccessDecorator(results)
1377
1373
  function doesUserNeedAccessToContent(result, userPermissions)
1378
1374
  {
1379
1375
  const permissions = new Set(result?.permission_id ?? []);
1380
- if (permissions.length === 0) {
1376
+ if (permissions.size === 0) {
1381
1377
  return false;
1382
1378
  }
1383
1379
  for (let permission of permissions) {
File without changes
File without changes
package/test/log.js CHANGED
File without changes
File without changes
File without changes