@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.
- package/README.md +82 -82
- package/lib/cjs/chat/api/conversation.js +42 -2
- package/lib/cjs/chat/api/listConversations.js +12 -12
- package/lib/cjs/chat/saveResponseTime.js +5 -5
- package/lib/cjs/chat/utils/getCountNotificaciones.js +12 -12
- package/lib/cjs/index.js +6 -1
- package/lib/cjs/mediaProcessing/index.js +255 -0
- package/lib/cjs/sendMail/index.js +65 -65
- package/lib/cjs/types/chat/api/conversation.d.ts +28 -1
- package/lib/cjs/types/chat/api/conversation.d.ts.map +1 -1
- package/lib/cjs/types/index.d.ts +2 -1
- package/lib/cjs/types/index.d.ts.map +1 -1
- package/lib/cjs/types/mediaProcessing/index.d.ts +65 -0
- package/lib/cjs/types/mediaProcessing/index.d.ts.map +1 -0
- package/lib/cjs/types/workout/planificacionPrueba7dias/10k/getPlanificacionPrueba7dias10k.d.ts +1 -1
- package/lib/cjs/types/workout/planificacionPrueba7dias/10k/getPlanificacionPrueba7dias10kMas50.d.ts +1 -1
- package/lib/cjs/types/workout/planificacionPrueba7dias/10k/getPlanificacionPrueba7dias10kPrimer.d.ts +1 -1
- package/lib/cjs/types/workout/planificacionPrueba7dias/10k/getPlanificacionPrueba7dias10kSub50.d.ts +1 -1
- package/lib/cjs/types/workout/planificacionPrueba7dias/21k/getPlanificacionPrueba7dias21k.d.ts +1 -1
- package/lib/cjs/types/workout/planificacionPrueba7dias/21k/getPlanificacionPrueba7dias21kMas105.d.ts +1 -1
- package/lib/cjs/types/workout/planificacionPrueba7dias/21k/getPlanificacionPrueba7dias21kPrimer.d.ts +1 -1
- package/lib/cjs/types/workout/planificacionPrueba7dias/21k/getPlanificacionPrueba7dias21kSub105.d.ts +1 -1
- package/lib/cjs/types/workout/planificacionPrueba7dias/42k/getPlanificacionPrueba7dias42k.d.ts +51 -2
- package/lib/cjs/types/workout/planificacionPrueba7dias/42k/getPlanificacionPrueba7dias42k.d.ts.map +1 -1
- package/lib/cjs/types/workout/planificacionPrueba7dias/42k/getPlanificacionPrueba7dias42kMas210.d.ts +1 -1
- package/lib/cjs/types/workout/planificacionPrueba7dias/42k/getPlanificacionPrueba7dias42kPrimer.d.ts +19 -2
- package/lib/cjs/types/workout/planificacionPrueba7dias/42k/getPlanificacionPrueba7dias42kPrimer.d.ts.map +1 -1
- package/lib/cjs/types/workout/planificacionPrueba7dias/42k/getPlanificacionPrueba7dias42kSub210.d.ts +1 -1
- package/lib/cjs/types/workout/planificacionPrueba7dias/5k/getPlanificacionPrueba7dias5k.d.ts +1 -1
- package/lib/cjs/types/workout/planificacionPrueba7dias/5k/getPlanificacionPrueba7dias5kPrimer.d.ts +1 -1
- package/lib/cjs/types/workout/planificacionPrueba7dias/5k/getPlanificacionPrueba7dias5kSub30.d.ts +1 -1
- package/lib/cjs/workout/planificacionPrueba7dias/10k/getPlanificacionPrueba7dias10kMas50.js +1 -1
- package/lib/cjs/workout/planificacionPrueba7dias/10k/getPlanificacionPrueba7dias10kPrimer.js +1 -1
- package/lib/cjs/workout/planificacionPrueba7dias/10k/getPlanificacionPrueba7dias10kSub50.js +1 -1
- package/lib/cjs/workout/planificacionPrueba7dias/21k/getPlanificacionPrueba7dias21kMas105.js +1 -1
- package/lib/cjs/workout/planificacionPrueba7dias/21k/getPlanificacionPrueba7dias21kPrimer.js +1 -1
- package/lib/cjs/workout/planificacionPrueba7dias/21k/getPlanificacionPrueba7dias21kSub105.js +1 -1
- package/lib/cjs/workout/planificacionPrueba7dias/42k/getPlanificacionPrueba7dias42kMas210.js +1 -1
- package/lib/cjs/workout/planificacionPrueba7dias/42k/getPlanificacionPrueba7dias42kPrimer.js +1 -0
- package/lib/cjs/workout/planificacionPrueba7dias/42k/getPlanificacionPrueba7dias42kSub210.js +1 -1
- package/lib/cjs/workout/planificacionPrueba7dias/5k/getPlanificacionPrueba7dias5kPrimer.js +1 -1
- package/lib/cjs/workout/planificacionPrueba7dias/5k/getPlanificacionPrueba7dias5kSub30.js +1 -1
- 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":"
|
|
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"}
|
package/lib/cjs/types/index.d.ts
CHANGED
|
@@ -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
|
-
|
|
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,CAAC;AACvG,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,sBAAsB,EAAE,MAAM,QAAQ,CAAC;AAC5E,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,aAAa,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AACjH,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,UAAU,EAAE,WAAW,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAClH,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AACxE,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,2BAA2B,EAAE,MAAM,oCAAoC,CAAC;AACjF,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;
|
|
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,CAAC;AACvG,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,sBAAsB,EAAE,MAAM,QAAQ,CAAC;AAC5E,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,aAAa,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AACjH,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,UAAU,EAAE,WAAW,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAClH,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AACxE,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,2BAA2B,EAAE,MAAM,oCAAoC,CAAC;AACjF,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,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"}
|
package/lib/cjs/types/workout/planificacionPrueba7dias/10k/getPlanificacionPrueba7dias10kSub50.d.ts
CHANGED
|
@@ -21,7 +21,7 @@ declare const getPlanificacionPrueba7dias10kSub50: (c: any) => ({
|
|
|
21
21
|
type: string;
|
|
22
22
|
durationPlanned: number;
|
|
23
23
|
distancePlanned: number;
|
|
24
|
-
|
|
24
|
+
zonePlanned: number;
|
|
25
25
|
})[];
|
|
26
26
|
export { getPlanificacionPrueba7dias10kSub50 };
|
|
27
27
|
//# sourceMappingURL=getPlanificacionPrueba7dias10kSub50.d.ts.map
|
package/lib/cjs/types/workout/planificacionPrueba7dias/21k/getPlanificacionPrueba7dias21k.d.ts
CHANGED
|
@@ -29,7 +29,7 @@ declare const getPlanificacionPrueba7dias21k: (c: any) => ({
|
|
|
29
29
|
type: string;
|
|
30
30
|
durationPlanned: number;
|
|
31
31
|
distancePlanned: number;
|
|
32
|
-
|
|
32
|
+
zonePlanned: number;
|
|
33
33
|
})[];
|
|
34
34
|
declare const changeGoalDistanceByNivelActual21k: (c: any) => void;
|
|
35
35
|
export { getPlanificacionPrueba7dias21k, changeGoalDistanceByNivelActual21k };
|
package/lib/cjs/types/workout/planificacionPrueba7dias/21k/getPlanificacionPrueba7dias21kMas105.d.ts
CHANGED
|
@@ -29,7 +29,7 @@ declare const getPlanificacionPrueba7dias21kMas105: (c: any) => ({
|
|
|
29
29
|
type: string;
|
|
30
30
|
durationPlanned: number;
|
|
31
31
|
distancePlanned: number;
|
|
32
|
-
|
|
32
|
+
zonePlanned: number;
|
|
33
33
|
})[];
|
|
34
34
|
export { getPlanificacionPrueba7dias21kMas105 };
|
|
35
35
|
//# sourceMappingURL=getPlanificacionPrueba7dias21kMas105.d.ts.map
|
package/lib/cjs/types/workout/planificacionPrueba7dias/21k/getPlanificacionPrueba7dias21kPrimer.d.ts
CHANGED
|
@@ -21,7 +21,7 @@ declare const getPlanificacionPrueba7dias21kPrimer: (c: any) => ({
|
|
|
21
21
|
type: string;
|
|
22
22
|
durationPlanned: number;
|
|
23
23
|
distancePlanned: number;
|
|
24
|
-
|
|
24
|
+
zonePlanned: number;
|
|
25
25
|
})[];
|
|
26
26
|
export { getPlanificacionPrueba7dias21kPrimer };
|
|
27
27
|
//# sourceMappingURL=getPlanificacionPrueba7dias21kPrimer.d.ts.map
|
package/lib/cjs/types/workout/planificacionPrueba7dias/21k/getPlanificacionPrueba7dias21kSub105.d.ts
CHANGED
|
@@ -29,7 +29,7 @@ declare const getPlanificacionPrueba7dias21kSub105: (c: any) => ({
|
|
|
29
29
|
type: string;
|
|
30
30
|
durationPlanned: number;
|
|
31
31
|
distancePlanned: number;
|
|
32
|
-
|
|
32
|
+
zonePlanned: number;
|
|
33
33
|
})[];
|
|
34
34
|
export { getPlanificacionPrueba7dias21kSub105 };
|
|
35
35
|
//# sourceMappingURL=getPlanificacionPrueba7dias21kSub105.d.ts.map
|
package/lib/cjs/types/workout/planificacionPrueba7dias/42k/getPlanificacionPrueba7dias42k.d.ts
CHANGED
|
@@ -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
|
package/lib/cjs/types/workout/planificacionPrueba7dias/42k/getPlanificacionPrueba7dias42k.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getPlanificacionPrueba7dias42k.d.ts","sourceRoot":"","sources":["../../../../../../src/workout/planificacionPrueba7dias/42k/getPlanificacionPrueba7dias42k.ts"],"names":[],"mappings":"AAIA,QAAA,MAAM,8BAA8B
|
|
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"}
|
package/lib/cjs/types/workout/planificacionPrueba7dias/42k/getPlanificacionPrueba7dias42kMas210.d.ts
CHANGED
|
@@ -53,7 +53,7 @@ declare const getPlanificacionPrueba7dias42kMas210: (c: any) => ({
|
|
|
53
53
|
type: string;
|
|
54
54
|
durationPlanned: number;
|
|
55
55
|
distancePlanned: number;
|
|
56
|
-
|
|
56
|
+
zonePlanned: number;
|
|
57
57
|
})[];
|
|
58
58
|
export { getPlanificacionPrueba7dias42kMas210 };
|
|
59
59
|
//# sourceMappingURL=getPlanificacionPrueba7dias42kMas210.d.ts.map
|
package/lib/cjs/types/workout/planificacionPrueba7dias/42k/getPlanificacionPrueba7dias42kPrimer.d.ts
CHANGED
|
@@ -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
|
|
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"}
|
package/lib/cjs/types/workout/planificacionPrueba7dias/42k/getPlanificacionPrueba7dias42kSub210.d.ts
CHANGED
|
@@ -21,7 +21,7 @@ declare const getPlanificacionPrueba7dias42kSub210: (c: any) => ({
|
|
|
21
21
|
type: string;
|
|
22
22
|
durationPlanned: number;
|
|
23
23
|
distancePlanned: number;
|
|
24
|
-
|
|
24
|
+
zonePlanned: number;
|
|
25
25
|
})[];
|
|
26
26
|
export { getPlanificacionPrueba7dias42kSub210 };
|
|
27
27
|
//# sourceMappingURL=getPlanificacionPrueba7dias42kSub210.d.ts.map
|
package/lib/cjs/types/workout/planificacionPrueba7dias/5k/getPlanificacionPrueba7dias5kSub30.d.ts
CHANGED
|
@@ -21,7 +21,7 @@ declare const getPlanificacionPrueba7dias5kSub30: (c: any) => ({
|
|
|
21
21
|
type: string;
|
|
22
22
|
durationPlanned: number;
|
|
23
23
|
distancePlanned: number;
|
|
24
|
-
|
|
24
|
+
zonePlanned: number;
|
|
25
25
|
})[];
|
|
26
26
|
export { getPlanificacionPrueba7dias5kSub30 };
|
|
27
27
|
//# sourceMappingURL=getPlanificacionPrueba7dias5kSub30.d.ts.map
|