@runnerpro/backend 1.21.12 → 1.21.14
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/lib/cjs/achievements/catalog.js +204 -0
- package/lib/cjs/achievements/index.js +805 -0
- package/lib/cjs/achievements/streak.js +126 -0
- package/lib/cjs/chat/api/conversation.js +21 -29
- package/lib/cjs/chat/exposed/conversation.js +0 -7
- package/lib/cjs/chat/index.js +0 -7
- package/lib/cjs/index.js +34 -5
- package/lib/cjs/locale/en.js +0 -4
- package/lib/cjs/locale/es.js +0 -4
- package/lib/cjs/locale/fr.js +0 -4
- package/lib/cjs/locale/it.js +0 -4
- package/lib/cjs/prompt/azureModel.js +7 -35
- package/lib/cjs/prompt/constants.js +12 -67
- package/lib/cjs/prompt/googleModel.js +6 -11
- package/lib/cjs/prompt/index.js +1 -4
- package/lib/cjs/prompt/modelPricing.js +1 -22
- package/lib/cjs/sendNotification/index.js +4 -88
- package/lib/cjs/types/achievements/catalog.d.ts +104 -0
- package/lib/cjs/types/achievements/catalog.d.ts.map +1 -0
- package/lib/cjs/types/achievements/index.d.ts +41 -0
- package/lib/cjs/types/achievements/index.d.ts.map +1 -0
- package/lib/cjs/types/achievements/streak.d.ts +20 -0
- package/lib/cjs/types/achievements/streak.d.ts.map +1 -0
- package/lib/cjs/types/chat/api/conversation.d.ts.map +1 -1
- package/lib/cjs/types/chat/exposed/conversation.d.ts.map +1 -1
- package/lib/cjs/types/chat/index.d.ts.map +1 -1
- package/lib/cjs/types/index.d.ts +4 -2
- package/lib/cjs/types/index.d.ts.map +1 -1
- package/lib/cjs/types/locale/en.d.ts +0 -4
- package/lib/cjs/types/locale/en.d.ts.map +1 -1
- package/lib/cjs/types/locale/es.d.ts +0 -4
- package/lib/cjs/types/locale/es.d.ts.map +1 -1
- package/lib/cjs/types/locale/fr.d.ts +0 -4
- package/lib/cjs/types/locale/fr.d.ts.map +1 -1
- package/lib/cjs/types/locale/it.d.ts +0 -4
- package/lib/cjs/types/locale/it.d.ts.map +1 -1
- package/lib/cjs/types/prompt/azureModel.d.ts.map +1 -1
- package/lib/cjs/types/prompt/constants.d.ts +7 -28
- package/lib/cjs/types/prompt/constants.d.ts.map +1 -1
- package/lib/cjs/types/prompt/googleModel.d.ts.map +1 -1
- package/lib/cjs/types/prompt/index.d.ts +2 -2
- package/lib/cjs/types/prompt/index.d.ts.map +1 -1
- package/lib/cjs/types/prompt/modelPricing.d.ts.map +1 -1
- package/lib/cjs/types/sendNotification/index.d.ts +1 -20
- package/lib/cjs/types/sendNotification/index.d.ts.map +1 -1
- package/lib/cjs/types/workout/planificacionPrueba7dias/index.d.ts.map +1 -1
- package/lib/cjs/types/workout/saveWorkoutAplication.d.ts.map +1 -1
- package/lib/cjs/workout/planificacionPrueba7dias/index.js +7 -3
- package/lib/cjs/workout/saveWorkoutAplication.js +10 -0
- package/package.json +1 -1
|
@@ -9,6 +9,7 @@ const getPlanificacionPrueba7dias5k_1 = require("./5k/getPlanificacionPrueba7dia
|
|
|
9
9
|
const getPlanificacionPrueba7dias10k_1 = require("./10k/getPlanificacionPrueba7dias10k");
|
|
10
10
|
const getPlanificacionPrueba7dias21k_1 = require("./21k/getPlanificacionPrueba7dias21k");
|
|
11
11
|
const getPlanificacionPrueba7dias42k_1 = require("./42k/getPlanificacionPrueba7dias42k");
|
|
12
|
+
const sendMail_1 = require("../../sendMail");
|
|
12
13
|
const moment_1 = __importDefault(require("moment"));
|
|
13
14
|
const common_1 = require("@runnerpro/common");
|
|
14
15
|
/**
|
|
@@ -39,10 +40,13 @@ const getPlanificacionPrueba7dias = (c, options = {}) => {
|
|
|
39
40
|
// @ts-ignore
|
|
40
41
|
workoutsBase = getWorkoutsByGoalDistance(c);
|
|
41
42
|
if (!workoutsBase || workoutsBase.length === 0) {
|
|
42
|
-
// Sin entrenamientos base para este perfil → planificación vacía. Ya no se avisa por
|
|
43
|
-
// email: el cliente queda sin workouts planificados y lo enciende la farola
|
|
44
|
-
// "plan no entregado" de Trials en el panel de agentes (>1 día de alta sin plan).
|
|
45
43
|
workoutsBase = [];
|
|
44
|
+
(0, sendMail_1.sendMail)({
|
|
45
|
+
to: ['david.jimenez@runnerpro.app'],
|
|
46
|
+
subject: 'Planificación de prueba 7 días - No hay entrenamientos',
|
|
47
|
+
body: JSON.stringify(c),
|
|
48
|
+
title: '',
|
|
49
|
+
});
|
|
46
50
|
}
|
|
47
51
|
if ((Number(c.nivelEntrenamientoFuerza) === 1 || Number(c.incluirEntrenamientoFuerza) === 1) && nDiasDisponibles >= 4) {
|
|
48
52
|
// @ts-ignore
|
|
@@ -23,6 +23,7 @@ const getDefaultWorkoutImage_1 = require("../image/getDefaultWorkoutImage");
|
|
|
23
23
|
const moment_1 = __importDefault(require("moment"));
|
|
24
24
|
const estructuraWorkout_1 = require("./estructuraWorkout");
|
|
25
25
|
const paceZone_1 = require("./paceZone");
|
|
26
|
+
const achievements_1 = require("../achievements");
|
|
26
27
|
// =============================================================================
|
|
27
28
|
// Prioridad de fuentes (Fase 1 plan dedup cross-proveedor)
|
|
28
29
|
// Mayor = más fiable. No se mete en @runnerpro/common para no propagar una
|
|
@@ -352,6 +353,15 @@ const postHooks = (idWorkout, opts) => __awaiter(void 0, void 0, void 0, functio
|
|
|
352
353
|
}
|
|
353
354
|
saveShareWorkoutImage(idWorkout, opts.type);
|
|
354
355
|
yield (0, estructuraWorkout_1.saveDoneStructuraWorkout)(idWorkout);
|
|
356
|
+
// Logros: evaluar al completar el entreno (este es el embudo de los entrenos
|
|
357
|
+
// sincronizados). Se pasa el idWorkout para calcular el PR solo de ESTE entreno
|
|
358
|
+
// (incremental). Aislado: un fallo de logros NUNCA debe romper la ingesta.
|
|
359
|
+
try {
|
|
360
|
+
yield (0, achievements_1.evaluateAchievements)(opts.idCliente, 'workout', { workoutId: idWorkout });
|
|
361
|
+
}
|
|
362
|
+
catch (_) {
|
|
363
|
+
// ignore — los logros no son críticos para el guardado del workout.
|
|
364
|
+
}
|
|
355
365
|
});
|
|
356
366
|
// getPolyline ampliado: acepta string ya-encoded (Apple `polylineEncoded`) o el
|
|
357
367
|
// objeto `activity` con map.polyline/summary_polyline (Strava/Garmin).
|