musora-content-services 2.95.0 → 2.95.2

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 (208) hide show
  1. package/.claude/settings.local.json +18 -0
  2. package/.coderabbit.yaml +0 -0
  3. package/.editorconfig +0 -0
  4. package/.github/pull_request_template.md +0 -0
  5. package/.github/workflows/conventional-commits.yaml +0 -0
  6. package/.github/workflows/docs.js.yml +0 -0
  7. package/.github/workflows/node.js.yml +0 -0
  8. package/.prettierignore +0 -0
  9. package/.prettierrc +0 -0
  10. package/CHANGELOG.md +4 -0
  11. package/CLAUDE.md +0 -0
  12. package/README.md +0 -0
  13. package/babel.config.cjs +0 -0
  14. package/jest.config.js +0 -0
  15. package/jsdoc.json +0 -0
  16. package/package.json +1 -1
  17. package/src/constants/award-assets.js +0 -0
  18. package/src/contentMetaData.js +0 -0
  19. package/src/filterBuilder.js +0 -0
  20. package/src/index.d.ts +0 -0
  21. package/src/index.js +0 -0
  22. package/src/infrastructure/http/HttpClient.ts +0 -0
  23. package/src/infrastructure/http/executors/FetchRequestExecutor.ts +0 -0
  24. package/src/infrastructure/http/index.ts +0 -0
  25. package/src/infrastructure/http/interfaces/HeaderProvider.ts +0 -0
  26. package/src/infrastructure/http/interfaces/HttpError.ts +0 -0
  27. package/src/infrastructure/http/interfaces/NetworkError.ts +0 -0
  28. package/src/infrastructure/http/interfaces/RequestExecutor.ts +0 -0
  29. package/src/infrastructure/http/interfaces/RequestOptions.ts +0 -0
  30. package/src/infrastructure/http/providers/DefaultHeaderProvider.ts +0 -0
  31. package/src/lib/brands.ts +0 -0
  32. package/src/lib/httpHelper.js +0 -0
  33. package/src/lib/lastUpdated.js +0 -0
  34. package/src/lib/sanity/query.ts +0 -0
  35. package/src/services/api/types.js +0 -0
  36. package/src/services/api/types.ts +0 -0
  37. package/src/services/awards/award-callbacks.js +72 -33
  38. package/src/services/awards/award-query.js +257 -89
  39. package/src/services/awards/internal/.indexignore +0 -0
  40. package/src/services/awards/internal/award-definitions.js +0 -0
  41. package/src/services/awards/internal/award-events.js +0 -0
  42. package/src/services/awards/internal/award-manager.js +0 -0
  43. package/src/services/awards/internal/certificate-builder.js +0 -0
  44. package/src/services/awards/internal/completion-data-generator.js +0 -0
  45. package/src/services/awards/internal/content-progress-observer.js +0 -0
  46. package/src/services/awards/internal/image-utils.js +0 -0
  47. package/src/services/awards/internal/message-generator.js +0 -0
  48. package/src/services/awards/internal/types.js +0 -0
  49. package/src/services/awards/types.d.ts +0 -0
  50. package/src/services/awards/types.js +5 -5
  51. package/src/services/config.js +0 -0
  52. package/src/services/content/artist.ts +0 -0
  53. package/src/services/content/content.ts +0 -0
  54. package/src/services/content/genre.ts +0 -0
  55. package/src/services/content/instructor.ts +0 -0
  56. package/src/services/content-org/content-org.js +0 -0
  57. package/src/services/content-org/guided-courses.ts +0 -0
  58. package/src/services/content-org/learning-paths.ts +0 -0
  59. package/src/services/content-org/playlists-types.js +0 -0
  60. package/src/services/content-org/playlists.js +0 -0
  61. package/src/services/content.js +0 -0
  62. package/src/services/contentAggregator.js +0 -0
  63. package/src/services/contentLikes.js +0 -0
  64. package/src/services/contentProgress.js +0 -0
  65. package/src/services/dataContext.js +0 -0
  66. package/src/services/dateUtils.js +0 -0
  67. package/src/services/eventsAPI.js +0 -0
  68. package/src/services/forums/categories.ts +0 -0
  69. package/src/services/forums/forums.ts +0 -0
  70. package/src/services/forums/posts.ts +0 -0
  71. package/src/services/forums/threads.ts +0 -0
  72. package/src/services/forums/types.ts +0 -0
  73. package/src/services/gamification/awards.ts +0 -0
  74. package/src/services/gamification/gamification.js +0 -0
  75. package/src/services/imageSRCBuilder.js +0 -0
  76. package/src/services/imageSRCVerify.js +0 -0
  77. package/src/services/liveTesting.ts +0 -0
  78. package/src/services/permissions/PermissionsAdapter.ts +0 -0
  79. package/src/services/permissions/PermissionsAdapterFactory.ts +0 -0
  80. package/src/services/permissions/PermissionsV1Adapter.ts +0 -0
  81. package/src/services/permissions/PermissionsV2Adapter.ts +0 -0
  82. package/src/services/permissions/README.md +0 -0
  83. package/src/services/permissions/index.ts +0 -0
  84. package/src/services/progress-events.js +0 -0
  85. package/src/services/progress-row/method-card.js +0 -0
  86. package/src/services/railcontent.js +0 -0
  87. package/src/services/recommendations.js +0 -0
  88. package/src/services/reporting/README.md +0 -0
  89. package/src/services/reporting/reporting.ts +0 -0
  90. package/src/services/reporting/types.ts +0 -0
  91. package/src/services/sentry/.indexignore +0 -0
  92. package/src/services/sentry/index.ts +0 -0
  93. package/src/services/sync/.indexignore +0 -0
  94. package/src/services/sync/adapters/factory.ts +0 -0
  95. package/src/services/sync/adapters/lokijs.ts +0 -0
  96. package/src/services/sync/adapters/sqlite.ts +0 -0
  97. package/src/services/sync/concurrency-safety.ts +0 -0
  98. package/src/services/sync/context/index.ts +0 -0
  99. package/src/services/sync/context/providers/base.ts +0 -0
  100. package/src/services/sync/context/providers/connectivity.ts +0 -0
  101. package/src/services/sync/context/providers/durability.ts +0 -0
  102. package/src/services/sync/context/providers/index.ts +0 -0
  103. package/src/services/sync/context/providers/session.ts +0 -0
  104. package/src/services/sync/context/providers/tabs.ts +0 -0
  105. package/src/services/sync/context/providers/visibility.ts +0 -0
  106. package/src/services/sync/database/factory.ts +0 -0
  107. package/src/services/sync/errors/boundary.ts +0 -0
  108. package/src/services/sync/errors/index.ts +0 -0
  109. package/src/services/sync/fetch.ts +7 -1
  110. package/src/services/sync/index.ts +0 -0
  111. package/src/services/sync/manager.ts +0 -0
  112. package/src/services/sync/models/Base.ts +0 -0
  113. package/src/services/sync/models/ContentLike.ts +0 -0
  114. package/src/services/sync/models/ContentProgress.ts +0 -0
  115. package/src/services/sync/models/Practice.ts +0 -0
  116. package/src/services/sync/models/PracticeDayNote.ts +0 -0
  117. package/src/services/sync/models/UserAwardProgress.ts +0 -0
  118. package/src/services/sync/models/index.ts +0 -0
  119. package/src/services/sync/repositories/base.ts +0 -0
  120. package/src/services/sync/repositories/content-likes.ts +0 -0
  121. package/src/services/sync/repositories/content-progress.ts +0 -0
  122. package/src/services/sync/repositories/index.ts +0 -0
  123. package/src/services/sync/repositories/practice-day-notes.ts +0 -0
  124. package/src/services/sync/repositories/practices.ts +0 -0
  125. package/src/services/sync/repositories/user-award-progress.ts +1 -1
  126. package/src/services/sync/repository-proxy.ts +0 -0
  127. package/src/services/sync/resolver.ts +0 -0
  128. package/src/services/sync/retry.ts +0 -0
  129. package/src/services/sync/run-scope.ts +0 -0
  130. package/src/services/sync/schema/index.ts +0 -0
  131. package/src/services/sync/serializers/index.ts +0 -0
  132. package/src/services/sync/serializers/model.ts +0 -0
  133. package/src/services/sync/serializers/raw.ts +0 -0
  134. package/src/services/sync/store/index.ts +0 -0
  135. package/src/services/sync/store/push-coalescer.ts +0 -0
  136. package/src/services/sync/store-configs.ts +0 -0
  137. package/src/services/sync/strategies/base.ts +0 -0
  138. package/src/services/sync/strategies/index.ts +0 -0
  139. package/src/services/sync/strategies/initial.ts +0 -0
  140. package/src/services/sync/strategies/polling.ts +0 -0
  141. package/src/services/sync/telemetry/index.ts +0 -0
  142. package/src/services/sync/telemetry/sampling.ts +0 -0
  143. package/src/services/sync/utils/event-emitter.ts +0 -0
  144. package/src/services/sync/utils/index.ts +0 -0
  145. package/src/services/sync/utils/throttle.ts +0 -0
  146. package/src/services/sync/utils/timers.ts +0 -0
  147. package/src/services/types.js +0 -0
  148. package/src/services/user/account.ts +0 -0
  149. package/src/services/user/chat.js +0 -0
  150. package/src/services/user/interests.js +0 -0
  151. package/src/services/user/management.js +0 -0
  152. package/src/services/user/memberships.ts +0 -0
  153. package/src/services/user/notifications.js +0 -0
  154. package/src/services/user/onboarding.ts +0 -0
  155. package/src/services/user/payments.ts +0 -0
  156. package/src/services/user/permissions.js +0 -0
  157. package/src/services/user/profile.js +0 -0
  158. package/src/services/user/sessions.js +0 -0
  159. package/src/services/user/types.d.ts +0 -0
  160. package/src/services/user/types.js +0 -0
  161. package/src/services/user/user-management-system.js +0 -0
  162. package/src/services/userActivity.js +0 -0
  163. package/test/HttpClient.test.js +0 -0
  164. package/test/awards/award-alacarte-observer.test.js +0 -0
  165. package/test/awards/award-auto-refresh.test.js +0 -0
  166. package/test/awards/award-calculations.test.js +0 -0
  167. package/test/awards/award-certificate-display.test.js +0 -0
  168. package/test/awards/award-collection-edge-cases.test.js +0 -0
  169. package/test/awards/award-collection-filtering.test.js +0 -0
  170. package/test/awards/award-completion-flow.test.js +0 -0
  171. package/test/awards/award-exclusion-handling.test.js +0 -0
  172. package/test/awards/award-multi-lesson.test.js +0 -0
  173. package/test/awards/award-observer-integration.test.js +0 -0
  174. package/test/awards/award-query-messages.test.js +0 -0
  175. package/test/awards/award-user-collection.test.js +0 -0
  176. package/test/awards/duplicate-prevention.test.js +0 -0
  177. package/test/awards/helpers/completion-mock.js +0 -0
  178. package/test/awards/helpers/index.js +0 -0
  179. package/test/awards/helpers/mock-setup.js +0 -0
  180. package/test/awards/helpers/progress-emitter.js +0 -0
  181. package/test/awards/message-generator.test.js +0 -0
  182. package/test/content.test.js +0 -0
  183. package/test/contentLikes.test.js +0 -0
  184. package/test/contentProgress.test.js +0 -0
  185. package/test/dataContext.test.js +0 -0
  186. package/test/forum.test.js +0 -0
  187. package/test/imageSRCBuilder.test.js +0 -0
  188. package/test/imageSRCVerify.test.js +0 -0
  189. package/test/initializeTests.js +0 -0
  190. package/test/learningPaths.test.js +0 -0
  191. package/test/lib/lastUpdated.test.js +0 -0
  192. package/test/live/contentProgressLive.test.js +0 -0
  193. package/test/live/railcontentLive.test.js +0 -0
  194. package/test/localStorageMock.js +0 -0
  195. package/test/log.js +0 -0
  196. package/test/mockData/award-definitions.js +0 -0
  197. package/test/mockData/mockData_fetchByRailContentIds_one_content.json +0 -0
  198. package/test/mockData/mockData_progress_content.json +0 -0
  199. package/test/mockData/mockData_sanity_progress_content.json +0 -0
  200. package/test/mockData/mockData_user_practices.json +0 -0
  201. package/test/notifications.test.js +0 -0
  202. package/test/progressRows.test.js +0 -0
  203. package/test/sanityQueryService.test.js +0 -0
  204. package/test/streakMessage.test.js +0 -0
  205. package/test/sync/models/award-database-integration.test.js +0 -0
  206. package/test/user/permissions.test.js +0 -0
  207. package/test/userActivity.test.js +0 -0
  208. package/tools/generate-index.cjs +0 -0
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -6,14 +6,14 @@
6
6
  * @property {string|null} logo - URL to logo image
