feat: establish NekoNest Cloud control and relay

This commit is contained in:
2026-08-12 23:25:43 +08:00
commit f27606b709
222 changed files with 71456 additions and 0 deletions
+28
View File
@@ -0,0 +1,28 @@
import assert from "node:assert/strict";
import { readFile } from "node:fs/promises";
import test from "node:test";
test("does not expose an unimplemented free-beta grace-period control", async () => {
const [actions, route, repository, bootstrap, billing, contract, stateModel] = await Promise.all([
readFile(new URL("../app/admin/AdminActions.tsx", import.meta.url), "utf8"),
readFile(new URL("../app/api/admin/beta/route.ts", import.meta.url), "utf8"),
readFile(new URL("../db/repository.ts", import.meta.url), "utf8"),
readFile(new URL("../db/bootstrap.ts", import.meta.url), "utf8"),
readFile(new URL("../app/dashboard/billing/page.tsx", import.meta.url), "utf8"),
readFile(new URL("../docs/commercial-contract.md", import.meta.url), "utf8"),
readFile(new URL("../docs/state-model.md", import.meta.url), "utf8"),
]);
const setPublicBeta = repository.slice(
repository.indexOf("export async function setPublicBeta"),
repository.indexOf("export async function createExemption"),
);
assert.doesNotMatch(actions, /graceDays|宽限天数/);
assert.doesNotMatch(route, /graceDays/);
assert.doesNotMatch(setPublicBeta, /input\.graceDays|invalid_grace/);
assert.match(setPublicBeta, /grace_days: 0/);
assert.match(bootstrap, /NULL, 0, 'system:seed'/);
assert.match(actions, /不自动断开既有主机/);
assert.match(billing, /新配对和未完成认领停止,既有主机不自动断开/);
assert.match(contract, /当前没有可配置的宽限天数或隐藏倒计时/);
assert.match(stateModel, /不参与资格、设备认证或页面判断/);
});