musora-content-services 1.0.16 → 1.0.18
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 +4 -0
- package/docs/global.html +185 -15
- package/docs/index.html +2 -2
- package/docs/index.js.html +62 -7
- package/package.json +1 -1
- package/src/index.js +61 -5
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.18](https://github.com/railroadmedia/musora-content-services/compare/v1.0.17...v1.0.18) (2024-08-13)
|
|
6
|
+
|
|
7
|
+
### [1.0.17](https://github.com/railroadmedia/musora-content-services/compare/v1.0.16...v1.0.17) (2024-08-13)
|
|
8
|
+
|
|
5
9
|
### [1.0.16](https://github.com/railroadmedia/musora-content-services/compare/v1.0.15...v1.0.16) (2024-08-13)
|
|
6
10
|
|
|
7
11
|
### [1.0.15](https://github.com/railroadmedia/musora-content-services/compare/v1.0.14...v1.0.15) (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#
|
|
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#
|
|
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#
|
|
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#
|
|
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#
|
|
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#
|
|
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"> → {Promise.<(Array.<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.<(Array.<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"> → {Promise.<(Array.<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#
|
|
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#
|
|
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#
|
|
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#
|
|
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#
|
|
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#
|
|
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#
|
|
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
|
|
|
@@ -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
|
|
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
|
|
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>
|
package/docs/index.js.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
|
|
|
@@ -482,12 +482,13 @@ async function fetchNewReleases(brand) {
|
|
|
482
482
|
* .catch(error => console.error(error));
|
|
483
483
|
*/
|
|
484
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"];
|
|
485
486
|
const liveTypes = {
|
|
486
|
-
'drumeo': ["drum-fest-international-2022", "spotlight", "the-history-of-electronic-drums", "backstage-secrets", "quick-tips", "
|
|
487
|
-
'pianote':
|
|
488
|
-
'guitareo': [
|
|
489
|
-
'singeo':
|
|
490
|
-
'default':
|
|
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
|
|
491
492
|
};
|
|
492
493
|
const typesString = arrayJoinWithQuotes(liveTypes[brand] ?? liveTypes['default']);
|
|
493
494
|
const now = getSanityDate(new Date());
|
|
@@ -508,6 +509,60 @@ async function fetchUpcomingEvents(brand) {
|
|
|
508
509
|
return fetchSanity(query, true);
|
|
509
510
|
}
|
|
510
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<Array<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}] && brand == '${brand}'
|
|
546
|
+
&& published_on > '${twoDaysAgo}'
|
|
547
|
+
&& published_on <= '${now}'
|
|
548
|
+
&& 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
|
+
|
|
511
566
|
/**
|
|
512
567
|
* Fetch content by a specific Railcontent ID.
|
|
513
568
|
*
|
|
@@ -1053,7 +1108,7 @@ module.exports = {
|
|
|
1053
1108
|
<br class="clear">
|
|
1054
1109
|
|
|
1055
1110
|
<footer>
|
|
1056
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.3</a> on Tue Aug 13 2024
|
|
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.
|
|
1057
1112
|
</footer>
|
|
1058
1113
|
|
|
1059
1114
|
<script>prettyPrint();</script>
|
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -435,12 +435,13 @@ async function fetchNewReleases(brand) {
|
|
|
435
435
|
* .catch(error => console.error(error));
|
|
436
436
|
*/
|
|
437
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"];
|
|
438
439
|
const liveTypes = {
|
|
439
|
-
'drumeo': ["drum-fest-international-2022", "spotlight", "the-history-of-electronic-drums", "backstage-secrets", "quick-tips", "
|
|
440
|
-
'pianote':
|
|
441
|
-
'guitareo': [
|
|
442
|
-
'singeo':
|
|
443
|
-
'default':
|
|
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
|
|
444
445
|
};
|
|
445
446
|
const typesString = arrayJoinWithQuotes(liveTypes[brand] ?? liveTypes['default']);
|
|
446
447
|
const now = getSanityDate(new Date());
|
|
@@ -461,6 +462,60 @@ async function fetchUpcomingEvents(brand) {
|
|
|
461
462
|
return fetchSanity(query, true);
|
|
462
463
|
}
|
|
463
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
|
+
|
|
464
519
|
/**
|
|
465
520
|
* Fetch content by a specific Railcontent ID.
|
|
466
521
|
*
|
|
@@ -979,6 +1034,7 @@ module.exports = {
|
|
|
979
1034
|
fetchSongCount,
|
|
980
1035
|
fetchWorkouts,
|
|
981
1036
|
fetchNewReleases,
|
|
1037
|
+
fetchLiveEvent,
|
|
982
1038
|
fetchUpcomingEvents,
|
|
983
1039
|
fetchByRailContentId,
|
|
984
1040
|
fetchByRailContentIds,
|