@vite-hub/comments 0.4.1 → 0.5.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 +19 -7
- package/dist/anchor.d.ts +2 -2
- package/dist/client.d.ts +424 -11
- package/dist/client.js +405 -5
- package/dist/{console-h4KlhIik.d.ts → console-D1lwNMZn.d.ts} +2 -0
- package/dist/{migrate-Bpw3xL5e.js → database-6hXRnqDE.js} +47 -2
- package/dist/database-CTo7mx6t.d.ts +575 -0
- package/dist/database.d.ts +2 -1
- package/dist/database.js +2 -2
- package/dist/{define-CX_Yr_hz.js → define-BMBSVbD9.js} +1 -1
- package/dist/{define-CHTWfHPo.d.ts → define-CmIFU96x.d.ts} +8 -4
- package/dist/{errors-4gelGVmK.js → errors-BJTZ9iyv.js} +24 -0
- package/dist/{errors-BHsVXlpd.js → errors-Dq4AHjza.js} +16 -0
- package/dist/{index-iPGlSAgj.d.ts → index-RiHzmV16.d.ts} +113 -11
- package/dist/index.d.ts +6 -7
- package/dist/index.js +21 -7
- package/dist/{install-96NXWnrw.d.ts → install-BGGQKbQ4.d.ts} +9 -3
- package/dist/{install-jRKmuLHK.js → install-DrAse1Fa.js} +844 -38
- package/dist/{installed-g6nDr5ac.js → installed-C3EoqJEY.js} +7 -6
- package/dist/{operations-D93EV10O.d.ts → operations-BKhUWYkb.d.ts} +9 -5
- package/dist/{operations-7ycAhDCw.d.ts → operations-VyyNZusz.d.ts} +8 -2
- package/dist/{operations-9tskoLsk.js → operations-lsVKE0GH.js} +294 -212
- package/dist/operations.d.ts +2 -2
- package/dist/operations.js +2 -2
- package/dist/overlay/{client-lZesR40x.js → client-DBmJ4C1M.js} +1 -1
- package/dist/overlay/overlay.js +36 -40
- package/dist/page/loader.js +39 -47
- package/dist/{page-CWwnmF3K.d.ts → page-Bzj0CszG.d.ts} +1 -10
- package/dist/{page-tools-shared-NHUjKI8E.js → page-tools-shared-BNnuPK93.js} +6 -3
- package/dist/{plugin-BNFd1zGz.js → plugin-DRsNaJaK.js} +14 -9
- package/dist/realtime.d.ts +2 -2
- package/dist/realtime.js +1 -1
- package/dist/request-log-Dj9Vw7qG.js +105 -0
- package/dist/request-origin-CFU0TQ7E.js +49 -0
- package/dist/{rpc-BZ1QNkCC.d.ts → rpc-CuJ5GLIz.d.ts} +1 -1
- package/dist/rpc.d.ts +1 -1
- package/dist/runtime/auth.d.ts +2 -2
- package/dist/runtime/auth.js +1 -1
- package/dist/runtime/console.d.ts +1 -1
- package/dist/runtime/console.js +1 -1
- package/dist/runtime/index.d.ts +11 -9
- package/dist/runtime/index.js +148 -14
- package/dist/{server-CqyzrqTI.js → server-Yk610niJ.js} +1 -1
- package/dist/server.d.ts +6 -5
- package/dist/server.js +5 -5
- package/dist/service-Bj-Mg63c.d.ts +73 -0
- package/dist/{service-C8ZgFWvy.js → service-DA5BwfPQ.js} +39 -11
- package/dist/{session-CKfW6DGE.d.ts → session-DUcEor2W.d.ts} +3 -3
- package/dist/{session-ByjMyTak.js → session-X_g9dnU5.js} +26 -29
- package/dist/{service-wC9kx9EX.d.ts → store-CsUNfC1w.d.ts} +2 -70
- package/dist/{table-names-DfiKUlOV.js → table-names-B9LlRC0B.js} +3 -1
- package/dist/testing.d.ts +1 -1
- package/dist/testing.js +2 -2
- package/dist/{types-C7LzhgRb.d.ts → types-BLaYh0_f.d.ts} +1 -1
- package/dist/{types-C1qzObs2.d.ts → types-C35INXIs.d.ts} +79 -4
- package/dist/vite.d.ts +22 -5
- package/dist/vite.js +140 -65
- package/package.json +8 -8
- package/dist/errors-BEChnUo7.d.ts +0 -197
|
@@ -0,0 +1,575 @@
|
|
|
1
|
+
//#region src/send/database.d.ts
|
|
2
|
+
/** Where a send is: delivered, read by the agent, answered, or not delivered. */
|
|
3
|
+
type CommentSendState = "pending" | "sent" | "working" | "done" | "failed";
|
|
4
|
+
/**
|
|
5
|
+
* One row for each send: the member, the threads it carried with the last message of each, and the read token. `threads`
|
|
6
|
+
* holds JSON, `[{ id, message, role }]`, and `sender` the member as Comments knew them when they sent. The token is
|
|
7
|
+
* kept as its SHA-256 hash.
|
|
8
|
+
*/
|
|
9
|
+
declare const commentSends: import("drizzle-orm/sqlite-core").SQLiteTableWithColumns<{
|
|
10
|
+
name: "vitehub_comment_sends";
|
|
11
|
+
schema: undefined;
|
|
12
|
+
columns: {
|
|
13
|
+
id: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
14
|
+
name: string;
|
|
15
|
+
tableName: "vitehub_comment_sends";
|
|
16
|
+
dataType: "string";
|
|
17
|
+
data: string;
|
|
18
|
+
driverParam: string;
|
|
19
|
+
notNull: true;
|
|
20
|
+
hasDefault: false;
|
|
21
|
+
isPrimaryKey: true;
|
|
22
|
+
isAutoincrement: false;
|
|
23
|
+
hasRuntimeDefault: false;
|
|
24
|
+
enumValues: [string, ...string[]];
|
|
25
|
+
baseColumn: never;
|
|
26
|
+
identity: undefined;
|
|
27
|
+
generated: undefined;
|
|
28
|
+
}, {}>;
|
|
29
|
+
member: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
30
|
+
name: string;
|
|
31
|
+
tableName: "vitehub_comment_sends";
|
|
32
|
+
dataType: "string";
|
|
33
|
+
data: string;
|
|
34
|
+
driverParam: string;
|
|
35
|
+
notNull: true;
|
|
36
|
+
hasDefault: false;
|
|
37
|
+
isPrimaryKey: false;
|
|
38
|
+
isAutoincrement: false;
|
|
39
|
+
hasRuntimeDefault: false;
|
|
40
|
+
enumValues: [string, ...string[]];
|
|
41
|
+
baseColumn: never;
|
|
42
|
+
identity: undefined;
|
|
43
|
+
generated: undefined;
|
|
44
|
+
}, {}>;
|
|
45
|
+
subjectKind: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
46
|
+
name: string;
|
|
47
|
+
tableName: "vitehub_comment_sends";
|
|
48
|
+
dataType: "string";
|
|
49
|
+
data: string;
|
|
50
|
+
driverParam: string;
|
|
51
|
+
notNull: true;
|
|
52
|
+
hasDefault: false;
|
|
53
|
+
isPrimaryKey: false;
|
|
54
|
+
isAutoincrement: false;
|
|
55
|
+
hasRuntimeDefault: false;
|
|
56
|
+
enumValues: [string, ...string[]];
|
|
57
|
+
baseColumn: never;
|
|
58
|
+
identity: undefined;
|
|
59
|
+
generated: undefined;
|
|
60
|
+
}, {}>;
|
|
61
|
+
subjectId: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
62
|
+
name: string;
|
|
63
|
+
tableName: "vitehub_comment_sends";
|
|
64
|
+
dataType: "string";
|
|
65
|
+
data: string;
|
|
66
|
+
driverParam: string;
|
|
67
|
+
notNull: true;
|
|
68
|
+
hasDefault: false;
|
|
69
|
+
isPrimaryKey: false;
|
|
70
|
+
isAutoincrement: false;
|
|
71
|
+
hasRuntimeDefault: false;
|
|
72
|
+
enumValues: [string, ...string[]];
|
|
73
|
+
baseColumn: never;
|
|
74
|
+
identity: undefined;
|
|
75
|
+
generated: undefined;
|
|
76
|
+
}, {}>;
|
|
77
|
+
page: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
78
|
+
name: string;
|
|
79
|
+
tableName: "vitehub_comment_sends";
|
|
80
|
+
dataType: "string";
|
|
81
|
+
data: string;
|
|
82
|
+
driverParam: string;
|
|
83
|
+
notNull: true;
|
|
84
|
+
hasDefault: false;
|
|
85
|
+
isPrimaryKey: false;
|
|
86
|
+
isAutoincrement: false;
|
|
87
|
+
hasRuntimeDefault: false;
|
|
88
|
+
enumValues: [string, ...string[]];
|
|
89
|
+
baseColumn: never;
|
|
90
|
+
identity: undefined;
|
|
91
|
+
generated: undefined;
|
|
92
|
+
}, {}>;
|
|
93
|
+
threads: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
94
|
+
name: string;
|
|
95
|
+
tableName: "vitehub_comment_sends";
|
|
96
|
+
dataType: "string";
|
|
97
|
+
data: string;
|
|
98
|
+
driverParam: string;
|
|
99
|
+
notNull: true;
|
|
100
|
+
hasDefault: false;
|
|
101
|
+
isPrimaryKey: false;
|
|
102
|
+
isAutoincrement: false;
|
|
103
|
+
hasRuntimeDefault: false;
|
|
104
|
+
enumValues: [string, ...string[]];
|
|
105
|
+
baseColumn: never;
|
|
106
|
+
identity: undefined;
|
|
107
|
+
generated: undefined;
|
|
108
|
+
}, {}>;
|
|
109
|
+
key: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
110
|
+
name: string;
|
|
111
|
+
tableName: "vitehub_comment_sends";
|
|
112
|
+
dataType: "string";
|
|
113
|
+
data: string;
|
|
114
|
+
driverParam: string;
|
|
115
|
+
notNull: true;
|
|
116
|
+
hasDefault: false;
|
|
117
|
+
isPrimaryKey: false;
|
|
118
|
+
isAutoincrement: false;
|
|
119
|
+
hasRuntimeDefault: false;
|
|
120
|
+
enumValues: [string, ...string[]];
|
|
121
|
+
baseColumn: never;
|
|
122
|
+
identity: undefined;
|
|
123
|
+
generated: undefined;
|
|
124
|
+
}, {}>;
|
|
125
|
+
state: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
126
|
+
name: string;
|
|
127
|
+
tableName: "vitehub_comment_sends";
|
|
128
|
+
dataType: "string enum";
|
|
129
|
+
data: "pending" | "sent" | "working" | "done" | "failed";
|
|
130
|
+
driverParam: string;
|
|
131
|
+
notNull: true;
|
|
132
|
+
hasDefault: false;
|
|
133
|
+
isPrimaryKey: false;
|
|
134
|
+
isAutoincrement: false;
|
|
135
|
+
hasRuntimeDefault: false;
|
|
136
|
+
enumValues: ["pending", "sent", "working", "done", "failed"];
|
|
137
|
+
baseColumn: never;
|
|
138
|
+
identity: undefined;
|
|
139
|
+
generated: undefined;
|
|
140
|
+
}, {}>;
|
|
141
|
+
delivery: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
142
|
+
name: string;
|
|
143
|
+
tableName: "vitehub_comment_sends";
|
|
144
|
+
dataType: "string";
|
|
145
|
+
data: string;
|
|
146
|
+
driverParam: string;
|
|
147
|
+
notNull: false;
|
|
148
|
+
hasDefault: false;
|
|
149
|
+
isPrimaryKey: false;
|
|
150
|
+
isAutoincrement: false;
|
|
151
|
+
hasRuntimeDefault: false;
|
|
152
|
+
enumValues: [string, ...string[]];
|
|
153
|
+
baseColumn: never;
|
|
154
|
+
identity: undefined;
|
|
155
|
+
generated: undefined;
|
|
156
|
+
}, {}>;
|
|
157
|
+
endpoint: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
158
|
+
name: string;
|
|
159
|
+
tableName: "vitehub_comment_sends";
|
|
160
|
+
dataType: "string";
|
|
161
|
+
data: string;
|
|
162
|
+
driverParam: string;
|
|
163
|
+
notNull: false;
|
|
164
|
+
hasDefault: false;
|
|
165
|
+
isPrimaryKey: false;
|
|
166
|
+
isAutoincrement: false;
|
|
167
|
+
hasRuntimeDefault: false;
|
|
168
|
+
enumValues: [string, ...string[]];
|
|
169
|
+
baseColumn: never;
|
|
170
|
+
identity: undefined;
|
|
171
|
+
generated: undefined;
|
|
172
|
+
}, {}>;
|
|
173
|
+
thread: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
174
|
+
name: string;
|
|
175
|
+
tableName: "vitehub_comment_sends";
|
|
176
|
+
dataType: "string";
|
|
177
|
+
data: string;
|
|
178
|
+
driverParam: string;
|
|
179
|
+
notNull: false;
|
|
180
|
+
hasDefault: false;
|
|
181
|
+
isPrimaryKey: false;
|
|
182
|
+
isAutoincrement: false;
|
|
183
|
+
hasRuntimeDefault: false;
|
|
184
|
+
enumValues: [string, ...string[]];
|
|
185
|
+
baseColumn: never;
|
|
186
|
+
identity: undefined;
|
|
187
|
+
generated: undefined;
|
|
188
|
+
}, {}>;
|
|
189
|
+
error: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
190
|
+
name: string;
|
|
191
|
+
tableName: "vitehub_comment_sends";
|
|
192
|
+
dataType: "string";
|
|
193
|
+
data: string;
|
|
194
|
+
driverParam: string;
|
|
195
|
+
notNull: false;
|
|
196
|
+
hasDefault: false;
|
|
197
|
+
isPrimaryKey: false;
|
|
198
|
+
isAutoincrement: false;
|
|
199
|
+
hasRuntimeDefault: false;
|
|
200
|
+
enumValues: [string, ...string[]];
|
|
201
|
+
baseColumn: never;
|
|
202
|
+
identity: undefined;
|
|
203
|
+
generated: undefined;
|
|
204
|
+
}, {}>;
|
|
205
|
+
sender: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
206
|
+
name: string;
|
|
207
|
+
tableName: "vitehub_comment_sends";
|
|
208
|
+
dataType: "string";
|
|
209
|
+
data: string;
|
|
210
|
+
driverParam: string;
|
|
211
|
+
notNull: true;
|
|
212
|
+
hasDefault: false;
|
|
213
|
+
isPrimaryKey: false;
|
|
214
|
+
isAutoincrement: false;
|
|
215
|
+
hasRuntimeDefault: false;
|
|
216
|
+
enumValues: [string, ...string[]];
|
|
217
|
+
baseColumn: never;
|
|
218
|
+
identity: undefined;
|
|
219
|
+
generated: undefined;
|
|
220
|
+
}, {}>;
|
|
221
|
+
tokenHash: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
222
|
+
name: string;
|
|
223
|
+
tableName: "vitehub_comment_sends";
|
|
224
|
+
dataType: "string";
|
|
225
|
+
data: string;
|
|
226
|
+
driverParam: string;
|
|
227
|
+
notNull: false;
|
|
228
|
+
hasDefault: false;
|
|
229
|
+
isPrimaryKey: false;
|
|
230
|
+
isAutoincrement: false;
|
|
231
|
+
hasRuntimeDefault: false;
|
|
232
|
+
enumValues: [string, ...string[]];
|
|
233
|
+
baseColumn: never;
|
|
234
|
+
identity: undefined;
|
|
235
|
+
generated: undefined;
|
|
236
|
+
}, {}>;
|
|
237
|
+
tokenExpiresAt: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
238
|
+
name: string;
|
|
239
|
+
tableName: "vitehub_comment_sends";
|
|
240
|
+
dataType: "number int53";
|
|
241
|
+
data: number;
|
|
242
|
+
driverParam: number;
|
|
243
|
+
notNull: false;
|
|
244
|
+
hasDefault: false;
|
|
245
|
+
isPrimaryKey: false;
|
|
246
|
+
isAutoincrement: false;
|
|
247
|
+
hasRuntimeDefault: false;
|
|
248
|
+
enumValues: undefined;
|
|
249
|
+
baseColumn: never;
|
|
250
|
+
identity: undefined;
|
|
251
|
+
generated: undefined;
|
|
252
|
+
}, {}>;
|
|
253
|
+
createdAt: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
254
|
+
name: string;
|
|
255
|
+
tableName: "vitehub_comment_sends";
|
|
256
|
+
dataType: "number int53";
|
|
257
|
+
data: number;
|
|
258
|
+
driverParam: number;
|
|
259
|
+
notNull: true;
|
|
260
|
+
hasDefault: false;
|
|
261
|
+
isPrimaryKey: false;
|
|
262
|
+
isAutoincrement: false;
|
|
263
|
+
hasRuntimeDefault: false;
|
|
264
|
+
enumValues: undefined;
|
|
265
|
+
baseColumn: never;
|
|
266
|
+
identity: undefined;
|
|
267
|
+
generated: undefined;
|
|
268
|
+
}, {}>;
|
|
269
|
+
updatedAt: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
270
|
+
name: string;
|
|
271
|
+
tableName: "vitehub_comment_sends";
|
|
272
|
+
dataType: "number int53";
|
|
273
|
+
data: number;
|
|
274
|
+
driverParam: number;
|
|
275
|
+
notNull: true;
|
|
276
|
+
hasDefault: false;
|
|
277
|
+
isPrimaryKey: false;
|
|
278
|
+
isAutoincrement: false;
|
|
279
|
+
hasRuntimeDefault: false;
|
|
280
|
+
enumValues: undefined;
|
|
281
|
+
baseColumn: never;
|
|
282
|
+
identity: undefined;
|
|
283
|
+
generated: undefined;
|
|
284
|
+
}, {}>;
|
|
285
|
+
};
|
|
286
|
+
dialect: "sqlite";
|
|
287
|
+
isAlias: false;
|
|
288
|
+
}>;
|
|
289
|
+
/** The tables of Send, for a Database contribution. Comments adds them only when `defineComments({ send })` is on. */
|
|
290
|
+
declare const commentSendsSchema: {
|
|
291
|
+
commentSends: import("drizzle-orm/sqlite-core").SQLiteTableWithColumns<{
|
|
292
|
+
name: "vitehub_comment_sends";
|
|
293
|
+
schema: undefined;
|
|
294
|
+
columns: {
|
|
295
|
+
id: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
296
|
+
name: string;
|
|
297
|
+
tableName: "vitehub_comment_sends";
|
|
298
|
+
dataType: "string";
|
|
299
|
+
data: string;
|
|
300
|
+
driverParam: string;
|
|
301
|
+
notNull: true;
|
|
302
|
+
hasDefault: false;
|
|
303
|
+
isPrimaryKey: true;
|
|
304
|
+
isAutoincrement: false;
|
|
305
|
+
hasRuntimeDefault: false;
|
|
306
|
+
enumValues: [string, ...string[]];
|
|
307
|
+
baseColumn: never;
|
|
308
|
+
identity: undefined;
|
|
309
|
+
generated: undefined;
|
|
310
|
+
}, {}>;
|
|
311
|
+
member: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
312
|
+
name: string;
|
|
313
|
+
tableName: "vitehub_comment_sends";
|
|
314
|
+
dataType: "string";
|
|
315
|
+
data: string;
|
|
316
|
+
driverParam: string;
|
|
317
|
+
notNull: true;
|
|
318
|
+
hasDefault: false;
|
|
319
|
+
isPrimaryKey: false;
|
|
320
|
+
isAutoincrement: false;
|
|
321
|
+
hasRuntimeDefault: false;
|
|
322
|
+
enumValues: [string, ...string[]];
|
|
323
|
+
baseColumn: never;
|
|
324
|
+
identity: undefined;
|
|
325
|
+
generated: undefined;
|
|
326
|
+
}, {}>;
|
|
327
|
+
subjectKind: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
328
|
+
name: string;
|
|
329
|
+
tableName: "vitehub_comment_sends";
|
|
330
|
+
dataType: "string";
|
|
331
|
+
data: string;
|
|
332
|
+
driverParam: string;
|
|
333
|
+
notNull: true;
|
|
334
|
+
hasDefault: false;
|
|
335
|
+
isPrimaryKey: false;
|
|
336
|
+
isAutoincrement: false;
|
|
337
|
+
hasRuntimeDefault: false;
|
|
338
|
+
enumValues: [string, ...string[]];
|
|
339
|
+
baseColumn: never;
|
|
340
|
+
identity: undefined;
|
|
341
|
+
generated: undefined;
|
|
342
|
+
}, {}>;
|
|
343
|
+
subjectId: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
344
|
+
name: string;
|
|
345
|
+
tableName: "vitehub_comment_sends";
|
|
346
|
+
dataType: "string";
|
|
347
|
+
data: string;
|
|
348
|
+
driverParam: string;
|
|
349
|
+
notNull: true;
|
|
350
|
+
hasDefault: false;
|
|
351
|
+
isPrimaryKey: false;
|
|
352
|
+
isAutoincrement: false;
|
|
353
|
+
hasRuntimeDefault: false;
|
|
354
|
+
enumValues: [string, ...string[]];
|
|
355
|
+
baseColumn: never;
|
|
356
|
+
identity: undefined;
|
|
357
|
+
generated: undefined;
|
|
358
|
+
}, {}>;
|
|
359
|
+
page: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
360
|
+
name: string;
|
|
361
|
+
tableName: "vitehub_comment_sends";
|
|
362
|
+
dataType: "string";
|
|
363
|
+
data: string;
|
|
364
|
+
driverParam: string;
|
|
365
|
+
notNull: true;
|
|
366
|
+
hasDefault: false;
|
|
367
|
+
isPrimaryKey: false;
|
|
368
|
+
isAutoincrement: false;
|
|
369
|
+
hasRuntimeDefault: false;
|
|
370
|
+
enumValues: [string, ...string[]];
|
|
371
|
+
baseColumn: never;
|
|
372
|
+
identity: undefined;
|
|
373
|
+
generated: undefined;
|
|
374
|
+
}, {}>;
|
|
375
|
+
threads: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
376
|
+
name: string;
|
|
377
|
+
tableName: "vitehub_comment_sends";
|
|
378
|
+
dataType: "string";
|
|
379
|
+
data: string;
|
|
380
|
+
driverParam: string;
|
|
381
|
+
notNull: true;
|
|
382
|
+
hasDefault: false;
|
|
383
|
+
isPrimaryKey: false;
|
|
384
|
+
isAutoincrement: false;
|
|
385
|
+
hasRuntimeDefault: false;
|
|
386
|
+
enumValues: [string, ...string[]];
|
|
387
|
+
baseColumn: never;
|
|
388
|
+
identity: undefined;
|
|
389
|
+
generated: undefined;
|
|
390
|
+
}, {}>;
|
|
391
|
+
key: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
392
|
+
name: string;
|
|
393
|
+
tableName: "vitehub_comment_sends";
|
|
394
|
+
dataType: "string";
|
|
395
|
+
data: string;
|
|
396
|
+
driverParam: string;
|
|
397
|
+
notNull: true;
|
|
398
|
+
hasDefault: false;
|
|
399
|
+
isPrimaryKey: false;
|
|
400
|
+
isAutoincrement: false;
|
|
401
|
+
hasRuntimeDefault: false;
|
|
402
|
+
enumValues: [string, ...string[]];
|
|
403
|
+
baseColumn: never;
|
|
404
|
+
identity: undefined;
|
|
405
|
+
generated: undefined;
|
|
406
|
+
}, {}>;
|
|
407
|
+
state: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
408
|
+
name: string;
|
|
409
|
+
tableName: "vitehub_comment_sends";
|
|
410
|
+
dataType: "string enum";
|
|
411
|
+
data: "pending" | "sent" | "working" | "done" | "failed";
|
|
412
|
+
driverParam: string;
|
|
413
|
+
notNull: true;
|
|
414
|
+
hasDefault: false;
|
|
415
|
+
isPrimaryKey: false;
|
|
416
|
+
isAutoincrement: false;
|
|
417
|
+
hasRuntimeDefault: false;
|
|
418
|
+
enumValues: ["pending", "sent", "working", "done", "failed"];
|
|
419
|
+
baseColumn: never;
|
|
420
|
+
identity: undefined;
|
|
421
|
+
generated: undefined;
|
|
422
|
+
}, {}>;
|
|
423
|
+
delivery: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
424
|
+
name: string;
|
|
425
|
+
tableName: "vitehub_comment_sends";
|
|
426
|
+
dataType: "string";
|
|
427
|
+
data: string;
|
|
428
|
+
driverParam: string;
|
|
429
|
+
notNull: false;
|
|
430
|
+
hasDefault: false;
|
|
431
|
+
isPrimaryKey: false;
|
|
432
|
+
isAutoincrement: false;
|
|
433
|
+
hasRuntimeDefault: false;
|
|
434
|
+
enumValues: [string, ...string[]];
|
|
435
|
+
baseColumn: never;
|
|
436
|
+
identity: undefined;
|
|
437
|
+
generated: undefined;
|
|
438
|
+
}, {}>;
|
|
439
|
+
endpoint: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
440
|
+
name: string;
|
|
441
|
+
tableName: "vitehub_comment_sends";
|
|
442
|
+
dataType: "string";
|
|
443
|
+
data: string;
|
|
444
|
+
driverParam: string;
|
|
445
|
+
notNull: false;
|
|
446
|
+
hasDefault: false;
|
|
447
|
+
isPrimaryKey: false;
|
|
448
|
+
isAutoincrement: false;
|
|
449
|
+
hasRuntimeDefault: false;
|
|
450
|
+
enumValues: [string, ...string[]];
|
|
451
|
+
baseColumn: never;
|
|
452
|
+
identity: undefined;
|
|
453
|
+
generated: undefined;
|
|
454
|
+
}, {}>;
|
|
455
|
+
thread: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
456
|
+
name: string;
|
|
457
|
+
tableName: "vitehub_comment_sends";
|
|
458
|
+
dataType: "string";
|
|
459
|
+
data: string;
|
|
460
|
+
driverParam: string;
|
|
461
|
+
notNull: false;
|
|
462
|
+
hasDefault: false;
|
|
463
|
+
isPrimaryKey: false;
|
|
464
|
+
isAutoincrement: false;
|
|
465
|
+
hasRuntimeDefault: false;
|
|
466
|
+
enumValues: [string, ...string[]];
|
|
467
|
+
baseColumn: never;
|
|
468
|
+
identity: undefined;
|
|
469
|
+
generated: undefined;
|
|
470
|
+
}, {}>;
|
|
471
|
+
error: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
472
|
+
name: string;
|
|
473
|
+
tableName: "vitehub_comment_sends";
|
|
474
|
+
dataType: "string";
|
|
475
|
+
data: string;
|
|
476
|
+
driverParam: string;
|
|
477
|
+
notNull: false;
|
|
478
|
+
hasDefault: false;
|
|
479
|
+
isPrimaryKey: false;
|
|
480
|
+
isAutoincrement: false;
|
|
481
|
+
hasRuntimeDefault: false;
|
|
482
|
+
enumValues: [string, ...string[]];
|
|
483
|
+
baseColumn: never;
|
|
484
|
+
identity: undefined;
|
|
485
|
+
generated: undefined;
|
|
486
|
+
}, {}>;
|
|
487
|
+
sender: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
488
|
+
name: string;
|
|
489
|
+
tableName: "vitehub_comment_sends";
|
|
490
|
+
dataType: "string";
|
|
491
|
+
data: string;
|
|
492
|
+
driverParam: string;
|
|
493
|
+
notNull: true;
|
|
494
|
+
hasDefault: false;
|
|
495
|
+
isPrimaryKey: false;
|
|
496
|
+
isAutoincrement: false;
|
|
497
|
+
hasRuntimeDefault: false;
|
|
498
|
+
enumValues: [string, ...string[]];
|
|
499
|
+
baseColumn: never;
|
|
500
|
+
identity: undefined;
|
|
501
|
+
generated: undefined;
|
|
502
|
+
}, {}>;
|
|
503
|
+
tokenHash: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
504
|
+
name: string;
|
|
505
|
+
tableName: "vitehub_comment_sends";
|
|
506
|
+
dataType: "string";
|
|
507
|
+
data: string;
|
|
508
|
+
driverParam: string;
|
|
509
|
+
notNull: false;
|
|
510
|
+
hasDefault: false;
|
|
511
|
+
isPrimaryKey: false;
|
|
512
|
+
isAutoincrement: false;
|
|
513
|
+
hasRuntimeDefault: false;
|
|
514
|
+
enumValues: [string, ...string[]];
|
|
515
|
+
baseColumn: never;
|
|
516
|
+
identity: undefined;
|
|
517
|
+
generated: undefined;
|
|
518
|
+
}, {}>;
|
|
519
|
+
tokenExpiresAt: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
520
|
+
name: string;
|
|
521
|
+
tableName: "vitehub_comment_sends";
|
|
522
|
+
dataType: "number int53";
|
|
523
|
+
data: number;
|
|
524
|
+
driverParam: number;
|
|
525
|
+
notNull: false;
|
|
526
|
+
hasDefault: false;
|
|
527
|
+
isPrimaryKey: false;
|
|
528
|
+
isAutoincrement: false;
|
|
529
|
+
hasRuntimeDefault: false;
|
|
530
|
+
enumValues: undefined;
|
|
531
|
+
baseColumn: never;
|
|
532
|
+
identity: undefined;
|
|
533
|
+
generated: undefined;
|
|
534
|
+
}, {}>;
|
|
535
|
+
createdAt: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
536
|
+
name: string;
|
|
537
|
+
tableName: "vitehub_comment_sends";
|
|
538
|
+
dataType: "number int53";
|
|
539
|
+
data: number;
|
|
540
|
+
driverParam: number;
|
|
541
|
+
notNull: true;
|
|
542
|
+
hasDefault: false;
|
|
543
|
+
isPrimaryKey: false;
|
|
544
|
+
isAutoincrement: false;
|
|
545
|
+
hasRuntimeDefault: false;
|
|
546
|
+
enumValues: undefined;
|
|
547
|
+
baseColumn: never;
|
|
548
|
+
identity: undefined;
|
|
549
|
+
generated: undefined;
|
|
550
|
+
}, {}>;
|
|
551
|
+
updatedAt: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
552
|
+
name: string;
|
|
553
|
+
tableName: "vitehub_comment_sends";
|
|
554
|
+
dataType: "number int53";
|
|
555
|
+
data: number;
|
|
556
|
+
driverParam: number;
|
|
557
|
+
notNull: true;
|
|
558
|
+
hasDefault: false;
|
|
559
|
+
isPrimaryKey: false;
|
|
560
|
+
isAutoincrement: false;
|
|
561
|
+
hasRuntimeDefault: false;
|
|
562
|
+
enumValues: undefined;
|
|
563
|
+
baseColumn: never;
|
|
564
|
+
identity: undefined;
|
|
565
|
+
generated: undefined;
|
|
566
|
+
}, {}>;
|
|
567
|
+
};
|
|
568
|
+
dialect: "sqlite";
|
|
569
|
+
isAlias: false;
|
|
570
|
+
}>;
|
|
571
|
+
};
|
|
572
|
+
/** `commentSendsSchema` as SQLite statements that are safe to run on every start. */
|
|
573
|
+
declare const commentSendsTables: readonly string[];
|
|
574
|
+
//#endregion
|
|
575
|
+
export { commentSendsTables as i, commentSends as n, commentSendsSchema as r, CommentSendState as t };
|
package/dist/database.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { a as commentsSchema, i as commentThreads, n as commentForge, r as commentMessages, t as commentCounters } from "./database-CA1aHKN7.js";
|
|
2
|
+
import { i as commentSendsTables, n as commentSends, r as commentSendsSchema, t as CommentSendState } from "./database-CTo7mx6t.js";
|
|
2
3
|
import { a as commentsMigrationSql, c as migrateComments, i as CommentsSchemaState, n as CommentsMigrationOptions, o as commentsSchemaState, s as liveThreadsBackup, t as CommentsMigration } from "./migrate-B0k_0swk.js";
|
|
3
4
|
//#region src/tables.d.ts
|
|
4
5
|
/**
|
|
@@ -9,4 +10,4 @@ import { a as commentsMigrationSql, c as migrateComments, i as CommentsSchemaSta
|
|
|
9
10
|
*/
|
|
10
11
|
export declare const commentsTables: readonly string[];
|
|
11
12
|
//#endregion
|
|
12
|
-
export { type CommentsMigration, type CommentsMigrationOptions, type CommentsSchemaState, commentCounters, commentForge, commentMessages, commentThreads, commentsMigrationSql, commentsSchema, commentsSchemaState, liveThreadsBackup, migrateComments };
|
|
13
|
+
export { type CommentSendState, type CommentsMigration, type CommentsMigrationOptions, type CommentsSchemaState, commentCounters, commentForge, commentMessages, commentSends, commentSendsSchema, commentSendsTables, commentThreads, commentsMigrationSql, commentsSchema, commentsSchemaState, liveThreadsBackup, migrateComments };
|
package/dist/database.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { commentCounters, commentForge, commentMessages, commentThreads, commentsMigrationSql, commentsSchema, commentsSchemaState, commentsTables, liveThreadsBackup, migrateComments };
|
|
1
|
+
import { c as migrateComments, d as commentForge, f as commentMessages, i as commentsMigrationSql, l as commentsTables, m as commentsSchema, n as commentSendsSchema, o as commentsSchemaState, p as commentThreads, r as commentSendsTables, s as liveThreadsBackup, t as commentSends, u as commentCounters } from "./database-6hXRnqDE.js";
|
|
2
|
+
export { commentCounters, commentForge, commentMessages, commentSends, commentSendsSchema, commentSendsTables, commentThreads, commentsMigrationSql, commentsSchema, commentsSchemaState, commentsTables, liveThreadsBackup, migrateComments };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as commentsErrorDiagnostics } from "./errors-
|
|
1
|
+
import { t as commentsErrorDiagnostics } from "./errors-Dq4AHjza.js";
|
|
2
2
|
//#region src/operations-core/define.ts
|
|
3
3
|
const marker = Symbol.for("vitehub.comments.definition");
|
|
4
4
|
/** Marks a definition, so the build can check what `server/comments.ts` exports. */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { D as CommentUser, T as CommentThread, b as CommentMetadata, n as CommentActor, w as CommentSubject, y as CommentMessage } from "./types-
|
|
1
|
+
import { D as CommentUser, T as CommentThread, b as CommentMetadata, n as CommentActor, w as CommentSubject, y as CommentMessage } from "./types-BLaYh0_f.js";
|
|
2
2
|
//#region src/operations-core/define.d.ts
|
|
3
3
|
/**
|
|
4
4
|
* - `read`: see threads, join the presence room of a page, and get `@` suggestions.
|
|
@@ -49,6 +49,12 @@ interface CommentsAuthorizeContext {
|
|
|
49
49
|
* `authorize: ({ console, user }) => console === true || user?.role === "editor"`.
|
|
50
50
|
*/
|
|
51
51
|
console?: boolean;
|
|
52
|
+
/**
|
|
53
|
+
* The app runs on the development server: Vite's serve command, which the generated plugin records. It never comes
|
|
54
|
+
* from `NODE_ENV`. Pass `{ development }` to `defaultPolicy()` for the dev, GitHub, and Site access checks.
|
|
55
|
+
* The full context is not the default gate: with `identify`, Console admission does not grant the app user access.
|
|
56
|
+
*/
|
|
57
|
+
development?: boolean;
|
|
52
58
|
}
|
|
53
59
|
/** Decides whether a person or an Agent may take an action. Return `true` to allow. */
|
|
54
60
|
type CommentsAuthorize = (context: CommentsAuthorizeContext) => boolean | Promise<boolean>;
|
|
@@ -173,8 +179,6 @@ interface CommentsDefinition {
|
|
|
173
179
|
declare function validateCommentsDefinition(value: unknown, file: string): CommentsDefinition;
|
|
174
180
|
/** A subject kind of your own, such as `drop`. */
|
|
175
181
|
declare function defineCommentSubject(subject: CommentSubjectDefinition): CommentSubjectDefinition;
|
|
176
|
-
/** Subjects that exist without a definition. */
|
|
177
|
-
declare const builtinCommentSubjects: readonly CommentSubjectDefinition[];
|
|
178
182
|
/** What the server checked about a request before the policy runs. */
|
|
179
183
|
interface CommentsPolicyGate {
|
|
180
184
|
/** Vite's serve command. The generated Nitro plugin records it; it never comes from `NODE_ENV`. */
|
|
@@ -201,4 +205,4 @@ declare function commentsRoleAllows(user: CommentsUser | null, action: CommentAc
|
|
|
201
205
|
*/
|
|
202
206
|
declare function defaultPolicy(user: CommentsUser | null, gate?: CommentsPolicyGate, action?: CommentAction): boolean;
|
|
203
207
|
//#endregion
|
|
204
|
-
export {
|
|
208
|
+
export { commentsRoleAllows as _, CommentsAttachmentFile as a, validateCommentsDefinition as b, CommentsCanMentionContext as c, CommentsPeople as d, CommentsPolicyGate as f, CommentsUser as g, CommentsStoreAttachmentContext as h, CommentSubjectDefinition as i, CommentsDefinition as l, CommentsReadAttachmentContext as m, CommentMentionEvent as n, CommentsAuthorize as o, CommentsRateLimit as p, CommentMessageEvent as r, CommentsAuthorizeContext as s, CommentAction as t, CommentsGitHubAccess as u, defaultPolicy as v, defineCommentSubject as y };
|
|
@@ -50,6 +50,30 @@ const commentsErrors = /*#__PURE__*/ defineErrors({
|
|
|
50
50
|
COMMENTS_FIELD_LOCKED: {
|
|
51
51
|
why: ({ holder }) => `${holder} holds the edit lease of this document in the Console.`,
|
|
52
52
|
fix: "Wait until they close the document, or edit it together with them in the Console."
|
|
53
|
+
},
|
|
54
|
+
COMMENTS_SEND_CODE_EXPIRED: {
|
|
55
|
+
why: "The setup code of Send is older than 10 minutes, or it does not exist.",
|
|
56
|
+
fix: "Press Send in the comment pill again. It copies a setup prompt with a new code."
|
|
57
|
+
},
|
|
58
|
+
COMMENTS_SEND_CODE_REFUSED: {
|
|
59
|
+
why: ({ reason }) => `Send did not pair the agent. ${reason}`,
|
|
60
|
+
fix: "Pair with the `webhookUrl` that T3 Code's `schedule_task` returns, on `relay.t3.codes`, or add the host to `defineComments({ send: { hosts } })`. Then press Copy again for a new code."
|
|
61
|
+
},
|
|
62
|
+
COMMENTS_SEND_CODE_USED: {
|
|
63
|
+
why: "An agent already used this setup code. A code pairs one agent, once.",
|
|
64
|
+
fix: "Press Send in the comment pill again for a new code."
|
|
65
|
+
},
|
|
66
|
+
COMMENTS_SEND_GRANT_INVALID: {
|
|
67
|
+
why: "The read token does not open this send: it is wrong, older than 24 hours, or the app turned read tokens off.",
|
|
68
|
+
fix: "Use the `read.token` of the same delivery within 24 hours. With `send: { grant: false }`, read the threads through the app's MCP tools instead."
|
|
69
|
+
},
|
|
70
|
+
COMMENTS_SEND_INSECURE: {
|
|
71
|
+
why: ({ origin }) => `Send answers with a setup code and a signing secret, and builds links that carry read tokens, so it does not run over plain http. The request came from ${origin}.`,
|
|
72
|
+
fix: "Open the site over https. In development, use `localhost`, `*.localhost`, or `127.0.0.1`. With `wrangler dev`, pass `--infer-origin-from-routes=false`, so the request keeps the local origin instead of the production host."
|
|
73
|
+
},
|
|
74
|
+
COMMENTS_SEND_OFF: {
|
|
75
|
+
why: "Send is off: `defineComments()` has no `send` option, or the app has no Webhooks.",
|
|
76
|
+
fix: "Set `defineComments({ send: true })` in `server/comments.ts`, in a ViteHub app with `vitehub({ database: true })`."
|
|
53
77
|
}
|
|
54
78
|
}
|
|
55
79
|
});
|
|
@@ -129,9 +129,25 @@ const commentsErrorDiagnostics = /*#__PURE__*/ defineDiagnostics({
|
|
|
129
129
|
why: ({ issue }) => `defineComments(): ${issue}`,
|
|
130
130
|
fix: "Pass rateLimit as { limit, window }, such as { limit: 5, window: \"1m\" }, or remove it to let guests write without a limit."
|
|
131
131
|
},
|
|
132
|
+
COMMENTS_RESOLVE_INTERRUPTED: {
|
|
133
|
+
why: ({ completed, threadId, replied }) => `Resolution stopped at ${JSON.stringify(threadId)}${replied ? " after its reply was saved" : ""}. Completed threads: ${completed.map((id) => JSON.stringify(id)).join(", ") || "none"}.`,
|
|
134
|
+
fix: "Read the affected thread again and resolve the remaining threads."
|
|
135
|
+
},
|
|
132
136
|
COMMENTS_SECRET_TOO_SHORT: {
|
|
133
137
|
why: ({ minimum }) => `[vitehub] VITEHUB_SECRET must be at least ${minimum} characters. Generate one with \`openssl rand -base64 32\`.`,
|
|
134
138
|
fix: "Set `VITEHUB_SECRET` to the output of `openssl rand -base64 32`, which has 44 characters."
|
|
139
|
+
},
|
|
140
|
+
COMMENTS_SEND_POSTGRES: {
|
|
141
|
+
why: "`defineComments({ send })` keeps its sends in SQLite tables, and this app keeps comments in Postgres.",
|
|
142
|
+
fix: "Keep comments in a SQLite, libSQL, or D1 Database, or remove `send` from `defineComments()`."
|
|
143
|
+
},
|
|
144
|
+
COMMENTS_SEND_TABLES_MISSING: {
|
|
145
|
+
why: ({ missing }) => `\`defineComments({ send })\` needs the tables ${missing}, and the Database does not have them yet.`,
|
|
146
|
+
fix: "Run `vitehub database generate` and `vitehub database migrate`. `vite dev` applies the migration for you."
|
|
147
|
+
},
|
|
148
|
+
COMMENTS_SEND_WEBHOOKS_OFF: {
|
|
149
|
+
why: ({ file }) => `${file} turns on Send, and Send delivers through the member endpoints of Webhooks, which this app does not have.`,
|
|
150
|
+
fix: "Use Comments through `vitehub()`, which adds Webhooks, and install `@vite-hub/webhooks` when you use the packages one by one. `comments()` without `vite-hub` has no Send."
|
|
135
151
|
}
|
|
136
152
|
}
|
|
137
153
|
});
|