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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "musora-content-services",
3
- "version": "1.3.10",
3
+ "version": "1.3.11",
4
4
  "description": "A package for Musoras content services ",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
@@ -455,7 +455,7 @@ export let contentTypeConfig = {
455
455
  sonor: contentWithSortField,
456
456
  }
457
457
 
458
- export const songAccessMembership = 94
458
+ export const plusMembershipPermissions = 92
459
459
 
460
460
  export function getNewReleasesTypes(brand) {
461
461
  const baseNewTypes = [
@@ -1,5 +1,5 @@
1
1
  import { fetchUserPermissions } from './services/userPermissions.js'
2
- import { songAccessMembership } from './contentTypeConfig.js'
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, songAccessMembership]
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
@@ -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