musora-content-services 1.0.100 → 1.0.101

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,8 @@
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.101](https://github.com/railroadmedia/musora-content-services/compare/v1.0.100...v1.0.101) (2024-09-17)
6
+
5
7
  ### [1.0.100](https://github.com/railroadmedia/musora-content-services/compare/v1.0.99...v1.0.100) (2024-09-16)
6
8
 
7
9
  ### [1.0.99](https://github.com/railroadmedia/musora-content-services/compare/v1.0.98...v1.0.99) (2024-09-12)
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.100",
3
+ "version": "1.0.101",
4
4
  "description": "A package for Musoras content services ",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -46,6 +46,7 @@ const contentWithSortField = {
46
46
  let contentTypeConfig = {
47
47
  'song': {
48
48
  'fields': [
49
+ 'album',
49
50
  'soundslice',
50
51
  'instrumentless',
51
52
  ],
package/src/index.d.ts CHANGED
@@ -33,13 +33,14 @@ import {
33
33
  fetchGenreLessons,
34
34
  } from './services/sanity.js';
35
35
 
36
- import {
36
+ import {
37
37
  fetchCompletedState,
38
38
  fetchAllCompletedStates,
39
39
  fetchContentInProgress,
40
+ fetchCompletedContent,
40
41
  fetchVimeoData,
41
42
  fetchContentPageUserData,
42
- } from "./services/railcontent";
43
+ } from './services/railcontent.js';
43
44
 
44
45
  import { initializeService } from './services/config.js';
45
46
 
@@ -80,6 +81,7 @@ declare module 'musora-content-services' {
80
81
  fetchCompletedState,
81
82
  fetchAllCompletedStates,
82
83
  fetchContentInProgress,
84
+ fetchCompletedContent,
83
85
  fetchContentPageUserData,
84
86
  fetchScheduledReleases,
85
87
  fetchArtistLessons,
@@ -240,7 +240,7 @@ export async function fetchSongCount(brand) {
240
240
  * @example
241
241
  * fetchWorkouts('drumeo')
242
242
  * .then(workouts => console.log(workouts))
243
- * .catch(error => console.error(error));
243
+ * .catch(error => console.error(error));
244
244
  */
245
245
  export async function fetchWorkouts(brand) {
246
246
  const fields = getFieldsForContentType('workout');
@@ -887,6 +887,30 @@ export async function fetchRelatedLessons(railContentId, brand) {
887
887
  return fetchSanity(query, false);
888
888
  }
889
889
 
890
+ /**
891
+ * Fetch related method lessons for a specific lesson by RailContent ID and type.
892
+ * @param {string} railContentId - The RailContent ID of the current lesson.
893
+ * @param {string} brand - The current brand.
894
+ * @returns {Promise<Object>|null>} - The fetched related lessons
895
+ */
896
+ export async function fetchRelatedMethodLessons(railContentId, brand) {
897
+ const query = `*[railcontent_id == ${railContentId} && brand == "${brand}"]{
898
+ "id":_id,
899
+ "related_lessons": *[references(^._id)][0].child[]->{
900
+ "id": railcontent_id,
901
+ "type": _type,
902
+ title,
903
+ "description": description[0].children[0].text, // Extraer texto plano
904
+ "thumbnail_url": thumbnail.asset->url,
905
+ "url": web_url_path,
906
+ difficulty,
907
+ difficulty_string,
908
+ }
909
+ }
910
+ }`
911
+ return fetchSanity(query, false);
912
+ }
913
+
890
914
  /**
891
915
  * Fetch all packs.
892
916
  * @param {string} brand - The brand for which to fetch packs.