@commonpub/schema 0.1.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.
Files changed (67) hide show
  1. package/LICENSE +661 -0
  2. package/README.md +87 -0
  3. package/dist/admin.d.ts +256 -0
  4. package/dist/admin.d.ts.map +1 -0
  5. package/dist/admin.js +33 -0
  6. package/dist/admin.js.map +1 -0
  7. package/dist/auth.d.ts +1552 -0
  8. package/dist/auth.d.ts.map +1 -0
  9. package/dist/auth.js +140 -0
  10. package/dist/auth.js.map +1 -0
  11. package/dist/content.d.ts +1129 -0
  12. package/dist/content.d.ts.map +1 -0
  13. package/dist/content.js +152 -0
  14. package/dist/content.js.map +1 -0
  15. package/dist/contest.d.ts +466 -0
  16. package/dist/contest.d.ts.map +1 -0
  17. package/dist/contest.js +64 -0
  18. package/dist/contest.js.map +1 -0
  19. package/dist/docs.d.ts +545 -0
  20. package/dist/docs.d.ts.map +1 -0
  21. package/dist/docs.js +78 -0
  22. package/dist/docs.js.map +1 -0
  23. package/dist/enums.d.ts +31 -0
  24. package/dist/enums.d.ts.map +1 -0
  25. package/dist/enums.js +149 -0
  26. package/dist/enums.js.map +1 -0
  27. package/dist/federation.d.ts +613 -0
  28. package/dist/federation.d.ts.map +1 -0
  29. package/dist/federation.js +63 -0
  30. package/dist/federation.js.map +1 -0
  31. package/dist/files.d.ts +259 -0
  32. package/dist/files.d.ts.map +1 -0
  33. package/dist/files.js +33 -0
  34. package/dist/files.js.map +1 -0
  35. package/dist/hub.d.ts +1235 -0
  36. package/dist/hub.d.ts.map +1 -0
  37. package/dist/hub.js +205 -0
  38. package/dist/hub.js.map +1 -0
  39. package/dist/index.d.ts +16 -0
  40. package/dist/index.d.ts.map +1 -0
  41. package/dist/index.js +31 -0
  42. package/dist/index.js.map +1 -0
  43. package/dist/learning.d.ts +960 -0
  44. package/dist/learning.d.ts.map +1 -0
  45. package/dist/learning.js +142 -0
  46. package/dist/learning.js.map +1 -0
  47. package/dist/openapi.d.ts +2 -0
  48. package/dist/openapi.d.ts.map +1 -0
  49. package/dist/openapi.js +322 -0
  50. package/dist/openapi.js.map +1 -0
  51. package/dist/product.d.ts +481 -0
  52. package/dist/product.d.ts.map +1 -0
  53. package/dist/product.js +66 -0
  54. package/dist/product.js.map +1 -0
  55. package/dist/social.d.ts +1027 -0
  56. package/dist/social.d.ts.map +1 -0
  57. package/dist/social.js +166 -0
  58. package/dist/social.js.map +1 -0
  59. package/dist/validators.d.ts +766 -0
  60. package/dist/validators.d.ts.map +1 -0
  61. package/dist/validators.js +385 -0
  62. package/dist/validators.js.map +1 -0
  63. package/dist/video.d.ts +353 -0
  64. package/dist/video.d.ts.map +1 -0
  65. package/dist/video.js +36 -0
  66. package/dist/video.js.map +1 -0
  67. package/package.json +77 -0
