musora-content-services 1.6.6 → 1.6.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 (46) hide show
  1. package/.github/workflows/node.js.yml +0 -0
  2. package/.prettierignore +0 -0
  3. package/.prettierrc +0 -0
  4. package/.yarnrc.yml +1 -0
  5. package/CHANGELOG.md +7 -0
  6. package/babel.config.cjs +0 -0
  7. package/docs/fonts/Montserrat/Montserrat-Bold.eot +0 -0
  8. package/docs/fonts/Montserrat/Montserrat-Bold.ttf +0 -0
  9. package/docs/fonts/Montserrat/Montserrat-Bold.woff +0 -0
  10. package/docs/fonts/Montserrat/Montserrat-Bold.woff2 +0 -0
  11. package/docs/fonts/Montserrat/Montserrat-Regular.eot +0 -0
  12. package/docs/fonts/Montserrat/Montserrat-Regular.ttf +0 -0
  13. package/docs/fonts/Montserrat/Montserrat-Regular.woff +0 -0
  14. package/docs/fonts/Montserrat/Montserrat-Regular.woff2 +0 -0
  15. package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.eot +0 -0
  16. package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.svg +0 -0
  17. package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.ttf +0 -0
  18. package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.woff +0 -0
  19. package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.woff2 +0 -0
  20. package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.eot +0 -0
  21. package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.svg +0 -0
  22. package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.ttf +0 -0
  23. package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.woff +0 -0
  24. package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.woff2 +0 -0
  25. package/docs/scripts/collapse.js +0 -0
  26. package/docs/scripts/commonNav.js +0 -0
  27. package/docs/scripts/linenumber.js +0 -0
  28. package/docs/scripts/nav.js +0 -0
  29. package/docs/scripts/polyfill.js +0 -0
  30. package/docs/scripts/prettify/Apache-License-2.0.txt +0 -0
  31. package/docs/scripts/prettify/lang-css.js +0 -0
  32. package/docs/scripts/prettify/prettify.js +0 -0
  33. package/docs/scripts/search.js +0 -0
  34. package/docs/styles/jsdoc.css +0 -0
  35. package/docs/styles/prettify.css +0 -0
  36. package/jest.config.js +0 -0
  37. package/package.json +1 -1
  38. package/src/services/imageSRCVerify.js +0 -0
  39. package/src/services/sanity.js +5 -2
  40. package/test/dataContext.test.js +0 -0
  41. package/test/imageSRCBuilder.test.js +0 -0
  42. package/test/imageSRCVerify.test.js +0 -0
  43. package/test/live/contentProgressLive.test.js +0 -0
  44. package/test/live/railcontentLive.test.js +0 -0
  45. package/test/localStorageMock.js +0 -0
  46. package/test/log.js +0 -0
File without changes
package/.prettierignore CHANGED
File without changes
package/.prettierrc CHANGED
File without changes
package/.yarnrc.yml ADDED
@@ -0,0 +1 @@
1
+ nodeLinker: node-modules
package/CHANGELOG.md CHANGED
@@ -2,6 +2,13 @@
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.6.7](https://github.com/railroadmedia/musora-content-services/compare/v1.6.3...v1.6.7) (2025-07-01)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * (BR-286) fetchLessonContent for users without access ([74d8663](https://github.com/railroadmedia/musora-content-services/commit/74d8663bc1ae63dbbabb697f55b7f3ed63739f4f))
11
+
5
12
  ### [1.6.6](https://github.com/railroadmedia/musora-content-services/compare/v1.6.5...v1.6.6) (2025-06-26)
6
13
 
7
14
  ### [1.6.5](https://github.com/railroadmedia/musora-content-services/compare/v1.6.4...v1.6.5) (2025-06-17)
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
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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "musora-content-services",
3
- "version": "1.6.6",
3
+ "version": "1.6.7",
4
4
  "description": "A package for Musoras content services ",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
File without changes
@@ -405,7 +405,7 @@ export async function fetchUpcomingEvents(brand, { page = 1, limit = 10 } = {})
405
405
  "type": _type,
406
406
  web_url_path,
407
407
  "permission_id": permission[]->railcontent_id,
408
- event_calendar_unique_key`
408
+ addevent_unique_key`
409
409
  const query = buildRawQuery(
410
410
  `_type in ${typesString} && brand == '${brand}' && published_on > '${now}' && status == 'scheduled'`,
411
411
  fields,
@@ -1293,7 +1293,7 @@ export async function fetchLessonContent(railContentId) {
1293
1293
  isSingle: true,
1294
1294
  })
1295
1295
  const chapterProcess = (result) => {
1296
- const chapters = result.chapters ?? []
1296
+ const chapters = result?.chapters ?? []
1297
1297
  if (chapters.length == 0) return result
1298
1298
  result.chapters = chapters.map((chapter, index) => ({
1299
1299
  ...chapter,
@@ -1995,6 +1995,9 @@ export async function fetchSanity(
1995
1995
  }
1996
1996
 
1997
1997
  function needsAccessDecorator(results, userPermissions, isAdmin) {
1998
+ if (!results || (Array.isArray(results) && results.length === 0)) {
1999
+ return results; // nothing to decorate
2000
+ }
1998
2001
  userPermissions = new Set(userPermissions)
1999
2002
 
2000
2003
  if (Array.isArray(results)) {
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
package/test/log.js CHANGED
File without changes