musora-content-services 1.0.257 → 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.
Files changed (38) hide show
  1. package/.github/workflows/node.js.yml +0 -0
  2. package/CHANGELOG.md +2 -0
  3. package/babel.config.js +0 -0
  4. package/docs/fonts/Montserrat/Montserrat-Bold.eot +0 -0
  5. package/docs/fonts/Montserrat/Montserrat-Bold.ttf +0 -0
  6. package/docs/fonts/Montserrat/Montserrat-Bold.woff +0 -0
  7. package/docs/fonts/Montserrat/Montserrat-Bold.woff2 +0 -0
  8. package/docs/fonts/Montserrat/Montserrat-Regular.eot +0 -0
  9. package/docs/fonts/Montserrat/Montserrat-Regular.ttf +0 -0
  10. package/docs/fonts/Montserrat/Montserrat-Regular.woff +0 -0
  11. package/docs/fonts/Montserrat/Montserrat-Regular.woff2 +0 -0
  12. package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.eot +0 -0
  13. package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.svg +0 -0
  14. package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.ttf +0 -0
  15. package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.woff +0 -0
  16. package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.woff2 +0 -0
  17. package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.eot +0 -0
  18. package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.svg +0 -0
  19. package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.ttf +0 -0
  20. package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.woff +0 -0
  21. package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.woff2 +0 -0
  22. package/docs/scripts/collapse.js +0 -0
  23. package/docs/scripts/commonNav.js +0 -0
  24. package/docs/scripts/linenumber.js +0 -0
  25. package/docs/scripts/nav.js +0 -0
  26. package/docs/scripts/polyfill.js +0 -0
  27. package/docs/scripts/prettify/Apache-License-2.0.txt +0 -0
  28. package/docs/scripts/prettify/lang-css.js +0 -0
  29. package/docs/scripts/prettify/prettify.js +0 -0
  30. package/docs/scripts/search.js +0 -0
  31. package/docs/styles/jsdoc.css +0 -0
  32. package/docs/styles/prettify.css +0 -0
  33. package/jsdoc.json +0 -0
  34. package/link_mcs.sh +0 -0
  35. package/package.json +1 -1
  36. package/src/contentTypeConfig.js +22 -2
  37. package/src/services/config.js +2 -1
  38. package/src/services/sanity.js +3 -6
File without changes
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.258](https://github.com/railroadmedia/musora-content-services/compare/v1.0.257...v1.0.258) (2025-01-08)
6
+
5
7
  ### [1.0.257](https://github.com/railroadmedia/musora-content-services/compare/v1.0.256...v1.0.257) (2025-01-03)
6
8
 
7
9
  ### [1.0.256](https://github.com/railroadmedia/musora-content-services/compare/v1.0.255...v1.0.256) (2025-01-02)
package/babel.config.js 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/jsdoc.json CHANGED
File without changes
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.257",
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,
@@ -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
  };
@@ -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,