musora-content-services 1.3.1 → 1.3.2

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/.prettierignore CHANGED
File without changes
package/.prettierrc CHANGED
File without changes
package/.yarnrc.yml ADDED
@@ -0,0 +1 @@
1
+ nodeLinker: node-modules
package/CHANGELOG.md CHANGED
@@ -2,6 +2,8 @@
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.2](https://github.com/railroadmedia/musora-content-services/compare/v1.3.1...v1.3.2) (2025-01-30)
6
+
5
7
  ### [1.3.1](https://github.com/railroadmedia/musora-content-services/compare/v1.3.0...v1.3.1) (2025-01-29)
6
8
 
7
9
  ## [1.3.0](https://github.com/railroadmedia/musora-content-services/compare/v1.2.5...v1.3.0) (2025-01-29)
package/babel.config.cjs CHANGED
File without changes
File without changes
package/docs/index.html CHANGED
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
package/jest.config.js CHANGED
File without changes
package/jsdoc.json CHANGED
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "musora-content-services",
3
- "version": "1.3.1",
3
+ "version": "1.3.2",
4
4
  "description": "A package for Musoras content services ",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
File without changes
File without changes
package/src/index.d.ts CHANGED
File without changes
package/src/index.js CHANGED
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -84,7 +84,7 @@ export async function fetchArtists(brand) {
84
84
  *[_type == "artist"]{
85
85
  name,
86
86
  "lessonsCount": count(*[${filter}])
87
- }[lessonsCount > 0]`
87
+ }[lessonsCount > 0] |order(lower(name)) `
88
88
  return fetchSanity(query, true, { processNeedAccess: false })
89
89
  }
90
90
 
@@ -94,7 +94,15 @@ export async function fetchArtists(brand) {
94
94
  * @returns {Promise<int|null>} - The fetched count of artists.
95
95
  */
96
96
  export async function fetchSongArtistCount(brand) {
97
- const query = `count(*[_type == 'artist']{'lessonsCount': count(*[_type == 'song' && brand == '${brand}' && references(^._id)]._id)}[lessonsCount > 0])`
97
+ const filter = await new FilterBuilder(
98
+ `_type == "song" && brand == "${brand}" && references(^._id)`,
99
+ { bypassPermissions: true }
100
+ ).buildFilter()
101
+ const query = `
102
+ count(*[_type == "artist"]{
103
+ name,
104
+ "lessonsCount": count(*[${filter}])
105
+ }[lessonsCount > 0])`
98
106
  return fetchSanity(query, true, { processNeedAccess: false })
99
107
  }
100
108
 
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/test/log.js CHANGED
File without changes
@@ -65,7 +65,7 @@ describe('Sanity Queries', function () {
65
65
  test('fetchSongArtistCount', async () => {
66
66
  const response = await fetchSongArtistCount('drumeo')
67
67
  log(response)
68
- expect(response).toBeGreaterThan(1000)
68
+ expect(response).toBeGreaterThan(700)
69
69
  }, 10000)
70
70
 
71
71
  test('fetchSanity-WithPostProcess', async () => {
File without changes
File without changes