musora-content-services 2.164.6 → 2.165.1

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 (338) hide show
  1. package/.agent/decisions/2026-04-28-tma-275-mcs-sanity-add-a-v2-url-segmen.md +0 -0
  2. package/.agent/decisions/2026-05-19-content-progress-ts-part-2.md +0 -0
  3. package/.agent/decisions/2026-05-20-live-event-fetch-permissions-id.md +0 -0
  4. package/.claude/settings.local.json +43 -17
  5. package/.coderabbit.yaml +0 -0
  6. package/.editorconfig +0 -0
  7. package/.github/pull_request_template.md +0 -0
  8. package/.github/workflows/automated-testing.yml +0 -0
  9. package/.github/workflows/conventional-commits.yaml +0 -0
  10. package/.github/workflows/docs.js.yml +0 -0
  11. package/.prettierignore +0 -0
  12. package/.prettierrc +0 -0
  13. package/CHANGELOG.md +14 -0
  14. package/CLAUDE.md +0 -0
  15. package/README.md +0 -0
  16. package/babel.config.cjs +0 -0
  17. package/codecov.yml +0 -0
  18. package/jest.config.js +0 -0
  19. package/jest.integration.config.js +0 -0
  20. package/jest.live.config.js +0 -0
  21. package/jsdoc.json +0 -0
  22. package/package.json +1 -1
  23. package/src/constants/award-assets.js +0 -0
  24. package/src/constants/membership-permissions.ts +0 -0
  25. package/src/contentMetaData.js +0 -0
  26. package/src/contentTypeConfig.js +3 -3
  27. package/src/filterBuilder.js +0 -0
  28. package/src/index.d.ts +2 -0
  29. package/src/index.js +2 -0
  30. package/src/infrastructure/http/HttpClient.ts +0 -0
  31. package/src/infrastructure/http/executors/FetchRequestExecutor.ts +0 -0
  32. package/src/infrastructure/http/index.ts +0 -0
  33. package/src/infrastructure/http/interfaces/HeaderProvider.ts +0 -0
  34. package/src/infrastructure/http/interfaces/HttpError.ts +0 -0
  35. package/src/infrastructure/http/interfaces/NetworkError.ts +0 -0
  36. package/src/infrastructure/http/interfaces/RequestExecutor.ts +0 -0
  37. package/src/infrastructure/http/interfaces/RequestOptions.ts +0 -0
  38. package/src/infrastructure/http/providers/DefaultHeaderProvider.ts +0 -0
  39. package/src/infrastructure/sanity/README.md +0 -0
  40. package/src/infrastructure/sanity/SanityClient.ts +0 -0
  41. package/src/infrastructure/sanity/clients/ContentClient.ts +0 -0
  42. package/src/infrastructure/sanity/examples/usage.ts +0 -0
  43. package/src/infrastructure/sanity/executors/FetchQueryExecutor.ts +0 -0
  44. package/src/infrastructure/sanity/index.ts +0 -0
  45. package/src/infrastructure/sanity/interfaces/ConfigProvider.ts +0 -0
  46. package/src/infrastructure/sanity/interfaces/FetchByIdOptions.ts +0 -0
  47. package/src/infrastructure/sanity/interfaces/QueryExecutor.ts +0 -0
  48. package/src/infrastructure/sanity/interfaces/SanityConfig.ts +0 -0
  49. package/src/infrastructure/sanity/interfaces/SanityError.ts +0 -0
  50. package/src/infrastructure/sanity/interfaces/SanityQuery.ts +0 -0
  51. package/src/infrastructure/sanity/interfaces/SanityResponse.ts +0 -0
  52. package/src/infrastructure/sanity/providers/DefaultConfigProvider.ts +0 -0
  53. package/src/lib/ads/monoid.ts +0 -0
  54. package/src/lib/ads/semigroup.ts +0 -0
  55. package/src/lib/brands.ts +0 -0
  56. package/src/lib/lastUpdated.js +0 -0
  57. package/src/lib/sanity/decorators/base.ts +0 -0
  58. package/src/lib/sanity/decorators/examples.ts +0 -0
  59. package/src/lib/sanity/decorators/navigate-to.ts +0 -0
  60. package/src/lib/sanity/decorators/need-access.ts +0 -0
  61. package/src/lib/sanity/decorators/need-lifetime-upgrade.ts +48 -0
  62. package/src/lib/sanity/decorators/page-type.ts +0 -0
  63. package/src/lib/sanity/field-access.ts +0 -0
  64. package/src/lib/sanity/filter.ts +0 -0
  65. package/src/lib/sanity/query.ts +0 -0
  66. package/src/services/api/types.js +0 -0
  67. package/src/services/api/types.ts +0 -0
  68. package/src/services/awards/award-callbacks.js +0 -0
  69. package/src/services/awards/award-query.js +0 -0
  70. package/src/services/awards/internal/.indexignore +0 -0
  71. package/src/services/awards/internal/award-definitions.js +0 -0
  72. package/src/services/awards/internal/award-events.js +0 -0
  73. package/src/services/awards/internal/award-manager.js +0 -0
  74. package/src/services/awards/internal/certificate-builder.js +0 -0
  75. package/src/services/awards/internal/completion-data-generator.js +0 -0
  76. package/src/services/awards/internal/content-progress-observer.js +0 -0
  77. package/src/services/awards/internal/image-utils.js +0 -0
  78. package/src/services/awards/internal/message-generator.js +0 -0
  79. package/src/services/awards/internal/types.js +0 -0
  80. package/src/services/awards/types.d.ts +0 -0
  81. package/src/services/awards/types.js +0 -0
  82. package/src/services/config.js +0 -0
  83. package/src/services/content/artist.ts +0 -0
  84. package/src/services/content/content.ts +1 -0
  85. package/src/services/content/genre.ts +0 -0
  86. package/src/services/content/instructor.ts +0 -0
  87. package/src/services/content-org/content-org.js +0 -0
  88. package/src/services/content-org/guided-courses.ts +0 -0
  89. package/src/services/content-org/learning-paths.ts +0 -0
  90. package/src/services/content-org/playlists-types.js +0 -0
  91. package/src/services/content-org/playlists.js +0 -0
  92. package/src/services/content.js +0 -0
  93. package/src/services/contentAggregator.js +0 -0
  94. package/src/services/contentLikes.js +0 -0
  95. package/src/services/contentProgress.js +0 -0
  96. package/src/services/dataContext.js +0 -0
  97. package/src/services/dateUtils.js +0 -0
  98. package/src/services/endScreen/README.md +0 -0
  99. package/src/services/endScreen/endScreen.ts +0 -0
  100. package/src/services/endScreen/types.ts +0 -0
  101. package/src/services/eventsAPI.js +0 -0
  102. package/src/services/forums/categories.ts +0 -0
  103. package/src/services/forums/forums.ts +0 -0
  104. package/src/services/forums/posts.ts +0 -0
  105. package/src/services/forums/threads.ts +0 -0
  106. package/src/services/forums/types.ts +0 -0
  107. package/src/services/gamification/awards.ts +0 -0
  108. package/src/services/gamification/gamification.js +0 -0
  109. package/src/services/imageSRCBuilder.js +0 -0
  110. package/src/services/imageSRCVerify.js +0 -0
  111. package/src/services/liveTesting.ts +0 -0
  112. package/src/services/multi-user-accounts/multi-user-accounts.ts +0 -0
  113. package/src/services/offline/activities.ts +0 -0
  114. package/src/services/offline/practices.ts +0 -0
  115. package/src/services/offline/progress.ts +0 -0
  116. package/src/services/permissions/PermissionsAdapter.ts +0 -0
  117. package/src/services/permissions/PermissionsAdapterFactory.ts +0 -0
  118. package/src/services/permissions/PermissionsV1Adapter.ts +0 -0
  119. package/src/services/permissions/PermissionsV2Adapter.ts +0 -0
  120. package/src/services/permissions/README.md +0 -0
  121. package/src/services/permissions/index.ts +0 -0
  122. package/src/services/permissions/permissions.ts +0 -0
  123. package/src/services/permissions/types.d.ts +0 -0
  124. package/src/services/progress/.indexignore +0 -0
  125. package/src/services/progress/collections.ts +0 -0
  126. package/src/services/progress/index.ts +0 -0
  127. package/src/services/progress/internal/queries.ts +0 -0
  128. package/src/services/progress/state.ts +0 -0
  129. package/src/services/progress/types.ts +0 -0
  130. package/src/services/progress-events.js +0 -0
  131. package/src/services/progress-row/base.js +0 -0
  132. package/src/services/progress-row/rows/.indexignore +0 -0
  133. package/src/services/progress-row/rows/content-card.js +0 -0
  134. package/src/services/progress-row/rows/method-card.js +0 -0
  135. package/src/services/progress-row/rows/playlist-card.js +0 -0
  136. package/src/services/railcontent.js +0 -0
  137. package/src/services/recommendations.js +0 -0
  138. package/src/services/reporting/README.md +0 -0
  139. package/src/services/reporting/reporting.ts +0 -0
  140. package/src/services/reporting/types.ts +0 -0
  141. package/src/services/sanity.js +8 -0
  142. package/src/services/search.ts +0 -0
  143. package/src/services/sentry/.indexignore +0 -0
  144. package/src/services/sentry/index.ts +0 -0
  145. package/src/services/state.ts +0 -0
  146. package/src/services/sync/.indexignore +0 -0
  147. package/src/services/sync/adapters/factory.ts +0 -0
  148. package/src/services/sync/adapters/lokijs.ts +0 -0
  149. package/src/services/sync/adapters/sqlite.ts +0 -0
  150. package/src/services/sync/context/index.ts +0 -0
  151. package/src/services/sync/context/providers/base.ts +0 -0
  152. package/src/services/sync/context/providers/connectivity.ts +0 -0
  153. package/src/services/sync/context/providers/durability.ts +0 -0
  154. package/src/services/sync/context/providers/index.ts +0 -0
  155. package/src/services/sync/context/providers/session.ts +0 -0
  156. package/src/services/sync/context/providers/tabs.ts +0 -0
  157. package/src/services/sync/context/providers/visibility.ts +0 -0
  158. package/src/services/sync/database/factory.ts +0 -0
  159. package/src/services/sync/debug.ts +0 -0
  160. package/src/services/sync/effects/index.ts +0 -0
  161. package/src/services/sync/effects/logout-warning.ts +0 -0
  162. package/src/services/sync/effects/push-failure-notification.ts +0 -0
  163. package/src/services/sync/errors/boundary.ts +0 -0
  164. package/src/services/sync/errors/index.ts +0 -0
  165. package/src/services/sync/errors/validators.ts +0 -0
  166. package/src/services/sync/fetch.ts +0 -0
  167. package/src/services/sync/index.ts +0 -0
  168. package/src/services/sync/manager.ts +0 -0
  169. package/src/services/sync/models/Base.ts +0 -0
  170. package/src/services/sync/models/ContentLike.ts +0 -0
  171. package/src/services/sync/models/ContentProgress.ts +0 -0
  172. package/src/services/sync/models/Practice.ts +0 -0
  173. package/src/services/sync/models/PracticeDayNote.ts +0 -0
  174. package/src/services/sync/models/UserAwardProgress.ts +0 -0
  175. package/src/services/sync/models/index.ts +0 -0
  176. package/src/services/sync/repositories/base.ts +0 -0
  177. package/src/services/sync/repositories/content-likes.ts +0 -0
  178. package/src/services/sync/repositories/content-progress.ts +0 -0
  179. package/src/services/sync/repositories/index.ts +0 -0
  180. package/src/services/sync/repositories/practice-day-notes.ts +0 -0
  181. package/src/services/sync/repositories/practices.ts +0 -0
  182. package/src/services/sync/repositories/user-award-progress.ts +0 -0
  183. package/src/services/sync/repository-proxy.ts +0 -0
  184. package/src/services/sync/resolver.ts +0 -0
  185. package/src/services/sync/retry.ts +0 -0
  186. package/src/services/sync/run-scope.ts +0 -0
  187. package/src/services/sync/schema/index.ts +0 -0
  188. package/src/services/sync/serializers/index.ts +0 -0
  189. package/src/services/sync/serializers/model.ts +0 -0
  190. package/src/services/sync/serializers/raw.ts +0 -0
  191. package/src/services/sync/stale-record-cleanup.ts +0 -0
  192. package/src/services/sync/store/index.ts +0 -0
  193. package/src/services/sync/store/push-coalescer.ts +0 -0
  194. package/src/services/sync/store-configs.ts +0 -0
  195. package/src/services/sync/strategies/base.ts +0 -0
  196. package/src/services/sync/strategies/index.ts +0 -0
  197. package/src/services/sync/strategies/initial.ts +0 -0
  198. package/src/services/sync/strategies/polling.ts +0 -0
  199. package/src/services/sync/telemetry/flood-prevention.ts +0 -0
  200. package/src/services/sync/telemetry/index.ts +0 -0
  201. package/src/services/sync/telemetry/sampling.ts +0 -0
  202. package/src/services/sync/utils/event-emitter.ts +0 -0
  203. package/src/services/sync/utils/index.ts +0 -0
  204. package/src/services/sync/utils/throttle.ts +0 -0
  205. package/src/services/sync/utils/timers.ts +0 -0
  206. package/src/services/types.js +0 -0
  207. package/src/services/urlBuilder.ts +0 -0
  208. package/src/services/user/account.ts +4 -2
  209. package/src/services/user/chat.js +0 -0
  210. package/src/services/user/interests.js +0 -0
  211. package/src/services/user/management.js +0 -0
  212. package/src/services/user/memberships.ts +11 -1
  213. package/src/services/user/notifications.js +0 -0
  214. package/src/services/user/onboarding.ts +12 -0
  215. package/src/services/user/payments.ts +0 -0
  216. package/src/services/user/profile.ts +0 -0
  217. package/src/services/user/sessions.js +0 -0
  218. package/src/services/user/streakCalculator.ts +0 -0
  219. package/src/services/user/types.js +0 -0
  220. package/src/services/user/user-management-system.js +0 -0
  221. package/src/services/userActivity.js +0 -0
  222. package/src/services/whoLiked.ts +0 -0
  223. package/test/initializeTests.js +0 -0
  224. package/test/integration/awards/award-exclusion-handling.test.ts +0 -0
  225. package/test/integration/awards/internal/image-utils.test.ts +0 -0
  226. package/test/integration/content-progress/__mocks__/mocks.ts +0 -0
  227. package/test/integration/content-progress/contentProgress.test.ts +0 -0
  228. package/test/integration/content-progress/e2eOfflineProgress.test.ts +0 -0
  229. package/test/integration/content-progress/e2eProgress.test.ts +0 -0
  230. package/test/integration/content-progress/getters.test.ts +0 -0
  231. package/test/integration/content-progress/helpers.test.ts +0 -0
  232. package/test/integration/content-progress/offlineContentProgress.test.ts +0 -0
  233. package/test/integration/forums.test.ts +0 -0
  234. package/test/integration/infrastructure/FetchRequestExecutor.test.ts +0 -0
  235. package/test/integration/initializeTestDB.ts +0 -0
  236. package/test/integration/learning-paths.test.ts +0 -0
  237. package/test/integration/notifications.test.ts +0 -0
  238. package/test/integration/progress-row/content-card.test.ts +0 -0
  239. package/test/integration/sync/adapters/idb-errors.test.ts +0 -0
  240. package/test/integration/sync/adapters/sqlite-errors.test.ts +0 -0
  241. package/test/integration/sync/fetch.test.ts +0 -0
  242. package/test/integration/sync/repositories/content-likes.test.ts +0 -0
  243. package/test/integration/sync/repositories/practices.test.ts +0 -0
  244. package/test/integration/sync/repositories/progress.test.ts +0 -0
  245. package/test/integration/sync/repositories/user-award-progress.static.test.ts +0 -0
  246. package/test/integration/sync/repositories/user-award-progress.test.ts +0 -0
  247. package/test/integration/sync/store/cross-user-protection.test.ts +0 -0
  248. package/test/integration/sync/store/store-idb.test.ts +0 -0
  249. package/test/integration/sync/store/store.test.ts +0 -0
  250. package/test/integration/user/permissions.test.js +0 -0
  251. package/test/integration/userActivity.test.ts +0 -0
  252. package/test/live/README.md +0 -0
  253. package/test/live/content.test.js +0 -0
  254. package/test/localStorageMock.js +0 -0
  255. package/test/log.js +0 -0
  256. package/test/mockData/award-definitions.js +0 -0
  257. package/test/mockData/mockData_fetchByRailContentIds_one_content.json +0 -0
  258. package/test/mockData/mockData_progress_content.json +0 -0
  259. package/test/mockData/mockData_sanity_progress_content.json +0 -0
  260. package/test/mockData/mockData_user_practices.json +0 -0
  261. package/test/setupConsole.js +0 -0
  262. package/test/setupNetworkGuard.js +0 -0
  263. package/test/setupTimers.js +0 -0
  264. package/test/unit/HttpClient.test.ts +0 -0
  265. package/test/unit/awards/award-alacarte-observer.test.ts +0 -0
  266. package/test/unit/awards/award-auto-refresh.test.ts +0 -0
  267. package/test/unit/awards/award-calculations.test.ts +0 -0
  268. package/test/unit/awards/award-callbacks.test.ts +0 -0
  269. package/test/unit/awards/award-certificate-display.test.ts +0 -0
  270. package/test/unit/awards/award-collection-edge-cases.test.ts +0 -0
  271. package/test/unit/awards/award-collection-filtering.test.ts +0 -0
  272. package/test/unit/awards/award-completion-flow.test.ts +0 -0
  273. package/test/unit/awards/award-multi-lesson.test.ts +0 -0
  274. package/test/unit/awards/award-observer-integration.test.ts +0 -0
  275. package/test/unit/awards/award-query-messages.test.ts +0 -0
  276. package/test/unit/awards/award-user-collection.test.ts +0 -0
  277. package/test/unit/awards/duplicate-prevention.test.ts +0 -0
  278. package/test/unit/awards/helpers/completion-mock.ts +0 -0
  279. package/test/unit/awards/helpers/index.ts +0 -0
  280. package/test/unit/awards/helpers/mock-setup.ts +0 -0
  281. package/test/unit/awards/helpers/progress-emitter.ts +0 -0
  282. package/test/unit/awards/message-generator.test.ts +0 -0
  283. package/test/unit/content-progress/bubbleTrickle.test.ts +0 -0
  284. package/test/unit/content-progress/helpers.test.ts +0 -0
  285. package/test/unit/content-progress/navigateTo.test.ts +0 -0
  286. package/test/unit/contentLikes.test.ts +0 -0
  287. package/test/unit/contentMetaData.test.ts +0 -0
  288. package/test/unit/dataContext.test.ts +0 -0
  289. package/test/unit/dateUtils.test.ts +0 -0
  290. package/test/unit/endScreen.test.js +0 -0
  291. package/test/unit/imageSRCBuilder.test.ts +0 -0
  292. package/test/unit/imageSRCVerify.test.ts +0 -0
  293. package/test/unit/infrastructure/DefaultHeaderProvider.test.ts +0 -0
  294. package/test/unit/infrastructure/sanity/ContentClient.test.ts +0 -0
  295. package/test/unit/infrastructure/sanity/DefaultConfigProvider.test.ts +0 -0
  296. package/test/unit/infrastructure/sanity/FetchQueryExecutor.test.ts +0 -0
  297. package/test/unit/infrastructure/sanity/SanityClient.test.ts +0 -0
  298. package/test/unit/lib/__snapshots__/filter.test.ts.snap +0 -0
  299. package/test/unit/lib/filter.test.ts +0 -0
  300. package/test/unit/lib/lastUpdated.test.ts +0 -0
  301. package/test/unit/lib/query.test.ts +0 -0
  302. package/test/unit/lib/sanity/decorators/base.test.ts +0 -0
  303. package/test/unit/lib/sanity/decorators/navigate-to.test.ts +0 -0
  304. package/test/unit/lib/sanity/decorators/need-access.test.ts +0 -0
  305. package/test/unit/lib/sanity/decorators/need-lifetime-upgrade.test.ts +85 -0
  306. package/test/unit/lib/sanity/decorators/page-type.test.ts +0 -0
  307. package/test/unit/progress-row/content-card.test.ts +0 -0
  308. package/test/unit/progress-row/playlist-card.test.ts +0 -0
  309. package/test/unit/progressRows.test.ts +0 -0
  310. package/test/unit/sanityQueryService.test.ts +0 -0
  311. package/test/unit/search.test.ts +0 -0
  312. package/test/unit/sentry.test.ts +0 -0
  313. package/test/unit/services/progress.test.ts +0 -0
  314. package/test/unit/streakMessage.test.ts +0 -0
  315. package/test/unit/sync/context.test.ts +0 -0
  316. package/test/unit/sync/effects/logout-warning.test.ts +0 -0
  317. package/test/unit/sync/effects/push-failure-notification.test.ts +0 -0
  318. package/test/unit/sync/errors/sync-errors.test.ts +0 -0
  319. package/test/unit/sync/errors/validators.test.ts +0 -0
  320. package/test/unit/sync/helpers/TestModel.ts +0 -0
  321. package/test/unit/sync/helpers/index.ts +0 -0
  322. package/test/unit/sync/manager.test.ts +0 -0
  323. package/test/unit/sync/models/user-award-progress.test.ts +0 -0
  324. package/test/unit/sync/resolver.test.ts +0 -0
  325. package/test/unit/sync/retry.test.ts +0 -0
  326. package/test/unit/sync/run-scope.test.ts +0 -0
  327. package/test/unit/sync/stale-record-cleanup.test.ts +0 -0
  328. package/test/unit/sync/store/push-coalescer.test.ts +0 -0
  329. package/test/unit/sync/store-configs.test.ts +0 -0
  330. package/test/unit/sync/telemetry/sync-telemetry.test.ts +0 -0
  331. package/test/unit/sync/utils/event-emitter.test.ts +0 -0
  332. package/test/unit/sync/utils/throttle.test.ts +0 -0
  333. package/test/unit/url-builder.test.ts +0 -0
  334. package/test/unit/user/account.test.ts +55 -0
  335. package/test/unit/user/permissions.test.js +0 -0
  336. package/tools/generate-index.cjs +0 -0
  337. package/tsconfig.json +0 -0
  338. package/usage/sanity/decorators/examples.ts +0 -0
