@techstuff-dev/foundation-api-utils 1.6.0 → 1.8.0

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/dist/index.js CHANGED
@@ -149,7 +149,9 @@ authSlice.reducer;
149
149
  var formatUserPayload = function (payload) {
150
150
  var userEmail = payload.email, firstName = payload.given_name, lastName = payload.family_name, dateOfBirth = payload.birthdate, uuid = payload["cognito:username"], termsAccepted = payload["custom:termsAccepted"], subscriptionId = payload["custom:subscriptionId"], contactPreference = payload["custom:contactPreferences"], customerId = payload["custom:customerId"];
151
151
  var parsedTermsAccepted = termsAccepted ? JSON.parse(termsAccepted) : null;
152
- var parsedContactPreference = contactPreference ? JSON.parse(contactPreference) : null;
152
+ var parsedContactPreference = contactPreference
153
+ ? JSON.parse(contactPreference)
154
+ : null;
153
155
  var data = {
154
156
  userEmail: userEmail,
155
157
  lastName: lastName,
@@ -191,30 +193,340 @@ function formatPromos(data) {
191
193
  };
192
194
  });
193
195
  }
194
- function formatESWorkoutItems(data) {
196
+ function formatWorkout(data) {
195
197
  var response = data.map(function (item) {
196
- var _a = item._source, changed = _a.changed, uuid = _a.uuid, description = _a.description, duration = _a.duration, duration_filter = _a.duration_filter, image = _a.image, level = _a.level, published = _a.published, targeted_section = _a.targeted_section, title = _a.title, uid = _a.uid, video_url = _a.video_url, video_poster = _a.video_poster, workout_category = _a.workout_category, workout_type = _a.workout_type, livestream_section = _a.livestream_section;
198
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11;
197
199
  return {
198
- changed: changed && changed[0],
199
- uuid: uuid && uuid[0],
200
- description: description && description[0],
201
- duration: duration && duration[0],
202
- duration_filter: duration_filter && duration_filter[0],
203
- level: level && level[0],
204
- published: published && published[0],
205
- targeted_section: targeted_section && targeted_section[0],
206
- uid: uid && uid[0],
207
- image: image && image[0],
208
- title: title && title[0],
209
- video: video_url && video_url[0],
210
- video_poster: video_poster && video_poster[0],
211
- workout_category: workout_category && workout_category[0],
212
- workout_type: workout_type && workout_type[0],
213
- livestream_section: livestream_section && livestream_section[0],
200
+ changed: (_b = (_a = item === null || item === void 0 ? void 0 : item._source) === null || _a === void 0 ? void 0 : _a.changed) === null || _b === void 0 ? void 0 : _b[0],
201
+ created: (_d = (_c = item === null || item === void 0 ? void 0 : item._source) === null || _c === void 0 ? void 0 : _c.created) === null || _d === void 0 ? void 0 : _d[0],
202
+ uuid: (_f = (_e = item === null || item === void 0 ? void 0 : item._source) === null || _e === void 0 ? void 0 : _e.uuid) === null || _f === void 0 ? void 0 : _f[0],
203
+ description: (_h = (_g = item === null || item === void 0 ? void 0 : item._source) === null || _g === void 0 ? void 0 : _g.description) === null || _h === void 0 ? void 0 : _h[0],
204
+ duration: (_k = (_j = item === null || item === void 0 ? void 0 : item._source) === null || _j === void 0 ? void 0 : _j.duration) === null || _k === void 0 ? void 0 : _k[0],
205
+ duration_filter: (_m = (_l = item === null || item === void 0 ? void 0 : item._source) === null || _l === void 0 ? void 0 : _l.duration_filter) === null || _m === void 0 ? void 0 : _m[0],
206
+ level: (_p = (_o = item === null || item === void 0 ? void 0 : item._source) === null || _o === void 0 ? void 0 : _o.level) === null || _p === void 0 ? void 0 : _p[0],
207
+ published: (_r = (_q = item === null || item === void 0 ? void 0 : item._source) === null || _q === void 0 ? void 0 : _q.published) === null || _r === void 0 ? void 0 : _r[0],
208
+ targeted_section: (_t = (_s = item === null || item === void 0 ? void 0 : item._source) === null || _s === void 0 ? void 0 : _s.targeted_section) === null || _t === void 0 ? void 0 : _t[0],
209
+ uid: (_v = (_u = item === null || item === void 0 ? void 0 : item._source) === null || _u === void 0 ? void 0 : _u.uid) === null || _v === void 0 ? void 0 : _v[0],
210
+ image: (_x = (_w = item === null || item === void 0 ? void 0 : item._source) === null || _w === void 0 ? void 0 : _w.image) === null || _x === void 0 ? void 0 : _x[0],
211
+ title: (_z = (_y = item === null || item === void 0 ? void 0 : item._source) === null || _y === void 0 ? void 0 : _y.title) === null || _z === void 0 ? void 0 : _z[0],
212
+ video: (_1 = (_0 = item === null || item === void 0 ? void 0 : item._source) === null || _0 === void 0 ? void 0 : _0.video_url) === null || _1 === void 0 ? void 0 : _1[0],
213
+ videoDownload: (_3 = (_2 = item === null || item === void 0 ? void 0 : item._source) === null || _2 === void 0 ? void 0 : _2.video_download) === null || _3 === void 0 ? void 0 : _3[0],
214
+ videoPoster: (_5 = (_4 = item === null || item === void 0 ? void 0 : item._source) === null || _4 === void 0 ? void 0 : _4.video_poster) === null || _5 === void 0 ? void 0 : _5[0],
215
+ workoutCategory: (_7 = (_6 = item === null || item === void 0 ? void 0 : item._source) === null || _6 === void 0 ? void 0 : _6.workout_category) === null || _7 === void 0 ? void 0 : _7[0],
216
+ workoutType: (_9 = (_8 = item === null || item === void 0 ? void 0 : item._source) === null || _8 === void 0 ? void 0 : _8.workout_type) === null || _9 === void 0 ? void 0 : _9[0],
217
+ livestream_section: (_11 = (_10 = item === null || item === void 0 ? void 0 : item._source) === null || _10 === void 0 ? void 0 : _10.livestream_section) === null || _11 === void 0 ? void 0 : _11[0],
214
218
  };
215
219
  });
216
220
  return response;
217
221
  }
222
+ function formatSeries(data, channel) {
223
+ var formattedSeriesSelection = data.map(function (series) {
224
+ return {
225
+ uuid: series.uuid,
226
+ id: series.uuid,
227
+ title: series.title,
228
+ subtitle: series.subtitle,
229
+ thumb: series.imageThumbnailURL,
230
+ mainImage: series.imageURL,
231
+ description: series.summary.value,
232
+ body: series.body.value,
233
+ nid: series.nid,
234
+ seasonList: series.season,
235
+ channel: channel,
236
+ };
237
+ });
238
+ return formattedSeriesSelection;
239
+ }
240
+ function formatShortform(data) {
241
+ return data.map(function (item) {
242
+ var _source = item._source;
243
+ return {
244
+ uuid: _source.uuid && _source.uuid[0],
245
+ id: _source.uuid && _source.uuid[0],
246
+ nid: _source.nid && _source.nid[0],
247
+ title: _source.title && _source.title[0],
248
+ thumb: _source.field_image_thumb && _source.field_image_thumb[0],
249
+ mainImage: _source.field_image_poster && _source.field_image_poster[0],
250
+ description: _source.field_short_synopsis && _source.field_short_synopsis[0],
251
+ body: _source.field_body && _source.field_body[0],
252
+ channel: _source.field_channel && _source.field_channel[0],
253
+ updated: _source.revision_timestamp && _source.revision_timestamp[0],
254
+ langcode: _source.langcode && _source.langcode[0],
255
+ video: _source.field_videomanifest && _source.field_videomanifest[0],
256
+ duration: _source.field_duration && _source.field_duration[0],
257
+ category: _source.field_category && _source.field_category[0],
258
+ };
259
+ });
260
+ }
261
+ function formatLongform(data) {
262
+ return data.map(function (item) {
263
+ var _source = item._source;
264
+ return {
265
+ uuid: _source.uuid && _source.uuid[0],
266
+ id: _source.uuid && _source.uuid[0],
267
+ nid: _source.nid && _source.nid[0],
268
+ title: _source.title && _source.title[0],
269
+ image: _source.image && _source.image[0],
270
+ image_promo: _source.image_promo && _source.image_promo[0],
271
+ image_promo_large: _source.image_promo_large && _source.image_promo_large[0],
272
+ image_poster: _source.image_poster && _source.image_poster[0],
273
+ summary: _source.summary && _source.summary[0],
274
+ created: _source.created && _source.created[0],
275
+ updated: _source.revision_timestamp && _source.revision_timestamp[0],
276
+ video: _source.video_manifest && _source.video_manifest[0],
277
+ rating: _source.rating && _source.rating[0],
278
+ released: _source.released_date && _source.released_date[0],
279
+ source_id: _source.source_id && _source.source_id[0],
280
+ director: _source.director && _source.director[0],
281
+ duration: _source.duration && _source.duration[0],
282
+ path: _source.path && _source.path[0],
283
+ genres: _source.genres,
284
+ actors: _source.actors,
285
+ writers: _source.writers,
286
+ };
287
+ });
288
+ }
289
+ function formatFaqs(data) {
290
+ return data.map(function (item) {
291
+ var _source = item._source;
292
+ return {
293
+ uuid: _source.uuid && _source.uuid[0],
294
+ id: _source.uuid && _source.uuid[0],
295
+ title: _source.title && _source.title[0],
296
+ answer: _source.answer && _source.answer[0],
297
+ created: _source.created && _source.created[0],
298
+ updated: _source.updated && _source.updated[0],
299
+ };
300
+ });
301
+ }
302
+ function formatPages(data) {
303
+ return data.map(function (item) {
304
+ var _source = item._source;
305
+ return {
306
+ uuid: _source.uuid && _source.uuid[0],
307
+ id: _source.uuid && _source.uuid[0],
308
+ title: _source.title && _source.title[0],
309
+ body: _source.body && _source.body[0],
310
+ created: _source.created && _source.created[0],
311
+ updated: _source.updated && _source.updated[0],
312
+ langcode: _source.langcode && _source.langcode[0],
313
+ url: _source.url && _source.url[0],
314
+ };
315
+ });
316
+ }
317
+ function formatSettings(data) {
318
+ return data.map(function (item) {
319
+ var _source = item._source;
320
+ var fieldset = _source.fieldset && _source.fieldset[0].toLowerCase();
321
+ return {
322
+ uuid: _source.uuid && _source.uuid[0],
323
+ created: _source.created && _source.created[0],
324
+ updated: _source.updated && _source.updated[0],
325
+ status: _source.status && _source.status[0],
326
+ type: _source.type && _source.type[0],
327
+ video: _source.video && _source.video[0],
328
+ number: _source.number && _source.number[0],
329
+ pass: _source.pass && _source.pass[0],
330
+ fieldset: fieldset,
331
+ };
332
+ });
333
+ }
334
+ function formatPress(data) {
335
+ return data.map(function (item) {
336
+ var _source = item._source;
337
+ return {
338
+ uuid: _source.uuid && _source.uuid[0],
339
+ created: _source.created && _source.created[0],
340
+ updated: _source.updated && _source.updated[0],
341
+ image: _source.image && _source.image[0],
342
+ title: _source.title && _source.title[0],
343
+ };
344
+ });
345
+ }
346
+ function formatGuests(data) {
347
+ return data.map(function (item) {
348
+ var _source = item._source;
349
+ return {
350
+ uuid: _source.uuid && _source.uuid[0],
351
+ id: _source.id && _source.id[0],
352
+ title: _source.title && _source.title[0],
353
+ updated: _source.updated && _source.updated[0],
354
+ description: _source.description && _source.description[0],
355
+ image: _source.image_16_9 && _source.image_16_9[0],
356
+ display: _source.display && _source.display[0],
357
+ };
358
+ });
359
+ }
360
+ function formatVideos(data) {
361
+ var response = data.map(function (item) {
362
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
363
+ return {
364
+ uuid: (_b = (_a = item === null || item === void 0 ? void 0 : item._source) === null || _a === void 0 ? void 0 : _a.uuid) === null || _b === void 0 ? void 0 : _b[0],
365
+ title: (_d = (_c = item === null || item === void 0 ? void 0 : item._source) === null || _c === void 0 ? void 0 : _c.title) === null || _d === void 0 ? void 0 : _d[0],
366
+ created: (_f = (_e = item === null || item === void 0 ? void 0 : item._source) === null || _e === void 0 ? void 0 : _e.created) === null || _f === void 0 ? void 0 : _f[0],
367
+ updated: (_h = (_g = item === null || item === void 0 ? void 0 : item._source) === null || _g === void 0 ? void 0 : _g.updated) === null || _h === void 0 ? void 0 : _h[0],
368
+ description: (_k = (_j = item === null || item === void 0 ? void 0 : item._source) === null || _j === void 0 ? void 0 : _j.description) === null || _k === void 0 ? void 0 : _k[0],
369
+ image: (_m = (_l = item === null || item === void 0 ? void 0 : item._source) === null || _l === void 0 ? void 0 : _l.image) === null || _m === void 0 ? void 0 : _m[0],
370
+ duration: (_p = (_o = item === null || item === void 0 ? void 0 : item._source) === null || _o === void 0 ? void 0 : _o.duration) === null || _p === void 0 ? void 0 : _p[0],
371
+ section: (_r = (_q = item === null || item === void 0 ? void 0 : item._source) === null || _q === void 0 ? void 0 : _q.section) === null || _r === void 0 ? void 0 : _r[0],
372
+ videoPoster: (_t = (_s = item === null || item === void 0 ? void 0 : item._source) === null || _s === void 0 ? void 0 : _s.video_poster) === null || _t === void 0 ? void 0 : _t[0],
373
+ videoUrl: (_v = (_u = item === null || item === void 0 ? void 0 : item._source) === null || _u === void 0 ? void 0 : _u.video_url) === null || _v === void 0 ? void 0 : _v[0],
374
+ videoDownload: (_x = (_w = item === null || item === void 0 ? void 0 : item._source) === null || _w === void 0 ? void 0 : _w.video_download) === null || _x === void 0 ? void 0 : _x[0],
375
+ sectionId: (_z = (_y = item === null || item === void 0 ? void 0 : item._source) === null || _y === void 0 ? void 0 : _y.section_id) === null || _z === void 0 ? void 0 : _z[0],
376
+ };
377
+ });
378
+ return response;
379
+ }
380
+ function formatSections(data) {
381
+ return data.map(function (item) {
382
+ var _source = item._source;
383
+ return {
384
+ uuid: _source.uuid && _source.uuid[0],
385
+ title: _source.title && _source.title[0],
386
+ description: _source.description && _source.description[0],
387
+ image: _source.image && _source.image[0],
388
+ challenge: _source.challenge && _source.challenge[0],
389
+ display: _source.display && _source.display[0],
390
+ id: _source.id && _source.id[0],
391
+ };
392
+ });
393
+ }
394
+ function formatSchedule(data) {
395
+ return data.map(function (item) {
396
+ var _source = item._source;
397
+ return {
398
+ uuid: _source.uuid && _source.uuid[0],
399
+ created: _source.created && _source.created[0],
400
+ langcode: _source.langcode && _source.langcode[0],
401
+ updated: _source.updated && _source.updated[0],
402
+ days: [
403
+ {
404
+ monday: _source.monday_title &&
405
+ _source.monday_title.length > 0 &&
406
+ _source.monday_title.map(function (title, index) {
407
+ var _a, _b, _c;
408
+ return {
409
+ end: (_a = _source === null || _source === void 0 ? void 0 : _source.monday_end) === null || _a === void 0 ? void 0 : _a[index],
410
+ start: (_b = _source === null || _source === void 0 ? void 0 : _source.monday_start) === null || _b === void 0 ? void 0 : _b[index],
411
+ title: title,
412
+ video: (_c = _source === null || _source === void 0 ? void 0 : _source.monday_video) === null || _c === void 0 ? void 0 : _c[index],
413
+ };
414
+ }),
415
+ },
416
+ {
417
+ tuesday: _source.tuesday_title &&
418
+ _source.tuesday_title.length > 0 &&
419
+ _source.tuesday_title.map(function (title, index) {
420
+ var _a, _b, _c;
421
+ return {
422
+ end: (_a = _source === null || _source === void 0 ? void 0 : _source.tuesday_end) === null || _a === void 0 ? void 0 : _a[index],
423
+ start: (_b = _source === null || _source === void 0 ? void 0 : _source.tuesday_start) === null || _b === void 0 ? void 0 : _b[index],
424
+ title: title,
425
+ video: (_c = _source === null || _source === void 0 ? void 0 : _source.tuesday_video) === null || _c === void 0 ? void 0 : _c[index],
426
+ };
427
+ }),
428
+ },
429
+ {
430
+ wednesday: _source.wednesday_title &&
431
+ _source.wednesday_title.length > 0 &&
432
+ _source.wednesday_title.map(function (title, index) {
433
+ var _a, _b, _c;
434
+ return {
435
+ end: (_a = _source === null || _source === void 0 ? void 0 : _source.wednesday_end) === null || _a === void 0 ? void 0 : _a[index],
436
+ start: (_b = _source === null || _source === void 0 ? void 0 : _source.wednesday_start) === null || _b === void 0 ? void 0 : _b[index],
437
+ title: title,
438
+ video: (_c = _source === null || _source === void 0 ? void 0 : _source.wednesday_video) === null || _c === void 0 ? void 0 : _c[index],
439
+ };
440
+ }),
441
+ },
442
+ {
443
+ thursday: _source.thursday_title &&
444
+ _source.thursday_title.length > 0 &&
445
+ _source.thursday_title.map(function (title, index) {
446
+ var _a, _b, _c;
447
+ return {
448
+ end: (_a = _source === null || _source === void 0 ? void 0 : _source.thursday_end) === null || _a === void 0 ? void 0 : _a[index],
449
+ start: (_b = _source === null || _source === void 0 ? void 0 : _source.thursday_start) === null || _b === void 0 ? void 0 : _b[index],
450
+ title: title,
451
+ video: (_c = _source === null || _source === void 0 ? void 0 : _source.thursday_video) === null || _c === void 0 ? void 0 : _c[index],
452
+ };
453
+ }),
454
+ },
455
+ {
456
+ friday: _source.friday_title &&
457
+ _source.friday_title.length > 0 &&
458
+ _source.friday_title.map(function (title, index) {
459
+ var _a, _b, _c;
460
+ return {
461
+ end: (_a = _source === null || _source === void 0 ? void 0 : _source.friday_end) === null || _a === void 0 ? void 0 : _a[index],
462
+ start: (_b = _source === null || _source === void 0 ? void 0 : _source.friday_start) === null || _b === void 0 ? void 0 : _b[index],
463
+ title: title,
464
+ video: (_c = _source === null || _source === void 0 ? void 0 : _source.friday_video) === null || _c === void 0 ? void 0 : _c[index],
465
+ };
466
+ }),
467
+ },
468
+ {
469
+ saturday: _source.saturday_title &&
470
+ _source.saturday_title.length > 0 &&
471
+ _source.saturday_title.map(function (title, index) {
472
+ var _a, _b, _c;
473
+ return {
474
+ end: (_a = _source === null || _source === void 0 ? void 0 : _source.saturday_end) === null || _a === void 0 ? void 0 : _a[index],
475
+ start: (_b = _source === null || _source === void 0 ? void 0 : _source.saturday_start) === null || _b === void 0 ? void 0 : _b[index],
476
+ title: title,
477
+ video: (_c = _source === null || _source === void 0 ? void 0 : _source.saturday_video) === null || _c === void 0 ? void 0 : _c[index],
478
+ };
479
+ }),
480
+ },
481
+ {
482
+ sunday: _source.sunday_title &&
483
+ _source.sunday_title.length > 0 &&
484
+ _source.sunday_title.map(function (title, index) {
485
+ var _a, _b, _c;
486
+ return {
487
+ end: (_a = _source === null || _source === void 0 ? void 0 : _source.sunday_end) === null || _a === void 0 ? void 0 : _a[index],
488
+ start: (_b = _source === null || _source === void 0 ? void 0 : _source.sunday_start) === null || _b === void 0 ? void 0 : _b[index],
489
+ title: title,
490
+ video: (_c = _source === null || _source === void 0 ? void 0 : _source.sunday_video) === null || _c === void 0 ? void 0 : _c[index],
491
+ };
492
+ }),
493
+ },
494
+ ],
495
+ };
496
+ });
497
+ }
498
+ function formatChallenges(data) {
499
+ return data.map(function (item) {
500
+ var _source = item._source;
501
+ return {
502
+ uuid: _source.uuid && _source.uuid[0],
503
+ title: _source.title && _source.title[0],
504
+ body: _source.body && _source.body[0],
505
+ image: _source.image && _source.image[0],
506
+ challengeKey: _source.challenge_key && _source.challenge_key[0],
507
+ created: _source.created && _source.created[0],
508
+ days: _source.days,
509
+ updated: _source.updated && _source.updated[0],
510
+ purchaseButtonLabel: _source.purchase_button_label && _source.purchase_button_label[0],
511
+ price: _source.price && _source.price[0],
512
+ };
513
+ });
514
+ }
515
+ function formatChallengeDays(data) {
516
+ return data.map(function (item) {
517
+ var _source = item._source;
518
+ return {
519
+ uuid: _source.uuid && _source.uuid[0],
520
+ title: _source.title && _source.title[0],
521
+ body: _source.body && _source.body[0],
522
+ image: _source.image && _source.image[0],
523
+ created: _source.created && _source.created[0],
524
+ updated: _source.updated && _source.updated[0],
525
+ video: _source.video && _source.video[0],
526
+ workout: _source.workout && _source.workout[0],
527
+ };
528
+ });
529
+ }
218
530
 
219
531
  // console.log('process.env', process.env);
220
532
  // console.log('process.env?.WEB_APP', process.env?.WEB_APP);
@@ -529,10 +841,10 @@ var authApi = react.createApi({
529
841
  }); },