@@ -0,0 +1,613 @@
1
+ /** Cache of resolved remote ActivityPub actors */
2
+ export declare const remoteActors: import("drizzle-orm/pg-core").PgTableWithColumns<{
3
+ name: "remote_actors";
4
+ schema: undefined;
5
+ columns: {
6
+ id: import("drizzle-orm/pg-core").PgColumn<{
7
+ name: "id";
8
+ tableName: "remote_actors";
9
+ dataType: "string";
10
+ columnType: "PgUUID";
11
+ data: string;
12
+ driverParam: string;
13
+ notNull: true;
14
+ hasDefault: true;
15
+ isPrimaryKey: true;
16
+ isAutoincrement: false;
17
+ hasRuntimeDefault: false;
18
+ enumValues: undefined;
19
+ baseColumn: never;
20
+ identity: undefined;
21
+ generated: undefined;
22
+ }, {}, {}>;
23
+ actorUri: import("drizzle-orm/pg-core").PgColumn<{
24
+ name: "actor_uri";
25
+ tableName: "remote_actors";
26
+ dataType: "string";
27
+ columnType: "PgText";
28
+ data: string;
29
+ driverParam: string;
30
+ notNull: true;
31
+ hasDefault: false;
32
+ isPrimaryKey: false;
33
+ isAutoincrement: false;
34
+ hasRuntimeDefault: false;
35
+ enumValues: [string, ...string[]];
36
+ baseColumn: never;
37
+ identity: undefined;
38
+ generated: undefined;
39
+ }, {}, {}>;
40
+ inbox: import("drizzle-orm/pg-core").PgColumn<{
41
+ name: "inbox";
42
+ tableName: "remote_actors";
43
+ dataType: "string";
44
+ columnType: "PgText";
45
+ data: string;
46
+ driverParam: string;
47
+ notNull: true;
48
+ hasDefault: false;
49
+ isPrimaryKey: false;
50
+ isAutoincrement: false;
51
+ hasRuntimeDefault: false;
52
+ enumValues: [string, ...string[]];
53
+ baseColumn: never;
54
+ identity: undefined;
55
+ generated: undefined;
56
+ }, {}, {}>;
57
+ outbox: import("drizzle-orm/pg-core").PgColumn<{
58
+ name: "outbox";
59
+ tableName: "remote_actors";
60
+ dataType: "string";
61
+ columnType: "PgText";
62
+ data: string;
63
+ driverParam: string;
64
+ notNull: false;
65
+ hasDefault: false;
66
+ isPrimaryKey: false;
67
+ isAutoincrement: false;
68
+ hasRuntimeDefault: false;
69
+ enumValues: [string, ...string[]];
70
+ baseColumn: never;
71
+ identity: undefined;
72
+ generated: undefined;
73
+ }, {}, {}>;
74
+ publicKeyPem: import("drizzle-orm/pg-core").PgColumn<{
75
+ name: "public_key_pem";
76
+ tableName: "remote_actors";
77
+ dataType: "string";
78
+ columnType: "PgText";
79
+ data: string;
80
+ driverParam: string;
81
+ notNull: false;
82
+ hasDefault: false;
83
+ isPrimaryKey: false;
84
+ isAutoincrement: false;
85
+ hasRuntimeDefault: false;
86
+ enumValues: [string, ...string[]];
87
+ baseColumn: never;
88
+ identity: undefined;
89
+ generated: undefined;
90
+ }, {}, {}>;
91
+ preferredUsername: import("drizzle-orm/pg-core").PgColumn<{
92
+ name: "preferred_username";
93
+ tableName: "remote_actors";
94
+ dataType: "string";
95
+ columnType: "PgVarchar";
96
+ data: string;
97
+ driverParam: string;
98
+ notNull: false;
99
+ hasDefault: false;
100
+ isPrimaryKey: false;
101
+ isAutoincrement: false;
102
+ hasRuntimeDefault: false;
103
+ enumValues: [string, ...string[]];
104
+ baseColumn: never;
105
+ identity: undefined;
106
+ generated: undefined;
107
+ }, {}, {
108
+ length: 64;
109
+ }>;
110
+ displayName: import("drizzle-orm/pg-core").PgColumn<{
111
+ name: "display_name";
112
+ tableName: "remote_actors";
113
+ dataType: "string";
114
+ columnType: "PgVarchar";
115
+ data: string;
116
+ driverParam: string;
117
+ notNull: false;
118
+ hasDefault: false;
119
+ isPrimaryKey: false;
120
+ isAutoincrement: false;
121
+ hasRuntimeDefault: false;
122
+ enumValues: [string, ...string[]];
123
+ baseColumn: never;
124
+ identity: undefined;
125
+ generated: undefined;
126
+ }, {}, {
127
+ length: 128;
128
+ }>;
129
+ avatarUrl: import("drizzle-orm/pg-core").PgColumn<{
130
+ name: "avatar_url";
131
+ tableName: "remote_actors";
132
+ dataType: "string";
133
+ columnType: "PgText";
134
+ data: string;
135
+ driverParam: string;
136
+ notNull: false;
137
+ hasDefault: false;
138
+ isPrimaryKey: false;
139
+ isAutoincrement: false;
140
+ hasRuntimeDefault: false;
141
+ enumValues: [string, ...string[]];
142
+ baseColumn: never;
143
+ identity: undefined;
144
+ generated: undefined;
145
+ }, {}, {}>;
146
+ instanceDomain: import("drizzle-orm/pg-core").PgColumn<{
147
+ name: "instance_domain";
148
+ tableName: "remote_actors";
149
+ dataType: "string";
150
+ columnType: "PgVarchar";
151
+ data: string;
152
+ driverParam: string;
153
+ notNull: true;
154
+ hasDefault: false;
155
+ isPrimaryKey: false;
156
+ isAutoincrement: false;
157
+ hasRuntimeDefault: false;
158
+ enumValues: [string, ...string[]];
159
+ baseColumn: never;
160
+ identity: undefined;
161
+ generated: undefined;
162
+ }, {}, {
163
+ length: 255;
164
+ }>;
165
+ lastFetchedAt: import("drizzle-orm/pg-core").PgColumn<{
166
+ name: "last_fetched_at";
167
+ tableName: "remote_actors";
168
+ dataType: "date";
169
+ columnType: "PgTimestamp";
170
+ data: Date;
171
+ driverParam: string;
172
+ notNull: true;
173
+ hasDefault: true;
174
+ isPrimaryKey: false;
175
+ isAutoincrement: false;
176
+ hasRuntimeDefault: false;
177
+ enumValues: undefined;
178
+ baseColumn: never;
179
+ identity: undefined;
180
+ generated: undefined;
181
+ }, {}, {}>;
182
+ createdAt: import("drizzle-orm/pg-core").PgColumn<{
183
+ name: "created_at";
184
+ tableName: "remote_actors";
185
+ dataType: "date";
186
+ columnType: "PgTimestamp";
187
+ data: Date;
188
+ driverParam: string;
189
+ notNull: true;
190
+ hasDefault: true;
191
+ isPrimaryKey: false;
192
+ isAutoincrement: false;
193
+ hasRuntimeDefault: false;
194
+ enumValues: undefined;
195
+ baseColumn: never;
196
+ identity: undefined;
197
+ generated: undefined;
198
+ }, {}, {}>;
199
+ };
200
+ dialect: "pg";
201
+ }>;
202
+ /** Log of inbound/outbound AP activities */
203
+ export declare const activities: import("drizzle-orm/pg-core").PgTableWithColumns<{
204
+ name: "activities";
205
+ schema: undefined;
206
+ columns: {
207
+ id: import("drizzle-orm/pg-core").PgColumn<{
208
+ name: "id";
209
+ tableName: "activities";
210
+ dataType: "string";
211
+ columnType: "PgUUID";
212
+ data: string;
213
+ driverParam: string;
214
+ notNull: true;
215
+ hasDefault: true;
216
+ isPrimaryKey: true;
217
+ isAutoincrement: false;
218
+ hasRuntimeDefault: false;
219
+ enumValues: undefined;
220
+ baseColumn: never;
221
+ identity: undefined;
222
+ generated: undefined;
223
+ }, {}, {}>;
224
+ type: import("drizzle-orm/pg-core").PgColumn<{
225
+ name: "type";
226
+ tableName: "activities";
227
+ dataType: "string";
228
+ columnType: "PgVarchar";
229
+ data: string;
230
+ driverParam: string;
231
+ notNull: true;
232
+ hasDefault: false;
233
+ isPrimaryKey: false;
234
+ isAutoincrement: false;
235
+ hasRuntimeDefault: false;
236
+ enumValues: [string, ...string[]];
237
+ baseColumn: never;
238
+ identity: undefined;
239
+ generated: undefined;
240
+ }, {}, {
241
+ length: 64;
242
+ }>;
243
+ actorUri: import("drizzle-orm/pg-core").PgColumn<{
244
+ name: "actor_uri";
245
+ tableName: "activities";
246
+ dataType: "string";
247
+ columnType: "PgText";
248
+ data: string;
249
+ driverParam: string;
250
+ notNull: true;
251
+ hasDefault: false;
252
+ isPrimaryKey: false;
253
+ isAutoincrement: false;
254
+ hasRuntimeDefault: false;
255
+ enumValues: [string, ...string[]];
256
+ baseColumn: never;
257
+ identity: undefined;
258
+ generated: undefined;
259
+ }, {}, {}>;
260
+ objectUri: import("drizzle-orm/pg-core").PgColumn<{
261
+ name: "object_uri";
262
+ tableName: "activities";
263
+ dataType: "string";
264
+ columnType: "PgText";
265
+ data: string;
266
+ driverParam: string;
267
+ notNull: false;
268
+ hasDefault: false;
269
+ isPrimaryKey: false;
270
+ isAutoincrement: false;
271
+ hasRuntimeDefault: false;
272
+ enumValues: [string, ...string[]];
273
+ baseColumn: never;
274
+ identity: undefined;
275
+ generated: undefined;
276
+ }, {}, {}>;
277
+ payload: import("drizzle-orm/pg-core").PgColumn<{
278
+ name: "payload";
279
+ tableName: "activities";
280
+ dataType: "json";
281
+ columnType: "PgJsonb";
282
+ data: unknown;
283
+ driverParam: unknown;
284
+ notNull: true;
285
+ hasDefault: false;
286
+ isPrimaryKey: false;
287
+ isAutoincrement: false;
288
+ hasRuntimeDefault: false;
289
+ enumValues: undefined;
290
+ baseColumn: never;
291
+ identity: undefined;
292
+ generated: undefined;
293
+ }, {}, {}>;
294
+ direction: import("drizzle-orm/pg-core").PgColumn<{
295
+ name: "direction";
296
+ tableName: "activities";
297
+ dataType: "string";
298
+ columnType: "PgEnumColumn";
299
+ data: "inbound" | "outbound";
300
+ driverParam: string;
301
+ notNull: true;
302
+ hasDefault: false;
303
+ isPrimaryKey: false;
304
+ isAutoincrement: false;
305
+ hasRuntimeDefault: false;
306
+ enumValues: ["inbound", "outbound"];
307
+ baseColumn: never;
308
+ identity: undefined;
309
+ generated: undefined;
310
+ }, {}, {}>;
311
+ status: import("drizzle-orm/pg-core").PgColumn<{
312
+ name: "status";
313
+ tableName: "activities";
314
+ dataType: "string";
315
+ columnType: "PgEnumColumn";
316
+ data: "pending" | "delivered" | "failed" | "processed";
317
+ driverParam: string;
318
+ notNull: true;
319
+ hasDefault: true;
320
+ isPrimaryKey: false;
321
+ isAutoincrement: false;
322
+ hasRuntimeDefault: false;
323
+ enumValues: ["pending", "delivered", "failed", "processed"];
324
+ baseColumn: never;
325
+ identity: undefined;
326
+ generated: undefined;
327
+ }, {}, {}>;
328
+ attempts: import("drizzle-orm/pg-core").PgColumn<{
329
+ name: "attempts";
330
+ tableName: "activities";
331
+ dataType: "number";
332
+ columnType: "PgInteger";
333
+ data: number;
334
+ driverParam: string | number;
335
+ notNull: true;
336
+ hasDefault: true;
337
+ isPrimaryKey: false;
338
+ isAutoincrement: false;
339
+ hasRuntimeDefault: false;
340
+ enumValues: undefined;
341
+ baseColumn: never;
342
+ identity: undefined;
343
+ generated: undefined;
344
+ }, {}, {}>;
345
+ error: import("drizzle-orm/pg-core").PgColumn<{
346
+ name: "error";
347
+ tableName: "activities";
348
+ dataType: "string";
349
+ columnType: "PgText";
350
+ data: string;
351
+ driverParam: string;
352
+ notNull: false;
353
+ hasDefault: false;
354
+ isPrimaryKey: false;
355
+ isAutoincrement: false;
356
+ hasRuntimeDefault: false;
357
+ enumValues: [string, ...string[]];
358
+ baseColumn: never;
359
+ identity: undefined;
360
+ generated: undefined;
361
+ }, {}, {}>;
362
+ createdAt: import("drizzle-orm/pg-core").PgColumn<{
363
+ name: "created_at";
364
+ tableName: "activities";
365
+ dataType: "date";
366
+ columnType: "PgTimestamp";
367
+ data: Date;
368
+ driverParam: string;
369
+ notNull: true;
370
+ hasDefault: true;
371
+ isPrimaryKey: false;
372
+ isAutoincrement: false;
373
+ hasRuntimeDefault: false;
374
+ enumValues: undefined;
375
+ baseColumn: never;
376
+ identity: undefined;
377
+ generated: undefined;
378
+ }, {}, {}>;
379
+ updatedAt: import("drizzle-orm/pg-core").PgColumn<{
380
+ name: "updated_at";
381
+ tableName: "activities";
382
+ dataType: "date";
383
+ columnType: "PgTimestamp";
384
+ data: Date;
385
+ driverParam: string;
386
+ notNull: true;
387
+ hasDefault: true;
388
+ isPrimaryKey: false;
389
+ isAutoincrement: false;
390
+ hasRuntimeDefault: false;
391
+ enumValues: undefined;
392
+ baseColumn: never;
393
+ identity: undefined;
394
+ generated: undefined;
395
+ }, {}, {}>;
396
+ };
397
+ dialect: "pg";
398
+ }>;
399
+ /** Federation-aware follow relationships (separate from local follows) */
400
+ export declare const followRelationships: import("drizzle-orm/pg-core").PgTableWithColumns<{
401
+ name: "follow_relationships";
402
+ schema: undefined;
403
+ columns: {
404
+ id: import("drizzle-orm/pg-core").PgColumn<{
405
+ name: "id";
406
+ tableName: "follow_relationships";
407
+ dataType: "string";
408
+ columnType: "PgUUID";
409
+ data: string;
410
+ driverParam: string;
411
+ notNull: true;
412
+ hasDefault: true;
413
+ isPrimaryKey: true;
414
+ isAutoincrement: false;
415
+ hasRuntimeDefault: false;
416
+ enumValues: undefined;
417
+ baseColumn: never;
418
+ identity: undefined;
419
+ generated: undefined;
420
+ }, {}, {}>;
421
+ followerActorUri: import("drizzle-orm/pg-core").PgColumn<{
422
+ name: "follower_actor_uri";
423
+ tableName: "follow_relationships";
424
+ dataType: "string";
425
+ columnType: "PgText";
426
+ data: string;
427
+ driverParam: string;
428
+ notNull: true;
429
+ hasDefault: false;
430
+ isPrimaryKey: false;
431
+ isAutoincrement: false;
432
+ hasRuntimeDefault: false;
433
+ enumValues: [string, ...string[]];
434
+ baseColumn: never;
435
+ identity: undefined;
436
+ generated: undefined;
437
+ }, {}, {}>;
438
+ followingActorUri: import("drizzle-orm/pg-core").PgColumn<{
439
+ name: "following_actor_uri";
440
+ tableName: "follow_relationships";
441
+ dataType: "string";
442
+ columnType: "PgText";
443
+ data: string;
444
+ driverParam: string;
445
+ notNull: true;
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
+ status: import("drizzle-orm/pg-core").PgColumn<{
456
+ name: "status";
457
+ tableName: "follow_relationships";
458
+ dataType: "string";
459
+ columnType: "PgEnumColumn";
460
+ data: "pending" | "accepted" | "rejected";
461
+ driverParam: string;
462
+ notNull: true;
463
+ hasDefault: true;
464
+ isPrimaryKey: false;
465
+ isAutoincrement: false;
466
+ hasRuntimeDefault: false;
467
+ enumValues: ["pending", "accepted", "rejected"];
468
+ baseColumn: never;
469
+ identity: undefined;
470
+ generated: undefined;
471
+ }, {}, {}>;
472
+ createdAt: import("drizzle-orm/pg-core").PgColumn<{
473
+ name: "created_at";
474
+ tableName: "follow_relationships";
475
+ dataType: "date";
476
+ columnType: "PgTimestamp";
477
+ data: Date;
478
+ driverParam: string;
479
+ notNull: true;
480
+ hasDefault: true;
481
+ isPrimaryKey: false;
482
+ isAutoincrement: false;
483
+ hasRuntimeDefault: false;
484
+ enumValues: undefined;
485
+ baseColumn: never;
486
+ identity: undefined;
487
+ generated: undefined;
488
+ }, {}, {}>;
489
+ updatedAt: import("drizzle-orm/pg-core").PgColumn<{
490
+ name: "updated_at";
491
+ tableName: "follow_relationships";
492
+ dataType: "date";
493
+ columnType: "PgTimestamp";
494
+ data: Date;
495
+ driverParam: string;
496
+ notNull: true;
497
+ hasDefault: true;
498
+ isPrimaryKey: false;
499
+ isAutoincrement: false;
500
+ hasRuntimeDefault: false;
501
+ enumValues: undefined;
502
+ baseColumn: never;
503
+ identity: undefined;
504
+ generated: undefined;
505
+ }, {}, {}>;
506
+ };
507
+ dialect: "pg";
508
+ }>;
509
+ /** RSA signing keys per user for ActivityPub HTTP Signatures */
510
+ export declare const actorKeypairs: import("drizzle-orm/pg-core").PgTableWithColumns<{
511
+ name: "actor_keypairs";
512
+ schema: undefined;
513
+ columns: {
514
+ id: import("drizzle-orm/pg-core").PgColumn<{
515
+ name: "id";
516
+ tableName: "actor_keypairs";
517
+ dataType: "string";
518
+ columnType: "PgUUID";
519
+ data: string;
520
+ driverParam: string;
521
+ notNull: true;
522
+ hasDefault: true;
523
+ isPrimaryKey: true;
524
+ isAutoincrement: false;
525
+ hasRuntimeDefault: false;
526
+ enumValues: undefined;
527
+ baseColumn: never;
528
+ identity: undefined;
529
+ generated: undefined;
530
+ }, {}, {}>;
531
+ userId: import("drizzle-orm/pg-core").PgColumn<{
532
+ name: "user_id";
533
+ tableName: "actor_keypairs";
534
+ dataType: "string";
535
+ columnType: "PgUUID";
536
+ data: string;
537
+ driverParam: string;
538
+ notNull: true;
539
+ hasDefault: false;
540
+ isPrimaryKey: false;
541
+ isAutoincrement: false;
542
+ hasRuntimeDefault: false;
543
+ enumValues: undefined;
544
+ baseColumn: never;
545
+ identity: undefined;
546
+ generated: undefined;
547
+ }, {}, {}>;
548
+ publicKeyPem: import("drizzle-orm/pg-core").PgColumn<{
549
+ name: "public_key_pem";
550
+ tableName: "actor_keypairs";
551
+ dataType: "string";
552
+ columnType: "PgText";
553
+ data: string;
554
+ driverParam: string;
555
+ notNull: true;
556
+ hasDefault: false;
557
+ isPrimaryKey: false;
558
+ isAutoincrement: false;
559
+ hasRuntimeDefault: false;
560
+ enumValues: [string, ...string[]];
561
+ baseColumn: never;
562
+ identity: undefined;
563
+ generated: undefined;
564
+ }, {}, {}>;
565
+ privateKeyPem: import("drizzle-orm/pg-core").PgColumn<{
566
+ name: "private_key_pem";
567
+ tableName: "actor_keypairs";
568
+ dataType: "string";
569
+ columnType: "PgText";
570
+ data: string;
571
+ driverParam: string;
572
+ notNull: true;
573
+ hasDefault: false;
574
+ isPrimaryKey: false;
575
+ isAutoincrement: false;
576
+ hasRuntimeDefault: false;
577
+ enumValues: [string, ...string[]];
578
+ baseColumn: never;
579
+ identity: undefined;
580
+ generated: undefined;
581
+ }, {}, {}>;
582
+ createdAt: import("drizzle-orm/pg-core").PgColumn<{
583
+ name: "created_at";
584
+ tableName: "actor_keypairs";
585
+ dataType: "date";
586
+ columnType: "PgTimestamp";
587
+ data: Date;
588
+ driverParam: string;
589
+ notNull: true;
590
+ hasDefault: true;
591
+ isPrimaryKey: false;
592
+ isAutoincrement: false;
593
+ hasRuntimeDefault: false;
594
+ enumValues: undefined;
595
+ baseColumn: never;
596
+ identity: undefined;
597
+ generated: undefined;
598
+ }, {}, {}>;
599
+ };
600
+ dialect: "pg";
601
+ }>;
602
+ export declare const actorKeypairsRelations: import("drizzle-orm").Relations<"actor_keypairs", {
603
+ user: import("drizzle-orm").One<"users", true>;
604
+ }>;
605
+ export type RemoteActorRow = typeof remoteActors.$inferSelect;
606
+ export type NewRemoteActorRow = typeof remoteActors.$inferInsert;
607
+ export type ActivityRow = typeof activities.$inferSelect;
608
+ export type NewActivityRow = typeof activities.$inferInsert;
609
+ export type FollowRelationshipRow = typeof followRelationships.$inferSelect;
610
+ export type NewFollowRelationshipRow = typeof followRelationships.$inferInsert;
611
+ export type ActorKeypairRow = typeof actorKeypairs.$inferSelect;
612
+ export type NewActorKeypairRow = typeof actorKeypairs.$inferInsert;
613
+ //# sourceMappingURL=federation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"federation.d.ts","sourceRoot":"","sources":["../src/federation.ts"],"names":[],"mappings":"AAKA,kDAAkD;AAClD,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAYvB,CAAC;AAEH,4CAA4C;AAC5C,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgBrB,CAAC;AAEH,0EAA0E;AAC1E,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAS9B,CAAC;AAEH,gEAAgE;AAChE,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EASxB,CAAC;AAIH,eAAO,MAAM,sBAAsB;;EAEhC,CAAC;AAGJ,MAAM,MAAM,cAAc,GAAG,OAAO,YAAY,CAAC,YAAY,CAAC;AAC9D,MAAM,MAAM,iBAAiB,GAAG,OAAO,YAAY,CAAC,YAAY,CAAC;AACjE,MAAM,MAAM,WAAW,GAAG,OAAO,UAAU,CAAC,YAAY,CAAC;AACzD,MAAM,MAAM,cAAc,GAAG,OAAO,UAAU,CAAC,YAAY,CAAC;AAC5D,MAAM,MAAM,qBAAqB,GAAG,OAAO,mBAAmB,CAAC,YAAY,CAAC;AAC5E,MAAM,MAAM,wBAAwB,GAAG,OAAO,mBAAmB,CAAC,YAAY,CAAC;AAC/E,MAAM,MAAM,eAAe,GAAG,OAAO,aAAa,CAAC,YAAY,CAAC;AAChE,MAAM,MAAM,kBAAkB,GAAG,OAAO,aAAa,CAAC,YAAY,CAAC"}
@@ -0,0 +1,63 @@
1
+ import { pgTable, uuid, varchar, text, timestamp, integer, jsonb, index, unique } from 'drizzle-orm/pg-core';
2
+ import { relations } from 'drizzle-orm';
3
+ import { users } from './auth.js';
4
+ import { activityDirectionEnum, activityStatusEnum, followRelationshipStatusEnum } from './enums.js';
5
+ /** Cache of resolved remote ActivityPub actors */
6
+ export const remoteActors = pgTable('remote_actors', {
7
+ id: uuid('id').defaultRandom().primaryKey(),
8
+ actorUri: text('actor_uri').notNull().unique(),
9
+ inbox: text('inbox').notNull(),
10
+ outbox: text('outbox'),
11
+ publicKeyPem: text('public_key_pem'),
12
+ preferredUsername: varchar('preferred_username', { length: 64 }),
13
+ displayName: varchar('display_name', { length: 128 }),
14
+ avatarUrl: text('avatar_url'),
15
+ instanceDomain: varchar('instance_domain', { length: 255 }).notNull(),
16
+ lastFetchedAt: timestamp('last_fetched_at', { withTimezone: true }).defaultNow().notNull(),
17
+ createdAt: timestamp('created_at', { withTimezone: true }).defaultNow().notNull(),
18
+ });
19
+ /** Log of inbound/outbound AP activities */
20
+ export const activities = pgTable('activities', {
21
+ id: uuid('id').defaultRandom().primaryKey(),
22
+ type: varchar('type', { length: 64 }).notNull(),
23
+ actorUri: text('actor_uri').notNull(),
24
+ objectUri: text('object_uri'),
25
+ payload: jsonb('payload').notNull(),
26
+ direction: activityDirectionEnum('direction').notNull(),
27
+ status: activityStatusEnum('status').default('pending').notNull(),
28
+ attempts: integer('attempts').default(0).notNull(),
29
+ error: text('error'),
30
+ createdAt: timestamp('created_at', { withTimezone: true }).defaultNow().notNull(),
31
+ updatedAt: timestamp('updated_at', { withTimezone: true }).defaultNow().notNull(),
32
+ }, (t) => [
33
+ index('idx_activities_direction_status').on(t.direction, t.status),
34
+ index('idx_activities_actor_uri').on(t.actorUri),
35
+ index('idx_activities_created_at').on(t.createdAt),
36
+ ]);
37
+ /** Federation-aware follow relationships (separate from local follows) */
38
+ export const followRelationships = pgTable('follow_relationships', {
39
+ id: uuid('id').defaultRandom().primaryKey(),
40
+ followerActorUri: text('follower_actor_uri').notNull(),
41
+ followingActorUri: text('following_actor_uri').notNull(),
42
+ status: followRelationshipStatusEnum('status').default('pending').notNull(),
43
+ createdAt: timestamp('created_at', { withTimezone: true }).defaultNow().notNull(),
44
+ updatedAt: timestamp('updated_at', { withTimezone: true }).defaultNow().notNull().$onUpdateFn(() => new Date()),
45
+ }, (t) => [
46
+ unique('follow_relationships_pair').on(t.followerActorUri, t.followingActorUri),
47
+ ]);
48
+ /** RSA signing keys per user for ActivityPub HTTP Signatures */
49
+ export const actorKeypairs = pgTable('actor_keypairs', {
50
+ id: uuid('id').defaultRandom().primaryKey(),
51
+ userId: uuid('user_id')
52
+ .notNull()
53
+ .references(() => users.id, { onDelete: 'cascade' })
54
+ .unique(),
55
+ publicKeyPem: text('public_key_pem').notNull(),
56
+ privateKeyPem: text('private_key_pem').notNull(),
57
+ createdAt: timestamp('created_at', { withTimezone: true }).defaultNow().notNull(),
58
+ });
59
+ // --- Relations ---
60
+ export const actorKeypairsRelations = relations(actorKeypairs, ({ one }) => ({
61
+ user: one(users, { fields: [actorKeypairs.userId], references: [users.id] }),
62
+ }));
63
+ //# sourceMappingURL=federation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"federation.js","sourceRoot":"","sources":["../src/federation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7G,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,4BAA4B,EAAE,MAAM,YAAY,CAAC;AAErG,kDAAkD;AAClD,MAAM,CAAC,MAAM,YAAY,GAAG,OAAO,CAAC,eAAe,EAAE;IACnD,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,aAAa,EAAE,CAAC,UAAU,EAAE;IAC3C,QAAQ,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC,OAAO,EAAE,CAAC,MAAM,EAAE;IAC9C,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE;IAC9B,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC;IACtB,YAAY,EAAE,IAAI,CAAC,gBAAgB,CAAC;IACpC,iBAAiB,EAAE,OAAO,CAAC,oBAAoB,EAAE,EAAE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