@runnerpro/backend 1.22.5 → 1.22.7

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.
@@ -1 +1 @@
1
- {"version":3,"file":"getPlanificacionPrueba7diasEmpezarCorrer.d.ts","sourceRoot":"","sources":["../../../../../../src/workout/planificacionPrueba7dias/empezarCorrer/getPlanificacionPrueba7diasEmpezarCorrer.ts"],"names":[],"mappings":"AAIA,QAAA,MAAM,wCAAwC;;;;;;;;;;;;;GAK7C,CAAC;AAEF,QAAA,MAAM,4CAA4C,kBAgCjD,CAAC;AAEF,OAAO,EAAE,wCAAwC,EAAE,4CAA4C,EAAE,CAAC"}
1
+ {"version":3,"file":"getPlanificacionPrueba7diasEmpezarCorrer.d.ts","sourceRoot":"","sources":["../../../../../../src/workout/planificacionPrueba7dias/empezarCorrer/getPlanificacionPrueba7diasEmpezarCorrer.ts"],"names":[],"mappings":"AAIA,QAAA,MAAM,wCAAwC;;;;;;;;;;;;;GAK7C,CAAC;AAEF,QAAA,MAAM,4CAA4C,kBAuCjD,CAAC;AAEF,OAAO,EAAE,wCAAwC,EAAE,4CAA4C,EAAE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/workout/planificacionPrueba7dias/index.ts"],"names":[],"mappings":"AAaA;;;;;;;;;;;;;;;;;;GAkBG;AACH,QAAA,MAAM,2BAA2B,qBAAgB,GAAG,UA+EnD,CAAC;AAmIF,OAAO,EAAE,2BAA2B,EAAE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/workout/planificacionPrueba7dias/index.ts"],"names":[],"mappings":"AAaA;;;;;;;;;;;;;;;;;;GAkBG;AACH,QAAA,MAAM,2BAA2B,qBAAgB,GAAG,UA+EnD,CAAC;AA2IF,OAAO,EAAE,2BAA2B,EAAE,CAAC"}
@@ -25,11 +25,19 @@ const changeGoalDistanceByNivelActualEmpezarCorrer = (c) => {
25
25
  // nivel suave). Sin esos datos (cohorte app): el frágil y el principiante absoluto arrancan
26
26
  // en el nivel suave (type '1'); el resto en el intermedio (type '2').
27
27
  const NIVEL_POR_AGUANTE = { lt5: 1, '5-20': 2, '20-45': 2, gt45: 3 };
28
+ // Sin aguante, la FRECUENCIA actual (F1) es la mejor señal: quien ya corre 3-4 días
29
+ // aguanta de sobra el nivel intermedio, y con 5+ el avanzado. Sin esto, un "Comenzar a
30
+ // correr" que ya corre 3-4 días caía en el nivel 1 (bloques de 1 minuto) — un plan
31
+ // insultantemente fácil que tampoco convierte (caso real: ferblanco).
32
+ const NIVEL_POR_DIAS_CORRE = { '3-4': 2, '5+': 3 };
28
33
  const TECHO_POR_LESION = { duele: 1, leve: 2, prudencia: 2, recuperado: 3 };
29
34
  let nivel;
30
35
  if (NIVEL_POR_AGUANTE[c.aguanteCorriendo] !== undefined) {
31
36
  nivel = NIVEL_POR_AGUANTE[c.aguanteCorriendo];
32
37
  }
38
+ else if (NIVEL_POR_DIAS_CORRE[c.diasCorreActual] !== undefined) {
39
+ nivel = NIVEL_POR_DIAS_CORRE[c.diasCorreActual];
40
+ }
33
41
  else if (c.objetivoPrincipal === 'Correr después de una lesión' ||
34
42
  c.objetivoPrincipal === 'Comenzar a correr' ||
35
43
  Number(c.goalDistance) === -2) {
@@ -111,8 +111,15 @@ const getPlanificacionPrueba7dias = (c, options = {}) => {
111
111
  return planificacion;
112
112
  };
113
113
  exports.getPlanificacionPrueba7dias = getPlanificacionPrueba7dias;
114
+ // Quien declara que NO aguanta corriendo de forma continua (aguante F3: "Menos de 5
115
+ // minutos" o "Entre 5 y 20 minutos") NO puede hacer rodajes continuos, sea cual sea su
116
+ // objetivo. Se le manda a la progresión caminar-correr (CaCos), que además se gradúa por
117
+ // ese mismo aguante (lt5→suave, 5-20→intermedio). Su objetivo/distancia se conserva para
118
+ // las semanas siguientes; solo la primera semana arranca caminando-corriendo.
119
+ // 20-45 y gt45 quedan fuera: quien aguanta 20+ min seguidos ya puede rodar continuo.
120
+ const necesitaCaminarCorrer = (c) => ['lt5', '5-20'].includes(c.aguanteCorriendo);
114
121
  const changeGoalDistanceByNivelActual = (c) => {
115
- if (['Comenzar a correr', 'Correr después de una lesión'].includes(c.objetivoPrincipal) || [-2].includes(Number(c.goalDistance)))
122
+ if (necesitaCaminarCorrer(c) || ['Comenzar a correr', 'Correr después de una lesión'].includes(c.objetivoPrincipal) || [-2].includes(Number(c.goalDistance)))
116
123
  (0, getPlanificacionPrueba7diasEmpezarCorrer_1.changeGoalDistanceByNivelActualEmpezarCorrer)(c);
117
124
  else if (Number(c.goalDistance) > 1 && Number(c.goalDistance) < 8000)
118
125
  (0, getPlanificacionPrueba7dias5k_1.changeGoalDistanceByNivelActual5k)(c);
@@ -127,7 +134,7 @@ const changeGoalDistanceByNivelActual = (c) => {
127
134
  (0, getPlanificacionPrueba7dias42k_1.changeGoalDistanceByNivelActual42k)(c);
128
135
  };
129
136
  const getWorkoutsByGoalDistance = (c) => {
130
- if (['Comenzar a correr', 'Correr después de una lesión'].includes(c.objetivoPrincipal) || Number(c.goalDistance) === -2)
137
+ if (necesitaCaminarCorrer(c) || ['Comenzar a correr', 'Correr después de una lesión'].includes(c.objetivoPrincipal) || Number(c.goalDistance) === -2)
131
138
  return (0, getPlanificacionPrueba7diasEmpezarCorrer_1.getPlanificacionPrueba7diasEmpezarCorrer)(c);
132
139
  if (Number(c.goalDistance) === 5000)
133
140
  return (0, getPlanificacionPrueba7dias5k_1.getPlanificacionPrueba7dias5k)(c);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@runnerpro/backend",
3
- "version": "1.22.5",
3
+ "version": "1.22.7",
4
4
  "description": "A collection of common backend functions",
5
5
  "exports": {
6
6
  ".": "./lib/cjs/index.js"