musora-content-services 1.0.90 → 1.0.92
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/config.js.html +6 -3
- package/docs/index.html +2 -2
- package/docs/module-Config.html +29 -4
- package/docs/module-Railcontent-Services.html +410 -5
- package/docs/module-Sanity-Services.html +182 -41
- package/docs/railcontent.js.html +63 -13
- package/docs/sanity.js.html +54 -32
- package/package.json +1 -1
- package/src/index.js +2 -0
- package/src/services/railcontent.js +40 -1
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
<nav >
|
|
30
30
|
|
|
31
31
|
|
|
32
|
-
<h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-Config.html">Config</a><ul class='methods'><li data-type='method'><a href="module-Config.html#~initializeService">initializeService</a></li></ul></li><li><a href="module-Railcontent-Services.html">Railcontent-Services</a><ul class='methods'><li data-type='method'><a href="module-Railcontent-Services.html#.fetchAllCompletedStates">fetchAllCompletedStates</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchCompletedState">fetchCompletedState</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchContentInProgress">fetchContentInProgress</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchContentPageUserData">fetchContentPageUserData</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchSongsInProgress">fetchSongsInProgress</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchVimeoData">fetchVimeoData</a></li></ul></li><li><a href="module-Sanity-Services.html">Sanity-Services</a><ul class='methods'><li data-type='method'><a href="module-Sanity-Services.html#.fetchAll">fetchAll</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchAllFilterOptions">fetchAllFilterOptions</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchAllPacks">fetchAllPacks</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchAllSongs">fetchAllSongs</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchArtists">fetchArtists</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchByRailContentId">fetchByRailContentId</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchByRailContentIds">fetchByRailContentIds</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchCatalogMetadata">fetchCatalogMetadata</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchChallengeOverview">fetchChallengeOverview</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchChildren">fetchChildren</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchCoachLessons">fetchCoachLessons</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchCourseOverview">fetchCourseOverview</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchFoundation">fetchFoundation</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchLessonContent">fetchLessonContent</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchMethod">fetchMethod</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchMethodChildren">fetchMethodChildren</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchMethodChildrenIds">fetchMethodChildrenIds</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchMethodNextLesson">fetchMethodNextLesson</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchMethodPreviousNextLesson">fetchMethodPreviousNextLesson</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchMethods">fetchMethods</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchNewReleases">fetchNewReleases</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchNextPreviousLesson">fetchNextPreviousLesson</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchPackAll">fetchPackAll</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchPackChildren">fetchPackChildren</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchParentByRailContentId">fetchParentByRailContentId</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchRelatedLessons">fetchRelatedLessons</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchRelatedSongs">fetchRelatedSongs</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchSanity">fetchSanity</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchSongArtistCount">fetchSongArtistCount</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchSongById">fetchSongById</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchSongCount">fetchSongCount</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchSongFilterOptions">fetchSongFilterOptions</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchUpcomingEvents">fetchUpcomingEvents</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchWorkouts">fetchWorkouts</a></li></ul></li></ul>
|
|
32
|
+
<h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-Config.html">Config</a><ul class='methods'><li data-type='method'><a href="module-Config.html#~initializeService">initializeService</a></li></ul></li><li><a href="module-Railcontent-Services.html">Railcontent-Services</a><ul class='methods'><li data-type='method'><a href="module-Railcontent-Services.html#.fetchAllCompletedStates">fetchAllCompletedStates</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchCompletedContent">fetchCompletedContent</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchCompletedState">fetchCompletedState</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchContentInProgress">fetchContentInProgress</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchContentPageUserData">fetchContentPageUserData</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchSongsInProgress">fetchSongsInProgress</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchVimeoData">fetchVimeoData</a></li></ul></li><li><a href="module-Sanity-Services.html">Sanity-Services</a><ul class='methods'><li data-type='method'><a href="module-Sanity-Services.html#.fetchAll">fetchAll</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchAllFilterOptions">fetchAllFilterOptions</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchAllPacks">fetchAllPacks</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchAllSongs">fetchAllSongs</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchArtists">fetchArtists</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchByRailContentId">fetchByRailContentId</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchByRailContentIds">fetchByRailContentIds</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchByReference">fetchByReference</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchCatalogMetadata">fetchCatalogMetadata</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchChallengeOverview">fetchChallengeOverview</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchChildren">fetchChildren</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchCoachLessons">fetchCoachLessons</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchCourseOverview">fetchCourseOverview</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchFoundation">fetchFoundation</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchLessonContent">fetchLessonContent</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchMethod">fetchMethod</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchMethodChildren">fetchMethodChildren</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchMethodChildrenIds">fetchMethodChildrenIds</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchMethodNextLesson">fetchMethodNextLesson</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchMethodPreviousNextLesson">fetchMethodPreviousNextLesson</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchMethods">fetchMethods</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchNewReleases">fetchNewReleases</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchNextPreviousLesson">fetchNextPreviousLesson</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchPackAll">fetchPackAll</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchPackChildren">fetchPackChildren</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchParentByRailContentId">fetchParentByRailContentId</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchRelatedLessons">fetchRelatedLessons</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchRelatedSongs">fetchRelatedSongs</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchSanity">fetchSanity</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchSongArtistCount">fetchSongArtistCount</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchSongById">fetchSongById</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchSongCount">fetchSongCount</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchSongFilterOptions">fetchSongFilterOptions</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchUpcomingEvents">fetchUpcomingEvents</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchWorkouts">fetchWorkouts</a></li></ul></li></ul>
|
|
33
33
|
|
|
34
34
|
</nav>
|
|
35
35
|
|
|
@@ -1090,7 +1090,7 @@ fetchAllFilterOptions('myBrand', '', 'Rock', 'John Doe', 'song', 'Love')
|
|
|
1090
1090
|
|
|
1091
1091
|
<dt class="tag-source">Source:</dt>
|
|
1092
1092
|
<dd class="tag-source"><ul class="dummy"><li>
|
|
1093
|
-
<a href="sanity.js.html">sanity.js</a>, <a href="sanity.js.html#
|
|
1093
|
+
<a href="sanity.js.html">sanity.js</a>, <a href="sanity.js.html#line851">line 851</a>
|
|
1094
1094
|
</li></ul></dd>
|
|
1095
1095
|
|
|
1096
1096
|
|
|
@@ -2333,6 +2333,171 @@ fetchAllFilterOptions('myBrand', '', 'Rock', 'John Doe', 'song', 'Love')
|
|
|
2333
2333
|
|
|
2334
2334
|
|
|
2335
2335
|
|
|
2336
|
+
<h4 class="name" id=".fetchByReference"><span class="type-signature type-signature-static">(static) </span>fetchByReference<span class="signature">(id)</span><span class="type-signature"> → {Promise.<(Object|null)>}</span></h4>
|
|
2337
|
+
|
|
2338
|
+
|
|
2339
|
+
|
|
2340
|
+
|
|
2341
|
+
|
|
2342
|
+
|
|
2343
|
+
<dl class="details">
|
|
2344
|
+
|
|
2345
|
+
<dt class="tag-description">Description:</dt>
|
|
2346
|
+
<dd class="tag-description"><ul class="dummy"><li>Fetch the data needed for the coach screen.</li></ul></dd>
|
|
2347
|
+
|
|
2348
|
+
|
|
2349
|
+
|
|
2350
|
+
<dt class="tag-source">Source:</dt>
|
|
2351
|
+
<dd class="tag-source"><ul class="dummy"><li>
|
|
2352
|
+
<a href="sanity.js.html">sanity.js</a>, <a href="sanity.js.html#line1020">line 1020</a>
|
|
2353
|
+
</li></ul></dd>
|
|
2354
|
+
|
|
2355
|
+
|
|
2356
|
+
|
|
2357
|
+
|
|
2358
|
+
|
|
2359
|
+
|
|
2360
|
+
|
|
2361
|
+
|
|
2362
|
+
|
|
2363
|
+
|
|
2364
|
+
|
|
2365
|
+
|
|
2366
|
+
|
|
2367
|
+
|
|
2368
|
+
|
|
2369
|
+
|
|
2370
|
+
|
|
2371
|
+
|
|
2372
|
+
|
|
2373
|
+
|
|
2374
|
+
|
|
2375
|
+
|
|
2376
|
+
|
|
2377
|
+
|
|
2378
|
+
|
|
2379
|
+
|
|
2380
|
+
|
|
2381
|
+
|
|
2382
|
+
|
|
2383
|
+
|
|
2384
|
+
|
|
2385
|
+
</dl>
|
|
2386
|
+
|
|
2387
|
+
|
|
2388
|
+
|
|
2389
|
+
|
|
2390
|
+
|
|
2391
|
+
|
|
2392
|
+
|
|
2393
|
+
|
|
2394
|
+
|
|
2395
|
+
|
|
2396
|
+
|
|
2397
|
+
<h5 class="h5-examples">Example</h5>
|
|
2398
|
+
|
|
2399
|
+
<pre class="prettyprint"><code>fetchCoachLessons('coach123')
|
|
2400
|
+
.then(lessons => console.log(lessons))
|
|
2401
|
+
.catch(error => console.error(error));</code></pre>
|
|
2402
|
+
|
|
2403
|
+
|
|
2404
|
+
|
|
2405
|
+
|
|
2406
|
+
<h5 class="h5-parameters">Parameters:</h5>
|
|
2407
|
+
|
|
2408
|
+
|
|
2409
|
+
<table class="params">
|
|
2410
|
+
<thead>
|
|
2411
|
+
<tr>
|
|
2412
|
+
|
|
2413
|
+
<th>Name</th>
|
|
2414
|
+
|
|
2415
|
+
|
|
2416
|
+
<th>Type</th>
|
|
2417
|
+
|
|
2418
|
+
|
|
2419
|
+
|
|
2420
|
+
|
|
2421
|
+
|
|
2422
|
+
<th class="last">Description</th>
|
|
2423
|
+
</tr>
|
|
2424
|
+
</thead>
|
|
2425
|
+
|
|
2426
|
+
<tbody>
|
|
2427
|
+
|
|
2428
|
+
|
|
2429
|
+
<tr>
|
|
2430
|
+
|
|
2431
|
+
<td class="name"><code>id</code></td>
|
|
2432
|
+
|
|
2433
|
+
|
|
2434
|
+
<td class="type">
|
|
2435
|
+
|
|
2436
|
+
|
|
2437
|
+
<span class="param-type">string</span>
|
|
2438
|
+
|
|
2439
|
+
|
|
2440
|
+
|
|
2441
|
+
|
|
2442
|
+
</td>
|
|
2443
|
+
|
|
2444
|
+
|
|
2445
|
+
|
|
2446
|
+
|
|
2447
|
+
|
|
2448
|
+
<td class="description last">The Railcontent ID of the coach</td>
|
|
2449
|
+
</tr>
|
|
2450
|
+
|
|
2451
|
+
|
|
2452
|
+
</tbody>
|
|
2453
|
+
</table>
|
|
2454
|
+
|
|
2455
|
+
|
|
2456
|
+
|
|
2457
|
+
|
|
2458
|
+
|
|
2459
|
+
|
|
2460
|
+
|
|
2461
|
+
|
|
2462
|
+
|
|
2463
|
+
|
|
2464
|
+
|
|
2465
|
+
|
|
2466
|
+
|
|
2467
|
+
|
|
2468
|
+
|
|
2469
|
+
|
|
2470
|
+
<h5 class="h5-returns">Returns:</h5>
|
|
2471
|
+
|
|
2472
|
+
|
|
2473
|
+
<div class="param-desc">
|
|
2474
|
+
- The lessons for the instructor or null if not found.
|
|
2475
|
+
</div>
|
|
2476
|
+
|
|
2477
|
+
|
|
2478
|
+
|
|
2479
|
+
<dl class="param-type">
|
|
2480
|
+
<dt>
|
|
2481
|
+
Type
|
|
2482
|
+
</dt>
|
|
2483
|
+
<dd>
|
|
2484
|
+
|
|
2485
|
+
<span class="param-type">Promise.<(Object|null)></span>
|
|
2486
|
+
|
|
2487
|
+
|
|
2488
|
+
|
|
2489
|
+
</dd>
|
|
2490
|
+
</dl>
|
|
2491
|
+
|
|
2492
|
+
|
|
2493
|
+
|
|
2494
|
+
|
|
2495
|
+
|
|
2496
|
+
|
|
2497
|
+
|
|
2498
|
+
|
|
2499
|
+
|
|
2500
|
+
|
|
2336
2501
|
<h4 class="name" id=".fetchCatalogMetadata"><span class="type-signature type-signature-static">(static) </span>fetchCatalogMetadata<span class="signature">(contentType)</span><span class="type-signature"> → {Promise.<(Object|null)>}</span></h4>
|
|
2337
2502
|
|
|
2338
2503
|
|
|
@@ -2350,7 +2515,7 @@ It's an ongoing discussion (Aug 2024), but it's been included here if necessary<
|
|
|
2350
2515
|
|
|
2351
2516
|
<dt class="tag-source">Source:</dt>
|
|
2352
2517
|
<dd class="tag-source"><ul class="dummy"><li>
|
|
2353
|
-
<a href="sanity.js.html">sanity.js</a>, <a href="sanity.js.html#
|
|
2518
|
+
<a href="sanity.js.html">sanity.js</a>, <a href="sanity.js.html#line1110">line 1110</a>
|
|
2354
2519
|
</li></ul></dd>
|
|
2355
2520
|
|
|
2356
2521
|
|
|
@@ -2515,7 +2680,7 @@ It's an ongoing discussion (Aug 2024), but it's been included here if necessary<
|
|
|
2515
2680
|
|
|
2516
2681
|
<dt class="tag-source">Source:</dt>
|
|
2517
2682
|
<dd class="tag-source"><ul class="dummy"><li>
|
|
2518
|
-
<a href="sanity.js.html">sanity.js</a>, <a href="sanity.js.html#
|
|
2683
|
+
<a href="sanity.js.html">sanity.js</a>, <a href="sanity.js.html#line943">line 943</a>
|
|
2519
2684
|
</li></ul></dd>
|
|
2520
2685
|
|
|
2521
2686
|
|
|
@@ -2882,7 +3047,7 @@ It's an ongoing discussion (Aug 2024), but it's been included here if necessary<
|
|
|
2882
3047
|
|
|
2883
3048
|
<dt class="tag-source">Source:</dt>
|
|
2884
3049
|
<dd class="tag-source"><ul class="dummy"><li>
|
|
2885
|
-
<a href="sanity.js.html">sanity.js</a>, <a href="sanity.js.html#
|
|
3050
|
+
<a href="sanity.js.html">sanity.js</a>, <a href="sanity.js.html#line971">line 971</a>
|
|
2886
3051
|
</li></ul></dd>
|
|
2887
3052
|
|
|
2888
3053
|
|
|
@@ -3047,7 +3212,7 @@ It's an ongoing discussion (Aug 2024), but it's been included here if necessary<
|
|
|
3047
3212
|
|
|
3048
3213
|
<dt class="tag-source">Source:</dt>
|
|
3049
3214
|
<dd class="tag-source"><ul class="dummy"><li>
|
|
3050
|
-
<a href="sanity.js.html">sanity.js</a>, <a href="sanity.js.html#
|
|
3215
|
+
<a href="sanity.js.html">sanity.js</a>, <a href="sanity.js.html#line1002">line 1002</a>
|
|
3051
3216
|
</li></ul></dd>
|
|
3052
3217
|
|
|
3053
3218
|
|
|
@@ -3370,7 +3535,7 @@ It's an ongoing discussion (Aug 2024), but it's been included here if necessary<
|
|
|
3370
3535
|
|
|
3371
3536
|
<dt class="tag-source">Source:</dt>
|
|
3372
3537
|
<dd class="tag-source"><ul class="dummy"><li>
|
|
3373
|
-
<a href="sanity.js.html">sanity.js</a>, <a href="sanity.js.html#
|
|
3538
|
+
<a href="sanity.js.html">sanity.js</a>, <a href="sanity.js.html#line785">line 785</a>
|
|
3374
3539
|
</li></ul></dd>
|
|
3375
3540
|
|
|
3376
3541
|
|
|
@@ -3875,7 +4040,7 @@ It's an ongoing discussion (Aug 2024), but it's been included here if necessary<
|
|
|
3875
4040
|
|
|
3876
4041
|
<dt class="tag-source">Source:</dt>
|
|
3877
4042
|
<dd class="tag-source"><ul class="dummy"><li>
|
|
3878
|
-
<a href="sanity.js.html">sanity.js</a>, <a href="sanity.js.html#
|
|
4043
|
+
<a href="sanity.js.html">sanity.js</a>, <a href="sanity.js.html#line723">line 723</a>
|
|
3879
4044
|
</li></ul></dd>
|
|
3880
4045
|
|
|
3881
4046
|
|
|
@@ -4033,7 +4198,7 @@ It's an ongoing discussion (Aug 2024), but it's been included here if necessary<
|
|
|
4033
4198
|
|
|
4034
4199
|
<dt class="tag-source">Source:</dt>
|
|
4035
4200
|
<dd class="tag-source"><ul class="dummy"><li>
|
|
4036
|
-
<a href="sanity.js.html">sanity.js</a>, <a href="sanity.js.html#
|
|
4201
|
+
<a href="sanity.js.html">sanity.js</a>, <a href="sanity.js.html#line689">line 689</a>
|
|
4037
4202
|
</li></ul></dd>
|
|
4038
4203
|
|
|
4039
4204
|
|
|
@@ -4215,7 +4380,7 @@ It's an ongoing discussion (Aug 2024), but it's been included here if necessary<
|
|
|
4215
4380
|
|
|
4216
4381
|
<dt class="tag-source">Source:</dt>
|
|
4217
4382
|
<dd class="tag-source"><ul class="dummy"><li>
|
|
4218
|
-
<a href="sanity.js.html">sanity.js</a>, <a href="sanity.js.html#
|
|
4383
|
+
<a href="sanity.js.html">sanity.js</a>, <a href="sanity.js.html#line707">line 707</a>
|
|
4219
4384
|
</li></ul></dd>
|
|
4220
4385
|
|
|
4221
4386
|
|
|
@@ -4720,7 +4885,7 @@ It's an ongoing discussion (Aug 2024), but it's been included here if necessary<
|
|
|
4720
4885
|
|
|
4721
4886
|
<dt class="tag-source">Source:</dt>
|
|
4722
4887
|
<dd class="tag-source"><ul class="dummy"><li>
|
|
4723
|
-
<a href="sanity.js.html">sanity.js</a>, <a href="sanity.js.html#
|
|
4888
|
+
<a href="sanity.js.html">sanity.js</a>, <a href="sanity.js.html#line759">line 759</a>
|
|
4724
4889
|
</li></ul></dd>
|
|
4725
4890
|
|
|
4726
4891
|
|
|
@@ -4878,7 +5043,7 @@ It's an ongoing discussion (Aug 2024), but it's been included here if necessary<
|
|
|
4878
5043
|
|
|
4879
5044
|
<dt class="tag-source">Source:</dt>
|
|
4880
5045
|
<dd class="tag-source"><ul class="dummy"><li>
|
|
4881
|
-
<a href="sanity.js.html">sanity.js</a>, <a href="sanity.js.html#
|
|
5046
|
+
<a href="sanity.js.html">sanity.js</a>, <a href="sanity.js.html#line865">line 865</a>
|
|
4882
5047
|
</li></ul></dd>
|
|
4883
5048
|
|
|
4884
5049
|
|
|
@@ -5036,7 +5201,7 @@ It's an ongoing discussion (Aug 2024), but it's been included here if necessary<
|
|
|
5036
5201
|
|
|
5037
5202
|
<dt class="tag-source">Source:</dt>
|
|
5038
5203
|
<dd class="tag-source"><ul class="dummy"><li>
|
|
5039
|
-
<a href="sanity.js.html">sanity.js</a>, <a href="sanity.js.html#
|
|
5204
|
+
<a href="sanity.js.html">sanity.js</a>, <a href="sanity.js.html#line929">line 929</a>
|
|
5040
5205
|
</li></ul></dd>
|
|
5041
5206
|
|
|
5042
5207
|
|
|
@@ -5334,7 +5499,7 @@ It's an ongoing discussion (Aug 2024), but it's been included here if necessary<
|
|
|
5334
5499
|
|
|
5335
5500
|
|
|
5336
5501
|
|
|
5337
|
-
<h4 class="name" id=".fetchRelatedLessons"><span class="type-signature type-signature-static">(static) </span>fetchRelatedLessons<span class="signature">(railContentId, brand
|
|
5502
|
+
<h4 class="name" id=".fetchRelatedLessons"><span class="type-signature type-signature-static">(static) </span>fetchRelatedLessons<span class="signature">(railContentId, brand)</span><span class="type-signature"> → {Promise.<(Array.<Object>|null)>}</span></h4>
|
|
5338
5503
|
|
|
5339
5504
|
|
|
5340
5505
|
|
|
@@ -5350,7 +5515,7 @@ It's an ongoing discussion (Aug 2024), but it's been included here if necessary<
|
|
|
5350
5515
|
|
|
5351
5516
|
<dt class="tag-source">Source:</dt>
|
|
5352
5517
|
<dd class="tag-source"><ul class="dummy"><li>
|
|
5353
|
-
<a href="sanity.js.html">sanity.js</a>, <a href="sanity.js.html#
|
|
5518
|
+
<a href="sanity.js.html">sanity.js</a>, <a href="sanity.js.html#line828">line 828</a>
|
|
5354
5519
|
</li></ul></dd>
|
|
5355
5520
|
|
|
5356
5521
|
|
|
@@ -5467,30 +5632,6 @@ It's an ongoing discussion (Aug 2024), but it's been included here if necessary<
|
|
|
5467
5632
|
</tr>
|
|
5468
5633
|
|
|
5469
5634
|
|
|
5470
|
-
|
|
5471
|
-
<tr>
|
|
5472
|
-
|
|
5473
|
-
<td class="name"><code>contentType</code></td>
|
|
5474
|
-
|
|
5475
|
-
|
|
5476
|
-
<td class="type">
|
|
5477
|
-
|
|
5478
|
-
|
|
5479
|
-
<span class="param-type">string</span>
|
|
5480
|
-
|
|
5481
|
-
|
|
5482
|
-
|
|
5483
|
-
|
|
5484
|
-
</td>
|
|
5485
|
-
|
|
5486
|
-
|
|
5487
|
-
|
|
5488
|
-
|
|
5489
|
-
|
|
5490
|
-
<td class="description last">name of the contentype to pull</td>
|
|
5491
|
-
</tr>
|
|
5492
|
-
|
|
5493
|
-
|
|
5494
5635
|
</tbody>
|
|
5495
5636
|
</table>
|
|
5496
5637
|
|
|
@@ -5745,7 +5886,7 @@ It's an ongoing discussion (Aug 2024), but it's been included here if necessary<
|
|
|
5745
5886
|
|
|
5746
5887
|
<dt class="tag-source">Source:</dt>
|
|
5747
5888
|
<dd class="tag-source"><ul class="dummy"><li>
|
|
5748
|
-
<a href="sanity.js.html">sanity.js</a>, <a href="sanity.js.html#
|
|
5889
|
+
<a href="sanity.js.html">sanity.js</a>, <a href="sanity.js.html#line1059">line 1059</a>
|
|
5749
5890
|
</li></ul></dd>
|
|
5750
5891
|
|
|
5751
5892
|
|
|
@@ -6912,7 +7053,7 @@ It also includes completion status and progress percentage for each workout by f
|
|
|
6912
7053
|
<br class="clear">
|
|
6913
7054
|
|
|
6914
7055
|
<footer>
|
|
6915
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.3</a> on
|
|
7056
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.3</a> on Wed Sep 11 2024 20:19:27 GMT+0000 (Coordinated Universal Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
6916
7057
|
</footer>
|
|
6917
7058
|
|
|
6918
7059
|
<script>prettyPrint();</script>
|
package/docs/railcontent.js.html
CHANGED
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
<nav >
|
|
30
30
|
|
|
31
31
|
|
|
32
|
-
<h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-Config.html">Config</a><ul class='methods'><li data-type='method'><a href="module-Config.html#~initializeService">initializeService</a></li></ul></li><li><a href="module-Railcontent-Services.html">Railcontent-Services</a><ul class='methods'><li data-type='method'><a href="module-Railcontent-Services.html#.fetchAllCompletedStates">fetchAllCompletedStates</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchCompletedState">fetchCompletedState</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchContentInProgress">fetchContentInProgress</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchContentPageUserData">fetchContentPageUserData</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchSongsInProgress">fetchSongsInProgress</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchVimeoData">fetchVimeoData</a></li></ul></li><li><a href="module-Sanity-Services.html">Sanity-Services</a><ul class='methods'><li data-type='method'><a href="module-Sanity-Services.html#.fetchAll">fetchAll</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchAllFilterOptions">fetchAllFilterOptions</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchAllPacks">fetchAllPacks</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchAllSongs">fetchAllSongs</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchArtists">fetchArtists</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchByRailContentId">fetchByRailContentId</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchByRailContentIds">fetchByRailContentIds</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchCatalogMetadata">fetchCatalogMetadata</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchChallengeOverview">fetchChallengeOverview</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchChildren">fetchChildren</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchCoachLessons">fetchCoachLessons</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchCourseOverview">fetchCourseOverview</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchFoundation">fetchFoundation</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchLessonContent">fetchLessonContent</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchMethod">fetchMethod</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchMethodChildren">fetchMethodChildren</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchMethodChildrenIds">fetchMethodChildrenIds</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchMethodNextLesson">fetchMethodNextLesson</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchMethodPreviousNextLesson">fetchMethodPreviousNextLesson</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchMethods">fetchMethods</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchNewReleases">fetchNewReleases</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchNextPreviousLesson">fetchNextPreviousLesson</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchPackAll">fetchPackAll</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchPackChildren">fetchPackChildren</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchParentByRailContentId">fetchParentByRailContentId</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchRelatedLessons">fetchRelatedLessons</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchRelatedSongs">fetchRelatedSongs</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchSanity">fetchSanity</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchSongArtistCount">fetchSongArtistCount</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchSongById">fetchSongById</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchSongCount">fetchSongCount</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchSongFilterOptions">fetchSongFilterOptions</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchUpcomingEvents">fetchUpcomingEvents</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchWorkouts">fetchWorkouts</a></li></ul></li></ul>
|
|
32
|
+
<h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-Config.html">Config</a><ul class='methods'><li data-type='method'><a href="module-Config.html#~initializeService">initializeService</a></li></ul></li><li><a href="module-Railcontent-Services.html">Railcontent-Services</a><ul class='methods'><li data-type='method'><a href="module-Railcontent-Services.html#.fetchAllCompletedStates">fetchAllCompletedStates</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchCompletedContent">fetchCompletedContent</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchCompletedState">fetchCompletedState</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchContentInProgress">fetchContentInProgress</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchContentPageUserData">fetchContentPageUserData</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchSongsInProgress">fetchSongsInProgress</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchVimeoData">fetchVimeoData</a></li></ul></li><li><a href="module-Sanity-Services.html">Sanity-Services</a><ul class='methods'><li data-type='method'><a href="module-Sanity-Services.html#.fetchAll">fetchAll</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchAllFilterOptions">fetchAllFilterOptions</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchAllPacks">fetchAllPacks</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchAllSongs">fetchAllSongs</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchArtists">fetchArtists</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchByRailContentId">fetchByRailContentId</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchByRailContentIds">fetchByRailContentIds</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchByReference">fetchByReference</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchCatalogMetadata">fetchCatalogMetadata</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchChallengeOverview">fetchChallengeOverview</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchChildren">fetchChildren</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchCoachLessons">fetchCoachLessons</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchCourseOverview">fetchCourseOverview</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchFoundation">fetchFoundation</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchLessonContent">fetchLessonContent</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchMethod">fetchMethod</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchMethodChildren">fetchMethodChildren</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchMethodChildrenIds">fetchMethodChildrenIds</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchMethodNextLesson">fetchMethodNextLesson</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchMethodPreviousNextLesson">fetchMethodPreviousNextLesson</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchMethods">fetchMethods</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchNewReleases">fetchNewReleases</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchNextPreviousLesson">fetchNextPreviousLesson</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchPackAll">fetchPackAll</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchPackChildren">fetchPackChildren</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchParentByRailContentId">fetchParentByRailContentId</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchRelatedLessons">fetchRelatedLessons</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchRelatedSongs">fetchRelatedSongs</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchSanity">fetchSanity</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchSongArtistCount">fetchSongArtistCount</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchSongById">fetchSongById</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchSongCount">fetchSongCount</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchSongFilterOptions">fetchSongFilterOptions</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchUpcomingEvents">fetchUpcomingEvents</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchWorkouts">fetchWorkouts</a></li></ul></li></ul>
|
|
33
33
|
|
|
34
34
|
</nav>
|
|
35
35
|
|
|
@@ -71,7 +71,7 @@ export async function fetchCompletedState(content_id) {
|
|
|
71
71
|
};
|
|
72
72
|
|
|
73
73
|
try {
|
|
74
|
-
const response = await
|
|
74
|
+
const response = await fetchAbsolute(url, { headers });
|
|
75
75
|
const result = await response.json();
|
|
76
76
|
|
|
77
77
|
if (result && result[content_id]) { return result[content_id]; // Return the correct object
|
|
@@ -103,7 +103,7 @@ export async function fetchVimeoData(vimeo_id) {
|
|
|
103
103
|
};
|
|
104
104
|
|
|
105
105
|
try {
|
|
106
|
-
const response = await
|
|
106
|
+
const response = await fetchAbsolute(url, { headers });
|
|
107
107
|
const result = await response.json();
|
|
108
108
|
|
|
109
109
|
if (result) {
|
|
@@ -138,7 +138,7 @@ export async function fetchAllCompletedStates(contentIds) {
|
|
|
138
138
|
};
|
|
139
139
|
|
|
140
140
|
try {
|
|
141
|
-
const response = await
|
|
141
|
+
const response = await fetchAbsolute(url, { headers });
|
|
142
142
|
const result = await response.json();
|
|
143
143
|
if(result){
|
|
144
144
|
return result;
|
|
@@ -170,7 +170,7 @@ export async function fetchSongsInProgress(brand) {
|
|
|
170
170
|
};
|
|
171
171
|
|
|
172
172
|
try {
|
|
173
|
-
const response = await
|
|
173
|
+
const response = await fetchAbsolute(url, { headers });
|
|
174
174
|
const result = await response.json();
|
|
175
175
|
if(result){
|
|
176
176
|
console.log('fetchSongsInProgress', result);
|
|
@@ -189,28 +189,69 @@ export async function fetchSongsInProgress(brand) {
|
|
|
189
189
|
*
|
|
190
190
|
* @param {string} type - The content type associated with the content.
|
|
191
191
|
* @param {string} brand - The brand associated with the content.
|
|
192
|
+
* @param {number} [limit=20] - The limit of results per page.
|
|
193
|
+
* @param {number} [page=1] - The page number for pagination.
|
|
192
194
|
* @returns {Promise<Object|null>} - Returns an object containing in-progress content if found, otherwise null.
|
|
193
195
|
* @example
|
|
194
196
|
* fetchContentInProgress('song', 'drumeo')
|
|
195
197
|
* .then(songs => console.log(songs))
|
|
196
198
|
* .catch(error => console.error(error));
|
|
197
199
|
*/
|
|
198
|
-
export async function fetchContentInProgress(type="all", brand) {
|
|
200
|
+
export async function fetchContentInProgress(type="all", brand, limit=20, page=1) {
|
|
199
201
|
let url;
|
|
200
|
-
if(type!=="all") {
|
|
201
|
-
url = `/content/in_progress/${globalConfig.railcontentConfig.userId}?brand=${brand}`;
|
|
202
|
+
if(type !== "all") {
|
|
203
|
+
url = `/content/in_progress/${globalConfig.railcontentConfig.userId}?brand=${brand}&limit=${limit}&page=${page}`;
|
|
202
204
|
} else {
|
|
203
|
-
url = `/content/in_progress/${globalConfig.railcontentConfig.userId}?content_type=${type}&brand=${brand}`;
|
|
205
|
+
url = `/content/in_progress/${globalConfig.railcontentConfig.userId}?content_type=${type}&brand=${brand}&limit=${limit}&page=${page}`;
|
|
204
206
|
}
|
|
205
207
|
const headers = {
|
|
206
208
|
'Content-Type': 'application/json',
|
|
207
209
|
'X-CSRF-TOKEN': globalConfig.railcontentConfig.token
|
|
208
210
|
};
|
|
209
211
|
try {
|
|
210
|
-
const response = await
|
|
212
|
+
const response = await fetchAbsolute(url, { headers });
|
|
211
213
|
const result = await response.json();
|
|
212
214
|
if(result){
|
|
213
|
-
console.log('contentInProgress', result);
|
|
215
|
+
//console.log('contentInProgress', result);
|
|
216
|
+
return result;
|
|
217
|
+
} else {
|
|
218
|
+
console.log('result not json');
|
|
219
|
+
}
|
|
220
|
+
} catch (error) {
|
|
221
|
+
console.error('Fetch error:', error);
|
|
222
|
+
return null;
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
/**
|
|
227
|
+
* Fetches a list of content that has been completed for the current user.
|
|
228
|
+
*
|
|
229
|
+
* @param {string} type - The content type associated with the content.
|
|
230
|
+
* @param {string} brand - The brand associated with the content.
|
|
231
|
+
* @param {number} [limit=20] - The limit of results per page.
|
|
232
|
+
* @param {number} [page=1] - The page number for pagination.
|
|
233
|
+
* @returns {Promise<Object|null>} - Returns an object containing in-progress content if found, otherwise null.
|
|
234
|
+
* @example
|
|
235
|
+
* fetchCompletedContent('song', 'drumeo')
|
|
236
|
+
* .then(songs => console.log(songs))
|
|
237
|
+
* .catch(error => console.error(error));
|
|
238
|
+
*/
|
|
239
|
+
export async function fetchCompletedContent(type="all", brand, limit=20, page=1) {
|
|
240
|
+
let url;
|
|
241
|
+
if(type !== "all") {
|
|
242
|
+
url = `/content/completed/${globalConfig.railcontentConfig.userId}?brand=${brand}&limit=${limit}&page=${page}`;
|
|
243
|
+
} else {
|
|
244
|
+
url = `/content/completed/${globalConfig.railcontentConfig.userId}?content_type=${type}&brand=${brand}&limit=${limit}&page=${page}`;
|
|
245
|
+
}
|
|
246
|
+
const headers = {
|
|
247
|
+
'Content-Type': 'application/json',
|
|
248
|
+
'X-CSRF-TOKEN': globalConfig.railcontentConfig.token
|
|
249
|
+
};
|
|
250
|
+
try {
|
|
251
|
+
const response = await fetchAbsolute(url, { headers });
|
|
252
|
+
const result = await response.json();
|
|
253
|
+
if(result){
|
|
254
|
+
//console.log('completed content', result);
|
|
214
255
|
return result;
|
|
215
256
|
} else {
|
|
216
257
|
console.log('result not json');
|
|
@@ -238,8 +279,9 @@ export async function fetchContentPageUserData(contentId) {
|
|
|
238
279
|
'Content-Type': 'application/json',
|
|
239
280
|
'X-CSRF-TOKEN': globalConfig.railcontentConfig.token
|
|
240
281
|
};
|
|
282
|
+
|
|
241
283
|
try {
|
|
242
|
-
const response = await
|
|
284
|
+
const response = await fetchAbsolute(url, { headers });
|
|
243
285
|
const result = await response.json();
|
|
244
286
|
if(result){
|
|
245
287
|
console.log('fetchContentPageUserData', result);
|
|
@@ -251,6 +293,14 @@ export async function fetchContentPageUserData(contentId) {
|
|
|
251
293
|
console.error('Fetch error:', error);
|
|
252
294
|
return null;
|
|
253
295
|
}
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
function fetchAbsolute(url, params) {
|
|
299
|
+
if (url.startsWith('/')) {
|
|
300
|
+
return fetch(globalConfig.railcontentConfig.baseUrl + url, params)
|
|
301
|
+
} else {
|
|
302
|
+
return fetch(url, params);
|
|
303
|
+
}
|
|
254
304
|
}</code></pre>
|
|
255
305
|
</article>
|
|
256
306
|
</section>
|
|
@@ -265,7 +315,7 @@ export async function fetchContentPageUserData(contentId) {
|
|
|
265
315
|
<br class="clear">
|
|
266
316
|
|
|
267
317
|
<footer>
|
|
268
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.3</a> on
|
|
318
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.3</a> on Wed Sep 11 2024 20:19:27 GMT+0000 (Coordinated Universal Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
269
319
|
</footer>
|
|
270
320
|
|
|
271
321
|
<script>prettyPrint();</script>
|