musora-content-services 1.3.10 → 1.3.11
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 +2 -0
- package/docs/config.js.html +14 -14
- package/docs/index.html +2 -2
- package/docs/module-Config.html +2 -2
- package/docs/module-Railcontent-Services.html +46 -46
- package/docs/module-Sanity-Services.html +540 -36
- package/docs/railcontent.js.html +370 -366
- package/docs/sanity.js.html +1111 -967
- package/package.json +1 -1
- package/src/contentTypeConfig.js +1 -1
- package/src/filterBuilder.js +2 -2
- package/src/services/railcontent.js +0 -0
- package/src/services/sanity.js +5 -0
- package/.yarnrc.yml +0 -1
- package/docs/global.html +0 -809
- package/docs/module-Content-Services.html +0 -763
package/package.json
CHANGED
package/src/contentTypeConfig.js
CHANGED
package/src/filterBuilder.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { fetchUserPermissions } from './services/userPermissions.js'
|
|
2
|
-
import {
|
|
2
|
+
import { plusMembershipPermissions } from './contentTypeConfig.js'
|
|
3
3
|
|
|
4
4
|
export class FilterBuilder {
|
|
5
5
|
STATUS_SCHEDULED = 'scheduled'
|
|
@@ -116,7 +116,7 @@ export class FilterBuilder {
|
|
|
116
116
|
if (this.bypassPermissions || this.userData.isAdmin) return this
|
|
117
117
|
let requiredPermissions = this._getUserPermissions()
|
|
118
118
|
if (this.userData.isABasicMember && this.allowsPullSongsContent) {
|
|
119
|
-
requiredPermissions = [...requiredPermissions,
|
|
119
|
+
requiredPermissions = [...requiredPermissions, plusMembershipPermissions]
|
|
120
120
|
}
|
|
121
121
|
this._andWhere(
|
|
122
122
|
`(!defined(permission) || references(*[_type == 'permission' && railcontent_id in ${arrayToRawRepresentation(requiredPermissions)}]._id))`
|
|
File without changes
|
package/src/services/sanity.js
CHANGED
|
@@ -255,6 +255,7 @@ export async function fetchRelatedSongs(brand, songId) {
|
|
|
255
255
|
"published_on": published_on,
|
|
256
256
|
status,
|
|
257
257
|
"image": thumbnail.asset->url,
|
|
258
|
+
"permission_id": permission[]->railcontent_id,
|
|
258
259
|
"fields": [
|
|
259
260
|
{
|
|
260
261
|
"key": "title",
|
|
@@ -280,6 +281,7 @@ export async function fetchRelatedSongs(brand, songId) {
|
|
|
280
281
|
"id": railcontent_id,
|
|
281
282
|
"url": web_url_path,
|
|
282
283
|
"published_on": published_on,
|
|
284
|
+
"permission_id": permission[]->railcontent_id,
|
|
283
285
|
status,
|
|
284
286
|
"fields": [
|
|
285
287
|
{
|
|
@@ -486,6 +488,9 @@ export async function fetchByRailContentId(id, contentType) {
|
|
|
486
488
|
* .catch(error => console.error(error));
|
|
487
489
|
*/
|
|
488
490
|
export async function fetchByRailContentIds(ids, contentType = undefined) {
|
|
491
|
+
if (!ids) {
|
|
492
|
+
return [];
|
|
493
|
+
}
|
|
489
494
|
const idsString = ids.join(',')
|
|
490
495
|
|
|
491
496
|
const query = `*[railcontent_id in [${idsString}]]{
|
package/.yarnrc.yml
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
nodeLinker: node-modules
|