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