7
7
  * @property {string} badge - URL to badge image
8
8
  * @property {string} award - URL to award image
9
- * @property {number} content_id - Railcontent ID of the parent content
10
- * @property {string} content_type - Type of content (guided-course, learning-path-v2, etc.)
9
+ * @property {number} content_id - Railcontent ID of the parent content (e.g., the learning path ID)
10
+ * @property {string} content_type - Type of parent content ('learning-path-v2', 'guided-course', etc.). Used with content_id to determine collection context for award evaluation.
11
11
  * @property {string} type - Sanity document type
12
12
  * @property {string} brand - Brand (drumeo, pianote, guitareo, singeo)
13
13
  * @property {string} content_title - Title of the associated content
14
14
  * @property {string|null} award_custom_text - Custom text for the award
15
15
  * @property {string|null} instructor_name - Name of the instructor
16
- * @property {number[]} child_ids - Array of child content IDs required for completion
16
+ * @property {number[]} child_ids - Array of child content IDs (lessons) that must be completed to earn this award
17
17
  */
18
18
 
19
19
  /**
@@ -41,7 +41,7 @@
41
41
  * @property {string} award - URL to award image
42
42
  * @property {string} brand - Brand (drumeo, pianote, guitareo, singeo)
43
43
  * @property {string} instructorName - Name of the instructor
44
- * @property {number} progressPercentage - Completion percentage (0-100)
44
+ * @property {number} progressPercentage - Completion percentage (0-100). Progress is tracked per collection context for learning paths.
45
45
  * @property {boolean} isCompleted - Whether the award is fully completed
46
46
  * @property {string|null} completedAt - ISO timestamp of completion, or null if not completed
47
47
  * @property {AwardCompletionData|null} completionData - Practice statistics, or null if not started
@@ -50,7 +50,7 @@
50
50
  /**
51
51
  * @typedef {Object} ContentAwardsResponse
52
52
  * @property {boolean} hasAwards - Whether the content has any associated awards
53
- * @property {AwardInfo[]} awards - Array of award objects with progress information
53
+ * @property {AwardInfo[]} awards - Array of award objects with progress information. For learning paths, progress is scoped to the specific learning path context.
54
54
  */
