@runnerpro/backend 1.17.0 → 1.17.2

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.
Files changed (43) hide show
  1. package/README.md +82 -82
  2. package/lib/cjs/chat/api/conversation.js +42 -2
  3. package/lib/cjs/chat/api/listConversations.js +12 -12
  4. package/lib/cjs/chat/saveResponseTime.js +5 -5
  5. package/lib/cjs/chat/utils/getCountNotificaciones.js +12 -12
  6. package/lib/cjs/index.js +6 -1
  7. package/lib/cjs/mediaProcessing/index.js +255 -0
  8. package/lib/cjs/sendMail/index.js +65 -65
  9. package/lib/cjs/types/chat/api/conversation.d.ts +28 -1
  10. package/lib/cjs/types/chat/api/conversation.d.ts.map +1 -1
  11. package/lib/cjs/types/index.d.ts +2 -1
  12. package/lib/cjs/types/index.d.ts.map +1 -1
  13. package/lib/cjs/types/mediaProcessing/index.d.ts +65 -0
  14. package/lib/cjs/types/mediaProcessing/index.d.ts.map +1 -0
  15. package/lib/cjs/types/workout/planificacionPrueba7dias/10k/getPlanificacionPrueba7dias10k.d.ts +1 -1
  16. package/lib/cjs/types/workout/planificacionPrueba7dias/10k/getPlanificacionPrueba7dias10kMas50.d.ts +1 -1
  17. package/lib/cjs/types/workout/planificacionPrueba7dias/10k/getPlanificacionPrueba7dias10kPrimer.d.ts +1 -1
  18. package/lib/cjs/types/workout/planificacionPrueba7dias/10k/getPlanificacionPrueba7dias10kSub50.d.ts +1 -1
  19. package/lib/cjs/types/workout/planificacionPrueba7dias/21k/getPlanificacionPrueba7dias21k.d.ts +1 -1
  20. package/lib/cjs/types/workout/planificacionPrueba7dias/21k/getPlanificacionPrueba7dias21kMas105.d.ts +1 -1
  21. package/lib/cjs/types/workout/planificacionPrueba7dias/21k/getPlanificacionPrueba7dias21kPrimer.d.ts +1 -1
  22. package/lib/cjs/types/workout/planificacionPrueba7dias/21k/getPlanificacionPrueba7dias21kSub105.d.ts +1 -1
  23. package/lib/cjs/types/workout/planificacionPrueba7dias/42k/getPlanificacionPrueba7dias42k.d.ts +51 -2
  24. package/lib/cjs/types/workout/planificacionPrueba7dias/42k/getPlanificacionPrueba7dias42k.d.ts.map +1 -1
  25. package/lib/cjs/types/workout/planificacionPrueba7dias/42k/getPlanificacionPrueba7dias42kMas210.d.ts +1 -1
  26. package/lib/cjs/types/workout/planificacionPrueba7dias/42k/getPlanificacionPrueba7dias42kPrimer.d.ts +19 -2
  27. package/lib/cjs/types/workout/planificacionPrueba7dias/42k/getPlanificacionPrueba7dias42kPrimer.d.ts.map +1 -1
  28. package/lib/cjs/types/workout/planificacionPrueba7dias/42k/getPlanificacionPrueba7dias42kSub210.d.ts +1 -1
  29. package/lib/cjs/types/workout/planificacionPrueba7dias/5k/getPlanificacionPrueba7dias5k.d.ts +1 -1
  30. package/lib/cjs/types/workout/planificacionPrueba7dias/5k/getPlanificacionPrueba7dias5kPrimer.d.ts +1 -1
  31. package/lib/cjs/types/workout/planificacionPrueba7dias/5k/getPlanificacionPrueba7dias5kSub30.d.ts +1 -1
  32. package/lib/cjs/workout/planificacionPrueba7dias/10k/getPlanificacionPrueba7dias10kMas50.js +1 -1
  33. package/lib/cjs/workout/planificacionPrueba7dias/10k/getPlanificacionPrueba7dias10kPrimer.js +1 -1
  34. package/lib/cjs/workout/planificacionPrueba7dias/10k/getPlanificacionPrueba7dias10kSub50.js +1 -1
  35. package/lib/cjs/workout/planificacionPrueba7dias/21k/getPlanificacionPrueba7dias21kMas105.js +1 -1
  36. package/lib/cjs/workout/planificacionPrueba7dias/21k/getPlanificacionPrueba7dias21kPrimer.js +1 -1
  37. package/lib/cjs/workout/planificacionPrueba7dias/21k/getPlanificacionPrueba7dias21kSub105.js +1 -1
  38. package/lib/cjs/workout/planificacionPrueba7dias/42k/getPlanificacionPrueba7dias42kMas210.js +1 -1
  39. package/lib/cjs/workout/planificacionPrueba7dias/42k/getPlanificacionPrueba7dias42kPrimer.js +1 -0
  40. package/lib/cjs/workout/planificacionPrueba7dias/42k/getPlanificacionPrueba7dias42kSub210.js +1 -1
  41. package/lib/cjs/workout/planificacionPrueba7dias/5k/getPlanificacionPrueba7dias5kPrimer.js +1 -1
  42. package/lib/cjs/workout/planificacionPrueba7dias/5k/getPlanificacionPrueba7dias5kSub30.js +1 -1
  43. package/package.json +81 -79
