musora-content-services 2.99.2 → 2.99.5
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,23 @@
|
|
|
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.99.5](https://github.com/railroadmedia/musora-content-services/compare/v2.99.4...v2.99.5) (2025-12-09)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* daily session created when method intro video completed ([#636](https://github.com/railroadmedia/musora-content-services/issues/636)) ([fdfbb62](https://github.com/railroadmedia/musora-content-services/commit/fdfbb6287348307920ec50b798a0f14520fe4f10))
|
|
11
|
+
|
|
12
|
+
### [2.99.4](https://github.com/railroadmedia/musora-content-services/compare/v2.99.3...v2.99.4) (2025-12-09)
|
|
13
|
+
|
|
14
|
+
### [2.99.3](https://github.com/railroadmedia/musora-content-services/compare/v2.99.2...v2.99.3) (2025-12-09)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Bug Fixes
|
|
18
|
+
|
|
19
|
+
* **agi:** optional query options property access ([e8d9a33](https://github.com/railroadmedia/musora-content-services/commit/e8d9a333462dc8bcfed7af9171bff4380c9d67fd))
|
|
20
|
+
* **groq:** query order and slicing out of place ([97a3c1c](https://github.com/railroadmedia/musora-content-services/commit/97a3c1c9d27745ee78894f3d2c9c5d3e8195efb0))
|
|
21
|
+
|
|
5
22
|
### [2.99.2](https://github.com/railroadmedia/musora-content-services/compare/v2.99.1...v2.99.2) (2025-12-09)
|
|
6
23
|
|
|
7
24
|
|
package/package.json
CHANGED
package/src/lib/sanity/query.ts
CHANGED
|
@@ -111,10 +111,10 @@ export const query = (): QueryBuilder => {
|
|
|
111
111
|
|
|
112
112
|
return `
|
|
113
113
|
*[${filter}]
|
|
114
|
-
${ordering}
|
|
115
|
-
${slice}
|
|
116
114
|
${projection.length > 0 ? `{ ${projection} }` : ''}
|
|
117
115
|
${state.postFilter ? `[${state.postFilter}]` : ''}
|
|
116
|
+
${ordering}
|
|
117
|
+
${slice}
|
|
118
118
|
`.trim()
|
|
119
119
|
},
|
|
120
120
|
|
|
@@ -41,8 +41,8 @@ export async function fetchArtists(
|
|
|
41
41
|
|
|
42
42
|
const data = query()
|
|
43
43
|
.and(`_type == "artist"`)
|
|
44
|
-
.order(options
|
|
45
|
-
.slice(options
|
|
44
|
+
.order(options?.sort || 'lower(name) asc')
|
|
45
|
+
.slice(options?.offset || 0, (options?.offset || 0) + (options?.limit || 20))
|
|
46
46
|
.select(
|
|
47
47
|
'name',
|
|
48
48
|
`"slug": slug.current`,
|
|
@@ -41,8 +41,8 @@ export async function fetchGenres(
|
|
|
41
41
|
|
|
42
42
|
const data = query()
|
|
43
43
|
.and(`_type == "genre"`)
|
|
44
|
-
.order(options
|
|
45
|
-
.slice(options
|
|
44
|
+
.order(options?.sort || 'lower(name) asc')
|
|
45
|
+
.slice(options?.offset || 0, (options?.offset || 0) + (options?.limit || 20))
|
|
46
46
|
.select(
|
|
47
47
|
'name',
|
|
48
48
|
`"slug": slug.current`,
|
|
@@ -42,8 +42,8 @@ export async function fetchInstructors(
|
|
|
42
42
|
|
|
43
43
|
const data = query()
|
|
44
44
|
.and(`_type == "instructor"`)
|
|
45
|
-
.order(options
|
|
46
|
-
.slice(options
|
|
45
|
+
.order(options?.sort || 'lower(name) asc')
|
|
46
|
+
.slice(options?.offset || 0, (options?.offset || 0) + (options?.limit || 20))
|
|
47
47
|
.select(
|
|
48
48
|
'name',
|
|
49
49
|
`"slug": slug.current`,
|
|
@@ -16,6 +16,7 @@ import { COLLECTION_TYPE, STATE } from '../sync/models/ContentProgress'
|
|
|
16
16
|
import { SyncWriteDTO } from '../sync'
|
|
17
17
|
import { ContentProgress } from '../sync/models'
|
|
18
18
|
import { CollectionParameter } from '../sync/repositories/content-progress'
|
|
19
|
+
import { getToday } from "../dateUtils.js";
|
|
19
20
|
|
|
20
21
|
const BASE_PATH: string = `/api/content-org`
|
|
21
22
|
const LEARNING_PATHS_PATH = `${BASE_PATH}/v1/user/learning-paths`
|
|
@@ -315,13 +316,22 @@ export async function completeMethodIntroVideo(
|
|
|
315
316
|
response.intro_video_response = await completeIfNotCompleted(introVideoId)
|
|
316
317
|
|
|
317
318
|
const methodStructure = await fetchMethodV2Structure(brand)
|
|
318
|
-
const
|
|
319
|
+
const firstLearningPathId = methodStructure.learning_paths[0].id
|
|
319
320
|
|
|
320
|
-
response.active_path_response = await
|
|
321
|
+
response.active_path_response = await methodIntroVideoCompleteActions(brand, firstLearningPathId, getToday())
|
|
321
322
|
|
|
322
323
|
return response
|
|
323
324
|
}
|
|
324
325
|
|
|
326
|
+
async function methodIntroVideoCompleteActions(brand: string, learningPathId: number, userDate: Date) {
|
|
327
|
+
const stringDate = userDate.toISOString().split('T')[0]
|
|
328
|
+
const url: string = `${LEARNING_PATHS_PATH}/method-intro-video-complete-actions`
|
|
329
|
+
const body = { brand: brand, learningPathId: learningPathId, userDate: stringDate }
|
|
330
|
+
return (await fetchHandler(url, 'POST', null, body)) as DailySessionResponse
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
|
|
334
|
+
|
|
325
335
|
interface completeLearningPathIntroVideo {
|
|
326
336
|
intro_video_response: SyncWriteDTO<ContentProgress, any> | null
|
|
327
337
|
learning_path_reset_response: SyncWriteDTO<ContentProgress, any> | null
|