@techstuff-dev/foundation-api-utils 1.8.0 → 1.9.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.
@@ -234,38 +234,45 @@ interface ESSchedule {
234
234
  _id: string;
235
235
  _score: null;
236
236
  _source: {
237
- uuid?: string[];
238
- created?: string[];
239
- langcode?: string[];
240
- updated?: string[];
241
- monday_title?: string[];
242
- monday_start?: string[];
243
- monday_end?: string[];
244
- monday_video?: string[];
245
- tuesday_title?: string[];
246
- tuesday_start?: string[];
247
- tuesday_end?: string[];
248
- tuesday_video?: string[];
249
- wednesday_title?: string[];
250
- wednesday_start?: string[];
251
- wednesday_end?: string[];
252
- wednesday_video?: string[];
253
- thursday_title?: string[];
254
- thursday_start?: string[];
255
- thursday_end?: string[];
256
- thursday_video?: string[];
257
- friday_title?: string[];
258
- friday_start?: string[];
259
- friday_end?: string[];
260
- friday_video?: string[];
261
- saturday_title?: string[];
262
- saturday_start?: string[];
263
- saturday_end?: string[];
264
- saturday_video?: string[];
265
- sunday_title?: string[];
266
- sunday_start?: string[];
267
- sunday_end?: string[];
268
- sunday_video?: string[];
237
+ uuid: string[];
238
+ created: string[];
239
+ langcode: string[];
240
+ updated: string[];
241
+ monday_title: string[];
242
+ monday_start: string[];
243
+ monday_end: string[];
244
+ monday_video: string[];
245
+ monday_live: string[];
246
+ tuesday_title: string[];
247
+ tuesday_start: string[];
248
+ tuesday_end: string[];
249
+ tuesday_video: string[];
250
+ tuesday_live: string[];
251
+ wednesday_title: string[];
252
+ wednesday_start: string[];
253
+ wednesday_end: string[];
254
+ wednesday_video: string[];
255
+ wednesday_live: string[];
256
+ thursday_title: string[];
257
+ thursday_start: string[];
258
+ thursday_end: string[];
259
+ thursday_video: string[];
260
+ thursday_live: string[];
261
+ friday_title: string[];
262
+ friday_start: string[];
263
+ friday_end: string[];
264
+ friday_video: string[];
265
+ friday_live: string[];
266
+ saturday_title: string[];
267
+ saturday_start: string[];
268
+ saturday_end: string[];
269
+ saturday_video: string[];
270
+ saturday_live: string[];
271
+ sunday_title: string[];
272
+ sunday_start: string[];
273
+ sunday_end: string[];
274
+ sunday_video: string[];
275
+ sunday_live: string[];
269
276
  };
270
277
  sort: number[];
271
278
  }
@@ -432,3 +439,60 @@ interface Series {
432
439
  nid: string;
433
440
  season: string;
434
441
  }
442
+ interface Schedule {
443
+ uuid: string;
444
+ created: string;
445
+ langcode: string;
446
+ updated: string;
447
+ days: {
448
+ monday?: {
449
+ title: string;
450
+ start: string;
451
+ end: string;
452
+ video: string;
453
+ live: string;
454
+ }[];
455
+ tuesday?: {
456
+ title: string;
457
+ start: string;
458
+ end: string;
459
+ video: string;
460
+ live: string;
461
+ }[];
462
+ wednesday?: {
463
+ title: string;
464
+ start: string;
465
+ end: string;
466
+ video: string;
467
+ live: string;
468
+ }[];
469
+ thursday?: {
470
+ title: string;
471
+ start: string;
472
+ end: string;
473
+ video: string;
474
+ live: string;
475
+ }[];
476
+ friday?: {
477
+ title: string;
478
+ start: string;
479
+ end: string;
480
+ video: string;
481
+ live: string;
482
+ }[];
483
+ saturday?: {
484
+ title: string;
485
+ start: string;
486
+ end: string;
487
+ video: string;
488
+ live: string;
489
+ }[];
490
+ sunday?: {
491
+ title: string;
492
+ start: string;
493
+ end: string;
494
+ video: string;
495
+ live: string;
496
+ }[];
497
+ }[];
498
+ }
@@ -119,104 +119,7 @@ export declare function formatSections(data: ESSection[]): {
119
119
  display: string | undefined;
120
120
  id: string | undefined;
121
121
  }[];
