musora-content-services 2.90.0 → 2.92.6
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 +40 -0
- package/package.json +11 -3
- package/src/index.d.ts +9 -31
- package/src/index.js +12 -34
- package/src/services/content-org/learning-paths.ts +33 -3
- package/src/services/contentAggregator.js +2 -2
- package/src/services/contentLikes.js +6 -39
- package/src/services/contentProgress.js +181 -479
- package/src/services/dataContext.js +0 -2
- package/src/services/progress-row/method-card.js +2 -1
- package/src/services/railcontent.js +12 -135
- package/src/services/sentry/.indexignore +0 -0
- package/src/services/sentry/index.ts +23 -0
- package/src/services/sync/.indexignore +0 -0
- package/src/services/sync/adapters/factory.ts +26 -0
- package/src/services/sync/adapters/lokijs.ts +1 -0
- package/src/services/sync/adapters/sqlite.ts +1 -0
- package/src/services/sync/concurrency-safety.ts +4 -0
- package/src/services/sync/context/index.ts +43 -0
- package/src/services/sync/context/providers/base.ts +4 -0
- package/src/services/sync/context/providers/connectivity.ts +14 -0
- package/src/services/sync/context/providers/durability.ts +5 -0
- package/src/services/sync/context/providers/index.ts +5 -0
- package/src/services/sync/context/providers/session.ts +8 -0
- package/src/services/sync/context/providers/tabs.ts +18 -0
- package/src/services/sync/context/providers/visibility.ts +14 -0
- package/src/services/sync/database/factory.ts +10 -0
- package/src/services/sync/errors/boundary.ts +45 -0
- package/src/services/sync/errors/index.ts +49 -0
- package/src/services/sync/fetch.ts +313 -0
- package/src/services/sync/index.ts +80 -0
- package/src/services/sync/manager.ts +139 -0
- package/src/services/sync/models/Base.ts +47 -0
- package/src/services/sync/models/ContentLike.ts +16 -0
- package/src/services/sync/models/ContentProgress.ts +69 -0
- package/src/services/sync/models/Practice.ts +72 -0
- package/src/services/sync/models/PracticeDayNote.ts +23 -0
- package/src/services/sync/models/index.ts +4 -0
- package/src/services/sync/repositories/base.ts +247 -0
- package/src/services/sync/repositories/content-likes.ts +26 -0
- package/src/services/sync/repositories/content-progress.ts +160 -0
- package/src/services/sync/repositories/index.ts +4 -0
- package/src/services/sync/repositories/practice-day-notes.ts +4 -0
- package/src/services/sync/repositories/practices.ts +52 -0
- package/src/services/sync/repository-proxy.ts +48 -0
- package/src/services/sync/resolver.ts +84 -0
- package/src/services/sync/retry.ts +88 -0
- package/src/services/sync/run-scope.ts +30 -0
- package/src/services/sync/schema/index.ts +66 -0
- package/src/services/sync/serializers/index.ts +2 -0
- package/src/services/sync/serializers/model.ts +32 -0
- package/src/services/sync/serializers/raw.ts +21 -0
- package/src/services/sync/store/index.ts +779 -0
- package/src/services/sync/store/push-coalescer.ts +57 -0
- package/src/services/sync/store-configs.ts +41 -0
- package/src/services/sync/strategies/base.ts +21 -0
- package/src/services/sync/strategies/index.ts +12 -0
- package/src/services/sync/strategies/initial.ts +11 -0
- package/src/services/sync/strategies/polling.ts +54 -0
- package/src/services/sync/telemetry/index.ts +140 -0
- package/src/services/sync/telemetry/sampling.ts +91 -0
- package/src/services/sync/utils/event-emitter.ts +24 -0
- package/src/services/sync/utils/index.ts +1 -0
- package/src/services/sync/utils/throttle.ts +93 -0
- package/src/services/sync/utils/timers.ts +9 -0
- package/src/services/userActivity.js +83 -148
- package/test/contentProgress.test.js +6 -39
- package/test/live/contentProgressLive.test.js +2 -31
- package/tools/generate-index.cjs +10 -4
- package/babel.config.cjs +0 -3
- package/docs/Content.html +0 -269
- package/docs/ContentOrganization.html +0 -245
- package/docs/Forums.html +0 -269
- package/docs/Gamification.html +0 -245
- package/docs/TestUser.html +0 -260
- package/docs/UserManagementSystem.html +0 -317
- package/docs/api_types.js.html +0 -97
- package/docs/config.js.html +0 -140
- package/docs/content-org_content-org.js.html +0 -76
- package/docs/content-org_guided-courses.ts.html +0 -110
- package/docs/content-org_learning-paths.ts.html +0 -379
- package/docs/content-org_playlists-types.js.html +0 -128
- package/docs/content-org_playlists.js.html +0 -440
- package/docs/content.js.html +0 -603
- package/docs/content_artist.ts.html +0 -206
- package/docs/content_content.ts.html +0 -77
- package/docs/content_genre.ts.html +0 -209
- package/docs/content_instructor.ts.html +0 -206
- package/docs/fonts/Montserrat/Montserrat-Bold.eot +0 -0
- package/docs/fonts/Montserrat/Montserrat-Bold.ttf +0 -0
- package/docs/fonts/Montserrat/Montserrat-Bold.woff +0 -0
- package/docs/fonts/Montserrat/Montserrat-Bold.woff2 +0 -0
- package/docs/fonts/Montserrat/Montserrat-Regular.eot +0 -0
- package/docs/fonts/Montserrat/Montserrat-Regular.ttf +0 -0
- package/docs/fonts/Montserrat/Montserrat-Regular.woff +0 -0
- package/docs/fonts/Montserrat/Montserrat-Regular.woff2 +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.eot +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.svg +0 -978
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.ttf +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.woff +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.woff2 +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.eot +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.svg +0 -1049
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.ttf +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.woff +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.woff2 +0 -0
- package/docs/forums_categories.ts.html +0 -156
- package/docs/forums_discussions.js.html +0 -95
- package/docs/forums_forum.js.html +0 -95
- package/docs/forums_forums.ts.html +0 -160
- package/docs/forums_posts.ts.html +0 -284
- package/docs/forums_threads.ts.html +0 -284
- package/docs/gamification_awards.js.html +0 -165
- package/docs/gamification_awards.ts.html +0 -195
- package/docs/gamification_gamification.js.html +0 -76
- package/docs/gamification_types.js.html +0 -80
- package/docs/global.html +0 -6019
- package/docs/index.html +0 -167
- package/docs/liveTesting.ts.html +0 -103
- package/docs/module-Accounts.html +0 -2283
- package/docs/module-Artist.html +0 -993
- package/docs/module-Awards.html +0 -836
- package/docs/module-Categories.html +0 -711
- package/docs/module-Config.html +0 -431
- package/docs/module-Content-Services-V2.html +0 -2998
- package/docs/module-ForumCategories.html +0 -687
- package/docs/module-ForumDiscussions.html +0 -370
- package/docs/module-Forums.html +0 -16599
- package/docs/module-Genre.html +0 -981
- package/docs/module-GuidedCourses.html +0 -108
- package/docs/module-Instructor.html +0 -929
- package/docs/module-Interests.html +0 -1066
- package/docs/module-LearningPaths.html +0 -2298
- package/docs/module-Onboarding.html +0 -882
- package/docs/module-Payments.html +0 -392
- package/docs/module-Permissions.html +0 -406
- package/docs/module-Playlists.html +0 -3030
- package/docs/module-ProgressRow.html +0 -108
- package/docs/module-Railcontent-Services.html +0 -6735
- package/docs/module-Sanity-Services.html +0 -8244
- package/docs/module-Sessions.html +0 -575
- package/docs/module-Threads.html +0 -1119
- package/docs/module-UserActivity.html +0 -4580
- package/docs/module-UserChat.html +0 -410
- package/docs/module-UserManagement.html +0 -1932
- package/docs/module-UserMemberships.html +0 -829
- package/docs/module-UserNotifications.html +0 -2595
- package/docs/module-UserProfile.html +0 -370
- package/docs/progress-row_method-card.js.html +0 -183
- package/docs/railcontent.js.html +0 -847
- package/docs/sanity.js.html +0 -2322
- package/docs/scripts/collapse.js +0 -39
- package/docs/scripts/commonNav.js +0 -28
- package/docs/scripts/linenumber.js +0 -25
- package/docs/scripts/nav.js +0 -12
- package/docs/scripts/polyfill.js +0 -4
- package/docs/scripts/prettify/Apache-License-2.0.txt +0 -202
- package/docs/scripts/prettify/lang-css.js +0 -2
- package/docs/scripts/prettify/prettify.js +0 -28
- package/docs/scripts/search.js +0 -99
- package/docs/styles/jsdoc.css +0 -776
- package/docs/styles/prettify.css +0 -80
- package/docs/userActivity.js.html +0 -1577
- package/docs/user_account.ts.html +0 -265
- package/docs/user_chat.js.html +0 -98
- package/docs/user_interests.js.html +0 -150
- package/docs/user_management.js.html +0 -258
- package/docs/user_memberships.js.html +0 -144
- package/docs/user_memberships.ts.html +0 -292
- package/docs/user_notifications.js.html +0 -374
- package/docs/user_onboarding.ts.html +0 -325
- package/docs/user_payments.ts.html +0 -146
- package/docs/user_permissions.js.html +0 -110
- package/docs/user_profile.js.html +0 -115
- package/docs/user_sessions.js.html +0 -170
- package/docs/user_types.js.html +0 -224
- package/docs/user_user-management-system.js.html +0 -79
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,46 @@
|
|
|
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.92.6](https://github.com/railroadmedia/musora-content-services/compare/v2.92.5...v2.92.6) (2025-12-02)
|
|
6
|
+
|
|
7
|
+
### [2.92.5](https://github.com/railroadmedia/musora-content-services/compare/v2.92.3...v2.92.5) (2025-12-02)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### Bug Fixes
|
|
11
|
+
|
|
12
|
+
* fixes to get things working with watermelon. added todos for subsequent commits ([#601](https://github.com/railroadmedia/musora-content-services/issues/601)) ([ed83230](https://github.com/railroadmedia/musora-content-services/commit/ed83230006c1fc3a79dfd1a4955fb3785651bf1b))
|
|
13
|
+
|
|
14
|
+
### [2.92.4](https://github.com/railroadmedia/musora-content-services/compare/v2.92.3...v2.92.4) (2025-12-02)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Bug Fixes
|
|
18
|
+
|
|
19
|
+
* fixes to get things working with watermelon. added todos for subsequent commits ([#601](https://github.com/railroadmedia/musora-content-services/issues/601)) ([ed83230](https://github.com/railroadmedia/musora-content-services/commit/ed83230006c1fc3a79dfd1a4955fb3785651bf1b))
|
|
20
|
+
|
|
21
|
+
### [2.92.3](https://github.com/railroadmedia/musora-content-services/compare/v2.92.2...v2.92.3) (2025-11-28)
|
|
22
|
+
|
|
23
|
+
### [2.92.2](https://github.com/railroadmedia/musora-content-services/compare/v2.92.0...v2.92.2) (2025-11-28)
|
|
24
|
+
|
|
25
|
+
### [2.92.1](https://github.com/railroadmedia/musora-content-services/compare/v2.92.0...v2.92.1) (2025-11-28)
|
|
26
|
+
|
|
27
|
+
## [2.92.0](https://github.com/railroadmedia/musora-content-services/compare/v2.90.0...v2.92.0) (2025-11-28)
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
### Features
|
|
31
|
+
|
|
32
|
+
* add parent id in method progress card cta([#598](https://github.com/railroadmedia/musora-content-services/issues/598)) ([857b311](https://github.com/railroadmedia/musora-content-services/commit/857b311182f090d4af11f6ae96496c068215b201))
|
|
33
|
+
* **BEH-1192:** add fetchLearningPathProgressCheckLessons method ([#595](https://github.com/railroadmedia/musora-content-services/issues/595)) ([3f3f0ea](https://github.com/railroadmedia/musora-content-services/commit/3f3f0ea05bfbf6e44d816fa0edee0402636a1165))
|
|
34
|
+
* **TP-1038:** makes it rain :watermelon: ([e81537c](https://github.com/railroadmedia/musora-content-services/commit/e81537cd5d331f81be413b9e1c71d82a9b410dfa))
|
|
35
|
+
|
|
36
|
+
## [2.91.0](https://github.com/railroadmedia/musora-content-services/compare/v2.90.0...v2.91.0) (2025-11-28)
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
### Features
|
|
40
|
+
|
|
41
|
+
* add parent id in method progress card cta([#598](https://github.com/railroadmedia/musora-content-services/issues/598)) ([857b311](https://github.com/railroadmedia/musora-content-services/commit/857b311182f090d4af11f6ae96496c068215b201))
|
|
42
|
+
* **BEH-1192:** add fetchLearningPathProgressCheckLessons method ([#595](https://github.com/railroadmedia/musora-content-services/issues/595)) ([3f3f0ea](https://github.com/railroadmedia/musora-content-services/commit/3f3f0ea05bfbf6e44d816fa0edee0402636a1165))
|
|
43
|
+
* **TP-1038:** makes it rain :watermelon: ([e81537c](https://github.com/railroadmedia/musora-content-services/commit/e81537cd5d331f81be413b9e1c71d82a9b410dfa))
|
|
44
|
+
|
|
5
45
|
## [2.90.0](https://github.com/railroadmedia/musora-content-services/compare/v2.89.0...v2.90.0) (2025-11-27)
|
|
6
46
|
|
|
7
47
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "musora-content-services",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.92.6",
|
|
4
4
|
"description": "A package for Musoras content services ",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -21,9 +21,12 @@
|
|
|
21
21
|
},
|
|
22
22
|
"homepage": "https://github.com/railroadmedia/musora-content-services#readme",
|
|
23
23
|
"devDependencies": {
|
|
24
|
+
"@babel/preset-env": "^7.25.3",
|
|
24
25
|
"@babel/plugin-transform-class-properties": "^7.27.1",
|
|
25
26
|
"@babel/plugin-transform-object-rest-spread": "^7.28.0",
|
|
26
27
|
"@babel/preset-typescript": "^7.27.1",
|
|
28
|
+
"@sentry/browser": "^10.15.0",
|
|
29
|
+
"babel-jest": "^29.7.0",
|
|
27
30
|
"dotenv": "^16.4.5",
|
|
28
31
|
"jest": "^29.7.0",
|
|
29
32
|
"jsdoc": "^4.0.3",
|
|
@@ -33,11 +36,16 @@
|
|
|
33
36
|
"ts-jest": "^29.2.4"
|
|
34
37
|
},
|
|
35
38
|
"dependencies": {
|
|
36
|
-
"@babel/preset-env": "^7.25.3",
|
|
37
39
|
"@sanity/client": "^5.4.2",
|
|
38
|
-
"babel-jest": "^29.7.0",
|
|
39
40
|
"dayjs": "^1.11.13",
|
|
40
41
|
"docdash": "^2.0.2",
|
|
41
42
|
"groqd": "^0.15.12"
|
|
43
|
+
},
|
|
44
|
+
"peerDependencies": {
|
|
45
|
+
"@nozbe/watermelondb": "0.28.1-0"
|
|
46
|
+
},
|
|
47
|
+
"exports": {
|
|
48
|
+
".": "./src/index.js",
|
|
49
|
+
"./*": "./src/*"
|
|
42
50
|
}
|
|
43
51
|
}
|
package/src/index.d.ts
CHANGED
|
@@ -34,6 +34,7 @@ import {
|
|
|
34
34
|
completeLearningPathIntroVideo,
|
|
35
35
|
completeMethodIntroVideo,
|
|
36
36
|
fetchLearningPathLessons,
|
|
37
|
+
fetchLearningPathProgressCheckLessons,
|
|
37
38
|
getActivePath,
|
|
38
39
|
getDailySession,
|
|
39
40
|
getEnrichedLearningPath,
|
|
@@ -91,16 +92,14 @@ import {
|
|
|
91
92
|
contentStatusReset,
|
|
92
93
|
contentStatusStarted,
|
|
93
94
|
getAllCompleted,
|
|
95
|
+
getAllCompletedByIds,
|
|
94
96
|
getAllStarted,
|
|
95
97
|
getAllStartedOrCompleted,
|
|
96
98
|
getLastInteractedOf,
|
|
97
99
|
getNavigateTo,
|
|
98
|
-
|
|
99
|
-
getProgressPercentage,
|
|
100
|
-
getProgressPercentageByIds,
|
|
100
|
+
getProgressDataByIds,
|
|
101
101
|
getProgressState,
|
|
102
102
|
getProgressStateByIds,
|
|
103
|
-
getResumeTimeSeconds,
|
|
104
103
|
getResumeTimeSecondsByIds,
|
|
105
104
|
getStartedOrCompletedProgressOnly,
|
|
106
105
|
recordWatchSession
|
|
@@ -201,7 +200,6 @@ import {
|
|
|
201
200
|
fetchCompletedState,
|
|
202
201
|
fetchContentInProgress,
|
|
203
202
|
fetchContentPageUserData,
|
|
204
|
-
fetchContentProgress,
|
|
205
203
|
fetchHandler,
|
|
206
204
|
fetchLastInteractedChild,
|
|
207
205
|
fetchLikeCount,
|
|
@@ -211,22 +209,13 @@ import {
|
|
|
211
209
|
fetchTopComment,
|
|
212
210
|
fetchUserAward,
|
|
213
211
|
fetchUserBadges,
|
|
214
|
-
fetchUserLikes,
|
|
215
212
|
fetchUserPermissionsData,
|
|
216
213
|
fetchUserPracticeMeta,
|
|
217
214
|
fetchUserPracticeNotes,
|
|
218
215
|
fetchUserPractices,
|
|
219
216
|
likeComment,
|
|
220
|
-
logUserPractice,
|
|
221
217
|
openComment,
|
|
222
|
-
postContentComplete,
|
|
223
|
-
postContentLiked,
|
|
224
|
-
postContentReset,
|
|
225
|
-
postContentRestore,
|
|
226
|
-
postContentStart,
|
|
227
|
-
postContentUnliked,
|
|
228
218
|
postPlaylistContentEngaged,
|
|
229
|
-
postRecordWatchSession,
|
|
230
219
|
replyToComment,
|
|
231
220
|
reportComment,
|
|
232
221
|
restoreComment,
|
|
@@ -402,7 +391,6 @@ import {
|
|
|
402
391
|
getProgressRows,
|
|
403
392
|
getRecentActivity,
|
|
404
393
|
getUserMonthlyStats,
|
|
405
|
-
getUserPractices,
|
|
406
394
|
getUserWeeklyStats,
|
|
407
395
|
pinProgressRow,
|
|
408
396
|
recordUserActivity,
|
|
@@ -411,13 +399,14 @@ import {
|
|
|
411
399
|
restorePracticeSession,
|
|
412
400
|
restoreUserActivity,
|
|
413
401
|
restoreUserPractice,
|
|
402
|
+
trackUserPractice,
|
|
414
403
|
unpinProgressRow,
|
|
415
404
|
updatePracticeNotes,
|
|
416
405
|
updateUserPractice
|
|
417
406
|
} from './services/userActivity.js';
|
|
418
407
|
|
|
419
408
|
import {
|
|
420
|
-
default as EventsAPI
|
|
409
|
+
default as EventsAPI
|
|
421
410
|
} from './services/eventsAPI';
|
|
422
411
|
|
|
423
412
|
declare module 'musora-content-services' {
|
|
@@ -488,7 +477,6 @@ declare module 'musora-content-services' {
|
|
|
488
477
|
fetchCompletedState,
|
|
489
478
|
fetchContentInProgress,
|
|
490
479
|
fetchContentPageUserData,
|
|
491
|
-
fetchContentProgress,
|
|
492
480
|
fetchContentRows,
|
|
493
481
|
fetchCustomerPayments,
|
|
494
482
|
fetchEnrollmentPageMetadata,
|
|
@@ -507,6 +495,7 @@ declare module 'musora-content-services' {
|
|
|
507
495
|
fetchLastInteractedChild,
|
|
508
496
|
fetchLatestThreads,
|
|
509
497
|
fetchLearningPathLessons,
|
|
498
|
+
fetchLearningPathProgressCheckLessons,
|
|
510
499
|
fetchLeaving,
|
|
511
500
|
fetchLessonContent,
|
|
512
501
|
fetchLessonsFeaturingThisContent,
|
|
@@ -562,7 +551,6 @@ declare module 'musora-content-services' {
|
|
|
562
551
|
fetchUpcomingEvents,
|
|
563
552
|
fetchUserAward,
|
|
564
553
|
fetchUserBadges,
|
|
565
|
-
fetchUserLikes,
|
|
566
554
|
fetchUserPermissions,
|
|
567
555
|
fetchUserPermissionsData,
|
|
568
556
|
fetchUserPlaylists,
|
|
@@ -574,6 +562,7 @@ declare module 'musora-content-services' {
|
|
|
574
562
|
getActiveDiscussions,
|
|
575
563
|
getActivePath,
|
|
576
564
|
getAllCompleted,
|
|
565
|
+
getAllCompletedByIds,
|
|
577
566
|
getAllStarted,
|
|
578
567
|
getAllStartedOrCompleted,
|
|
579
568
|
getAwardDataForGuidedContent,
|
|
@@ -593,9 +582,7 @@ declare module 'musora-content-services' {
|
|
|
593
582
|
getOwnedContent,
|
|
594
583
|
getPracticeNotes,
|
|
595
584
|
getPracticeSessions,
|
|
596
|
-
|
|
597
|
-
getProgressPercentage,
|
|
598
|
-
getProgressPercentageByIds,
|
|
585
|
+
getProgressDataByIds,
|
|
599
586
|
getProgressRows,
|
|
600
587
|
getProgressState,
|
|
601
588
|
getProgressStateByIds,
|
|
@@ -603,7 +590,6 @@ declare module 'musora-content-services' {
|
|
|
603
590
|
getRecentActivity,
|
|
604
591
|
getRecommendedForYou,
|
|
605
592
|
getReportIssueOptions,
|
|
606
|
-
getResumeTimeSeconds,
|
|
607
593
|
getResumeTimeSecondsByIds,
|
|
608
594
|
getSanityDate,
|
|
609
595
|
getScheduleContentRows,
|
|
@@ -614,7 +600,6 @@ declare module 'musora-content-services' {
|
|
|
614
600
|
getToday,
|
|
615
601
|
getUserData,
|
|
616
602
|
getUserMonthlyStats,
|
|
617
|
-
getUserPractices,
|
|
618
603
|
getUserSignature,
|
|
619
604
|
getUserWeeklyStats,
|
|
620
605
|
getWeekNumber,
|
|
@@ -634,7 +619,6 @@ declare module 'musora-content-services' {
|
|
|
634
619
|
likePlaylist,
|
|
635
620
|
likePost,
|
|
636
621
|
lockThread,
|
|
637
|
-
logUserPractice,
|
|
638
622
|
login,
|
|
639
623
|
logout,
|
|
640
624
|
mapContentToParent,
|
|
@@ -650,14 +634,7 @@ declare module 'musora-content-services' {
|
|
|
650
634
|
pauseLiveEventPolling,
|
|
651
635
|
pinProgressRow,
|
|
652
636
|
pinThread,
|
|
653
|
-
postContentComplete,
|
|
654
|
-
postContentLiked,
|
|
655
|
-
postContentReset,
|
|
656
|
-
postContentRestore,
|
|
657
|
-
postContentStart,
|
|
658
|
-
postContentUnliked,
|
|
659
637
|
postPlaylistContentEngaged,
|
|
660
|
-
postRecordWatchSession,
|
|
661
638
|
rankCategories,
|
|
662
639
|
rankItems,
|
|
663
640
|
recommendations,
|
|
@@ -696,6 +673,7 @@ declare module 'musora-content-services' {
|
|
|
696
673
|
togglePlaylistPrivate,
|
|
697
674
|
toggleSignaturePrivate,
|
|
698
675
|
toggleStudentView,
|
|
676
|
+
trackUserPractice,
|
|
699
677
|
unEnrollUserInGuidedCourse,
|
|
700
678
|
unassignModeratorToComment,
|
|
701
679
|
unblockUser,
|
package/src/index.js
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
/*** This file was generated automatically. To recreate, please run `npm run build-index`. ***/
|
|
2
2
|
|
|
3
|
+
import {
|
|
4
|
+
default as EventsAPI
|
|
5
|
+
} from './services/eventsAPI';
|
|
6
|
+
|
|
3
7
|
import {
|
|
4
8
|
globalConfig,
|
|
5
9
|
initializeService
|
|
@@ -34,6 +38,7 @@ import {
|
|
|
34
38
|
completeLearningPathIntroVideo,
|
|
35
39
|
completeMethodIntroVideo,
|
|
36
40
|
fetchLearningPathLessons,
|
|
41
|
+
fetchLearningPathProgressCheckLessons,
|
|
37
42
|
getActivePath,
|
|
38
43
|
getDailySession,
|
|
39
44
|
getEnrichedLearningPath,
|
|
@@ -91,16 +96,14 @@ import {
|
|
|
91
96
|
contentStatusReset,
|
|
92
97
|
contentStatusStarted,
|
|
93
98
|
getAllCompleted,
|
|
99
|
+
getAllCompletedByIds,
|
|
94
100
|
getAllStarted,
|
|
95
101
|
getAllStartedOrCompleted,
|
|
96
102
|
getLastInteractedOf,
|
|
97
103
|
getNavigateTo,
|
|
98
|
-
|
|
99
|
-
getProgressPercentage,
|
|
100
|
-
getProgressPercentageByIds,
|
|
104
|
+
getProgressDataByIds,
|
|
101
105
|
getProgressState,
|
|
102
106
|
getProgressStateByIds,
|
|
103
|
-
getResumeTimeSeconds,
|
|
104
107
|
getResumeTimeSecondsByIds,
|
|
105
108
|
getStartedOrCompletedProgressOnly,
|
|
106
109
|
recordWatchSession
|
|
@@ -201,7 +204,6 @@ import {
|
|
|
201
204
|
fetchCompletedState,
|
|
202
205
|
fetchContentInProgress,
|
|
203
206
|
fetchContentPageUserData,
|
|
204
|
-
fetchContentProgress,
|
|
205
207
|
fetchHandler,
|
|
206
208
|
fetchLastInteractedChild,
|
|
207
209
|
fetchLikeCount,
|
|
@@ -211,22 +213,13 @@ import {
|
|
|
211
213
|
fetchTopComment,
|
|
212
214
|
fetchUserAward,
|
|
213
215
|
fetchUserBadges,
|
|
214
|
-
fetchUserLikes,
|
|
215
216
|
fetchUserPermissionsData,
|
|
216
217
|
fetchUserPracticeMeta,
|
|
217
218
|
fetchUserPracticeNotes,
|
|
218
219
|
fetchUserPractices,
|
|
219
220
|
likeComment,
|
|
220
|
-
logUserPractice,
|
|
221
221
|
openComment,
|
|
222
|
-
postContentComplete,
|
|
223
|
-
postContentLiked,
|
|
224
|
-
postContentReset,
|
|
225
|
-
postContentRestore,
|
|
226
|
-
postContentStart,
|
|
227
|
-
postContentUnliked,
|
|
228
222
|
postPlaylistContentEngaged,
|
|
229
|
-
postRecordWatchSession,
|
|
230
223
|
replyToComment,
|
|
231
224
|
reportComment,
|
|
232
225
|
restoreComment,
|
|
@@ -402,7 +395,6 @@ import {
|
|
|
402
395
|
getProgressRows,
|
|
403
396
|
getRecentActivity,
|
|
404
397
|
getUserMonthlyStats,
|
|
405
|
-
getUserPractices,
|
|
406
398
|
getUserWeeklyStats,
|
|
407
399
|
pinProgressRow,
|
|
408
400
|
recordUserActivity,
|
|
@@ -411,15 +403,12 @@ import {
|
|
|
411
403
|
restorePracticeSession,
|
|
412
404
|
restoreUserActivity,
|
|
413
405
|
restoreUserPractice,
|
|
406
|
+
trackUserPractice,
|
|
414
407
|
unpinProgressRow,
|
|
415
408
|
updatePracticeNotes,
|
|
416
409
|
updateUserPractice
|
|
417
410
|
} from './services/userActivity.js';
|
|
418
411
|
|
|
419
|
-
import {
|
|
420
|
-
default as EventsAPI
|
|
421
|
-
} from './services/eventsAPI';
|
|
422
|
-
|
|
423
412
|
export {
|
|
424
413
|
addContextToContent,
|
|
425
414
|
addItemToPlaylist,
|
|
@@ -487,7 +476,6 @@ export {
|
|
|
487
476
|
fetchCompletedState,
|
|
488
477
|
fetchContentInProgress,
|
|
489
478
|
fetchContentPageUserData,
|
|
490
|
-
fetchContentProgress,
|
|
491
479
|
fetchContentRows,
|
|
492
480
|
fetchCustomerPayments,
|
|
493
481
|
fetchEnrollmentPageMetadata,
|
|
@@ -506,6 +494,7 @@ export {
|
|
|
506
494
|
fetchLastInteractedChild,
|
|
507
495
|
fetchLatestThreads,
|
|
508
496
|
fetchLearningPathLessons,
|
|
497
|
+
fetchLearningPathProgressCheckLessons,
|
|
509
498
|
fetchLeaving,
|
|
510
499
|
fetchLessonContent,
|
|
511
500
|
fetchLessonsFeaturingThisContent,
|
|
@@ -561,7 +550,6 @@ export {
|
|
|
561
550
|
fetchUpcomingEvents,
|
|
562
551
|
fetchUserAward,
|
|
563
552
|
fetchUserBadges,
|
|
564
|
-
fetchUserLikes,
|
|
565
553
|
fetchUserPermissions,
|
|
566
554
|
fetchUserPermissionsData,
|
|
567
555
|
fetchUserPlaylists,
|
|
@@ -573,6 +561,7 @@ export {
|
|
|
573
561
|
getActiveDiscussions,
|
|
574
562
|
getActivePath,
|
|
575
563
|
getAllCompleted,
|
|
564
|
+
getAllCompletedByIds,
|
|
576
565
|
getAllStarted,
|
|
577
566
|
getAllStartedOrCompleted,
|
|
578
567
|
getAwardDataForGuidedContent,
|
|
@@ -592,9 +581,7 @@ export {
|
|
|
592
581
|
getOwnedContent,
|
|
593
582
|
getPracticeNotes,
|
|
594
583
|
getPracticeSessions,
|
|
595
|
-
|
|
596
|
-
getProgressPercentage,
|
|
597
|
-
getProgressPercentageByIds,
|
|
584
|
+
getProgressDataByIds,
|
|
598
585
|
getProgressRows,
|
|
599
586
|
getProgressState,
|
|
600
587
|
getProgressStateByIds,
|
|
@@ -602,7 +589,6 @@ export {
|
|
|
602
589
|
getRecentActivity,
|
|
603
590
|
getRecommendedForYou,
|
|
604
591
|
getReportIssueOptions,
|
|
605
|
-
getResumeTimeSeconds,
|
|
606
592
|
getResumeTimeSecondsByIds,
|
|
607
593
|
getSanityDate,
|
|
608
594
|
getScheduleContentRows,
|
|
@@ -613,7 +599,6 @@ export {
|
|
|
613
599
|
getToday,
|
|
614
600
|
getUserData,
|
|
615
601
|
getUserMonthlyStats,
|
|
616
|
-
getUserPractices,
|
|
617
602
|
getUserSignature,
|
|
618
603
|
getUserWeeklyStats,
|
|
619
604
|
getWeekNumber,
|
|
@@ -633,7 +618,6 @@ export {
|
|
|
633
618
|
likePlaylist,
|
|
634
619
|
likePost,
|
|
635
620
|
lockThread,
|
|
636
|
-
logUserPractice,
|
|
637
621
|
login,
|
|
638
622
|
logout,
|
|
639
623
|
mapContentToParent,
|
|
@@ -649,14 +633,7 @@ export {
|
|
|
649
633
|
pauseLiveEventPolling,
|
|
650
634
|
pinProgressRow,
|
|
651
635
|
pinThread,
|
|
652
|
-
postContentComplete,
|
|
653
|
-
postContentLiked,
|
|
654
|
-
postContentReset,
|
|
655
|
-
postContentRestore,
|
|
656
|
-
postContentStart,
|
|
657
|
-
postContentUnliked,
|
|
658
636
|
postPlaylistContentEngaged,
|
|
659
|
-
postRecordWatchSession,
|
|
660
637
|
rankCategories,
|
|
661
638
|
rankItems,
|
|
662
639
|
recommendations,
|
|
@@ -695,6 +672,7 @@ export {
|
|
|
695
672
|
togglePlaylistPrivate,
|
|
696
673
|
toggleSignaturePrivate,
|
|
697
674
|
toggleStudentView,
|
|
675
|
+
trackUserPractice,
|
|
698
676
|
unEnrollUserInGuidedCourse,
|
|
699
677
|
unassignModeratorToComment,
|
|
700
678
|
unblockUser,
|
|
@@ -8,6 +8,7 @@ import { addContextToContent } from '../contentAggregator.js'
|
|
|
8
8
|
import {
|
|
9
9
|
contentStatusCompleted,
|
|
10
10
|
contentStatusReset,
|
|
11
|
+
getAllCompletedByIds,
|
|
11
12
|
getProgressState,
|
|
12
13
|
} from '../contentProgress.js'
|
|
13
14
|
|
|
@@ -220,6 +221,35 @@ export async function fetchLearningPathLessons(
|
|
|
220
221
|
}
|
|
221
222
|
}
|
|
222
223
|
|
|
224
|
+
/**
|
|
225
|
+
* For an array of contentIds, fetch any content progress with state=completed,
|
|
226
|
+
* including other learning paths and a la carte progress.
|
|
227
|
+
*
|
|
228
|
+
* @param contentIds The array of content IDs within the learning path
|
|
229
|
+
* @param learningPathId The learning path ID
|
|
230
|
+
* @returns {Promise<Object>} Response object
|
|
231
|
+
* @returns {Array} result.lessons - Array of all learning path lesson contentIds.
|
|
232
|
+
* @returns {Array} result.completed_lessons - Array of learning path lesson contentIds that are completed.
|
|
233
|
+
* @returns {Array} result.lessons_count - Count of learning path lessons.
|
|
234
|
+
* @returns {Array} result.completed_lessons_count - Count of learning path completed lessons.
|
|
235
|
+
*/
|
|
236
|
+
export async function fetchLearningPathProgressCheckLessons(
|
|
237
|
+
contentIds: number[],
|
|
238
|
+
learningPathId: number
|
|
239
|
+
): Promise<object> {
|
|
240
|
+
let query = await getAllCompletedByIds(contentIds, {
|
|
241
|
+
id: learningPathId,
|
|
242
|
+
type: 'learning-path-v2',
|
|
243
|
+
})
|
|
244
|
+
let completedContentIds = query.data
|
|
245
|
+
return {
|
|
246
|
+
lessons: contentIds,
|
|
247
|
+
completed_lessons: completedContentIds,
|
|
248
|
+
lessons_count: contentIds.length,
|
|
249
|
+
completed_lessons_count: completedContentIds.length,
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
|
|
223
253
|
interface completeMethodIntroVideo {
|
|
224
254
|
intro_video_response: Object | null,
|
|
225
255
|
active_path_response: ActiveLearningPathResponse
|
|
@@ -238,7 +268,7 @@ export async function completeMethodIntroVideo(introVideoId: number, brand: stri
|
|
|
238
268
|
response.intro_video_response = await completeIfNotCompleted(introVideoId)
|
|
239
269
|
|
|
240
270
|
const methodStructure = await fetchMethodV2Structure(brand)
|
|
241
|
-
const learningPathId = methodStructure.
|
|
271
|
+
const learningPathId = methodStructure.learning_paths[0].id
|
|
242
272
|
|
|
243
273
|
response.active_path_response = await startLearningPath(brand, learningPathId)
|
|
244
274
|
|
|
@@ -249,7 +279,7 @@ export async function completeMethodIntroVideo(introVideoId: number, brand: stri
|
|
|
249
279
|
interface completeLearningPathIntroVideo {
|
|
250
280
|
intro_video_response: Object | null,
|
|
251
281
|
learning_path_reset_response: void | null,
|
|
252
|
-
lesson_import_response: Object
|
|
282
|
+
lesson_import_response: Object | null
|
|
253
283
|
}
|
|
254
284
|
/**
|
|
255
285
|
* Handles completion of learning path intro video and other related actions.
|
|
@@ -269,12 +299,12 @@ export async function completeLearningPathIntroVideo(introVideoId: number, learn
|
|
|
269
299
|
const collection = { id: learningPathId, type: 'learning-path-v2' }
|
|
270
300
|
|
|
271
301
|
if (!lessonsToImport) {
|
|
272
|
-
// returns nothing now, but it will when watermelon comes 'round
|
|
273
302
|
response.learning_path_reset_response = await contentStatusReset(learningPathId, collection)
|
|
274
303
|
|
|
275
304
|
} else {
|
|
276
305
|
response.lesson_import_response = {}
|
|
277
306
|
for (const contentId of lessonsToImport) {
|
|
307
|
+
// todo: create bulk complete endpoint with bubbling. and set up watermelon method bubbling
|
|
278
308
|
response.lesson_import_response[contentId] = await contentStatusCompleted(contentId, collection)
|
|
279
309
|
}
|
|
280
310
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getNavigateTo,
|
|
3
|
-
|
|
3
|
+
getProgressDataByIds,
|
|
4
4
|
getProgressStateByIds,
|
|
5
5
|
getResumeTimeSecondsByIds,
|
|
6
6
|
} from './contentProgress'
|
|
@@ -93,7 +93,7 @@ export async function addContextToContent(dataPromise, ...dataArgs) {
|
|
|
93
93
|
navigateToData,
|
|
94
94
|
] = await Promise.all([ //for now assume these all return `collection = {type, id}`. it will be so when watermelon here
|
|
95
95
|
addProgressPercentage || addProgressStatus || addProgressTimestamp
|
|
96
|
-
?
|
|
96
|
+
? getProgressDataByIds(ids, collection) : Promise.resolve(null),
|
|
97
97
|
addIsLiked ? isContentLikedByIds(ids, collection) : Promise.resolve(null),
|
|
98
98
|
addResumeTimeSeconds ? getResumeTimeSecondsByIds(ids, collection) : Promise.resolve(null),
|
|
99
99
|
addLastInteractedChild ? fetchLastInteractedChild(ids, collection) : Promise.resolve(null),
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { DataContext, ContentLikesVersionKey } from './dataContext.js'
|
|
1
|
+
import { db } from './sync'
|
|
3
2
|
|
|
4
3
|
/**
|
|
5
4
|
* Exported functions that are excluded from index generation.
|
|
@@ -8,51 +7,19 @@ import { DataContext, ContentLikesVersionKey } from './dataContext.js'
|
|
|
8
7
|
*/
|
|
9
8
|
const excludeFromGeneratedIndex = []
|
|
10
9
|
|
|
11
|
-
export let dataContext = new DataContext(ContentLikesVersionKey, fetchUserLikes)
|
|
12
|
-
|
|
13
10
|
export async function isContentLiked(contentId) {
|
|
14
|
-
|
|
15
|
-
let data = await dataContext.getData()
|
|
16
|
-
return data.includes(contentId)
|
|
11
|
+
return (await db.likes.isLiked(contentId)).data
|
|
17
12
|
}
|
|
18
13
|
|
|
19
14
|
export async function isContentLikedByIds(contentIds) {
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
contentIds?.forEach((id) => (likes[id] = data.includes(id)))
|
|
24
|
-
|
|
25
|
-
return likes
|
|
15
|
+
const existences = await db.likes.areLiked(contentIds)
|
|
16
|
+
return Object.fromEntries(contentIds.map((id, i) => [id, existences.data[i]]))
|
|
26
17
|
}
|
|
27
18
|
|
|
28
19
|
export async function likeContent(contentId) {
|
|
29
|
-
|
|
30
|
-
await dataContext.update(
|
|
31
|
-
function (localContext) {
|
|
32
|
-
if (!localContext.data.includes(contentId)) {
|
|
33
|
-
localContext.data.push(contentId)
|
|
34
|
-
}
|
|
35
|
-
},
|
|
36
|
-
async function () {
|
|
37
|
-
return postContentLiked(contentId)
|
|
38
|
-
}
|
|
39
|
-
)
|
|
20
|
+
return db.likes.like(contentId)
|
|
40
21
|
}
|
|
41
22
|
|
|
42
23
|
export async function unlikeContent(contentId) {
|
|
43
|
-
|
|
44
|
-
await dataContext.update(
|
|
45
|
-
function (localContext) {
|
|
46
|
-
if (localContext.data.includes(contentId)) {
|
|
47
|
-
const index = localContext.data.indexOf(contentId)
|
|
48
|
-
if (index > -1) {
|
|
49
|
-
// only splice array when item is found
|
|
50
|
-
localContext.data.splice(index, 1) // 2nd parameter means remove one item only
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
},
|
|
54
|
-
async function () {
|
|
55
|
-
return postContentUnliked(contentId)
|
|
56
|
-
}
|
|
57
|
-
)
|
|
24
|
+
return db.likes.unlike(contentId)
|
|
58
25
|
}
|