55
55
 
56
56
  /**
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
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
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
@@ -308,7 +308,13 @@ function serializeIds(ids: { id: RecordId }): { client_record_id: RecordId } {
308
308
 
309
309
  function deserializeRecord(record: SyncSyncable<BaseModel, 'client_record_id'> | null): SyncSyncable<BaseModel, 'id'> | null {
310
310
  if (record) {
311
- const { client_record_id: id, ...rest } = record
311
+ const { client_record_id: id, ...rest } = record as any
312
+
313
+ if ('collection_type' in rest && rest.collection_type === 'self') {
314
+ rest.collection_type = null
315
+ rest.collection_id = null
316
+ }
317
+
312
318
  return {
313
319
  ...rest,
314
320
  id
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
@@ -15,7 +15,7 @@ export default class UserAwardProgressRepository extends SyncRepository<UserAwar
15
15
  }
16
16
 
17
17
  static isInProgress(progress: AwardProgressData): boolean {
18
- return progress.progress_percentage > 0 && !UserAwardProgressRepository.isCompleted(progress)
18
+ return progress.progress_percentage >= 0 && !UserAwardProgressRepository.isCompleted(progress)
19
19
  }
20
20
 
21
21
  static completedAtDate(progress: { completed_at: number | null }): Date | null {
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
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
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
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/test/log.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