122
- export declare function formatSchedule(data: ESSchedule[]): {
123
- uuid: string | undefined;
124
- created: string | undefined;
125
- langcode: string | undefined;
126
- updated: string | undefined;
127
- days: ({
128
- monday: false | {
129
- end: string | undefined;
130
- start: string | undefined;
131
- title: string;
132
- video: string | undefined;
133
- }[] | undefined;
134
- tuesday?: undefined;
135
- wednesday?: undefined;
136
- thursday?: undefined;
137
- friday?: undefined;
138
- saturday?: undefined;
139
- sunday?: undefined;
140
- } | {
141
- tuesday: false | {
142
- end: string | undefined;
143
- start: string | undefined;
144
- title: string;
145
- video: string | undefined;
146
- }[] | undefined;
147
- monday?: undefined;
148
- wednesday?: undefined;
149
- thursday?: undefined;
150
- friday?: undefined;
151
- saturday?: undefined;
152
- sunday?: undefined;
153
- } | {
154
- wednesday: false | {
155
- end: string | undefined;
156
- start: string | undefined;
157
- title: string;
158
- video: string | undefined;
159
- }[] | undefined;
160
- monday?: undefined;
161
- tuesday?: undefined;
162
- thursday?: undefined;
163
- friday?: undefined;
164
- saturday?: undefined;
165
- sunday?: undefined;
166
- } | {
167
- thursday: false | {
168
- end: string | undefined;
169
- start: string | undefined;
170
- title: string;
171
- video: string | undefined;
172
- }[] | undefined;
173
- monday?: undefined;
174
- tuesday?: undefined;
175
- wednesday?: undefined;
176
- friday?: undefined;
177
- saturday?: undefined;
178
- sunday?: undefined;
179
- } | {
180
- friday: false | {
181
- end: string | undefined;
182
- start: string | undefined;
183
- title: string;
184
- video: string | undefined;
185
- }[] | undefined;
186
- monday?: undefined;
187
- tuesday?: undefined;
188
- wednesday?: undefined;
189
- thursday?: undefined;
190
- saturday?: undefined;
191
- sunday?: undefined;
192
- } | {
193
- saturday: false | {
194
- end: string | undefined;
195
- start: string | undefined;
196
- title: string;
197
- video: string | undefined;
198
- }[] | undefined;
199
- monday?: undefined;
200
- tuesday?: undefined;
201
- wednesday?: undefined;
202
- thursday?: undefined;
203
- friday?: undefined;
204
- sunday?: undefined;
205
- } | {
206
- sunday: false | {
207
- end: string | undefined;
208
- start: string | undefined;
209
- title: string;
210
- video: string | undefined;
211
- }[] | undefined;
212
- monday?: undefined;
213
- tuesday?: undefined;
214
- wednesday?: undefined;
215
- thursday?: undefined;
216
- friday?: undefined;
217
- saturday?: undefined;
218
- })[];
219
- }[];
122
+ export declare function formatSchedule(data: ESSchedule[]): Schedule[];
220
123
  export declare function formatChallenges(data: ESChallenge[]): {
221
124
  uuid: string | undefined;
222
125
  title: string | undefined;
package/dist/index.esm.js CHANGED
@@ -391,103 +391,96 @@ function formatSections(data) {
391
391
  }
392
392
  function formatSchedule(data) {
393
393
  return data.map(function (item) {
394
- var _source = item._source;
394
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
395
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],
396
+ 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],
397
+ 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],
398
+ langcode: (_f = (_e = item === null || item === void 0 ? void 0 : item._source) === null || _e === void 0 ? void 0 : _e.langcode) === null || _f === void 0 ? void 0 : _f[0],
399
+ 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],
400
400
  days: [
401
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
- }),
402
+ monday: (_k = (_j = item === null || item === void 0 ? void 0 : item._source) === null || _j === void 0 ? void 0 : _j.monday_title) === null || _k === void 0 ? void 0 : _k.map(function (title, index) {
403
+ var _a, _b, _c, _d, _e, _f, _g, _h;
404
+ return {
405
+ end: (_b = (_a = item === null || item === void 0 ? void 0 : item._source) === null || _a === void 0 ? void 0 : _a.monday_end) === null || _b === void 0 ? void 0 : _b[index],
406
+ start: (_d = (_c = item === null || item === void 0 ? void 0 : item._source) === null || _c === void 0 ? void 0 : _c.monday_start) === null || _d === void 0 ? void 0 : _d[index],
407
+ title: title,
408
+ video: (_f = (_e = item === null || item === void 0 ? void 0 : item._source) === null || _e === void 0 ? void 0 : _e.monday_video) === null || _f === void 0 ? void 0 : _f[index],
409
+ live: (_h = (_g = item === null || item === void 0 ? void 0 : item._source) === null || _g === void 0 ? void 0 : _g.monday_live) === null || _h === void 0 ? void 0 : _h[index],
410
+ };
411
+ }),
413
412
  },
