musora-content-services 2.36.4 → 2.37.0

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/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
+ ## [2.37.0](https://github.com/railroadmedia/musora-content-services/compare/v2.36.4...v2.37.0) (2025-09-10)
6
+
7
+
8
+ ### Features
9
+
10
+ * fix navigateTo for packs without progress, restrict pack access to allowed packs ([#444](https://github.com/railroadmedia/musora-content-services/issues/444)) ([5807c54](https://github.com/railroadmedia/musora-content-services/commit/5807c5496209dcdbbbe9820ce8ecdb30dab74c54))
11
+
5
12
  ### [2.36.4](https://github.com/railroadmedia/musora-content-services/compare/v2.36.3...v2.36.4) (2025-09-10)
6
13
 
7
14
  ### [2.36.3](https://github.com/railroadmedia/musora-content-services/compare/v2.36.2...v2.36.3) (2025-09-09)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "musora-content-services",
3
- "version": "2.36.4",
3
+ "version": "2.37.0",
4
4
  "description": "A package for Musoras content services ",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
@@ -115,10 +115,10 @@ export async function getNavigateTo(data) {
115
115
  const contentState = await getProgressState(content.id)
116
116
  if (contentState !== STATE_STARTED) {
117
117
  const firstChild = content.children[0]
118
- let lastInteractedChildNavToData =
119
- (await getNavigateTo([firstChild])[firstChild.id]) ?? null
118
+ let lastInteractedChildNavToData = await getNavigateTo([firstChild])
119
+ lastInteractedChildNavToData = lastInteractedChildNavToData[firstChild.id] ?? null
120
120
  navigateToData[content.id] = buildNavigateTo(
121
- content.children[0],
121
+ firstChild,
122
122
  lastInteractedChildNavToData
123
123
  )
124
124
  } else {
File without changes
@@ -1450,7 +1450,8 @@ export async function fetchLiveEvent(brand, forcedContentId = null) {
1450
1450
  * .catch(error => console.error(error));
1451
1451
  */
1452
1452
  export async function fetchPackData(id) {
1453
- const query = `*[railcontent_id == ${id}]{
1453
+ const builder = await new FilterBuilder(`railcontent_id == ${id}`).buildFilter()
1454
+ const query = `*[${builder}]{
1454
1455
  ${await getFieldsForContentTypeWithFilteredChildren('pack')}
1455
1456
  } [0...1]`
1456
1457
  return fetchSanity(query, false)
@@ -2183,7 +2184,7 @@ export async function fetchTabData(
2183
2184
  const lessonCountFilter = await new FilterBuilder(`_id in ^.child[]._ref`).buildFilter()
2184
2185
  entityFieldsString =
2185
2186
  ` ${fieldsString}
2186
- 'children': child[${childrenFilter}]->{ ${childrenFields} },
2187
+ 'children': child[${childrenFilter}]->{ ${childrenFields} 'children': child[${childrenFilter}]->{ ${childrenFields} }, },
2187
2188
  'isLive': live_event_start_time <= "${now}" && live_event_end_time >= "${now}",
2188
2189
  'lesson_count': coalesce(count(*[${lessonCountFilter}]), 0),
2189
2190
  'length_in_seconds': coalesce(