wiki-formant 0.60.0 → 0.62.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 +86 -5
- package/bin/maintenance-log.mjs +27 -48
- package/bin/mark-verified.mjs +10 -13
- package/bin/prisma-models.mjs +5 -5
- package/dist/block-editor.d.ts +9 -0
- package/dist/block-editor.js +19 -0
- package/dist/block-views.d.ts +2 -1
- package/dist/block-views.js +2 -1
- package/dist/category.d.ts +64 -0
- package/dist/category.js +65 -0
- package/dist/maintenance.d.ts +0 -11
- package/dist/maintenance.js +0 -20
- package/dist/mcp.d.ts +1 -1
- package/dist/mcp.js +6 -3
- package/dist/store.d.ts +196 -0
- package/dist/store.js +266 -0
- package/dist/text.d.ts +6 -0
- package/dist/text.js +13 -0
- package/dist/tree.d.ts +95 -0
- package/dist/tree.js +122 -0
- package/dist/wiki-tools.d.ts +66 -0
- package/dist/wiki-tools.js +342 -0
- package/package.json +26 -5
- package/prisma/wiki.prisma +62 -0
- package/prisma/wiki.sql +68 -0
package/prisma/wiki.sql
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
-- Shipped by wiki-formant. The tables prisma/wiki.prisma declares, as
|
|
2
|
+
-- `prisma migrate diff` writes them, for a migration that moves an existing
|
|
3
|
+
-- wiki's rows in: create these, INSERT ... SELECT the old rows, retarget any
|
|
4
|
+
-- foreign keys, drop the old tables, then build search_tsv with fts-ddl.
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
-- CreateTable
|
|
9
|
+
CREATE TABLE "WikiPage" (
|
|
10
|
+
"id" TEXT NOT NULL DEFAULT (gen_random_uuid())::text,
|
|
11
|
+
"siteId" TEXT NOT NULL DEFAULT '',
|
|
12
|
+
"tagPath" TEXT NOT NULL DEFAULT '',
|
|
13
|
+
"slug" TEXT NOT NULL,
|
|
14
|
+
"title" TEXT NOT NULL,
|
|
15
|
+
"content" JSONB NOT NULL DEFAULT '[]',
|
|
16
|
+
"metadata" JSONB NOT NULL DEFAULT '{}',
|
|
17
|
+
"version" TEXT NOT NULL DEFAULT '1.0.0',
|
|
18
|
+
"authorId" TEXT,
|
|
19
|
+
"lastVerifiedAt" TIMESTAMPTZ(3),
|
|
20
|
+
"createdAt" TIMESTAMPTZ(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
21
|
+
"updatedAt" TIMESTAMPTZ(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
22
|
+
|
|
23
|
+
CONSTRAINT "WikiPage_pkey" PRIMARY KEY ("id")
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
-- CreateTable
|
|
27
|
+
CREATE TABLE "WikiRevision" (
|
|
28
|
+
"id" TEXT NOT NULL DEFAULT (gen_random_uuid())::text,
|
|
29
|
+
"pageId" TEXT NOT NULL,
|
|
30
|
+
"title" TEXT NOT NULL,
|
|
31
|
+
"content" JSONB NOT NULL,
|
|
32
|
+
"version" TEXT NOT NULL,
|
|
33
|
+
"changeType" TEXT NOT NULL,
|
|
34
|
+
"message" TEXT,
|
|
35
|
+
"authorId" TEXT,
|
|
36
|
+
"createdAt" TIMESTAMPTZ(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
37
|
+
|
|
38
|
+
CONSTRAINT "WikiRevision_pkey" PRIMARY KEY ("id")
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
-- CreateIndex
|
|
42
|
+
CREATE INDEX "WikiPage_siteId_tagPath_updatedAt_idx" ON "WikiPage"("siteId", "tagPath", "updatedAt");
|
|
43
|
+
|
|
44
|
+
-- CreateIndex
|
|
45
|
+
CREATE INDEX "WikiPage_siteId_updatedAt_idx" ON "WikiPage"("siteId", "updatedAt");
|
|
46
|
+
|
|
47
|
+
-- CreateIndex
|
|
48
|
+
|
|
49
|
+
-- CreateIndex
|
|
50
|
+
CREATE UNIQUE INDEX "WikiPage_siteId_tagPath_slug_key" ON "WikiPage"("siteId", "tagPath", "slug");
|
|
51
|
+
|
|
52
|
+
-- CreateIndex
|
|
53
|
+
CREATE INDEX "WikiRevision_pageId_createdAt_idx" ON "WikiRevision"("pageId", "createdAt");
|
|
54
|
+
|
|
55
|
+
-- CreateIndex
|
|
56
|
+
CREATE INDEX "WikiRevision_authorId_createdAt_idx" ON "WikiRevision"("authorId", "createdAt");
|
|
57
|
+
|
|
58
|
+
-- AddForeignKey
|
|
59
|
+
ALTER TABLE "WikiRevision" ADD CONSTRAINT "WikiRevision_pageId_fkey" FOREIGN KEY ("pageId") REFERENCES "WikiPage"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
-- STRUCTURE S7: the Data API gets nothing. Prisma connects as postgres, which
|
|
63
|
+
-- bypasses RLS; with no policies, anon and authenticated read nothing.
|
|
64
|
+
ALTER TABLE "WikiPage" ENABLE ROW LEVEL SECURITY;
|
|
65
|
+
ALTER TABLE "WikiRevision" ENABLE ROW LEVEL SECURITY;
|
|
66
|
+
|
|
67
|
+
-- The full-text column and its index: `npx fts-ddl '"WikiPage"'` after the
|
|
68
|
+
-- rows are in, never a plain tsvector column (it would stay empty).
|