414
413
  {
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
- }),
414
+ tuesday: (_m = (_l = item === null || item === void 0 ? void 0 : item._source) === null || _l === void 0 ? void 0 : _l.tuesday_title) === null || _m === void 0 ? void 0 : _m.map(function (title, index) {
415
+ var _a, _b, _c, _d, _e, _f, _g, _h;
416
+ return {
417
+ end: (_b = (_a = item === null || item === void 0 ? void 0 : item._source) === null || _a === void 0 ? void 0 : _a.tuesday_end) === null || _b === void 0 ? void 0 : _b[index],
418
+ start: (_d = (_c = item === null || item === void 0 ? void 0 : item._source) === null || _c === void 0 ? void 0 : _c.tuesday_start) === null || _d === void 0 ? void 0 : _d[index],
419
+ title: title,
420
+ video: (_f = (_e = item === null || item === void 0 ? void 0 : item._source) === null || _e === void 0 ? void 0 : _e.tuesday_video) === null || _f === void 0 ? void 0 : _f[index],
421
+ live: (_h = (_g = item === null || item === void 0 ? void 0 : item._source) === null || _g === void 0 ? void 0 : _g.tuesday_live) === null || _h === void 0 ? void 0 : _h[index],
422
+ };
423
+ }),
426
424
  },
427
425
  {
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
- }),
426
+ wednesday: (_p = (_o = item === null || item === void 0 ? void 0 : item._source) === null || _o === void 0 ? void 0 : _o.wednesday_title) === null || _p === void 0 ? void 0 : _p.map(function (title, index) {
427
+ var _a, _b, _c, _d, _e, _f, _g, _h;
428
+ return {
429
+ end: (_b = (_a = item === null || item === void 0 ? void 0 : item._source) === null || _a === void 0 ? void 0 : _a.wednesday_end) === null || _b === void 0 ? void 0 : _b[index],
430
+ start: (_d = (_c = item === null || item === void 0 ? void 0 : item._source) === null || _c === void 0 ? void 0 : _c.wednesday_start) === null || _d === void 0 ? void 0 : _d[index],
431
+ title: title,
432
+ video: (_f = (_e = item === null || item === void 0 ? void 0 : item._source) === null || _e === void 0 ? void 0 : _e.wednesday_video) === null || _f === void 0 ? void 0 : _f[index],
433
+ live: (_h = (_g = item === null || item === void 0 ? void 0 : item._source) === null || _g === void 0 ? void 0 : _g.wednesday_live) === null || _h === void 0 ? void 0 : _h[index],
434
+ };
435
+ }),
439
436
  },
440
437
  {
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
- }),
438
+ thursday: (_r = (_q = item === null || item === void 0 ? void 0 : item._source) === null || _q === void 0 ? void 0 : _q.thursday_title) === null || _r === void 0 ? void 0 : _r.map(function (title, index) {
439
+ var _a, _b, _c, _d, _e, _f, _g, _h;
440
+ return {
441
+ end: (_b = (_a = item === null || item === void 0 ? void 0 : item._source) === null || _a === void 0 ? void 0 : _a.thursday_end) === null || _b === void 0 ? void 0 : _b[index],
442
+ start: (_d = (_c = item === null || item === void 0 ? void 0 : item._source) === null || _c === void 0 ? void 0 : _c.thursday_start) === null || _d === void 0 ? void 0 : _d[index],
443
+ title: title,
444
+ video: (_f = (_e = item === null || item === void 0 ? void 0 : item._source) === null || _e === void 0 ? void 0 : _e.thursday_video) === null || _f === void 0 ? void 0 : _f[index],
445
+ live: (_h = (_g = item === null || item === void 0 ? void 0 : item._source) === null || _g === void 0 ? void 0 : _g.thursday_live) === null || _h === void 0 ? void 0 : _h[index],
446
+ };
447
+ }),
452
448
  },
