musora-content-services 1.6.1 → 1.6.3
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/.github/workflows/node.js.yml +0 -0
- package/.prettierignore +0 -0
- package/.prettierrc +0 -0
- package/CHANGELOG.md +4 -0
- package/README.md +0 -0
- package/babel.config.cjs +0 -0
- 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 -0
- 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 -0
- 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/scripts/collapse.js +0 -0
- package/docs/scripts/commonNav.js +0 -0
- package/docs/scripts/linenumber.js +0 -0
- package/docs/scripts/nav.js +0 -0
- package/docs/scripts/polyfill.js +0 -0
- package/docs/scripts/prettify/Apache-License-2.0.txt +0 -0
- package/docs/scripts/prettify/lang-css.js +0 -0
- package/docs/scripts/prettify/prettify.js +0 -0
- package/docs/scripts/search.js +0 -0
- package/docs/styles/jsdoc.css +0 -0
- package/docs/styles/prettify.css +0 -0
- package/jest.config.js +0 -0
- package/package.json +1 -1
- package/src/services/lastUpdated.js +4 -2
- package/src/services/sanity.js +5 -0
- package/src/services/userPermissions.js +1 -1
- package/test/lastUpdated.test.js +3 -3
- package/test/live/contentProgressLive.test.js +0 -0
- package/test/live/railcontentLive.test.js +0 -0
- package/test/localStorageMock.js +0 -0
- package/test/log.js +0 -0
|
File without changes
|
package/.prettierignore
CHANGED
|
File without changes
|
package/.prettierrc
CHANGED
|
File without changes
|
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
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
|
+
### [1.6.3](https://github.com/railroadmedia/musora-content-services/compare/v1.6.2...v1.6.3) (2025-06-12)
|
|
6
|
+
|
|
7
|
+
### [1.6.2](https://github.com/railroadmedia/musora-content-services/compare/v1.6.1...v1.6.2) (2025-06-11)
|
|
8
|
+
|
|
5
9
|
### [1.6.1](https://github.com/railroadmedia/musora-content-services/compare/v1.6.0...v1.6.1) (2025-06-11)
|
|
6
10
|
|
|
7
11
|
## [1.6.0](https://github.com/railroadmedia/musora-content-services/compare/v1.5.0...v1.6.0) (2025-06-04)
|
package/README.md
CHANGED
|
File without changes
|
package/babel.config.cjs
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
|
|
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/docs/scripts/collapse.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/docs/scripts/nav.js
CHANGED
|
File without changes
|
package/docs/scripts/polyfill.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/docs/scripts/search.js
CHANGED
|
File without changes
|
package/docs/styles/jsdoc.css
CHANGED
|
File without changes
|
package/docs/styles/prettify.css
CHANGED
|
File without changes
|
package/jest.config.js
CHANGED
|
File without changes
|
package/package.json
CHANGED
|
@@ -11,8 +11,10 @@ const excludeFromGeneratedIndex = [
|
|
|
11
11
|
'clearLastUpdatedTime',
|
|
12
12
|
]
|
|
13
13
|
|
|
14
|
-
export function wasLastUpdateOlderThanXSeconds(seconds, key) {
|
|
15
|
-
let lastUpdated = globalConfig.
|
|
14
|
+
export async function wasLastUpdateOlderThanXSeconds(seconds, key) {
|
|
15
|
+
let lastUpdated = globalConfig.isMA
|
|
16
|
+
? await globalConfig.localStorage.getItem(key)
|
|
17
|
+
: globalConfig.localStorage.getItem(key)
|
|
16
18
|
if (!lastUpdated) return false
|
|
17
19
|
const verifyServerTime = seconds * 1000
|
|
18
20
|
return new Date().getTime() - lastUpdated > verifyServerTime
|
package/src/services/sanity.js
CHANGED
|
@@ -1979,6 +1979,11 @@ function needsAccessDecorator(results, userPermissions, isAdmin) {
|
|
|
1979
1979
|
result['need_access'] = doesUserNeedAccessToContent(result, userPermissions, isAdmin)
|
|
1980
1980
|
})
|
|
1981
1981
|
} else {
|
|
1982
|
+
if (results.lessons) {
|
|
1983
|
+
results.lessons.forEach((lesson) => {
|
|
1984
|
+
lesson['need_access'] = doesUserNeedAccessToContent(lesson, userPermissions, isAdmin) // Updated to check lesson access
|
|
1985
|
+
})
|
|
1986
|
+
}
|
|
1982
1987
|
results['need_access'] = doesUserNeedAccessToContent(results, userPermissions, isAdmin)
|
|
1983
1988
|
}
|
|
1984
1989
|
|
|
@@ -15,7 +15,7 @@ let userPermissionsPromise = null
|
|
|
15
15
|
let lastUpdatedKey = `userPermissions_lastUpdated`
|
|
16
16
|
|
|
17
17
|
export async function fetchUserPermissions() {
|
|
18
|
-
if (!userPermissionsPromise || wasLastUpdateOlderThanXSeconds(10, lastUpdatedKey)) {
|
|
18
|
+
if (!userPermissionsPromise || (await wasLastUpdateOlderThanXSeconds(10, lastUpdatedKey))) {
|
|
19
19
|
userPermissionsPromise = fetchUserPermissionsData()
|
|
20
20
|
setLastUpdatedTime(lastUpdatedKey)
|
|
21
21
|
}
|
package/test/lastUpdated.test.js
CHANGED
|
@@ -11,11 +11,11 @@ describe('lastUpdated', function () {
|
|
|
11
11
|
|
|
12
12
|
test('lastUpdated', async () => {
|
|
13
13
|
setLastUpdatedTime('testKey')
|
|
14
|
-
let test1 = wasLastUpdateOlderThanXSeconds(1, 'testKey')
|
|
14
|
+
let test1 = await wasLastUpdateOlderThanXSeconds(1, 'testKey')
|
|
15
15
|
await new Promise((r) => setTimeout(r, 800))
|
|
16
|
-
let test2 = wasLastUpdateOlderThanXSeconds(1, 'testKey')
|
|
16
|
+
let test2 = await wasLastUpdateOlderThanXSeconds(1, 'testKey')
|
|
17
17
|
await new Promise((r) => setTimeout(r, 500))
|
|
18
|
-
let test3 = wasLastUpdateOlderThanXSeconds(1, 'testKey')
|
|
18
|
+
let test3 = await wasLastUpdateOlderThanXSeconds(1, 'testKey')
|
|
19
19
|
|
|
20
20
|
expect(test1).toEqual(false)
|
|
21
21
|
expect(test2).toEqual(false)
|
|
File without changes
|
|
File without changes
|
package/test/localStorageMock.js
CHANGED
|
File without changes
|
package/test/log.js
CHANGED
|
File without changes
|