@vite-hub/comments 0.1.0 → 0.3.1
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 +79 -31
- package/dist/anchor.d.ts +7 -4
- package/dist/anchor.js +10 -5
- package/dist/client-diagnostics-CcFpkbAk.js +40 -0
- package/dist/client.d.ts +78 -3
- package/dist/client.js +198 -13
- package/dist/{console-BIz9t2cO.d.ts → console-h4KlhIik.d.ts} +97 -8
- package/dist/context-BqIsmYP1.js +61 -0
- package/dist/database/postgres.d.ts +738 -347
- package/dist/database/postgres.js +28 -7
- package/dist/{database-Cb2xjC1V.d.ts → database-CA1aHKN7.d.ts} +675 -276
- package/dist/database.d.ts +6 -98
- package/dist/database.js +2 -3
- package/dist/define-43mMR39K.js +89 -0
- package/dist/define-B3TF9zzn.d.ts +204 -0
- package/dist/errors-4gelGVmK.js +57 -0
- package/dist/errors-C6qptPoG.js +135 -0
- package/dist/errors-CyQyKAvy.d.ts +185 -0
- package/dist/fold-name-B7Zb3-MF.js +7 -0
- package/dist/{identity-3qtVC4rF.js → identity-CBOzgxSf.js} +7 -2
- package/dist/index-DNhy69Wt.d.ts +83 -0
- package/dist/index.d.ts +7 -7
- package/dist/index.js +196 -5
- package/dist/install-BcMPgPk_.js +1154 -0
- package/dist/install-W9ghhGoh.d.ts +36 -0
- package/dist/installed-B-PfERBU.js +30 -0
- package/dist/invariant-D8_xBqmZ.js +22 -0
- package/dist/migrate-B0k_0swk.d.ts +54 -0
- package/dist/migrate-BDQ8xqUs.js +289 -0
- package/dist/object-Da1zyPCR.js +11 -0
- package/dist/{operations-0B0QTVWX.d.ts → operations-D4A1Fcgf.d.ts} +37 -15
- package/dist/operations-DMMIfYPW.js +1159 -0
- package/dist/operations-GLeOqgMt.d.ts +257 -0
- package/dist/operations.d.ts +3 -7
- package/dist/operations.js +3 -2
- package/dist/overlay/client-DmsSMOzi.js +4 -0
- package/dist/overlay/dist-BoHMOFax.js +14 -0
- package/dist/overlay/dist-yIZmvSaU.js +1 -0
- package/dist/overlay/overlay.js +183 -177
- package/dist/page/loader.js +138 -18
- package/dist/{page-BuroSMXO.js → page-B41ozN63.js} +8 -6
- package/dist/{page-BtXADR6d.d.ts → page-DtbMOEMd.d.ts} +6 -5
- package/dist/page-tools-shared-NHUjKI8E.js +117 -0
- package/dist/path--zk6PEMz.js +18 -0
- package/dist/plugin-PS8PMYus.js +74 -0
- package/dist/realtime.d.ts +6 -12
- package/dist/realtime.js +23 -24
- package/dist/rpc-HBcWtg0T.d.ts +17 -0
- package/dist/rpc-RKPAusHp.js +153 -0
- package/dist/rpc.d.ts +2 -29
- package/dist/rpc.js +2 -75
- package/dist/runtime/auth.d.ts +5 -3
- package/dist/runtime/auth.js +8 -5
- package/dist/runtime/console.d.ts +1 -1
- package/dist/runtime/console.js +26 -21
- package/dist/runtime/index.d.ts +108 -60
- package/dist/runtime/index.js +684 -236
- package/dist/{server-BomGg3Gb.js → server-D8k-0GXe.js} +16 -7
- package/dist/server.d.ts +14 -88
- package/dist/server.js +7 -326
- package/dist/service-CFVm23k7.d.ts +158 -0
- package/dist/service-GHhhyQj4.js +609 -0
- package/dist/session-DVx-1Tym.d.ts +14 -0
- package/dist/session-EkudzUmm.js +503 -0
- package/dist/testing.d.ts +1 -1
- package/dist/testing.js +14 -2
- package/dist/tokens-DSbwkVSy.js +58 -0
- package/dist/types-BIS0hCEl.d.ts +124 -0
- package/dist/types-CZujrMFd.d.ts +322 -0
- package/dist/vite.d.ts +91 -87
- package/dist/vite.js +535 -796
- package/package.json +24 -27
- package/dist/database-BSnVrwHn.js +0 -60
- package/dist/database-C-ktS9Do.js +0 -95
- package/dist/define-BzW2Ychn.d.ts +0 -46
- package/dist/define-Cbhl6QVJ.js +0 -32
- package/dist/errors-BAQYcy3_.d.ts +0 -89
- package/dist/errors-DeD6wTCl.js +0 -77
- package/dist/h3-v1-request-DDGXJ9E7.js +0 -166
- package/dist/index-DklG2Etf.d.ts +0 -111
- package/dist/operations-NZG5dB8y.js +0 -732
- package/dist/page-tools-shared-D-amu6sx.js +0 -53
- package/dist/plugin-QElKQYkA.js +0 -725
- package/dist/request-DVc3M_AG.js +0 -14
- package/dist/src-CRTwnaEG.js +0 -1362
- package/dist/types-Cj8K7Vx7.d.ts +0 -176
- package/dist/types-Un2dcJWD.d.ts +0 -288
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { bigint, index, pgTable, text, uniqueIndex } from "drizzle-orm/pg-core";
|
|
1
|
+
import { bigint, boolean, index, pgTable, text, uniqueIndex } from "drizzle-orm/pg-core";
|
|
2
2
|
//#region src/operations-core/database/postgres.ts
|
|
3
3
|
/**
|
|
4
4
|
* Threads of comments. `n` is unique inside `scope`, which is what `?comment=<n>` names. `anchor`, `actor`, and
|
|
@@ -18,10 +18,15 @@ const commentThreads = pgTable("vitehub_comment_threads", {
|
|
|
18
18
|
authorName: text("author_name"),
|
|
19
19
|
authorImage: text("author_image"),
|
|
20
20
|
actor: text("actor"),
|
|
21
|
+
metadata: text("metadata"),
|
|
22
|
+
context: text("context"),
|
|
23
|
+
revision: bigint("revision", { mode: "number" }),
|
|
24
|
+
requestId: text("request_id"),
|
|
21
25
|
createdAt: bigint("created_at", { mode: "number" }).notNull(),
|
|
22
26
|
updatedAt: bigint("updated_at", { mode: "number" }).notNull()
|
|
23
27
|
}, (table) => [
|
|
24
28
|
uniqueIndex("vitehub_comment_threads_scope_n").on(table.scope, table.n),
|
|
29
|
+
uniqueIndex("vitehub_comment_threads_scope_request").on(table.scope, table.requestId),
|
|
25
30
|
index("vitehub_comment_threads_subject").on(table.subjectKind, table.subjectId),
|
|
26
31
|
index("vitehub_comment_threads_status").on(table.status, table.updatedAt)
|
|
27
32
|
]);
|
|
@@ -47,14 +52,30 @@ const commentCounters = pgTable("vitehub_comment_counters", {
|
|
|
47
52
|
scope: text("scope").primaryKey(),
|
|
48
53
|
next: bigint("next", { mode: "number" }).notNull()
|
|
49
54
|
});
|
|
55
|
+
/** The pull request comment of each message, when `defineComments({ forge })` posts threads. */
|
|
56
|
+
const commentForge = pgTable("vitehub_comment_forge", {
|
|
57
|
+
id: text("id").primaryKey(),
|
|
58
|
+
threadId: text("thread_id"),
|
|
59
|
+
repository: text("repository").notNull(),
|
|
60
|
+
pullRequest: bigint("pull_request", { mode: "number" }).notNull(),
|
|
61
|
+
remoteId: text("remote_id"),
|
|
62
|
+
nodeId: text("node_id"),
|
|
63
|
+
url: text("url"),
|
|
64
|
+
digest: text("digest"),
|
|
65
|
+
postedAs: text("posted_as", { enum: ["author", "app"] }),
|
|
66
|
+
minimized: boolean("minimized").notNull().default(false),
|
|
67
|
+
error: text("error"),
|
|
68
|
+
updatedAt: bigint("updated_at", { mode: "number" }).notNull()
|
|
69
|
+
}, (table) => [index("vitehub_comment_forge_thread").on(table.threadId), index("vitehub_comment_forge_pull_request").on(table.repository, table.pullRequest)]);
|
|
50
70
|
/**
|
|
51
|
-
* The tables
|
|
52
|
-
*
|
|
71
|
+
* The tables of Comments, for Postgres. ViteHub adds them to the Database for you; add them to a Database Definition
|
|
72
|
+
* yourself only without ViteHub. For SQLite, libSQL, and D1 use `@vite-hub/comments/database`.
|
|
53
73
|
*/
|
|
54
74
|
const commentsPostgresSchema = {
|
|
55
|
-
commentThreads,
|
|
56
|
-
commentMessages,
|
|
57
|
-
commentCounters
|
|
75
|
+
vitehubCommentThreads: commentThreads,
|
|
76
|
+
vitehubCommentMessages: commentMessages,
|
|
77
|
+
vitehubCommentCounters: commentCounters,
|
|
78
|
+
vitehubCommentForge: commentForge
|
|
58
79
|
};
|
|
59
80
|
//#endregion
|
|
60
|
-
export { commentCounters, commentMessages, commentThreads, commentsPostgresSchema };
|
|
81
|
+
export { commentCounters, commentForge, commentMessages, commentThreads, commentsPostgresSchema };
|