musora-content-services 1.0.15 → 1.0.17

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 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.0.17](https://github.com/railroadmedia/musora-content-services/compare/v1.0.16...v1.0.17) (2024-08-13)
6
+
7
+ ### [1.0.16](https://github.com/railroadmedia/musora-content-services/compare/v1.0.15...v1.0.16) (2024-08-13)
8
+
5
9
  ### [1.0.15](https://github.com/railroadmedia/musora-content-services/compare/v1.0.14...v1.0.15) (2024-08-13)
6
10
 
7
11
  ### [1.0.14](https://github.com/railroadmedia/musora-content-services/compare/v1.0.13...v1.0.14) (2024-08-13)
package/docs/global.html CHANGED
@@ -29,7 +29,7 @@
29
29
  <nav >
30
30
 
31
31
 
32
- <h2><a href="index.html">Home</a></h2><h3>Global</h3><ul><li><a href="global.html#fetchAll">fetchAll</a></li><li><a href="global.html#fetchAllFilterOptions">fetchAllFilterOptions</a></li><li><a href="global.html#fetchAllSongs">fetchAllSongs</a></li><li><a href="global.html#fetchArtists">fetchArtists</a></li><li><a href="global.html#fetchByRailContentId">fetchByRailContentId</a></li><li><a href="global.html#fetchByRailContentIds">fetchByRailContentIds</a></li><li><a href="global.html#fetchChildren">fetchChildren</a></li><li><a href="global.html#fetchLessonContent">fetchLessonContent</a></li><li><a href="global.html#fetchMethodChildren">fetchMethodChildren</a></li><li><a href="global.html#fetchMethodNextLesson">fetchMethodNextLesson</a></li><li><a href="global.html#fetchNewReleases">fetchNewReleases</a></li><li><a href="global.html#fetchNextPreviousLesson">fetchNextPreviousLesson</a></li><li><a href="global.html#fetchPackAll">fetchPackAll</a></li><li><a href="global.html#fetchPackChildren">fetchPackChildren</a></li><li><a href="global.html#fetchRelatedLessons">fetchRelatedLessons</a></li><li><a href="global.html#fetchRelatedSongs">fetchRelatedSongs</a></li><li><a href="global.html#fetchSanity">fetchSanity</a></li><li><a href="global.html#fetchSongArtistCount">fetchSongArtistCount</a></li><li><a href="global.html#fetchSongById">fetchSongById</a></li><li><a href="global.html#fetchSongCount">fetchSongCount</a></li><li><a href="global.html#fetchSongFilterOptions">fetchSongFilterOptions</a></li><li><a href="global.html#fetchUpcomingEvents">fetchUpcomingEvents</a></li><li><a href="global.html#fetchWorkouts">fetchWorkouts</a></li><li><a href="global.html#initializeSanityService">initializeSanityService</a></li></ul>
32
+ <h2><a href="index.html">Home</a></h2><h3>Global</h3><ul><li><a href="global.html#fetchAll">fetchAll</a></li><li><a href="global.html#fetchAllFilterOptions">fetchAllFilterOptions</a></li><li><a href="global.html#fetchAllSongs">fetchAllSongs</a></li><li><a href="global.html#fetchArtists">fetchArtists</a></li><li><a href="global.html#fetchByRailContentId">fetchByRailContentId</a></li><li><a href="global.html#fetchByRailContentIds">fetchByRailContentIds</a></li><li><a href="global.html#fetchChildren">fetchChildren</a></li><li><a href="global.html#fetchLessonContent">fetchLessonContent</a></li><li><a href="global.html#fetchLiveEvent">fetchLiveEvent</a></li><li><a href="global.html#fetchMethodChildren">fetchMethodChildren</a></li><li><a href="global.html#fetchMethodNextLesson">fetchMethodNextLesson</a></li><li><a href="global.html#fetchNewReleases">fetchNewReleases</a></li><li><a href="global.html#fetchNextPreviousLesson">fetchNextPreviousLesson</a></li><li><a href="global.html#fetchPackAll">fetchPackAll</a></li><li><a href="global.html#fetchPackChildren">fetchPackChildren</a></li><li><a href="global.html#fetchRelatedLessons">fetchRelatedLessons</a></li><li><a href="global.html#fetchRelatedSongs">fetchRelatedSongs</a></li><li><a href="global.html#fetchSanity">fetchSanity</a></li><li><a href="global.html#fetchSongArtistCount">fetchSongArtistCount</a></li><li><a href="global.html#fetchSongById">fetchSongById</a></li><li><a href="global.html#fetchSongCount">fetchSongCount</a></li><li><a href="global.html#fetchSongFilterOptions">fetchSongFilterOptions</a></li><li><a href="global.html#fetchUpcomingEvents">fetchUpcomingEvents</a></li><li><a href="global.html#fetchWorkouts">fetchWorkouts</a></li><li><a href="global.html#initializeSanityService">initializeSanityService</a></li></ul>
33
33
 
34
34
  </nav>
35
35
 
@@ -146,7 +146,7 @@
146
146
 
147
147
  <dt class="tag-source">Source:</dt>
148
148
  <dd class="tag-source"><ul class="dummy"><li>
149
- <a href="index.js.html">index.js</a>, <a href="index.js.html#line538">line 538</a>
149
+ <a href="index.js.html">index.js</a>, <a href="index.js.html#line597">line 597</a>
150
150
  </li></ul></dd>
151
151
 
152
152
 
@@ -639,7 +639,7 @@ The filter options are dynamically generated based on the provided filters, styl
639
639
 
640
640
  <dt class="tag-source">Source:</dt>
641
641
  <dd class="tag-source"><ul class="dummy"><li>
642
- <a href="index.js.html">index.js</a>, <a href="index.js.html#line682">line 682</a>
642
+ <a href="index.js.html">index.js</a>, <a href="index.js.html#line741">line 741</a>
643
643
  </li></ul></dd>
644
644
 
645
645
 
@@ -1612,7 +1612,7 @@ fetchAllFilterOptions('myBrand', '', 'Rock', 'John Doe', 'song', 'Love')
1612
1612
 
1613
1613
  <dt class="tag-source">Source:</dt>
1614
1614
  <dd class="tag-source"><ul class="dummy"><li>
1615
- <a href="index.js.html">index.js</a>, <a href="index.js.html#line471">line 471</a>
1615
+ <a href="index.js.html">index.js</a>, <a href="index.js.html#line530">line 530</a>
1616
1616
  </li></ul></dd>
1617
1617
 
1618
1618
 
@@ -1777,7 +1777,7 @@ fetchAllFilterOptions('myBrand', '', 'Rock', 'John Doe', 'song', 'Love')
1777
1777
 
1778
1778
  <dt class="tag-source">Source:</dt>
1779
1779
  <dd class="tag-source"><ul class="dummy"><li>
1780
- <a href="index.js.html">index.js</a>, <a href="index.js.html#line497">line 497</a>
1780
+ <a href="index.js.html">index.js</a>, <a href="index.js.html#line556">line 556</a>
1781
1781
  </li></ul></dd>
1782
1782
 
1783
1783
 
@@ -1942,7 +1942,7 @@ fetchAllFilterOptions('myBrand', '', 'Rock', 'John Doe', 'song', 'Love')
1942
1942
 
1943
1943
  <dt class="tag-source">Source:</dt>
1944
1944
  <dd class="tag-source"><ul class="dummy"><li>
1945
- <a href="index.js.html">index.js</a>, <a href="index.js.html#line724">line 724</a>
1945
+ <a href="index.js.html">index.js</a>, <a href="index.js.html#line783">line 783</a>
1946
1946
  </li></ul></dd>
1947
1947
 
1948
1948
 
@@ -2100,7 +2100,7 @@ fetchAllFilterOptions('myBrand', '', 'Rock', 'John Doe', 'song', 'Love')
2100
2100
 
2101
2101
  <dt class="tag-source">Source:</dt>
2102
2102
  <dd class="tag-source"><ul class="dummy"><li>
2103
- <a href="index.js.html">index.js</a>, <a href="index.js.html#line802">line 802</a>
2103
+ <a href="index.js.html">index.js</a>, <a href="index.js.html#line861">line 861</a>
2104
2104
  </li></ul></dd>
2105
2105
 
2106
2106
 
@@ -2249,6 +2249,176 @@ fetchAllFilterOptions('myBrand', '', 'Rock', 'John Doe', 'song', 'Love')
2249
2249
 
2250
2250
 
2251
2251
 
2252
+ <h4 class="name" id="fetchLiveEvent"><span class="type-signature type-signature-async">(async) </span>fetchLiveEvent<span class="signature">(brand)</span><span class="type-signature"> &rarr; {Promise.&lt;(Array.&lt;Object>|null)>}</span></h4>
2253
+
2254
+
2255
+
2256
+
2257
+
2258
+
2259
+ <dl class="details">
2260
+
2261
+ <dt class="tag-description">Description:</dt>
2262
+ <dd class="tag-description"><ul class="dummy"><li>Fetch upcoming events for a specific brand that are within 48 hours before their `published_on` date
2263
+ and are currently ongoing based on their `length_in_seconds`.
2264
+
2265
+ This function retrieves events that have a `published_on` date within the last 48 hours or are currently
2266
+ ongoing based on the event's duration (`length_in_seconds`).</li></ul></dd>
2267
+
2268
+
2269
+
2270
+ <dt class="tag-source">Source:</dt>
2271
+ <dd class="tag-source"><ul class="dummy"><li>
2272
+ <a href="index.js.html">index.js</a>, <a href="index.js.html#line482">line 482</a>
2273
+ </li></ul></dd>
2274
+
2275
+
2276
+
2277
+
2278
+
2279
+
2280
+
2281
+
2282
+
2283
+
2284
+
2285
+
2286
+
2287
+
2288
+
2289
+
2290
+
2291
+
2292
+
2293
+
2294
+
2295
+
2296
+
2297
+
2298
+
2299
+
2300
+
2301
+
2302
+
2303
+
2304
+
2305
+ </dl>
2306
+
2307
+
2308
+
2309
+
2310
+
2311
+
2312
+
2313
+
2314
+
2315
+
2316
+
2317
+ <h5 class="h5-examples">Example</h5>
2318
+
2319
+ <pre class="prettyprint"><code>// Example usage:
2320
+ fetchUpcomingEvents('drumeo')
2321
+ .then(events => console.log(events))
2322
+ .catch(error => console.error(error));</code></pre>
2323
+
2324
+
2325
+
2326
+
2327
+ <h5 class="h5-parameters">Parameters:</h5>
2328
+
2329
+
2330
+ <table class="params">
2331
+ <thead>
2332
+ <tr>
2333
+
2334
+ <th>Name</th>
2335
+
2336
+
2337
+ <th>Type</th>
2338
+
2339
+
2340
+
2341
+
2342
+
2343
+ <th class="last">Description</th>
2344
+ </tr>
2345
+ </thead>
2346
+
2347
+ <tbody>
2348
+
2349
+
2350
+ <tr>
2351
+
2352
+ <td class="name"><code>brand</code></td>
2353
+
2354
+
2355
+ <td class="type">
2356
+
2357
+
2358
+ <span class="param-type">string</span>
2359
+
2360
+
2361
+
2362
+
2363
+ </td>
2364
+
2365
+
2366
+
2367
+
2368
+
2369
+ <td class="description last">The brand for which to fetch upcoming events (e.g., 'drumeo', 'pianote', etc.).</td>
2370
+ </tr>
2371
+
2372
+
2373
+ </tbody>
2374
+ </table>
2375
+
2376
+
2377
+
2378
+
2379
+
2380
+
2381
+
2382
+
2383
+
2384
+
2385
+
2386
+
2387
+
2388
+
2389
+
2390
+
2391
+ <h5 class="h5-returns">Returns:</h5>
2392
+
2393
+
2394
+ <div class="param-desc">
2395
+ - A promise that resolves to an array of event objects or null if no events are found.
2396
+ </div>
2397
+
2398
+
2399
+
2400
+ <dl class="param-type">
2401
+ <dt>
2402
+ Type
2403
+ </dt>
2404
+ <dd>
2405
+
2406
+ <span class="param-type">Promise.&lt;(Array.&lt;Object>|null)></span>
2407
+
2408
+
2409
+
2410
+ </dd>
2411
+ </dl>
2412
+
2413
+
2414
+
2415
+
2416
+
2417
+
2418
+
2419
+
2420
+
2421
+
2252
2422
  <h4 class="name" id="fetchMethodChildren"><span class="type-signature type-signature-async">(async) </span>fetchMethodChildren<span class="signature">(railcontentId)</span><span class="type-signature"> &rarr; {Promise.&lt;(Array.&lt;Object>|null)>}</span></h4>
2253
2423
 
2254
2424
 
@@ -2265,7 +2435,7 @@ fetchAllFilterOptions('myBrand', '', 'Rock', 'John Doe', 'song', 'Love')
2265
2435
 
2266
2436
  <dt class="tag-source">Source:</dt>
2267
2437
  <dd class="tag-source"><ul class="dummy"><li>
2268
- <a href="index.js.html">index.js</a>, <a href="index.js.html#line766">line 766</a>
2438
+ <a href="index.js.html">index.js</a>, <a href="index.js.html#line825">line 825</a>
2269
2439
  </li></ul></dd>
2270
2440
 
2271
2441
 
@@ -2423,7 +2593,7 @@ fetchAllFilterOptions('myBrand', '', 'Rock', 'John Doe', 'song', 'Love')
2423
2593
 
2424
2594
  <dt class="tag-source">Source:</dt>
2425
2595
  <dd class="tag-source"><ul class="dummy"><li>
2426
- <a href="index.js.html">index.js</a>, <a href="index.js.html#line745">line 745</a>
2596
+ <a href="index.js.html">index.js</a>, <a href="index.js.html#line804">line 804</a>
2427
2597
  </li></ul></dd>
2428
2598
 
2429
2599
 
@@ -2739,7 +2909,7 @@ fetchAllFilterOptions('myBrand', '', 'Rock', 'John Doe', 'song', 'Love')
2739
2909
 
2740
2910
  <dt class="tag-source">Source:</dt>
2741
2911
  <dd class="tag-source"><ul class="dummy"><li>
2742
- <a href="index.js.html">index.js</a>, <a href="index.js.html#line776">line 776</a>
2912
+ <a href="index.js.html">index.js</a>, <a href="index.js.html#line835">line 835</a>
2743
2913
  </li></ul></dd>
2744
2914
 
2745
2915
 
@@ -2897,7 +3067,7 @@ fetchAllFilterOptions('myBrand', '', 'Rock', 'John Doe', 'song', 'Love')
2897
3067
 
2898
3068
  <dt class="tag-source">Source:</dt>
2899
3069
  <dd class="tag-source"><ul class="dummy"><li>
2900
- <a href="index.js.html">index.js</a>, <a href="index.js.html#line856">line 856</a>
3070
+ <a href="index.js.html">index.js</a>, <a href="index.js.html#line915">line 915</a>
2901
3071
  </li></ul></dd>
2902
3072
 
2903
3073
 
@@ -3055,7 +3225,7 @@ fetchAllFilterOptions('myBrand', '', 'Rock', 'John Doe', 'song', 'Love')
3055
3225
 
3056
3226
  <dt class="tag-source">Source:</dt>
3057
3227
  <dd class="tag-source"><ul class="dummy"><li>
3058
- <a href="index.js.html">index.js</a>, <a href="index.js.html#line882">line 882</a>
3228
+ <a href="index.js.html">index.js</a>, <a href="index.js.html#line941">line 941</a>
3059
3229
  </li></ul></dd>
3060
3230
 
3061
3231
 
@@ -3220,7 +3390,7 @@ fetchAllFilterOptions('myBrand', '', 'Rock', 'John Doe', 'song', 'Love')
3220
3390
 
3221
3391
  <dt class="tag-source">Source:</dt>
3222
3392
  <dd class="tag-source"><ul class="dummy"><li>
3223
- <a href="index.js.html">index.js</a>, <a href="index.js.html#line835">line 835</a>
3393
+ <a href="index.js.html">index.js</a>, <a href="index.js.html#line894">line 894</a>
3224
3394
  </li></ul></dd>
3225
3395
 
3226
3396
 
@@ -3591,7 +3761,7 @@ fetchAllFilterOptions('myBrand', '', 'Rock', 'John Doe', 'song', 'Love')
3591
3761
 
3592
3762
  <dt class="tag-source">Source:</dt>
3593
3763
  <dd class="tag-source"><ul class="dummy"><li>
3594
- <a href="index.js.html">index.js</a>, <a href="index.js.html#line899">line 899</a>
3764
+ <a href="index.js.html">index.js</a>, <a href="index.js.html#line958">line 958</a>
3595
3765
  </li></ul></dd>
3596
3766
 
3597
3767
 
@@ -4427,7 +4597,7 @@ fetchSanity(query, true)
4427
4597
 
4428
4598
  <dt class="tag-source">Source:</dt>
4429
4599
  <dd class="tag-source"><ul class="dummy"><li>
4430
- <a href="index.js.html">index.js</a>, <a href="index.js.html#line435">line 435</a>
4600
+ <a href="index.js.html">index.js</a>, <a href="index.js.html#line437">line 437</a>
4431
4601
  </li></ul></dd>
4432
4602
 
4433
4603
 
@@ -5160,7 +5330,7 @@ initializeSanityService({
5160
5330
  <br class="clear">
5161
5331
 
5162
5332
  <footer>
5163
- Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.3</a> on Tue Aug 13 2024 03:41:08 GMT+0000 (Coordinated Universal Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
5333
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.3</a> on Tue Aug 13 2024 18:37:07 GMT+0000 (Coordinated Universal Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
5164
5334
  </footer>
5165
5335
 
5166
5336
  <script>prettyPrint();</script>
package/docs/index.html CHANGED
@@ -29,7 +29,7 @@
29
29
  <nav >
30
30
 
31
31
 
32
- <h2><a href="index.html">Home</a></h2><h3>Global</h3><ul><li><a href="global.html#fetchAll">fetchAll</a></li><li><a href="global.html#fetchAllFilterOptions">fetchAllFilterOptions</a></li><li><a href="global.html#fetchAllSongs">fetchAllSongs</a></li><li><a href="global.html#fetchArtists">fetchArtists</a></li><li><a href="global.html#fetchByRailContentId">fetchByRailContentId</a></li><li><a href="global.html#fetchByRailContentIds">fetchByRailContentIds</a></li><li><a href="global.html#fetchChildren">fetchChildren</a></li><li><a href="global.html#fetchLessonContent">fetchLessonContent</a></li><li><a href="global.html#fetchMethodChildren">fetchMethodChildren</a></li><li><a href="global.html#fetchMethodNextLesson">fetchMethodNextLesson</a></li><li><a href="global.html#fetchNewReleases">fetchNewReleases</a></li><li><a href="global.html#fetchNextPreviousLesson">fetchNextPreviousLesson</a></li><li><a href="global.html#fetchPackAll">fetchPackAll</a></li><li><a href="global.html#fetchPackChildren">fetchPackChildren</a></li><li><a href="global.html#fetchRelatedLessons">fetchRelatedLessons</a></li><li><a href="global.html#fetchRelatedSongs">fetchRelatedSongs</a></li><li><a href="global.html#fetchSanity">fetchSanity</a></li><li><a href="global.html#fetchSongArtistCount">fetchSongArtistCount</a></li><li><a href="global.html#fetchSongById">fetchSongById</a></li><li><a href="global.html#fetchSongCount">fetchSongCount</a></li><li><a href="global.html#fetchSongFilterOptions">fetchSongFilterOptions</a></li><li><a href="global.html#fetchUpcomingEvents">fetchUpcomingEvents</a></li><li><a href="global.html#fetchWorkouts">fetchWorkouts</a></li><li><a href="global.html#initializeSanityService">initializeSanityService</a></li></ul>
32
+ <h2><a href="index.html">Home</a></h2><h3>Global</h3><ul><li><a href="global.html#fetchAll">fetchAll</a></li><li><a href="global.html#fetchAllFilterOptions">fetchAllFilterOptions</a></li><li><a href="global.html#fetchAllSongs">fetchAllSongs</a></li><li><a href="global.html#fetchArtists">fetchArtists</a></li><li><a href="global.html#fetchByRailContentId">fetchByRailContentId</a></li><li><a href="global.html#fetchByRailContentIds">fetchByRailContentIds</a></li><li><a href="global.html#fetchChildren">fetchChildren</a></li><li><a href="global.html#fetchLessonContent">fetchLessonContent</a></li><li><a href="global.html#fetchLiveEvent">fetchLiveEvent</a></li><li><a href="global.html#fetchMethodChildren">fetchMethodChildren</a></li><li><a href="global.html#fetchMethodNextLesson">fetchMethodNextLesson</a></li><li><a href="global.html#fetchNewReleases">fetchNewReleases</a></li><li><a href="global.html#fetchNextPreviousLesson">fetchNextPreviousLesson</a></li><li><a href="global.html#fetchPackAll">fetchPackAll</a></li><li><a href="global.html#fetchPackChildren">fetchPackChildren</a></li><li><a href="global.html#fetchRelatedLessons">fetchRelatedLessons</a></li><li><a href="global.html#fetchRelatedSongs">fetchRelatedSongs</a></li><li><a href="global.html#fetchSanity">fetchSanity</a></li><li><a href="global.html#fetchSongArtistCount">fetchSongArtistCount</a></li><li><a href="global.html#fetchSongById">fetchSongById</a></li><li><a href="global.html#fetchSongCount">fetchSongCount</a></li><li><a href="global.html#fetchSongFilterOptions">fetchSongFilterOptions</a></li><li><a href="global.html#fetchUpcomingEvents">fetchUpcomingEvents</a></li><li><a href="global.html#fetchWorkouts">fetchWorkouts</a></li><li><a href="global.html#initializeSanityService">initializeSanityService</a></li></ul>
33
33
 
34
34
  </nav>
35
35
 
@@ -103,7 +103,7 @@ Run the following to execute the tests</p>
103
103
  <br class="clear">
104
104
 
105
105
  <footer>
106
- Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.3</a> on Tue Aug 13 2024 03:41:08 GMT+0000 (Coordinated Universal Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
106
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.3</a> on Tue Aug 13 2024 18:37:07 GMT+0000 (Coordinated Universal Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
107
107
  </footer>
108
108
 
109
109
  <script>prettyPrint();</script>
@@ -29,7 +29,7 @@
29
29
  <nav >
30
30
 
31
31
 
32
- <h2><a href="index.html">Home</a></h2><h3>Global</h3><ul><li><a href="global.html#fetchAll">fetchAll</a></li><li><a href="global.html#fetchAllFilterOptions">fetchAllFilterOptions</a></li><li><a href="global.html#fetchAllSongs">fetchAllSongs</a></li><li><a href="global.html#fetchArtists">fetchArtists</a></li><li><a href="global.html#fetchByRailContentId">fetchByRailContentId</a></li><li><a href="global.html#fetchByRailContentIds">fetchByRailContentIds</a></li><li><a href="global.html#fetchChildren">fetchChildren</a></li><li><a href="global.html#fetchLessonContent">fetchLessonContent</a></li><li><a href="global.html#fetchMethodChildren">fetchMethodChildren</a></li><li><a href="global.html#fetchMethodNextLesson">fetchMethodNextLesson</a></li><li><a href="global.html#fetchNewReleases">fetchNewReleases</a></li><li><a href="global.html#fetchNextPreviousLesson">fetchNextPreviousLesson</a></li><li><a href="global.html#fetchPackAll">fetchPackAll</a></li><li><a href="global.html#fetchPackChildren">fetchPackChildren</a></li><li><a href="global.html#fetchRelatedLessons">fetchRelatedLessons</a></li><li><a href="global.html#fetchRelatedSongs">fetchRelatedSongs</a></li><li><a href="global.html#fetchSanity">fetchSanity</a></li><li><a href="global.html#fetchSongArtistCount">fetchSongArtistCount</a></li><li><a href="global.html#fetchSongById">fetchSongById</a></li><li><a href="global.html#fetchSongCount">fetchSongCount</a></li><li><a href="global.html#fetchSongFilterOptions">fetchSongFilterOptions</a></li><li><a href="global.html#fetchUpcomingEvents">fetchUpcomingEvents</a></li><li><a href="global.html#fetchWorkouts">fetchWorkouts</a></li><li><a href="global.html#initializeSanityService">initializeSanityService</a></li></ul>
32
+ <h2><a href="index.html">Home</a></h2><h3>Global</h3><ul><li><a href="global.html#fetchAll">fetchAll</a></li><li><a href="global.html#fetchAllFilterOptions">fetchAllFilterOptions</a></li><li><a href="global.html#fetchAllSongs">fetchAllSongs</a></li><li><a href="global.html#fetchArtists">fetchArtists</a></li><li><a href="global.html#fetchByRailContentId">fetchByRailContentId</a></li><li><a href="global.html#fetchByRailContentIds">fetchByRailContentIds</a></li><li><a href="global.html#fetchChildren">fetchChildren</a></li><li><a href="global.html#fetchLessonContent">fetchLessonContent</a></li><li><a href="global.html#fetchLiveEvent">fetchLiveEvent</a></li><li><a href="global.html#fetchMethodChildren">fetchMethodChildren</a></li><li><a href="global.html#fetchMethodNextLesson">fetchMethodNextLesson</a></li><li><a href="global.html#fetchNewReleases">fetchNewReleases</a></li><li><a href="global.html#fetchNextPreviousLesson">fetchNextPreviousLesson</a></li><li><a href="global.html#fetchPackAll">fetchPackAll</a></li><li><a href="global.html#fetchPackChildren">fetchPackChildren</a></li><li><a href="global.html#fetchRelatedLessons">fetchRelatedLessons</a></li><li><a href="global.html#fetchRelatedSongs">fetchRelatedSongs</a></li><li><a href="global.html#fetchSanity">fetchSanity</a></li><li><a href="global.html#fetchSongArtistCount">fetchSongArtistCount</a></li><li><a href="global.html#fetchSongById">fetchSongById</a></li><li><a href="global.html#fetchSongCount">fetchSongCount</a></li><li><a href="global.html#fetchSongFilterOptions">fetchSongFilterOptions</a></li><li><a href="global.html#fetchUpcomingEvents">fetchUpcomingEvents</a></li><li><a href="global.html#fetchWorkouts">fetchWorkouts</a></li><li><a href="global.html#initializeSanityService">initializeSanityService</a></li></ul>
33
33
 
34
34
  </nav>
35
35
 
@@ -455,15 +455,17 @@ async function fetchNewReleases(brand) {
455
455
  };
456
456
  const typesString = arrayJoinWithQuotes(newTypes[brand] ?? newTypes['default']);
457
457
  const query = `*[_type in [${typesString}] &amp;&amp; brand == '${brand}'] | order(releaseDate desc) [0...5] {
458
- railcontent_id,
458
+ "id": railcontent_id,
459
459
  title,
460
460
  "image": thumbnail.asset->url,
461
- "artist_name": artist->name,
462
- artist,
461
+ "artist_name": instructor[0]->name,
462
+ "artists": instructor[]->name,
463
463
  difficulty,
464
464
  difficulty_string,
465
+ length_in_seconds,
466
+ published_on,
467
+ "type": _type,
465
468
  web_url_path,
466
- published_on
467
469
  } | order(published_on desc)[0...5]`
468
470
  return fetchSanity(query, true);
469
471
  }
@@ -480,30 +482,87 @@ async function fetchNewReleases(brand) {
480
482
  * .catch(error => console.error(error));
481
483
  */
482
484
  async function fetchUpcomingEvents(brand) {
485
+ const baseLiveTypes = ["student-review", "student-reviews", "student-focus", "coach-stream", "live", "question-and-answer", "student-review", "boot-camps", "recording", "pack-bundle-lesson"];
483
486
  const liveTypes = {
484
- 'drumeo': ["drum-fest-international-2022", "spotlight", "the-history-of-electronic-drums", "backstage-secrets", "quick-tips", "question-and-answer", "student-collaborations", "live-streams", "live", "podcasts", "solos", "boot-camps", "gear-guides", "performances", "in-rhythm", "challenges", "on-the-road", "diy-drum-experiments", "rhythmic-adventures-of-captain-carson", "study-the-greats", "rhythms-from-another-planet", "tama-drums", "paiste-cymbals", "behind-the-scenes", "exploring-beats", "sonor-drums", "student-focus", "coach-stream", "live", "question-and-answer", "student-review", "boot-camps", "recording", "pack-bundle-lesson"],
485
- 'pianote': ["student-review", "student-reviews", "question-and-answer", "student-focus", "coach-stream", "live", "question-and-answer", "student-review", "boot-camps", "recording", "pack-bundle-lesson"],
486
- 'guitareo': ["student-review", "student-reviews", "question-and-answer", "archives", "recording", "student-focus", "coach-stream", "live", "question-and-answer", "student-review", "boot-camps", "recording", "pack-bundle-lesson"],
487
- 'singeo': ["student-review", "student-reviews", "question-and-answer", "student-focus", "coach-stream", "live", "question-and-answer", "student-review", "boot-camps", "recording", "pack-bundle-lesson"],
488
- 'default': ["student-review", "student-reviews", "question-and-answer", "student-focus", "coach-stream", "live", "question-and-answer", "student-review", "boot-camps", "recording", "pack-bundle-lesson"]
487
+ 'drumeo': [...baseLiveTypes, "drum-fest-international-2022", "spotlight", "the-history-of-electronic-drums", "backstage-secrets", "quick-tips", "student-collaborations", "live-streams", "podcasts", "solos", "gear-guides", "performances", "in-rhythm", "challenges", "on-the-road", "diy-drum-experiments", "rhythmic-adventures-of-captain-carson", "study-the-greats", "rhythms-from-another-planet", "tama-drums", "paiste-cymbals", "behind-the-scenes", "exploring-beats", "sonor-drums"],
488
+ 'pianote': baseLiveTypes,
489
+ 'guitareo': [...baseLiveTypes, "archives"],
490
+ 'singeo': baseLiveTypes,
491
+ 'default': baseLiveTypes
489
492
  };
490
493
  const typesString = arrayJoinWithQuotes(liveTypes[brand] ?? liveTypes['default']);
491
494
  const now = getSanityDate(new Date());
492
495
  //TODO: status = 'scheduled' is this handled in sanity?
493
496
  const query = `*[_type in [${typesString}] &amp;&amp; brand == '${brand}' &amp;&amp; published_on > '${now}']{
494
- railcontent_id,
497
+ "id": railcontent_id,
495
498
  title,
496
499
  "image": thumbnail.asset->url,
497
- "artist_name": artist->name,
498
- artist,
500
+ "artist_name": instructor[0]->name,
501
+ "artists": instructor[]->name,
499
502
  difficulty,
500
503
  difficulty_string,
504
+ length_in_seconds,
505
+ published_on,
506
+ "type": _type,
501
507
  web_url_path,
502
- published_on
503
508
  } | order(published_on asc)[0...5]`;
504
509
  return fetchSanity(query, true);
505
510
  }
506
511
 
512
+ /**
513
+ * Fetch upcoming events for a specific brand that are within 48 hours before their `published_on` date
514
+ * and are currently ongoing based on their `length_in_seconds`.
515
+ *
516
+ * This function retrieves events that have a `published_on` date within the last 48 hours or are currently
517
+ * ongoing based on the event's duration (`length_in_seconds`).
518
+ *
519
+ * @param {string} brand - The brand for which to fetch upcoming events (e.g., 'drumeo', 'pianote', etc.).
520
+ * @returns {Promise&lt;Array&lt;Object>|null>} - A promise that resolves to an array of event objects or null if no events are found.
521
+ *
522
+ * @example
523
+ * // Example usage:
524
+ * fetchUpcomingEvents('drumeo')
525
+ * .then(events => console.log(events))
526
+ * .catch(error => console.error(error));
527
+ *
528
+ */
529
+ async function fetchLiveEvent(brand) {
530
+ const baseLiveTypes = ["student-review", "student-reviews", "student-focus", "coach-stream", "live", "question-and-answer", "student-review", "boot-camps", "recording", "pack-bundle-lesson"];
531
+ const liveTypes = {
532
+ 'drumeo': [...baseLiveTypes, "drum-fest-international-2022", "spotlight", "the-history-of-electronic-drums", "backstage-secrets", "quick-tips", "student-collaborations", "live-streams", "podcasts", "solos", "gear-guides", "performances", "in-rhythm", "challenges", "on-the-road", "diy-drum-experiments", "rhythmic-adventures-of-captain-carson", "study-the-greats", "rhythms-from-another-planet", "tama-drums", "paiste-cymbals", "behind-the-scenes", "exploring-beats", "sonor-drums"],
533
+ 'pianote': baseLiveTypes,
534
+ 'guitareo': [...baseLiveTypes, "archives"],
535
+ 'singeo': baseLiveTypes,
536
+ 'default': baseLiveTypes
537
+ };
538
+
539
+ const typesString = arrayJoinWithQuotes(liveTypes[brand] ?? liveTypes['default']);
540
+ const now = getSanityDate(new Date());
541
+ const twoDaysAgo = getSanityDate(new Date(Date.now() - 48 * 60 * 60 * 1000)); // 48 hours ago
542
+
543
+ // Adjust the query to filter events based on the calculated time window
544
+ const query = `
545
+ *[_type in [${typesString}] &amp;&amp; brand == '${brand}'
546
+ &amp;&amp; published_on > '${twoDaysAgo}'
547
+ &amp;&amp; published_on &lt;= '${now}'
548
+ &amp;&amp; dateTime(published_on) + length_in_seconds * 1000 > '${now}'] {
549
+ "id": railcontent_id,
550
+ title,
551
+ "image": thumbnail.asset->url,
552
+ "artist_name": instructor[0]->name,
553
+ "artists": instructor[]->name,
554
+ difficulty,
555
+ difficulty_string,
556
+ length_in_seconds,
557
+ published_on,
558
+ "type": _type,
559
+ web_url_path,
560
+ } | order(published_on asc)[0]`;
561
+
562
+ return fetchSanity(query, true);
563
+ }
564
+
565
+
507
566
  /**
508
567
  * Fetch content by a specific Railcontent ID.
509
568
  *
@@ -1049,7 +1108,7 @@ module.exports = {
1049
1108
  <br class="clear">
1050
1109
 
1051
1110
  <footer>
1052
- Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.3</a> on Tue Aug 13 2024 03:41:08 GMT+0000 (Coordinated Universal Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
1111
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.3</a> on Tue Aug 13 2024 18:37:07 GMT+0000 (Coordinated Universal Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
1053
1112
  </footer>
1054
1113
 
1055
1114
  <script>prettyPrint();</script>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "musora-content-services",
3
- "version": "1.0.15",
3
+ "version": "1.0.17",
4
4
  "description": "A package for Musoras content services ",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
package/src/index.js CHANGED
@@ -408,15 +408,17 @@ async function fetchNewReleases(brand) {
408
408
  };
409
409
  const typesString = arrayJoinWithQuotes(newTypes[brand] ?? newTypes['default']);
410
410
  const query = `*[_type in [${typesString}] && brand == '${brand}'] | order(releaseDate desc) [0...5] {
411
- railcontent_id,
411
+ "id": railcontent_id,
412
412
  title,
413
413
  "image": thumbnail.asset->url,
414
- "artist_name": artist->name,
415
- artist,
414
+ "artist_name": instructor[0]->name,
415
+ "artists": instructor[]->name,
416
416
  difficulty,
417
417
  difficulty_string,
418
+ length_in_seconds,
419
+ published_on,
420
+ "type": _type,
418
421
  web_url_path,
419
- published_on
420
422
  } | order(published_on desc)[0...5]`
421
423
  return fetchSanity(query, true);
422
424
  }
@@ -433,30 +435,87 @@ async function fetchNewReleases(brand) {
433
435
  * .catch(error => console.error(error));
434
436
  */
435
437
  async function fetchUpcomingEvents(brand) {
438
+ const baseLiveTypes = ["student-review", "student-reviews", "student-focus", "coach-stream", "live", "question-and-answer", "student-review", "boot-camps", "recording", "pack-bundle-lesson"];
436
439
  const liveTypes = {
437
- 'drumeo': ["drum-fest-international-2022", "spotlight", "the-history-of-electronic-drums", "backstage-secrets", "quick-tips", "question-and-answer", "student-collaborations", "live-streams", "live", "podcasts", "solos", "boot-camps", "gear-guides", "performances", "in-rhythm", "challenges", "on-the-road", "diy-drum-experiments", "rhythmic-adventures-of-captain-carson", "study-the-greats", "rhythms-from-another-planet", "tama-drums", "paiste-cymbals", "behind-the-scenes", "exploring-beats", "sonor-drums", "student-focus", "coach-stream", "live", "question-and-answer", "student-review", "boot-camps", "recording", "pack-bundle-lesson"],
438
- 'pianote': ["student-review", "student-reviews", "question-and-answer", "student-focus", "coach-stream", "live", "question-and-answer", "student-review", "boot-camps", "recording", "pack-bundle-lesson"],
439
- 'guitareo': ["student-review", "student-reviews", "question-and-answer", "archives", "recording", "student-focus", "coach-stream", "live", "question-and-answer", "student-review", "boot-camps", "recording", "pack-bundle-lesson"],
440
- 'singeo': ["student-review", "student-reviews", "question-and-answer", "student-focus", "coach-stream", "live", "question-and-answer", "student-review", "boot-camps", "recording", "pack-bundle-lesson"],
441
- 'default': ["student-review", "student-reviews", "question-and-answer", "student-focus", "coach-stream", "live", "question-and-answer", "student-review", "boot-camps", "recording", "pack-bundle-lesson"]
440
+ 'drumeo': [...baseLiveTypes, "drum-fest-international-2022", "spotlight", "the-history-of-electronic-drums", "backstage-secrets", "quick-tips", "student-collaborations", "live-streams", "podcasts", "solos", "gear-guides", "performances", "in-rhythm", "challenges", "on-the-road", "diy-drum-experiments", "rhythmic-adventures-of-captain-carson", "study-the-greats", "rhythms-from-another-planet", "tama-drums", "paiste-cymbals", "behind-the-scenes", "exploring-beats", "sonor-drums"],
441
+ 'pianote': baseLiveTypes,
442
+ 'guitareo': [...baseLiveTypes, "archives"],
443
+ 'singeo': baseLiveTypes,
444
+ 'default': baseLiveTypes
442
445
  };
443
446
  const typesString = arrayJoinWithQuotes(liveTypes[brand] ?? liveTypes['default']);
444
447
  const now = getSanityDate(new Date());
445
448
  //TODO: status = 'scheduled' is this handled in sanity?
446
449
  const query = `*[_type in [${typesString}] && brand == '${brand}' && published_on > '${now}']{
447
- railcontent_id,
450
+ "id": railcontent_id,
448
451
  title,
449
452
  "image": thumbnail.asset->url,
450
- "artist_name": artist->name,
451
- artist,
453
+ "artist_name": instructor[0]->name,
454
+ "artists": instructor[]->name,
452
455
  difficulty,
453
456
  difficulty_string,
457
+ length_in_seconds,
458
+ published_on,
459
+ "type": _type,
454
460
  web_url_path,
455
- published_on
456
461
  } | order(published_on asc)[0...5]`;
457
462
  return fetchSanity(query, true);
458
463
  }
459
464
 
465
+ /**
466
+ * Fetch upcoming events for a specific brand that are within 48 hours before their `published_on` date
467
+ * and are currently ongoing based on their `length_in_seconds`.
468
+ *
469
+ * This function retrieves events that have a `published_on` date within the last 48 hours or are currently
470
+ * ongoing based on the event's duration (`length_in_seconds`).
471
+ *
472
+ * @param {string} brand - The brand for which to fetch upcoming events (e.g., 'drumeo', 'pianote', etc.).
473
+ * @returns {Promise<Array<Object>|null>} - A promise that resolves to an array of event objects or null if no events are found.
474
+ *
475
+ * @example
476
+ * // Example usage:
477
+ * fetchUpcomingEvents('drumeo')
478
+ * .then(events => console.log(events))
479
+ * .catch(error => console.error(error));
480
+ *
481
+ */
482
+ async function fetchLiveEvent(brand) {
483
+ const baseLiveTypes = ["student-review", "student-reviews", "student-focus", "coach-stream", "live", "question-and-answer", "student-review", "boot-camps", "recording", "pack-bundle-lesson"];
484
+ const liveTypes = {
485
+ 'drumeo': [...baseLiveTypes, "drum-fest-international-2022", "spotlight", "the-history-of-electronic-drums", "backstage-secrets", "quick-tips", "student-collaborations", "live-streams", "podcasts", "solos", "gear-guides", "performances", "in-rhythm", "challenges", "on-the-road", "diy-drum-experiments", "rhythmic-adventures-of-captain-carson", "study-the-greats", "rhythms-from-another-planet", "tama-drums", "paiste-cymbals", "behind-the-scenes", "exploring-beats", "sonor-drums"],
486
+ 'pianote': baseLiveTypes,
487
+ 'guitareo': [...baseLiveTypes, "archives"],
488
+ 'singeo': baseLiveTypes,
489
+ 'default': baseLiveTypes
490
+ };
491
+
492
+ const typesString = arrayJoinWithQuotes(liveTypes[brand] ?? liveTypes['default']);
493
+ const now = getSanityDate(new Date());
494
+ const twoDaysAgo = getSanityDate(new Date(Date.now() - 48 * 60 * 60 * 1000)); // 48 hours ago
495
+
496
+ // Adjust the query to filter events based on the calculated time window
497
+ const query = `
498
+ *[_type in [${typesString}] && brand == '${brand}'
499
+ && published_on > '${twoDaysAgo}'
500
+ && published_on <= '${now}'
501
+ && dateTime(published_on) + length_in_seconds * 1000 > '${now}'] {
502
+ "id": railcontent_id,
503
+ title,
504
+ "image": thumbnail.asset->url,
505
+ "artist_name": instructor[0]->name,
506
+ "artists": instructor[]->name,
507
+ difficulty,
508
+ difficulty_string,
509
+ length_in_seconds,
510
+ published_on,
511
+ "type": _type,
512
+ web_url_path,
513
+ } | order(published_on asc)[0]`;
514
+
515
+ return fetchSanity(query, true);
516
+ }
517
+
518
+
460
519
  /**
461
520
  * Fetch content by a specific Railcontent ID.
462
521
  *