ntfy-reverse-proxy 0.0.0 → 2.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/README.md +48 -0
- package/build/src/cli/commands/config-io.d.ts +5 -0
- package/build/src/cli/commands/config-io.d.ts.map +1 -0
- package/build/src/cli/commands/config-io.js +19 -0
- package/build/src/cli/commands/config-io.js.map +1 -0
- package/build/src/cli/commands/context.d.ts +9 -0
- package/build/src/cli/commands/context.d.ts.map +1 -0
- package/build/src/cli/commands/context.js +108 -0
- package/build/src/cli/commands/context.js.map +1 -0
- package/build/src/cli/commands/deploy.d.ts +4 -0
- package/build/src/cli/commands/deploy.d.ts.map +1 -0
- package/build/src/cli/commands/deploy.js +496 -0
- package/build/src/cli/commands/deploy.js.map +1 -0
- package/build/src/cli/commands/generate.d.ts +4 -0
- package/build/src/cli/commands/generate.d.ts.map +1 -0
- package/build/src/cli/commands/generate.js +68 -0
- package/build/src/cli/commands/generate.js.map +1 -0
- package/build/src/cli/commands/server.d.ts +7 -0
- package/build/src/cli/commands/server.d.ts.map +1 -0
- package/build/src/cli/commands/server.js +43 -0
- package/build/src/cli/commands/server.js.map +1 -0
- package/build/src/cli/commands/settings.d.ts +5 -0
- package/build/src/cli/commands/settings.d.ts.map +1 -0
- package/build/src/cli/commands/settings.js +16 -0
- package/build/src/cli/commands/settings.js.map +1 -0
- package/build/src/cli/commands/validate.d.ts +4 -0
- package/build/src/cli/commands/validate.d.ts.map +1 -0
- package/build/src/cli/commands/validate.js +45 -0
- package/build/src/cli/commands/validate.js.map +1 -0
- package/build/src/cli/index.d.ts +5 -0
- package/build/src/cli/index.d.ts.map +1 -0
- package/build/src/cli/index.js +118 -0
- package/build/src/cli/index.js.map +1 -0
- package/build/src/cli/menu/interactive.d.ts +4 -0
- package/build/src/cli/menu/interactive.d.ts.map +1 -0
- package/build/src/cli/menu/interactive.js +902 -0
- package/build/src/cli/menu/interactive.js.map +1 -0
- package/build/src/lib/item.d.ts +3 -0
- package/build/src/lib/item.d.ts.map +1 -0
- package/build/src/lib/item.js +3 -0
- package/build/src/lib/item.js.map +1 -0
- package/build/src/lib/regex.d.ts +30 -0
- package/build/src/lib/regex.d.ts.map +1 -0
- package/build/src/lib/regex.js +30 -0
- package/build/src/lib/regex.js.map +1 -0
- package/build/src/lib/schema.d.ts +167 -0
- package/build/src/lib/schema.d.ts.map +1 -0
- package/build/src/lib/schema.js +70 -0
- package/build/src/lib/schema.js.map +1 -0
- package/build/src/lib/utility.d.ts +4 -0
- package/build/src/lib/utility.d.ts.map +1 -0
- package/build/src/lib/utility.js +14 -0
- package/build/src/lib/utility.js.map +1 -0
- package/build/src/types/cli/commands/config-io.d.ts +38 -0
- package/build/src/types/cli/commands/context.d.ts +131 -0
- package/build/src/types/cli/commands/deploy.d.ts +622 -0
- package/build/src/types/cli/commands/generate.d.ts +51 -0
- package/build/src/types/cli/commands/server.d.ts +65 -0
- package/build/src/types/cli/commands/settings.d.ts +25 -0
- package/build/src/types/cli/commands/validate.d.ts +37 -0
- package/build/src/types/cli/index.d.ts +55 -0
- package/build/src/types/cli/menu/interactive.d.ts +381 -0
- package/build/src/types/fetch-response.d.ts +11 -0
- package/build/src/types/lib/schema.d.ts +134 -0
- package/build/src/types/lib/utility.d.ts +8 -0
- package/build/src/types/tests/cli/commands/context.test.d.ts +57 -0
- package/build/src/types/tests/cli/commands/generate.test.d.ts +12 -0
- package/build/src/types/tests/cli/commands/server.test.d.ts +45 -0
- package/build/src/types/tests/cli/commands/settings.test.d.ts +40 -0
- package/build/src/types/tests/cli/commands/validate.test.d.ts +19 -0
- package/build/src/types/tests/cli/menu/interactive.test.d.ts +6 -0
- package/build/src/types/tests/lib/schema.test.d.ts +10 -0
- package/build/src/types/tests/type-declarations.test.d.ts +173 -0
- package/build/src/types/tests/worker/index.test.d.ts +20 -0
- package/build/src/types/tests/worker/interpreters/ntfy-json.test.d.ts +19 -0
- package/build/src/types/tests/worker/interpreters/pfsense.test.d.ts +10 -0
- package/build/src/types/tests/worker/interpreters/plain-text.test.d.ts +10 -0
- package/build/src/types/tests/worker/interpreters/seerr.test.d.ts +8 -0
- package/build/src/types/tests/worker/interpreters/statuspage.test.d.ts +58 -0
- package/build/src/types/tests/worker/interpreters/synology.test.d.ts +8 -0
- package/build/src/types/tests/worker/interpreters/unifi.test.d.ts +8 -0
- package/build/src/types/tests/worker/landing/page.test.d.ts +55 -0
- package/build/src/types/tests/worker/pipeline/accumulate.test.d.ts +28 -0
- package/build/src/types/tests/worker/pipeline/authenticate.test.d.ts +9 -0
- package/build/src/types/tests/worker/pipeline/email.test.d.ts +15 -0
- package/build/src/types/tests/worker/pipeline/format.test.d.ts +38 -0
- package/build/src/types/tests/worker/pipeline/interpret.test.d.ts +43 -0
- package/build/src/types/tests/worker/pipeline/parse.test.d.ts +17 -0
- package/build/src/types/tests/worker/pipeline/receive.test.d.ts +23 -0
- package/build/src/types/tests/worker/pipeline/respond.test.d.ts +20 -0
- package/build/src/types/tests/worker/pipeline/route.test.d.ts +80 -0
- package/build/src/types/tests/worker/pipeline/send.test.d.ts +37 -0
- package/build/src/types/tests/worker/pipeline/split.test.d.ts +17 -0
- package/build/src/types/worker/index.d.ts +232 -0
- package/build/src/types/worker/interpreters/ntfy-json.d.ts +28 -0
- package/build/src/types/worker/interpreters/pfsense.d.ts +97 -0
- package/build/src/types/worker/interpreters/plain-text.d.ts +24 -0
- package/build/src/types/worker/interpreters/seerr.d.ts +124 -0
- package/build/src/types/worker/interpreters/statuspage.d.ts +239 -0
- package/build/src/types/worker/interpreters/synology.d.ts +99 -0
- package/build/src/types/worker/interpreters/unifi.d.ts +111 -0
- package/build/src/types/worker/landing/page.d.ts +44 -0
- package/build/src/types/worker/pipeline/accumulate.d.ts +79 -0
- package/build/src/types/worker/pipeline/authenticate.d.ts +68 -0
- package/build/src/types/worker/pipeline/email.d.ts +108 -0
- package/build/src/types/worker/pipeline/format.d.ts +47 -0
- package/build/src/types/worker/pipeline/interpret.d.ts +63 -0
- package/build/src/types/worker/pipeline/parse.d.ts +39 -0
- package/build/src/types/worker/pipeline/receive.d.ts +64 -0
- package/build/src/types/worker/pipeline/respond.d.ts +113 -0
- package/build/src/types/worker/pipeline/route.d.ts +34 -0
- package/build/src/types/worker/pipeline/send.d.ts +143 -0
- package/build/src/types/worker/pipeline/shared.d.ts +85 -0
- package/build/src/types/worker/pipeline/split.d.ts +35 -0
- package/build/src/worker/handlers.d.ts +5 -0
- package/build/src/worker/handlers.d.ts.map +1 -0
- package/build/src/worker/handlers.js +360 -0
- package/build/src/worker/handlers.js.map +1 -0
- package/build/src/worker/index.d.ts +4 -0
- package/build/src/worker/index.d.ts.map +1 -0
- package/build/src/worker/index.js +52 -0
- package/build/src/worker/index.js.map +1 -0
- package/build/src/worker/interpreters/ntfy-json.d.ts +4 -0
- package/build/src/worker/interpreters/ntfy-json.d.ts.map +1 -0
- package/build/src/worker/interpreters/ntfy-json.js +49 -0
- package/build/src/worker/interpreters/ntfy-json.js.map +1 -0
- package/build/src/worker/interpreters/pfsense.d.ts +4 -0
- package/build/src/worker/interpreters/pfsense.d.ts.map +1 -0
- package/build/src/worker/interpreters/pfsense.js +150 -0
- package/build/src/worker/interpreters/pfsense.js.map +1 -0
- package/build/src/worker/interpreters/plain-text.d.ts +4 -0
- package/build/src/worker/interpreters/plain-text.d.ts.map +1 -0
- package/build/src/worker/interpreters/plain-text.js +18 -0
- package/build/src/worker/interpreters/plain-text.js.map +1 -0
- package/build/src/worker/interpreters/seerr.d.ts +4 -0
- package/build/src/worker/interpreters/seerr.d.ts.map +1 -0
- package/build/src/worker/interpreters/seerr.js +173 -0
- package/build/src/worker/interpreters/seerr.js.map +1 -0
- package/build/src/worker/interpreters/statuspage.d.ts +4 -0
- package/build/src/worker/interpreters/statuspage.d.ts.map +1 -0
- package/build/src/worker/interpreters/statuspage.js +266 -0
- package/build/src/worker/interpreters/statuspage.js.map +1 -0
- package/build/src/worker/interpreters/synology.d.ts +4 -0
- package/build/src/worker/interpreters/synology.d.ts.map +1 -0
- package/build/src/worker/interpreters/synology.js +177 -0
- package/build/src/worker/interpreters/synology.js.map +1 -0
- package/build/src/worker/interpreters/unifi.d.ts +4 -0
- package/build/src/worker/interpreters/unifi.d.ts.map +1 -0
- package/build/src/worker/interpreters/unifi.js +152 -0
- package/build/src/worker/interpreters/unifi.js.map +1 -0
- package/build/src/worker/landing/page.d.ts +4 -0
- package/build/src/worker/landing/page.d.ts.map +1 -0
- package/build/src/worker/landing/page.js +260 -0
- package/build/src/worker/landing/page.js.map +1 -0
- package/build/src/worker/pipeline/accumulate.d.ts +7 -0
- package/build/src/worker/pipeline/accumulate.d.ts.map +1 -0
- package/build/src/worker/pipeline/accumulate.js +53 -0
- package/build/src/worker/pipeline/accumulate.js.map +1 -0
- package/build/src/worker/pipeline/authenticate.d.ts +4 -0
- package/build/src/worker/pipeline/authenticate.d.ts.map +1 -0
- package/build/src/worker/pipeline/authenticate.js +53 -0
- package/build/src/worker/pipeline/authenticate.js.map +1 -0
- package/build/src/worker/pipeline/email.d.ts +4 -0
- package/build/src/worker/pipeline/email.d.ts.map +1 -0
- package/build/src/worker/pipeline/email.js +149 -0
- package/build/src/worker/pipeline/email.js.map +1 -0
- package/build/src/worker/pipeline/format.d.ts +5 -0
- package/build/src/worker/pipeline/format.d.ts.map +1 -0
- package/build/src/worker/pipeline/format.js +48 -0
- package/build/src/worker/pipeline/format.js.map +1 -0
- package/build/src/worker/pipeline/interpret.d.ts +4 -0
- package/build/src/worker/pipeline/interpret.d.ts.map +1 -0
- package/build/src/worker/pipeline/interpret.js +30 -0
- package/build/src/worker/pipeline/interpret.js.map +1 -0
- package/build/src/worker/pipeline/parse.d.ts +4 -0
- package/build/src/worker/pipeline/parse.d.ts.map +1 -0
- package/build/src/worker/pipeline/parse.js +59 -0
- package/build/src/worker/pipeline/parse.js.map +1 -0
- package/build/src/worker/pipeline/receive.d.ts +4 -0
- package/build/src/worker/pipeline/receive.d.ts.map +1 -0
- package/build/src/worker/pipeline/receive.js +52 -0
- package/build/src/worker/pipeline/receive.js.map +1 -0
- package/build/src/worker/pipeline/respond.d.ts +4 -0
- package/build/src/worker/pipeline/respond.d.ts.map +1 -0
- package/build/src/worker/pipeline/respond.js +48 -0
- package/build/src/worker/pipeline/respond.js.map +1 -0
- package/build/src/worker/pipeline/route.d.ts +5 -0
- package/build/src/worker/pipeline/route.d.ts.map +1 -0
- package/build/src/worker/pipeline/route.js +23 -0
- package/build/src/worker/pipeline/route.js.map +1 -0
- package/build/src/worker/pipeline/send.d.ts +4 -0
- package/build/src/worker/pipeline/send.d.ts.map +1 -0
- package/build/src/worker/pipeline/send.js +156 -0
- package/build/src/worker/pipeline/send.js.map +1 -0
- package/build/src/worker/pipeline/split.d.ts +4 -0
- package/build/src/worker/pipeline/split.d.ts.map +1 -0
- package/build/src/worker/pipeline/split.js +40 -0
- package/build/src/worker/pipeline/split.js.map +1 -0
- package/package.json +95 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"page.d.ts","sourceRoot":"","sources":["../../../../src/worker/landing/page.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAEV,uBAAuB,EAUvB,yBAAyB,EAG1B,MAAM,sCAAsC,CAAC;AA2B9C,iBAAS,WAAW,CAAC,MAAM,EAAE,uBAAuB,GAAG,yBAAyB,CAkQ/E;AAED,OAAO,EACL,WAAW,GACZ,CAAC"}
|
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
import { LIB_REGEX_AMPERSAND, LIB_REGEX_DOUBLE_QUOTE, LIB_REGEX_GREATER_THAN, LIB_REGEX_LESS_THAN, LIB_REGEX_SINGLE_QUOTE, } from '../../lib/regex.js';
|
|
2
|
+
function escapeHtml(str) {
|
|
3
|
+
return str
|
|
4
|
+
.replace(new RegExp(LIB_REGEX_AMPERSAND, 'g'), '&')
|
|
5
|
+
.replace(new RegExp(LIB_REGEX_LESS_THAN, 'g'), '<')
|
|
6
|
+
.replace(new RegExp(LIB_REGEX_GREATER_THAN, 'g'), '>')
|
|
7
|
+
.replace(new RegExp(LIB_REGEX_DOUBLE_QUOTE, 'g'), '"')
|
|
8
|
+
.replace(new RegExp(LIB_REGEX_SINGLE_QUOTE, 'g'), ''');
|
|
9
|
+
}
|
|
10
|
+
function landingPage(config) {
|
|
11
|
+
const settings = config['settings'];
|
|
12
|
+
const servers = config['servers'];
|
|
13
|
+
const contexts = config['contexts'];
|
|
14
|
+
let debugSection = '';
|
|
15
|
+
if (settings['show_response_output'] === true) {
|
|
16
|
+
const maskedServers = servers.map((server) => ({
|
|
17
|
+
name: server['name'],
|
|
18
|
+
server: '***',
|
|
19
|
+
token: '***',
|
|
20
|
+
}));
|
|
21
|
+
const maskedContexts = contexts.map((context) => {
|
|
22
|
+
const base = {
|
|
23
|
+
id: '***',
|
|
24
|
+
name: context['name'],
|
|
25
|
+
type: context['type'],
|
|
26
|
+
interpreter: context['interpreter'],
|
|
27
|
+
topic: '***',
|
|
28
|
+
...(context['error_topic'] !== undefined ? { error_topic: '***' } : {}),
|
|
29
|
+
mode: context['mode'],
|
|
30
|
+
show_visitor_info: context['show_visitor_info'],
|
|
31
|
+
primary_server: context['primary_server'],
|
|
32
|
+
servers: context['servers'],
|
|
33
|
+
};
|
|
34
|
+
if (context['type'] === 'http') {
|
|
35
|
+
return {
|
|
36
|
+
...base,
|
|
37
|
+
...(context['token'] !== undefined ? { token: '***' } : {}),
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
return {
|
|
41
|
+
...base,
|
|
42
|
+
...(context['allowed_from'] !== undefined ? { allowed_from: '***' } : {}),
|
|
43
|
+
};
|
|
44
|
+
});
|
|
45
|
+
const maskedConfig = {
|
|
46
|
+
settings: {
|
|
47
|
+
...settings,
|
|
48
|
+
base_domain: '***',
|
|
49
|
+
},
|
|
50
|
+
servers: maskedServers,
|
|
51
|
+
contexts: maskedContexts,
|
|
52
|
+
};
|
|
53
|
+
const maskedJsonRaw = JSON.stringify(maskedConfig, null, 2);
|
|
54
|
+
const maskedJson = escapeHtml(maskedJsonRaw);
|
|
55
|
+
debugSection = [
|
|
56
|
+
'',
|
|
57
|
+
' <details>',
|
|
58
|
+
' <summary>Debug Info</summary>',
|
|
59
|
+
` <pre><code>${maskedJson}</code></pre>`,
|
|
60
|
+
' </details>',
|
|
61
|
+
].join('\n');
|
|
62
|
+
}
|
|
63
|
+
const html = [
|
|
64
|
+
'<!DOCTYPE html>',
|
|
65
|
+
'<html lang="en">',
|
|
66
|
+
'<head>',
|
|
67
|
+
' <meta charset="UTF-8" />',
|
|
68
|
+
' <meta name="viewport" content="width=device-width, initial-scale=1.0" />',
|
|
69
|
+
' <title>Reverse Proxy for ntfy</title>',
|
|
70
|
+
' <link rel="preconnect" href="https://fonts.googleapis.com" />',
|
|
71
|
+
' <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />',
|
|
72
|
+
' <link href="https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,500;1,9..40,300&family=JetBrains+Mono:wght@400&display=swap" rel="stylesheet" />',
|
|
73
|
+
' <style>',
|
|
74
|
+
' :root {',
|
|
75
|
+
' --bg: #0c0c0f;',
|
|
76
|
+
' --surface: #16161a;',
|
|
77
|
+
' --surface-hover: #1c1c22;',
|
|
78
|
+
' --border: #2a2a32;',
|
|
79
|
+
' --text: #e8e8ed;',
|
|
80
|
+
' --text-muted: #7a7a85;',
|
|
81
|
+
' --accent: #6ee7b7;',
|
|
82
|
+
' --accent-dim: rgba(110, 231, 183, 0.08);',
|
|
83
|
+
' }',
|
|
84
|
+
'',
|
|
85
|
+
' * { margin: 0; padding: 0; box-sizing: border-box; }',
|
|
86
|
+
'',
|
|
87
|
+
' body {',
|
|
88
|
+
' background: var(--bg);',
|
|
89
|
+
' color: var(--text);',
|
|
90
|
+
' font-family: \'DM Sans\', sans-serif;',
|
|
91
|
+
' font-weight: 300;',
|
|
92
|
+
' min-height: 100vh;',
|
|
93
|
+
' display: flex;',
|
|
94
|
+
' align-items: center;',
|
|
95
|
+
' justify-content: center;',
|
|
96
|
+
' padding: 2rem;',
|
|
97
|
+
' -webkit-font-smoothing: antialiased;',
|
|
98
|
+
' }',
|
|
99
|
+
'',
|
|
100
|
+
' .card {',
|
|
101
|
+
' background: var(--surface);',
|
|
102
|
+
' border: 1px solid var(--border);',
|
|
103
|
+
' border-radius: 16px;',
|
|
104
|
+
' padding: 3rem;',
|
|
105
|
+
' max-width: 520px;',
|
|
106
|
+
' width: 100%;',
|
|
107
|
+
' animation: fadeUp 0.6s ease-out both;',
|
|
108
|
+
' }',
|
|
109
|
+
'',
|
|
110
|
+
' @keyframes fadeUp {',
|
|
111
|
+
' from { opacity: 0; transform: translateY(12px); }',
|
|
112
|
+
' to { opacity: 1; transform: translateY(0); }',
|
|
113
|
+
' }',
|
|
114
|
+
'',
|
|
115
|
+
' .badge {',
|
|
116
|
+
' display: inline-flex;',
|
|
117
|
+
' align-items: center;',
|
|
118
|
+
' gap: 6px;',
|
|
119
|
+
' background: var(--accent-dim);',
|
|
120
|
+
' border: 1px solid rgba(110, 231, 183, 0.15);',
|
|
121
|
+
' border-radius: 100px;',
|
|
122
|
+
' padding: 5px 14px;',
|
|
123
|
+
' font-size: 0.75rem;',
|
|
124
|
+
' font-weight: 500;',
|
|
125
|
+
' color: var(--accent);',
|
|
126
|
+
' letter-spacing: 0.02em;',
|
|
127
|
+
' margin-bottom: 1.5rem;',
|
|
128
|
+
' }',
|
|
129
|
+
'',
|
|
130
|
+
' .badge-dot {',
|
|
131
|
+
' width: 6px;',
|
|
132
|
+
' height: 6px;',
|
|
133
|
+
' background: var(--accent);',
|
|
134
|
+
' border-radius: 50%;',
|
|
135
|
+
' animation: pulse 2s ease-in-out infinite;',
|
|
136
|
+
' }',
|
|
137
|
+
'',
|
|
138
|
+
' @keyframes pulse {',
|
|
139
|
+
' 0%, 100% { opacity: 1; }',
|
|
140
|
+
' 50% { opacity: 0.4; }',
|
|
141
|
+
' }',
|
|
142
|
+
'',
|
|
143
|
+
' h1 {',
|
|
144
|
+
' font-size: 1.75rem;',
|
|
145
|
+
' font-weight: 500;',
|
|
146
|
+
' letter-spacing: -0.025em;',
|
|
147
|
+
' line-height: 1.2;',
|
|
148
|
+
' margin-bottom: 0.75rem;',
|
|
149
|
+
' }',
|
|
150
|
+
'',
|
|
151
|
+
' .subtitle {',
|
|
152
|
+
' color: var(--text-muted);',
|
|
153
|
+
' font-size: 0.95rem;',
|
|
154
|
+
' line-height: 1.6;',
|
|
155
|
+
' margin-bottom: 2rem;',
|
|
156
|
+
' }',
|
|
157
|
+
'',
|
|
158
|
+
' .link {',
|
|
159
|
+
' display: inline-flex;',
|
|
160
|
+
' align-items: center;',
|
|
161
|
+
' gap: 8px;',
|
|
162
|
+
' color: var(--text);',
|
|
163
|
+
' text-decoration: none;',
|
|
164
|
+
' font-size: 0.875rem;',
|
|
165
|
+
' font-weight: 500;',
|
|
166
|
+
' padding: 10px 20px;',
|
|
167
|
+
' border: 1px solid var(--border);',
|
|
168
|
+
' border-radius: 10px;',
|
|
169
|
+
' transition: all 0.2s ease;',
|
|
170
|
+
' }',
|
|
171
|
+
'',
|
|
172
|
+
' .link:hover {',
|
|
173
|
+
' background: var(--surface-hover);',
|
|
174
|
+
' border-color: var(--accent);',
|
|
175
|
+
' color: var(--accent);',
|
|
176
|
+
' }',
|
|
177
|
+
'',
|
|
178
|
+
' .link svg {',
|
|
179
|
+
' width: 16px;',
|
|
180
|
+
' height: 16px;',
|
|
181
|
+
' fill: currentColor;',
|
|
182
|
+
' }',
|
|
183
|
+
'',
|
|
184
|
+
' details {',
|
|
185
|
+
' margin-top: 2rem;',
|
|
186
|
+
' border-top: 1px solid var(--border);',
|
|
187
|
+
' padding-top: 1.5rem;',
|
|
188
|
+
' animation: fadeUp 0.6s ease-out 0.15s both;',
|
|
189
|
+
' }',
|
|
190
|
+
'',
|
|
191
|
+
' summary {',
|
|
192
|
+
' cursor: pointer;',
|
|
193
|
+
' font-size: 0.8rem;',
|
|
194
|
+
' font-weight: 500;',
|
|
195
|
+
' color: var(--text-muted);',
|
|
196
|
+
' letter-spacing: 0.05em;',
|
|
197
|
+
' text-transform: uppercase;',
|
|
198
|
+
' list-style: none;',
|
|
199
|
+
' display: flex;',
|
|
200
|
+
' align-items: center;',
|
|
201
|
+
' gap: 8px;',
|
|
202
|
+
' transition: color 0.2s ease;',
|
|
203
|
+
' }',
|
|
204
|
+
'',
|
|
205
|
+
' summary:hover { color: var(--text); }',
|
|
206
|
+
' summary::-webkit-details-marker { display: none; }',
|
|
207
|
+
'',
|
|
208
|
+
' summary::before {',
|
|
209
|
+
' content: \'\';',
|
|
210
|
+
' width: 5px;',
|
|
211
|
+
' height: 5px;',
|
|
212
|
+
' border-right: 1.5px solid currentColor;',
|
|
213
|
+
' border-bottom: 1.5px solid currentColor;',
|
|
214
|
+
' transform: rotate(-45deg);',
|
|
215
|
+
' transition: transform 0.2s ease;',
|
|
216
|
+
' }',
|
|
217
|
+
'',
|
|
218
|
+
' details[open] summary::before {',
|
|
219
|
+
' transform: rotate(45deg);',
|
|
220
|
+
' }',
|
|
221
|
+
'',
|
|
222
|
+
' pre {',
|
|
223
|
+
' background: var(--bg);',
|
|
224
|
+
' border: 1px solid var(--border);',
|
|
225
|
+
' border-radius: 10px;',
|
|
226
|
+
' padding: 1.25rem;',
|
|
227
|
+
' margin-top: 1rem;',
|
|
228
|
+
' overflow-x: auto;',
|
|
229
|
+
' font-family: \'JetBrains Mono\', monospace;',
|
|
230
|
+
' font-size: 0.75rem;',
|
|
231
|
+
' line-height: 1.7;',
|
|
232
|
+
' color: var(--text-muted);',
|
|
233
|
+
' tab-size: 2;',
|
|
234
|
+
' }',
|
|
235
|
+
'',
|
|
236
|
+
' code { font-family: inherit; }',
|
|
237
|
+
' </style>',
|
|
238
|
+
'</head>',
|
|
239
|
+
'<body>',
|
|
240
|
+
' <div class="card">',
|
|
241
|
+
' <div class="badge"><span class="badge-dot"></span>Operational</div>',
|
|
242
|
+
' <h1>Reverse Proxy for ntfy</h1>',
|
|
243
|
+
' <p class="subtitle">A reverse proxy for ntfy running on Cloudflare Workers. Route webhooks and emails with built-in interpreters and server failover.</p>',
|
|
244
|
+
' <a class="link" href="https://github.com/cbnventures/ntfy-reverse-proxy" target="_blank" rel="noopener">',
|
|
245
|
+
' <svg viewBox="0 0 16 16"><path d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"/></svg>',
|
|
246
|
+
' View on GitHub',
|
|
247
|
+
` </a>${debugSection}`,
|
|
248
|
+
' </div>',
|
|
249
|
+
'</body>',
|
|
250
|
+
'</html>',
|
|
251
|
+
].join('\n');
|
|
252
|
+
return new Response(html, {
|
|
253
|
+
status: 200,
|
|
254
|
+
headers: {
|
|
255
|
+
'Content-Type': 'text/html; charset=utf-8',
|
|
256
|
+
},
|
|
257
|
+
});
|
|
258
|
+
}
|
|
259
|
+
export { landingPage, };
|
|
260
|
+
//# sourceMappingURL=page.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"page.js","sourceRoot":"","sources":["../../../../src/worker/landing/page.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,sBAAsB,EACtB,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B;QACpB,OAAO;QACP,EAAE;QACF,oCAAoC;QACpC,YAAY;QACZ,SAAS;QACT,QAAQ;QACR,sBAAsB;QACtB,yEAAyE;QACzE,qCAAqC;QACrC,+JAA+J;QAC/J,8GAA8G;QAC9G,2mBAA2mB;QAC3mB,sBAAsB;QACtB,WAAW,YAAY,EAAE;QACzB,UAAU;QACV,SAAS;QACT,SAAS;KACV,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAEb,OAAO,IAAI,QAAQ,CAAC,IAAI,EAAE;QACxB,MAAM,EAAE,GAAG;QACX,OAAO,EAAE;YACP,cAAc,EAAE,0BAA0B;SAC3C;KACF,CAAC,CAAC;AACL,CAAC;AAED,OAAO,EACL,WAAW,GACZ,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { WorkerPipelineAccumulateDeleteStateKv, WorkerPipelineAccumulateDeleteStatePageId, WorkerPipelineAccumulateDeleteStateReturns, WorkerPipelineAccumulateDiffComponentsCurrent, WorkerPipelineAccumulateDiffComponentsPrevious, WorkerPipelineAccumulateDiffComponentsReturns, WorkerPipelineAccumulateFormatComponentLinesDiff, WorkerPipelineAccumulateFormatComponentLinesReturns, WorkerPipelineAccumulateReadStateKv, WorkerPipelineAccumulateReadStatePageId, WorkerPipelineAccumulateReadStateReturns, WorkerPipelineAccumulateWriteStateKv, WorkerPipelineAccumulateWriteStatePageId, WorkerPipelineAccumulateWriteStateReturns, WorkerPipelineAccumulateWriteStateState } from '../../types/worker/pipeline/accumulate.d.ts';
|
|
2
|
+
export declare function readState(kv: WorkerPipelineAccumulateReadStateKv, pageId: WorkerPipelineAccumulateReadStatePageId): WorkerPipelineAccumulateReadStateReturns;
|
|
3
|
+
export declare function writeState(kv: WorkerPipelineAccumulateWriteStateKv, pageId: WorkerPipelineAccumulateWriteStatePageId, state: WorkerPipelineAccumulateWriteStateState): WorkerPipelineAccumulateWriteStateReturns;
|
|
4
|
+
export declare function deleteState(kv: WorkerPipelineAccumulateDeleteStateKv, pageId: WorkerPipelineAccumulateDeleteStatePageId): WorkerPipelineAccumulateDeleteStateReturns;
|
|
5
|
+
export declare function diffComponents(previous: WorkerPipelineAccumulateDiffComponentsPrevious, current: WorkerPipelineAccumulateDiffComponentsCurrent): WorkerPipelineAccumulateDiffComponentsReturns;
|
|
6
|
+
export declare function formatComponentLines(diff: WorkerPipelineAccumulateFormatComponentLinesDiff): WorkerPipelineAccumulateFormatComponentLinesReturns;
|
|
7
|
+
//# sourceMappingURL=accumulate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accumulate.d.ts","sourceRoot":"","sources":["../../../../src/worker/pipeline/accumulate.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,qCAAqC,EACrC,yCAAyC,EACzC,0CAA0C,EAC1C,6CAA6C,EAE7C,8CAA8C,EAE9C,6CAA6C,EAE7C,gDAAgD,EAEhD,mDAAmD,EACnD,mCAAmC,EACnC,uCAAuC,EAEvC,wCAAwC,EACxC,oCAAoC,EACpC,wCAAwC,EACxC,yCAAyC,EAEzC,uCAAuC,EACxC,MAAM,6CAA6C,CAAC;AAwBrD,wBAAsB,SAAS,CAAC,EAAE,EAAE,mCAAmC,EAAE,MAAM,EAAE,uCAAuC,GAAG,wCAAwC,CAQlK;AAgBD,wBAAsB,UAAU,CAAC,EAAE,EAAE,oCAAoC,EAAE,MAAM,EAAE,wCAAwC,EAAE,KAAK,EAAE,uCAAuC,GAAG,yCAAyC,CAMtN;AAeD,wBAAsB,WAAW,CAAC,EAAE,EAAE,qCAAqC,EAAE,MAAM,EAAE,yCAAyC,GAAG,0CAA0C,CAI1K;AAeD,wBAAgB,cAAc,CAAC,QAAQ,EAAE,8CAA8C,EAAE,OAAO,EAAE,6CAA6C,GAAG,6CAA6C,CA6B9L;AAcD,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,gDAAgD,GAAG,mDAAmD,CAYhJ"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { REGEX_PARENTHETICAL_CONTENT } from '../../lib/regex.js';
|
|
2
|
+
export async function readState(kv, pageId) {
|
|
3
|
+
const raw = await kv.get(`statuspage:${pageId}`);
|
|
4
|
+
if (raw === null) {
|
|
5
|
+
return null;
|
|
6
|
+
}
|
|
7
|
+
return JSON.parse(raw);
|
|
8
|
+
}
|
|
9
|
+
export async function writeState(kv, pageId, state) {
|
|
10
|
+
const serializedState = JSON.stringify(state);
|
|
11
|
+
await kv.put(`statuspage:${pageId}`, serializedState, { expirationTtl: 86400 });
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
export async function deleteState(kv, pageId) {
|
|
15
|
+
await kv.delete(`statuspage:${pageId}`);
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
export function diffComponents(previous, current) {
|
|
19
|
+
const diff = [];
|
|
20
|
+
const previousMap = previous;
|
|
21
|
+
const currentMap = current;
|
|
22
|
+
for (const id of Object.keys(currentMap)) {
|
|
23
|
+
const currentEntry = currentMap[id];
|
|
24
|
+
if (currentEntry === undefined) {
|
|
25
|
+
continue;
|
|
26
|
+
}
|
|
27
|
+
const name = currentEntry['name'];
|
|
28
|
+
const newStatus = currentEntry['status'];
|
|
29
|
+
const previousEntry = previousMap[id];
|
|
30
|
+
const oldStatus = (previousEntry !== undefined) ? previousEntry['status'] : undefined;
|
|
31
|
+
const changed = oldStatus !== newStatus;
|
|
32
|
+
const entry = {
|
|
33
|
+
name,
|
|
34
|
+
oldStatus,
|
|
35
|
+
newStatus,
|
|
36
|
+
changed,
|
|
37
|
+
};
|
|
38
|
+
diff.push(entry);
|
|
39
|
+
}
|
|
40
|
+
return diff;
|
|
41
|
+
}
|
|
42
|
+
export function formatComponentLines(diff) {
|
|
43
|
+
const inputDiff = diff;
|
|
44
|
+
return inputDiff.map((entry) => {
|
|
45
|
+
const cleanName = entry['name'].replace(new RegExp(REGEX_PARENTHETICAL_CONTENT, 'g'), '').trim();
|
|
46
|
+
const humanized = entry['newStatus']
|
|
47
|
+
.split('_')
|
|
48
|
+
.map((word) => word.charAt(0).toUpperCase() + word.slice(1))
|
|
49
|
+
.join(' ');
|
|
50
|
+
return `- ${cleanName} (${humanized})`;
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=accumulate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accumulate.js","sourceRoot":"","sources":["../../../../src/worker/pipeline/accumulate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,oBAAoB,CAAC;AAgDjE,MAAM,CAAC,KAAK,UAAU,SAAS,CAAC,EAAuC,EAAE,MAA+C;IACtH,MAAM,GAAG,GAAyC,MAAM,EAAE,CAAC,GAAG,CAAC,cAAc,MAAM,EAAE,CAAC,CAAC;IAEvF,IAAI,GAAG,KAAK,IAAI,EAAE,CAAC;QACjB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;AACzB,CAAC;AAgBD,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,EAAwC,EAAE,MAAgD,EAAE,KAA8C;IACzK,MAAM,eAAe,GAAsD,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IAEjG,MAAM,EAAE,CAAC,GAAG,CAAC,cAAc,MAAM,EAAE,EAAE,eAAe,EAAE,EAAE,aAAa,EAAE,KAAK,EAAE,CAAC,CAAC;IAEhF,OAAO;AACT,CAAC;AAeD,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,EAAyC,EAAE,MAAiD;IAC5H,MAAM,EAAE,CAAC,MAAM,CAAC,cAAc,MAAM,EAAE,CAAC,CAAC;IAExC,OAAO;AACT,CAAC;AAeD,MAAM,UAAU,cAAc,CAAC,QAAwD,EAAE,OAAsD;IAC7I,MAAM,IAAI,GAAsC,EAAE,CAAC;IACnD,MAAM,WAAW,GAAsC,QAAQ,CAAC;IAChE,MAAM,UAAU,GAAsC,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AAK,CAAC,CAAC,CAAC,CAAC;aAC3D,IAAI,CAAC,GAAG,CAAC,CAAC;QAEb,OAAO,KAAK,SAAS,KAAK,SAAS,GAAG,CAAC;IACzC,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { WorkerPipelineAuthenticateAuthConfig, WorkerPipelineAuthenticateCredentials, WorkerPipelineAuthenticateResult } from '../../types/worker/pipeline/authenticate.d.ts';
|
|
2
|
+
declare function authenticate(authConfig: WorkerPipelineAuthenticateAuthConfig, credentials: WorkerPipelineAuthenticateCredentials): WorkerPipelineAuthenticateResult;
|
|
3
|
+
export { authenticate, };
|
|
4
|
+
//# sourceMappingURL=authenticate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authenticate.d.ts","sourceRoot":"","sources":["../../../../src/worker/pipeline/authenticate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAIV,oCAAoC,EAEpC,qCAAqC,EAOrC,gCAAgC,EAEjC,MAAM,+CAA+C,CAAC;AAUvD,iBAAS,YAAY,CAAC,UAAU,EAAE,oCAAoC,EAAE,WAAW,EAAE,qCAAqC,GAAG,gCAAgC,CAkE5J;AAED,OAAO,EACL,YAAY,GACb,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
function authenticate(authConfig, credentials) {
|
|
2
|
+
if (authConfig['type'] === 'http') {
|
|
3
|
+
const token = authConfig['token'];
|
|
4
|
+
if (token === undefined) {
|
|
5
|
+
return { authenticated: true };
|
|
6
|
+
}
|
|
7
|
+
const authorization = credentials['authorization'];
|
|
8
|
+
if (authorization === undefined) {
|
|
9
|
+
return {
|
|
10
|
+
authenticated: false, reason: 'Missing Authorization header',
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
const isBearerMatch = authorization === `Bearer ${token}`;
|
|
14
|
+
const isRawMatch = authorization === token;
|
|
15
|
+
if (isBearerMatch === true || isRawMatch === true) {
|
|
16
|
+
return { authenticated: true };
|
|
17
|
+
}
|
|
18
|
+
return {
|
|
19
|
+
authenticated: false, reason: 'Invalid token',
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
const allowedFrom = authConfig['allowed_from'];
|
|
23
|
+
if (allowedFrom === undefined) {
|
|
24
|
+
return { authenticated: true };
|
|
25
|
+
}
|
|
26
|
+
const from = credentials['from'];
|
|
27
|
+
if (from === undefined) {
|
|
28
|
+
return {
|
|
29
|
+
authenticated: false, reason: 'Missing sender address',
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
const normalizedAllowedFrom = allowedFrom.toLowerCase();
|
|
33
|
+
const normalizedFrom = from.toLowerCase();
|
|
34
|
+
if (normalizedAllowedFrom.startsWith('*@') === true) {
|
|
35
|
+
const allowedDomain = normalizedAllowedFrom.slice(1);
|
|
36
|
+
const atIndex = normalizedFrom.indexOf('@');
|
|
37
|
+
const fromDomain = normalizedFrom.slice(atIndex);
|
|
38
|
+
if (fromDomain === allowedDomain) {
|
|
39
|
+
return { authenticated: true };
|
|
40
|
+
}
|
|
41
|
+
return {
|
|
42
|
+
authenticated: false, reason: 'Sender domain not allowed',
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
if (normalizedFrom === normalizedAllowedFrom) {
|
|
46
|
+
return { authenticated: true };
|
|
47
|
+
}
|
|
48
|
+
return {
|
|
49
|
+
authenticated: false, reason: 'Sender not allowed',
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
export { authenticate, };
|
|
53
|
+
//# sourceMappingURL=authenticate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authenticate.js","sourceRoot":"","sources":["../../../../src/worker/pipeline/authenticate.ts"],"names":[],"mappings":"AAyBA,SAAS,YAAY,CAAC,UAAgD,EAAE,WAAkD;IACxH,IAAI,UAAU,CAAC,MAAM,CAAC,KAAK,MAAM,EAAE,CAAC;QAClC,MAAM,KAAK,GAAoC,UAAU,CAAC,OA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AAM,OAAO,GAAsC,cAAc,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QAC/E,MAAM,UAAU,GAAyC,cAAc,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAEvF,IAAI,UAAU,KAAK,aAAa,EAAE,CAAC;YACjC,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC;QACjC,CAAC;QAED,OAAO;YACL,aAAa,EAAE,KAAK,EAAE,MAAM,EAAE,2BAA2B;SAC1D,CAAC;IACJ,CAAC;IAED,IAAI,cAAc,KAAK,qBAAqB,EAAE,CAAC;QAC7C,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC;IACjC,CAAC;IAED,OAAO;QACL,aAAa,EAAE,KAAK,EAAE,MAAM,EAAE,oBAAoB;KACnD,CAAC;AACJ,CAAC;AAED,OAAO,EACL,YAAY,GACb,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { WorkerPipelineEmailParseEmailReturns, WorkerPipelineEmailRawEmail } from '../../types/worker/pipeline/email.d.ts';
|
|
2
|
+
declare function parseEmail(rawEmail: WorkerPipelineEmailRawEmail): WorkerPipelineEmailParseEmailReturns;
|
|
3
|
+
export { parseEmail, };
|
|
4
|
+
//# sourceMappingURL=email.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"email.d.ts","sourceRoot":"","sources":["../../../../src/worker/pipeline/email.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAqBV,oCAAoC,EAOpC,2BAA2B,EAE5B,MAAM,wCAAwC,CAAC;AA+EhD,iBAAe,UAAU,CAAC,QAAQ,EAAE,2BAA2B,GAAG,oCAAoC,CA2IrG;AAED,OAAO,EACL,UAAU,GACX,CAAC"}
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import { REGEX_EMAIL_ANGLE_BRACKET, REGEX_EMBEDDED_MIME_BOUNDARY, REGEX_HEADER_CONTINUATION, REGEX_MIME_BOUNDARY, } from '../../lib/regex.js';
|
|
2
|
+
import { stripHtml } from '../../lib/utility.js';
|
|
3
|
+
function extractEmailAddress(header) {
|
|
4
|
+
const match = header.match(REGEX_EMAIL_ANGLE_BRACKET);
|
|
5
|
+
return (match !== null && match[1] !== undefined) ? match[1] : header;
|
|
6
|
+
}
|
|
7
|
+
function extractFromMultipart(body, headerSection) {
|
|
8
|
+
const nestedBoundaryMatch = headerSection.match(REGEX_MIME_BOUNDARY);
|
|
9
|
+
const nestedBoundary = (nestedBoundaryMatch !== null && nestedBoundaryMatch[1] !== undefined) ? nestedBoundaryMatch[1] : undefined;
|
|
10
|
+
let text = '';
|
|
11
|
+
let html = '';
|
|
12
|
+
if (nestedBoundary === undefined) {
|
|
13
|
+
return {
|
|
14
|
+
text, html,
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
const parts = body.split(`--${nestedBoundary}`);
|
|
18
|
+
for (const part of parts) {
|
|
19
|
+
const trimmedPart = part.trim();
|
|
20
|
+
if (trimmedPart === '' || trimmedPart === '--') {
|
|
21
|
+
continue;
|
|
22
|
+
}
|
|
23
|
+
const separator = [
|
|
24
|
+
'\r\n',
|
|
25
|
+
'\r\n',
|
|
26
|
+
].join('');
|
|
27
|
+
const separatorIndex = trimmedPart.indexOf(separator);
|
|
28
|
+
if (separatorIndex === -1) {
|
|
29
|
+
continue;
|
|
30
|
+
}
|
|
31
|
+
const partContentType = trimmedPart.slice(0, separatorIndex).toLowerCase();
|
|
32
|
+
const partBody = trimmedPart.slice(separatorIndex + 4).trim();
|
|
33
|
+
if (partContentType.includes('text/plain') === true && text === '') {
|
|
34
|
+
text = partBody;
|
|
35
|
+
}
|
|
36
|
+
else if (partContentType.includes('text/html') === true && html === '') {
|
|
37
|
+
html = partBody;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
return {
|
|
41
|
+
text, html,
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
async function parseEmail(rawEmail) {
|
|
45
|
+
const separator = [
|
|
46
|
+
'\r\n',
|
|
47
|
+
'\r\n',
|
|
48
|
+
].join('');
|
|
49
|
+
const headerSeparatorIndex = rawEmail.indexOf(separator);
|
|
50
|
+
const headerSection = (headerSeparatorIndex !== -1) ? rawEmail.slice(0, headerSeparatorIndex) : rawEmail;
|
|
51
|
+
const bodySection = (headerSeparatorIndex !== -1) ? rawEmail.slice(headerSeparatorIndex + 4) : '';
|
|
52
|
+
const unfoldedHeaderSection = headerSection.replace(new RegExp(REGEX_HEADER_CONTINUATION, 'g'), ' ');
|
|
53
|
+
const headerLines = unfoldedHeaderSection.split('\r\n');
|
|
54
|
+
const headers = new Map();
|
|
55
|
+
for (const headerLine of headerLines) {
|
|
56
|
+
const colonIndex = headerLine.indexOf(':');
|
|
57
|
+
if (colonIndex === -1) {
|
|
58
|
+
continue;
|
|
59
|
+
}
|
|
60
|
+
const key = headerLine.slice(0, colonIndex).trim().toLowerCase();
|
|
61
|
+
const value = headerLine.slice(colonIndex + 1).trim();
|
|
62
|
+
headers.set(key, value);
|
|
63
|
+
}
|
|
64
|
+
const from = extractEmailAddress(headers.get('from') ?? '');
|
|
65
|
+
const to = extractEmailAddress(headers.get('to') ?? '');
|
|
66
|
+
const subject = headers.get('subject') ?? '';
|
|
67
|
+
const contentType = headers.get('content-type') ?? 'text/plain';
|
|
68
|
+
const boundaryMatch = contentType.match(REGEX_MIME_BOUNDARY);
|
|
69
|
+
const boundary = (boundaryMatch !== null && boundaryMatch[1] !== undefined) ? boundaryMatch[1] : undefined;
|
|
70
|
+
if (boundary !== undefined) {
|
|
71
|
+
const parts = bodySection.split(`--${boundary}`);
|
|
72
|
+
let textBody = '';
|
|
73
|
+
let htmlBody = '';
|
|
74
|
+
for (const part of parts) {
|
|
75
|
+
const trimmedPart = part.trim();
|
|
76
|
+
if (trimmedPart === '' || trimmedPart === '--') {
|
|
77
|
+
continue;
|
|
78
|
+
}
|
|
79
|
+
const partSeparator = [
|
|
80
|
+
'\r\n',
|
|
81
|
+
'\r\n',
|
|
82
|
+
].join('');
|
|
83
|
+
const partHeaderSeparatorIndex = trimmedPart.indexOf(partSeparator);
|
|
84
|
+
if (partHeaderSeparatorIndex === -1) {
|
|
85
|
+
continue;
|
|
86
|
+
}
|
|
87
|
+
const partContentType = trimmedPart.slice(0, partHeaderSeparatorIndex).toLowerCase();
|
|
88
|
+
const partBody = trimmedPart.slice(partHeaderSeparatorIndex + 4);
|
|
89
|
+
if (partContentType.includes('text/plain') === true) {
|
|
90
|
+
textBody = partBody.trim();
|
|
91
|
+
}
|
|
92
|
+
else if (partContentType.includes('text/html') === true) {
|
|
93
|
+
htmlBody = partBody.trim();
|
|
94
|
+
}
|
|
95
|
+
else if (partContentType.includes('multipart/') === true) {
|
|
96
|
+
const nestedPartHeaders = trimmedPart.slice(0, partHeaderSeparatorIndex);
|
|
97
|
+
const nestedResult = extractFromMultipart(partBody, nestedPartHeaders);
|
|
98
|
+
if (nestedResult['text'] !== '') {
|
|
99
|
+
textBody = nestedResult['text'];
|
|
100
|
+
}
|
|
101
|
+
if (nestedResult['html'] !== '' && htmlBody === '') {
|
|
102
|
+
htmlBody = nestedResult['html'];
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
if (textBody !== '') {
|
|
107
|
+
return {
|
|
108
|
+
from, to, subject, textBody,
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
if (htmlBody !== '') {
|
|
112
|
+
const strippedBody = stripHtml(htmlBody);
|
|
113
|
+
return {
|
|
114
|
+
from, to, subject, textBody: strippedBody,
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
return {
|
|
118
|
+
from, to, subject, textBody: '',
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
if (contentType.includes('text/html') === true) {
|
|
122
|
+
const textBody = stripHtml(bodySection);
|
|
123
|
+
return {
|
|
124
|
+
from, to, subject, textBody,
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
const embeddedBoundaryMatch = bodySection.match(new RegExp(REGEX_EMBEDDED_MIME_BOUNDARY, 'm'));
|
|
128
|
+
if (embeddedBoundaryMatch !== null && embeddedBoundaryMatch[1] !== undefined) {
|
|
129
|
+
const embeddedBoundaryArg = `boundary="${embeddedBoundaryMatch[1]}"`;
|
|
130
|
+
const embeddedResult = extractFromMultipart(bodySection, embeddedBoundaryArg);
|
|
131
|
+
if (embeddedResult['text'] !== '') {
|
|
132
|
+
return {
|
|
133
|
+
from, to, subject, textBody: embeddedResult['text'],
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
if (embeddedResult['html'] !== '') {
|
|
137
|
+
const embeddedHtmlStripped = stripHtml(embeddedResult['html']);
|
|
138
|
+
return {
|
|
139
|
+
from, to, subject, textBody: embeddedHtmlStripped,
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
const textBody = bodySection.trim();
|
|
144
|
+
return {
|
|
145
|
+
from, to, subject, textBody,
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
export { parseEmail, };
|
|
149
|
+
//# sourceMappingURL=email.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"email.js","sourceRoot":"","sources":["../../../../src/worker/pipeline/email.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,yBAAyB,EACzB,4BAA4B,EAC5B,yBAAyB,EACzB,mBAAmB,GACpB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AA0CjD,SAAS,mBAAmB,CAAC,MAAsC;IACjE,MAAM,KAAK,GAAgD,MAAM,CAAC,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAEnG,OAAO,CAAC,KAAK,KAAK,IAAI,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;AACxE,CAAC;AAUD,SAAS,oBAAoB,CAAC,IAAoC,EA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KAAK,EAAE,EAAE,CAAC;YAClC,MAAM,oBAAoB,GAAsD,SAAS,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC;YAElH,OAAO;gBACL,IAAI,EAAE,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,oBAAoB;aAClD,CAAC;QACJ,CAAC;IACH,CAAC;IAED,MAAM,QAAQ,GAAgC,WAAW,CAAC,IAAI,EAAE,CAAC;IAEjE,OAAO;QACL,IAAI,EAAE,EAAE,EAAE,OAAO,EAAE,QAAQ;KAC5B,CAAC;AACJ,CAAC;AAED,OAAO,EACL,UAAU,GACX,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { WorkerPipelineFormatOptions, WorkerPipelineFormatResult } from '../../types/worker/pipeline/format.d.ts';
|
|
2
|
+
import type { WorkerPipelineInterpretNotificationObject } from '../../types/worker/pipeline/interpret.d.ts';
|
|
3
|
+
declare function format(notification: WorkerPipelineInterpretNotificationObject, options: WorkerPipelineFormatOptions): WorkerPipelineFormatResult;
|
|
4
|
+
export { format, };
|
|
5
|
+
//# sourceMappingURL=format.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../../../src/worker/pipeline/format.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAQV,2BAA2B,EAC3B,0BAA0B,EAE3B,MAAM,yCAAyC,CAAC;AACjD,OAAO,KAAK,EAAE,yCAAyC,EAAE,MAAM,4CAA4C,CAAC;AAU5G,iBAAS,MAAM,CAAC,YAAY,EAAE,yCAAyC,EAAE,OAAO,EAAE,2BAA2B,GAAG,0BAA0B,CA0DzI;AAED,OAAO,EACL,MAAM,GACP,CAAC"}
|