453
449
  {
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
- }),
450
+ friday: (_t = (_s = item === null || item === void 0 ? void 0 : item._source) === null || _s === void 0 ? void 0 : _s.friday_title) === null || _t === void 0 ? void 0 : _t.map(function (title, index) {
451
+ var _a, _b, _c, _d, _e, _f, _g, _h;
452
+ return {
453
+ end: (_b = (_a = item === null || item === void 0 ? void 0 : item._source) === null || _a === void 0 ? void 0 : _a.friday_end) === null || _b === void 0 ? void 0 : _b[index],
454
+ start: (_d = (_c = item === null || item === void 0 ? void 0 : item._source) === null || _c === void 0 ? void 0 : _c.friday_start) === null || _d === void 0 ? void 0 : _d[index],
455
+ title: title,
456
+ video: (_f = (_e = item === null || item === void 0 ? void 0 : item._source) === null || _e === void 0 ? void 0 : _e.friday_video) === null || _f === void 0 ? void 0 : _f[index],
457
+ live: (_h = (_g = item === null || item === void 0 ? void 0 : item._source) === null || _g === void 0 ? void 0 : _g.friday_live) === null || _h === void 0 ? void 0 : _h[index],
458
+ };
459
+ }),
465
460
  },
466
461
  {
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
- }),
462
+ saturday: (_v = (_u = item === null || item === void 0 ? void 0 : item._source) === null || _u === void 0 ? void 0 : _u.saturday_title) === null || _v === void 0 ? void 0 : _v.map(function (title, index) {
463
+ var _a, _b, _c, _d, _e, _f, _g, _h;
464
+ return {
465
+ end: (_b = (_a = item === null || item === void 0 ? void 0 : item._source) === null || _a === void 0 ? void 0 : _a.saturday_end) === null || _b === void 0 ? void 0 : _b[index],
466
+ start: (_d = (_c = item === null || item === void 0 ? void 0 : item._source) === null || _c === void 0 ? void 0 : _c.saturday_start) === null || _d === void 0 ? void 0 : _d[index],
467
+ title: title,
468
+ video: (_f = (_e = item === null || item === void 0 ? void 0 : item._source) === null || _e === void 0 ? void 0 : _e.saturday_video) === null || _f === void 0 ? void 0 : _f[index],
469
+ live: (_h = (_g = item === null || item === void 0 ? void 0 : item._source) === null || _g === void 0 ? void 0 : _g.saturday_live) === null || _h === void 0 ? void 0 : _h[index],
470
+ };
471
+ }),
478
472
  },
479
473
  {
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
- }),
474
+ sunday: (_x = (_w = item === null || item === void 0 ? void 0 : item._source) === null || _w === void 0 ? void 0 : _w.sunday_title) === null || _x === void 0 ? void 0 : _x.map(function (title, index) {
475
+ var _a, _b, _c, _d, _e, _f, _g, _h;
476
+ return {
477
+ end: (_b = (_a = item === null || item === void 0 ? void 0 : item._source) === null || _a === void 0 ? void 0 : _a.sunday_end) === null || _b === void 0 ? void 0 : _b[index],
478
+ start: (_d = (_c = item === null || item === void 0 ? void 0 : item._source) === null || _c === void 0 ? void 0 : _c.sunday_start) === null || _d === void 0 ? void 0 : _d[index],
479
+ title: title,
480
+ video: (_f = (_e = item === null || item === void 0 ? void 0 : item._source) === null || _e === void 0 ? void 0 : _e.sunday_video) === null || _f === void 0 ? void 0 : _f[index],
481
+ live: (_h = (_g = item === null || item === void 0 ? void 0 : item._source) === null || _g === void 0 ? void 0 : _g.sunday_live) === null || _h === void 0 ? void 0 : _h[index],
482
+ };
483
+ }),
491
484
  },
492
485
  ],
493
486
  };