musora-content-services 2.60.1 → 2.61.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,27 @@
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.61.0](https://github.com/railroadmedia/musora-content-services/compare/v2.60.2...v2.61.0) (2025-10-29)
6
+
7
+
8
+ ### Features
9
+
10
+ * **BEH-1358:** Fetch all methods ([#511](https://github.com/railroadmedia/musora-content-services/issues/511)) ([4778770](https://github.com/railroadmedia/musora-content-services/commit/47787704ef8c835ac05ecee88313f0f02cf01109))
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * add client platform header for mobile requests ([#512](https://github.com/railroadmedia/musora-content-services/issues/512)) ([23e0eaa](https://github.com/railroadmedia/musora-content-services/commit/23e0eaab439aba231ff04b41b13c5440704779a2))
16
+
17
+ ### [2.60.2](https://github.com/railroadmedia/musora-content-services/compare/v2.60.0...v2.60.2) (2025-10-27)
18
+
19
+
20
+ ### Bug Fixes
21
+
22
+ * **MU2-1075:** Merge pull request [#510](https://github.com/railroadmedia/musora-content-services/issues/510) from railroadmedia/MU2-1075-scheduled-states ([baefd2c](https://github.com/railroadmedia/musora-content-services/commit/baefd2c4acda9d685176690bf1360b0b72e9f730))
23
+ * **T3PS-865:** Update CustomerOrder from customer_url to status_url ([df46b99](https://github.com/railroadmedia/musora-content-services/commit/df46b991b9cd312d6e70a1d8ec5e5ef92400e363))
24
+ * **T3PS:** Update docs ([fd49e25](https://github.com/railroadmedia/musora-content-services/commit/fd49e25c9468f51f2982b0406efd514092a228b7))
25
+
5
26
  ### [2.60.1](https://github.com/railroadmedia/musora-content-services/compare/v2.60.0...v2.60.1) (2025-10-24)
6
27
 
7
28
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "musora-content-services",
3
- "version": "2.60.1",
3
+ "version": "2.61.0",
4
4
  "description": "A package for Musoras content services ",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
@@ -579,9 +579,56 @@ export let contentTypeConfig = {
579
579
  `quarter_removed`,
580
580
  '"thumbnail": thumbnail.asset->url',
581
581
  ]
582
- }
582
+ },
583
+ "method-v2": [
584
+ `"id":_id`,
585
+ `"type":_type`,
586
+ "brand",
587
+ `"intro_video": intro_video->{ ${getIntroVideoFields().join(", ")} }`,
588
+ `child[]->{
589
+ "resource": ${resourcesField},
590
+ total_skills,
591
+ "difficulty":difficulty,
592
+ "published_on":published_on,
593
+ "type":_type,
594
+ brand,
595
+ title,
596
+ "description": ${descriptionField},
597
+ "thumbnail": thumbnail.asset->url,
598
+ length_in_seconds,
599
+ "intro_video": intro_video->{
600
+ external_id,
601
+ hlsManifestUrl,
602
+ video_playback_endpoints
603
+ },
604
+ lp_lessons[]->{
605
+ ${DEFAULT_FIELDS.join(',')}
606
+ }
607
+ }`,
608
+ ],
609
+ "method-v2-intro-video": getIntroVideoFields(),
610
+ }
611
+
612
+ export function getIntroVideoFields() {
613
+ return [
614
+ "brand",
615
+ `"description": ${descriptionField}`,
616
+ `"thumbnail": thumbnail.asset->url`,
617
+ "length_in_seconds",
618
+ `video_desktop {
619
+ external_id,
620
+ hlsManifestUrl,
621
+ video_playback_endpoints
622
+ }`,
623
+ `video_mobile {
624
+ external_id,
625
+ hlsManifestUrl,
626
+ video_playback_endpoints
627
+ }`
628
+ ];
583
629
  }
584
630
 
631
+
585
632
  export const plusMembershipPermissions = 92
586
633
 
587
634
  export function getNewReleasesTypes(brand) {
@@ -109,17 +109,12 @@ export class FilterBuilder {
109
109
  ) {
110
110
  // we must pull in future content here, otherwise we'll restrict on content this is published in the past and remove any scheduled content
111
111
  this.pullFutureContent = true
112
- const now = this._getRoundedTime().toISOString()
113
- let statuses = [...this.availableContentStatuses]
114
- statuses.splice(statuses.indexOf(this.STATUS_SCHEDULED), 1)
115
- this._andWhere(
116
- `(${this.prefix}status in ${arrayToStringRepresentation(statuses)} || (${this.prefix}status == '${this.STATUS_SCHEDULED}' && defined(${this.prefix}live_event_end_date) && ${this.prefix}live_event_end_date <= '${now}'))`
117
- )
118
- } else {
119
- this._andWhere(
120
- `${this.prefix}status in ${arrayToStringRepresentation(this.availableContentStatuses)}`
121
- )
122
112
  }
113
+
114
+ this._andWhere(
115
+ `${this.prefix}status in ${arrayToStringRepresentation(this.availableContentStatuses)}`
116
+ )
117
+
123
118
  return this
124
119
  }
125
120
 
package/src/index.d.ts CHANGED
@@ -213,6 +213,7 @@ import {
213
213
  fetchCommentModContentData,
214
214
  fetchContentRows,
215
215
  fetchFoundation,
216
+ fetchFullMethodV2StructureFor,
216
217
  fetchGenreLessons,
217
218
  fetchHierarchy,
218
219
  fetchLeaving,
@@ -436,6 +437,7 @@ declare module 'musora-content-services' {
436
437
  fetchFollowedThreads,
437
438
  fetchForumCategories,
438
439
  fetchFoundation,
440
+ fetchFullMethodV2StructureFor,
439
441
  fetchGenreLessons,
440
442
  fetchHandler,
441
443
  fetchHierarchy,
package/src/index.js CHANGED
@@ -213,6 +213,7 @@ import {
213
213
  fetchCommentModContentData,
214
214
  fetchContentRows,
215
215
  fetchFoundation,
216
+ fetchFullMethodV2StructureFor,
216
217
  fetchGenreLessons,
217
218
  fetchHierarchy,
218
219
  fetchLeaving,
@@ -435,6 +436,7 @@ export {
435
436
  fetchFollowedThreads,
436
437
  fetchForumCategories,
437
438
  fetchFoundation,
439
+ fetchFullMethodV2StructureFor,
438
440
  fetchGenreLessons,
439
441
  fetchHandler,
440
442
  fetchHierarchy,
@@ -13,6 +13,10 @@ export class DefaultHeaderProvider implements HeaderProvider {
13
13
  headers['M-Client-Timezone'] = globalConfig.localTimezoneString
14
14
  }
15
15
 
16
+ if (globalConfig.isMA) {
17
+ headers['X-Client-Platform'] = 'mobile'
18
+ }
19
+
16
20
  return headers
17
21
  }
18
22
  }
@@ -9,6 +9,7 @@ import {
9
9
  descriptionField,
10
10
  resourcesField,
11
11
  contentTypeConfig,
12
+ getIntroVideoFields,
12
13
  DEFAULT_FIELDS,
13
14
  getFieldsForContentType,
14
15
  filtersToGroq,
@@ -373,7 +374,7 @@ export async function fetchUpcomingEvents(brand, { page = 1, limit = 10 } = {})
373
374
  live_event_end_time,
374
375
  "isLive": live_event_start_time <= '${now}' && live_event_end_time >= '${now}'`
375
376
  const query = buildRawQuery(
376
- `defined(live_event_start_time) && (!defined(live_event_end_time) || live_event_end_time >= '${now}' ) && brand == '${brand}' && published_on > '${now}' && status == 'scheduled'`,
377
+ `defined(live_event_start_time) && live_event_start_time >= '${now}' && (!defined(live_event_end_time) || live_event_end_time >= '${now}' ) && brand == '${brand}' && status == 'scheduled'`,
377
378
  fields,
378
379
  {
379
380
  sortOrder: 'published_on asc',
@@ -2243,7 +2244,7 @@ export async function fetchScheduledAndNewReleases(
2243
2244
  const sortOrder = getSortOrder(sort, brand)
2244
2245
 
2245
2246
  const query = `
2246
- *[_type in [${typesString}] && brand == '${brand}' && ((status in ['published','scheduled'] && published_on > '${now}')||(show_in_new_feed == true)) ]
2247
+ *[_type in [${typesString}] && brand == '${brand}' && ((status in ['published','scheduled'] )||(show_in_new_feed == true)) ]
2247
2248
  [${start}...${end}]
2248
2249
  | order(published_on asc) {
2249
2250
  "id": railcontent_id,
@@ -2277,17 +2278,22 @@ export async function fetchShows(brand, type, sort = 'sort') {
2277
2278
  return fetchSanity(query, true)
2278
2279
  }
2279
2280
 
2281
+
2280
2282
  export async function fetchMethodV2IntroVideo(brand) {
2281
- const _type = 'method-intro'
2283
+ const _type = "method-intro";
2282
2284
  const filter = `_type == '${_type}' && brand == '${brand}'`;
2283
- const query =`*[${filter}] {
2284
- brand,
2285
- 'description': ${descriptionField},
2286
- 'thumbnail': thumbnail.asset->url,
2287
- video_desktop{external_id, hlsManifestUrl, video_playback_endpoints},
2288
- video_mobile{external_id, hlsManifestUrl, video_playback_endpoints},
2289
- length_in_seconds,
2290
- }`
2285
+ const fields = getIntroVideoFields();
2291
2286
 
2292
- return fetchSanity(query, false)
2287
+ const query = `*[${filter}] { ${fields.join(", ")} }`;
2288
+ return fetchSanity(query, false);
2289
+ }
2290
+
2291
+ export async function fetchFullMethodV2StructureFor(brand) {
2292
+ const _type = "method-v2";
2293
+ const filter = `_type == '${_type}' && brand == '${brand}'`;
2294
+
2295
+ const fields = contentTypeConfig[_type];
2296
+ const query = `*[${filter}] { ${fields.join(",")} }`;
2297
+
2298
+ return await fetchSanity(query, true);
2293
2299
  }