@techstuff-dev/foundation-api-utils 1.6.0 → 1.7.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/@types/lib/hooks/index.d.ts +12 -20
- package/dist/@types/lib/services/content/content.interfaces.d.ts +327 -37
- package/dist/@types/lib/services/content/index.d.ts +4 -6
- package/dist/@types/lib/services/index.d.ts +2 -2
- package/dist/@types/lib/store/index.d.ts +30 -50
- package/dist/@types/lib/utils/dataFormat/index.d.ts +247 -9
- package/dist/index.esm.js +389 -71
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +402 -99
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
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
|
|
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,337 @@ function formatPromos(data) {
|
|
|
191
193
|
};
|
|
192
194
|
});
|
|
193
195
|
}
|
|
194
|
-
function
|
|
196
|
+
function formatWorkout(data) {
|
|
195
197
|
var response = data.map(function (item) {
|
|
196
|
-
var _a
|
|
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
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
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
|
+
video_download: (_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
|
+
video_poster: (_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
|
+
workout_category: (_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
|
+
workout_type: (_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
|
+
return data.map(function (item) {
|
|
362
|
+
var _source = item._source;
|
|
363
|
+
return {
|
|
364
|
+
uuid: _source.uuid && _source.uuid[0],
|
|
365
|
+
title: _source.title && _source.title[0],
|
|
366
|
+
updated: _source.updated && _source.updated[0],
|
|
367
|
+
description: _source.description && _source.description[0],
|
|
368
|
+
image: _source.image && _source.image[0],
|
|
369
|
+
duration: _source.duration && _source.duration[0],
|
|
370
|
+
section: _source.section && _source.section[0],
|
|
371
|
+
video_poster: _source.video_poster && _source.video_poster[0],
|
|
372
|
+
video_url: _source.video_url && _source.video_url[0],
|
|
373
|
+
section_id: _source.section_id && _source.section_id[0],
|
|
374
|
+
};
|
|
375
|
+
});
|
|
376
|
+
}
|
|
377
|
+
function formatSections(data) {
|
|
378
|
+
return data.map(function (item) {
|
|
379
|
+
var _source = item._source;
|
|
380
|
+
return {
|
|
381
|
+
uuid: _source.uuid && _source.uuid[0],
|
|
382
|
+
title: _source.title && _source.title[0],
|
|
383
|
+
description: _source.description && _source.description[0],
|
|
384
|
+
image: _source.image && _source.image[0],
|
|
385
|
+
challenge: _source.challenge && _source.challenge[0],
|
|
386
|
+
display: _source.display && _source.display[0],
|
|
387
|
+
id: _source.id && _source.id[0],
|
|
388
|
+
};
|
|
389
|
+
});
|
|
390
|
+
}
|
|
391
|
+
function formatSchedule(data) {
|
|
392
|
+
return data.map(function (item) {
|
|
393
|
+
var _source = item._source;
|
|
394
|
+
return {
|
|
395
|
+
uuid: _source.uuid && _source.uuid[0],
|
|
396
|
+
created: _source.created && _source.created[0],
|
|
397
|
+
langcode: _source.langcode && _source.langcode[0],
|
|
398
|
+
updated: _source.updated && _source.updated[0],
|
|
399
|
+
days: [
|
|
400
|
+
{
|
|
401
|
+
monday: _source.monday_title &&
|
|
402
|
+
_source.monday_title.length > 0 &&
|
|
403
|
+
_source.monday_title.map(function (title, index) {
|
|
404
|
+
var _a, _b, _c;
|
|
405
|
+
return {
|
|
406
|
+
end: (_a = _source === null || _source === void 0 ? void 0 : _source.monday_end) === null || _a === void 0 ? void 0 : _a[index],
|
|
407
|
+
start: (_b = _source === null || _source === void 0 ? void 0 : _source.monday_start) === null || _b === void 0 ? void 0 : _b[index],
|
|
408
|
+
title: title,
|
|
409
|
+
video: (_c = _source === null || _source === void 0 ? void 0 : _source.monday_video) === null || _c === void 0 ? void 0 : _c[index],
|
|
410
|
+
};
|
|
411
|
+
}),
|
|
412
|
+
},
|
|
413
|
+
{
|
|
414
|
+
tuesday: _source.tuesday_title &&
|
|
415
|
+
_source.tuesday_title.length > 0 &&
|
|
416
|
+
_source.tuesday_title.map(function (title, index) {
|
|
417
|
+
var _a, _b, _c;
|
|
418
|
+
return {
|
|
419
|
+
end: (_a = _source === null || _source === void 0 ? void 0 : _source.tuesday_end) === null || _a === void 0 ? void 0 : _a[index],
|
|
420
|
+
start: (_b = _source === null || _source === void 0 ? void 0 : _source.tuesday_start) === null || _b === void 0 ? void 0 : _b[index],
|
|
421
|
+
title: title,
|
|
422
|
+
video: (_c = _source === null || _source === void 0 ? void 0 : _source.tuesday_video) === null || _c === void 0 ? void 0 : _c[index],
|
|
423
|
+
};
|
|
424
|
+
}),
|
|
425
|
+
},
|
|
426
|
+
{
|
|
427
|
+
wednesday: _source.wednesday_title &&
|
|
428
|
+
_source.wednesday_title.length > 0 &&
|
|
429
|
+
_source.wednesday_title.map(function (title, index) {
|
|
430
|
+
var _a, _b, _c;
|
|
431
|
+
return {
|
|
432
|
+
end: (_a = _source === null || _source === void 0 ? void 0 : _source.wednesday_end) === null || _a === void 0 ? void 0 : _a[index],
|
|
433
|
+
start: (_b = _source === null || _source === void 0 ? void 0 : _source.wednesday_start) === null || _b === void 0 ? void 0 : _b[index],
|
|
434
|
+
title: title,
|
|
435
|
+
video: (_c = _source === null || _source === void 0 ? void 0 : _source.wednesday_video) === null || _c === void 0 ? void 0 : _c[index],
|
|
436
|
+
};
|
|
437
|
+
}),
|
|
438
|
+
},
|
|
439
|
+
{
|
|
440
|
+
thursday: _source.thursday_title &&
|
|
441
|
+
_source.thursday_title.length > 0 &&
|
|
442
|
+
_source.thursday_title.map(function (title, index) {
|
|
443
|
+
var _a, _b, _c;
|
|
444
|
+
return {
|
|
445
|
+
end: (_a = _source === null || _source === void 0 ? void 0 : _source.thursday_end) === null || _a === void 0 ? void 0 : _a[index],
|
|
446
|
+
start: (_b = _source === null || _source === void 0 ? void 0 : _source.thursday_start) === null || _b === void 0 ? void 0 : _b[index],
|
|
447
|
+
title: title,
|
|
448
|
+
video: (_c = _source === null || _source === void 0 ? void 0 : _source.thursday_video) === null || _c === void 0 ? void 0 : _c[index],
|
|
449
|
+
};
|
|
450
|
+
}),
|
|
451
|
+
},
|
|
452
|
+
{
|
|
453
|
+
friday: _source.friday_title &&
|
|
454
|
+
_source.friday_title.length > 0 &&
|
|
455
|
+
_source.friday_title.map(function (title, index) {
|
|
456
|
+
var _a, _b, _c;
|
|
457
|
+
return {
|
|
458
|
+
end: (_a = _source === null || _source === void 0 ? void 0 : _source.friday_end) === null || _a === void 0 ? void 0 : _a[index],
|
|
459
|
+
start: (_b = _source === null || _source === void 0 ? void 0 : _source.friday_start) === null || _b === void 0 ? void 0 : _b[index],
|
|
460
|
+
title: title,
|
|
461
|
+
video: (_c = _source === null || _source === void 0 ? void 0 : _source.friday_video) === null || _c === void 0 ? void 0 : _c[index],
|
|
462
|
+
};
|
|
463
|
+
}),
|
|
464
|
+
},
|
|
465
|
+
{
|
|
466
|
+
saturday: _source.saturday_title &&
|
|
467
|
+
_source.saturday_title.length > 0 &&
|
|
468
|
+
_source.saturday_title.map(function (title, index) {
|
|
469
|
+
var _a, _b, _c;
|
|
470
|
+
return {
|
|
471
|
+
end: (_a = _source === null || _source === void 0 ? void 0 : _source.saturday_end) === null || _a === void 0 ? void 0 : _a[index],
|
|
472
|
+
start: (_b = _source === null || _source === void 0 ? void 0 : _source.saturday_start) === null || _b === void 0 ? void 0 : _b[index],
|
|
473
|
+
title: title,
|
|
474
|
+
video: (_c = _source === null || _source === void 0 ? void 0 : _source.saturday_video) === null || _c === void 0 ? void 0 : _c[index],
|
|
475
|
+
};
|
|
476
|
+
}),
|
|
477
|
+
},
|
|
478
|
+
{
|
|
479
|
+
sunday: _source.sunday_title &&
|
|
480
|
+
_source.sunday_title.length > 0 &&
|
|
481
|
+
_source.sunday_title.map(function (title, index) {
|
|
482
|
+
var _a, _b, _c;
|
|
483
|
+
return {
|
|
484
|
+
end: (_a = _source === null || _source === void 0 ? void 0 : _source.sunday_end) === null || _a === void 0 ? void 0 : _a[index],
|
|
485
|
+
start: (_b = _source === null || _source === void 0 ? void 0 : _source.sunday_start) === null || _b === void 0 ? void 0 : _b[index],
|
|
486
|
+
title: title,
|
|
487
|
+
video: (_c = _source === null || _source === void 0 ? void 0 : _source.sunday_video) === null || _c === void 0 ? void 0 : _c[index],
|
|
488
|
+
};
|
|
489
|
+
}),
|
|
490
|
+
},
|
|
491
|
+
],
|
|
492
|
+
};
|
|
493
|
+
});
|
|
494
|
+
}
|
|
495
|
+
function formatChallenges(data) {
|
|
496
|
+
return data.map(function (item) {
|
|
497
|
+
var _source = item._source;
|
|
498
|
+
return {
|
|
499
|
+
uuid: _source.uuid && _source.uuid[0],
|
|
500
|
+
title: _source.title && _source.title[0],
|
|
501
|
+
body: _source.body && _source.body[0],
|
|
502
|
+
image: _source.image && _source.image[0],
|
|
503
|
+
challengeKey: _source.challenge_key && _source.challenge_key[0],
|
|
504
|
+
created: _source.created && _source.created[0],
|
|
505
|
+
days: _source.days,
|
|
506
|
+
updated: _source.updated && _source.updated[0],
|
|
507
|
+
purchaseButtonLabel: _source.purchase_button_label && _source.purchase_button_label[0],
|
|
508
|
+
price: _source.price && _source.price[0],
|
|
509
|
+
};
|
|
510
|
+
});
|
|
511
|
+
}
|
|
512
|
+
function formatChallengeDays(data) {
|
|
513
|
+
return data.map(function (item) {
|
|
514
|
+
var _source = item._source;
|
|
515
|
+
return {
|
|
516
|
+
uuid: _source.uuid && _source.uuid[0],
|
|
517
|
+
title: _source.title && _source.title[0],
|
|
518
|
+
body: _source.body && _source.body[0],
|
|
519
|
+
image: _source.image && _source.image[0],
|
|
520
|
+
created: _source.created && _source.created[0],
|
|
521
|
+
updated: _source.updated && _source.updated[0],
|
|
522
|
+
video: _source.video && _source.video[0],
|
|
523
|
+
workout: _source.workout && _source.workout[0],
|
|
524
|
+
};
|
|
525
|
+
});
|
|
526
|
+
}
|
|
218
527
|
|
|
219
528
|
// console.log('process.env', process.env);
|
|
220
529
|
// console.log('process.env?.WEB_APP', process.env?.WEB_APP);
|
|
@@ -529,10 +838,10 @@ var authApi = react.createApi({
|
|
|
529
838
|
}); },
|
|
530
839
|
});
|
|
531
840
|
// Export hooks for usage in functional components.
|
|
532
|
-
|
|
841
|
+
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
842
|
|
|
534
|
-
console.log('APP_ES_INSTANCE', APP_ES_INSTANCE);
|
|
535
|
-
console.log('APP_ES_AUTH', APP_ES_AUTH);
|
|
843
|
+
// console.log('APP_ES_INSTANCE', APP_ES_INSTANCE);
|
|
844
|
+
// console.log('APP_ES_AUTH', APP_ES_AUTH);
|
|
536
845
|
var contentApi = react.createApi({
|
|
537
846
|
reducerPath: 'contentApi',
|
|
538
847
|
baseQuery: react.fetchBaseQuery({
|
|
@@ -542,58 +851,62 @@ var contentApi = react.createApi({
|
|
|
542
851
|
return headers;
|
|
543
852
|
},
|
|
544
853
|
}),
|
|
545
|
-
tagTypes: ['Data'
|
|
854
|
+
tagTypes: ['Data'],
|
|
546
855
|
// keepUnusedDataFor: 300,
|
|
547
856
|
endpoints: function (builder) { return ({
|
|
548
857
|
getData: builder.query({
|
|
549
|
-
query: function (
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
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: {},
|
|
858
|
+
query: function (_a) {
|
|
859
|
+
var index = _a.index, _b = _a.options, options = _b === void 0 ? {} : _b;
|
|
860
|
+
return ({
|
|
861
|
+
url: "".concat(index, "/_search"),
|
|
862
|
+
method: 'POST',
|
|
863
|
+
body: {
|
|
864
|
+
from: 0,
|
|
865
|
+
size: options.size || 1000,
|
|
866
|
+
sort: options.sort || [{ created: { order: 'desc' } }],
|
|
867
|
+
query: options.query || {
|
|
868
|
+
match_all: {},
|
|
869
|
+
},
|
|
591
870
|
},
|
|
592
|
-
}
|
|
593
|
-
}
|
|
594
|
-
transformResponse: function (response) { var _a; return
|
|
595
|
-
providesTags: ['
|
|
871
|
+
});
|
|
872
|
+
},
|
|
873
|
+
transformResponse: function (response) { var _a; return (_a = response === null || response === void 0 ? void 0 : response.hits) === null || _a === void 0 ? void 0 : _a.hits; },
|
|
874
|
+
providesTags: ['Data'],
|
|
596
875
|
}),
|
|
876
|
+
// getPromos: builder.query<Promo[], string | undefined>({
|
|
877
|
+
// query: (index) => ({
|
|
878
|
+
// url: `${index}/_search`,
|
|
879
|
+
// method: 'POST',
|
|
880
|
+
// body: {
|
|
881
|
+
// from: 0,
|
|
882
|
+
// size: 100,
|
|
883
|
+
// sort: [{ created: { order: 'desc' } }],
|
|
884
|
+
// query: {
|
|
885
|
+
// match_all: {},
|
|
886
|
+
// },
|
|
887
|
+
// },
|
|
888
|
+
// }),
|
|
889
|
+
// transformResponse: (response: ESPromoResponse) =>
|
|
890
|
+
// formatPromos(response?.hits?.hits),
|
|
891
|
+
// providesTags: ['Promos'],
|
|
892
|
+
// }),
|
|
893
|
+
// getWorkouts: builder.query<Workout[], string | undefined>({
|
|
894
|
+
// query: (index) => ({
|
|
895
|
+
// url: `${index}/_search`,
|
|
896
|
+
// method: 'POST',
|
|
897
|
+
// body: {
|
|
898
|
+
// from: 0,
|
|
899
|
+
// size: 100,
|
|
900
|
+
// sort: [{ created: { order: 'desc' } }],
|
|
901
|
+
// query: {
|
|
902
|
+
// match_all: {},
|
|
903
|
+
// },
|
|
904
|
+
// },
|
|
905
|
+
// }),
|
|
906
|
+
// transformResponse: (response: ESWorkoutResponse) =>
|
|
907
|
+
// formatESWorkoutItems(response?.hits?.hits),
|
|
908
|
+
// providesTags: ['Workouts'],
|
|
909
|
+
// }),
|
|
597
910
|
getWorkoutById: builder.query({
|
|
598
911
|
query: function (_a) {
|
|
599
912
|
var index = _a.index, id = _a.id;
|
|
@@ -612,7 +925,12 @@ var contentApi = react.createApi({
|
|
|
612
925
|
}),
|
|
613
926
|
}); },
|
|
614
927
|
});
|
|
615
|
-
|
|
928
|
+
contentApi.useGetDataQuery; contentApi.useLazyGetDataQuery;
|
|
929
|
+
// useGetPromosQuery,
|
|
930
|
+
// useLazyGetPromosQuery,
|
|
931
|
+
// useGetWorkoutsQuery,
|
|
932
|
+
// useLazyGetWorkoutsQuery,
|
|
933
|
+
contentApi.useGetWorkoutByIdQuery; contentApi.useLazyGetWorkoutByIdQuery;
|
|
616
934
|
|
|
617
935
|
var useLoggedIn = function () {
|
|
618
936
|
var isLoggedIn = reactRedux.useSelector(isAuthenticated);
|
|
@@ -728,41 +1046,26 @@ var webStore = isWeb && makeWebStore();
|
|
|
728
1046
|
|
|
729
1047
|
exports.authApi = authApi;
|
|
730
1048
|
exports.contentApi = contentApi;
|
|
731
|
-
exports.
|
|
1049
|
+
exports.formatChallengeDays = formatChallengeDays;
|
|
1050
|
+
exports.formatChallenges = formatChallenges;
|
|
1051
|
+
exports.formatFaqs = formatFaqs;
|
|
1052
|
+
exports.formatGuests = formatGuests;
|
|
1053
|
+
exports.formatLongform = formatLongform;
|
|
1054
|
+
exports.formatPages = formatPages;
|
|
1055
|
+
exports.formatPress = formatPress;
|
|
732
1056
|
exports.formatPromos = formatPromos;
|
|
1057
|
+
exports.formatSchedule = formatSchedule;
|
|
1058
|
+
exports.formatSections = formatSections;
|
|
1059
|
+
exports.formatSeries = formatSeries;
|
|
1060
|
+
exports.formatSettings = formatSettings;
|
|
1061
|
+
exports.formatShortform = formatShortform;
|
|
733
1062
|
exports.formatUserPayload = formatUserPayload;
|
|
1063
|
+
exports.formatVideos = formatVideos;
|
|
1064
|
+
exports.formatWorkout = formatWorkout;
|
|
734
1065
|
exports.nativeStore = nativeStore;
|
|
735
1066
|
exports.useAppDispatch = useAppDispatch;
|
|
736
1067
|
exports.useAppSelector = useAppSelector;
|
|
737
1068
|
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
1069
|
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
1070
|
exports.webStore = webStore;
|
|
768
1071
|
//# sourceMappingURL=index.js.map
|