musora-content-services 2.140.8 → 2.140.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,15 @@
|
|
|
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.140.9](https://github.com/railroadmedia/musora-content-services/compare/v2.140.8...v2.140.9) (2026-03-24)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* bubbling 0% progress doesnt reset ancestor ([#881](https://github.com/railroadmedia/musora-content-services/issues/881)) ([c1538e5](https://github.com/railroadmedia/musora-content-services/commit/c1538e52a34d839ab9b81cc6f72f8839ef4dcb51))
|
|
11
|
+
* **MU2-1419:** return product brand on account setup ([#882](https://github.com/railroadmedia/musora-content-services/issues/882)) ([c7bf35e](https://github.com/railroadmedia/musora-content-services/commit/c7bf35e06144d132799a5234b8cb1bf188c2307c))
|
|
12
|
+
* **NW-345:** Get to Post for account status endpoint ([d97f97e](https://github.com/railroadmedia/musora-content-services/commit/d97f97e9a04ef4f701636c7c1ee602e96fc546d5))
|
|
13
|
+
|
|
5
14
|
### [2.140.8](https://github.com/railroadmedia/musora-content-services/compare/v2.140.7...v2.140.8) (2026-03-23)
|
|
6
15
|
|
|
7
16
|
|
package/package.json
CHANGED
|
@@ -589,7 +589,7 @@ async function setStartedOrCompletedStatus(contentId, collection, isCompleted, {
|
|
|
589
589
|
}
|
|
590
590
|
|
|
591
591
|
// have to do this so we dont unnecessarily create a 0% record for each child on set to started/completed
|
|
592
|
-
await bubbleAndTrickleProgressesSafely(progresses, collection, metadata)
|
|
592
|
+
await bubbleAndTrickleProgressesSafely(progresses, collection, metadata, false)
|
|
593
593
|
|
|
594
594
|
if (isLP) {
|
|
595
595
|
let exportProgresses = progresses
|
|
@@ -635,7 +635,7 @@ async function setStartedOrCompletedStatusMany(contentIds, collection, isComplet
|
|
|
635
635
|
}
|
|
636
636
|
}
|
|
637
637
|
// have to do this so we dont unnecessarily create a 0% record for each child on set to started/completed
|
|
638
|
-
await bubbleAndTrickleProgressesSafely(progresses, collection, metadata)
|
|
638
|
+
await bubbleAndTrickleProgressesSafely(progresses, collection, metadata, false)
|
|
639
639
|
|
|
640
640
|
if (isLP) {
|
|
641
641
|
let exportProgresses = progresses
|
|
@@ -668,6 +668,7 @@ async function resetStatus(contentId, collection = null, {skipPush = false} = {}
|
|
|
668
668
|
const response = await db.contentProgress.eraseProgress(normalizeContentId(contentId), normalizeCollection(collection), {skipPush: true})
|
|
669
669
|
|
|
670
670
|
const hierarchy = await getHierarchy(contentId, collection)
|
|
671
|
+
const metadata = hierarchy.metadata || {}
|
|
671
672
|
|
|
672
673
|
let progresses = {
|
|
673
674
|
...trickleProgress(hierarchy, contentId, collection, progress),
|
|
@@ -675,7 +676,7 @@ async function resetStatus(contentId, collection = null, {skipPush = false} = {}
|
|
|
675
676
|
}
|
|
676
677
|
|
|
677
678
|
// have to use different endpoints for erase vs record
|
|
678
|
-
await bubbleAndTrickleProgressesSafely(progresses, collection)
|
|
679
|
+
await bubbleAndTrickleProgressesSafely(progresses, collection, metadata, true)
|
|
679
680
|
|
|
680
681
|
if (isLP) {
|
|
681
682
|
progresses[contentId] = progress
|
|
@@ -800,13 +801,17 @@ function getChildrenToDepth(parentId, hierarchy, depth = 1) {
|
|
|
800
801
|
return allChildrenIds
|
|
801
802
|
}
|
|
802
803
|
|
|
803
|
-
async function bubbleAndTrickleProgressesSafely(progresses, collection, metadata) {
|
|
804
|
-
|
|
804
|
+
async function bubbleAndTrickleProgressesSafely(progresses, collection, metadata, isResetAction) {
|
|
805
|
+
let eraseProgresses = {}
|
|
806
|
+
if (isResetAction) {
|
|
807
|
+
eraseProgresses = Object.fromEntries(
|
|
805
808
|
Object.entries(progresses).filter(([_, pct]) => pct === 0)
|
|
806
|
-
|
|
807
|
-
|
|
809
|
+
)
|
|
810
|
+
progresses = Object.fromEntries(
|
|
808
811
|
Object.entries(progresses).filter(([_, pct]) => pct > 0)
|
|
809
|
-
|
|
812
|
+
)
|
|
813
|
+
}
|
|
814
|
+
|
|
810
815
|
if (Object.keys(progresses).length > 0) {
|
|
811
816
|
await db.contentProgress.recordProgressMany(
|
|
812
817
|
progresses,
|
|
@@ -16,10 +16,10 @@ import { AuthResponse } from './types'
|
|
|
16
16
|
*/
|
|
17
17
|
export async function status(email: string): Promise<{ requires_setup: boolean }> {
|
|
18
18
|
const httpClient = new HttpClient(globalConfig.baseUrl)
|
|
19
|
-
|
|
20
|
-
`/api/user-management-system/v1/accounts/${encodeURIComponent(email)}/status
|
|
19
|
+
return await httpClient.post<{ requires_setup: boolean }>(
|
|
20
|
+
`/api/user-management-system/v1/accounts/${encodeURIComponent(email)}/status`,
|
|
21
|
+
[]
|
|
21
22
|
)
|
|
22
|
-
return response
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
/**
|
|
@@ -48,6 +48,7 @@ export interface AccountSetupProps {
|
|
|
48
48
|
export interface AccountSetupResponse {
|
|
49
49
|
auth: AuthResponse
|
|
50
50
|
onboarding: Onboarding
|
|
51
|
+
product_brand?: string
|
|
51
52
|
}
|
|
52
53
|
|
|
53
54
|
/**
|