530
842
  });
531
843
  // Export hooks for usage in functional components.
532
- var useLoginQuery = authApi.useLoginQuery, useLazyLoginQuery = authApi.useLazyLoginQuery, useResetPasswordMutation = authApi.useResetPasswordMutation, useResetPasswordAuthMutation = authApi.useResetPasswordAuthMutation, useRefreshTokenQuery = authApi.useRefreshTokenQuery, useLazyRefreshTokenQuery = authApi.useLazyRefreshTokenQuery, useLogoutQuery = authApi.useLogoutQuery, useLazyLogoutQuery = authApi.useLazyLogoutQuery, useRegisterMutation = authApi.useRegisterMutation, useVerifyUserQuery = authApi.useVerifyUserQuery, useLazyVerifyUserQuery = authApi.useLazyVerifyUserQuery, useGetUserInfoQuery = authApi.useGetUserInfoQuery, useLazyGetUserInfoQuery = authApi.useLazyGetUserInfoQuery, useUpdateUserInfoMutation = authApi.useUpdateUserInfoMutation, useForgottenPasswordMutation = authApi.useForgottenPasswordMutation, useVerifyUserAttributesQuery = authApi.useVerifyUserAttributesQuery, useLazyVerifyUserAttributesQuery = authApi.useLazyVerifyUserAttributesQuery, useVerifyUserResendQuery = authApi.useVerifyUserResendQuery, useLazyVerifyUserResendQuery = authApi.useLazyVerifyUserResendQuery, useUpdateUserMutation = authApi.useUpdateUserMutation;
844
+ authApi.useLoginQuery; authApi.useLazyLoginQuery; authApi.useResetPasswordMutation; authApi.useResetPasswordAuthMutation; authApi.useRefreshTokenQuery; authApi.useLazyRefreshTokenQuery; authApi.useLogoutQuery; authApi.useLazyLogoutQuery; authApi.useRegisterMutation; authApi.useVerifyUserQuery; authApi.useLazyVerifyUserQuery; authApi.useGetUserInfoQuery; authApi.useLazyGetUserInfoQuery; authApi.useUpdateUserInfoMutation; authApi.useForgottenPasswordMutation; authApi.useVerifyUserAttributesQuery; authApi.useLazyVerifyUserAttributesQuery; authApi.useVerifyUserResendQuery; authApi.useLazyVerifyUserResendQuery; authApi.useUpdateUserMutation;
533
845
 
