@kidecms/core 0.1.11 → 0.13.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/admin/components/AssetsGrid.tsx +366 -173
- package/admin/components/BlockEditor.tsx +260 -679
- package/admin/components/CheckboxField.tsx +2 -2
- package/admin/components/CollaborationReviewBar.tsx +384 -0
- package/admin/components/ColorField.tsx +87 -0
- package/admin/components/CommandPalette.tsx +169 -0
- package/admin/components/ContentEditor.tsx +687 -0
- package/admin/components/DocumentActions.tsx +4 -2
- package/admin/components/DocumentsDataTable.tsx +91 -10
- package/admin/components/FieldControl.astro +151 -26
- package/admin/components/FocalPointSelector.tsx +27 -1
- package/admin/components/InternalLinkPicker.tsx +4 -3
- package/admin/components/LinkField.tsx +126 -0
- package/admin/components/RelationField.tsx +105 -26
- package/admin/components/RepeaterInput.tsx +46 -0
- package/admin/components/RichTextEditor.tsx +44 -9
- package/admin/components/SharedSectionBlockField.tsx +93 -0
- package/admin/components/SidebarUserMenu.tsx +1 -1
- package/admin/components/Toast.astro +1 -1
- package/admin/components/TreeItemsEditor.tsx +20 -19
- package/admin/components/TreeSelect.tsx +2 -2
- package/admin/components/YoutubeField.tsx +48 -0
- package/admin/components/block-fields.tsx +777 -0
- package/admin/components/content-block-spec.ts +114 -0
- package/admin/components/slash-command.tsx +242 -0
- package/admin/components/tree-utils.ts +14 -2
- package/admin/components/ui/badge.tsx +2 -3
- package/admin/components/ui/button.tsx +5 -4
- package/admin/components/ui/checkbox.tsx +1 -1
- package/admin/components/ui/input.tsx +1 -1
- package/admin/components/ui/select.tsx +1 -1
- package/admin/components/ui/table.tsx +1 -1
- package/admin/components/ui/textarea.tsx +1 -1
- package/admin/layouts/AdminLayout.astro +323 -123
- package/admin/lib/access.ts +54 -0
- package/admin/lib/collaboration.ts +178 -0
- package/admin/lib/edit-data.ts +448 -0
- package/admin/views/AccessDeniedView.astro +8 -0
- package/admin/views/EditView.astro +706 -0
- package/admin/views/ListView.astro +202 -0
- package/admin/views/RecentView.astro +76 -0
- package/admin/views/SinglesView.astro +65 -0
- package/admin/views/edit/EditScripts.astro +145 -0
- package/admin/views/edit/ReverseReferencesList.astro +68 -0
- package/core/admin.ts +193 -0
- package/core/ai.ts +87 -0
- package/core/api.ts +1392 -0
- package/core/assets.ts +336 -0
- package/core/audit.ts +84 -0
- package/core/auth-config.ts +44 -0
- package/core/auth.ts +303 -0
- package/core/collaboration.ts +276 -0
- package/core/content.ts +27 -0
- package/core/create-admin.ts +28 -0
- package/core/define.ts +625 -0
- package/core/field-model.ts +172 -0
- package/core/generator.ts +519 -0
- package/core/http.ts +42 -0
- package/core/image.ts +219 -0
- package/core/index.ts +211 -0
- package/core/locks.ts +52 -0
- package/core/log.ts +37 -0
- package/core/migrate.ts +278 -0
- package/core/rate-limit.ts +110 -0
- package/core/request-scope.ts +33 -0
- package/core/richtext.ts +1 -0
- package/core/runtime.ts +63 -0
- package/core/schema.ts +32 -0
- package/core/search.ts +489 -0
- package/core/seed.ts +101 -0
- package/core/shared-sections.ts +96 -0
- package/core/tasks.ts +176 -0
- package/core/values.ts +433 -0
- package/core/webhooks.ts +85 -0
- package/core/youtube.ts +39 -0
- package/internals/cli.mjs +34 -0
- package/internals/context.ts +67 -0
- package/internals/create-admin.ts +40 -0
- package/internals/describe.ts +25 -0
- package/internals/eject.ts +144 -0
- package/internals/generator.ts +11 -0
- package/internals/integration.ts +481 -0
- package/internals/mcp.ts +397 -0
- package/internals/project.ts +26 -0
- package/internals/push.ts +160 -0
- package/internals/reindex.ts +11 -0
- package/internals/restore.ts +257 -0
- package/internals/seed.data.ts +7 -0
- package/internals/seed.ts +11 -0
- package/internals/upgrade.ts +776 -0
- package/{virtual.d.ts → internals/virtual.d.ts} +39 -5
- package/middleware/auth.ts +130 -17
- package/middleware/push.ts +121 -0
- package/package.json +55 -67
- package/platform/cloudflare/cf-env.ts +60 -0
- package/platform/cloudflare/database.ts +28 -0
- package/platform/cloudflare/globals.d.ts +5 -0
- package/platform/cloudflare/storage.ts +33 -0
- package/platform/cloudflare/uploads-route.ts +37 -0
- package/platform/node/database.ts +39 -0
- package/platform/node/storage.ts +52 -0
- package/routes/admin/[...path].astro +71 -0
- package/routes/{pages/admin → admin}/assets/[id].astro +25 -19
- package/routes/admin/assets/index.astro +90 -0
- package/routes/{pages/admin/login.astro → admin/forgot-password.astro} +21 -19
- package/routes/{pages/admin → admin}/invite.astro +6 -6
- package/routes/admin/login.astro +103 -0
- package/routes/admin/reset-password.astro +73 -0
- package/routes/{pages/admin → admin}/setup.astro +31 -8
- package/routes/api/{cms/[collection] → [collection]}/[...path].ts +66 -14
- package/routes/api/admin/search.ts +89 -0
- package/routes/api/{cms/assets → assets}/[id].ts +24 -14
- package/routes/api/{cms/assets → assets}/index.ts +4 -2
- package/routes/api/assets/upload.ts +147 -0
- package/routes/api/auth/forgot-password.ts +77 -0
- package/routes/api/{cms/auth → auth}/invite.ts +41 -9
- package/routes/api/auth/login.ts +167 -0
- package/routes/api/{cms/auth → auth}/logout.ts +11 -2
- package/routes/api/auth/reset-password.ts +85 -0
- package/routes/api/auth/setup.ts +110 -0
- package/routes/api/auth/sso/[provider]/start.ts +34 -0
- package/routes/api/collaboration/index.ts +106 -0
- package/routes/api/cron/_authorize.ts +25 -0
- package/routes/api/{cms/cron → cron}/publish.ts +3 -9
- package/routes/api/cron/tasks.ts +33 -0
- package/routes/api/forms/submit/[slug].ts +143 -0
- package/routes/api/img/[...path].ts +65 -0
- package/routes/api/{cms/preview → preview}/render.ts +8 -3
- package/routes/api/{cms/references → references}/[collection]/[id].ts +31 -1
- package/routes/api/webhooks/[provider].ts +54 -0
- package/README.md +0 -28
- package/dist/admin.d.ts +0 -33
- package/dist/admin.js +0 -92
- package/dist/ai.d.ts +0 -15
- package/dist/ai.js +0 -70
- package/dist/api.d.ts +0 -14
- package/dist/api.js +0 -833
- package/dist/assets.d.ts +0 -51
- package/dist/assets.js +0 -163
- package/dist/auth.d.ts +0 -30
- package/dist/auth.js +0 -132
- package/dist/content.d.ts +0 -3
- package/dist/content.js +0 -29
- package/dist/create-admin.d.ts +0 -5
- package/dist/create-admin.js +0 -23
- package/dist/define.d.ts +0 -254
- package/dist/define.js +0 -36
- package/dist/generator.d.ts +0 -9
- package/dist/generator.js +0 -370
- package/dist/image.d.ts +0 -9
- package/dist/image.js +0 -69
- package/dist/index.d.ts +0 -28
- package/dist/index.js +0 -16
- package/dist/integration.d.ts +0 -14
- package/dist/integration.js +0 -327
- package/dist/locks.d.ts +0 -7
- package/dist/locks.js +0 -37
- package/dist/richtext.d.ts +0 -1
- package/dist/richtext.js +0 -1
- package/dist/runtime.d.ts +0 -24
- package/dist/runtime.js +0 -26
- package/dist/schema.d.ts +0 -17
- package/dist/schema.js +0 -13
- package/dist/seed.d.ts +0 -2
- package/dist/seed.js +0 -84
- package/dist/values.d.ts +0 -8
- package/dist/values.js +0 -102
- package/dist/webhooks.d.ts +0 -2
- package/dist/webhooks.js +0 -73
- package/routes/api/cms/assets/upload.ts +0 -112
- package/routes/api/cms/auth/login.ts +0 -124
- package/routes/api/cms/auth/setup.ts +0 -77
- package/routes/api/cms/img/[...path].ts +0 -24
- package/routes/pages/admin/[...path].astro +0 -1107
- package/routes/pages/admin/assets/index.astro +0 -63
- /package/routes/api/{cms/ai → ai}/alt-text.ts +0 -0
- /package/routes/api/{cms/ai → ai}/seo.ts +0 -0
- /package/routes/api/{cms/ai → ai}/translate.ts +0 -0
- /package/routes/api/{cms/assets → assets}/folders.ts +0 -0
- /package/routes/api/{cms/locks → locks}/[...path].ts +0 -0
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `pnpm cms:restore [packet-dir]` - restore files from the latest Kide upgrade
|
|
3
|
+
* backup, or from an explicit upgrade packet directory.
|
|
4
|
+
*/
|
|
5
|
+
import { createHash } from "node:crypto";
|
|
6
|
+
import { copyFileSync, existsSync, mkdirSync, readFileSync, rmSync, statSync, writeFileSync } from "node:fs";
|
|
7
|
+
import path from "node:path";
|
|
8
|
+
|
|
9
|
+
type Args = {
|
|
10
|
+
packetDir?: string;
|
|
11
|
+
dryRun: boolean;
|
|
12
|
+
force: boolean;
|
|
13
|
+
help: boolean;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
type FileCheckpoint = {
|
|
17
|
+
exists: boolean;
|
|
18
|
+
sha256?: string;
|
|
19
|
+
size?: number;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
type BackupEntry = {
|
|
23
|
+
file: string;
|
|
24
|
+
existed: boolean;
|
|
25
|
+
backupSha256?: string;
|
|
26
|
+
backupSize?: number;
|
|
27
|
+
afterAttempt?: FileCheckpoint & { at?: string };
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
type BackupManifest = {
|
|
31
|
+
backedUp?: string[];
|
|
32
|
+
missing?: string[];
|
|
33
|
+
entries?: BackupEntry[];
|
|
34
|
+
[key: string]: unknown;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
type PlanItem = {
|
|
38
|
+
file: string;
|
|
39
|
+
action: "restore" | "delete" | "skip" | "blocked";
|
|
40
|
+
reason: string;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
const usage = `Usage:
|
|
44
|
+
pnpm cms:restore [upgrade-packet-dir]
|
|
45
|
+
|
|
46
|
+
Options:
|
|
47
|
+
--dry-run Show what would be restored without changing files
|
|
48
|
+
--force Restore even when files changed after the upgrade attempt
|
|
49
|
+
--help Show this help
|
|
50
|
+
|
|
51
|
+
Examples:
|
|
52
|
+
pnpm cms:restore
|
|
53
|
+
pnpm cms:restore --dry-run
|
|
54
|
+
pnpm cms:restore .kide/upgrade/v0.10.0-to-v0.11.0
|
|
55
|
+
`;
|
|
56
|
+
|
|
57
|
+
const parseArgs = (argv: string[]): Args => {
|
|
58
|
+
const args: Args = { dryRun: false, force: false, help: false };
|
|
59
|
+
|
|
60
|
+
for (const arg of argv) {
|
|
61
|
+
if (arg === "--help" || arg === "-h") {
|
|
62
|
+
args.help = true;
|
|
63
|
+
} else if (arg === "--dry-run") {
|
|
64
|
+
args.dryRun = true;
|
|
65
|
+
} else if (arg === "--force") {
|
|
66
|
+
args.force = true;
|
|
67
|
+
} else if (arg.startsWith("--")) {
|
|
68
|
+
throw new Error(`Unknown option: ${arg}`);
|
|
69
|
+
} else if (!args.packetDir) {
|
|
70
|
+
args.packetDir = arg;
|
|
71
|
+
} else {
|
|
72
|
+
throw new Error(`Unexpected argument: ${arg}`);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
return args;
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
const readJson = <T>(file: string): T => {
|
|
80
|
+
try {
|
|
81
|
+
return JSON.parse(readFileSync(file, "utf-8")) as T;
|
|
82
|
+
} catch (error) {
|
|
83
|
+
throw new Error(`Could not parse ${file}: ${(error as Error).message}`, { cause: error });
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
const resolveInside = (root: string, file: string) => {
|
|
88
|
+
if (path.isAbsolute(file)) throw new Error(`Refusing absolute restore path: ${file}`);
|
|
89
|
+
const resolved = path.resolve(root, file);
|
|
90
|
+
const normalizedRoot = path.resolve(root);
|
|
91
|
+
if (resolved !== normalizedRoot && !resolved.startsWith(`${normalizedRoot}${path.sep}`)) {
|
|
92
|
+
throw new Error(`Refusing restore path outside ${root}: ${file}`);
|
|
93
|
+
}
|
|
94
|
+
return resolved;
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
const sha256 = (file: string) => createHash("sha256").update(readFileSync(file)).digest("hex");
|
|
98
|
+
|
|
99
|
+
const checkpoint = (file: string): FileCheckpoint => {
|
|
100
|
+
if (!existsSync(file)) return { exists: false };
|
|
101
|
+
const stat = statSync(file);
|
|
102
|
+
if (!stat.isFile()) return { exists: true };
|
|
103
|
+
return { exists: true, sha256: sha256(file), size: stat.size };
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
const sameCheckpoint = (actual: FileCheckpoint, expected?: FileCheckpoint) => {
|
|
107
|
+
if (!expected) return false;
|
|
108
|
+
if (!actual.exists || !expected.exists) return actual.exists === expected.exists;
|
|
109
|
+
return actual.sha256 === expected.sha256 && actual.size === expected.size;
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
const resolvePacketDir = (cwd: string, packetArg?: string) => {
|
|
113
|
+
if (packetArg) return path.resolve(cwd, packetArg);
|
|
114
|
+
|
|
115
|
+
const latestPath = path.join(cwd, ".kide", "upgrade", "latest.json");
|
|
116
|
+
if (!existsSync(latestPath)) {
|
|
117
|
+
throw new Error("No latest upgrade packet found. Pass a packet directory explicitly.");
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
const latest = readJson<{ packet?: string }>(latestPath);
|
|
121
|
+
if (!latest.packet) throw new Error(`${latestPath} does not include a packet path.`);
|
|
122
|
+
return path.resolve(cwd, latest.packet);
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
const normalizeEntries = (manifest: BackupManifest): BackupEntry[] => {
|
|
126
|
+
const byFile = new Map<string, BackupEntry>();
|
|
127
|
+
|
|
128
|
+
for (const entry of manifest.entries ?? []) {
|
|
129
|
+
byFile.set(entry.file, entry);
|
|
130
|
+
}
|
|
131
|
+
for (const file of manifest.backedUp ?? []) {
|
|
132
|
+
if (!byFile.has(file)) byFile.set(file, { file, existed: true });
|
|
133
|
+
}
|
|
134
|
+
for (const file of manifest.missing ?? []) {
|
|
135
|
+
if (!byFile.has(file)) byFile.set(file, { file, existed: false });
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
return [...byFile.values()].sort((a, b) => a.file.localeCompare(b.file));
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
const planRestore = (cwd: string, backupDir: string, entries: BackupEntry[], force: boolean): PlanItem[] =>
|
|
142
|
+
entries.map((entry) => {
|
|
143
|
+
const target = resolveInside(cwd, entry.file);
|
|
144
|
+
const current = checkpoint(target);
|
|
145
|
+
|
|
146
|
+
if (entry.existed) {
|
|
147
|
+
const backup = resolveInside(backupDir, entry.file);
|
|
148
|
+
if (!existsSync(backup)) {
|
|
149
|
+
return { file: entry.file, action: "blocked", reason: "backup file is missing" };
|
|
150
|
+
}
|
|
151
|
+
const backupState = checkpoint(backup);
|
|
152
|
+
if (current.exists && sameCheckpoint(current, backupState)) {
|
|
153
|
+
return { file: entry.file, action: "skip", reason: "already matches backup" };
|
|
154
|
+
}
|
|
155
|
+
if (force || sameCheckpoint(current, entry.afterAttempt)) {
|
|
156
|
+
return { file: entry.file, action: "restore", reason: force ? "forced" : "matches upgrade attempt" };
|
|
157
|
+
}
|
|
158
|
+
return {
|
|
159
|
+
file: entry.file,
|
|
160
|
+
action: "blocked",
|
|
161
|
+
reason: entry.afterAttempt ? "changed since upgrade attempt" : "no upgrade-attempt checkpoint",
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
if (!current.exists) {
|
|
166
|
+
return { file: entry.file, action: "skip", reason: "still absent" };
|
|
167
|
+
}
|
|
168
|
+
if (force || sameCheckpoint(current, entry.afterAttempt)) {
|
|
169
|
+
return { file: entry.file, action: "delete", reason: force ? "forced" : "created by upgrade attempt" };
|
|
170
|
+
}
|
|
171
|
+
return {
|
|
172
|
+
file: entry.file,
|
|
173
|
+
action: "blocked",
|
|
174
|
+
reason: entry.afterAttempt ? "changed since upgrade attempt" : "no upgrade-attempt checkpoint",
|
|
175
|
+
};
|
|
176
|
+
});
|
|
177
|
+
|
|
178
|
+
const writeReport = (packetDir: string, args: Args, plan: PlanItem[]) => {
|
|
179
|
+
const byAction = (action: PlanItem["action"]) =>
|
|
180
|
+
plan.filter((item) => item.action === action).map((item) => item.file);
|
|
181
|
+
writeFileSync(
|
|
182
|
+
path.join(packetDir, "restore-report.json"),
|
|
183
|
+
`${JSON.stringify(
|
|
184
|
+
{
|
|
185
|
+
at: new Date().toISOString(),
|
|
186
|
+
dryRun: args.dryRun,
|
|
187
|
+
force: args.force,
|
|
188
|
+
restored: byAction("restore"),
|
|
189
|
+
deleted: byAction("delete"),
|
|
190
|
+
skipped: byAction("skip"),
|
|
191
|
+
blocked: plan.filter((item) => item.action === "blocked"),
|
|
192
|
+
},
|
|
193
|
+
null,
|
|
194
|
+
2,
|
|
195
|
+
)}\n`,
|
|
196
|
+
);
|
|
197
|
+
};
|
|
198
|
+
|
|
199
|
+
async function main() {
|
|
200
|
+
const cwd = process.cwd();
|
|
201
|
+
const args = parseArgs(process.argv.slice(2));
|
|
202
|
+
|
|
203
|
+
if (args.help) {
|
|
204
|
+
console.log(usage);
|
|
205
|
+
return;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
const packetDir = resolvePacketDir(cwd, args.packetDir);
|
|
209
|
+
const backupDir = path.join(packetDir, "backup");
|
|
210
|
+
const manifestPath = path.join(backupDir, "manifest.json");
|
|
211
|
+
if (!existsSync(manifestPath)) {
|
|
212
|
+
throw new Error(`No backup manifest found at ${manifestPath}.`);
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
const manifest = readJson<BackupManifest>(manifestPath);
|
|
216
|
+
const entries = normalizeEntries(manifest);
|
|
217
|
+
if (entries.length === 0) throw new Error(`No restorable files listed in ${manifestPath}.`);
|
|
218
|
+
|
|
219
|
+
const plan = planRestore(cwd, backupDir, entries, args.force);
|
|
220
|
+
const blocked = plan.filter((item) => item.action === "blocked");
|
|
221
|
+
const restore = plan.filter((item) => item.action === "restore");
|
|
222
|
+
const remove = plan.filter((item) => item.action === "delete");
|
|
223
|
+
const skipped = plan.filter((item) => item.action === "skip");
|
|
224
|
+
|
|
225
|
+
console.log(`[cms:restore] Packet: ${path.relative(cwd, packetDir) || "."}`);
|
|
226
|
+
console.log(
|
|
227
|
+
`[cms:restore] ${args.dryRun ? "Would restore" : "Restoring"} ${restore.length}, delete ${remove.length}, skip ${skipped.length}.`,
|
|
228
|
+
);
|
|
229
|
+
|
|
230
|
+
if (blocked.length > 0) {
|
|
231
|
+
for (const item of blocked) {
|
|
232
|
+
console.log(`[cms:restore] blocked ${item.file}: ${item.reason}`);
|
|
233
|
+
}
|
|
234
|
+
if (!args.dryRun) writeReport(packetDir, args, plan);
|
|
235
|
+
throw new Error("Restore blocked. Re-run with --force to overwrite these files.");
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
if (!args.dryRun) {
|
|
239
|
+
for (const item of restore) {
|
|
240
|
+
const source = resolveInside(backupDir, item.file);
|
|
241
|
+
const target = resolveInside(cwd, item.file);
|
|
242
|
+
mkdirSync(path.dirname(target), { recursive: true });
|
|
243
|
+
copyFileSync(source, target);
|
|
244
|
+
}
|
|
245
|
+
for (const item of remove) {
|
|
246
|
+
rmSync(resolveInside(cwd, item.file), { force: true });
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
if (!args.dryRun) writeReport(packetDir, args, plan);
|
|
251
|
+
console.log(args.dryRun ? "[cms:restore] Dry run complete." : "[cms:restore] Restore complete.");
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
main().catch((error) => {
|
|
255
|
+
console.error(`[cms:restore] ${(error as Error).message}`);
|
|
256
|
+
process.exit(1);
|
|
257
|
+
});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { SeedDocument } from "../core";
|
|
2
|
+
|
|
3
|
+
// Kide ships no seed content. Define your own documents here (keyed by
|
|
4
|
+
// collection slug) and run `kide seed` to load them into an empty database.
|
|
5
|
+
const seedData: Record<string, SeedDocument[]> = {};
|
|
6
|
+
|
|
7
|
+
export default seedData;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { closeDb, seedDatabase } from "../core";
|
|
2
|
+
import { loadProjectConfig, loadProjectRuntime } from "./project";
|
|
3
|
+
import seedData from "./seed.data";
|
|
4
|
+
|
|
5
|
+
await loadProjectRuntime();
|
|
6
|
+
const config = await loadProjectConfig();
|
|
7
|
+
|
|
8
|
+
await seedDatabase(config, seedData);
|
|
9
|
+
// Release the DB / local platform proxy so the process can exit (matters on the
|
|
10
|
+
// Cloudflare target, where the binding proxy otherwise keeps Node alive).
|
|
11
|
+
await closeDb();
|