@@ -1,22 +1,48 @@
1
1
  {
2
2
  "permissions": {
3
3
  "allow": [
4
- "Bash(tree:*)",
5
- "Bash(find:*)",
6
- "Bash(docker exec:*)",
7
- "Bash(node:*)",
8
- "Bash(npm run build-index:*)",
9
- "Bash(npm run link_mcs:*)",
10
- "Bash(./link_mcs.sh:*)",
11
- "Bash(curl:*)",
12
- "Bash(php artisan:*)",
13
- "Bash(git checkout:*)",
14
- "Bash(source .env)",
15
- "Bash(echo:*)",
16
- "Bash(grep:*)",
17
- "Bash(gh api repos/railroadmedia/musora-platform-backend/commits/1f9878a5e681bf1e2233c0d59a618d477b118c49 --jq '.commit.message' 2>/dev/null || echo \"no access\")",
18
- "WebFetch(domain:github.com)",
19
- "Read(//app/**)"
4
+ "Bash(npx jest *)",
5
+ "Bash(npx tsc *)",
6
+ "Skill(counselors)",
7
+ "Bash(counselors ls *)",
8
+ "Bash(counselors groups *)",
9
+ "Bash(counselors run *)",
10
+ "Bash(npm test *)",
11
+ "Bash(gh pr *)",
12
+ "Bash(gh api *)",
13
+ "Bash(mkdir -p /tmp/pr-review-v2)",
14
+ "Read(//tmp/pr-review-v2/**)",
15
+ "Bash(cat /home/alesevero/railenvironment/applications/musora-content-services/AGENTS.md)",
16
+ "Bash(echo \"no AGENTS.md\")",
17
+ "Bash(echo \"exit=$?\")",
18
+ "Bash(git checkout *)",
19
+ "Skill(pr)",
20
+ "Skill(create-decision)",
21
+ "mcp__github__pull_request_read",
22
+ "mcp__github__push_files",
23
+ "Bash(git push *)",
24
+ "mcp__github__create_pull_request"
20
25
  ]
21
- }
26
+ },
27
+ "model": "sonnet",
28
+ "enabledMcpjsonServers": [
29
+ "atlassian",
30
+ "figma",
31
+ "google-workspace",
32
+ "snowflake",
33
+ "aws",
34
+ "hex",
35
+ "sanity",
36
+ "mysql",
37
+ "slack",
38
+ "langfuse",
39
+ "chrome-devtools",
40
+ "railway",
41
+ "github",
42
+ "asana"
43
+ ],
44
+ "disabledMcpjsonServers": [
45
+ "nightwatch"
46
+ ],
47
+ "effortLevel": "medium"
22
48
  }
