diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..23ad12b Binary files /dev/null and b/.gitignore differ diff --git a/data/colonias-rutas.json b/data/colonias-rutas.json new file mode 100644 index 0000000..8259037 --- /dev/null +++ b/data/colonias-rutas.json @@ -0,0 +1,37 @@ +[ + { + "colonia": "Zona Centro", + "routeId": "RUTA-01", + "horarioEstimado": "Matutino (06:30 - 07:15)" + }, + { + "colonia": "Las Arboledas", + "routeId": "RUTA-01", + "horarioEstimado": "Matutino (07:00 - 07:30)" + }, + { + "colonia": "Trojes", + "routeId": "RUTA-13", + "horarioEstimado": "Matutino (06:40 - 07:10)" + }, + { + "colonia": "San Juanico", + "routeId": "RUTA-03", + "horarioEstimado": "Matutino (06:45 - 07:15)" + }, + { + "colonia": "Los Olivos", + "routeId": "RUTA-04", + "horarioEstimado": "Matutino (07:00 - 07:40)" + }, + { + "colonia": "Rancho Seco", + "routeId": "RUTA-05", + "horarioEstimado": "Vespertino (14:15 - 15:00)" + }, + { + "colonia": "Las Insurgentes", + "routeId": "RUTA-12", + "horarioEstimado": "Matutino (06:35 - 07:10)" + } +] \ No newline at end of file diff --git a/data/notificaciones.json b/data/notificaciones.json new file mode 100644 index 0000000..93834b0 --- /dev/null +++ b/data/notificaciones.json @@ -0,0 +1,26 @@ +[ + { + "triggerEvent": "ROUTE_START", + "condition": "Cuando positionId cambia de 1 a 2", + "pushPayload": { + "title": "¡Ruta Iniciada!", + "body": "El camión recolector ha salido del Relleno Sanitario rumbo a tu sector. Asegúrate de tener listos tus residuos." + } + }, + { + "triggerEvent": "TRUCK_PROXIMITY", + "condition": "Cuando positionId llega a 4 (punto previo al destino)", + "pushPayload": { + "title": "Camión Cercano", + "body": "El camión está a menos de 15 minutos de tu domicilio. Es momento de sacar tus bolsas a la acera." + } + }, + { + "triggerEvent": "ROUTE_COMPLETED", + "condition": "Cuando positionId llega a 8 (retorno al basurero)", + "pushPayload": { + "title": "Servicio Finalizado", + "body": "El camión de tu sector ha concluido su jornada de recolección diaria." + } + } +] \ No newline at end of file diff --git a/data/rutas.json b/data/rutas.json new file mode 100644 index 0000000..71e5aaf --- /dev/null +++ b/data/rutas.json @@ -0,0 +1,962 @@ +[ + { + "routeId": "RUTA-01", + "name": "Zona Centro - Las Arboledas", + "truckId": 101, + "status": "EN_RUTA", + "positions": [ + { + "positionId": 1, + "lat": 20.5111, + "lng": -100.9037, + "speed": 0, + "timestamp": "2026-05-22T06:00:00Z" + }, + { + "positionId": 2, + "lat": 20.5185, + "lng": -100.845, + "speed": 45, + "timestamp": "2026-05-22T06:12:00Z" + }, + { + "positionId": 3, + "lat": 20.5215, + "lng": -100.8142, + "speed": 22, + "timestamp": "2026-05-22T06:25:00Z" + }, + { + "positionId": 4, + "lat": 20.5212, + "lng": -100.8175, + "speed": 15, + "timestamp": "2026-05-22T06:38:00Z" + }, + { + "positionId": 5, + "lat": 20.521, + "lng": -100.821, + "speed": 0, + "timestamp": "2026-05-22T06:50:00Z" + }, + { + "positionId": 6, + "lat": 20.5235, + "lng": -100.8212, + "speed": 18, + "timestamp": "2026-05-22T07:05:00Z" + }, + { + "positionId": 7, + "lat": 20.526, + "lng": -100.8215, + "speed": 20, + "timestamp": "2026-05-22T07:18:00Z" + }, + { + "positionId": 8, + "lat": 20.5111, + "lng": -100.9037, + "speed": 40, + "timestamp": "2026-05-22T07:40:00Z" + } + ] + }, + { + "routeId": "RUTA-02", + "name": "Sector Norte - Av. Tecnológico", + "truckId": 102, + "status": "EN_RUTA", + "positions": [ + { + "positionId": 1, + "lat": 20.5111, + "lng": -100.9037, + "speed": 0, + "timestamp": "2026-05-22T06:05:00Z" + }, + { + "positionId": 2, + "lat": 20.528, + "lng": -100.8135, + "speed": 38, + "timestamp": "2026-05-22T06:18:00Z" + }, + { + "positionId": 3, + "lat": 20.541, + "lng": -100.813, + "speed": 25, + "timestamp": "2026-05-22T06:30:00Z" + }, + { + "positionId": 4, + "lat": 20.5445, + "lng": -100.8132, + "speed": 12, + "timestamp": "2026-05-22T06:45:00Z" + }, + { + "positionId": 5, + "lat": 20.548, + "lng": -100.8135, + "speed": 0, + "timestamp": "2026-05-22T06:58:00Z" + }, + { + "positionId": 6, + "lat": 20.5515, + "lng": -100.8138, + "speed": 15, + "timestamp": "2026-05-22T07:10:00Z" + }, + { + "positionId": 7, + "lat": 20.554, + "lng": -100.811, + "speed": 22, + "timestamp": "2026-05-22T07:25:00Z" + }, + { + "positionId": 8, + "lat": 20.5111, + "lng": -100.9037, + "speed": 45, + "timestamp": "2026-05-22T07:50:00Z" + } + ] + }, + { + "routeId": "RUTA-03", + "name": "Sector Poniente - San Juanico", + "truckId": 103, + "status": "EN_RUTA", + "positions": [ + { + "positionId": 1, + "lat": 20.5111, + "lng": -100.9037, + "speed": 0, + "timestamp": "2026-05-22T06:10:00Z" + }, + { + "positionId": 2, + "lat": 20.525, + "lng": -100.851, + "speed": 42, + "timestamp": "2026-05-22T06:20:00Z" + }, + { + "positionId": 3, + "lat": 20.529, + "lng": -100.832, + "speed": 20, + "timestamp": "2026-05-22T06:35:00Z" + }, + { + "positionId": 4, + "lat": 20.5315, + "lng": -100.8355, + "speed": 15, + "timestamp": "2026-05-22T06:48:00Z" + }, + { + "positionId": 5, + "lat": 20.534, + "lng": -100.839, + "speed": 0, + "timestamp": "2026-05-22T07:00:00Z" + }, + { + "positionId": 6, + "lat": 20.5362, + "lng": -100.8425, + "speed": 10, + "timestamp": "2026-05-22T07:15:00Z" + }, + { + "positionId": 7, + "lat": 20.533, + "lng": -100.843, + "speed": 18, + "timestamp": "2026-05-22T07:28:00Z" + }, + { + "positionId": 8, + "lat": 20.5111, + "lng": -100.9037, + "speed": 35, + "timestamp": "2026-05-22T07:45:00Z" + } + ] + }, + { + "routeId": "RUTA-04", + "name": "Oriente - Los Olivos", + "truckId": 104, + "status": "EN_RUTA", + "positions": [ + { + "positionId": 1, + "lat": 20.5111, + "lng": -100.9037, + "speed": 0, + "timestamp": "2026-05-22T06:15:00Z" + }, + { + "positionId": 2, + "lat": 20.526, + "lng": -100.801, + "speed": 45, + "timestamp": "2026-05-22T06:30:00Z" + }, + { + "positionId": 3, + "lat": 20.5295, + "lng": -100.789, + "speed": 24, + "timestamp": "2026-05-22T06:45:00Z" + }, + { + "positionId": 4, + "lat": 20.532, + "lng": -100.785, + "speed": 12, + "timestamp": "2026-05-22T06:58:00Z" + }, + { + "positionId": 5, + "lat": 20.535, + "lng": -100.779, + "speed": 0, + "timestamp": "2026-05-22T07:12:00Z" + }, + { + "positionId": 6, + "lat": 20.531, + "lng": -100.776, + "speed": 15, + "timestamp": "2026-05-22T07:25:00Z" + }, + { + "positionId": 7, + "lat": 20.527, + "lng": -100.782, + "speed": 26, + "timestamp": "2026-05-22T07:38:00Z" + }, + { + "positionId": 8, + "lat": 20.5111, + "lng": -100.9037, + "speed": 48, + "timestamp": "2026-05-22T07:58:00Z" + } + ] + }, + { + "routeId": "RUTA-05", + "name": "Sector Sur - Rancho Seco", + "truckId": 105, + "status": "EN_RUTA", + "positions": [ + { + "positionId": 1, + "lat": 20.5111, + "lng": -100.9037, + "speed": 0, + "timestamp": "2026-05-22T06:20:00Z" + }, + { + "positionId": 2, + "lat": 20.505, + "lng": -100.862, + "speed": 35, + "timestamp": "2026-05-22T06:32:00Z" + }, + { + "positionId": 3, + "lat": 20.502, + "lng": -100.835, + "speed": 22, + "timestamp": "2026-05-22T06:45:00Z" + }, + { + "positionId": 4, + "lat": 20.4995, + "lng": -100.821, + "speed": 14, + "timestamp": "2026-05-22T06:58:00Z" + }, + { + "positionId": 5, + "lat": 20.497, + "lng": -100.815, + "speed": 0, + "timestamp": "2026-05-22T07:10:00Z" + }, + { + "positionId": 6, + "lat": 20.501, + "lng": -100.812, + "speed": 16, + "timestamp": "2026-05-22T07:22:00Z" + }, + { + "positionId": 7, + "lat": 20.506, + "lng": -100.816, + "speed": 25, + "timestamp": "2026-05-22T07:35:00Z" + }, + { + "positionId": 8, + "lat": 20.5111, + "lng": -100.9037, + "speed": 40, + "timestamp": "2026-05-22T07:55:00Z" + } + ] + }, + { + "routeId": "RUTA-06", + "name": "Norte Extremo - Rumbos de Roque", + "truckId": 106, + "status": "EN_RUTA", + "positions": [ + { + "positionId": 1, + "lat": 20.5111, + "lng": -100.9037, + "speed": 0, + "timestamp": "2026-05-22T06:00:00Z" + }, + { + "positionId": 2, + "lat": 20.538, + "lng": -100.838, + "speed": 40, + "timestamp": "2026-05-22T06:15:00Z" + }, + { + "positionId": 3, + "lat": 20.561, + "lng": -100.837, + "speed": 30, + "timestamp": "2026-05-22T06:30:00Z" + }, + { + "positionId": 4, + "lat": 20.575, + "lng": -100.836, + "speed": 15, + "timestamp": "2026-05-22T06:45:00Z" + }, + { + "positionId": 5, + "lat": 20.582, + "lng": -100.835, + "speed": 0, + "timestamp": "2026-05-22T07:00:00Z" + }, + { + "positionId": 6, + "lat": 20.578, + "lng": -100.831, + "speed": 20, + "timestamp": "2026-05-22T07:15:00Z" + }, + { + "positionId": 7, + "lat": 20.565, + "lng": -100.832, + "speed": 28, + "timestamp": "2026-05-22T07:30:00Z" + }, + { + "positionId": 8, + "lat": 20.5111, + "lng": -100.9037, + "speed": 45, + "timestamp": "2026-05-22T07:55:00Z" + } + ] + }, + { + "routeId": "RUTA-07", + "name": "Nororiente - Ciudad Industrial", + "truckId": 107, + "status": "EN_RUTA", + "positions": [ + { + "positionId": 1, + "lat": 20.5111, + "lng": -100.9037, + "speed": 0, + "timestamp": "2026-05-22T06:10:00Z" + }, + { + "positionId": 2, + "lat": 20.535, + "lng": -100.805, + "speed": 44, + "timestamp": "2026-05-22T06:24:00Z" + }, + { + "positionId": 3, + "lat": 20.545, + "lng": -100.795, + "speed": 25, + "timestamp": "2026-05-22T06:38:00Z" + }, + { + "positionId": 4, + "lat": 20.548, + "lng": -100.785, + "speed": 18, + "timestamp": "2026-05-22T06:52:00Z" + }, + { + "positionId": 5, + "lat": 20.551, + "lng": -100.775, + "speed": 0, + "timestamp": "2026-05-22T07:05:00Z" + }, + { + "positionId": 6, + "lat": 20.546, + "lng": -100.772, + "speed": 12, + "timestamp": "2026-05-22T07:18:00Z" + }, + { + "positionId": 7, + "lat": 20.539, + "lng": -100.782, + "speed": 30, + "timestamp": "2026-05-22T07:30:00Z" + }, + { + "positionId": 8, + "lat": 20.5111, + "lng": -100.9037, + "speed": 42, + "timestamp": "2026-05-22T07:52:00Z" + } + ] + }, + { + "routeId": "RUTA-08", + "name": "Suroriente - Universidad Latina", + "truckId": 108, + "status": "EN_RUTA", + "positions": [ + { + "positionId": 1, + "lat": 20.5111, + "lng": -100.9037, + "speed": 0, + "timestamp": "2026-05-22T06:15:00Z" + }, + { + "positionId": 2, + "lat": 20.518, + "lng": -100.831, + "speed": 38, + "timestamp": "2026-05-22T06:28:00Z" + }, + { + "positionId": 3, + "lat": 20.5245, + "lng": -100.798, + "speed": 30, + "timestamp": "2026-05-22T06:42:00Z" + }, + { + "positionId": 4, + "lat": 20.521, + "lng": -100.7995, + "speed": 14, + "timestamp": "2026-05-22T06:55:00Z" + }, + { + "positionId": 5, + "lat": 20.5175, + "lng": -100.801, + "speed": 0, + "timestamp": "2026-05-22T07:08:00Z" + }, + { + "positionId": 6, + "lat": 20.514, + "lng": -100.803, + "speed": 18, + "timestamp": "2026-05-22T07:20:00Z" + }, + { + "positionId": 7, + "lat": 20.511, + "lng": -100.8055, + "speed": 22, + "timestamp": "2026-05-22T07:32:00Z" + }, + { + "positionId": 8, + "lat": 20.5111, + "lng": -100.9037, + "speed": 40, + "timestamp": "2026-05-22T07:54:00Z" + } + ] + }, + { + "routeId": "RUTA-09", + "name": "Poniente - Hospital General", + "truckId": 109, + "status": "EN_RUTA", + "positions": [ + { + "positionId": 1, + "lat": 20.5111, + "lng": -100.9037, + "speed": 0, + "timestamp": "2026-05-22T06:02:00Z" + }, + { + "positionId": 2, + "lat": 20.521, + "lng": -100.865, + "speed": 45, + "timestamp": "2026-05-22T06:12:00Z" + }, + { + "positionId": 3, + "lat": 20.526, + "lng": -100.852, + "speed": 26, + "timestamp": "2026-05-22T06:24:00Z" + }, + { + "positionId": 4, + "lat": 20.5275, + "lng": -100.849, + "speed": 12, + "timestamp": "2026-05-22T06:36:00Z" + }, + { + "positionId": 5, + "lat": 20.5285, + "lng": -100.846, + "speed": 0, + "timestamp": "2026-05-22T06:48:00Z" + }, + { + "positionId": 6, + "lat": 20.525, + "lng": -100.847, + "speed": 15, + "timestamp": "2026-05-22T07:00:00Z" + }, + { + "positionId": 7, + "lat": 20.522, + "lng": -100.855, + "speed": 32, + "timestamp": "2026-05-22T07:12:00Z" + }, + { + "positionId": 8, + "lat": 20.5111, + "lng": -100.9037, + "speed": 44, + "timestamp": "2026-05-22T07:30:00Z" + } + ] + }, + { + "routeId": "RUTA-10", + "name": "Eje Juan Pablo II - Sede UG Sur", + "truckId": 110, + "status": "EN_RUTA", + "positions": [ + { + "positionId": 1, + "lat": 20.5111, + "lng": -100.9037, + "speed": 0, + "timestamp": "2026-05-22T06:22:00Z" + }, + { + "positionId": 2, + "lat": 20.5015, + "lng": -100.852, + "speed": 40, + "timestamp": "2026-05-22T06:34:00Z" + }, + { + "positionId": 3, + "lat": 20.499, + "lng": -100.839, + "speed": 28, + "timestamp": "2026-05-22T06:46:00Z" + }, + { + "positionId": 4, + "lat": 20.495, + "lng": -100.832, + "speed": 18, + "timestamp": "2026-05-22T06:58:00Z" + }, + { + "positionId": 5, + "lat": 20.492, + "lng": -100.828, + "speed": 0, + "timestamp": "2026-05-22T07:10:00Z" + }, + { + "positionId": 6, + "lat": 20.4945, + "lng": -100.824, + "speed": 14, + "timestamp": "2026-05-22T07:22:00Z" + }, + { + "positionId": 7, + "lat": 20.498, + "lng": -100.83, + "speed": 30, + "timestamp": "2026-05-22T07:34:00Z" + }, + { + "positionId": 8, + "lat": 20.5111, + "lng": -100.9037, + "speed": 38, + "timestamp": "2026-05-22T07:52:00Z" + } + ] + }, + { + "routeId": "RUTA-11", + "name": "Zona de Oro - Torres Landa", + "truckId": 111, + "status": "EN_RUTA", + "positions": [ + { + "positionId": 1, + "lat": 20.5111, + "lng": -100.9037, + "speed": 0, + "timestamp": "2026-05-22T06:04:00Z" + }, + { + "positionId": 2, + "lat": 20.524, + "lng": -100.835, + "speed": 36, + "timestamp": "2026-05-22T06:16:00Z" + }, + { + "positionId": 3, + "lat": 20.528, + "lng": -100.825, + "speed": 22, + "timestamp": "2026-05-22T06:29:00Z" + }, + { + "positionId": 4, + "lat": 20.5295, + "lng": -100.821, + "speed": 10, + "timestamp": "2026-05-22T06:42:00Z" + }, + { + "positionId": 5, + "lat": 20.531, + "lng": -100.817, + "speed": 0, + "timestamp": "2026-05-22T06:55:00Z" + }, + { + "positionId": 6, + "lat": 20.529, + "lng": -100.814, + "speed": 16, + "timestamp": "2026-05-22T07:08:00Z" + }, + { + "positionId": 7, + "lat": 20.526, + "lng": -100.822, + "speed": 28, + "timestamp": "2026-05-22T07:21:00Z" + }, + { + "positionId": 8, + "lat": 20.5111, + "lng": -100.9037, + "speed": 42, + "timestamp": "2026-05-22T07:42:00Z" + } + ] + }, + { + "routeId": "RUTA-12", + "name": "Nororiente - Las Insurgentes", + "truckId": 112, + "status": "EN_RUTA", + "positions": [ + { + "positionId": 1, + "lat": 20.5111, + "lng": -100.9037, + "speed": 0, + "timestamp": "2026-05-22T06:08:00Z" + }, + { + "positionId": 2, + "lat": 20.528, + "lng": -100.808, + "speed": 40, + "timestamp": "2026-05-22T06:22:00Z" + }, + { + "positionId": 3, + "lat": 20.532, + "lng": -100.798, + "speed": 24, + "timestamp": "2026-05-22T06:35:00Z" + }, + { + "positionId": 4, + "lat": 20.534, + "lng": -100.794, + "speed": 15, + "timestamp": "2026-05-22T06:48:00Z" + }, + { + "positionId": 5, + "lat": 20.536, + "lng": -100.79, + "speed": 0, + "timestamp": "2026-05-22T07:00:00Z" + }, + { + "positionId": 6, + "lat": 20.531, + "lng": -100.792, + "speed": 12, + "timestamp": "2026-05-22T07:12:00Z" + }, + { + "positionId": 7, + "lat": 20.527, + "lng": -100.802, + "speed": 26, + "timestamp": "2026-05-22T07:25:00Z" + }, + { + "positionId": 8, + "lat": 20.5111, + "lng": -100.9037, + "speed": 44, + "timestamp": "2026-05-22T07:48:00Z" + } + ] + }, + { + "routeId": "RUTA-13", + "name": "Sector Norte - Trojes e Irrigación", + "truckId": 113, + "status": "EN_RUTA", + "positions": [ + { + "positionId": 1, + "lat": 20.5111, + "lng": -100.9037, + "speed": 0, + "timestamp": "2026-05-22T06:12:00Z" + }, + { + "positionId": 2, + "lat": 20.536, + "lng": -100.819, + "speed": 35, + "timestamp": "2026-05-22T06:26:00Z" + }, + { + "positionId": 3, + "lat": 20.542, + "lng": -100.808, + "speed": 28, + "timestamp": "2026-05-22T06:40:00Z" + }, + { + "positionId": 4, + "lat": 20.544, + "lng": -100.804, + "speed": 14, + "timestamp": "2026-05-22T06:54:00Z" + }, + { + "positionId": 5, + "lat": 20.546, + "lng": -100.8, + "speed": 0, + "timestamp": "2026-05-22T07:06:00Z" + }, + { + "positionId": 6, + "lat": 20.541, + "lng": -100.802, + "speed": 18, + "timestamp": "2026-05-22T07:18:00Z" + }, + { + "positionId": 7, + "lat": 20.537, + "lng": -100.812, + "speed": 25, + "timestamp": "2026-05-22T07:30:00Z" + }, + { + "positionId": 8, + "lat": 20.5111, + "lng": -100.9037, + "speed": 39, + "timestamp": "2026-05-22T07:54:00Z" + } + ] + }, + { + "routeId": "RUTA-14", + "name": "Sur Poniente - La Toscana", + "truckId": 114, + "status": "EN_RUTA", + "positions": [ + { + "positionId": 1, + "lat": 20.5111, + "lng": -100.9037, + "speed": 0, + "timestamp": "2026-05-22T06:16:00Z" + }, + { + "positionId": 2, + "lat": 20.515, + "lng": -100.858, + "speed": 42, + "timestamp": "2026-05-22T06:28:00Z" + }, + { + "positionId": 3, + "lat": 20.514, + "lng": -100.839, + "speed": 26, + "timestamp": "2026-05-22T06:41:00Z" + }, + { + "positionId": 4, + "lat": 20.5125, + "lng": -100.831, + "speed": 16, + "timestamp": "2026-05-22T06:54:00Z" + }, + { + "positionId": 5, + "lat": 20.511, + "lng": -100.825, + "speed": 0, + "timestamp": "2026-05-22T07:06:00Z" + }, + { + "positionId": 6, + "lat": 20.5135, + "lng": -100.828, + "speed": 12, + "timestamp": "2026-05-22T07:18:00Z" + }, + { + "positionId": 7, + "lat": 20.516, + "lng": -100.842, + "speed": 32, + "timestamp": "2026-05-22T07:30:00Z" + }, + { + "positionId": 8, + "lat": 20.5111, + "lng": -100.9037, + "speed": 45, + "timestamp": "2026-05-22T07:51:00Z" + } + ] + }, + { + "routeId": "RUTA-15", + "name": "Norponiente - Camino a San José de Celaya", + "truckId": 115, + "status": "EN_RUTA", + "positions": [ + { + "positionId": 1, + "lat": 20.5111, + "lng": -100.9037, + "speed": 0, + "timestamp": "2026-05-22T06:18:00Z" + }, + { + "positionId": 2, + "lat": 20.532, + "lng": -100.859, + "speed": 38, + "timestamp": "2026-05-22T06:31:00Z" + }, + { + "positionId": 3, + "lat": 20.539, + "lng": -100.848, + "speed": 24, + "timestamp": "2026-05-22T06:44:00Z" + }, + { + "positionId": 4, + "lat": 20.542, + "lng": -100.844, + "speed": 15, + "timestamp": "2026-05-22T06:57:00Z" + }, + { + "positionId": 5, + "lat": 20.545, + "lng": -100.841, + "speed": 0, + "timestamp": "2026-05-22T07:09:00Z" + }, + { + "positionId": 6, + "lat": 20.541, + "lng": -100.843, + "speed": 14, + "timestamp": "2026-05-22T07:21:00Z" + }, + { + "positionId": 7, + "lat": 20.536, + "lng": -100.852, + "speed": 28, + "timestamp": "2026-05-22T07:33:00Z" + }, + { + "positionId": 8, + "lat": 20.5111, + "lng": -100.9037, + "speed": 41, + "timestamp": "2026-05-22T07:54:00Z" + } + ] + } +] \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..bb70f7c --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,27 @@ +services: + postgres: + image: postgis/postgis:16-3.4 + container_name: recoleccion-pg + restart: unless-stopped + environment: + POSTGRES_USER: recoleccion + POSTGRES_PASSWORD: recoleccion123 + POSTGRES_DB: recoleccion_db + ports: + - "5433:5432" + volumes: + - pgdata:/var/lib/postgresql/data + - ./init:/docker-entrypoint-initdb.d + + redis: + image: redis:7-alpine + container_name: recoleccion-redis + restart: unless-stopped + ports: + - "6380:6379" + volumes: + - redisdata:/data + +volumes: + pgdata: + redisdata: diff --git a/env b/env new file mode 100644 index 0000000..0636222 --- /dev/null +++ b/env @@ -0,0 +1,9 @@ +DB_HOST=localhost +DB_PORT=5433 +DB_NAME=recoleccion_db +DB_USER=recoleccion +DB_PASSWORD=recoleccion123 +REDIS_HOST=localhost +REDIS_PORT=6380 +JWT_SECRET=hackathon_celaya_2026_secret_key +JWT_EXPIRES_IN=7d diff --git a/env.example b/env.example new file mode 100644 index 0000000..9995cec --- /dev/null +++ b/env.example @@ -0,0 +1,9 @@ +DB_HOST=localhost +DB_PORT=5433 +DB_NAME=recoleccion_db +DB_USER=recoleccion +DB_PASSWORD=recoleccion123 +REDIS_HOST=localhost +REDIS_PORT=6380 +JWT_SECRET=cambia_esto_por_algo_seguro +JWT_EXPIRES_IN=7d diff --git a/init/01_schema.sql b/init/01_schema.sql new file mode 100644 index 0000000..451bf07 --- /dev/null +++ b/init/01_schema.sql @@ -0,0 +1,192 @@ +-- ================================================================ +-- SCHEMA - App Recolección Inteligente · Hackathon Celaya 2026 +-- ================================================================ + +CREATE EXTENSION IF NOT EXISTS postgis; +CREATE EXTENSION IF NOT EXISTS pgcrypto; + +-- ---------------------------------------------------------------- +-- 1. USERS +-- ---------------------------------------------------------------- +CREATE TABLE users ( + id UUID PRIMARY KEY DEFAULT gen_random_uuid(), + email VARCHAR(255) UNIQUE, + phone VARCHAR(20) UNIQUE, + password_hash VARCHAR(255) NOT NULL, + fcm_token VARCHAR(500), + rol VARCHAR(20) NOT NULL DEFAULT 'ciudadano', + activo BOOLEAN NOT NULL DEFAULT TRUE, + created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(), + updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW(), + CONSTRAINT chk_contacto CHECK (email IS NOT NULL OR phone IS NOT NULL) +); + +-- ---------------------------------------------------------------- +-- 2. RUTAS +-- ---------------------------------------------------------------- +CREATE TABLE rutas ( + id SERIAL PRIMARY KEY, + route_id VARCHAR(20) NOT NULL UNIQUE, + nombre VARCHAR(255) NOT NULL, + truck_id SMALLINT NOT NULL, + hora_inicio TIME NOT NULL, + hora_fin_ref TIME NOT NULL, + activa BOOLEAN NOT NULL DEFAULT TRUE, + created_at TIMESTAMPTZ NOT NULL DEFAULT NOW() +); + +-- ---------------------------------------------------------------- +-- 3. RUTA_POSICIONES +-- ---------------------------------------------------------------- +CREATE TABLE ruta_posiciones ( + id BIGSERIAL PRIMARY KEY, + ruta_id INT NOT NULL REFERENCES rutas(id) ON DELETE CASCADE, + position_id SMALLINT NOT NULL, + lat DECIMAL(9,6) NOT NULL, + lng DECIMAL(9,6) NOT NULL, + speed_kmh SMALLINT NOT NULL DEFAULT 0, + ts_referencia TIMESTAMPTZ NOT NULL, + offset_seg INT NOT NULL DEFAULT 0, + punto GEOGRAPHY(POINT, 4326) NOT NULL, + CONSTRAINT uq_ruta_posicion UNIQUE (ruta_id, position_id) +); + +CREATE INDEX idx_ruta_pos_ruta ON ruta_posiciones (ruta_id, position_id); +CREATE INDEX idx_ruta_pos_punto ON ruta_posiciones USING GIST (punto); + +-- ---------------------------------------------------------------- +-- 4. COLONIAS +-- ---------------------------------------------------------------- +CREATE TABLE colonias ( + id SERIAL PRIMARY KEY, + nombre VARCHAR(255) NOT NULL UNIQUE, + ruta_id INT NOT NULL REFERENCES rutas(id), + horario_turno VARCHAR(20) NOT NULL, + hora_inicio_est TIME NOT NULL, + hora_fin_est TIME NOT NULL, + poligono GEOGRAPHY(POLYGON, 4326), + created_at TIMESTAMPTZ NOT NULL DEFAULT NOW() +); + +CREATE INDEX idx_colonias_ruta ON colonias (ruta_id); +CREATE INDEX idx_colonias_pol ON colonias USING GIST (poligono) WHERE poligono IS NOT NULL; + +-- ---------------------------------------------------------------- +-- 5. DOMICILIOS +-- ---------------------------------------------------------------- +CREATE TABLE domicilios ( + id UUID PRIMARY KEY DEFAULT gen_random_uuid(), + user_id UUID NOT NULL REFERENCES users(id) ON DELETE CASCADE, + alias VARCHAR(50) NOT NULL, + direccion_texto TEXT NOT NULL, + lat DECIMAL(9,6) NOT NULL, + lng DECIMAL(9,6) NOT NULL, + coordenada GEOGRAPHY(POINT, 4326) NOT NULL, + colonia_id INT REFERENCES colonias(id) ON DELETE SET NULL, + validado BOOLEAN NOT NULL DEFAULT FALSE, + created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(), + CONSTRAINT uq_domicilio_alias UNIQUE (user_id, alias) +); + +CREATE INDEX idx_domicilios_user ON domicilios (user_id); +CREATE INDEX idx_domicilios_col ON domicilios (colonia_id); +CREATE INDEX idx_domicilios_coord ON domicilios USING GIST (coordenada); + +-- ---------------------------------------------------------------- +-- 6. ESTADO_RUTA (actualizado por el simulador/cron) +-- ---------------------------------------------------------------- +CREATE TABLE estado_ruta ( + ruta_id INT PRIMARY KEY REFERENCES rutas(id) ON DELETE CASCADE, + estado VARCHAR(20) NOT NULL DEFAULT 'INACTIVA', + position_id_actual SMALLINT NOT NULL DEFAULT 1, + lat_actual DECIMAL(9,6), + lng_actual DECIMAL(9,6), + hora_real_inicio TIMESTAMPTZ, + hora_estim_fin TIMESTAMPTZ, + minutos_retraso SMALLINT NOT NULL DEFAULT 0, + motivo_retraso TEXT, + actualizado_at TIMESTAMPTZ NOT NULL DEFAULT NOW() +); + +-- ---------------------------------------------------------------- +-- 7. NOTIFICACION_TEMPLATES +-- ---------------------------------------------------------------- +CREATE TABLE notificacion_templates ( + id SERIAL PRIMARY KEY, + trigger_event VARCHAR(30) NOT NULL UNIQUE, + position_id_trigger SMALLINT NOT NULL, + titulo VARCHAR(150) NOT NULL, + cuerpo TEXT NOT NULL, + activo BOOLEAN NOT NULL DEFAULT TRUE, + created_at TIMESTAMPTZ NOT NULL DEFAULT NOW() +); + +-- ---------------------------------------------------------------- +-- 8. NOTIFICACIONES +-- ---------------------------------------------------------------- +CREATE TABLE notificaciones ( + id UUID PRIMARY KEY DEFAULT gen_random_uuid(), + user_id UUID NOT NULL REFERENCES users(id) ON DELETE CASCADE, + domicilio_id UUID REFERENCES domicilios(id) ON DELETE SET NULL, + template_id INT REFERENCES notificacion_templates(id), + ruta_id INT REFERENCES rutas(id), + titulo VARCHAR(150) NOT NULL, + mensaje TEXT NOT NULL, + enviada_at TIMESTAMPTZ NOT NULL DEFAULT NOW(), + leida BOOLEAN NOT NULL DEFAULT FALSE, + leida_at TIMESTAMPTZ +); + +CREATE INDEX idx_notif_user ON notificaciones (user_id, enviada_at DESC); +CREATE INDEX idx_notif_no_leida ON notificaciones (user_id) WHERE leida = FALSE; + +-- ---------------------------------------------------------------- +-- 9. REPORTES +-- ---------------------------------------------------------------- +CREATE TABLE reportes ( + id UUID PRIMARY KEY DEFAULT gen_random_uuid(), + user_id UUID NOT NULL REFERENCES users(id) ON DELETE CASCADE, + domicilio_id UUID REFERENCES domicilios(id) ON DELETE SET NULL, + ruta_id INT REFERENCES rutas(id), + tipo VARCHAR(40) NOT NULL, + descripcion TEXT, + calificacion SMALLINT CHECK (calificacion BETWEEN 1 AND 5), + estado VARCHAR(20) NOT NULL DEFAULT 'abierto', + creado_at TIMESTAMPTZ NOT NULL DEFAULT NOW() +); + +CREATE INDEX idx_reportes_user ON reportes (user_id); +CREATE INDEX idx_reportes_ruta ON reportes (ruta_id, creado_at); + +-- ---------------------------------------------------------------- +-- 10. GUÍA DE SEPARACIÓN +-- ---------------------------------------------------------------- +CREATE TABLE residuos_categorias ( + id SERIAL PRIMARY KEY, + nombre VARCHAR(50) NOT NULL, + descripcion TEXT, + color_hex CHAR(7), + icono VARCHAR(100) +); + +CREATE TABLE residuos_ejemplos ( + id SERIAL PRIMARY KEY, + categoria_id INT NOT NULL REFERENCES residuos_categorias(id) ON DELETE CASCADE, + nombre VARCHAR(255) NOT NULL, + descripcion TEXT +); + +-- ---------------------------------------------------------------- +-- TRIGGERS +-- ---------------------------------------------------------------- +CREATE OR REPLACE FUNCTION fn_set_updated_at() +RETURNS TRIGGER LANGUAGE plpgsql AS $$ +BEGIN + NEW.updated_at = NOW(); + RETURN NEW; +END; +$$; + +CREATE TRIGGER trg_users_updated_at + BEFORE UPDATE ON users + FOR EACH ROW EXECUTE FUNCTION fn_set_updated_at(); diff --git a/init/02_seed_static.sql b/init/02_seed_static.sql new file mode 100644 index 0000000..3409402 --- /dev/null +++ b/init/02_seed_static.sql @@ -0,0 +1,49 @@ +-- ================================================================ +-- SEED ESTÁTICO - Templates de notificaciones y Guía de residuos +-- ================================================================ + +INSERT INTO notificacion_templates (trigger_event, position_id_trigger, titulo, cuerpo) +VALUES +( + 'ROUTE_START', 2, + '¡Ruta Iniciada!', + 'El camión recolector ha salido del Relleno Sanitario rumbo a tu sector. Asegúrate de tener listos tus residuos.' +), +( + 'TRUCK_PROXIMITY', 4, + 'Camión Cercano', + 'El camión está a menos de 15 minutos de tu domicilio. Es momento de sacar tus bolsas a la acera.' +), +( + 'ROUTE_COMPLETED', 8, + 'Servicio Finalizado', + 'El camión de tu sector ha concluido su jornada de recolección diaria.' +); + +INSERT INTO residuos_categorias (nombre, descripcion, color_hex, icono) VALUES +('Orgánicos', 'Residuos de origen natural que se descomponen', '#4CAF50', 'leaf'), +('Reciclables', 'Materiales que pueden recuperarse y reutilizarse', '#2196F3', 'recycle'), +('Sanitarios', 'Residuos que implican riesgo de contagio o contaminación', '#F44336', 'biohazard'), +('Especiales', 'Residuos que requieren manejo diferenciado', '#FF9800', 'warning'); + +INSERT INTO residuos_ejemplos (categoria_id, nombre, descripcion) VALUES +(1, 'Cáscaras de frutas y verduras', 'Restos de cocina de origen vegetal'), +(1, 'Sobras de comida', 'Alimentos preparados ya no consumibles'), +(1, 'Posos de café y filtros', 'Biodegradables, ideales para composta'), +(1, 'Cáscaras de huevo', 'Se descomponen lentamente, aptas para composta'), +(1, 'Servilletas y papel sucios', 'Con grasa o alimentos, van con orgánicos'), +(2, 'Botellas y envases PET', 'Plástico transparente, enjuagados'), +(2, 'Latas de aluminio y hojalata', 'Limpias y aplastadas para ahorrar espacio'), +(2, 'Cartón y papel limpio', 'Sin grasa ni humedad'), +(2, 'Vidrio', 'Botellas y frascos; NO vidrio de ventana'), +(2, 'Envases Tetra Pak', 'Enjuagar y aplastar antes de depositar'), +(3, 'Pañales desechables', 'Van en bolsa cerrada'), +(3, 'Toallas sanitarias y tampones', 'Bolsa sellada por higiene'), +(3, 'Papel higiénico usado', 'No es reciclable'), +(3, 'Gasas y vendas usadas', 'Materiales con sangre u otros fluidos'), +(3, 'Cubrebocas y guantes usados', 'Doble bolsa por precaución'), +(4, 'Pilas y baterías', 'Llevar a puntos RAEE o tiendas participantes'), +(4, 'Medicamentos caducos', 'Farmacias con programa de devolución'), +(4, 'Aceite vegetal usado', 'Envasar en botella; NO tirar por el drenaje'), +(4, 'Electrónicos y cables', 'Puntos de reciclaje RAEE'), +(4, 'Pinturas y solventes', 'Centro de acopio municipal; nunca al bote normal'); diff --git a/init/03_seed_json.js b/init/03_seed_json.js new file mode 100644 index 0000000..df2dc31 --- /dev/null +++ b/init/03_seed_json.js @@ -0,0 +1,146 @@ +/** + * SEED JSON - App Recolección Inteligente + * Uso: npm run seed + */ + +require('dotenv').config(); +const { Pool } = require('pg'); +const fs = require('fs'); +const path = require('path'); + +const pool = new Pool({ + host: process.env.DB_HOST || 'localhost', + port: parseInt(process.env.DB_PORT || '5433'), + database: process.env.DB_NAME || 'recoleccion_db', + user: process.env.DB_USER || 'recoleccion', + password: process.env.DB_PASSWORD || 'recoleccion123', +}); + +function readJson(filename) { + const filepath = path.join(__dirname, '..', 'data', filename); + return JSON.parse(fs.readFileSync(filepath, 'utf-8')); +} + +function parseHorario(str) { + const match = str.match(/^(\w+)\s*\((\d{2}:\d{2})\s*-\s*(\d{2}:\d{2})\)/); + if (!match) throw new Error(`Horario no reconocido: "${str}"`); + return { turno: match[1], inicio: match[2], fin: match[3] }; +} + +async function seed() { + const client = await pool.connect(); + + try { + await client.query('BEGIN'); + + const rutas = readJson('rutas.json'); + const colonias = readJson('colonias-rutas.json'); + + console.log(`\n📦 Sembrando ${rutas.length} rutas...`); + + for (const ruta of rutas) { + const pos1 = ruta.positions.find(p => p.positionId === 1); + const pos8 = ruta.positions.find(p => p.positionId === 8); + + const horaInicio = new Date(pos1.timestamp).toISOString().substring(11, 16); + const horaFin = new Date(pos8.timestamp).toISOString().substring(11, 16); + + // ── Insertar ruta ────────────────────────────────────── + const { rows: [rutaRow] } = await client.query( + `INSERT INTO rutas (route_id, nombre, truck_id, hora_inicio, hora_fin_ref) + VALUES ($1, $2, $3, $4::TIME, $5::TIME) + ON CONFLICT (route_id) DO UPDATE + SET nombre = EXCLUDED.nombre, + truck_id = EXCLUDED.truck_id, + hora_inicio = EXCLUDED.hora_inicio, + hora_fin_ref = EXCLUDED.hora_fin_ref + RETURNING id`, + [ruta.routeId, ruta.name, ruta.truckId, horaInicio, horaFin] + ); + const rutaId = rutaRow.id; + + // ── Estado inicial ───────────────────────────────────── + await client.query( + `INSERT INTO estado_ruta (ruta_id, estado, position_id_actual) + VALUES ($1, 'INACTIVA', 1) + ON CONFLICT (ruta_id) DO NOTHING`, + [rutaId] + ); + + // ── Posiciones ───────────────────────────────────────── + const tsBase = new Date(pos1.timestamp).getTime(); + + for (const pos of ruta.positions) { + const offsetSeg = Math.round((new Date(pos.timestamp).getTime() - tsBase) / 1000); + + // IMPORTANTE: punto va al final ($8) para que los parámetros + // sean estrictamente secuenciales $1..$8 sin saltos + const wkt = `SRID=4326;POINT(${pos.lng} ${pos.lat})`; + + await client.query( + `INSERT INTO ruta_posiciones + (ruta_id, position_id, lat, lng, speed_kmh, ts_referencia, offset_seg, punto) + VALUES + ($1, $2, $3, $4, $5, $6::timestamptz,$7, $8::geography) + ON CONFLICT (ruta_id, position_id) DO UPDATE + SET lat = EXCLUDED.lat, + lng = EXCLUDED.lng, + speed_kmh = EXCLUDED.speed_kmh, + ts_referencia = EXCLUDED.ts_referencia, + offset_seg = EXCLUDED.offset_seg, + punto = EXCLUDED.punto`, + [rutaId, pos.positionId, pos.lat, pos.lng, + pos.speed, pos.timestamp, offsetSeg, wkt] + ); + } + + console.log(` ✓ ${ruta.routeId} — ${ruta.name}`); + } + + // ── Colonias ─────────────────────────────────────────────── + console.log(`\n🗺️ Sembrando ${colonias.length} colonias...`); + + for (const col of colonias) { + const { rows: [rutaRow] } = await client.query( + 'SELECT id FROM rutas WHERE route_id = $1', + [col.routeId] + ); + + if (!rutaRow) { + console.warn(` ⚠️ ${col.routeId} no encontrada para "${col.colonia}". Omitida.`); + continue; + } + + const h = parseHorario(col.horarioEstimado); + + await client.query( + `INSERT INTO colonias (nombre, ruta_id, horario_turno, hora_inicio_est, hora_fin_est) + VALUES ($1, $2, $3, $4::TIME, $5::TIME) + ON CONFLICT (nombre) DO UPDATE + SET ruta_id = EXCLUDED.ruta_id, + horario_turno = EXCLUDED.horario_turno, + hora_inicio_est = EXCLUDED.hora_inicio_est, + hora_fin_est = EXCLUDED.hora_fin_est`, + [col.colonia, rutaRow.id, h.turno, h.inicio, h.fin] + ); + + console.log(` ✓ ${col.colonia} → ${col.routeId} (${h.turno} ${h.inicio}-${h.fin})`); + } + + await client.query('COMMIT'); + console.log('\n✅ Seed completado exitosamente.\n'); + + } catch (err) { + await client.query('ROLLBACK'); + console.error('\n❌ Error en el seed, se hizo ROLLBACK:', err.message); + throw err; + } finally { + client.release(); + await pool.end(); + } +} + +seed().catch((err) => { + console.error('💥 Error fatal:', err.message); + process.exit(1); +}); diff --git a/node_modules/.package-lock.json b/node_modules/.package-lock.json new file mode 100644 index 0000000..ecb2811 --- /dev/null +++ b/node_modules/.package-lock.json @@ -0,0 +1,166 @@ +{ + "name": "recoleccion-db", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "node_modules/dotenv": { + "version": "16.6.1", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.6.1.tgz", + "integrity": "sha512-uBq4egWHTcTt33a72vpSG0z3HnPuIl6NqYcTrKEg2azoEyl2hpW0zqlxysq2pK9HlDIHyHyakeYaYnSAwd8bow==", + "license": "BSD-2-Clause", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://dotenvx.com" + } + }, + "node_modules/pg": { + "version": "8.21.0", + "resolved": "https://registry.npmjs.org/pg/-/pg-8.21.0.tgz", + "integrity": "sha512-AUP1EYJuHraQGsVoCQVIcM7TEJVGtDzxWtGFZd8rds9d+CCXlU5Js1rYgfLNvxy9iJrpHjGrRjoi/3BT9fRyiA==", + "license": "MIT", + "dependencies": { + "pg-connection-string": "^2.13.0", + "pg-pool": "^3.14.0", + "pg-protocol": "^1.14.0", + "pg-types": "2.2.0", + "pgpass": "1.0.5" + }, + "engines": { + "node": ">= 16.0.0" + }, + "optionalDependencies": { + "pg-cloudflare": "^1.4.0" + }, + "peerDependencies": { + "pg-native": ">=3.0.1" + }, + "peerDependenciesMeta": { + "pg-native": { + "optional": true + } + } + }, + "node_modules/pg-cloudflare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/pg-cloudflare/-/pg-cloudflare-1.4.0.tgz", + "integrity": "sha512-Vo7z/6rrQYxpNRylp4Tlob2elzbh+N/MOQbxFVWCxS7oEx6jF53GTJFxK2WWpKuBRkmiin4Mt+xofFDjx09R0A==", + "license": "MIT", + "optional": true + }, + "node_modules/pg-connection-string": { + "version": "2.13.0", + "resolved": "https://registry.npmjs.org/pg-connection-string/-/pg-connection-string-2.13.0.tgz", + "integrity": "sha512-EMnU9E2fSULdsbErBbMaXJvFeD9B4+nPcM3f+4lsiCR0BHLPrLVjv3DbyM2hgQQviKJaTWIRRTjKjWlHg3p2ig==", + "license": "MIT" + }, + "node_modules/pg-int8": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/pg-int8/-/pg-int8-1.0.1.tgz", + "integrity": "sha512-WCtabS6t3c8SkpDBUlb1kjOs7l66xsGdKpIPZsg4wR+B3+u9UAum2odSsF9tnvxg80h4ZxLWMy4pRjOsFIqQpw==", + "license": "ISC", + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/pg-pool": { + "version": "3.14.0", + "resolved": "https://registry.npmjs.org/pg-pool/-/pg-pool-3.14.0.tgz", + "integrity": "sha512-gKtPkFdQPU3DksooVLi9LsjZxrsBUZIpa+7aVx+LV5pNh0KzP4Zleud2po+ConrxbuXGBJ6Hfer6hdgpIBpBaw==", + "license": "MIT", + "peerDependencies": { + "pg": ">=8.0" + } + }, + "node_modules/pg-protocol": { + "version": "1.14.0", + "resolved": "https://registry.npmjs.org/pg-protocol/-/pg-protocol-1.14.0.tgz", + "integrity": "sha512-n5taZ1kO3s9ngDTVxsEznOqCyToTgz0FLuPq0B33COy5pPpuWJpY3/2oRBVETuOgzdqRXfWpM9HIhp2LBBT1BA==", + "license": "MIT" + }, + "node_modules/pg-types": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/pg-types/-/pg-types-2.2.0.tgz", + "integrity": "sha512-qTAAlrEsl8s4OiEQY69wDvcMIdQN6wdz5ojQiOy6YRMuynxenON0O5oCpJI6lshc6scgAY8qvJ2On/p+CXY0GA==", + "license": "MIT", + "dependencies": { + "pg-int8": "1.0.1", + "postgres-array": "~2.0.0", + "postgres-bytea": "~1.0.0", + "postgres-date": "~1.0.4", + "postgres-interval": "^1.1.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/pgpass": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/pgpass/-/pgpass-1.0.5.tgz", + "integrity": "sha512-FdW9r/jQZhSeohs1Z3sI1yxFQNFvMcnmfuj4WBMUTxOrAyLMaTcE1aAMBiTlbMNaXvBCQuVi0R7hd8udDSP7ug==", + "license": "MIT", + "dependencies": { + "split2": "^4.1.0" + } + }, + "node_modules/postgres-array": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/postgres-array/-/postgres-array-2.0.0.tgz", + "integrity": "sha512-VpZrUqU5A69eQyW2c5CA1jtLecCsN2U/bD6VilrFDWq5+5UIEVO7nazS3TEcHf1zuPYO/sqGvUvW62g86RXZuA==", + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/postgres-bytea": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/postgres-bytea/-/postgres-bytea-1.0.1.tgz", + "integrity": "sha512-5+5HqXnsZPE65IJZSMkZtURARZelel2oXUEO8rH83VS/hxH5vv1uHquPg5wZs8yMAfdv971IU+kcPUczi7NVBQ==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/postgres-date": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/postgres-date/-/postgres-date-1.0.7.tgz", + "integrity": "sha512-suDmjLVQg78nMK2UZ454hAG+OAW+HQPZ6n++TNDUX+L0+uUlLywnoxJKDou51Zm+zTCjrCl0Nq6J9C5hP9vK/Q==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/postgres-interval": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/postgres-interval/-/postgres-interval-1.2.0.tgz", + "integrity": "sha512-9ZhXKM/rw350N1ovuWHbGxnGh/SNJ4cnxHiM0rxE4VN41wsg8P8zWn9hv/buK00RP4WvlOyr/RBDiptyxVbkZQ==", + "license": "MIT", + "dependencies": { + "xtend": "^4.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/split2": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/split2/-/split2-4.2.0.tgz", + "integrity": "sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg==", + "license": "ISC", + "engines": { + "node": ">= 10.x" + } + }, + "node_modules/xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", + "license": "MIT", + "engines": { + "node": ">=0.4" + } + } + } +} diff --git a/node_modules/dotenv/CHANGELOG.md b/node_modules/dotenv/CHANGELOG.md new file mode 100644 index 0000000..8b80dd6 --- /dev/null +++ b/node_modules/dotenv/CHANGELOG.md @@ -0,0 +1,520 @@ +# Changelog + +All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. + +## [Unreleased](https://github.com/motdotla/dotenv/compare/v16.6.1...master) + +## [16.6.1](https://github.com/motdotla/dotenv/compare/v16.6.0...v16.6.1) (2025-06-27) + +### Changed + +- Default `quiet` to true – hiding the runtime log message ([#874](https://github.com/motdotla/dotenv/pull/874)) +- NOTICE: 17.0.0 will be released with quiet defaulting to false. Use `config({ quiet: true })` to suppress. +- And check out the new [dotenvx](https://github.com/dotenvx/dotenvx). As coding workflows evolve and agents increasingly handle secrets, encrypted .env files offer a much safer way to deploy both agents and code together with secure secrets. Simply switch `require('dotenv').config()` for `require('@dotenvx/dotenvx').config()`. + +## [16.6.0](https://github.com/motdotla/dotenv/compare/v16.5.0...v16.6.0) (2025-06-26) + +### Added + +- Default log helpful message `[dotenv@16.6.0] injecting env (1) from .env` ([#870](https://github.com/motdotla/dotenv/pull/870)) +- Use `{ quiet: true }` to suppress +- Aligns dotenv more closely with [dotenvx](https://github.com/dotenvx/dotenvx). + +## [16.5.0](https://github.com/motdotla/dotenv/compare/v16.4.7...v16.5.0) (2025-04-07) + +### Added + +- 🎉 Added new sponsor [Graphite](https://graphite.dev/?utm_source=github&utm_medium=repo&utm_campaign=dotenv) - *the AI developer productivity platform helping teams on GitHub ship higher quality software, faster*. + +> [!TIP] +> **[Become a sponsor](https://github.com/sponsors/motdotla)** +> +> The dotenvx README is viewed thousands of times DAILY on GitHub and NPM. +> Sponsoring dotenv is a great way to get in front of developers and give back to the developer community at the same time. + +### Changed + +- Remove `_log` method. Use `_debug` [#862](https://github.com/motdotla/dotenv/pull/862) + +## [16.4.7](https://github.com/motdotla/dotenv/compare/v16.4.6...v16.4.7) (2024-12-03) + +### Changed + +- Ignore `.tap` folder when publishing. (oops, sorry about that everyone. - @motdotla) [#848](https://github.com/motdotla/dotenv/pull/848) + +## [16.4.6](https://github.com/motdotla/dotenv/compare/v16.4.5...v16.4.6) (2024-12-02) + +### Changed + +- Clean up stale dev dependencies [#847](https://github.com/motdotla/dotenv/pull/847) +- Various README updates clarifying usage and alternative solutions using [dotenvx](https://github.com/dotenvx/dotenvx) + +## [16.4.5](https://github.com/motdotla/dotenv/compare/v16.4.4...v16.4.5) (2024-02-19) + +### Changed + +- 🐞 Fix recent regression when using `path` option. return to historical behavior: do not attempt to auto find `.env` if `path` set. (regression was introduced in `16.4.3`) [#814](https://github.com/motdotla/dotenv/pull/814) + +## [16.4.4](https://github.com/motdotla/dotenv/compare/v16.4.3...v16.4.4) (2024-02-13) + +### Changed + +- 🐞 Replaced chaining operator `?.` with old school `&&` (fixing node 12 failures) [#812](https://github.com/motdotla/dotenv/pull/812) + +## [16.4.3](https://github.com/motdotla/dotenv/compare/v16.4.2...v16.4.3) (2024-02-12) + +### Changed + +- Fixed processing of multiple files in `options.path` [#805](https://github.com/motdotla/dotenv/pull/805) + +## [16.4.2](https://github.com/motdotla/dotenv/compare/v16.4.1...v16.4.2) (2024-02-10) + +### Changed + +- Changed funding link in package.json to [`dotenvx.com`](https://dotenvx.com) + +## [16.4.1](https://github.com/motdotla/dotenv/compare/v16.4.0...v16.4.1) (2024-01-24) + +- Patch support for array as `path` option [#797](https://github.com/motdotla/dotenv/pull/797) + +## [16.4.0](https://github.com/motdotla/dotenv/compare/v16.3.2...v16.4.0) (2024-01-23) + +- Add `error.code` to error messages around `.env.vault` decryption handling [#795](https://github.com/motdotla/dotenv/pull/795) +- Add ability to find `.env.vault` file when filename(s) passed as an array [#784](https://github.com/motdotla/dotenv/pull/784) + +## [16.3.2](https://github.com/motdotla/dotenv/compare/v16.3.1...v16.3.2) (2024-01-18) + +### Added + +- Add debug message when no encoding set [#735](https://github.com/motdotla/dotenv/pull/735) + +### Changed + +- Fix output typing for `populate` [#792](https://github.com/motdotla/dotenv/pull/792) +- Use subarray instead of slice [#793](https://github.com/motdotla/dotenv/pull/793) + +## [16.3.1](https://github.com/motdotla/dotenv/compare/v16.3.0...v16.3.1) (2023-06-17) + +### Added + +- Add missing type definitions for `processEnv` and `DOTENV_KEY` options. [#756](https://github.com/motdotla/dotenv/pull/756) + +## [16.3.0](https://github.com/motdotla/dotenv/compare/v16.2.0...v16.3.0) (2023-06-16) + +### Added + +- Optionally pass `DOTENV_KEY` to options rather than relying on `process.env.DOTENV_KEY`. Defaults to `process.env.DOTENV_KEY` [#754](https://github.com/motdotla/dotenv/pull/754) + +## [16.2.0](https://github.com/motdotla/dotenv/compare/v16.1.4...v16.2.0) (2023-06-15) + +### Added + +- Optionally write to your own target object rather than `process.env`. Defaults to `process.env`. [#753](https://github.com/motdotla/dotenv/pull/753) +- Add import type URL to types file [#751](https://github.com/motdotla/dotenv/pull/751) + +## [16.1.4](https://github.com/motdotla/dotenv/compare/v16.1.3...v16.1.4) (2023-06-04) + +### Added + +- Added `.github/` to `.npmignore` [#747](https://github.com/motdotla/dotenv/pull/747) + +## [16.1.3](https://github.com/motdotla/dotenv/compare/v16.1.2...v16.1.3) (2023-05-31) + +### Removed + +- Removed `browser` keys for `path`, `os`, and `crypto` in package.json. These were set to false incorrectly as of 16.1. Instead, if using dotenv on the front-end make sure to include polyfills for `path`, `os`, and `crypto`. [node-polyfill-webpack-plugin](https://github.com/Richienb/node-polyfill-webpack-plugin) provides these. + +## [16.1.2](https://github.com/motdotla/dotenv/compare/v16.1.1...v16.1.2) (2023-05-31) + +### Changed + +- Exposed private function `_configDotenv` as `configDotenv`. [#744](https://github.com/motdotla/dotenv/pull/744) + +## [16.1.1](https://github.com/motdotla/dotenv/compare/v16.1.0...v16.1.1) (2023-05-30) + +### Added + +- Added type definition for `decrypt` function + +### Changed + +- Fixed `{crypto: false}` in `packageJson.browser` + +## [16.1.0](https://github.com/motdotla/dotenv/compare/v16.0.3...v16.1.0) (2023-05-30) + +### Added + +- Add `populate` convenience method [#733](https://github.com/motdotla/dotenv/pull/733) +- Accept URL as path option [#720](https://github.com/motdotla/dotenv/pull/720) +- Add dotenv to `npm fund` command +- Spanish language README [#698](https://github.com/motdotla/dotenv/pull/698) +- Add `.env.vault` support. 🎉 ([#730](https://github.com/motdotla/dotenv/pull/730)) + +ℹ️ `.env.vault` extends the `.env` file format standard with a localized encrypted vault file. Package it securely with your production code deploys. It's cloud agnostic so that you can deploy your secrets anywhere – without [risky third-party integrations](https://techcrunch.com/2023/01/05/circleci-breach/). [read more](https://github.com/motdotla/dotenv#-deploying) + +### Changed + +- Fixed "cannot resolve 'fs'" error on tools like Replit [#693](https://github.com/motdotla/dotenv/pull/693) + +## [16.0.3](https://github.com/motdotla/dotenv/compare/v16.0.2...v16.0.3) (2022-09-29) + +### Changed + +- Added library version to debug logs ([#682](https://github.com/motdotla/dotenv/pull/682)) + +## [16.0.2](https://github.com/motdotla/dotenv/compare/v16.0.1...v16.0.2) (2022-08-30) + +### Added + +- Export `env-options.js` and `cli-options.js` in package.json for use with downstream [dotenv-expand](https://github.com/motdotla/dotenv-expand) module + +## [16.0.1](https://github.com/motdotla/dotenv/compare/v16.0.0...v16.0.1) (2022-05-10) + +### Changed + +- Minor README clarifications +- Development ONLY: updated devDependencies as recommended for development only security risks ([#658](https://github.com/motdotla/dotenv/pull/658)) + +## [16.0.0](https://github.com/motdotla/dotenv/compare/v15.0.1...v16.0.0) (2022-02-02) + +### Added + +- _Breaking:_ Backtick support 🎉 ([#615](https://github.com/motdotla/dotenv/pull/615)) + +If you had values containing the backtick character, please quote those values with either single or double quotes. + +## [15.0.1](https://github.com/motdotla/dotenv/compare/v15.0.0...v15.0.1) (2022-02-02) + +### Changed + +- Properly parse empty single or double quoted values 🐞 ([#614](https://github.com/motdotla/dotenv/pull/614)) + +## [15.0.0](https://github.com/motdotla/dotenv/compare/v14.3.2...v15.0.0) (2022-01-31) + +`v15.0.0` is a major new release with some important breaking changes. + +### Added + +- _Breaking:_ Multiline parsing support (just works. no need for the flag.) + +### Changed + +- _Breaking:_ `#` marks the beginning of a comment (UNLESS the value is wrapped in quotes. Please update your `.env` files to wrap in quotes any values containing `#`. For example: `SECRET_HASH="something-with-a-#-hash"`). + +..Understandably, (as some teams have noted) this is tedious to do across the entire team. To make it less tedious, we recommend using [dotenv cli](https://github.com/dotenv-org/cli) going forward. It's an optional plugin that will keep your `.env` files in sync between machines, environments, or team members. + +### Removed + +- _Breaking:_ Remove multiline option (just works out of the box now. no need for the flag.) + +## [14.3.2](https://github.com/motdotla/dotenv/compare/v14.3.1...v14.3.2) (2022-01-25) + +### Changed + +- Preserve backwards compatibility on values containing `#` 🐞 ([#603](https://github.com/motdotla/dotenv/pull/603)) + +## [14.3.1](https://github.com/motdotla/dotenv/compare/v14.3.0...v14.3.1) (2022-01-25) + +### Changed + +- Preserve backwards compatibility on exports by re-introducing the prior in-place exports 🐞 ([#606](https://github.com/motdotla/dotenv/pull/606)) + +## [14.3.0](https://github.com/motdotla/dotenv/compare/v14.2.0...v14.3.0) (2022-01-24) + +### Added + +- Add `multiline` option 🎉 ([#486](https://github.com/motdotla/dotenv/pull/486)) + +## [14.2.0](https://github.com/motdotla/dotenv/compare/v14.1.1...v14.2.0) (2022-01-17) + +### Added + +- Add `dotenv_config_override` cli option +- Add `DOTENV_CONFIG_OVERRIDE` command line env option + +## [14.1.1](https://github.com/motdotla/dotenv/compare/v14.1.0...v14.1.1) (2022-01-17) + +### Added + +- Add React gotcha to FAQ on README + +## [14.1.0](https://github.com/motdotla/dotenv/compare/v14.0.1...v14.1.0) (2022-01-17) + +### Added + +- Add `override` option 🎉 ([#595](https://github.com/motdotla/dotenv/pull/595)) + +## [14.0.1](https://github.com/motdotla/dotenv/compare/v14.0.0...v14.0.1) (2022-01-16) + +### Added + +- Log error on failure to load `.env` file ([#594](https://github.com/motdotla/dotenv/pull/594)) + +## [14.0.0](https://github.com/motdotla/dotenv/compare/v13.0.1...v14.0.0) (2022-01-16) + +### Added + +- _Breaking:_ Support inline comments for the parser 🎉 ([#568](https://github.com/motdotla/dotenv/pull/568)) + +## [13.0.1](https://github.com/motdotla/dotenv/compare/v13.0.0...v13.0.1) (2022-01-16) + +### Changed + +* Hide comments and newlines from debug output ([#404](https://github.com/motdotla/dotenv/pull/404)) + +## [13.0.0](https://github.com/motdotla/dotenv/compare/v12.0.4...v13.0.0) (2022-01-16) + +### Added + +* _Breaking:_ Add type file for `config.js` ([#539](https://github.com/motdotla/dotenv/pull/539)) + +## [12.0.4](https://github.com/motdotla/dotenv/compare/v12.0.3...v12.0.4) (2022-01-16) + +### Changed + +* README updates +* Minor order adjustment to package json format + +## [12.0.3](https://github.com/motdotla/dotenv/compare/v12.0.2...v12.0.3) (2022-01-15) + +### Changed + +* Simplified jsdoc for consistency across editors + +## [12.0.2](https://github.com/motdotla/dotenv/compare/v12.0.1...v12.0.2) (2022-01-15) + +### Changed + +* Improve embedded jsdoc type documentation + +## [12.0.1](https://github.com/motdotla/dotenv/compare/v12.0.0...v12.0.1) (2022-01-15) + +### Changed + +* README updates and clarifications + +## [12.0.0](https://github.com/motdotla/dotenv/compare/v11.0.0...v12.0.0) (2022-01-15) + +### Removed + +- _Breaking:_ drop support for Flow static type checker ([#584](https://github.com/motdotla/dotenv/pull/584)) + +### Changed + +- Move types/index.d.ts to lib/main.d.ts ([#585](https://github.com/motdotla/dotenv/pull/585)) +- Typescript cleanup ([#587](https://github.com/motdotla/dotenv/pull/587)) +- Explicit typescript inclusion in package.json ([#566](https://github.com/motdotla/dotenv/pull/566)) + +## [11.0.0](https://github.com/motdotla/dotenv/compare/v10.0.0...v11.0.0) (2022-01-11) + +### Changed + +- _Breaking:_ drop support for Node v10 ([#558](https://github.com/motdotla/dotenv/pull/558)) +- Patch debug option ([#550](https://github.com/motdotla/dotenv/pull/550)) + +## [10.0.0](https://github.com/motdotla/dotenv/compare/v9.0.2...v10.0.0) (2021-05-20) + +### Added + +- Add generic support to parse function +- Allow for import "dotenv/config.js" +- Add support to resolve home directory in path via ~ + +## [9.0.2](https://github.com/motdotla/dotenv/compare/v9.0.1...v9.0.2) (2021-05-10) + +### Changed + +- Support windows newlines with debug mode + +## [9.0.1](https://github.com/motdotla/dotenv/compare/v9.0.0...v9.0.1) (2021-05-08) + +### Changed + +- Updates to README + +## [9.0.0](https://github.com/motdotla/dotenv/compare/v8.6.0...v9.0.0) (2021-05-05) + +### Changed + +- _Breaking:_ drop support for Node v8 + +## [8.6.0](https://github.com/motdotla/dotenv/compare/v8.5.1...v8.6.0) (2021-05-05) + +### Added + +- define package.json in exports + +## [8.5.1](https://github.com/motdotla/dotenv/compare/v8.5.0...v8.5.1) (2021-05-05) + +### Changed + +- updated dev dependencies via npm audit + +## [8.5.0](https://github.com/motdotla/dotenv/compare/v8.4.0...v8.5.0) (2021-05-05) + +### Added + +- allow for `import "dotenv/config"` + +## [8.4.0](https://github.com/motdotla/dotenv/compare/v8.3.0...v8.4.0) (2021-05-05) + +### Changed + +- point to exact types file to work with VS Code + +## [8.3.0](https://github.com/motdotla/dotenv/compare/v8.2.0...v8.3.0) (2021-05-05) + +### Changed + +- _Breaking:_ drop support for Node v8 (mistake to be released as minor bump. later bumped to 9.0.0. see above.) + +## [8.2.0](https://github.com/motdotla/dotenv/compare/v8.1.0...v8.2.0) (2019-10-16) + +### Added + +- TypeScript types + +## [8.1.0](https://github.com/motdotla/dotenv/compare/v8.0.0...v8.1.0) (2019-08-18) + +### Changed + +- _Breaking:_ drop support for Node v6 ([#392](https://github.com/motdotla/dotenv/issues/392)) + +# [8.0.0](https://github.com/motdotla/dotenv/compare/v7.0.0...v8.0.0) (2019-05-02) + +### Changed + +- _Breaking:_ drop support for Node v6 ([#302](https://github.com/motdotla/dotenv/issues/392)) + +## [7.0.0] - 2019-03-12 + +### Fixed + +- Fix removing unbalanced quotes ([#376](https://github.com/motdotla/dotenv/pull/376)) + +### Removed + +- Removed `load` alias for `config` for consistency throughout code and documentation. + +## [6.2.0] - 2018-12-03 + +### Added + +- Support preload configuration via environment variables ([#351](https://github.com/motdotla/dotenv/issues/351)) + +## [6.1.0] - 2018-10-08 + +### Added + +- `debug` option for `config` and `parse` methods will turn on logging + +## [6.0.0] - 2018-06-02 + +### Changed + +- _Breaking:_ drop support for Node v4 ([#304](https://github.com/motdotla/dotenv/pull/304)) + +## [5.0.0] - 2018-01-29 + +### Added + +- Testing against Node v8 and v9 +- Documentation on trim behavior of values +- Documentation on how to use with `import` + +### Changed + +- _Breaking_: default `path` is now `path.resolve(process.cwd(), '.env')` +- _Breaking_: does not write over keys already in `process.env` if the key has a falsy value +- using `const` and `let` instead of `var` + +### Removed + +- Testing against Node v7 + +## [4.0.0] - 2016-12-23 + +### Changed + +- Return Object with parsed content or error instead of false ([#165](https://github.com/motdotla/dotenv/pull/165)). + +### Removed + +- `verbose` option removed in favor of returning result. + +## [3.0.0] - 2016-12-20 + +### Added + +- `verbose` option will log any error messages. Off by default. +- parses email addresses correctly +- allow importing config method directly in ES6 + +### Changed + +- Suppress error messages by default ([#154](https://github.com/motdotla/dotenv/pull/154)) +- Ignoring more files for NPM to make package download smaller + +### Fixed + +- False positive test due to case-sensitive variable ([#124](https://github.com/motdotla/dotenv/pull/124)) + +### Removed + +- `silent` option removed in favor of `verbose` + +## [2.0.0] - 2016-01-20 + +### Added + +- CHANGELOG to ["make it easier for users and contributors to see precisely what notable changes have been made between each release"](http://keepachangelog.com/). Linked to from README +- LICENSE to be more explicit about what was defined in `package.json`. Linked to from README +- Testing nodejs v4 on travis-ci +- added examples of how to use dotenv in different ways +- return parsed object on success rather than boolean true + +### Changed + +- README has shorter description not referencing ruby gem since we don't have or want feature parity + +### Removed + +- Variable expansion and escaping so environment variables are encouraged to be fully orthogonal + +## [1.2.0] - 2015-06-20 + +### Added + +- Preload hook to require dotenv without including it in your code + +### Changed + +- clarified license to be "BSD-2-Clause" in `package.json` + +### Fixed + +- retain spaces in string vars + +## [1.1.0] - 2015-03-31 + +### Added + +- Silent option to silence `console.log` when `.env` missing + +## [1.0.0] - 2015-03-13 + +### Removed + +- support for multiple `.env` files. should always use one `.env` file for the current environment + +[7.0.0]: https://github.com/motdotla/dotenv/compare/v6.2.0...v7.0.0 +[6.2.0]: https://github.com/motdotla/dotenv/compare/v6.1.0...v6.2.0 +[6.1.0]: https://github.com/motdotla/dotenv/compare/v6.0.0...v6.1.0 +[6.0.0]: https://github.com/motdotla/dotenv/compare/v5.0.0...v6.0.0 +[5.0.0]: https://github.com/motdotla/dotenv/compare/v4.0.0...v5.0.0 +[4.0.0]: https://github.com/motdotla/dotenv/compare/v3.0.0...v4.0.0 +[3.0.0]: https://github.com/motdotla/dotenv/compare/v2.0.0...v3.0.0 +[2.0.0]: https://github.com/motdotla/dotenv/compare/v1.2.0...v2.0.0 +[1.2.0]: https://github.com/motdotla/dotenv/compare/v1.1.0...v1.2.0 +[1.1.0]: https://github.com/motdotla/dotenv/compare/v1.0.0...v1.1.0 +[1.0.0]: https://github.com/motdotla/dotenv/compare/v0.4.0...v1.0.0 diff --git a/node_modules/dotenv/LICENSE b/node_modules/dotenv/LICENSE new file mode 100644 index 0000000..c430ad8 --- /dev/null +++ b/node_modules/dotenv/LICENSE @@ -0,0 +1,23 @@ +Copyright (c) 2015, Scott Motte +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/node_modules/dotenv/README-es.md b/node_modules/dotenv/README-es.md new file mode 100644 index 0000000..5fc934d --- /dev/null +++ b/node_modules/dotenv/README-es.md @@ -0,0 +1,411 @@ +
+🎉 announcing dotenvx. run anywhere, multi-environment, encrypted envs. +
+ +  + +
+ +

+ + Dotenv es apoyado por la comunidad. + +

+Gracias espaciales a: +
+
+ +Graphite + + + Graphite is the AI developer productivity platform helping teams on GitHub ship higher quality software, faster. + +
+
+ +# dotenv [![NPM version](https://img.shields.io/npm/v/dotenv.svg?style=flat-square)](https://www.npmjs.com/package/dotenv) + +dotenv + +Dotenv es un módulo de dependencia cero que carga las variables de entorno desde un archivo `.env` en [`process.env`](https://nodejs.org/docs/latest/api/process.html#process_process_env). El almacenamiento de la configuración del entorno separado del código está basado en la metodología [The Twelve-Factor App](http://12factor.net/config). + +[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square)](https://github.com/feross/standard) +[![LICENSE](https://img.shields.io/github/license/motdotla/dotenv.svg)](LICENSE) + +## Instalación + +```bash +# instalación local (recomendado) +npm install dotenv --save +``` + +O installación con yarn? `yarn add dotenv` + +## Uso + +Cree un archivo `.env` en la raíz de su proyecto: + +```dosini +S3_BUCKET="YOURS3BUCKET" +SECRET_KEY="YOURSECRETKEYGOESHERE" +``` + +Tan prónto como sea posible en su aplicación, importe y configure dotenv: + +```javascript +require('dotenv').config() +console.log(process.env) // elimine esto después que haya confirmado que esta funcionando +``` + +.. o usa ES6? + +```javascript +import * as dotenv from 'dotenv' // vea en https://github.com/motdotla/dotenv#como-uso-dotenv-con-import +// REVISAR LINK DE REFERENCIA DE IMPORTACIÓN +dotenv.config() +import express from 'express' +``` + +Eso es todo. `process.env` ahora tiene las claves y los valores que definiste en tu archivo `.env`: + +```javascript +require('dotenv').config() + +... + +s3.getBucketCors({Bucket: process.env.S3_BUCKET}, function(err, data) {}) +``` + +### Valores multilínea + +Si necesita variables de varias líneas, por ejemplo, claves privadas, ahora se admiten en la versión (`>= v15.0.0`) con saltos de línea: + +```dosini +PRIVATE_KEY="-----BEGIN RSA PRIVATE KEY----- +... +Kh9NV... +... +-----END RSA PRIVATE KEY-----" +``` + +Alternativamente, puede usar comillas dobles y usar el carácter `\n`: + +```dosini +PRIVATE_KEY="-----BEGIN RSA PRIVATE KEY-----\nKh9NV...\n-----END RSA PRIVATE KEY-----\n" +``` + +### Comentarios + +Los comentarios pueden ser agregados en tu archivo o en la misma línea: + +```dosini +# This is a comment +SECRET_KEY=YOURSECRETKEYGOESHERE # comment +SECRET_HASH="something-with-a-#-hash" +``` + +Los comentarios comienzan donde existe un `#`, entonces, si su valor contiene un `#`, enciérrelo entre comillas. Este es un cambio importante desde la versión `>= v15.0.0` en adelante. + +### Análisis + +El motor que analiza el contenido de su archivo que contiene variables de entorno está disponible para su uso. Este Acepta una Cadena o un Búfer y devolverá un Objeto con las claves y los valores analizados. + +```javascript +const dotenv = require('dotenv') +const buf = Buffer.from('BASICO=basico') +const config = dotenv.parse(buf) // devolverá un objeto +console.log(typeof config, config) // objeto { BASICO : 'basico' } +``` + +### Precarga + +Puede usar el `--require` (`-r`) [opción de línea de comando](https://nodejs.org/api/cli.html#-r---require-module) para precargar dotenv. Al hacer esto, no necesita requerir ni cargar dotnev en el código de su aplicación. + +```bash +$ node -r dotenv/config tu_script.js +``` + +Las opciones de configuración a continuación se admiten como argumentos de línea de comandos en el formato `dotenv_config_