@hintergrund/worker 0.1.5 → 0.1.7
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/dist/api/cms/handlers/admin-users.handler.d.ts +8 -0
- package/dist/api/cms/handlers/admin-users.handler.d.ts.map +1 -0
- package/dist/api/cms/handlers/admin-users.handler.js +121 -0
- package/dist/api/cms/handlers/agent-conversations.handler.d.ts +7 -0
- package/dist/api/cms/handlers/agent-conversations.handler.d.ts.map +1 -0
- package/dist/api/cms/handlers/agent-conversations.handler.js +94 -0
- package/dist/api/cms/handlers/auth.handler.d.ts +0 -3
- package/dist/api/cms/handlers/auth.handler.d.ts.map +1 -1
- package/dist/api/cms/handlers/auth.handler.js +74 -153
- package/dist/api/cms/handlers/website-repo.handler.d.ts +8 -0
- package/dist/api/cms/handlers/website-repo.handler.d.ts.map +1 -0
- package/dist/api/cms/handlers/website-repo.handler.js +148 -0
- package/dist/api/cms/routes/index.d.ts.map +1 -1
- package/dist/api/cms/routes/index.js +16 -4
- package/dist/api/emails/handlers/campaigns.handler.d.ts +10 -23
- package/dist/api/emails/handlers/campaigns.handler.d.ts.map +1 -1
- package/dist/api/emails/handlers/campaigns.handler.js +164 -92
- package/dist/api/emails/handlers/invoice.handler.d.ts +5 -19
- package/dist/api/emails/handlers/invoice.handler.d.ts.map +1 -1
- package/dist/api/emails/handlers/invoice.handler.js +58 -340
- package/dist/api/emails/handlers/public.handler.d.ts +6 -29
- package/dist/api/emails/handlers/public.handler.d.ts.map +1 -1
- package/dist/api/emails/handlers/public.handler.js +150 -312
- package/dist/api/emails/handlers/send.handler.d.ts +5 -17
- package/dist/api/emails/handlers/send.handler.d.ts.map +1 -1
- package/dist/api/emails/handlers/send.handler.js +107 -92
- package/dist/api/emails/handlers/settings.handler.d.ts +28 -33
- package/dist/api/emails/handlers/settings.handler.d.ts.map +1 -1
- package/dist/api/emails/handlers/settings.handler.js +96 -287
- package/dist/api/emails/handlers/subscribers.handler.d.ts +13 -0
- package/dist/api/emails/handlers/subscribers.handler.d.ts.map +1 -0
- package/dist/api/emails/handlers/subscribers.handler.js +125 -0
- package/dist/api/emails/handlers/webhook.handler.d.ts +1 -2
- package/dist/api/emails/handlers/webhook.handler.d.ts.map +1 -1
- package/dist/api/emails/handlers/webhook.handler.js +66 -166
- package/dist/api/emails/routes/admin.routes.d.ts +1 -3
- package/dist/api/emails/routes/admin.routes.d.ts.map +1 -1
- package/dist/api/emails/routes/admin.routes.js +19 -49
- package/dist/api/emails/routes/public.routes.d.ts +1 -3
- package/dist/api/emails/routes/public.routes.d.ts.map +1 -1
- package/dist/api/emails/routes/public.routes.js +2 -9
- package/dist/api/shop/handlers/prices.handler.d.ts +2 -15
- package/dist/api/shop/handlers/prices.handler.d.ts.map +1 -1
- package/dist/api/shop/handlers/prices.handler.js +2 -83
- package/dist/api/shop/handlers/products.handler.d.ts +29 -20
- package/dist/api/shop/handlers/products.handler.d.ts.map +1 -1
- package/dist/api/shop/handlers/products.handler.js +195 -162
- package/dist/api/shop/handlers/public.handler.d.ts +24 -8
- package/dist/api/shop/handlers/public.handler.d.ts.map +1 -1
- package/dist/api/shop/handlers/public.handler.js +525 -78
- package/dist/api/shop/routes.d.ts.map +1 -1
- package/dist/api/shop/routes.js +14 -9
- package/dist/hintergrund-assets.d.ts +3 -2
- package/dist/hintergrund-assets.d.ts.map +1 -1
- package/dist/hintergrund-assets.js +4 -2
- package/dist/index.d.ts +14 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +44 -4
- package/dist/lib/auth/crypto.d.ts +2 -15
- package/dist/lib/auth/crypto.d.ts.map +1 -1
- package/dist/lib/auth/crypto.js +8 -95
- package/dist/lib/auth/jwt.d.ts +0 -4
- package/dist/lib/auth/jwt.d.ts.map +1 -1
- package/dist/lib/auth/jwt.js +0 -6
- package/dist/lib/config.d.ts +1 -1
- package/dist/lib/config.d.ts.map +1 -1
- package/dist/lib/config.js +42 -86
- package/dist/lib/email-template.d.ts +15 -0
- package/dist/lib/email-template.d.ts.map +1 -0
- package/dist/lib/email-template.js +58 -0
- package/dist/lib/email.d.ts +18 -8
- package/dist/lib/email.d.ts.map +1 -1
- package/dist/lib/email.js +59 -70
- package/dist/lib/github-config.d.ts +19 -0
- package/dist/lib/github-config.d.ts.map +1 -0
- package/dist/lib/github-config.js +23 -0
- package/dist/lib/github.d.ts +10 -0
- package/dist/lib/github.d.ts.map +1 -1
- package/dist/lib/github.js +20 -2
- package/dist/lib/project-db.d.ts +24 -0
- package/dist/lib/project-db.d.ts.map +1 -0
- package/dist/lib/project-db.js +172 -0
- package/dist/lib/template.js +4 -4
- package/dist/middleware/auth.d.ts +0 -2
- package/dist/middleware/auth.d.ts.map +1 -1
- package/dist/middleware/auth.js +21 -50
- package/package.json +2 -1
- package/dist/api/builder/handlers/generate.handler.d.ts +0 -12
- package/dist/api/builder/handlers/generate.handler.d.ts.map +0 -1
- package/dist/api/builder/handlers/generate.handler.js +0 -203
- package/dist/api/builder/handlers/template.handler.d.ts +0 -12
- package/dist/api/builder/handlers/template.handler.d.ts.map +0 -1
- package/dist/api/builder/handlers/template.handler.js +0 -208
- package/dist/api/builder/routes.d.ts +0 -7
- package/dist/api/builder/routes.d.ts.map +0 -1
- package/dist/api/builder/routes.js +0 -15
- package/dist/api/cms/handlers/assets.handler.d.ts +0 -31
- package/dist/api/cms/handlers/assets.handler.d.ts.map +0 -1
- package/dist/api/cms/handlers/assets.handler.js +0 -200
- package/dist/api/cms/handlers/config.handler.d.ts +0 -7
- package/dist/api/cms/handlers/config.handler.d.ts.map +0 -1
- package/dist/api/cms/handlers/config.handler.js +0 -37
- package/dist/api/cms/handlers/content.handler.d.ts +0 -21
- package/dist/api/cms/handlers/content.handler.d.ts.map +0 -1
- package/dist/api/cms/handlers/content.handler.js +0 -117
- package/dist/api/cms/routes/assets.routes.d.ts +0 -4
- package/dist/api/cms/routes/assets.routes.d.ts.map +0 -1
- package/dist/api/cms/routes/assets.routes.js +0 -13
- package/dist/api/cms/routes/content.routes.d.ts +0 -4
- package/dist/api/cms/routes/content.routes.d.ts.map +0 -1
- package/dist/api/cms/routes/content.routes.js +0 -11
- package/dist/api/emails/handlers/branding.handler.d.ts +0 -17
- package/dist/api/emails/handlers/branding.handler.d.ts.map +0 -1
- package/dist/api/emails/handlers/branding.handler.js +0 -120
- package/dist/api/emails/handlers/contacts.handler.d.ts +0 -37
- package/dist/api/emails/handlers/contacts.handler.d.ts.map +0 -1
- package/dist/api/emails/handlers/contacts.handler.js +0 -161
- package/dist/api/emails/handlers/templates.handler.d.ts +0 -32
- package/dist/api/emails/handlers/templates.handler.d.ts.map +0 -1
- package/dist/api/emails/handlers/templates.handler.js +0 -132
- package/dist/api/newsletter/handlers/email.handler.d.ts +0 -7
- package/dist/api/newsletter/handlers/email.handler.d.ts.map +0 -1
- package/dist/api/newsletter/handlers/email.handler.js +0 -102
- package/dist/api/newsletter/handlers/emails.handler.d.ts +0 -31
- package/dist/api/newsletter/handlers/emails.handler.d.ts.map +0 -1
- package/dist/api/newsletter/handlers/emails.handler.js +0 -262
- package/dist/api/newsletter/handlers/invoice.handler.d.ts +0 -22
- package/dist/api/newsletter/handlers/invoice.handler.d.ts.map +0 -1
- package/dist/api/newsletter/handlers/invoice.handler.js +0 -455
- package/dist/api/newsletter/handlers/public.handler.d.ts +0 -22
- package/dist/api/newsletter/handlers/public.handler.d.ts.map +0 -1
- package/dist/api/newsletter/handlers/public.handler.js +0 -300
- package/dist/api/newsletter/handlers/send.handler.d.ts +0 -12
- package/dist/api/newsletter/handlers/send.handler.d.ts.map +0 -1
- package/dist/api/newsletter/handlers/send.handler.js +0 -153
- package/dist/api/newsletter/handlers/subscribers.handler.d.ts +0 -22
- package/dist/api/newsletter/handlers/subscribers.handler.d.ts.map +0 -1
- package/dist/api/newsletter/handlers/subscribers.handler.js +0 -195
- package/dist/api/newsletter/routes/admin.routes.d.ts +0 -4
- package/dist/api/newsletter/routes/admin.routes.d.ts.map +0 -1
- package/dist/api/newsletter/routes/admin.routes.js +0 -28
- package/dist/api/newsletter/routes/index.d.ts +0 -4
- package/dist/api/newsletter/routes/index.d.ts.map +0 -1
- package/dist/api/newsletter/routes/index.js +0 -9
- package/dist/api/newsletter/routes/public.routes.d.ts +0 -4
- package/dist/api/newsletter/routes/public.routes.d.ts.map +0 -1
- package/dist/api/newsletter/routes/public.routes.js +0 -9
- package/dist/api/shop/handlers/assets.handler.d.ts +0 -3
- package/dist/api/shop/handlers/assets.handler.d.ts.map +0 -1
- package/dist/api/shop/handlers/assets.handler.js +0 -62
- package/dist/api/shop/handlers/checkout.handler.d.ts +0 -10
- package/dist/api/shop/handlers/checkout.handler.d.ts.map +0 -1
- package/dist/api/shop/handlers/checkout.handler.js +0 -50
- package/dist/api/shop/handlers/customers.handler.d.ts +0 -17
- package/dist/api/shop/handlers/customers.handler.d.ts.map +0 -1
- package/dist/api/shop/handlers/customers.handler.js +0 -89
- package/dist/api/shop/handlers/orders.handler.d.ts +0 -17
- package/dist/api/shop/handlers/orders.handler.d.ts.map +0 -1
- package/dist/api/shop/handlers/orders.handler.js +0 -84
- package/dist/api/shop/handlers/stats.handler.d.ts +0 -10
- package/dist/api/shop/handlers/stats.handler.d.ts.map +0 -1
- package/dist/api/shop/handlers/stats.handler.js +0 -71
- package/dist/api/shop/handlers/webhook.handler.d.ts +0 -10
- package/dist/api/shop/handlers/webhook.handler.d.ts.map +0 -1
- package/dist/api/shop/handlers/webhook.handler.js +0 -233
- package/dist/cms-assets.d.ts +0 -4
- package/dist/cms-assets.d.ts.map +0 -1
- package/dist/cms-assets.js +0 -5
- package/dist/cms-bundle.d.ts +0 -3
- package/dist/cms-bundle.d.ts.map +0 -1
- package/dist/cms-bundle.js +0 -4
- package/dist/config-loader.d.ts +0 -26
- package/dist/config-loader.d.ts.map +0 -1
- package/dist/config-loader.js +0 -98
- package/dist/jwt.d.ts +0 -26
- package/dist/jwt.d.ts.map +0 -1
- package/dist/jwt.js +0 -102
- package/dist/lib/plunk.d.ts +0 -204
- package/dist/lib/plunk.d.ts.map +0 -1
- package/dist/lib/plunk.js +0 -259
- package/dist/template.d.ts +0 -2
- package/dist/template.d.ts.map +0 -1
- package/dist/template.js +0 -61
- package/dist/utils.d.ts +0 -23
- package/dist/utils.d.ts.map +0 -1
- package/dist/utils.js +0 -110
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import { getGitHubConfig } from '../../../lib/config';
|
|
2
|
+
import { createGitHubClient } from '../../../lib/github';
|
|
3
|
+
const STATIC_MIME_TYPES = {
|
|
4
|
+
'.jpg': 'image/jpeg',
|
|
5
|
+
'.jpeg': 'image/jpeg',
|
|
6
|
+
'.png': 'image/png',
|
|
7
|
+
'.gif': 'image/gif',
|
|
8
|
+
'.svg': 'image/svg+xml',
|
|
9
|
+
'.webp': 'image/webp',
|
|
10
|
+
'.ico': 'image/x-icon',
|
|
11
|
+
};
|
|
12
|
+
const MAX_UPLOAD_BYTES = 10 * 1024 * 1024;
|
|
13
|
+
function getStaticMimeType(path) {
|
|
14
|
+
const ext = path.slice(((path.lastIndexOf('.') - 1) >>> 0) + 2).toLowerCase();
|
|
15
|
+
return STATIC_MIME_TYPES['.' + ext] ?? null;
|
|
16
|
+
}
|
|
17
|
+
function normalizePath(path) {
|
|
18
|
+
return path.replace(/^\/+/, '').replace(/\\/g, '/');
|
|
19
|
+
}
|
|
20
|
+
export function isAllowedWebsitePath(path) {
|
|
21
|
+
const normalized = normalizePath(path);
|
|
22
|
+
if (normalized.includes('..'))
|
|
23
|
+
return false;
|
|
24
|
+
return normalized.startsWith('frontend/');
|
|
25
|
+
}
|
|
26
|
+
async function listRepoFiles(c) {
|
|
27
|
+
const client = createGitHubClient(getGitHubConfig(c.env));
|
|
28
|
+
const { owner, repo, branch } = client.getRepoInfo();
|
|
29
|
+
const octokit = client.getOctokit();
|
|
30
|
+
const tree = await octokit.rest.git.getTree({ owner, repo, tree_sha: branch, recursive: 'true' });
|
|
31
|
+
const paths = tree.data.tree
|
|
32
|
+
.filter((item) => item.type === 'blob' && item.path && isAllowedWebsitePath(item.path))
|
|
33
|
+
.filter((item) => !getStaticMimeType(item.path)) // text files only
|
|
34
|
+
.map((item) => item.path);
|
|
35
|
+
const files = {};
|
|
36
|
+
const results = await client.readFiles(paths);
|
|
37
|
+
for (const [path, result] of results) {
|
|
38
|
+
if (result)
|
|
39
|
+
files[path] = result;
|
|
40
|
+
}
|
|
41
|
+
return files;
|
|
42
|
+
}
|
|
43
|
+
async function listStaticAssets(c) {
|
|
44
|
+
const client = createGitHubClient(getGitHubConfig(c.env));
|
|
45
|
+
const { owner, repo, branch } = client.getRepoInfo();
|
|
46
|
+
const octokit = client.getOctokit();
|
|
47
|
+
const tree = await octokit.rest.git.getTree({ owner, repo, tree_sha: branch, recursive: 'true' });
|
|
48
|
+
const assetPaths = tree.data.tree
|
|
49
|
+
.filter((item) => item.type === 'blob' &&
|
|
50
|
+
item.path &&
|
|
51
|
+
item.path.startsWith('frontend/static/') &&
|
|
52
|
+
getStaticMimeType(item.path) !== null)
|
|
53
|
+
.map((item) => item.path);
|
|
54
|
+
return assetPaths.map((path) => {
|
|
55
|
+
const name = path.split('/').pop();
|
|
56
|
+
const mimeType = getStaticMimeType(path);
|
|
57
|
+
return { name, path, content: '', mimeType };
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
export async function headWebsiteRepo(c) {
|
|
61
|
+
const client = createGitHubClient(getGitHubConfig(c.env));
|
|
62
|
+
const commitSha = await client.getCommitSha();
|
|
63
|
+
return c.json({ commitSha });
|
|
64
|
+
}
|
|
65
|
+
export async function syncWebsiteRepo(c) {
|
|
66
|
+
const client = createGitHubClient(getGitHubConfig(c.env));
|
|
67
|
+
const [files, commitSha, staticAssets] = await Promise.all([
|
|
68
|
+
listRepoFiles(c),
|
|
69
|
+
client.getCommitSha(),
|
|
70
|
+
listStaticAssets(c),
|
|
71
|
+
]);
|
|
72
|
+
const srcFiles = Object.entries(files).map(([path, file]) => ({
|
|
73
|
+
path,
|
|
74
|
+
content: file.content,
|
|
75
|
+
sha: file.sha,
|
|
76
|
+
}));
|
|
77
|
+
return c.json({ files, srcFiles, staticAssets, commitSha });
|
|
78
|
+
}
|
|
79
|
+
export async function commitWebsiteRepo(c) {
|
|
80
|
+
const body = await c.req.json();
|
|
81
|
+
const filesInput = Array.isArray(body.files) ? body.files : [];
|
|
82
|
+
const files = filesInput.map((file) => ({
|
|
83
|
+
path: normalizePath(String(file.path ?? '')),
|
|
84
|
+
content: String(file.content ?? ''),
|
|
85
|
+
encoding: file.encoding === 'base64' ? 'base64' : 'utf8',
|
|
86
|
+
}));
|
|
87
|
+
const invalidPath = files.find((f) => !isAllowedWebsitePath(f.path));
|
|
88
|
+
if (invalidPath) {
|
|
89
|
+
return c.json({ error: `Path is not allowed for website sync: ${invalidPath.path}` }, 400);
|
|
90
|
+
}
|
|
91
|
+
if (files.length === 0) {
|
|
92
|
+
return c.json({ error: 'No files to commit' }, 400);
|
|
93
|
+
}
|
|
94
|
+
const client = createGitHubClient(getGitHubConfig(c.env));
|
|
95
|
+
if (body.baseCommitSha) {
|
|
96
|
+
const noConflict = await client.checkNoConflict(String(body.baseCommitSha));
|
|
97
|
+
if (!noConflict) {
|
|
98
|
+
return c.json({ conflict: true, message: 'Repository changed since the last sync' }, 409);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
const commitSha = await client.writeFilesAtomic(files, String(body.message || 'Publish website changes'), body.baseCommitSha ? String(body.baseCommitSha) : undefined);
|
|
102
|
+
return c.json({ success: true, commitSha });
|
|
103
|
+
}
|
|
104
|
+
function sanitizeFilename(name) {
|
|
105
|
+
const lower = name.toLowerCase();
|
|
106
|
+
const sanitized = lower.replace(/[^a-z0-9._-]/g, '-');
|
|
107
|
+
const trimmed = sanitized.replace(/^\.+|\.+$/g, '').replace(/^-+|-+$/g, '');
|
|
108
|
+
return trimmed.slice(0, 200) || 'file';
|
|
109
|
+
}
|
|
110
|
+
export async function uploadWebsiteAsset(c) {
|
|
111
|
+
const formData = await c.req.formData();
|
|
112
|
+
const moduleVal = formData.get('module');
|
|
113
|
+
const fileVal = formData.get('file');
|
|
114
|
+
const nameOverride = formData.get('name');
|
|
115
|
+
if (typeof moduleVal !== 'string' || !['cms', 'shop', 'builder', 'email'].includes(moduleVal)) {
|
|
116
|
+
return c.json({ error: 'module must be cms, shop, builder, or email' }, 400);
|
|
117
|
+
}
|
|
118
|
+
const module = moduleVal;
|
|
119
|
+
if (!fileVal || typeof fileVal === 'string') {
|
|
120
|
+
return c.json({ error: 'file field is required' }, 400);
|
|
121
|
+
}
|
|
122
|
+
const uploadedFile = fileVal;
|
|
123
|
+
if (uploadedFile.size > MAX_UPLOAD_BYTES) {
|
|
124
|
+
return c.json({ error: 'File exceeds 10 MB limit' }, 400);
|
|
125
|
+
}
|
|
126
|
+
const rawName = typeof nameOverride === 'string' && nameOverride.trim()
|
|
127
|
+
? nameOverride.trim()
|
|
128
|
+
: uploadedFile.name;
|
|
129
|
+
const name = sanitizeFilename(rawName);
|
|
130
|
+
const mimeType = uploadedFile.type || getStaticMimeType(name) || 'application/octet-stream';
|
|
131
|
+
const arrayBuffer = await uploadedFile.arrayBuffer();
|
|
132
|
+
const bytes = new Uint8Array(arrayBuffer);
|
|
133
|
+
let binaryString = '';
|
|
134
|
+
for (let i = 0; i < bytes.length; i++) {
|
|
135
|
+
binaryString += String.fromCharCode(bytes[i]);
|
|
136
|
+
}
|
|
137
|
+
const contentBase64 = btoa(binaryString);
|
|
138
|
+
const staticDir = module === 'email' ? 'emails' : module === 'shop' ? 'shop' : 'cms';
|
|
139
|
+
const path = `frontend/static/${staticDir}/${name}`;
|
|
140
|
+
return c.json({
|
|
141
|
+
success: true,
|
|
142
|
+
path,
|
|
143
|
+
name,
|
|
144
|
+
mimeType,
|
|
145
|
+
contentBase64,
|
|
146
|
+
size: uploadedFile.size,
|
|
147
|
+
});
|
|
148
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/api/cms/routes/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/api/cms/routes/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAkB5B,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAEzC,QAAA,MAAM,SAAS,sDAAsB,CAAC;AAwBtC,eAAe,SAAS,CAAC"}
|
|
@@ -2,15 +2,27 @@ import { Hono } from 'hono';
|
|
|
2
2
|
import { getDashboard } from '../handlers/dashboard.handler';
|
|
3
3
|
import { authMiddleware } from '../../../middleware/auth';
|
|
4
4
|
import authRoutes from './auth.routes';
|
|
5
|
-
import
|
|
6
|
-
import
|
|
5
|
+
import { bootstrapAdminUser, createAdminUser, deleteAdminUser, listAdminUsers, patchAdminUser } from '../handlers/admin-users.handler';
|
|
6
|
+
import { deleteConversation, getAgentApiKey, listConversations, upsertConversation } from '../handlers/agent-conversations.handler';
|
|
7
|
+
import { commitWebsiteRepo, headWebsiteRepo, syncWebsiteRepo, uploadWebsiteAsset } from '../handlers/website-repo.handler';
|
|
7
8
|
const cmsRoutes = new Hono();
|
|
8
9
|
// Dashboard route (protected)
|
|
9
10
|
cmsRoutes.get('/', authMiddleware, getDashboard);
|
|
10
11
|
// Auth routes (public)
|
|
11
12
|
cmsRoutes.route('/', authRoutes);
|
|
13
|
+
cmsRoutes.post('/bootstrap', bootstrapAdminUser);
|
|
12
14
|
// Protected routes
|
|
13
15
|
cmsRoutes.use('/*', authMiddleware);
|
|
14
|
-
cmsRoutes.
|
|
15
|
-
cmsRoutes.
|
|
16
|
+
cmsRoutes.get('/users', listAdminUsers);
|
|
17
|
+
cmsRoutes.post('/users', createAdminUser);
|
|
18
|
+
cmsRoutes.patch('/users/:id', patchAdminUser);
|
|
19
|
+
cmsRoutes.delete('/users/:id', deleteAdminUser);
|
|
20
|
+
cmsRoutes.get('/agent/conversations', listConversations);
|
|
21
|
+
cmsRoutes.post('/agent/conversations', upsertConversation);
|
|
22
|
+
cmsRoutes.delete('/agent/conversations/:id', deleteConversation);
|
|
23
|
+
cmsRoutes.get('/agent/api-key', getAgentApiKey);
|
|
24
|
+
cmsRoutes.get('/website/repo/head', headWebsiteRepo);
|
|
25
|
+
cmsRoutes.get('/website/repo/sync', syncWebsiteRepo);
|
|
26
|
+
cmsRoutes.put('/website/repo/commit', commitWebsiteRepo);
|
|
27
|
+
cmsRoutes.put('/website/repo/upload', uploadWebsiteAsset);
|
|
16
28
|
export default cmsRoutes;
|
|
@@ -1,32 +1,19 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Campaigns Handler
|
|
3
|
-
*
|
|
4
|
-
* Manages email campaigns via Plunk API.
|
|
2
|
+
* Campaigns Handler — D1-backed, no Plunk dependency
|
|
5
3
|
*/
|
|
6
4
|
import { Context } from 'hono';
|
|
7
|
-
/**
|
|
8
|
-
* GET /api/email/admin/campaigns
|
|
9
|
-
* Get all campaigns from Plunk
|
|
10
|
-
*/
|
|
5
|
+
/** GET /api/email/admin/campaigns */
|
|
11
6
|
export declare function getCampaigns(c: Context): Promise<Response>;
|
|
12
|
-
/**
|
|
13
|
-
* GET /api/email/admin/campaigns/:id
|
|
14
|
-
* Get a single campaign from Plunk
|
|
15
|
-
*/
|
|
7
|
+
/** GET /api/email/admin/campaigns/:id */
|
|
16
8
|
export declare function getCampaign(c: Context): Promise<Response>;
|
|
17
|
-
/**
|
|
18
|
-
* POST /api/email/admin/campaigns
|
|
19
|
-
* Create a new campaign in Plunk
|
|
20
|
-
*/
|
|
9
|
+
/** POST /api/email/admin/campaigns */
|
|
21
10
|
export declare function createCampaign(c: Context): Promise<Response>;
|
|
22
|
-
/**
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
11
|
+
/** PATCH /api/email/admin/campaigns/:id */
|
|
12
|
+
export declare function updateCampaign(c: Context): Promise<Response>;
|
|
13
|
+
/** DELETE /api/email/admin/campaigns/:id */
|
|
14
|
+
export declare function deleteCampaign(c: Context): Promise<Response>;
|
|
15
|
+
/** POST /api/email/admin/campaigns/:id/send */
|
|
26
16
|
export declare function sendCampaign(c: Context): Promise<Response>;
|
|
27
|
-
/**
|
|
28
|
-
* POST /api/email/admin/campaigns/:id/test
|
|
29
|
-
* Send a test email for a campaign
|
|
30
|
-
*/
|
|
17
|
+
/** POST /api/email/admin/campaigns/:id/test */
|
|
31
18
|
export declare function testCampaign(c: Context): Promise<Response>;
|
|
32
19
|
//# sourceMappingURL=campaigns.handler.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"campaigns.handler.d.ts","sourceRoot":"","sources":["../../../../src/api/emails/handlers/campaigns.handler.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"campaigns.handler.d.ts","sourceRoot":"","sources":["../../../../src/api/emails/handlers/campaigns.handler.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAsB/B,qCAAqC;AACrC,wBAAsB,YAAY,CAAC,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC,CAWhE;AAED,yCAAyC;AACzC,wBAAsB,WAAW,CAAC,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC,CAW/D;AAED,sCAAsC;AACtC,wBAAsB,cAAc,CAAC,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC,CAuBlE;AAED,2CAA2C;AAC3C,wBAAsB,cAAc,CAAC,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC,CA2BlE;AAED,4CAA4C;AAC5C,wBAAsB,cAAc,CAAC,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC,CAYlE;AAED,+CAA+C;AAC/C,wBAAsB,YAAY,CAAC,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC,CAiEhE;AAED,+CAA+C;AAC/C,wBAAsB,YAAY,CAAC,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC,CA8BhE"}
|
|
@@ -1,139 +1,211 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Campaigns Handler
|
|
3
|
-
*
|
|
4
|
-
* Manages email campaigns via Plunk API.
|
|
5
|
-
*/
|
|
6
|
-
import { createPlunkClient } from '../../../lib/plunk';
|
|
7
|
-
/**
|
|
8
|
-
* GET /api/email/admin/campaigns
|
|
9
|
-
* Get all campaigns from Plunk
|
|
2
|
+
* Campaigns Handler — D1-backed, no Plunk dependency
|
|
10
3
|
*/
|
|
4
|
+
import { getProjectDb, createId } from '../../../lib/project-db';
|
|
5
|
+
import { sendEmail } from '../../../lib/email';
|
|
6
|
+
import { renderEmailTemplate } from '../../../lib/email-template';
|
|
7
|
+
import { readEmailTemplateData } from './settings.handler';
|
|
8
|
+
function rowToCampaign(row) {
|
|
9
|
+
return {
|
|
10
|
+
id: row.id,
|
|
11
|
+
name: row.name,
|
|
12
|
+
subject: row.subject,
|
|
13
|
+
bodyHtml: row.body_html,
|
|
14
|
+
status: row.status,
|
|
15
|
+
recipientCount: row.recipient_count,
|
|
16
|
+
scheduledAt: row.scheduled_at,
|
|
17
|
+
sentAt: row.sent_at,
|
|
18
|
+
createdAt: row.created_at,
|
|
19
|
+
updatedAt: row.updated_at,
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
/** GET /api/email/admin/campaigns */
|
|
11
23
|
export async function getCampaigns(c) {
|
|
12
24
|
try {
|
|
13
|
-
const
|
|
14
|
-
const {
|
|
15
|
-
|
|
25
|
+
const db = getProjectDb(c.env);
|
|
26
|
+
const { results } = await db
|
|
27
|
+
.prepare('SELECT * FROM campaigns ORDER BY created_at DESC')
|
|
28
|
+
.all();
|
|
29
|
+
return c.json({ campaigns: (results ?? []).map(rowToCampaign) });
|
|
16
30
|
}
|
|
17
31
|
catch (error) {
|
|
18
32
|
console.error('Get campaigns error:', error);
|
|
19
|
-
return c.json({
|
|
20
|
-
success: false,
|
|
21
|
-
message: error instanceof Error ? error.message : 'Failed to fetch campaigns',
|
|
22
|
-
}, 500);
|
|
33
|
+
return c.json({ success: false, message: 'Failed to fetch campaigns' }, 500);
|
|
23
34
|
}
|
|
24
35
|
}
|
|
25
|
-
/**
|
|
26
|
-
* GET /api/email/admin/campaigns/:id
|
|
27
|
-
* Get a single campaign from Plunk
|
|
28
|
-
*/
|
|
36
|
+
/** GET /api/email/admin/campaigns/:id */
|
|
29
37
|
export async function getCampaign(c) {
|
|
30
38
|
try {
|
|
31
39
|
const id = c.req.param('id');
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
return c.json({ campaign });
|
|
40
|
+
const db = getProjectDb(c.env);
|
|
41
|
+
const row = await db.prepare('SELECT * FROM campaigns WHERE id = ?').bind(id).first();
|
|
42
|
+
if (!row)
|
|
43
|
+
return c.json({ success: false, message: 'Campaign not found' }, 404);
|
|
44
|
+
return c.json({ campaign: rowToCampaign(row) });
|
|
38
45
|
}
|
|
39
46
|
catch (error) {
|
|
40
47
|
console.error('Get campaign error:', error);
|
|
41
|
-
return c.json({
|
|
42
|
-
success: false,
|
|
43
|
-
message: error instanceof Error ? error.message : 'Failed to fetch campaign',
|
|
44
|
-
}, 500);
|
|
48
|
+
return c.json({ success: false, message: 'Failed to fetch campaign' }, 500);
|
|
45
49
|
}
|
|
46
50
|
}
|
|
47
|
-
/**
|
|
48
|
-
* POST /api/email/admin/campaigns
|
|
49
|
-
* Create a new campaign in Plunk
|
|
50
|
-
*/
|
|
51
|
+
/** POST /api/email/admin/campaigns */
|
|
51
52
|
export async function createCampaign(c) {
|
|
52
53
|
try {
|
|
53
54
|
const body = await c.req.json();
|
|
54
|
-
if (!body.name || !body.subject || !body.
|
|
55
|
-
return c.json({ success: false, message: '
|
|
55
|
+
if (!body.name || !body.subject || !body.bodyHtml) {
|
|
56
|
+
return c.json({ success: false, message: 'name, subject, and bodyHtml are required' }, 400);
|
|
56
57
|
}
|
|
57
|
-
const
|
|
58
|
-
const
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
});
|
|
65
|
-
return c.json({
|
|
66
|
-
success: true,
|
|
67
|
-
campaign: {
|
|
68
|
-
id: result.id,
|
|
69
|
-
},
|
|
70
|
-
});
|
|
58
|
+
const db = getProjectDb(c.env);
|
|
59
|
+
const now = Date.now();
|
|
60
|
+
const id = createId('cam');
|
|
61
|
+
await db.prepare(`INSERT INTO campaigns (id, name, subject, body_html, status, created_at, updated_at)
|
|
62
|
+
VALUES (?, ?, ?, ?, 'draft', ?, ?)`).bind(id, body.name, body.subject, body.bodyHtml, now, now).run();
|
|
63
|
+
const row = await db.prepare('SELECT * FROM campaigns WHERE id = ?').bind(id).first();
|
|
64
|
+
return c.json({ success: true, campaign: rowToCampaign(row) }, 201);
|
|
71
65
|
}
|
|
72
66
|
catch (error) {
|
|
73
67
|
console.error('Create campaign error:', error);
|
|
74
|
-
return c.json({
|
|
75
|
-
success: false,
|
|
76
|
-
message: error instanceof Error ? error.message : 'Failed to create campaign',
|
|
77
|
-
}, 500);
|
|
68
|
+
return c.json({ success: false, message: 'Failed to create campaign' }, 500);
|
|
78
69
|
}
|
|
79
70
|
}
|
|
80
|
-
/**
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
71
|
+
/** PATCH /api/email/admin/campaigns/:id */
|
|
72
|
+
export async function updateCampaign(c) {
|
|
73
|
+
try {
|
|
74
|
+
const id = c.req.param('id');
|
|
75
|
+
const body = await c.req.json();
|
|
76
|
+
const db = getProjectDb(c.env);
|
|
77
|
+
const now = Date.now();
|
|
78
|
+
const existing = await db.prepare('SELECT * FROM campaigns WHERE id = ?').bind(id).first();
|
|
79
|
+
if (!existing)
|
|
80
|
+
return c.json({ success: false, message: 'Campaign not found' }, 404);
|
|
81
|
+
if (existing.status === 'sent')
|
|
82
|
+
return c.json({ success: false, message: 'Cannot edit a sent campaign' }, 400);
|
|
83
|
+
const sets = ['updated_at = ?'];
|
|
84
|
+
const vals = [now];
|
|
85
|
+
if (body.name !== undefined) {
|
|
86
|
+
sets.push('name = ?');
|
|
87
|
+
vals.push(body.name);
|
|
88
|
+
}
|
|
89
|
+
if (body.subject !== undefined) {
|
|
90
|
+
sets.push('subject = ?');
|
|
91
|
+
vals.push(body.subject);
|
|
92
|
+
}
|
|
93
|
+
if (body.bodyHtml !== undefined) {
|
|
94
|
+
sets.push('body_html = ?');
|
|
95
|
+
vals.push(body.bodyHtml);
|
|
96
|
+
}
|
|
97
|
+
vals.push(id);
|
|
98
|
+
await db.prepare(`UPDATE campaigns SET ${sets.join(', ')} WHERE id = ?`).bind(...vals).run();
|
|
99
|
+
const row = await db.prepare('SELECT * FROM campaigns WHERE id = ?').bind(id).first();
|
|
100
|
+
return c.json({ success: true, campaign: rowToCampaign(row) });
|
|
101
|
+
}
|
|
102
|
+
catch (error) {
|
|
103
|
+
console.error('Update campaign error:', error);
|
|
104
|
+
return c.json({ success: false, message: 'Failed to update campaign' }, 500);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
/** DELETE /api/email/admin/campaigns/:id */
|
|
108
|
+
export async function deleteCampaign(c) {
|
|
109
|
+
try {
|
|
110
|
+
const id = c.req.param('id');
|
|
111
|
+
const db = getProjectDb(c.env);
|
|
112
|
+
const existing = await db.prepare('SELECT id FROM campaigns WHERE id = ?').bind(id).first();
|
|
113
|
+
if (!existing)
|
|
114
|
+
return c.json({ success: false, message: 'Campaign not found' }, 404);
|
|
115
|
+
await db.prepare('DELETE FROM campaigns WHERE id = ?').bind(id).run();
|
|
116
|
+
return c.json({ success: true });
|
|
117
|
+
}
|
|
118
|
+
catch (error) {
|
|
119
|
+
console.error('Delete campaign error:', error);
|
|
120
|
+
return c.json({ success: false, message: 'Failed to delete campaign' }, 500);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
/** POST /api/email/admin/campaigns/:id/send */
|
|
84
124
|
export async function sendCampaign(c) {
|
|
85
125
|
try {
|
|
86
126
|
const id = c.req.param('id');
|
|
87
|
-
|
|
88
|
-
|
|
127
|
+
const db = getProjectDb(c.env);
|
|
128
|
+
const row = await db.prepare('SELECT * FROM campaigns WHERE id = ?').bind(id).first();
|
|
129
|
+
if (!row)
|
|
130
|
+
return c.json({ success: false, message: 'Campaign not found' }, 404);
|
|
131
|
+
if (row.status === 'sent')
|
|
132
|
+
return c.json({ success: false, message: 'Campaign already sent' }, 400);
|
|
133
|
+
// Get all subscribed contacts
|
|
134
|
+
const { results: subscribers } = await db
|
|
135
|
+
.prepare("SELECT email, name FROM subscribers WHERE status = 'subscribed'")
|
|
136
|
+
.all();
|
|
137
|
+
if (!subscribers || subscribers.length === 0) {
|
|
138
|
+
return c.json({ success: false, message: 'No subscribed contacts found' }, 400);
|
|
89
139
|
}
|
|
90
|
-
const
|
|
91
|
-
const
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
140
|
+
const now = Date.now();
|
|
141
|
+
const sendId = createId('snd');
|
|
142
|
+
const { settings, logoDataUrl } = await readEmailTemplateData(c.env);
|
|
143
|
+
let sentCount = 0;
|
|
144
|
+
let lastError;
|
|
145
|
+
const origin = new URL(c.req.url).origin;
|
|
146
|
+
// Send to each subscriber
|
|
147
|
+
for (const subscriber of subscribers) {
|
|
148
|
+
const unsubscribeUrl = `${origin}/api/email/unsubscribe?email=${encodeURIComponent(subscriber.email)}`;
|
|
149
|
+
try {
|
|
150
|
+
await sendEmail(c.env, {
|
|
151
|
+
to: subscriber.email,
|
|
152
|
+
toName: subscriber.name ?? undefined,
|
|
153
|
+
subject: row.subject,
|
|
154
|
+
html: renderEmailTemplate({
|
|
155
|
+
bodyHtml: row.body_html,
|
|
156
|
+
template: settings.emailTemplate,
|
|
157
|
+
logoDataUrl,
|
|
158
|
+
unsubscribeUrl,
|
|
159
|
+
}),
|
|
160
|
+
});
|
|
161
|
+
sentCount++;
|
|
162
|
+
}
|
|
163
|
+
catch (err) {
|
|
164
|
+
console.error(`Failed to send to ${subscriber.email}:`, err);
|
|
165
|
+
lastError = err instanceof Error ? err.message : 'Unknown error';
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
const status = sentCount > 0 ? 'sent' : 'failed';
|
|
169
|
+
// Update campaign status
|
|
170
|
+
await db.prepare('UPDATE campaigns SET status = ?, recipient_count = ?, sent_at = ?, updated_at = ? WHERE id = ?').bind(status, sentCount, now, now, id).run();
|
|
171
|
+
// Record send history
|
|
172
|
+
await db.prepare(`INSERT INTO email_sends (id, type, campaign_id, subject, recipient_count, status, error, sent_at, created_at)
|
|
173
|
+
VALUES (?, 'campaign', ?, ?, ?, ?, ?, ?, ?)`).bind(sendId, id, row.subject, sentCount, status, lastError ?? null, now, now).run();
|
|
174
|
+
return c.json({ success: true, recipientCount: sentCount });
|
|
97
175
|
}
|
|
98
176
|
catch (error) {
|
|
99
177
|
console.error('Send campaign error:', error);
|
|
100
|
-
return c.json({
|
|
101
|
-
success: false,
|
|
102
|
-
message: error instanceof Error ? error.message : 'Failed to send campaign',
|
|
103
|
-
}, 500);
|
|
178
|
+
return c.json({ success: false, message: 'Failed to send campaign' }, 500);
|
|
104
179
|
}
|
|
105
180
|
}
|
|
106
|
-
/**
|
|
107
|
-
* POST /api/email/admin/campaigns/:id/test
|
|
108
|
-
* Send a test email for a campaign
|
|
109
|
-
*/
|
|
181
|
+
/** POST /api/email/admin/campaigns/:id/test */
|
|
110
182
|
export async function testCampaign(c) {
|
|
111
183
|
try {
|
|
112
184
|
const id = c.req.param('id');
|
|
113
|
-
if (!id) {
|
|
114
|
-
return c.json({ success: false, message: 'Campaign ID is required' }, 400);
|
|
115
|
-
}
|
|
116
185
|
const body = await c.req.json();
|
|
117
|
-
if (!body.email)
|
|
186
|
+
if (!body.email)
|
|
118
187
|
return c.json({ success: false, message: 'Test email is required' }, 400);
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
122
|
-
if (!emailRegex.test(body.email)) {
|
|
188
|
+
const EMAIL_REGEX = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
189
|
+
if (!EMAIL_REGEX.test(body.email))
|
|
123
190
|
return c.json({ success: false, message: 'Invalid email format' }, 400);
|
|
124
|
-
|
|
125
|
-
const
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
191
|
+
const db = getProjectDb(c.env);
|
|
192
|
+
const row = await db.prepare('SELECT * FROM campaigns WHERE id = ?').bind(id).first();
|
|
193
|
+
if (!row)
|
|
194
|
+
return c.json({ success: false, message: 'Campaign not found' }, 404);
|
|
195
|
+
const { settings, logoDataUrl } = await readEmailTemplateData(c.env);
|
|
196
|
+
await sendEmail(c.env, {
|
|
197
|
+
to: body.email,
|
|
198
|
+
subject: `[TEST] ${row.subject}`,
|
|
199
|
+
html: renderEmailTemplate({
|
|
200
|
+
bodyHtml: row.body_html,
|
|
201
|
+
template: settings.emailTemplate,
|
|
202
|
+
logoDataUrl,
|
|
203
|
+
}),
|
|
130
204
|
});
|
|
205
|
+
return c.json({ success: true, message: `Test email sent to ${body.email}` });
|
|
131
206
|
}
|
|
132
207
|
catch (error) {
|
|
133
208
|
console.error('Test campaign error:', error);
|
|
134
|
-
return c.json({
|
|
135
|
-
success: false,
|
|
136
|
-
message: error instanceof Error ? error.message : 'Failed to send test email',
|
|
137
|
-
}, 500);
|
|
209
|
+
return c.json({ success: false, message: 'Failed to send test email' }, 500);
|
|
138
210
|
}
|
|
139
211
|
}
|
|
@@ -1,28 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Invoice Handler
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
* Uses global branding for logo when showLogo is enabled.
|
|
4
|
+
* PDF generation for shop invoices. Invoice config is now read from D1 email_settings.
|
|
6
5
|
*/
|
|
7
|
-
import type {
|
|
8
|
-
import type { InvoiceTemplate, InvoiceData } from '@hintergrund/shared';
|
|
6
|
+
import type { InvoiceConfig, InvoiceData } from '@hintergrund/shared';
|
|
9
7
|
/**
|
|
10
|
-
*
|
|
11
|
-
*
|
|
8
|
+
* Generate PDF invoice from InvoiceConfig + InvoiceData.
|
|
9
|
+
* Optionally provide logo (base64 data URL) and invoice company styling.
|
|
12
10
|
*/
|
|
13
|
-
export declare function
|
|
14
|
-
/**
|
|
15
|
-
* PUT /api/email/admin/invoice-template
|
|
16
|
-
* Save the invoice template configuration to GitHub
|
|
17
|
-
*/
|
|
18
|
-
export declare function saveInvoiceTemplate(c: Context): Promise<Response>;
|
|
19
|
-
/**
|
|
20
|
-
* Generate PDF invoice
|
|
21
|
-
* @param template Invoice template configuration
|
|
22
|
-
* @param data Invoice data
|
|
23
|
-
* @param branding Optional global branding for logo and company name
|
|
24
|
-
*/
|
|
25
|
-
export declare function generateInvoicePdf(template: InvoiceTemplate, data: InvoiceData, branding?: {
|
|
11
|
+
export declare function generateInvoicePdf(config: InvoiceConfig, data: InvoiceData, branding?: {
|
|
26
12
|
logo?: string;
|
|
27
13
|
companyName?: string;
|
|
28
14
|
primaryColor?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"invoice.handler.d.ts","sourceRoot":"","sources":["../../../../src/api/emails/handlers/invoice.handler.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"invoice.handler.d.ts","sourceRoot":"","sources":["../../../../src/api/emails/handlers/invoice.handler.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAsCtE;;;GAGG;AACH,wBAAsB,kBAAkB,CACvC,MAAM,EAAE,aAAa,EACrB,IAAI,EAAE,WAAW,EACjB,QAAQ,CAAC,EAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAAC,YAAY,CAAC,EAAE,MAAM,CAAA;CAAE,GACvE,OAAO,CAAC,UAAU,CAAC,CA0JrB"}
|