package/.coderabbit.yaml CHANGED
File without changes
package/.editorconfig CHANGED
File without changes
File without changes
File without changes
File without changes
File without changes
package/.prettierignore CHANGED
File without changes
package/.prettierrc CHANGED
File without changes
package/CHANGELOG.md CHANGED
@@ -2,6 +2,20 @@
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.165.1](https://github.com/railroadmedia/musora-content-services/compare/v2.165.0...v2.165.1) (2026-06-19)
6
+
7
+ ## [2.165.0](https://github.com/railroadmedia/musora-content-services/compare/v2.164.6...v2.165.0) (2026-06-18)
8
+
9
+
10
+ ### Features
11
+
12
+ * **BEHSTP-370:** add need_lifetime_upgrade flag on documents and grant30DaysAccessForLifetime method ([2dd8bed](https://github.com/railroadmedia/musora-content-services/commit/2dd8bedf71a543599a0c421d7eea99cae3bf156c))
13
+
14
+
15
+ ### Bug Fixes
16
+
17
+ * add method for progress types mapping ([#998](https://github.com/railroadmedia/musora-content-services/issues/998)) ([9830710](https://github.com/railroadmedia/musora-content-services/commit/9830710893e85f3680286fc5abdc23d1cbf47580))
18
+
5
19
  ### [2.164.6](https://github.com/railroadmedia/musora-content-services/compare/v2.164.5...v2.164.6) (2026-06-10)
6
20
 
7
21
  ### [2.164.5](https://github.com/railroadmedia/musora-content-services/compare/v2.164.4...v2.164.5) (2026-06-10)
package/CLAUDE.md CHANGED
File without changes
package/README.md CHANGED
File without changes
package/babel.config.cjs CHANGED
File without changes
package/codecov.yml CHANGED
File without changes
package/jest.config.js CHANGED
File without changes
File without changes
File without changes
package/jsdoc.json CHANGED
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "musora-content-services",
3
- "version": "2.164.6",
3
+ "version": "2.165.1",
4
4
  "description": "A package for Musoras content services ",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
File without changes
File without changes
File without changes
@@ -73,6 +73,7 @@ export const DEFAULT_FIELDS = [
73
73
  'live_event_end_time',
74
74
  'enrollment_start_time',
75
75
  'enrollment_end_time',
76
+ 'membership_tier',
76
77
  ]
77
78
 
78
79
  // these are identical... why
@@ -328,6 +329,7 @@ export const progressTypesMapping = {
328
329
  'course-lesson',
329
330
  'routine',
330
331
  ],
332
+ method: [LEARNING_PATH_LESSON],
331
333
  course: ['course'],
332
334
  show: showsLessonTypes,
333
335
  'song tutorial': [...tutorialsLessonTypes, 'song-tutorial-lesson'],
@@ -695,9 +697,7 @@ export let contentTypeConfig = {
695
697
  }`,
696
698
  ],
697
699
  'new-and-scheduled': {
698
- fields: [
699
- 'show_in_new_feed',
700
- ],
700
+ fields: ['show_in_new_feed'],
701
701
  includeChildFields: true,
702
702
  },
703
703
  }
File without changes
package/src/index.d.ts CHANGED
@@ -428,6 +428,7 @@ import {
428
428
  fetchMemberships,
429
429
  fetchRechargeTokens,
430
430
  getUpgradePrice,
431
+ grant30DaysAccessForLifetime,
431
432
  restorePurchases,
432
433
  upgradeSubscription
433
434
  } from './services/user/memberships.ts';
@@ -742,6 +743,7 @@ declare module 'musora-content-services' {
742
743
  getUserWeeklyStats,
743
744
  getWeekNumber,
744
745
  globalConfig,
746
+ grant30DaysAccessForLifetime,
745
747
  guidedCourses,
746
748
  hasAnyMethodV2IntroCompleted,
747
749
  initializeEnvVar,
package/src/index.js CHANGED
@@ -432,6 +432,7 @@ import {
432
432
  fetchMemberships,
433
433
  fetchRechargeTokens,
434
434
  getUpgradePrice,
435
+ grant30DaysAccessForLifetime,
435
436
  restorePurchases,
436
437
  upgradeSubscription
437
438
  } from './services/user/memberships.ts';
@@ -741,6 +742,7 @@ export {
741
742
  getUserWeeklyStats,
742
743
  getWeekNumber,
743
744
  globalConfig,
745
+ grant30DaysAccessForLifetime,
744
746
  guidedCourses,
745
747
  hasAnyMethodV2IntroCompleted,
746
748
  initializeEnvVar,
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/src/lib/brands.ts CHANGED
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -0,0 +1,48 @@
1
+ import { decorate, type FieldDecorator } from './base'
2
+ import { type UserPermissions } from '../../../services/permissions'
3
+ import { type AccessDecoratable } from './need-access'
4
+ import { MEMBERSHIP_PERMISSIONS } from '../../../constants/membership-permissions'
5
+
6
+ export const NEED_LIFETIME_UPGRADE_FIELD = 'need_lifetime_upgrade' as const
7
+
8
+ type LifetimeUpgradeDecoratable = AccessDecoratable & { need_access?: boolean; membership_tier?: string }
9
+
10
+ export type WithNeedLifetimeUpgrade<T extends AccessDecoratable> = T & {
11
+ need_lifetime_upgrade: boolean
12
+ children?: WithNeedLifetimeUpgrade<NonNullable<T['children']>[number]>[]
13
+ }
14
+
15
+ export function lifetimeUpgradeDecorator(
16
+ userPermissions: UserPermissions
17
+ ): FieldDecorator<LifetimeUpgradeDecoratable, typeof NEED_LIFETIME_UPGRADE_FIELD, boolean> {
18
+ const userPermSet = new Set(userPermissions?.permissions ?? [])
19
+ const hasLifetime = userPermSet.has(MEMBERSHIP_PERMISSIONS.lifetime)
20
+ const hasPlus = userPermSet.has(MEMBERSHIP_PERMISSIONS.plus)
21
+
22
+ return {
23
+ field: NEED_LIFETIME_UPGRADE_FIELD,
24
+ compute: (item) => {
25
+ if (userPermissions?.isAdmin || !hasLifetime || hasPlus) return false
26
+ if (!item.need_access) return false
27
+ return item.membership_tier === 'plus'
28
+ },
29
+ }
30
+ }
31
+
32
+ export function decorateLifetimeUpgrade<T extends LifetimeUpgradeDecoratable>(
33
+ items: T[],
34
+ userPermissions: UserPermissions
35
+ ): WithNeedLifetimeUpgrade<T>[]
36
+ export function decorateLifetimeUpgrade<T extends LifetimeUpgradeDecoratable>(
37
+ items: T,
38
+ userPermissions: UserPermissions
39
+ ): WithNeedLifetimeUpgrade<T>
40
+ export function decorateLifetimeUpgrade<T extends LifetimeUpgradeDecoratable>(
41
+ items: T | T[],
42
+ userPermissions: UserPermissions
43
+ ): WithNeedLifetimeUpgrade<T> | WithNeedLifetimeUpgrade<T>[] {
44
+ const { field, compute } = lifetimeUpgradeDecorator(userPermissions)
45
+ return decorate(items as T, field, compute) as
46
+ | WithNeedLifetimeUpgrade<T>
47
+ | WithNeedLifetimeUpgrade<T>[]
48
+ }
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
@@ -40,5 +40,6 @@ export interface Lesson {
40
40
  title: string
41
41
  type: LessonType
42
42
  need_access: boolean
43
+ need_lifetime_upgrade: boolean
43
44
  page_type: LessonPageType
44
45
  }
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
@@ -46,6 +46,7 @@ import { globalConfig } from './config.js'
46
46
 
47
47
  import { arrayToStringRepresentation, FilterBuilder } from '../filterBuilder.js'
48
48
  import { getPermissionsAdapter } from './permissions/index.ts'
49
+ import { lifetimeUpgradeDecorator, NEED_LIFETIME_UPGRADE_FIELD } from '../lib/sanity/decorators/need-lifetime-upgrade.ts'
49
50
  import {
50
51
  getAllCompleted,
51
52
  getAllCompletedByIds,
@@ -1639,6 +1640,7 @@ export async function fetchSanity(
1639
1640
  return null
1640
1641
  }
1641
1642
  results = processNeedAccess ? await needsAccessDecorator(results, userPermissions) : results
1643
+ results = processNeedAccess ? needsLifetimeUpgradeDecorator(results, userPermissions) : results
1642
1644
  results = processPageType ? pageTypeDecorator(results) : results
1643
1645
  return customPostProcess ? customPostProcess(results) : results
1644
1646
  } else {
@@ -1734,6 +1736,12 @@ function needsAccessDecorator(results, userPermissions) {
1734
1736
  })
1735
1737
  }
1736
1738
 
1739
+ function needsLifetimeUpgradeDecorator(results, userPermissions) {
1740
+ if (globalConfig.sanityConfig.useDummyRailContentMethods) return results
1741
+ const { compute } = lifetimeUpgradeDecorator(userPermissions)
1742
+ return contentResultsDecorator(results, NEED_LIFETIME_UPGRADE_FIELD, compute)
1743
+ }
1744
+
1737
1745
  function doesUserNeedAccessToContent(result, userPermissions) {
1738
1746
  // Legacy function - now delegates to adapter
1739
1747
  // Kept for backwards compatibility if used elsewhere
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