@@ -45,72 +45,72 @@ const sendMail = ({ subject, title, body, to, link, attachments, bcc }) => __awa
45
45
  });
46
46
  exports.sendMail = sendMail;
47
47
  function getBodyHTML(title, body, link) {
48
- return `
49
- <html lang="es">
50
- <head>
51
- <meta charset="UTF-8">
52
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
53
- <title>Correo con estilo</title>
54
- <style>
55
- /* Estilos generales */
56
- body {
57
- margin: 0;
58
- padding: 0;
59
- }
60
-
61
- /* Estilos específicos del botón */
62
- .button {
63
- display: inline-block;
64
- padding: 12px 26px;
65
- font-size: 17px;
66
- text-align: center;
67
- text-decoration: none;
68
- background-color: #ea5b1b;
69
- color: #ffffff !important;
70
- margin: 40px 0 20px 0;
71
- font-family: 'Sofia Sans', 'Roboto', sans-serif;
72
- font-weight: bold;
73
- border-radius: 4px;
74
- border: 2px solid #ea5b1b;
75
- }
76
- </style>
77
- </head>
78
- <body style="background: #f0f0f0; padding: 0 0 40px 0">
79
- <table role="presentation" style="width:100%;border-collapse:collapse;border:0;border-spacing:0;background:#f0f0f0">
80
- <tr>
81
- <td align="center" style="padding:0;">
82
- <table role="presentation" style="width:100%;border-collapse:collapse;border-spacing:0;text-align:left;">
83
- <tr>
84
- <td align="center" style="padding:5px 0 0 0;background:#ea5b1b;">
85
- <img src="cid:logo" alt="" width="220" style="height:auto;display:block;">
86
- </td>
87
- </tr>
88
- <tr>
89
- <td style="padding:20px 24px 0px 24px; max-width: 600px" align="center">
90
- <h1 style="font-size:22px;text-align:center;margin:16px 0 6px 0;font-family:'Sofia Sans', 'Roboto', sans-serif;font-style: italic">
91
- ${title || ''}
92
- </h1>
93
- <p style="text-align:left;margin:0 0 12px 0;font-size:15px;line-height:24px;font-family:'Sofia Sans', 'Roboto', sans-serif;">
94
- ${body.split('\n').join('<br>')}
95
- </p>
48
+ return `
49
+ <html lang="es">
50
+ <head>
51
+ <meta charset="UTF-8">
52
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
53
+ <title>Correo con estilo</title>
54
+ <style>
55
+ /* Estilos generales */
56
+ body {
57
+ margin: 0;
58
+ padding: 0;
59
+ }
60
+
61
+ /* Estilos específicos del botón */
62
+ .button {
63
+ display: inline-block;
64
+ padding: 12px 26px;
65
+ font-size: 17px;
66
+ text-align: center;
67
+ text-decoration: none;
68
+ background-color: #ea5b1b;
69
+ color: #ffffff !important;
70
+ margin: 40px 0 20px 0;
71
+ font-family: 'Sofia Sans', 'Roboto', sans-serif;
72
+ font-weight: bold;
73
+ border-radius: 4px;
74
+ border: 2px solid #ea5b1b;
75
+ }
76
+ </style>
77
+ </head>
78
+ <body style="background: #f0f0f0; padding: 0 0 40px 0">
79
+ <table role="presentation" style="width:100%;border-collapse:collapse;border:0;border-spacing:0;background:#f0f0f0">
80
+ <tr>
81
+ <td align="center" style="padding:0;">
82
+ <table role="presentation" style="width:100%;border-collapse:collapse;border-spacing:0;text-align:left;">
83
+ <tr>
84
+ <td align="center" style="padding:5px 0 0 0;background:#ea5b1b;">
85
+ <img src="cid:logo" alt="" width="220" style="height:auto;display:block;">
86
+ </td>
87
+ </tr>
88
+ <tr>
89
+ <td style="padding:20px 24px 0px 24px; max-width: 600px" align="center">
90
+ <h1 style="font-size:22px;text-align:center;margin:16px 0 6px 0;font-family:'Sofia Sans', 'Roboto', sans-serif;font-style: italic">
91
+ ${title || ''}
92
+ </h1>
93
+ <p style="text-align:left;margin:0 0 12px 0;font-size:15px;line-height:24px;font-family:'Sofia Sans', 'Roboto', sans-serif;">
94
+ ${body.split('\n').join('<br>')}
95
+ </p>
96
96
  ${link
97
- ? `
98
- <table role="presentation" style="width:100%;border-collapse:collapse;border:0;border-spacing:0;background:#f0f0f0;">
99
- <tr>
100
- <td align="center" style="padding:0;">
101
- <a href="${link.external ? '' : process.env.FRONTEND_URL}${link.url}" class="button" style="color:white">${link.text}</a>
102
- </td>
103
- </tr>
104
- </table>
97
+ ? `
98
+ <table role="presentation" style="width:100%;border-collapse:collapse;border:0;border-spacing:0;background:#f0f0f0;">
99
+ <tr>
100
+ <td align="center" style="padding:0;">
101
+ <a href="${link.external ? '' : process.env.FRONTEND_URL}${link.url}" class="button" style="color:white">${link.text}</a>
102
+ </td>
103
+ </tr>
104
+ </table>
105
105
  `
106
- : ''}
107
- </td>
108
- </tr>
109
- </table>
110
- </td>
111
- </tr>
112
- </table>
113
- </body>
114
- </html>
106
+ : ''}
107
+ </td>
108
+ </tr>
109
+ </table>
110
+ </td>
111
+ </tr>
112
+ </table>
113
+ </body>
114
+ </html>
115
115
  `;
116
116
  }
@@ -1,8 +1,35 @@
1
1
  declare const conversationRoute: ({ router, ...params }: any) => void;
2
+ /**
3
+ * Envía un mensaje de chat entre entrenador y cliente
4
+ *
5
+ * @param req - Request con body conteniendo:
6
+ * @param req.body.text - Texto del mensaje
7
+ * @param req.body.idCliente - ID del cliente destinatario (solo para entrenadores)
8
+ * @param req.body.replyMessageId - ID del mensaje al que se responde (opcional)
9
+ * @param req.body.new - Objeto con datos de comentario intelligence (opcional, tipo 6)
10
+ * @param req.body.idWorkout - ID del workout a linkear en el mensaje (opcional, solo entrenadores)
11
+ * @param res - Response
12
+ * @param params.sendNotification - Función para enviar notificaciones push
13
+ * @param params.firebaseMessaging - Instancia de Firebase Messaging
14
+ * @param params.isClient - Si el sender es cliente (true) o entrenador (false)
15
+ * @returns Promise<void> - Envía { idMessage, text } en la respuesta
16
+ *
17
+ * @example
18
+ * ```typescript
19
+ * // Mensaje normal de entrenador
20
+ * POST /chat/conversation/send
21
+ * { "idCliente": "abc123", "text": "Hola!" }
22
+ *
23
+ * // Mensaje con workout linkeado
24
+ * POST /chat/conversation/send
25
+ * { "idCliente": "abc123", "text": "Para el entreno de series...", "idWorkout": "workout456" }
26
+ * ```
27
+ */
28
+ declare const sendMessage: (req: any, res: any, { sendNotification, firebaseMessaging, isClient }: any) => Promise<void>;
2
29
  declare const updateSenderView: ({ userid, idCliente, idMessage }: {
3
30
  userid: any;
4
31
  idCliente: any;
5
32
  idMessage: any;
6
33
  }) => Promise<void>;
7
- export { conversationRoute, updateSenderView };
34
+ export { conversationRoute, updateSenderView, sendMessage };
8
35
  //# sourceMappingURL=conversation.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"conversation.d.ts","sourceRoot":"","sources":["../../../../../src/chat/api/conversation.ts"],"names":[],"mappings":"AAkBA,QAAA,MAAM,iBAAiB,0BAA2B,GAAG,SA0BpD,CAAC;AA8PF,QAAA,MAAM,gBAAgB;;;;mBAkBrB,CAAC;AAsRF,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,CAAC"}
1
+ {"version":3,"file":"conversation.d.ts","sourceRoot":"","sources":["../../../../../src/chat/api/conversation.ts"],"names":[],"mappings":"AAmBA,QAAA,MAAM,iBAAiB,0BAA2B,GAAG,SA0BpD,CAAC;AAmMF;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,QAAA,MAAM,WAAW,0EAAuE,GAAG,kBAkE1F,CAAC;AAEF,QAAA,MAAM,gBAAgB;;;;mBAqBrB,CAAC;AA8RF,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,WAAW,EAAE,CAAC"}
@@ -17,5 +17,6 @@ import { getPlanificacionPrueba7dias } from './workout/planificacionPrueba7dias'
17
17
  import { saveResponseTime } from './chat/saveResponseTime';
18
18
  import { sendPrompt } from './prompt';
19
19
  import { updateSenderView } from './chat/api/conversation';
20
- export { sendNotification, sleep, query, queryWithClient, longRunningQuery, batchQuery, toPgArray, pool, sendMail, err, fetchIA, notifySlack, CHANNEL_SLACK, translate, LANGUAGES, useTranslation, getExerciseTranslatedDescription, chat, chatApi, chatExposed, getCountNotificaciones, notionGetUsers, notionGetDatabase, notionAddPage, notionEditPage, NOTION_DATABASES_ID, readSheet, findCellByValue, writeSheet, appendSheet, getNumberByLetter, getLetter, reduceSizeImage, generateShareMap, getDefaultWorkoutImage, sendWorkoutToWatch, getPlanificacionPrueba7dias, saveResponseTime, sendPrompt, updateSenderView, };
20
+ import { transcribeAudio, describeImage, processMediaFile, reprocessRecentMedia } from './mediaProcessing';
21
+ export { sendNotification, sleep, query, queryWithClient, longRunningQuery, batchQuery, toPgArray, pool, sendMail, err, fetchIA, notifySlack, CHANNEL_SLACK, translate, LANGUAGES, useTranslation, getExerciseTranslatedDescription, chat, chatApi, chatExposed, getCountNotificaciones, notionGetUsers, notionGetDatabase, notionAddPage, notionEditPage, NOTION_DATABASES_ID, readSheet, findCellByValue, writeSheet, appendSheet, getNumberByLetter, getLetter, reduceSizeImage, generateShareMap, getDefaultWorkoutImage, sendWorkoutToWatch, getPlanificacionPrueba7dias, saveResponseTime, sendPrompt, updateSenderView, transcribeAudio, describeImage, processMediaFile, reprocessRecentMedia, };
21
22
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,KAAK,EAAE,eAAe,EAAE,gBAAgB,EAAE,UAAU,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC7F,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAC5B,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,cAAc,EAAE,gCAAgC,EAAE,MAAM,eAAe,CA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,MAAM,UAAU,CAAC;AACtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAE3G,OAAO,EACL,gBAAgB,EAChB,KAAK,EACL,KAAK,EACL,eAAe,EACf,gBAAgB,EAChB,UAAU,EACV,SAAS,EACT,IAAI,EACJ,QAAQ,EACR,GAAG,EACH,OAAO,EACP,WAAW,EACX,aAAa,EACb,SAAS,EACT,SAAS,EACT,cAAc,EACd,gCAAgC,EAChC,IAAI,EACJ,OAAO,EACP,WAAW,EACX,sBAAsB,EACtB,cAAc,EACd,iBAAiB,EACjB,aAAa,EACb,cAAc,EACd,mBAAmB,EACnB,SAAS,EACT,eAAe,EACf,UAAU,EACV,WAAW,EACX,iBAAiB,EACjB,SAAS,EACT,eAAe,EACf,gBAAgB,EAChB,sBAAsB,EACtB,kBAAkB,EAClB,2BAA2B,EAC3B,gBAAgB,EAChB,UAAU,EACV,gBAAgB,EAChB,eAAe,EACf,aAAa,EACb,gBAAgB,EAChB,oBAAoB,GACrB,CAAC"}
@@ -0,0 +1,65 @@
1
+ /// <reference types="node" />
2
+ /**
3
+ * Transcribe un archivo de audio usando Gemini (Vertex AI)
4
+ *
5
+ * @param fileBuffer - Buffer del archivo de audio
6
+ * @param mimetype - Tipo MIME del archivo (ej: 'audio/mpeg', 'audio/wav')
7
+ * @returns Promise<string> - Transcripción del audio
8
+ *
9
+ * @example
10
+ * ```typescript
11
+ * const transcription = await transcribeAudio(audioBuffer, 'audio/mpeg');
12
+ * // Resultado: "Hola, quería comentarte que hoy me duele un poco la rodilla..."
13
+ * ```
14
+ */
15
+ declare const transcribeAudio: (fileBuffer: Buffer, mimetype: string) => Promise<string>;
16
+ /**
17
+ * Genera una descripción de una imagen usando Gemini (Vertex AI)
18
+ * Contextualizada para una aplicación de fitness/entrenamiento
19
+ *
20
+ * @param fileBuffer - Buffer del archivo de imagen
21
+ * @param mimetype - Tipo MIME del archivo (ej: 'image/jpeg', 'image/png')
22
+ * @returns Promise<string> - Descripción de la imagen
23
+ *
24
+ * @example
25
+ * ```typescript
26
+ * const description = await describeImage(imageBuffer, 'image/jpeg');
27
+ * // Resultado: "Captura de Garmin Connect mostrando un entrenamiento de 10km..."
28
+ * ```
29
+ */
30
+ declare const describeImage: (fileBuffer: Buffer, mimetype: string) => Promise<string>;
31
+ /**
32
+ * Procesa un archivo multimedia (audio o imagen) y guarda el resultado en la base de datos
33
+ * Esta función se ejecuta de forma asíncrona después de guardar el mensaje
34
+ *
35
+ * @param idMessage - ID del mensaje en CHAT MESSAGE
36
+ * @param fileBuffer - Buffer del archivo
37
+ * @param mimetype - Tipo MIME del archivo
38
+ * @returns Promise<void>
39
+ *
40
+ * @example
41
+ * ```typescript
42
+ * // No usar await para ejecutar en background
43
+ * processMediaFile(123, fileBuffer, 'audio/mpeg');
44
+ * ```
45
+ */
46
+ declare const processMediaFile: (idMessage: number, fileBuffer: Buffer, mimetype: string) => Promise<void>;
47
+ /**
48
+ * Reprocesa mensajes multimedia recientes (últimos 2 días) que no tienen FILE TEXT
49
+ * Útil para procesar mensajes enviados antes del deploy de esta funcionalidad
50
+ *
51
+ * @param bucket - Instancia del bucket de Google Cloud Storage
52
+ * @returns Promise<{ processed: number; errors: number }> - Estadísticas del reprocesamiento
53
+ *
54
+ * @example
55
+ * ```typescript
56
+ * const stats = await reprocessRecentMedia(bucket);
57
+ * // Resultado: { processed: 5, errors: 1 }
58
+ * ```
59
+ */
60
+ declare const reprocessRecentMedia: (bucket: any) => Promise<{
61
+ processed: number;
62
+ errors: number;
63
+ }>;
64
+ export { transcribeAudio, describeImage, processMediaFile, reprocessRecentMedia };
65
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/mediaProcessing/index.ts"],"names":[],"mappings":";AAqBA;;;;;;;;;;;;GAYG;AACH,QAAA,MAAM,eAAe,eAAsB,MAAM,YAAY,MAAM,KAAG,QAAQ,MAAM,CAkDnF,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,QAAA,MAAM,aAAa,eAAsB,MAAM,YAAY,MAAM,KAAG,QAAQ,MAAM,CAkDjF,CAAC;AAEF;;;;;;;;;;;;;;GAcG;AACH,QAAA,MAAM,gBAAgB,cAAqB,MAAM,cAAc,MAAM,YAAY,MAAM,KAAG,QAAQ,IAAI,CAkBrG,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,QAAA,MAAM,oBAAoB,WAAkB,GAAG;eAAwB,MAAM;YAAU,MAAM;EAwD5F,CAAC;AAEF,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,CAAC"}
@@ -5,7 +5,7 @@ declare const getPlanificacionPrueba7dias10k: (c: any) => ({
5
5
  type: string;
6
6
  durationPlanned: number;
7
7
  distancePlanned: number;
8
- zoneMetric2: number;
8
+ zonePlanned: number;
9
9
  } | {
10
10
  title: string;
11
11
  description: string;
@@ -21,7 +21,7 @@ declare const getPlanificacionPrueba7dias10kMas50: (c: any) => ({
21
21
  type: string;
22
22
  durationPlanned: number;
23
23
  distancePlanned: number;
24
- zoneMetric2: number;
24
+ zonePlanned: number;
25
25
  } | {
26
26
  title: string;
27
27
  description: string;
@@ -5,7 +5,7 @@ declare const getPlanificacionPrueba7dias10kPrimer: (c: any) => ({
5
5
  type: string;
6
6
  durationPlanned: number;
7
7
  distancePlanned: number;
8
- zoneMetric2: number;
8
+ zonePlanned: number;
9
9
  } | {
10
10
  title: string;
11
11
  description: string;
@@ -21,7 +21,7 @@ declare const getPlanificacionPrueba7dias10kSub50: (c: any) => ({
21
21
  type: string;
22
22
  durationPlanned: number;
23
23
  distancePlanned: number;
24
- zoneMetric2: number;
24
+ zonePlanned: number;
25
25
  })[];
26
26
  export { getPlanificacionPrueba7dias10kSub50 };
27
27
  //# sourceMappingURL=getPlanificacionPrueba7dias10kSub50.d.ts.map
@@ -29,7 +29,7 @@ declare const getPlanificacionPrueba7dias21k: (c: any) => ({
29
29
  type: string;
30
30
  durationPlanned: number;
31
31
  distancePlanned: number;
32
- zoneMetric2: number;
32
+ zonePlanned: number;
33
33
  })[];
34
34
  declare const changeGoalDistanceByNivelActual21k: (c: any) => void;
35
35
  export { getPlanificacionPrueba7dias21k, changeGoalDistanceByNivelActual21k };
@@ -29,7 +29,7 @@ declare const getPlanificacionPrueba7dias21kMas105: (c: any) => ({
29
29
  type: string;
30
30
  durationPlanned: number;
31
31
  distancePlanned: number;
32
- zoneMetric2: number;
32
+ zonePlanned: number;
33
33
  })[];
34
34
  export { getPlanificacionPrueba7dias21kMas105 };
35
35
  //# sourceMappingURL=getPlanificacionPrueba7dias21kMas105.d.ts.map
@@ -21,7 +21,7 @@ declare const getPlanificacionPrueba7dias21kPrimer: (c: any) => ({
21
21
  type: string;
22
22
  durationPlanned: number;
23
23
  distancePlanned: number;
24
- zoneMetric2: number;
24
+ zonePlanned: number;
25
25
  })[];
26
26
  export { getPlanificacionPrueba7dias21kPrimer };
27
27
  //# sourceMappingURL=getPlanificacionPrueba7dias21kPrimer.d.ts.map
@@ -29,7 +29,7 @@ declare const getPlanificacionPrueba7dias21kSub105: (c: any) => ({
29
29
  type: string;
30
30
  durationPlanned: number;
31
31
  distancePlanned: number;
32
- zoneMetric2: number;
32
+ zonePlanned: number;
33
33
  })[];
34
34
  export { getPlanificacionPrueba7dias21kSub105 };
35
35
  //# sourceMappingURL=getPlanificacionPrueba7dias21kSub105.d.ts.map
@@ -1,11 +1,60 @@
1
- declare const getPlanificacionPrueba7dias42k: (c: any) => {
1
+ declare const getPlanificacionPrueba7dias42k: (c: any) => ({
2
+ title: string;
3
+ description: string;
4
+ shortDescription: string;
5
+ type: string;
6
+ distancePlanned: number;
7
+ durationPlanned: number;
8
+ structure: ({
9
+ index: number;
10
+ type: number;
11
+ typeMetric1: number;
12
+ valueMetric1: number;
13
+ typeMetric2: number;
14
+ valueMetric2: any;
15
+ zoneMetric2: number;
16
+ } | {
17
+ index: number;
18
+ type: number;
19
+ typeMetric1: number;
20
+ valueMetric1: number;
21
+ typeMetric2?: undefined;
22
+ valueMetric2?: undefined;
23
+ zoneMetric2?: undefined;
24
+ })[];
25
+ } | {
26
+ title: string;
27
+ description: string;
28
+ shortDescription: string;
29
+ type: string;
30
+ distancePlanned: number;
31
+ durationPlanned: number;
32
+ structure: ({
33
+ index: number;
34
+ type: number;
35
+ typeMetric1: number;
36
+ valueMetric1: number;
37
+ typeMetric2: number;
38
+ valueMetric2: any;
39
+ zoneMetric2?: undefined;
40
+ } | {
41
+ index: number;
42
+ type: number;
43
+ typeMetric1: number;
44
+ valueMetric1: number;
45
+ typeMetric2: number;
46
+ valueMetric2: any;
47
+ zoneMetric2: number;
48
+ })[];
49
+ } | {
2
50
  title: string;
3
51
  description: string;
4
52
  shortDescription: string;
5
53
  type: string;
6
54
  durationPlanned: number;
7
55
  distancePlanned: number;
8
- }[];
56
+ zonePlanned: number;
57
+ })[];
9
58
  declare const changeGoalDistanceByNivelActual42k: (c: any) => void;
10
59
  export { getPlanificacionPrueba7dias42k, changeGoalDistanceByNivelActual42k };
11
60
  //# sourceMappingURL=getPlanificacionPrueba7dias42k.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"getPlanificacionPrueba7dias42k.d.ts","sourceRoot":"","sources":["../../../../../../src/workout/planificacionPrueba7dias/42k/getPlanificacionPrueba7dias42k.ts"],"names":[],"mappings":"AAIA,QAAA,MAAM,8BAA8B;;;;;;;GAKnC,CAAC;AAEF,QAAA,MAAM,kCAAkC,kBAQvC,CAAC;AAEF,OAAO,EAAE,8BAA8B,EAAE,kCAAkC,EAAE,CAAC"}
1
+ {"version":3,"file":"getPlanificacionPrueba7dias42k.d.ts","sourceRoot":"","sources":["../../../../../../src/workout/planificacionPrueba7dias/42k/getPlanificacionPrueba7dias42k.ts"],"names":[],"mappings":"AAIA,QAAA,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAKnC,CAAC;AAEF,QAAA,MAAM,kCAAkC,kBAQvC,CAAC;AAEF,OAAO,EAAE,8BAA8B,EAAE,kCAAkC,EAAE,CAAC"}
@@ -53,7 +53,7 @@ declare const getPlanificacionPrueba7dias42kMas210: (c: any) => ({
53
53
  type: string;
54
54
  durationPlanned: number;
55
55
  distancePlanned: number;
56
- zoneMetric2: number;
56
+ zonePlanned: number;
57
57
  })[];
58
58
  export { getPlanificacionPrueba7dias42kMas210 };
59
59
  //# sourceMappingURL=getPlanificacionPrueba7dias42kMas210.d.ts.map
@@ -1,10 +1,27 @@
1
- declare const getPlanificacionPrueba7dias42kPrimer: (c: any) => {
1
+ declare const getPlanificacionPrueba7dias42kPrimer: (c: any) => ({
2
+ title: string;
3
+ description: string;
4
+ shortDescription: string;
5
+ type: string;
6
+ distancePlanned: number;
7
+ durationPlanned: number;
8
+ structure: {
9
+ index: number;
10
+ type: number;
11
+ typeMetric1: number;
12
+ valueMetric1: number;
13
+ typeMetric2: number;
14
+ valueMetric2: any;
15
+ zoneMetric2: number;
16
+ }[];
17
+ } | {
2
18
  title: string;
3
19
  description: string;
4
20
  shortDescription: string;
5
21
  type: string;
6
22
  durationPlanned: number;
7
23
  distancePlanned: number;
8
- }[];
24
+ zonePlanned: number;
25
+ })[];
9
26
  export { getPlanificacionPrueba7dias42kPrimer };
10
27
  //# sourceMappingURL=getPlanificacionPrueba7dias42kPrimer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"getPlanificacionPrueba7dias42kPrimer.d.ts","sourceRoot":"","sources":["../../../../../../src/workout/planificacionPrueba7dias/42k/getPlanificacionPrueba7dias42kPrimer.ts"],"names":[],"mappings":"AAGA,QAAA,MAAM,oCAAoC;;;;;;;GASzC,CAAC;AAgKF,OAAO,EAAE,oCAAoC,EAAE,CAAC"}
1
+ {"version":3,"file":"getPlanificacionPrueba7dias42kPrimer.d.ts","sourceRoot":"","sources":["../../../../../../src/workout/planificacionPrueba7dias/42k/getPlanificacionPrueba7dias42kPrimer.ts"],"names":[],"mappings":"AAGA,QAAA,MAAM,oCAAoC;;;;;;;;;;;;;;;;;;;;;;;;IASzC,CAAC;AAiKF,OAAO,EAAE,oCAAoC,EAAE,CAAC"}
@@ -21,7 +21,7 @@ declare const getPlanificacionPrueba7dias42kSub210: (c: any) => ({
21
21
  type: string;
22
22
  durationPlanned: number;
23
23
  distancePlanned: number;
24
- zoneMetric2: number;
24
+ zonePlanned: number;
25
25
  })[];
26
26
  export { getPlanificacionPrueba7dias42kSub210 };
27
27
  //# sourceMappingURL=getPlanificacionPrueba7dias42kSub210.d.ts.map
@@ -5,7 +5,7 @@ declare const getPlanificacionPrueba7dias5k: (c: any) => ({
5
5
  type: string;
6
6
  durationPlanned: number;
7
7
  distancePlanned: number;
8
- zoneMetric2: number;
8
+ zonePlanned: number;
9
9
  } | {
10
10
  title: string;
11
11
  description: string;
@@ -5,7 +5,7 @@ declare const getPlanificacionPrueba7dias5kPrimer: (c: any) => ({
5
5
  type: string;
6
6
  durationPlanned: number;
7
7
  distancePlanned: number;
8
- zoneMetric2: number;
8
+ zonePlanned: number;
9
9
  } | {
10
10
  title: string;
11
11
  description: string;
@@ -21,7 +21,7 @@ declare const getPlanificacionPrueba7dias5kSub30: (c: any) => ({
21
21
  type: string;
22
22
  durationPlanned: number;
23
23
  distancePlanned: number;
24
- zoneMetric2: number;
24
+ zonePlanned: number;
25
25
  })[];
26
26
  export { getPlanificacionPrueba7dias5kSub30 };
27
27
  //# sourceMappingURL=getPlanificacionPrueba7dias5kSub30.d.ts.map
@@ -76,7 +76,7 @@ const getDay2 = (c) => {
76
76
  type: common_1.WORKOUT_TYPE.CORRER,
77
77
  durationPlanned: 3300,
78
78
  distancePlanned: (0, common_2.calculateDistance)(c, 3300, 2),
79
- zoneMetric2: 2,
79
+ zonePlanned: 2,
80
80
  };
81
81
  };
82
82
  const getDay3 = (c) => {
@@ -21,7 +21,7 @@ const getDay1 = (c) => {
21
21
  type: common_1.WORKOUT_TYPE.CORRER,
22
22
  durationPlanned: 2400,
23
23
  distancePlanned: (0, common_2.calculateDistance)(c, 2400, 2),
24
- zoneMetric2: 2,
24
+ zonePlanned: 2,
25
25
  };
26
26
  };
27
27
  const getDay2 = (c) => {
@@ -76,7 +76,7 @@ const getDay2 = (c) => {
76
76
  type: common_1.WORKOUT_TYPE.CORRER,
77
77
  durationPlanned: 4200,
78
78
  distancePlanned: (0, common_2.calculateDistance)(c, 4200, 2),
79
- zoneMetric2: 2,
79
+ zonePlanned: 2,
80
80
  };
81
81
  };
82
82
  const getDay3 = (c) => {
@@ -148,6 +148,6 @@ const getDay3 = (c) => {
148
148
  type: common_1.WORKOUT_TYPE.CORRER,
149
149
  durationPlanned: 4500,
150
150
  distancePlanned: (0, common_2.calculateDistance)(c, 4500, 2),
151
- zoneMetric2: 2,
151
+ zonePlanned: 2,
152
152
  };
153
153
  };
@@ -133,6 +133,6 @@ const getDay3 = (c) => {
133
133
  type: common_1.WORKOUT_TYPE.CORRER,
134
134
  durationPlanned: 3600,
135
135
  distancePlanned: (0, common_2.calculateDistance)(c, 3600, 2),
136
- zoneMetric2: 2,
136
+ zonePlanned: 2,
137
137
  };
138
138
  };
@@ -148,6 +148,6 @@ const getDay3 = (c) => {
148
148
  type: common_1.WORKOUT_TYPE.CORRER,
149
149
  durationPlanned: 4800,
150
150
  distancePlanned: (0, common_2.calculateDistance)(c, 4800, 2),
151
- zoneMetric2: 2,
151
+ zonePlanned: 2,
152
152
  };
153
153
  };
@@ -157,6 +157,6 @@ const getDay3 = (c) => {
157
157
  type: common_1.WORKOUT_TYPE.CORRER,
158
158
  durationPlanned: 6000,
159
159
  distancePlanned: (0, common_2.calculateDistance)(c, 6000, 2),
160
- zoneMetric2: 2,
160
+ zonePlanned: 2,
161
161
  };
162
162
  };
@@ -157,5 +157,6 @@ const getDay3 = (c) => {
157
157
  type: common_1.WORKOUT_TYPE.CORRER,
158
158
  durationPlanned: 5400,
159
159
  distancePlanned: (0, common_2.calculateDistance)(c, 5400, 2),
160
+ zonePlanned: 2,
160
161
  };
161
162
  };
@@ -134,6 +134,6 @@ const getDay3 = (c) => {
134
134
  type: common_1.WORKOUT_TYPE.CORRER,
135
135
  durationPlanned: 6600,
136
136
  distancePlanned: (0, common_2.calculateDistance)(c, 6600, 2),
137
- zoneMetric2: 2,
137
+ zonePlanned: 2,
138
138
  };
139
139
  };
@@ -21,7 +21,7 @@ const getDay1 = (c) => {
21
21
  type: common_1.WORKOUT_TYPE.CORRER,
22
22
  durationPlanned: 1500,
23
23
  distancePlanned: (0, common_2.calculateDistance)(c, 1500, 2),
24
- zoneMetric2: 2,
24
+ zonePlanned: 2,
25
25
  };
26
26
  };
27
27
  const getDay2 = (c) => {
@@ -139,6 +139,6 @@ const getDay3 = (c) => {
139
139
  type: common_1.WORKOUT_TYPE.CORRER,
140
140
  durationPlanned: 2100,
141
141
  distancePlanned: (0, common_2.calculateDistance)(c, 2100, 2),
142
- zoneMetric2: 2,
142
+ zonePlanned: 2,
143
143
  };
144
144
  };