@sunsteel/contracts 0.62.0 → 0.64.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
@@ -363,6 +363,40 @@ var ROUTINE_TRAINING_BLOCK_SOURCE_KINDS = [
363
363
  "CURRENT_ROUTINE",
364
364
  "SAVED_VERSION"
365
365
  ];
366
+ function trainingBlockCovers(block, date) {
367
+ return block.startDate <= date && date <= block.endDate;
368
+ }
369
+ function resolveActiveTrainingBlock(blocks, date) {
370
+ return blocks?.find((block) => trainingBlockCovers(block, date)) ?? null;
371
+ }
372
+ function resolveRoutinePlan(routine, date) {
373
+ const block = resolveActiveTrainingBlock(routine.trainingBlocks, date);
374
+ if (block) {
375
+ return {
376
+ block: {
377
+ id: block.id,
378
+ seriesId: block.seriesId,
379
+ revision: block.revision,
380
+ name: block.name,
381
+ startDate: block.startDate,
382
+ endDate: block.endDate
383
+ },
384
+ scheduleMode: block.scheduleMode,
385
+ restDays: block.restDays,
386
+ rotationWeekdays: block.rotationWeekdays,
387
+ nextRotationDayId: block.nextRotationDayId,
388
+ days: block.days
389
+ };
390
+ }
391
+ return {
392
+ block: null,
393
+ scheduleMode: routine.scheduleMode,
394
+ restDays: routine.restDays,
395
+ rotationWeekdays: routine.rotationWeekdays ?? [],
396
+ nextRotationDayId: routine.nextRotationDayId ?? null,
397
+ days: routine.days
398
+ };
399
+ }
366
400
 
367
401
  // src/routine-sharing.ts
368
402
  var ROUTINE_VISIBILITY_VALUES = [
@@ -429,6 +463,8 @@ var SCHEDULE_SKIP_PAST_DAYS = 6;
429
463
  var SCHEDULE_OVERRIDES_MAX_RANGE_DAYS = 62;
430
464
 
431
465
  // src/workout.ts
466
+ var SESSION_NOTE_MAX_LENGTH = 2e3;
467
+ var SESSION_EXERCISE_NOTE_MAX_LENGTH = 500;
432
468
  var SESSION_SHARE_FIELDS = [
433
469
  "duration",
434
470
  "volume",
@@ -679,6 +715,8 @@ export {
679
715
  SESSION_CORRECTIONS_MAX,
680
716
  SESSION_CORRECTION_LIMITS,
681
717
  SESSION_CORRECTION_WINDOW_HOURS,
718
+ SESSION_EXERCISE_NOTE_MAX_LENGTH,
719
+ SESSION_NOTE_MAX_LENGTH,
682
720
  SESSION_SHARE_DEFAULT_FIELDS,
683
721
  SESSION_SHARE_FIELDS,
684
722
  SESSION_SHARE_MAX_ACTIVE_LINKS,
@@ -704,7 +742,10 @@ export {
704
742
  accountExportFileName,
705
743
  isWithinQuietHours,
706
744
  matchesDeletionConfirmation,
745
+ resolveActiveTrainingBlock,
746
+ resolveRoutinePlan,
707
747
  routineDayLabel,
708
748
  sessionCorrectionWindow,
709
- setLogValuesDiffer
749
+ setLogValuesDiffer,
750
+ trainingBlockCovers
710
751
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sunsteel/contracts",
3
- "version": "0.62.0",
3
+ "version": "0.64.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/ezee969/sunsteel-contracts.git"