easyoref 1.0.0
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/LICENSE +21 -0
- package/README.md +127 -0
- package/dist/bin.d.ts +9 -0
- package/dist/bin.d.ts.map +1 -0
- package/dist/bin.js +25 -0
- package/dist/bin.js.map +1 -0
- package/dist/bot.d.ts +16 -0
- package/dist/bot.d.ts.map +1 -0
- package/dist/bot.js +481 -0
- package/dist/bot.js.map +1 -0
- package/dist/config.d.ts +72 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +120 -0
- package/dist/config.js.map +1 -0
- package/dist/gif-state.d.ts +17 -0
- package/dist/gif-state.d.ts.map +1 -0
- package/dist/gif-state.js +67 -0
- package/dist/gif-state.js.map +1 -0
- package/dist/i18n.d.ts +37 -0
- package/dist/i18n.d.ts.map +1 -0
- package/dist/i18n.js +240 -0
- package/dist/i18n.js.map +1 -0
- package/dist/init.d.ts +7 -0
- package/dist/init.d.ts.map +1 -0
- package/dist/init.js +163 -0
- package/dist/init.js.map +1 -0
- package/dist/logger.d.ts +14 -0
- package/dist/logger.d.ts.map +1 -0
- package/dist/logger.js +45 -0
- package/dist/logger.js.map +1 -0
- package/package.json +60 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025-2026 Mikhail Kogan
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
# EasyOref
|
|
2
|
+
|
|
3
|
+
Israeli civil defense alerts → your family's Telegram chat.
|
|
4
|
+
|
|
5
|
+
[](https://github.com/mikhailkogan17/EasyOref/actions/workflows/ci.yml)
|
|
6
|
+
[](LICENSE)
|
|
7
|
+
[](https://www.npmjs.com/package/easyoref)
|
|
8
|
+
|
|
9
|
+
[Русский](docs/readme_ru.md) · [עברית](docs/readme_he.md)
|
|
10
|
+
|
|
11
|
+
> [!CAUTION]
|
|
12
|
+
> EasyOref **does not replace** official Home Front Command alerts.
|
|
13
|
+
> It **supplements** them — notifying your family abroad.
|
|
14
|
+
> Always follow Home Front Command instructions!
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## Why
|
|
19
|
+
|
|
20
|
+
During a rocket attack, your family abroad sees "MISSILES HIT NETANYA" on the news.
|
|
21
|
+
|
|
22
|
+
They don't know:
|
|
23
|
+
- Is it your neighborhood or 200 km away?
|
|
24
|
+
- Are you safe?
|
|
25
|
+
- Should they worry?
|
|
26
|
+
|
|
27
|
+
**Nothing solves this today.**
|
|
28
|
+
Alert apps with area filtering — for you in Israel.
|
|
29
|
+
Cell Broadcast alerts — for you in Israel.
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
## Features
|
|
34
|
+
|
|
35
|
+
- **4 languages** — Russian, English, Hebrew, Arabic
|
|
36
|
+
- **3 alert types** — early warning, siren, all-clear
|
|
37
|
+
- **Custom messages** — your own text and media per alert type
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## Install
|
|
42
|
+
|
|
43
|
+
### 1. Install Node.js
|
|
44
|
+
|
|
45
|
+
<details>
|
|
46
|
+
<summary>Windows</summary>
|
|
47
|
+
|
|
48
|
+
Download the installer from [nodejs.org](https://nodejs.org/) (LTS, 22+). Run it, click "Next".
|
|
49
|
+
|
|
50
|
+
</details>
|
|
51
|
+
|
|
52
|
+
<details>
|
|
53
|
+
<summary>macOS</summary>
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
brew install node
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Or download from [nodejs.org](https://nodejs.org/).
|
|
60
|
+
|
|
61
|
+
</details>
|
|
62
|
+
|
|
63
|
+
<details>
|
|
64
|
+
<summary>Linux / Raspberry Pi</summary>
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -
|
|
68
|
+
sudo apt install -y nodejs
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
</details>
|
|
72
|
+
|
|
73
|
+
### 2. Set up Telegram
|
|
74
|
+
|
|
75
|
+
1. Message [@BotFather](https://t.me/BotFather) → `/newbot` → copy the **token**
|
|
76
|
+
2. Add the bot to your family group chat
|
|
77
|
+
3. Forward any message from that chat to [@userinfobot](https://t.me/userinfobot) → copy the **chat ID**
|
|
78
|
+
|
|
79
|
+
### 3. Find your city ID
|
|
80
|
+
|
|
81
|
+
Open [cities.json](https://github.com/eladnava/pikud-haoref-api/blob/master/cities.json), find your city, copy the `id` number.
|
|
82
|
+
|
|
83
|
+
Example: `"id": 722` = Tel Aviv — South & Jaffa.
|
|
84
|
+
|
|
85
|
+
### 4. Run setup
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
npx easyoref init
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
The wizard asks for language, token, chat ID, and city ID. Config is saved to `~/.easyoref/config.yaml`.
|
|
92
|
+
|
|
93
|
+
### 5. Start the bot
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
npx easyoref
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
**Done.** The bot will message your chat whenever the Home Front Command issues an alert for your area.
|
|
100
|
+
|
|
101
|
+
> The bot needs to run 24/7 — on a Raspberry Pi, server, or always-on computer.
|
|
102
|
+
> Guides: [RPi](docs/rpi.md) · [Local](docs/local.md)
|
|
103
|
+
|
|
104
|
+
---
|
|
105
|
+
|
|
106
|
+
## Configuration
|
|
107
|
+
|
|
108
|
+
Config file: `~/.easyoref/config.yaml`. Created by `npx easyoref init`.
|
|
109
|
+
|
|
110
|
+
Full reference: [`config.yaml.example`](config.yaml.example).
|
|
111
|
+
|
|
112
|
+
| Key | Default | Description |
|
|
113
|
+
| ------------------------ | ------- | --------------------------------------------------------------------------------------------------- |
|
|
114
|
+
| `city_ids` | — | **required.** [Find city IDs](https://github.com/eladnava/pikud-haoref-api/blob/master/cities.json) |
|
|
115
|
+
| `telegram.bot_token` | — | **required.** Token from @BotFather |
|
|
116
|
+
| `telegram.chat_id` | — | **required.** Chat ID (negative number) |
|
|
117
|
+
| `language` | `ru` | `ru` `en` `he` `ar` |
|
|
118
|
+
| `alert_types` | all | `early` `siren` `incident_over` |
|
|
119
|
+
| `gif_mode` | `none` | `funny_cats` `assertive` `pikud_haoref` `none` |
|
|
120
|
+
| `title_override.*` | — | Custom title per alert type |
|
|
121
|
+
| `description_override.*` | — | Custom description per alert type |
|
|
122
|
+
|
|
123
|
+
---
|
|
124
|
+
|
|
125
|
+
## License
|
|
126
|
+
|
|
127
|
+
[MIT](LICENSE) — Mikhail Kogan, 2026
|
package/dist/bin.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bin.d.ts","sourceRoot":"","sources":["../src/bin.ts"],"names":[],"mappings":";AACA;;;;;GAKG"}
|
package/dist/bin.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* EasyOref CLI entrypoint.
|
|
4
|
+
*
|
|
5
|
+
* npx easyoref — run the bot
|
|
6
|
+
* npx easyoref init — interactive setup wizard
|
|
7
|
+
*/
|
|
8
|
+
const command = process.argv[2];
|
|
9
|
+
if (command === "init") {
|
|
10
|
+
const { init } = await import("./init.js");
|
|
11
|
+
await init();
|
|
12
|
+
}
|
|
13
|
+
else if (command === "--help" || command === "-h") {
|
|
14
|
+
console.log(`
|
|
15
|
+
Usage:
|
|
16
|
+
easyoref Start the bot
|
|
17
|
+
easyoref init Interactive setup wizard
|
|
18
|
+
easyoref --help Show this message
|
|
19
|
+
`);
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
await import("./bot.js");
|
|
23
|
+
}
|
|
24
|
+
export {};
|
|
25
|
+
//# sourceMappingURL=bin.js.map
|
package/dist/bin.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bin.js","sourceRoot":"","sources":["../src/bin.ts"],"names":[],"mappings":";AACA;;;;;GAKG;AAEH,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAEhC,IAAI,OAAO,KAAK,MAAM,EAAE,CAAC;IACvB,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,MAAM,CAAC,WAAW,CAAC,CAAC;IAC3C,MAAM,IAAI,EAAE,CAAC;AACf,CAAC;KAAM,IAAI,OAAO,KAAK,QAAQ,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;IACpD,OAAO,CAAC,GAAG,CAAC;;;;;CAKb,CAAC,CAAC;AACH,CAAC;KAAM,CAAC;IACN,MAAM,MAAM,CAAC,UAAU,CAAC,CAAC;AAC3B,CAAC"}
|
package/dist/bot.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* EasyOref — Real-time Israeli Red Alert Filter Bot
|
|
3
|
+
*
|
|
4
|
+
* Architecture:
|
|
5
|
+
* oref.org.il API → local filter (area map) → Telegram (grammY)
|
|
6
|
+
*
|
|
7
|
+
* Flow:
|
|
8
|
+
* 1. Poll oref.org.il every 2 seconds for active alerts
|
|
9
|
+
* 2. Match areas against configured regions (Hebrew names)
|
|
10
|
+
* 3. Classify alert type: early warning / siren / incident over
|
|
11
|
+
* 4. If relevant → send calm message to family Telegram chat
|
|
12
|
+
*
|
|
13
|
+
* No LLM needed — purely deterministic matching for <1s latency.
|
|
14
|
+
*/
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=bot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bot.d.ts","sourceRoot":"","sources":["../src/bot.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG"}
|