musora-content-services 1.0.256 → 1.0.258

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,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.258](https://github.com/railroadmedia/musora-content-services/compare/v1.0.257...v1.0.258) (2025-01-08)
6
+
7
+ ### [1.0.257](https://github.com/railroadmedia/musora-content-services/compare/v1.0.256...v1.0.257) (2025-01-03)
8
+
5
9
  ### [1.0.256](https://github.com/railroadmedia/musora-content-services/compare/v1.0.255...v1.0.256) (2025-01-02)
6
10
 
7
11
  ### [1.0.255](https://github.com/railroadmedia/musora-content-services/compare/v1.0.254...v1.0.255) (2025-01-02)
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.256",
3
+ "version": "1.0.258",
4
4
  "description": "A package for Musoras content services ",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -1,3 +1,6 @@
1
+ //import {AWSUrl, CloudFrontURl} from "./services/config";
2
+ const AWSUrl = 'https://s3.us-east-1.amazonaws.com/musora-web-platform';
3
+ const CloudFrontURl = 'https://d3fzm1tzeyr5n3.cloudfront.net';
1
4
  const DEFAULT_FIELDS = [
2
5
  "'sanity_id' : _id",
3
6
  "'id': railcontent_id",
@@ -20,11 +23,17 @@ const DEFAULT_FIELDS = [
20
23
  'status',
21
24
  "'slug' : slug.current",
22
25
  "'permission_id': permission[]->railcontent_id",
23
- "xp"
26
+ "xp",
27
+ "child_count"
24
28
  ];
25
29
 
26
30
  const descriptionField = 'description[0].children[0].text';
27
- const resourcesField = 'resource[]{resource_name, _key, "resource_url": coalesce(\'https://d3fzm1tzeyr5n3.cloudfront.net\'+string::split(resource_aws.asset->fileURL,\'https://s3.us-east-1.amazonaws.com/musora-web-platform\')[1], resource_url )}';
31
+ // this pulls both any defined resources for the document as well as any resources in the parent document
32
+ const resourcesField = `[
33
+ ... resource[]{resource_name, _key, "resource_url": coalesce('${CloudFrontURl}'+string::split(resource_aws.asset->fileURL, '${AWSUrl}')[1], resource_url )},
34
+ ... *[railcontent_id == ^.parent_content_data[0].id] [0].resource[]{resource_name, _key, "resource_url": coalesce('${CloudFrontURl}'+string::split(resource_aws.asset->fileURL, '${AWSUrl}')[1], resource_url )},
35
+ ]`;
36
+
28
37
 
29
38
  const assignmentsField = `"assignments":assignment[]{
30
39
  "id": railcontent_id,
@@ -90,6 +99,11 @@ let contentTypeConfig = {
90
99
  }
91
100
  },
92
101
  },
102
+ 'song-tutorial-children': {
103
+ 'fields': [
104
+ `"resources": ${resourcesField}`,
105
+ ],
106
+ },
93
107
  'challenge': {
94
108
  'fields': [
95
109
  'enrollment_start_time',
@@ -308,6 +322,11 @@ let contentTypeConfig = {
308
322
  'total_xp',
309
323
  ]
310
324
  },
325
+ 'pack-bundle-lesson': {
326
+ 'fields': [
327
+ `"resources": ${resourcesField}`,
328
+ ],
329
+ },
311
330
  'foundation': {
312
331
  'fields': [
313
332
  `"description": ${descriptionField}`,
@@ -529,6 +548,7 @@ function groupFilters(filters) {
529
548
  module.exports = {
530
549
  contentTypeConfig,
531
550
  descriptionField,
551
+ resourcesField,
532
552
  artistOrInstructorName,
533
553
  artistOrInstructorNameAsArray,
534
554
  getFieldsForContentType,
package/src/index.d.ts CHANGED
@@ -71,6 +71,7 @@ import {
71
71
  postChallengesHideCompletedBanner,
72
72
  postChallengesLeave,
73
73
  postChallengesSetStartDate,
74
+ postChallengesSoloNotification,
74
75
  postChallengesUnlock,
75
76
  postContentCompleted,
76
77
  postContentLiked,
@@ -257,6 +258,7 @@ declare module 'musora-content-services' {
257
258
  postChallengesHideCompletedBanner,
258
259
  postChallengesLeave,
259
260
  postChallengesSetStartDate,
261
+ postChallengesSoloNotification,
260
262
  postChallengesUnlock,
261
263
  postContentCompleted,
262
264
  postContentLiked,
package/src/index.js CHANGED
@@ -71,6 +71,7 @@ import {
71
71
  postChallengesHideCompletedBanner,
72
72
  postChallengesLeave,
73
73
  postChallengesSetStartDate,
74
+ postChallengesSoloNotification,
74
75
  postChallengesUnlock,
75
76
  postContentCompleted,
76
77
  postContentLiked,
@@ -256,6 +257,7 @@ export {
256
257
  postChallengesHideCompletedBanner,
257
258
  postChallengesLeave,
258
259
  postChallengesSetStartDate,
260
+ postChallengesSoloNotification,
259
261
  postChallengesUnlock,
260
262
  postContentCompleted,
261
263
  postContentLiked,
@@ -17,6 +17,7 @@ let globalConfig = {
17
17
  */
18
18
  const excludeFromGeneratedIndex = [];
19
19
 
20
+
20
21
  /**
21
22
  * Initializes the service with the given configuration.
22
23
  * This function must be called before using any other functions in this library.
@@ -71,5 +72,5 @@ function initializeService(config) {
71
72
  // Export both the initialization function and the config object
72
73
  module.exports = {
73
74
  initializeService,
74
- globalConfig
75
+ globalConfig,
75
76
  };
@@ -575,6 +575,17 @@ export async function postChallengesCommunityNotification(contentId) {
575
575
  return await fetchHandler(url, 'post');
576
576
  }
577
577
 
578
+ /**
579
+ * Enable solo notifications for the provided challenge
580
+ *
581
+ * @param {int|string} contentId - railcontent id of the challenge
582
+ * @returns {Promise<any|null>}
583
+ */
584
+ export async function postChallengesSoloNotification(contentId) {
585
+ let url = `/challenges/notifications/solo_reminders/${contentId}`;
586
+ return await fetchHandler(url, 'post');
587
+ }
588
+
578
589
  /**
579
590
  * Complete the challenge lesson and update challenge progress
580
591
  *
@@ -6,6 +6,7 @@ import {
6
6
  artistOrInstructorNameAsArray,
7
7
  assignmentsField,
8
8
  descriptionField,
9
+ resourcesField,
9
10
  contentTypeConfig,
10
11
  DEFAULT_FIELDS,
11
12
  getFieldsForContentType,
@@ -13,7 +14,7 @@ import {
13
14
  getUpcomingEventsTypes,
14
15
  showsTypes,
15
16
  getNewReleasesTypes,
16
- coachLessonsTypes
17
+ coachLessonsTypes,
17
18
  } from "../contentTypeConfig";
18
19
 
19
20
  import {
@@ -1179,11 +1180,7 @@ export async function fetchLessonContent(railContentId) {
1179
1180
  const fields = `title,
1180
1181
  published_on,
1181
1182
  "type":_type,
1182
- "resources": resource[]{resource_name, _key,
1183
- "resource_url": coalesce(
1184
- 'https://d3fzm1tzeyr5n3.cloudfront.net'+string::split(resource_aws.asset->fileURL,'https://s3.us-east-1.amazonaws.com/musora-web-platform')[1],
1185
- resource_url
1186
- )},
1183
+ "resources": ${resourcesField},
1187
1184
  difficulty,
1188
1185
  difficulty_string,
1189
1186
  brand,