musora-content-services 1.3.17 → 1.3.19
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/link_mcs.sh +0 -0
- package/package.json +1 -1
- package/src/contentMetaData.js +0 -4
- package/src/index.d.ts +0 -20
- package/src/index.js +0 -20
- package/src/services/contentLikes.js +0 -0
- package/src/services/contentProgress.js +0 -0
- package/src/services/railcontent.js +8 -121
- 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
- package/.vscode/settings.json +0 -9
|
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.3.19](https://github.com/railroadmedia/musora-content-services/compare/v1.3.18...v1.3.19) (2025-03-18)
|
|
6
|
+
|
|
7
|
+
### [1.3.18](https://github.com/railroadmedia/musora-content-services/compare/v1.3.17...v1.3.18) (2025-03-18)
|
|
8
|
+
|
|
5
9
|
### [1.3.17](https://github.com/railroadmedia/musora-content-services/compare/v1.3.16...v1.3.17) (2025-03-17)
|
|
6
10
|
|
|
7
11
|
### [1.3.16](https://github.com/railroadmedia/musora-content-services/compare/v1.3.15...v1.3.16) (2025-03-14)
|
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/link_mcs.sh
CHANGED
|
File without changes
|
package/package.json
CHANGED
package/src/contentMetaData.js
CHANGED
|
@@ -1029,13 +1029,11 @@ const contentMetadata = {
|
|
|
1029
1029
|
{
|
|
1030
1030
|
name: 'Completed',
|
|
1031
1031
|
short_name: 'COMPLETED',
|
|
1032
|
-
is_group_by: true,
|
|
1033
1032
|
value: 'completed',
|
|
1034
1033
|
},
|
|
1035
1034
|
{
|
|
1036
1035
|
name: 'Owned Challenges',
|
|
1037
1036
|
short_name: 'OWNED CHALLENGES',
|
|
1038
|
-
is_group_by: true,
|
|
1039
1037
|
value: 'owned',
|
|
1040
1038
|
},
|
|
1041
1039
|
],
|
|
@@ -1158,13 +1156,11 @@ const contentMetadata = {
|
|
|
1158
1156
|
{
|
|
1159
1157
|
name: 'Completed',
|
|
1160
1158
|
short_name: 'COMPLETED',
|
|
1161
|
-
is_group_by: true,
|
|
1162
1159
|
value: 'completed',
|
|
1163
1160
|
},
|
|
1164
1161
|
{
|
|
1165
1162
|
name: 'Owned Challenges',
|
|
1166
1163
|
short_name: 'OWNED CHALLENGES',
|
|
1167
|
-
is_group_by: true,
|
|
1168
1164
|
value: 'owned',
|
|
1169
1165
|
},
|
|
1170
1166
|
],
|
package/src/index.d.ts
CHANGED
|
@@ -38,17 +38,12 @@ import {
|
|
|
38
38
|
|
|
39
39
|
import {
|
|
40
40
|
addItemToPlaylist,
|
|
41
|
-
assignModeratorToComment,
|
|
42
|
-
closeComment,
|
|
43
41
|
countAssignmentsAndLessons,
|
|
44
|
-
createComment,
|
|
45
42
|
createPlaylist,
|
|
46
|
-
deleteComment,
|
|
47
43
|
deletePlaylist,
|
|
48
44
|
deletePlaylistItem,
|
|
49
45
|
deletePlaylistLike,
|
|
50
46
|
duplicatePlaylist,
|
|
51
|
-
editComment,
|
|
52
47
|
fetchAllCompletedStates,
|
|
53
48
|
fetchCarouselCardData,
|
|
54
49
|
fetchChallengeIndexMetadata,
|
|
@@ -78,9 +73,7 @@ import {
|
|
|
78
73
|
fetchUserLikes,
|
|
79
74
|
fetchUserPermissionsData,
|
|
80
75
|
fetchUserPlaylists,
|
|
81
|
-
likeComment,
|
|
82
76
|
likePlaylist,
|
|
83
|
-
openComment,
|
|
84
77
|
pinPlaylist,
|
|
85
78
|
playback,
|
|
86
79
|
postChallengesCommunityNotification,
|
|
@@ -97,11 +90,8 @@ import {
|
|
|
97
90
|
postContentReset,
|
|
98
91
|
postContentUnliked,
|
|
99
92
|
postRecordWatchSession,
|
|
100
|
-
replyToComment,
|
|
101
93
|
reportPlaylist,
|
|
102
94
|
setStudentViewForUser,
|
|
103
|
-
unassignModeratorToComment,
|
|
104
|
-
unlikeComment,
|
|
105
95
|
unpinPlaylist,
|
|
106
96
|
updatePlaylist,
|
|
107
97
|
updatePlaylistItem
|
|
@@ -165,21 +155,16 @@ import {
|
|
|
165
155
|
declare module 'musora-content-services' {
|
|
166
156
|
export {
|
|
167
157
|
addItemToPlaylist,
|
|
168
|
-
assignModeratorToComment,
|
|
169
158
|
assignmentStatusCompleted,
|
|
170
159
|
assignmentStatusReset,
|
|
171
|
-
closeComment,
|
|
172
160
|
contentStatusCompleted,
|
|
173
161
|
contentStatusReset,
|
|
174
162
|
countAssignmentsAndLessons,
|
|
175
|
-
createComment,
|
|
176
163
|
createPlaylist,
|
|
177
|
-
deleteComment,
|
|
178
164
|
deletePlaylist,
|
|
179
165
|
deletePlaylistItem,
|
|
180
166
|
deletePlaylistLike,
|
|
181
167
|
duplicatePlaylist,
|
|
182
|
-
editComment,
|
|
183
168
|
fetchAll,
|
|
184
169
|
fetchAllCompletedStates,
|
|
185
170
|
fetchAllFilterOptions,
|
|
@@ -262,10 +247,8 @@ declare module 'musora-content-services' {
|
|
|
262
247
|
initializeService,
|
|
263
248
|
isContentLiked,
|
|
264
249
|
jumpToContinueContent,
|
|
265
|
-
likeComment,
|
|
266
250
|
likeContent,
|
|
267
251
|
likePlaylist,
|
|
268
|
-
openComment,
|
|
269
252
|
pinPlaylist,
|
|
270
253
|
playback,
|
|
271
254
|
postChallengesCommunityNotification,
|
|
@@ -285,14 +268,11 @@ declare module 'musora-content-services' {
|
|
|
285
268
|
rankCategories,
|
|
286
269
|
rankItems,
|
|
287
270
|
recordWatchSession,
|
|
288
|
-
replyToComment,
|
|
289
271
|
reportPlaylist,
|
|
290
272
|
reset,
|
|
291
273
|
setLastUpdatedTime,
|
|
292
274
|
setStudentViewForUser,
|
|
293
275
|
similarItems,
|
|
294
|
-
unassignModeratorToComment,
|
|
295
|
-
unlikeComment,
|
|
296
276
|
unlikeContent,
|
|
297
277
|
unpinPlaylist,
|
|
298
278
|
updatePlaylist,
|
package/src/index.js
CHANGED
|
@@ -38,17 +38,12 @@ import {
|
|
|
38
38
|
|
|
39
39
|
import {
|
|
40
40
|
addItemToPlaylist,
|
|
41
|
-
assignModeratorToComment,
|
|
42
|
-
closeComment,
|
|
43
41
|
countAssignmentsAndLessons,
|
|
44
|
-
createComment,
|
|
45
42
|
createPlaylist,
|
|
46
|
-
deleteComment,
|
|
47
43
|
deletePlaylist,
|
|
48
44
|
deletePlaylistItem,
|
|
49
45
|
deletePlaylistLike,
|
|
50
46
|
duplicatePlaylist,
|
|
51
|
-
editComment,
|
|
52
47
|
fetchAllCompletedStates,
|
|
53
48
|
fetchCarouselCardData,
|
|
54
49
|
fetchChallengeIndexMetadata,
|
|
@@ -78,9 +73,7 @@ import {
|
|
|
78
73
|
fetchUserLikes,
|
|
79
74
|
fetchUserPermissionsData,
|
|
80
75
|
fetchUserPlaylists,
|
|
81
|
-
likeComment,
|
|
82
76
|
likePlaylist,
|
|
83
|
-
openComment,
|
|
84
77
|
pinPlaylist,
|
|
85
78
|
playback,
|
|
86
79
|
postChallengesCommunityNotification,
|
|
@@ -97,11 +90,8 @@ import {
|
|
|
97
90
|
postContentReset,
|
|
98
91
|
postContentUnliked,
|
|
99
92
|
postRecordWatchSession,
|
|
100
|
-
replyToComment,
|
|
101
93
|
reportPlaylist,
|
|
102
94
|
setStudentViewForUser,
|
|
103
|
-
unassignModeratorToComment,
|
|
104
|
-
unlikeComment,
|
|
105
95
|
unpinPlaylist,
|
|
106
96
|
updatePlaylist,
|
|
107
97
|
updatePlaylistItem
|
|
@@ -164,21 +154,16 @@ import {
|
|
|
164
154
|
|
|
165
155
|
export {
|
|
166
156
|
addItemToPlaylist,
|
|
167
|
-
assignModeratorToComment,
|
|
168
157
|
assignmentStatusCompleted,
|
|
169
158
|
assignmentStatusReset,
|
|
170
|
-
closeComment,
|
|
171
159
|
contentStatusCompleted,
|
|
172
160
|
contentStatusReset,
|
|
173
161
|
countAssignmentsAndLessons,
|
|
174
|
-
createComment,
|
|
175
162
|
createPlaylist,
|
|
176
|
-
deleteComment,
|
|
177
163
|
deletePlaylist,
|
|
178
164
|
deletePlaylistItem,
|
|
179
165
|
deletePlaylistLike,
|
|
180
166
|
duplicatePlaylist,
|
|
181
|
-
editComment,
|
|
182
167
|
fetchAll,
|
|
183
168
|
fetchAllCompletedStates,
|
|
184
169
|
fetchAllFilterOptions,
|
|
@@ -261,10 +246,8 @@ export {
|
|
|
261
246
|
initializeService,
|
|
262
247
|
isContentLiked,
|
|
263
248
|
jumpToContinueContent,
|
|
264
|
-
likeComment,
|
|
265
249
|
likeContent,
|
|
266
250
|
likePlaylist,
|
|
267
|
-
openComment,
|
|
268
251
|
pinPlaylist,
|
|
269
252
|
playback,
|
|
270
253
|
postChallengesCommunityNotification,
|
|
@@ -284,14 +267,11 @@ export {
|
|
|
284
267
|
rankCategories,
|
|
285
268
|
rankItems,
|
|
286
269
|
recordWatchSession,
|
|
287
|
-
replyToComment,
|
|
288
270
|
reportPlaylist,
|
|
289
271
|
reset,
|
|
290
272
|
setLastUpdatedTime,
|
|
291
273
|
setStudentViewForUser,
|
|
292
274
|
similarItems,
|
|
293
|
-
unassignModeratorToComment,
|
|
294
|
-
unlikeComment,
|
|
295
275
|
unlikeContent,
|
|
296
276
|
unpinPlaylist,
|
|
297
277
|
updatePlaylist,
|
|
File without changes
|
|
File without changes
|
|
@@ -290,10 +290,6 @@ async function patchDataHandler(url, data) {
|
|
|
290
290
|
return fetchHandler(url, 'patch', null, data)
|
|
291
291
|
}
|
|
292
292
|
|
|
293
|
-
async function deleteDataHandler(url, data) {
|
|
294
|
-
return fetchHandler(url, 'delete')
|
|
295
|
-
}
|
|
296
|
-
|
|
297
293
|
export async function fetchHandler(url, method = 'get', dataVersion = null, body = null) {
|
|
298
294
|
let headers = {
|
|
299
295
|
'Content-Type': 'application/json',
|
|
@@ -1210,28 +1206,28 @@ export async function setStudentViewForUser(userId, enable) {
|
|
|
1210
1206
|
* @returns {Promise<Object|null>} - A promise that resolves to an comment object
|
|
1211
1207
|
*/
|
|
1212
1208
|
export async function fetchTopComment(railcontentId) {
|
|
1213
|
-
const url = `/api/content/v1/comments
|
|
1209
|
+
const url = `/api/content/v1/comments/${railcontentId}/top`
|
|
1214
1210
|
return await fetchHandler(url)
|
|
1215
1211
|
}
|
|
1216
1212
|
|
|
1217
1213
|
|
|
1218
1214
|
/**
|
|
1219
1215
|
*
|
|
1220
|
-
* @param
|
|
1221
|
-
* @param
|
|
1222
|
-
* @param
|
|
1216
|
+
* @param railcontentId
|
|
1217
|
+
* @param page
|
|
1218
|
+
* @param limit
|
|
1223
1219
|
* @returns {Promise<*|null>}
|
|
1224
1220
|
*/
|
|
1225
1221
|
export async function fetchComments(railcontentId, page = 1, limit = 20) {
|
|
1226
|
-
const url = `/api/content/v1/comments
|
|
1222
|
+
const url = `/api/content/v1/comments/${railcontentId}/all?page=${page}&limit=${limit}`
|
|
1227
1223
|
return await fetchHandler(url)
|
|
1228
1224
|
}
|
|
1229
1225
|
|
|
1230
1226
|
/**
|
|
1231
1227
|
*
|
|
1232
|
-
* @param
|
|
1233
|
-
* @param
|
|
1234
|
-
* @param
|
|
1228
|
+
* @param commentId
|
|
1229
|
+
* @param page
|
|
1230
|
+
* @param limit
|
|
1235
1231
|
* @returns {Promise<*|null>}
|
|
1236
1232
|
*/
|
|
1237
1233
|
export async function fetchCommentRelies(commentId, page = 1, limit = 20) {
|
|
@@ -1239,115 +1235,6 @@ export async function fetchCommentRelies(commentId, page = 1, limit = 20) {
|
|
|
1239
1235
|
return await fetchHandler(url)
|
|
1240
1236
|
}
|
|
1241
1237
|
|
|
1242
|
-
/**
|
|
1243
|
-
* @param {int} commentId
|
|
1244
|
-
* @returns {Promise<*|null>}
|
|
1245
|
-
*/
|
|
1246
|
-
export async function deleteComment(commentId) {
|
|
1247
|
-
const url = `/api/content/v1/comments/${commentId}`
|
|
1248
|
-
return await fetchHandler(url, "DELETE")
|
|
1249
|
-
}
|
|
1250
|
-
|
|
1251
|
-
/**
|
|
1252
|
-
* @param {int} commentId
|
|
1253
|
-
* @param {string} comment
|
|
1254
|
-
* @returns {Promise<*|null>}
|
|
1255
|
-
*/
|
|
1256
|
-
export async function replyToComment(commentId, comment) {
|
|
1257
|
-
const data = {'comment' : comment}
|
|
1258
|
-
const url = `/api/content/v1/comments/${commentId}/reply`
|
|
1259
|
-
return await postDataHandler(url, data)
|
|
1260
|
-
}
|
|
1261
|
-
|
|
1262
|
-
/**
|
|
1263
|
-
* @param {int} railcontentId
|
|
1264
|
-
* @param {string} comment
|
|
1265
|
-
* @returns {Promise<*|null>}
|
|
1266
|
-
*/
|
|
1267
|
-
export async function createComment(railcontentId, comment) {
|
|
1268
|
-
const data = {
|
|
1269
|
-
'comment' : comment,
|
|
1270
|
-
'content_id' : railcontentId
|
|
1271
|
-
}
|
|
1272
|
-
const url = `/api/content/v1/comments/store`
|
|
1273
|
-
return await postDataHandler(url, data)
|
|
1274
|
-
}
|
|
1275
|
-
|
|
1276
|
-
/**
|
|
1277
|
-
* @param {int} commentId
|
|
1278
|
-
* @returns {Promise<*|null>}
|
|
1279
|
-
*/
|
|
1280
|
-
export async function assignModeratorToComment(commentId) {
|
|
1281
|
-
const url = `/api/content/v1/comments/${commentId}/assign_moderator`
|
|
1282
|
-
return await postDataHandler(url)
|
|
1283
|
-
}
|
|
1284
|
-
|
|
1285
|
-
/**
|
|
1286
|
-
* @param {int} commentId
|
|
1287
|
-
* @returns {Promise<*|null>}
|
|
1288
|
-
*/
|
|
1289
|
-
export async function unassignModeratorToComment(commentId) {
|
|
1290
|
-
const url = `/api/content/v1/comments/${commentId}/unassign_moderator`
|
|
1291
|
-
return await postDataHandler(url)
|
|
1292
|
-
}
|
|
1293
|
-
|
|
1294
|
-
/**
|
|
1295
|
-
* @param {int} commentId
|
|
1296
|
-
* @returns {Promise<*|null>}
|
|
1297
|
-
*/
|
|
1298
|
-
export async function likeComment(commentId) {
|
|
1299
|
-
const url = `/api/content/v1/comments/${commentId}/like`
|
|
1300
|
-
return await postDataHandler(url)
|
|
1301
|
-
}
|
|
1302
|
-
|
|
1303
|
-
/**
|
|
1304
|
-
* @param {int} commentId
|
|
1305
|
-
* @returns {Promise<*|null>}
|
|
1306
|
-
*/
|
|
1307
|
-
export async function unlikeComment(commentId) {
|
|
1308
|
-
const url = `/api/content/v1/comments/${commentId}/like`
|
|
1309
|
-
return await deleteDataHandler(url)
|
|
1310
|
-
}
|
|
1311
|
-
|
|
1312
|
-
/**
|
|
1313
|
-
* @param {int} commentId
|
|
1314
|
-
* @returns {Promise<*|null>}
|
|
1315
|
-
*/
|
|
1316
|
-
export async function closeComment(commentId) {
|
|
1317
|
-
const url = `/api/content/v1/comments/${commentId}`
|
|
1318
|
-
const data = {
|
|
1319
|
-
'conversation_status' : 'closed'
|
|
1320
|
-
}
|
|
1321
|
-
return await patchDataHandler(url, data)
|
|
1322
|
-
}
|
|
1323
|
-
|
|
1324
|
-
/**
|
|
1325
|
-
* @param {int} commentId
|
|
1326
|
-
* @returns {Promise<*|null>}
|
|
1327
|
-
*/
|
|
1328
|
-
export async function openComment(commentId) {
|
|
1329
|
-
const url = `/api/content/v1/comments/${commentId}`
|
|
1330
|
-
const data = {
|
|
1331
|
-
'conversation_status' : 'open'
|
|
1332
|
-
}
|
|
1333
|
-
return await patchDataHandler(url, data)
|
|
1334
|
-
}
|
|
1335
|
-
|
|
1336
|
-
/**
|
|
1337
|
-
* @param {int} commentId
|
|
1338
|
-
* @param {string} comment
|
|
1339
|
-
* @returns {Promise<*|null>}
|
|
1340
|
-
*/
|
|
1341
|
-
export async function editComment(commentId, comment) {
|
|
1342
|
-
const url = `/api/content/v1/comments/${commentId}`
|
|
1343
|
-
const data = {
|
|
1344
|
-
'comment' : comment
|
|
1345
|
-
}
|
|
1346
|
-
return await patchDataHandler(url, data)
|
|
1347
|
-
}
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
1238
|
function fetchAbsolute(url, params) {
|
|
1352
1239
|
if (globalConfig.railcontentConfig.authToken) {
|
|
1353
1240
|
params.headers['Authorization'] = `Bearer ${globalConfig.railcontentConfig.authToken}`
|
|
File without changes
|
|
File without changes
|
package/test/localStorageMock.js
CHANGED
|
File without changes
|
package/test/log.js
CHANGED
|
File without changes
|
package/.vscode/settings.json
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"emeraldwalk.runonsave": {
|
|
3
|
-
"commands": [
|
|
4
|
-
{
|
|
5
|
-
"cmd": "cp -r ~/Workspace/musora/musora-content-services/src ~/Workspace/musora/MusoraApp/node_modules/musora-content-services; cp ~/Workspace/musora/musora-content-services/index.d.ts ~/Workspace/musora/MusoraApp/node_modules/musora-content-services"
|
|
6
|
-
}
|
|
7
|
-
]
|
|
8
|
-
}
|
|
9
|
-
}
|