534
- console.log('APP_ES_INSTANCE', APP_ES_INSTANCE);
535
- console.log('APP_ES_AUTH', APP_ES_AUTH);
846
+ // console.log('APP_ES_INSTANCE', APP_ES_INSTANCE);
847
+ // console.log('APP_ES_AUTH', APP_ES_AUTH);
536
848
  var contentApi = react.createApi({
537
849
  reducerPath: 'contentApi',
538
850
  baseQuery: react.fetchBaseQuery({
@@ -542,58 +854,62 @@ var contentApi = react.createApi({
542
854
  return headers;
543
855
  },
544
856
  }),
545
- tagTypes: ['Data', 'Promos', 'Workouts'],
857
+ tagTypes: ['Data'],
546
858
  // keepUnusedDataFor: 300,
547
859
  endpoints: function (builder) { return ({
548
860
  getData: builder.query({
549
- query: function (index) { return ({
550
- url: "".concat(index, "/_search"),
551
- method: 'POST',
552
- body: {
553
- from: 0,
554
- size: 100,
555
- sort: [{ created: { order: 'desc' } }],
556
- query: {
557
- match_all: {},
558
- },
559
- },
560
- }); },
561
- // transformResponse: (response: ESPromoResponse) =>
562
- // formatPromos(response?.hits?.hits),
563
- providesTags: ['Promos'],
564
- }),
565
- getPromos: builder.query({
566
- query: function (index) { return ({
567
- url: "".concat(index, "/_search"),
568
- method: 'POST',
569
- body: {
570
- from: 0,
571
- size: 100,
572
- sort: [{ created: { order: 'desc' } }],
573
- query: {
574
- match_all: {},
575
- },
576
- },
577
- }); },
578
- transformResponse: function (response) { var _a; return formatPromos((_a = response === null || response === void 0 ? void 0 : response.hits) === null || _a === void 0 ? void 0 : _a.hits); },
579
- providesTags: ['Promos'],
580
- }),
581
- getWorkouts: builder.query({
582
- query: function (index) { return ({
583
- url: "".concat(index, "/_search"),
584
- method: 'POST',
585
- body: {
586
- from: 0,
587
- size: 100,
588
- sort: [{ created: { order: 'desc' } }],
589
- query: {
590
- match_all: {},
861
+ query: function (_a) {
862
+ var index = _a.index, _b = _a.options, options = _b === void 0 ? {} : _b;
863
+ return ({
864
+ url: "".concat(index, "/_search"),
865
+ method: 'POST',
866
+ body: {
867
+ from: 0,
868
+ size: options.size || 1000,
869
+ sort: options.sort || [{ created: { order: 'desc' } }],
870
+ query: options.query || {
871
+ match_all: {},
872
+ },
591
873
  },
592
- },
593
- }); },
594
- transformResponse: function (response) { var _a; return formatESWorkoutItems((_a = response === null || response === void 0 ? void 0 : response.hits) === null || _a === void 0 ? void 0 : _a.hits); },
595
- providesTags: ['Workouts'],
874
+ });
875
+ },
876
+ transformResponse: function (response) { var _a; return (_a = response === null || response === void 0 ? void 0 : response.hits) === null || _a === void 0 ? void 0 : _a.hits; },
877
+ providesTags: ['Data'],
596
878
  }),
879
+ // getPromos: builder.query<Promo[], string | undefined>({
880
+ // query: (index) => ({
881
+ // url: `${index}/_search`,
882
+ // method: 'POST',
883
+ // body: {
884
+ // from: 0,
885
+ // size: 100,
886
+ // sort: [{ created: { order: 'desc' } }],
887
+ // query: {
888
+ // match_all: {},
889
+ // },
890
+ // },
891
+ // }),
892
+ // transformResponse: (response: ESPromoResponse) =>
893
+ // formatPromos(response?.hits?.hits),
894
+ // providesTags: ['Promos'],
895
+ // }),
896
+ // getWorkouts: builder.query<Workout[], string | undefined>({
897
+ // query: (index) => ({
898
+ // url: `${index}/_search`,
899
+ // method: 'POST',
900
+ // body: {
901
+ // from: 0,
902
+ // size: 100,
903
+ // sort: [{ created: { order: 'desc' } }],
904
+ // query: {
905
+ // match_all: {},
906
+ // },
907
+ // },
908
+ // }),
909
+ // transformResponse: (response: ESWorkoutResponse) =>
910
+ // formatESWorkoutItems(response?.hits?.hits),
911
+ // providesTags: ['Workouts'],
912
+ // }),
597
913
  getWorkoutById: builder.query({
598
914
  query: function (_a) {
599
915
  var index = _a.index, id = _a.id;
@@ -612,7 +928,12 @@ var contentApi = react.createApi({
612
928
  }),
613
929
  }); },
614
930
  });
615
- var useGetDataQuery = contentApi.useGetDataQuery, useLazyGetDataQuery = contentApi.useLazyGetDataQuery, useGetPromosQuery = contentApi.useGetPromosQuery, useLazyGetPromosQuery = contentApi.useLazyGetPromosQuery, useGetWorkoutsQuery = contentApi.useGetWorkoutsQuery, useLazyGetWorkoutsQuery = contentApi.useLazyGetWorkoutsQuery, useGetWorkoutByIdQuery = contentApi.useGetWorkoutByIdQuery, useLazyGetWorkoutByIdQuery = contentApi.useLazyGetWorkoutByIdQuery;
931
+ contentApi.useGetDataQuery; contentApi.useLazyGetDataQuery;
932
+ // useGetPromosQuery,
933
+ // useLazyGetPromosQuery,
934
+ // useGetWorkoutsQuery,
935
+ // useLazyGetWorkoutsQuery,
936
+ contentApi.useGetWorkoutByIdQuery; contentApi.useLazyGetWorkoutByIdQuery;
616
937
 
617
938
  var useLoggedIn = function () {
618
939
  var isLoggedIn = reactRedux.useSelector(isAuthenticated);
@@ -728,41 +1049,26 @@ var webStore = isWeb && makeWebStore();
728
1049
 
729
1050
  exports.authApi = authApi;
730
1051
  exports.contentApi = contentApi;
731
- exports.formatESWorkoutItems = formatESWorkoutItems;
1052
+ exports.formatChallengeDays = formatChallengeDays;
1053
+ exports.formatChallenges = formatChallenges;
1054
+ exports.formatFaqs = formatFaqs;
1055
+ exports.formatGuests = formatGuests;
1056
+ exports.formatLongform = formatLongform;
1057
+ exports.formatPages = formatPages;
1058
+ exports.formatPress = formatPress;
732
1059
  exports.formatPromos = formatPromos;
1060
+ exports.formatSchedule = formatSchedule;
1061
+ exports.formatSections = formatSections;
1062
+ exports.formatSeries = formatSeries;
1063
+ exports.formatSettings = formatSettings;
1064
+ exports.formatShortform = formatShortform;
733
1065
  exports.formatUserPayload = formatUserPayload;
1066
+ exports.formatVideos = formatVideos;
1067
+ exports.formatWorkout = formatWorkout;
734
1068
  exports.nativeStore = nativeStore;
735
1069
  exports.useAppDispatch = useAppDispatch;
736
1070
  exports.useAppSelector = useAppSelector;
737
1071
  exports.useAppStore = useAppStore;
738
- exports.useForgottenPasswordMutation = useForgottenPasswordMutation;
739
- exports.useGetDataQuery = useGetDataQuery;
740
- exports.useGetPromosQuery = useGetPromosQuery;
741
- exports.useGetUserInfoQuery = useGetUserInfoQuery;
742
- exports.useGetWorkoutByIdQuery = useGetWorkoutByIdQuery;
743
- exports.useGetWorkoutsQuery = useGetWorkoutsQuery;
744
- exports.useLazyGetDataQuery = useLazyGetDataQuery;
745
- exports.useLazyGetPromosQuery = useLazyGetPromosQuery;
746
- exports.useLazyGetUserInfoQuery = useLazyGetUserInfoQuery;
747
- exports.useLazyGetWorkoutByIdQuery = useLazyGetWorkoutByIdQuery;
748
- exports.useLazyGetWorkoutsQuery = useLazyGetWorkoutsQuery;
749
- exports.useLazyLoginQuery = useLazyLoginQuery;
750
- exports.useLazyLogoutQuery = useLazyLogoutQuery;
751
- exports.useLazyRefreshTokenQuery = useLazyRefreshTokenQuery;
752
- exports.useLazyVerifyUserAttributesQuery = useLazyVerifyUserAttributesQuery;
753
- exports.useLazyVerifyUserQuery = useLazyVerifyUserQuery;
754
- exports.useLazyVerifyUserResendQuery = useLazyVerifyUserResendQuery;
755
1072
  exports.useLoggedIn = useLoggedIn;
756
- exports.useLoginQuery = useLoginQuery;
757
- exports.useLogoutQuery = useLogoutQuery;
758
- exports.useRefreshTokenQuery = useRefreshTokenQuery;
759
- exports.useRegisterMutation = useRegisterMutation;
760
- exports.useResetPasswordAuthMutation = useResetPasswordAuthMutation;
761
- exports.useResetPasswordMutation = useResetPasswordMutation;
762
- exports.useUpdateUserInfoMutation = useUpdateUserInfoMutation;
763
- exports.useUpdateUserMutation = useUpdateUserMutation;
764
- exports.useVerifyUserAttributesQuery = useVerifyUserAttributesQuery;
765
- exports.useVerifyUserQuery = useVerifyUserQuery;
766
- exports.useVerifyUserResendQuery = useVerifyUserResendQuery;
767
1073
  exports.webStore = webStore;
768
1074
  //# sourceMappingURL=index.js.map