@open-commune/core 0.1.2

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.
@@ -0,0 +1,4323 @@
1
+ import * as _trpc_server from '@trpc/server';
2
+ import { z } from 'zod';
3
+ import * as drizzle_orm_bun_sqlite from 'drizzle-orm/bun-sqlite';
4
+ import { Database } from 'bun:sqlite';
5
+ import * as drizzle_orm_sqlite_core from 'drizzle-orm/sqlite-core';
6
+ import { FIELD_TYPES, FieldType, PUBLICATION_STATUSES } from './domains/collections/constants.js';
7
+ export { PublicationStatus } from './domains/collections/constants.js';
8
+ import { FieldDefinition, fieldDefinitionSchema } from './domains/collections/utils.js';
9
+ export { FIELD_VALUE_SCHEMAS, buildDataSchema } from './domains/collections/utils.js';
10
+
11
+ declare const envSchema: z.ZodObject<{
12
+ COMMUN_DATA_DIR: z.ZodDefault<z.ZodString>;
13
+ COMMUN_MIGRATIONS_DIR: z.ZodOptional<z.ZodString>;
14
+ COMMUN_S3_ENDPOINT: z.ZodOptional<z.ZodString>;
15
+ COMMUN_S3_REGION: z.ZodDefault<z.ZodString>;
16
+ COMMUN_S3_BUCKET: z.ZodString;
17
+ COMMUN_S3_ACCESS_KEY: z.ZodString;
18
+ COMMUN_S3_SECRET_KEY: z.ZodString;
19
+ COMMUN_EMAIL_WEBHOOK_URL: z.ZodString;
20
+ COMMUN_EMAIL_WEBHOOK_TOKEN: z.ZodOptional<z.ZodString>;
21
+ COMMUN_ADMIN_URL: z.ZodOptional<z.ZodString>;
22
+ COMMUN_JWT_SECRET: z.ZodString;
23
+ }, z.core.$strip>;
24
+ type CoreEnv = z.infer<typeof envSchema>;
25
+ /**
26
+ * Parse and validate the environment at the app boundary. Call once at startup:
27
+ * the result flows through DI, nothing reads process.env afterwards.
28
+ */
29
+ declare function parseEnv(raw?: Record<string, string | undefined>): CoreEnv;
30
+
31
+ /** Postal address, as a typed JSON field. */
32
+ declare const addressSchema: z.ZodObject<{
33
+ street: z.ZodOptional<z.ZodString>;
34
+ postalCode: z.ZodOptional<z.ZodString>;
35
+ city: z.ZodOptional<z.ZodString>;
36
+ }, z.core.$strip>;
37
+ type Address = z.infer<typeof addressSchema>;
38
+ /**
39
+ * Instance settings — a singleton row (id = 1, enforced by the queries).
40
+ * Single-tenant by design: one instance = one local authority; no table
41
+ * anywhere carries a tenant key.
42
+ */
43
+ declare const organization: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
44
+ name: "organization";
45
+ schema: undefined;
46
+ columns: {
47
+ id: drizzle_orm_sqlite_core.SQLiteColumn<{
48
+ name: "id";
49
+ tableName: "organization";
50
+ dataType: "number";
51
+ columnType: "SQLiteInteger";
52
+ data: number;
53
+ driverParam: number;
54
+ notNull: true;
55
+ hasDefault: true;
56
+ isPrimaryKey: true;
57
+ isAutoincrement: false;
58
+ hasRuntimeDefault: false;
59
+ enumValues: undefined;
60
+ baseColumn: never;
61
+ identity: undefined;
62
+ generated: undefined;
63
+ }, {}, {}>;
64
+ name: drizzle_orm_sqlite_core.SQLiteColumn<{
65
+ name: "name";
66
+ tableName: "organization";
67
+ dataType: "string";
68
+ columnType: "SQLiteText";
69
+ data: string;
70
+ driverParam: string;
71
+ notNull: true;
72
+ hasDefault: false;
73
+ isPrimaryKey: false;
74
+ isAutoincrement: false;
75
+ hasRuntimeDefault: false;
76
+ enumValues: [string, ...string[]];
77
+ baseColumn: never;
78
+ identity: undefined;
79
+ generated: undefined;
80
+ }, {}, {
81
+ length: number | undefined;
82
+ }>;
83
+ type: drizzle_orm_sqlite_core.SQLiteColumn<{
84
+ name: "type";
85
+ tableName: "organization";
86
+ dataType: "string";
87
+ columnType: "SQLiteText";
88
+ data: "commune" | "intercommunality" | "syndicate" | "other";
89
+ driverParam: string;
90
+ notNull: true;
91
+ hasDefault: true;
92
+ isPrimaryKey: false;
93
+ isAutoincrement: false;
94
+ hasRuntimeDefault: false;
95
+ enumValues: ["commune", "intercommunality", "syndicate", "other"];
96
+ baseColumn: never;
97
+ identity: undefined;
98
+ generated: undefined;
99
+ }, {}, {
100
+ length: number | undefined;
101
+ }>;
102
+ slug: drizzle_orm_sqlite_core.SQLiteColumn<{
103
+ name: "slug";
104
+ tableName: "organization";
105
+ dataType: "string";
106
+ columnType: "SQLiteText";
107
+ data: string;
108
+ driverParam: string;
109
+ notNull: true;
110
+ hasDefault: false;
111
+ isPrimaryKey: false;
112
+ isAutoincrement: false;
113
+ hasRuntimeDefault: false;
114
+ enumValues: [string, ...string[]];
115
+ baseColumn: never;
116
+ identity: undefined;
117
+ generated: undefined;
118
+ }, {}, {
119
+ length: number | undefined;
120
+ }>;
121
+ description: drizzle_orm_sqlite_core.SQLiteColumn<{
122
+ name: "description";
123
+ tableName: "organization";
124
+ dataType: "string";
125
+ columnType: "SQLiteText";
126
+ data: string;
127
+ driverParam: string;
128
+ notNull: false;
129
+ hasDefault: false;
130
+ isPrimaryKey: false;
131
+ isAutoincrement: false;
132
+ hasRuntimeDefault: false;
133
+ enumValues: [string, ...string[]];
134
+ baseColumn: never;
135
+ identity: undefined;
136
+ generated: undefined;
137
+ }, {}, {
138
+ length: number | undefined;
139
+ }>;
140
+ address: drizzle_orm_sqlite_core.SQLiteColumn<{
141
+ name: "address";
142
+ tableName: "organization";
143
+ dataType: "json";
144
+ columnType: "SQLiteTextJson";
145
+ data: {
146
+ street?: string | undefined;
147
+ postalCode?: string | undefined;
148
+ city?: string | undefined;
149
+ };
150
+ driverParam: string;
151
+ notNull: false;
152
+ hasDefault: false;
153
+ isPrimaryKey: false;
154
+ isAutoincrement: false;
155
+ hasRuntimeDefault: false;
156
+ enumValues: undefined;
157
+ baseColumn: never;
158
+ identity: undefined;
159
+ generated: undefined;
160
+ }, {}, {
161
+ $type: {
162
+ street?: string | undefined;
163
+ postalCode?: string | undefined;
164
+ city?: string | undefined;
165
+ };
166
+ }>;
167
+ deployment: drizzle_orm_sqlite_core.SQLiteColumn<{
168
+ name: "deployment";
169
+ tableName: "organization";
170
+ dataType: "json";
171
+ columnType: "SQLiteTextJson";
172
+ data: Record<string, unknown>;
173
+ driverParam: string;
174
+ notNull: false;
175
+ hasDefault: false;
176
+ isPrimaryKey: false;
177
+ isAutoincrement: false;
178
+ hasRuntimeDefault: false;
179
+ enumValues: undefined;
180
+ baseColumn: never;
181
+ identity: undefined;
182
+ generated: undefined;
183
+ }, {}, {
184
+ $type: Record<string, unknown>;
185
+ }>;
186
+ settings: drizzle_orm_sqlite_core.SQLiteColumn<{
187
+ name: "settings";
188
+ tableName: "organization";
189
+ dataType: "json";
190
+ columnType: "SQLiteTextJson";
191
+ data: Record<string, unknown>;
192
+ driverParam: string;
193
+ notNull: false;
194
+ hasDefault: false;
195
+ isPrimaryKey: false;
196
+ isAutoincrement: false;
197
+ hasRuntimeDefault: false;
198
+ enumValues: undefined;
199
+ baseColumn: never;
200
+ identity: undefined;
201
+ generated: undefined;
202
+ }, {}, {
203
+ $type: Record<string, unknown>;
204
+ }>;
205
+ updatedBy: drizzle_orm_sqlite_core.SQLiteColumn<{
206
+ name: "updated_by";
207
+ tableName: "organization";
208
+ dataType: "string";
209
+ columnType: "SQLiteText";
210
+ data: string;
211
+ driverParam: string;
212
+ notNull: false;
213
+ hasDefault: false;
214
+ isPrimaryKey: false;
215
+ isAutoincrement: false;
216
+ hasRuntimeDefault: false;
217
+ enumValues: [string, ...string[]];
218
+ baseColumn: never;
219
+ identity: undefined;
220
+ generated: undefined;
221
+ }, {}, {
222
+ length: number | undefined;
223
+ }>;
224
+ legacyExtra: drizzle_orm_sqlite_core.SQLiteColumn<{
225
+ name: "legacy_extra";
226
+ tableName: "organization";
227
+ dataType: "json";
228
+ columnType: "SQLiteTextJson";
229
+ data: Record<string, unknown> | null;
230
+ driverParam: string;
231
+ notNull: false;
232
+ hasDefault: false;
233
+ isPrimaryKey: false;
234
+ isAutoincrement: false;
235
+ hasRuntimeDefault: false;
236
+ enumValues: undefined;
237
+ baseColumn: never;
238
+ identity: undefined;
239
+ generated: undefined;
240
+ }, {}, {
241
+ $type: Record<string, unknown> | null;
242
+ }>;
243
+ createdAt: drizzle_orm_sqlite_core.SQLiteColumn<{
244
+ name: "created_at";
245
+ tableName: "organization";
246
+ dataType: "string";
247
+ columnType: "SQLiteText";
248
+ data: string;
249
+ driverParam: string;
250
+ notNull: true;
251
+ hasDefault: true;
252
+ isPrimaryKey: false;
253
+ isAutoincrement: false;
254
+ hasRuntimeDefault: true;
255
+ enumValues: [string, ...string[]];
256
+ baseColumn: never;
257
+ identity: undefined;
258
+ generated: undefined;
259
+ }, {}, {
260
+ length: number | undefined;
261
+ }>;
262
+ updatedAt: drizzle_orm_sqlite_core.SQLiteColumn<{
263
+ name: "updated_at";
264
+ tableName: "organization";
265
+ dataType: "string";
266
+ columnType: "SQLiteText";
267
+ data: string;
268
+ driverParam: string;
269
+ notNull: true;
270
+ hasDefault: true;
271
+ isPrimaryKey: false;
272
+ isAutoincrement: false;
273
+ hasRuntimeDefault: true;
274
+ enumValues: [string, ...string[]];
275
+ baseColumn: never;
276
+ identity: undefined;
277
+ generated: undefined;
278
+ }, {}, {
279
+ length: number | undefined;
280
+ }>;
281
+ };
282
+ dialect: "sqlite";
283
+ }>;
284
+ type Organization = typeof organization.$inferSelect;
285
+ type NewOrganization = typeof organization.$inferInsert;
286
+ declare const users: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
287
+ name: "users";
288
+ schema: undefined;
289
+ columns: {
290
+ id: drizzle_orm_sqlite_core.SQLiteColumn<{
291
+ name: "id";
292
+ tableName: "users";
293
+ dataType: "string";
294
+ columnType: "SQLiteText";
295
+ data: string;
296
+ driverParam: string;
297
+ notNull: true;
298
+ hasDefault: true;
299
+ isPrimaryKey: true;
300
+ isAutoincrement: false;
301
+ hasRuntimeDefault: true;
302
+ enumValues: [string, ...string[]];
303
+ baseColumn: never;
304
+ identity: undefined;
305
+ generated: undefined;
306
+ }, {}, {
307
+ length: number | undefined;
308
+ }>;
309
+ email: drizzle_orm_sqlite_core.SQLiteColumn<{
310
+ name: "email";
311
+ tableName: "users";
312
+ dataType: "string";
313
+ columnType: "SQLiteText";
314
+ data: string;
315
+ driverParam: string;
316
+ notNull: true;
317
+ hasDefault: false;
318
+ isPrimaryKey: false;
319
+ isAutoincrement: false;
320
+ hasRuntimeDefault: false;
321
+ enumValues: [string, ...string[]];
322
+ baseColumn: never;
323
+ identity: undefined;
324
+ generated: undefined;
325
+ }, {}, {
326
+ length: number | undefined;
327
+ }>;
328
+ name: drizzle_orm_sqlite_core.SQLiteColumn<{
329
+ name: "name";
330
+ tableName: "users";
331
+ dataType: "string";
332
+ columnType: "SQLiteText";
333
+ data: string;
334
+ driverParam: string;
335
+ notNull: true;
336
+ hasDefault: false;
337
+ isPrimaryKey: false;
338
+ isAutoincrement: false;
339
+ hasRuntimeDefault: false;
340
+ enumValues: [string, ...string[]];
341
+ baseColumn: never;
342
+ identity: undefined;
343
+ generated: undefined;
344
+ }, {}, {
345
+ length: number | undefined;
346
+ }>;
347
+ passwordHash: drizzle_orm_sqlite_core.SQLiteColumn<{
348
+ name: "password_hash";
349
+ tableName: "users";
350
+ dataType: "string";
351
+ columnType: "SQLiteText";
352
+ data: string;
353
+ driverParam: string;
354
+ notNull: false;
355
+ hasDefault: false;
356
+ isPrimaryKey: false;
357
+ isAutoincrement: false;
358
+ hasRuntimeDefault: false;
359
+ enumValues: [string, ...string[]];
360
+ baseColumn: never;
361
+ identity: undefined;
362
+ generated: undefined;
363
+ }, {}, {
364
+ length: number | undefined;
365
+ }>;
366
+ role: drizzle_orm_sqlite_core.SQLiteColumn<{
367
+ name: "role";
368
+ tableName: "users";
369
+ dataType: "string";
370
+ columnType: "SQLiteText";
371
+ data: "admin" | "redacteur";
372
+ driverParam: string;
373
+ notNull: true;
374
+ hasDefault: true;
375
+ isPrimaryKey: false;
376
+ isAutoincrement: false;
377
+ hasRuntimeDefault: false;
378
+ enumValues: ["admin", "redacteur"];
379
+ baseColumn: never;
380
+ identity: undefined;
381
+ generated: undefined;
382
+ }, {}, {
383
+ length: number | undefined;
384
+ }>;
385
+ createdAt: drizzle_orm_sqlite_core.SQLiteColumn<{
386
+ name: "created_at";
387
+ tableName: "users";
388
+ dataType: "string";
389
+ columnType: "SQLiteText";
390
+ data: string;
391
+ driverParam: string;
392
+ notNull: true;
393
+ hasDefault: true;
394
+ isPrimaryKey: false;
395
+ isAutoincrement: false;
396
+ hasRuntimeDefault: true;
397
+ enumValues: [string, ...string[]];
398
+ baseColumn: never;
399
+ identity: undefined;
400
+ generated: undefined;
401
+ }, {}, {
402
+ length: number | undefined;
403
+ }>;
404
+ updatedAt: drizzle_orm_sqlite_core.SQLiteColumn<{
405
+ name: "updated_at";
406
+ tableName: "users";
407
+ dataType: "string";
408
+ columnType: "SQLiteText";
409
+ data: string;
410
+ driverParam: string;
411
+ notNull: true;
412
+ hasDefault: true;
413
+ isPrimaryKey: false;
414
+ isAutoincrement: false;
415
+ hasRuntimeDefault: true;
416
+ enumValues: [string, ...string[]];
417
+ baseColumn: never;
418
+ identity: undefined;
419
+ generated: undefined;
420
+ }, {}, {
421
+ length: number | undefined;
422
+ }>;
423
+ };
424
+ dialect: "sqlite";
425
+ }>;
426
+ /**
427
+ * Server-side sessions. The client carries a signed JWT holding `{ session }`,
428
+ * but revocation lives HERE: a valid JWT whose row is revoked is refused.
429
+ */
430
+ declare const sessions: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
431
+ name: "sessions";
432
+ schema: undefined;
433
+ columns: {
434
+ id: drizzle_orm_sqlite_core.SQLiteColumn<{
435
+ name: "id";
436
+ tableName: "sessions";
437
+ dataType: "string";
438
+ columnType: "SQLiteText";
439
+ data: string;
440
+ driverParam: string;
441
+ notNull: true;
442
+ hasDefault: true;
443
+ isPrimaryKey: true;
444
+ isAutoincrement: false;
445
+ hasRuntimeDefault: true;
446
+ enumValues: [string, ...string[]];
447
+ baseColumn: never;
448
+ identity: undefined;
449
+ generated: undefined;
450
+ }, {}, {
451
+ length: number | undefined;
452
+ }>;
453
+ userId: drizzle_orm_sqlite_core.SQLiteColumn<{
454
+ name: "user_id";
455
+ tableName: "sessions";
456
+ dataType: "string";
457
+ columnType: "SQLiteText";
458
+ data: string;
459
+ driverParam: string;
460
+ notNull: true;
461
+ hasDefault: false;
462
+ isPrimaryKey: false;
463
+ isAutoincrement: false;
464
+ hasRuntimeDefault: false;
465
+ enumValues: [string, ...string[]];
466
+ baseColumn: never;
467
+ identity: undefined;
468
+ generated: undefined;
469
+ }, {}, {
470
+ length: number | undefined;
471
+ }>;
472
+ expiresAt: drizzle_orm_sqlite_core.SQLiteColumn<{
473
+ name: "expires_at";
474
+ tableName: "sessions";
475
+ dataType: "string";
476
+ columnType: "SQLiteText";
477
+ data: string;
478
+ driverParam: string;
479
+ notNull: true;
480
+ hasDefault: false;
481
+ isPrimaryKey: false;
482
+ isAutoincrement: false;
483
+ hasRuntimeDefault: false;
484
+ enumValues: [string, ...string[]];
485
+ baseColumn: never;
486
+ identity: undefined;
487
+ generated: undefined;
488
+ }, {}, {
489
+ length: number | undefined;
490
+ }>;
491
+ revokedAt: drizzle_orm_sqlite_core.SQLiteColumn<{
492
+ name: "revoked_at";
493
+ tableName: "sessions";
494
+ dataType: "string";
495
+ columnType: "SQLiteText";
496
+ data: string;
497
+ driverParam: string;
498
+ notNull: false;
499
+ hasDefault: false;
500
+ isPrimaryKey: false;
501
+ isAutoincrement: false;
502
+ hasRuntimeDefault: false;
503
+ enumValues: [string, ...string[]];
504
+ baseColumn: never;
505
+ identity: undefined;
506
+ generated: undefined;
507
+ }, {}, {
508
+ length: number | undefined;
509
+ }>;
510
+ ua: drizzle_orm_sqlite_core.SQLiteColumn<{
511
+ name: "ua";
512
+ tableName: "sessions";
513
+ dataType: "string";
514
+ columnType: "SQLiteText";
515
+ data: string;
516
+ driverParam: string;
517
+ notNull: false;
518
+ hasDefault: false;
519
+ isPrimaryKey: false;
520
+ isAutoincrement: false;
521
+ hasRuntimeDefault: false;
522
+ enumValues: [string, ...string[]];
523
+ baseColumn: never;
524
+ identity: undefined;
525
+ generated: undefined;
526
+ }, {}, {
527
+ length: number | undefined;
528
+ }>;
529
+ ip: drizzle_orm_sqlite_core.SQLiteColumn<{
530
+ name: "ip";
531
+ tableName: "sessions";
532
+ dataType: "string";
533
+ columnType: "SQLiteText";
534
+ data: string;
535
+ driverParam: string;
536
+ notNull: false;
537
+ hasDefault: false;
538
+ isPrimaryKey: false;
539
+ isAutoincrement: false;
540
+ hasRuntimeDefault: false;
541
+ enumValues: [string, ...string[]];
542
+ baseColumn: never;
543
+ identity: undefined;
544
+ generated: undefined;
545
+ }, {}, {
546
+ length: number | undefined;
547
+ }>;
548
+ createdAt: drizzle_orm_sqlite_core.SQLiteColumn<{
549
+ name: "created_at";
550
+ tableName: "sessions";
551
+ dataType: "string";
552
+ columnType: "SQLiteText";
553
+ data: string;
554
+ driverParam: string;
555
+ notNull: true;
556
+ hasDefault: true;
557
+ isPrimaryKey: false;
558
+ isAutoincrement: false;
559
+ hasRuntimeDefault: true;
560
+ enumValues: [string, ...string[]];
561
+ baseColumn: never;
562
+ identity: undefined;
563
+ generated: undefined;
564
+ }, {}, {
565
+ length: number | undefined;
566
+ }>;
567
+ };
568
+ dialect: "sqlite";
569
+ }>;
570
+ /** Single-use, time-limited invitations (crypto-random token, stored hashed). */
571
+ declare const invitations: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
572
+ name: "invitations";
573
+ schema: undefined;
574
+ columns: {
575
+ id: drizzle_orm_sqlite_core.SQLiteColumn<{
576
+ name: "id";
577
+ tableName: "invitations";
578
+ dataType: "string";
579
+ columnType: "SQLiteText";
580
+ data: string;
581
+ driverParam: string;
582
+ notNull: true;
583
+ hasDefault: true;
584
+ isPrimaryKey: true;
585
+ isAutoincrement: false;
586
+ hasRuntimeDefault: true;
587
+ enumValues: [string, ...string[]];
588
+ baseColumn: never;
589
+ identity: undefined;
590
+ generated: undefined;
591
+ }, {}, {
592
+ length: number | undefined;
593
+ }>;
594
+ email: drizzle_orm_sqlite_core.SQLiteColumn<{
595
+ name: "email";
596
+ tableName: "invitations";
597
+ dataType: "string";
598
+ columnType: "SQLiteText";
599
+ data: string;
600
+ driverParam: string;
601
+ notNull: true;
602
+ hasDefault: false;
603
+ isPrimaryKey: false;
604
+ isAutoincrement: false;
605
+ hasRuntimeDefault: false;
606
+ enumValues: [string, ...string[]];
607
+ baseColumn: never;
608
+ identity: undefined;
609
+ generated: undefined;
610
+ }, {}, {
611
+ length: number | undefined;
612
+ }>;
613
+ tokenHash: drizzle_orm_sqlite_core.SQLiteColumn<{
614
+ name: "token_hash";
615
+ tableName: "invitations";
616
+ dataType: "string";
617
+ columnType: "SQLiteText";
618
+ data: string;
619
+ driverParam: string;
620
+ notNull: true;
621
+ hasDefault: false;
622
+ isPrimaryKey: false;
623
+ isAutoincrement: false;
624
+ hasRuntimeDefault: false;
625
+ enumValues: [string, ...string[]];
626
+ baseColumn: never;
627
+ identity: undefined;
628
+ generated: undefined;
629
+ }, {}, {
630
+ length: number | undefined;
631
+ }>;
632
+ role: drizzle_orm_sqlite_core.SQLiteColumn<{
633
+ name: "role";
634
+ tableName: "invitations";
635
+ dataType: "string";
636
+ columnType: "SQLiteText";
637
+ data: "admin" | "redacteur";
638
+ driverParam: string;
639
+ notNull: true;
640
+ hasDefault: true;
641
+ isPrimaryKey: false;
642
+ isAutoincrement: false;
643
+ hasRuntimeDefault: false;
644
+ enumValues: ["admin", "redacteur"];
645
+ baseColumn: never;
646
+ identity: undefined;
647
+ generated: undefined;
648
+ }, {}, {
649
+ length: number | undefined;
650
+ }>;
651
+ expiresAt: drizzle_orm_sqlite_core.SQLiteColumn<{
652
+ name: "expires_at";
653
+ tableName: "invitations";
654
+ dataType: "string";
655
+ columnType: "SQLiteText";
656
+ data: string;
657
+ driverParam: string;
658
+ notNull: true;
659
+ hasDefault: false;
660
+ isPrimaryKey: false;
661
+ isAutoincrement: false;
662
+ hasRuntimeDefault: false;
663
+ enumValues: [string, ...string[]];
664
+ baseColumn: never;
665
+ identity: undefined;
666
+ generated: undefined;
667
+ }, {}, {
668
+ length: number | undefined;
669
+ }>;
670
+ usedAt: drizzle_orm_sqlite_core.SQLiteColumn<{
671
+ name: "used_at";
672
+ tableName: "invitations";
673
+ dataType: "string";
674
+ columnType: "SQLiteText";
675
+ data: string;
676
+ driverParam: string;
677
+ notNull: false;
678
+ hasDefault: false;
679
+ isPrimaryKey: false;
680
+ isAutoincrement: false;
681
+ hasRuntimeDefault: false;
682
+ enumValues: [string, ...string[]];
683
+ baseColumn: never;
684
+ identity: undefined;
685
+ generated: undefined;
686
+ }, {}, {
687
+ length: number | undefined;
688
+ }>;
689
+ createdAt: drizzle_orm_sqlite_core.SQLiteColumn<{
690
+ name: "created_at";
691
+ tableName: "invitations";
692
+ dataType: "string";
693
+ columnType: "SQLiteText";
694
+ data: string;
695
+ driverParam: string;
696
+ notNull: true;
697
+ hasDefault: true;
698
+ isPrimaryKey: false;
699
+ isAutoincrement: false;
700
+ hasRuntimeDefault: true;
701
+ enumValues: [string, ...string[]];
702
+ baseColumn: never;
703
+ identity: undefined;
704
+ generated: undefined;
705
+ }, {}, {
706
+ length: number | undefined;
707
+ }>;
708
+ };
709
+ dialect: "sqlite";
710
+ }>;
711
+ /** Machine tokens for site builds — shown once, stored hashed, revocable. */
712
+ declare const apiTokens: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
713
+ name: "api_tokens";
714
+ schema: undefined;
715
+ columns: {
716
+ id: drizzle_orm_sqlite_core.SQLiteColumn<{
717
+ name: "id";
718
+ tableName: "api_tokens";
719
+ dataType: "string";
720
+ columnType: "SQLiteText";
721
+ data: string;
722
+ driverParam: string;
723
+ notNull: true;
724
+ hasDefault: true;
725
+ isPrimaryKey: true;
726
+ isAutoincrement: false;
727
+ hasRuntimeDefault: true;
728
+ enumValues: [string, ...string[]];
729
+ baseColumn: never;
730
+ identity: undefined;
731
+ generated: undefined;
732
+ }, {}, {
733
+ length: number | undefined;
734
+ }>;
735
+ name: drizzle_orm_sqlite_core.SQLiteColumn<{
736
+ name: "name";
737
+ tableName: "api_tokens";
738
+ dataType: "string";
739
+ columnType: "SQLiteText";
740
+ data: string;
741
+ driverParam: string;
742
+ notNull: true;
743
+ hasDefault: false;
744
+ isPrimaryKey: false;
745
+ isAutoincrement: false;
746
+ hasRuntimeDefault: false;
747
+ enumValues: [string, ...string[]];
748
+ baseColumn: never;
749
+ identity: undefined;
750
+ generated: undefined;
751
+ }, {}, {
752
+ length: number | undefined;
753
+ }>;
754
+ tokenHash: drizzle_orm_sqlite_core.SQLiteColumn<{
755
+ name: "token_hash";
756
+ tableName: "api_tokens";
757
+ dataType: "string";
758
+ columnType: "SQLiteText";
759
+ data: string;
760
+ driverParam: string;
761
+ notNull: true;
762
+ hasDefault: false;
763
+ isPrimaryKey: false;
764
+ isAutoincrement: false;
765
+ hasRuntimeDefault: false;
766
+ enumValues: [string, ...string[]];
767
+ baseColumn: never;
768
+ identity: undefined;
769
+ generated: undefined;
770
+ }, {}, {
771
+ length: number | undefined;
772
+ }>;
773
+ lastUsedAt: drizzle_orm_sqlite_core.SQLiteColumn<{
774
+ name: "last_used_at";
775
+ tableName: "api_tokens";
776
+ dataType: "string";
777
+ columnType: "SQLiteText";
778
+ data: string;
779
+ driverParam: string;
780
+ notNull: false;
781
+ hasDefault: false;
782
+ isPrimaryKey: false;
783
+ isAutoincrement: false;
784
+ hasRuntimeDefault: false;
785
+ enumValues: [string, ...string[]];
786
+ baseColumn: never;
787
+ identity: undefined;
788
+ generated: undefined;
789
+ }, {}, {
790
+ length: number | undefined;
791
+ }>;
792
+ revokedAt: drizzle_orm_sqlite_core.SQLiteColumn<{
793
+ name: "revoked_at";
794
+ tableName: "api_tokens";
795
+ dataType: "string";
796
+ columnType: "SQLiteText";
797
+ data: string;
798
+ driverParam: string;
799
+ notNull: false;
800
+ hasDefault: false;
801
+ isPrimaryKey: false;
802
+ isAutoincrement: false;
803
+ hasRuntimeDefault: false;
804
+ enumValues: [string, ...string[]];
805
+ baseColumn: never;
806
+ identity: undefined;
807
+ generated: undefined;
808
+ }, {}, {
809
+ length: number | undefined;
810
+ }>;
811
+ createdAt: drizzle_orm_sqlite_core.SQLiteColumn<{
812
+ name: "created_at";
813
+ tableName: "api_tokens";
814
+ dataType: "string";
815
+ columnType: "SQLiteText";
816
+ data: string;
817
+ driverParam: string;
818
+ notNull: true;
819
+ hasDefault: true;
820
+ isPrimaryKey: false;
821
+ isAutoincrement: false;
822
+ hasRuntimeDefault: true;
823
+ enumValues: [string, ...string[]];
824
+ baseColumn: never;
825
+ identity: undefined;
826
+ generated: undefined;
827
+ }, {}, {
828
+ length: number | undefined;
829
+ }>;
830
+ };
831
+ dialect: "sqlite";
832
+ }>;
833
+ type User = typeof users.$inferSelect;
834
+ type NewUser = typeof users.$inferInsert;
835
+ type Session = typeof sessions.$inferSelect;
836
+ type Invitation = typeof invitations.$inferSelect;
837
+ type ApiToken = typeof apiTokens.$inferSelect;
838
+ declare const media: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
839
+ name: "media";
840
+ schema: undefined;
841
+ columns: {
842
+ id: drizzle_orm_sqlite_core.SQLiteColumn<{
843
+ name: "id";
844
+ tableName: "media";
845
+ dataType: "string";
846
+ columnType: "SQLiteText";
847
+ data: string;
848
+ driverParam: string;
849
+ notNull: true;
850
+ hasDefault: true;
851
+ isPrimaryKey: true;
852
+ isAutoincrement: false;
853
+ hasRuntimeDefault: true;
854
+ enumValues: [string, ...string[]];
855
+ baseColumn: never;
856
+ identity: undefined;
857
+ generated: undefined;
858
+ }, {}, {
859
+ length: number | undefined;
860
+ }>;
861
+ filename: drizzle_orm_sqlite_core.SQLiteColumn<{
862
+ name: "filename";
863
+ tableName: "media";
864
+ dataType: "string";
865
+ columnType: "SQLiteText";
866
+ data: string;
867
+ driverParam: string;
868
+ notNull: true;
869
+ hasDefault: false;
870
+ isPrimaryKey: false;
871
+ isAutoincrement: false;
872
+ hasRuntimeDefault: false;
873
+ enumValues: [string, ...string[]];
874
+ baseColumn: never;
875
+ identity: undefined;
876
+ generated: undefined;
877
+ }, {}, {
878
+ length: number | undefined;
879
+ }>;
880
+ mime: drizzle_orm_sqlite_core.SQLiteColumn<{
881
+ name: "mime";
882
+ tableName: "media";
883
+ dataType: "string";
884
+ columnType: "SQLiteText";
885
+ data: string;
886
+ driverParam: string;
887
+ notNull: true;
888
+ hasDefault: false;
889
+ isPrimaryKey: false;
890
+ isAutoincrement: false;
891
+ hasRuntimeDefault: false;
892
+ enumValues: [string, ...string[]];
893
+ baseColumn: never;
894
+ identity: undefined;
895
+ generated: undefined;
896
+ }, {}, {
897
+ length: number | undefined;
898
+ }>;
899
+ size: drizzle_orm_sqlite_core.SQLiteColumn<{
900
+ name: "size";
901
+ tableName: "media";
902
+ dataType: "number";
903
+ columnType: "SQLiteInteger";
904
+ data: number;
905
+ driverParam: number;
906
+ notNull: true;
907
+ hasDefault: false;
908
+ isPrimaryKey: false;
909
+ isAutoincrement: false;
910
+ hasRuntimeDefault: false;
911
+ enumValues: undefined;
912
+ baseColumn: never;
913
+ identity: undefined;
914
+ generated: undefined;
915
+ }, {}, {}>;
916
+ alt: drizzle_orm_sqlite_core.SQLiteColumn<{
917
+ name: "alt";
918
+ tableName: "media";
919
+ dataType: "string";
920
+ columnType: "SQLiteText";
921
+ data: string;
922
+ driverParam: string;
923
+ notNull: false;
924
+ hasDefault: false;
925
+ isPrimaryKey: false;
926
+ isAutoincrement: false;
927
+ hasRuntimeDefault: false;
928
+ enumValues: [string, ...string[]];
929
+ baseColumn: never;
930
+ identity: undefined;
931
+ generated: undefined;
932
+ }, {}, {
933
+ length: number | undefined;
934
+ }>;
935
+ caption: drizzle_orm_sqlite_core.SQLiteColumn<{
936
+ name: "caption";
937
+ tableName: "media";
938
+ dataType: "string";
939
+ columnType: "SQLiteText";
940
+ data: string;
941
+ driverParam: string;
942
+ notNull: false;
943
+ hasDefault: false;
944
+ isPrimaryKey: false;
945
+ isAutoincrement: false;
946
+ hasRuntimeDefault: false;
947
+ enumValues: [string, ...string[]];
948
+ baseColumn: never;
949
+ identity: undefined;
950
+ generated: undefined;
951
+ }, {}, {
952
+ length: number | undefined;
953
+ }>;
954
+ objects: drizzle_orm_sqlite_core.SQLiteColumn<{
955
+ name: "objects";
956
+ tableName: "media";
957
+ dataType: "json";
958
+ columnType: "SQLiteTextJson";
959
+ data: Record<string, unknown>;
960
+ driverParam: string;
961
+ notNull: true;
962
+ hasDefault: false;
963
+ isPrimaryKey: false;
964
+ isAutoincrement: false;
965
+ hasRuntimeDefault: false;
966
+ enumValues: undefined;
967
+ baseColumn: never;
968
+ identity: undefined;
969
+ generated: undefined;
970
+ }, {}, {
971
+ $type: Record<string, unknown>;
972
+ }>;
973
+ metaData: drizzle_orm_sqlite_core.SQLiteColumn<{
974
+ name: "meta_data";
975
+ tableName: "media";
976
+ dataType: "json";
977
+ columnType: "SQLiteTextJson";
978
+ data: Record<string, unknown>;
979
+ driverParam: string;
980
+ notNull: false;
981
+ hasDefault: false;
982
+ isPrimaryKey: false;
983
+ isAutoincrement: false;
984
+ hasRuntimeDefault: false;
985
+ enumValues: undefined;
986
+ baseColumn: never;
987
+ identity: undefined;
988
+ generated: undefined;
989
+ }, {}, {
990
+ $type: Record<string, unknown>;
991
+ }>;
992
+ createdBy: drizzle_orm_sqlite_core.SQLiteColumn<{
993
+ name: "created_by";
994
+ tableName: "media";
995
+ dataType: "string";
996
+ columnType: "SQLiteText";
997
+ data: string;
998
+ driverParam: string;
999
+ notNull: false;
1000
+ hasDefault: false;
1001
+ isPrimaryKey: false;
1002
+ isAutoincrement: false;
1003
+ hasRuntimeDefault: false;
1004
+ enumValues: [string, ...string[]];
1005
+ baseColumn: never;
1006
+ identity: undefined;
1007
+ generated: undefined;
1008
+ }, {}, {
1009
+ length: number | undefined;
1010
+ }>;
1011
+ updatedBy: drizzle_orm_sqlite_core.SQLiteColumn<{
1012
+ name: "updated_by";
1013
+ tableName: "media";
1014
+ dataType: "string";
1015
+ columnType: "SQLiteText";
1016
+ data: string;
1017
+ driverParam: string;
1018
+ notNull: false;
1019
+ hasDefault: false;
1020
+ isPrimaryKey: false;
1021
+ isAutoincrement: false;
1022
+ hasRuntimeDefault: false;
1023
+ enumValues: [string, ...string[]];
1024
+ baseColumn: never;
1025
+ identity: undefined;
1026
+ generated: undefined;
1027
+ }, {}, {
1028
+ length: number | undefined;
1029
+ }>;
1030
+ legacyExtra: drizzle_orm_sqlite_core.SQLiteColumn<{
1031
+ name: "legacy_extra";
1032
+ tableName: "media";
1033
+ dataType: "json";
1034
+ columnType: "SQLiteTextJson";
1035
+ data: Record<string, unknown> | null;
1036
+ driverParam: string;
1037
+ notNull: false;
1038
+ hasDefault: false;
1039
+ isPrimaryKey: false;
1040
+ isAutoincrement: false;
1041
+ hasRuntimeDefault: false;
1042
+ enumValues: undefined;
1043
+ baseColumn: never;
1044
+ identity: undefined;
1045
+ generated: undefined;
1046
+ }, {}, {
1047
+ $type: Record<string, unknown> | null;
1048
+ }>;
1049
+ createdAt: drizzle_orm_sqlite_core.SQLiteColumn<{
1050
+ name: "created_at";
1051
+ tableName: "media";
1052
+ dataType: "string";
1053
+ columnType: "SQLiteText";
1054
+ data: string;
1055
+ driverParam: string;
1056
+ notNull: true;
1057
+ hasDefault: true;
1058
+ isPrimaryKey: false;
1059
+ isAutoincrement: false;
1060
+ hasRuntimeDefault: true;
1061
+ enumValues: [string, ...string[]];
1062
+ baseColumn: never;
1063
+ identity: undefined;
1064
+ generated: undefined;
1065
+ }, {}, {
1066
+ length: number | undefined;
1067
+ }>;
1068
+ updatedAt: drizzle_orm_sqlite_core.SQLiteColumn<{
1069
+ name: "updated_at";
1070
+ tableName: "media";
1071
+ dataType: "string";
1072
+ columnType: "SQLiteText";
1073
+ data: string;
1074
+ driverParam: string;
1075
+ notNull: true;
1076
+ hasDefault: true;
1077
+ isPrimaryKey: false;
1078
+ isAutoincrement: false;
1079
+ hasRuntimeDefault: true;
1080
+ enumValues: [string, ...string[]];
1081
+ baseColumn: never;
1082
+ identity: undefined;
1083
+ generated: undefined;
1084
+ }, {}, {
1085
+ length: number | undefined;
1086
+ }>;
1087
+ };
1088
+ dialect: "sqlite";
1089
+ }>;
1090
+ type Media = typeof media.$inferSelect;
1091
+ type NewMedia = typeof media.$inferInsert;
1092
+ /** Collection definitions — the primary content model of Commun. */
1093
+ declare const collectionDefinitions: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
1094
+ name: "collection_definitions";
1095
+ schema: undefined;
1096
+ columns: {
1097
+ id: drizzle_orm_sqlite_core.SQLiteColumn<{
1098
+ name: "id";
1099
+ tableName: "collection_definitions";
1100
+ dataType: "string";
1101
+ columnType: "SQLiteText";
1102
+ data: string;
1103
+ driverParam: string;
1104
+ notNull: true;
1105
+ hasDefault: true;
1106
+ isPrimaryKey: true;
1107
+ isAutoincrement: false;
1108
+ hasRuntimeDefault: true;
1109
+ enumValues: [string, ...string[]];
1110
+ baseColumn: never;
1111
+ identity: undefined;
1112
+ generated: undefined;
1113
+ }, {}, {
1114
+ length: number | undefined;
1115
+ }>;
1116
+ name: drizzle_orm_sqlite_core.SQLiteColumn<{
1117
+ name: "name";
1118
+ tableName: "collection_definitions";
1119
+ dataType: "string";
1120
+ columnType: "SQLiteText";
1121
+ data: string;
1122
+ driverParam: string;
1123
+ notNull: true;
1124
+ hasDefault: false;
1125
+ isPrimaryKey: false;
1126
+ isAutoincrement: false;
1127
+ hasRuntimeDefault: false;
1128
+ enumValues: [string, ...string[]];
1129
+ baseColumn: never;
1130
+ identity: undefined;
1131
+ generated: undefined;
1132
+ }, {}, {
1133
+ length: number | undefined;
1134
+ }>;
1135
+ slug: drizzle_orm_sqlite_core.SQLiteColumn<{
1136
+ name: "slug";
1137
+ tableName: "collection_definitions";
1138
+ dataType: "string";
1139
+ columnType: "SQLiteText";
1140
+ data: string;
1141
+ driverParam: string;
1142
+ notNull: true;
1143
+ hasDefault: false;
1144
+ isPrimaryKey: false;
1145
+ isAutoincrement: false;
1146
+ hasRuntimeDefault: false;
1147
+ enumValues: [string, ...string[]];
1148
+ baseColumn: never;
1149
+ identity: undefined;
1150
+ generated: undefined;
1151
+ }, {}, {
1152
+ length: number | undefined;
1153
+ }>;
1154
+ description: drizzle_orm_sqlite_core.SQLiteColumn<{
1155
+ name: "description";
1156
+ tableName: "collection_definitions";
1157
+ dataType: "string";
1158
+ columnType: "SQLiteText";
1159
+ data: string;
1160
+ driverParam: string;
1161
+ notNull: false;
1162
+ hasDefault: false;
1163
+ isPrimaryKey: false;
1164
+ isAutoincrement: false;
1165
+ hasRuntimeDefault: false;
1166
+ enumValues: [string, ...string[]];
1167
+ baseColumn: never;
1168
+ identity: undefined;
1169
+ generated: undefined;
1170
+ }, {}, {
1171
+ length: number | undefined;
1172
+ }>;
1173
+ fields: drizzle_orm_sqlite_core.SQLiteColumn<{
1174
+ name: "fields";
1175
+ tableName: "collection_definitions";
1176
+ dataType: "json";
1177
+ columnType: "SQLiteTextJson";
1178
+ data: {
1179
+ name: string;
1180
+ label: string;
1181
+ type: "number" | "boolean" | "text" | "rich-text" | "date" | "media" | "relation" | "select" | "steps" | "json";
1182
+ required: boolean;
1183
+ hidden: boolean;
1184
+ options?: string[] | undefined;
1185
+ target?: string | undefined;
1186
+ }[];
1187
+ driverParam: string;
1188
+ notNull: true;
1189
+ hasDefault: false;
1190
+ isPrimaryKey: false;
1191
+ isAutoincrement: false;
1192
+ hasRuntimeDefault: false;
1193
+ enumValues: undefined;
1194
+ baseColumn: never;
1195
+ identity: undefined;
1196
+ generated: undefined;
1197
+ }, {}, {
1198
+ $type: {
1199
+ name: string;
1200
+ label: string;
1201
+ type: "number" | "boolean" | "text" | "rich-text" | "date" | "media" | "relation" | "select" | "steps" | "json";
1202
+ required: boolean;
1203
+ hidden: boolean;
1204
+ options?: string[] | undefined;
1205
+ target?: string | undefined;
1206
+ }[];
1207
+ }>;
1208
+ editor: drizzle_orm_sqlite_core.SQLiteColumn<{
1209
+ name: "editor";
1210
+ tableName: "collection_definitions";
1211
+ dataType: "json";
1212
+ columnType: "SQLiteTextJson";
1213
+ data: Record<string, unknown>;
1214
+ driverParam: string;
1215
+ notNull: false;
1216
+ hasDefault: false;
1217
+ isPrimaryKey: false;
1218
+ isAutoincrement: false;
1219
+ hasRuntimeDefault: false;
1220
+ enumValues: undefined;
1221
+ baseColumn: never;
1222
+ identity: undefined;
1223
+ generated: undefined;
1224
+ }, {}, {
1225
+ $type: Record<string, unknown>;
1226
+ }>;
1227
+ display: drizzle_orm_sqlite_core.SQLiteColumn<{
1228
+ name: "display";
1229
+ tableName: "collection_definitions";
1230
+ dataType: "json";
1231
+ columnType: "SQLiteTextJson";
1232
+ data: Record<string, unknown>;
1233
+ driverParam: string;
1234
+ notNull: false;
1235
+ hasDefault: false;
1236
+ isPrimaryKey: false;
1237
+ isAutoincrement: false;
1238
+ hasRuntimeDefault: false;
1239
+ enumValues: undefined;
1240
+ baseColumn: never;
1241
+ identity: undefined;
1242
+ generated: undefined;
1243
+ }, {}, {
1244
+ $type: Record<string, unknown>;
1245
+ }>;
1246
+ headings: drizzle_orm_sqlite_core.SQLiteColumn<{
1247
+ name: "headings";
1248
+ tableName: "collection_definitions";
1249
+ dataType: "json";
1250
+ columnType: "SQLiteTextJson";
1251
+ data: Record<string, unknown>;
1252
+ driverParam: string;
1253
+ notNull: false;
1254
+ hasDefault: false;
1255
+ isPrimaryKey: false;
1256
+ isAutoincrement: false;
1257
+ hasRuntimeDefault: false;
1258
+ enumValues: undefined;
1259
+ baseColumn: never;
1260
+ identity: undefined;
1261
+ generated: undefined;
1262
+ }, {}, {
1263
+ $type: Record<string, unknown>;
1264
+ }>;
1265
+ createdBy: drizzle_orm_sqlite_core.SQLiteColumn<{
1266
+ name: "created_by";
1267
+ tableName: "collection_definitions";
1268
+ dataType: "string";
1269
+ columnType: "SQLiteText";
1270
+ data: string;
1271
+ driverParam: string;
1272
+ notNull: false;
1273
+ hasDefault: false;
1274
+ isPrimaryKey: false;
1275
+ isAutoincrement: false;
1276
+ hasRuntimeDefault: false;
1277
+ enumValues: [string, ...string[]];
1278
+ baseColumn: never;
1279
+ identity: undefined;
1280
+ generated: undefined;
1281
+ }, {}, {
1282
+ length: number | undefined;
1283
+ }>;
1284
+ updatedBy: drizzle_orm_sqlite_core.SQLiteColumn<{
1285
+ name: "updated_by";
1286
+ tableName: "collection_definitions";
1287
+ dataType: "string";
1288
+ columnType: "SQLiteText";
1289
+ data: string;
1290
+ driverParam: string;
1291
+ notNull: false;
1292
+ hasDefault: false;
1293
+ isPrimaryKey: false;
1294
+ isAutoincrement: false;
1295
+ hasRuntimeDefault: false;
1296
+ enumValues: [string, ...string[]];
1297
+ baseColumn: never;
1298
+ identity: undefined;
1299
+ generated: undefined;
1300
+ }, {}, {
1301
+ length: number | undefined;
1302
+ }>;
1303
+ legacyExtra: drizzle_orm_sqlite_core.SQLiteColumn<{
1304
+ name: "legacy_extra";
1305
+ tableName: "collection_definitions";
1306
+ dataType: "json";
1307
+ columnType: "SQLiteTextJson";
1308
+ data: Record<string, unknown> | null;
1309
+ driverParam: string;
1310
+ notNull: false;
1311
+ hasDefault: false;
1312
+ isPrimaryKey: false;
1313
+ isAutoincrement: false;
1314
+ hasRuntimeDefault: false;
1315
+ enumValues: undefined;
1316
+ baseColumn: never;
1317
+ identity: undefined;
1318
+ generated: undefined;
1319
+ }, {}, {
1320
+ $type: Record<string, unknown> | null;
1321
+ }>;
1322
+ createdAt: drizzle_orm_sqlite_core.SQLiteColumn<{
1323
+ name: "created_at";
1324
+ tableName: "collection_definitions";
1325
+ dataType: "string";
1326
+ columnType: "SQLiteText";
1327
+ data: string;
1328
+ driverParam: string;
1329
+ notNull: true;
1330
+ hasDefault: true;
1331
+ isPrimaryKey: false;
1332
+ isAutoincrement: false;
1333
+ hasRuntimeDefault: true;
1334
+ enumValues: [string, ...string[]];
1335
+ baseColumn: never;
1336
+ identity: undefined;
1337
+ generated: undefined;
1338
+ }, {}, {
1339
+ length: number | undefined;
1340
+ }>;
1341
+ updatedAt: drizzle_orm_sqlite_core.SQLiteColumn<{
1342
+ name: "updated_at";
1343
+ tableName: "collection_definitions";
1344
+ dataType: "string";
1345
+ columnType: "SQLiteText";
1346
+ data: string;
1347
+ driverParam: string;
1348
+ notNull: true;
1349
+ hasDefault: true;
1350
+ isPrimaryKey: false;
1351
+ isAutoincrement: false;
1352
+ hasRuntimeDefault: true;
1353
+ enumValues: [string, ...string[]];
1354
+ baseColumn: never;
1355
+ identity: undefined;
1356
+ generated: undefined;
1357
+ }, {}, {
1358
+ length: number | undefined;
1359
+ }>;
1360
+ };
1361
+ dialect: "sqlite";
1362
+ }>;
1363
+ /** Entries of a collection — validated against the definition's fields. */
1364
+ declare const entries: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
1365
+ name: "entries";
1366
+ schema: undefined;
1367
+ columns: {
1368
+ id: drizzle_orm_sqlite_core.SQLiteColumn<{
1369
+ name: "id";
1370
+ tableName: "entries";
1371
+ dataType: "string";
1372
+ columnType: "SQLiteText";
1373
+ data: string;
1374
+ driverParam: string;
1375
+ notNull: true;
1376
+ hasDefault: true;
1377
+ isPrimaryKey: true;
1378
+ isAutoincrement: false;
1379
+ hasRuntimeDefault: true;
1380
+ enumValues: [string, ...string[]];
1381
+ baseColumn: never;
1382
+ identity: undefined;
1383
+ generated: undefined;
1384
+ }, {}, {
1385
+ length: number | undefined;
1386
+ }>;
1387
+ collectionId: drizzle_orm_sqlite_core.SQLiteColumn<{
1388
+ name: "collection_id";
1389
+ tableName: "entries";
1390
+ dataType: "string";
1391
+ columnType: "SQLiteText";
1392
+ data: string;
1393
+ driverParam: string;
1394
+ notNull: true;
1395
+ hasDefault: false;
1396
+ isPrimaryKey: false;
1397
+ isAutoincrement: false;
1398
+ hasRuntimeDefault: false;
1399
+ enumValues: [string, ...string[]];
1400
+ baseColumn: never;
1401
+ identity: undefined;
1402
+ generated: undefined;
1403
+ }, {}, {
1404
+ length: number | undefined;
1405
+ }>;
1406
+ title: drizzle_orm_sqlite_core.SQLiteColumn<{
1407
+ name: "title";
1408
+ tableName: "entries";
1409
+ dataType: "string";
1410
+ columnType: "SQLiteText";
1411
+ data: string;
1412
+ driverParam: string;
1413
+ notNull: true;
1414
+ hasDefault: false;
1415
+ isPrimaryKey: false;
1416
+ isAutoincrement: false;
1417
+ hasRuntimeDefault: false;
1418
+ enumValues: [string, ...string[]];
1419
+ baseColumn: never;
1420
+ identity: undefined;
1421
+ generated: undefined;
1422
+ }, {}, {
1423
+ length: number | undefined;
1424
+ }>;
1425
+ slug: drizzle_orm_sqlite_core.SQLiteColumn<{
1426
+ name: "slug";
1427
+ tableName: "entries";
1428
+ dataType: "string";
1429
+ columnType: "SQLiteText";
1430
+ data: string;
1431
+ driverParam: string;
1432
+ notNull: true;
1433
+ hasDefault: false;
1434
+ isPrimaryKey: false;
1435
+ isAutoincrement: false;
1436
+ hasRuntimeDefault: false;
1437
+ enumValues: [string, ...string[]];
1438
+ baseColumn: never;
1439
+ identity: undefined;
1440
+ generated: undefined;
1441
+ }, {}, {
1442
+ length: number | undefined;
1443
+ }>;
1444
+ data: drizzle_orm_sqlite_core.SQLiteColumn<{
1445
+ name: "data";
1446
+ tableName: "entries";
1447
+ dataType: "json";
1448
+ columnType: "SQLiteTextJson";
1449
+ data: Record<string, unknown>;
1450
+ driverParam: string;
1451
+ notNull: true;
1452
+ hasDefault: false;
1453
+ isPrimaryKey: false;
1454
+ isAutoincrement: false;
1455
+ hasRuntimeDefault: false;
1456
+ enumValues: undefined;
1457
+ baseColumn: never;
1458
+ identity: undefined;
1459
+ generated: undefined;
1460
+ }, {}, {
1461
+ $type: Record<string, unknown>;
1462
+ }>;
1463
+ related: drizzle_orm_sqlite_core.SQLiteColumn<{
1464
+ name: "related";
1465
+ tableName: "entries";
1466
+ dataType: "json";
1467
+ columnType: "SQLiteTextJson";
1468
+ data: string[];
1469
+ driverParam: string;
1470
+ notNull: false;
1471
+ hasDefault: false;
1472
+ isPrimaryKey: false;
1473
+ isAutoincrement: false;
1474
+ hasRuntimeDefault: false;
1475
+ enumValues: undefined;
1476
+ baseColumn: never;
1477
+ identity: undefined;
1478
+ generated: undefined;
1479
+ }, {}, {
1480
+ $type: string[];
1481
+ }>;
1482
+ createdBy: drizzle_orm_sqlite_core.SQLiteColumn<{
1483
+ name: "created_by";
1484
+ tableName: "entries";
1485
+ dataType: "string";
1486
+ columnType: "SQLiteText";
1487
+ data: string;
1488
+ driverParam: string;
1489
+ notNull: false;
1490
+ hasDefault: false;
1491
+ isPrimaryKey: false;
1492
+ isAutoincrement: false;
1493
+ hasRuntimeDefault: false;
1494
+ enumValues: [string, ...string[]];
1495
+ baseColumn: never;
1496
+ identity: undefined;
1497
+ generated: undefined;
1498
+ }, {}, {
1499
+ length: number | undefined;
1500
+ }>;
1501
+ updatedBy: drizzle_orm_sqlite_core.SQLiteColumn<{
1502
+ name: "updated_by";
1503
+ tableName: "entries";
1504
+ dataType: "string";
1505
+ columnType: "SQLiteText";
1506
+ data: string;
1507
+ driverParam: string;
1508
+ notNull: false;
1509
+ hasDefault: false;
1510
+ isPrimaryKey: false;
1511
+ isAutoincrement: false;
1512
+ hasRuntimeDefault: false;
1513
+ enumValues: [string, ...string[]];
1514
+ baseColumn: never;
1515
+ identity: undefined;
1516
+ generated: undefined;
1517
+ }, {}, {
1518
+ length: number | undefined;
1519
+ }>;
1520
+ status: drizzle_orm_sqlite_core.SQLiteColumn<{
1521
+ name: "status";
1522
+ tableName: "entries";
1523
+ dataType: "string";
1524
+ columnType: "SQLiteText";
1525
+ data: "draft" | "waiting" | "ready" | "scheduled" | "published";
1526
+ driverParam: string;
1527
+ notNull: true;
1528
+ hasDefault: true;
1529
+ isPrimaryKey: false;
1530
+ isAutoincrement: false;
1531
+ hasRuntimeDefault: false;
1532
+ enumValues: ["draft", "waiting", "ready", "scheduled", "published"];
1533
+ baseColumn: never;
1534
+ identity: undefined;
1535
+ generated: undefined;
1536
+ }, {}, {
1537
+ length: number | undefined;
1538
+ }>;
1539
+ publishedAt: drizzle_orm_sqlite_core.SQLiteColumn<{
1540
+ name: "published_at";
1541
+ tableName: "entries";
1542
+ dataType: "string";
1543
+ columnType: "SQLiteText";
1544
+ data: string;
1545
+ driverParam: string;
1546
+ notNull: false;
1547
+ hasDefault: false;
1548
+ isPrimaryKey: false;
1549
+ isAutoincrement: false;
1550
+ hasRuntimeDefault: false;
1551
+ enumValues: [string, ...string[]];
1552
+ baseColumn: never;
1553
+ identity: undefined;
1554
+ generated: undefined;
1555
+ }, {}, {
1556
+ length: number | undefined;
1557
+ }>;
1558
+ legacyExtra: drizzle_orm_sqlite_core.SQLiteColumn<{
1559
+ name: "legacy_extra";
1560
+ tableName: "entries";
1561
+ dataType: "json";
1562
+ columnType: "SQLiteTextJson";
1563
+ data: Record<string, unknown> | null;
1564
+ driverParam: string;
1565
+ notNull: false;
1566
+ hasDefault: false;
1567
+ isPrimaryKey: false;
1568
+ isAutoincrement: false;
1569
+ hasRuntimeDefault: false;
1570
+ enumValues: undefined;
1571
+ baseColumn: never;
1572
+ identity: undefined;
1573
+ generated: undefined;
1574
+ }, {}, {
1575
+ $type: Record<string, unknown> | null;
1576
+ }>;
1577
+ createdAt: drizzle_orm_sqlite_core.SQLiteColumn<{
1578
+ name: "created_at";
1579
+ tableName: "entries";
1580
+ dataType: "string";
1581
+ columnType: "SQLiteText";
1582
+ data: string;
1583
+ driverParam: string;
1584
+ notNull: true;
1585
+ hasDefault: true;
1586
+ isPrimaryKey: false;
1587
+ isAutoincrement: false;
1588
+ hasRuntimeDefault: true;
1589
+ enumValues: [string, ...string[]];
1590
+ baseColumn: never;
1591
+ identity: undefined;
1592
+ generated: undefined;
1593
+ }, {}, {
1594
+ length: number | undefined;
1595
+ }>;
1596
+ updatedAt: drizzle_orm_sqlite_core.SQLiteColumn<{
1597
+ name: "updated_at";
1598
+ tableName: "entries";
1599
+ dataType: "string";
1600
+ columnType: "SQLiteText";
1601
+ data: string;
1602
+ driverParam: string;
1603
+ notNull: true;
1604
+ hasDefault: true;
1605
+ isPrimaryKey: false;
1606
+ isAutoincrement: false;
1607
+ hasRuntimeDefault: true;
1608
+ enumValues: [string, ...string[]];
1609
+ baseColumn: never;
1610
+ identity: undefined;
1611
+ generated: undefined;
1612
+ }, {}, {
1613
+ length: number | undefined;
1614
+ }>;
1615
+ };
1616
+ dialect: "sqlite";
1617
+ }>;
1618
+ type CollectionDefinition = typeof collectionDefinitions.$inferSelect;
1619
+ type NewCollectionDefinition = typeof collectionDefinitions.$inferInsert;
1620
+ type Entry = typeof entries.$inferSelect;
1621
+ type NewEntry = typeof entries.$inferInsert;
1622
+
1623
+ type schema_Address = Address;
1624
+ type schema_ApiToken = ApiToken;
1625
+ type schema_CollectionDefinition = CollectionDefinition;
1626
+ type schema_Entry = Entry;
1627
+ declare const schema_FIELD_TYPES: typeof FIELD_TYPES;
1628
+ declare const schema_FieldDefinition: typeof FieldDefinition;
1629
+ declare const schema_FieldType: typeof FieldType;
1630
+ type schema_Invitation = Invitation;
1631
+ type schema_Media = Media;
1632
+ type schema_NewCollectionDefinition = NewCollectionDefinition;
1633
+ type schema_NewEntry = NewEntry;
1634
+ type schema_NewMedia = NewMedia;
1635
+ type schema_NewOrganization = NewOrganization;
1636
+ type schema_NewUser = NewUser;
1637
+ type schema_Organization = Organization;
1638
+ declare const schema_PUBLICATION_STATUSES: typeof PUBLICATION_STATUSES;
1639
+ type schema_Session = Session;
1640
+ type schema_User = User;
1641
+ declare const schema_addressSchema: typeof addressSchema;
1642
+ declare const schema_apiTokens: typeof apiTokens;
1643
+ declare const schema_collectionDefinitions: typeof collectionDefinitions;
1644
+ declare const schema_entries: typeof entries;
1645
+ declare const schema_fieldDefinitionSchema: typeof fieldDefinitionSchema;
1646
+ declare const schema_invitations: typeof invitations;
1647
+ declare const schema_media: typeof media;
1648
+ declare const schema_organization: typeof organization;
1649
+ declare const schema_sessions: typeof sessions;
1650
+ declare const schema_users: typeof users;
1651
+ declare namespace schema {
1652
+ export { schema_FIELD_TYPES as FIELD_TYPES, schema_FieldDefinition as FieldDefinition, schema_FieldType as FieldType, schema_PUBLICATION_STATUSES as PUBLICATION_STATUSES, schema_addressSchema as addressSchema, schema_apiTokens as apiTokens, schema_collectionDefinitions as collectionDefinitions, schema_entries as entries, schema_fieldDefinitionSchema as fieldDefinitionSchema, schema_invitations as invitations, schema_media as media, schema_organization as organization, schema_sessions as sessions, schema_users as users };
1653
+ export type { schema_Address as Address, schema_ApiToken as ApiToken, schema_CollectionDefinition as CollectionDefinition, schema_Entry as Entry, schema_Invitation as Invitation, schema_Media as Media, schema_NewCollectionDefinition as NewCollectionDefinition, schema_NewEntry as NewEntry, schema_NewMedia as NewMedia, schema_NewOrganization as NewOrganization, schema_NewUser as NewUser, schema_Organization as Organization, schema_Session as Session, schema_User as User };
1654
+ }
1655
+
1656
+ /** Open and migrate the instance database: one instance, one SQLite file. */
1657
+ declare function connectDb(dataDir: string, migrationsDir?: string): drizzle_orm_bun_sqlite.BunSQLiteDatabase<typeof schema> & {
1658
+ $client: Database;
1659
+ };
1660
+ /** The fully-typed Drizzle instance returned by `connectDb`. */
1661
+ type StoreDb = ReturnType<typeof connectDb>;
1662
+
1663
+ /** The health payload — served AS-IS by GET /health and trpc health.ping. */
1664
+ interface HealthStatus {
1665
+ status: 'ok' | 'degraded';
1666
+ service: string;
1667
+ time: string;
1668
+ db: {
1669
+ ok: boolean;
1670
+ };
1671
+ }
1672
+ /**
1673
+ * Connectivity snapshot for operators and probes: the instance is up and its
1674
+ * database answers. Lives in `infrastructure/` as an observability concern;
1675
+ * both transports (REST route, tRPC ping) return its payload untouched.
1676
+ */
1677
+ declare class HealthService {
1678
+ private readonly db;
1679
+ constructor(db: StoreDb);
1680
+ check(): Promise<HealthStatus>;
1681
+ }
1682
+
1683
+ /**
1684
+ * S3-compatible object storage is the only media backend (Scaleway, MinIO,
1685
+ * Garage…). The interface exists for test doubles, not for alternative
1686
+ * backends.
1687
+ */
1688
+ interface StorageDriver {
1689
+ /** Pre-signed URL for a direct client PUT. */
1690
+ presignedPutUrl(key: string, contentType: string, metadata?: Record<string, string>): Promise<string>;
1691
+ /** In-process upload, same destination as a pre-signed PUT. */
1692
+ put(key: string, body: Uint8Array, contentType: string): Promise<void>;
1693
+ /** Object metadata if it exists (confirms an upload), null otherwise. */
1694
+ head(key: string): Promise<{
1695
+ size: number;
1696
+ } | null>;
1697
+ remove(keys: string[]): Promise<void>;
1698
+ /** URL a browser can load the object from: public under `medias/`, signed elsewhere. */
1699
+ url(key: string): Promise<string>;
1700
+ }
1701
+ interface S3Config {
1702
+ endpoint?: string;
1703
+ region: string;
1704
+ bucket: string;
1705
+ accessKey: string;
1706
+ secretKey: string;
1707
+ }
1708
+ /** Works with any S3-compatible endpoint: Scaleway Object Storage, MinIO, Garage… */
1709
+ declare class S3Storage implements StorageDriver {
1710
+ private readonly config;
1711
+ private readonly client;
1712
+ constructor(config: S3Config);
1713
+ presignedPutUrl(key: string, contentType: string, metadata?: Record<string, string>): Promise<string>;
1714
+ put(key: string, body: Uint8Array, contentType: string): Promise<void>;
1715
+ head(key: string): Promise<{
1716
+ size: number;
1717
+ } | null>;
1718
+ remove(keys: string[]): Promise<void>;
1719
+ url(key: string): Promise<string>;
1720
+ /** Direct URL, unsigned and non-expiring — see `PUBLIC_PREFIX`. */
1721
+ private publicUrl;
1722
+ }
1723
+ /** Build the storage driver from the parsed environment. */
1724
+ declare function createStorage(env: CoreEnv): StorageDriver;
1725
+
1726
+ /**
1727
+ * The core sends business EVENTS, never emails: it knows no provider, no
1728
+ * template, no copy. Point COMMUN_EMAIL_WEBHOOK_URL at whatever consumes them.
1729
+ *
1730
+ * The payload mirrors the Loops `events/send` shape, so pointing it straight at
1731
+ * Loops works without an adapter — but any receiver honouring the same contract
1732
+ * does too, which is what keeps self-hosting free of a provider.
1733
+ */
1734
+ interface EmailEvent {
1735
+ email: string;
1736
+ eventName: 'userInvited' | 'passwordResetRequested';
1737
+ eventProperties?: Record<string, string | number | boolean>;
1738
+ }
1739
+ declare class EmailService {
1740
+ private readonly config;
1741
+ constructor(config: {
1742
+ url: string;
1743
+ token?: string;
1744
+ });
1745
+ static fromEnv(env: CoreEnv): EmailService;
1746
+ sendEvent(event: EmailEvent): Promise<void>;
1747
+ }
1748
+
1749
+ /**
1750
+ * All database access of the users domain — services never touch Drizzle
1751
+ * directly. Methods are async by contract even though bun:sqlite executes
1752
+ * synchronously.
1753
+ */
1754
+ declare class UsersRepository {
1755
+ private readonly db;
1756
+ constructor(db: StoreDb);
1757
+ findUserByEmail(email: string): Promise<User | undefined>;
1758
+ findUserById(id: string): Promise<User | undefined>;
1759
+ listUsers(): Promise<User[]>;
1760
+ hasAnyUser(): Promise<boolean>;
1761
+ deleteUser(id: string): Promise<void>;
1762
+ activateUser(input: {
1763
+ email: string;
1764
+ name: string;
1765
+ passwordHash: string;
1766
+ role: 'admin' | 'redacteur';
1767
+ }): Promise<User>;
1768
+ insertSession(input: {
1769
+ userId: string;
1770
+ expiresAt: string;
1771
+ ua?: string | null;
1772
+ ip?: string | null;
1773
+ }): Promise<Session>;
1774
+ findActiveSessionWithUser(sessionId: string, now: string): Promise<{
1775
+ session: Session;
1776
+ user: User;
1777
+ } | undefined>;
1778
+ revokeSession(sessionId: string, now: string): Promise<void>;
1779
+ findSessionById(sessionId: string): Promise<Session | undefined>;
1780
+ listActiveSessionsByUser(userId: string, now: string): Promise<Session[]>;
1781
+ updateUser(id: string, input: Partial<Pick<User, 'name' | 'role'>>): Promise<User | undefined>;
1782
+ insertInvitation(input: {
1783
+ email: string;
1784
+ role: 'admin' | 'redacteur';
1785
+ tokenHash: string;
1786
+ expiresAt: string;
1787
+ }): Promise<Invitation>;
1788
+ findValidInvitation(tokenHash: string, now: string): Promise<Invitation | undefined>;
1789
+ markInvitationUsed(id: string, now: string): Promise<void>;
1790
+ insertApiToken(input: {
1791
+ name: string;
1792
+ tokenHash: string;
1793
+ }): Promise<ApiToken>;
1794
+ findActiveApiToken(tokenHash: string): Promise<ApiToken | undefined>;
1795
+ touchApiToken(id: string, now: string): Promise<void>;
1796
+ revokeApiToken(id: string, now: string): Promise<void>;
1797
+ listApiTokens(): Promise<Array<Pick<ApiToken, 'id' | 'name' | 'lastUsedAt' | 'revokedAt' | 'createdAt'>>>;
1798
+ purgeExpired(now: string): Promise<void>;
1799
+ }
1800
+
1801
+ /** Device metadata captured at login (iso legacy: the account page lists devices). */
1802
+ interface SessionMeta {
1803
+ ua?: string | null;
1804
+ ip?: string | null;
1805
+ }
1806
+ interface AuthSession {
1807
+ sessionId: string;
1808
+ user: User;
1809
+ expiresAt: string;
1810
+ }
1811
+ /**
1812
+ * Identity & access of the instance: passwords (argon2id via Bun.password),
1813
+ * opaque hashed sessions, single-use invitations and machine API tokens.
1814
+ * Everything token-like is random (crypto), shown once, stored hashed.
1815
+ */
1816
+ declare class UsersService {
1817
+ private readonly repository;
1818
+ private readonly options;
1819
+ constructor(repository: UsersRepository, options?: {
1820
+ email?: EmailService;
1821
+ adminUrl?: string;
1822
+ jwtSecret?: string;
1823
+ });
1824
+ /** Clé HMAC du JWT de session (JWT { session: <uuid> }). */
1825
+ private jwtKey;
1826
+ /** Émission best-effort : un échec du webhook email ne casse jamais le flux. */
1827
+ private sendEmailEvent;
1828
+ hashPassword(password: string): Promise<string>;
1829
+ verifyPassword(password: string, passwordHash: string): Promise<boolean>;
1830
+ login(email: string, password: string, meta?: SessionMeta): Promise<{
1831
+ token: string;
1832
+ session: AuthSession;
1833
+ } | null>;
1834
+ createSession(user: User, meta?: SessionMeta): Promise<{
1835
+ token: string;
1836
+ session: AuthSession;
1837
+ }>;
1838
+ verifySession(token: string): Promise<AuthSession | null>;
1839
+ revokeSession(sessionId: string): Promise<void>;
1840
+ /** Active sessions of a user (device list — legacy `account/me` parity). */
1841
+ listSessions(userId: string, currentSessionId: string): Promise<{
1842
+ id: string;
1843
+ createdAt: string;
1844
+ expiresAt: string;
1845
+ ua: string | null;
1846
+ ip: string | null;
1847
+ current: boolean;
1848
+ }[]>;
1849
+ /** Revoke ONE of the caller's own sessions (targeted device logout). */
1850
+ revokeOwnSession(userId: string, sessionId: string): Promise<void>;
1851
+ /** Boot housekeeping — SQLite has no TTL indexes, unlike the legacy Mongo. */
1852
+ purgeExpired(): Promise<void>;
1853
+ createInvitation(input: {
1854
+ email: string;
1855
+ role: 'admin' | 'redacteur';
1856
+ }): Promise<{
1857
+ token: string;
1858
+ expiresAt: string;
1859
+ }>;
1860
+ /**
1861
+ * « Forgotten password »: reuses the invitation mechanism — a single-use
1862
+ * link that redefines the password of an existing account. The response is
1863
+ * identical whether the address exists or not, so it cannot be used to
1864
+ * enumerate accounts.
1865
+ */
1866
+ requestPasswordReset(email: string): Promise<void>;
1867
+ /**
1868
+ * Consume an invitation: activates (or creates) the user with the given
1869
+ * password and marks the link used. Expired or already-used links are
1870
+ * refused without leaking whether the email exists. `name` is optional for
1871
+ * an EXISTING account (password-reset flow keeps the current name).
1872
+ */
1873
+ acceptInvitation(token: string, input: {
1874
+ name?: string;
1875
+ password: string;
1876
+ }): Promise<User>;
1877
+ listUsers(): Promise<User[]>;
1878
+ getUser(id: string): Promise<User>;
1879
+ hasAnyUser(): Promise<boolean>;
1880
+ removeUser(actorId: string, id: string): Promise<void>;
1881
+ updateUser(id: string, input: {
1882
+ name?: string;
1883
+ role?: 'admin' | 'redacteur';
1884
+ email?: string;
1885
+ }): Promise<User>;
1886
+ /** The plaintext token is returned ONCE — only its sha256 lands in the database. */
1887
+ createApiToken(name: string): Promise<{
1888
+ token: string;
1889
+ record: ApiToken;
1890
+ }>;
1891
+ /** True if the bearer token matches a non-revoked API token (stamps lastUsedAt). */
1892
+ verifyApiToken(token: string): Promise<boolean>;
1893
+ revokeApiToken(id: string): Promise<void>;
1894
+ listApiTokens(): Promise<Pick<{
1895
+ name: string;
1896
+ id: string;
1897
+ createdAt: string;
1898
+ revokedAt: string | null;
1899
+ tokenHash: string;
1900
+ lastUsedAt: string | null;
1901
+ }, "name" | "id" | "createdAt" | "revokedAt" | "lastUsedAt">[]>;
1902
+ }
1903
+
1904
+ /**
1905
+ * All database access of the organization domain (singleton row, id = 1).
1906
+ * Methods are async by contract even though bun:sqlite executes synchronously.
1907
+ */
1908
+ declare class OrganizationRepository {
1909
+ private readonly db;
1910
+ constructor(db: StoreDb);
1911
+ get(): Promise<Organization | undefined>;
1912
+ insert(input: NewOrganization): Promise<Organization>;
1913
+ update(input: Partial<NewOrganization>): Promise<Organization | undefined>;
1914
+ }
1915
+
1916
+ declare const organizationInitDto: z.ZodObject<{
1917
+ type: z.ZodOptional<z.ZodEnum<{
1918
+ commune: "commune";
1919
+ intercommunality: "intercommunality";
1920
+ syndicate: "syndicate";
1921
+ other: "other";
1922
+ }>>;
1923
+ name: z.ZodString;
1924
+ slug: z.ZodString;
1925
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1926
+ address: z.ZodOptional<z.ZodNullable<z.ZodType<{
1927
+ street?: string | undefined;
1928
+ postalCode?: string | undefined;
1929
+ city?: string | undefined;
1930
+ }, {
1931
+ street?: string | undefined;
1932
+ postalCode?: string | undefined;
1933
+ city?: string | undefined;
1934
+ }, z.core.$ZodTypeInternals<{
1935
+ street?: string | undefined;
1936
+ postalCode?: string | undefined;
1937
+ city?: string | undefined;
1938
+ }, {
1939
+ street?: string | undefined;
1940
+ postalCode?: string | undefined;
1941
+ city?: string | undefined;
1942
+ }>>>>;
1943
+ deployment: z.ZodOptional<z.ZodNullable<z.ZodType<Record<string, unknown>, Record<string, unknown>, z.core.$ZodTypeInternals<Record<string, unknown>, Record<string, unknown>>>>>;
1944
+ settings: z.ZodOptional<z.ZodNullable<z.ZodType<Record<string, unknown>, Record<string, unknown>, z.core.$ZodTypeInternals<Record<string, unknown>, Record<string, unknown>>>>>;
1945
+ }, {
1946
+ out: {};
1947
+ in: {};
1948
+ }>;
1949
+ declare const organizationUpdateDto: z.ZodObject<{
1950
+ type: z.ZodOptional<z.ZodEnum<{
1951
+ commune: "commune";
1952
+ intercommunality: "intercommunality";
1953
+ syndicate: "syndicate";
1954
+ other: "other";
1955
+ }>>;
1956
+ name: z.ZodOptional<z.ZodString>;
1957
+ slug: z.ZodOptional<z.ZodString>;
1958
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1959
+ address: z.ZodOptional<z.ZodNullable<z.ZodType<{
1960
+ street?: string | undefined;
1961
+ postalCode?: string | undefined;
1962
+ city?: string | undefined;
1963
+ }, {
1964
+ street?: string | undefined;
1965
+ postalCode?: string | undefined;
1966
+ city?: string | undefined;
1967
+ }, z.core.$ZodTypeInternals<{
1968
+ street?: string | undefined;
1969
+ postalCode?: string | undefined;
1970
+ city?: string | undefined;
1971
+ }, {
1972
+ street?: string | undefined;
1973
+ postalCode?: string | undefined;
1974
+ city?: string | undefined;
1975
+ }>>>>;
1976
+ deployment: z.ZodOptional<z.ZodNullable<z.ZodType<Record<string, unknown>, Record<string, unknown>, z.core.$ZodTypeInternals<Record<string, unknown>, Record<string, unknown>>>>>;
1977
+ settings: z.ZodOptional<z.ZodNullable<z.ZodType<Record<string, unknown>, Record<string, unknown>, z.core.$ZodTypeInternals<Record<string, unknown>, Record<string, unknown>>>>>;
1978
+ }, {
1979
+ out: {};
1980
+ in: {};
1981
+ }>;
1982
+ type OrganizationInitDto = z.infer<typeof organizationInitDto>;
1983
+ type OrganizationUpdateDto = z.infer<typeof organizationUpdateDto>;
1984
+
1985
+ /** Instance settings — a singleton: initialised once, then only updated. */
1986
+ declare class OrganizationService {
1987
+ private readonly repository;
1988
+ private readonly options;
1989
+ constructor(repository: OrganizationRepository, options?: {
1990
+ fetchImpl?: typeof fetch;
1991
+ });
1992
+ get(): Promise<Organization | null>;
1993
+ /** First-time initialisation — refused once the singleton exists. */
1994
+ init(input: OrganizationInitDto): Promise<Organization>;
1995
+ update(input: OrganizationUpdateDto, actorId?: string): Promise<Organization>;
1996
+ /** Triggers the site build through the configured deploy hook. */
1997
+ deploy(): Promise<{
1998
+ status: number;
1999
+ }>;
2000
+ }
2001
+
2002
+ /**
2003
+ * All database access of the media domain. Methods are async by contract
2004
+ * even though bun:sqlite executes synchronously.
2005
+ */
2006
+ declare class MediaRepository {
2007
+ private readonly db;
2008
+ constructor(db: StoreDb);
2009
+ insert(input: NewMedia): Promise<Media>;
2010
+ findById(id: string): Promise<Media | undefined>;
2011
+ list(): Promise<Media[]>;
2012
+ /** Retrouve un média par une clé de son metaData — ce qui rend un import idempotent. */
2013
+ findByMetaData(name: string, value: string): Promise<Media | undefined>;
2014
+ update(id: string, input: Partial<Pick<Media, 'alt' | 'caption' | 'filename' | 'metaData' | 'objects' | 'updatedBy'>>): Promise<Media | undefined>;
2015
+ delete(id: string): Promise<void>;
2016
+ }
2017
+
2018
+ declare const mediaRequestUploadDto: z.ZodObject<{
2019
+ filename: z.ZodString;
2020
+ mime: z.ZodString;
2021
+ metaData: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
2022
+ }, z.core.$strip>;
2023
+ declare const mediaFinalizeDto: z.ZodObject<{
2024
+ key: z.ZodString;
2025
+ filename: z.ZodString;
2026
+ mime: z.ZodString;
2027
+ alt: z.ZodOptional<z.ZodString>;
2028
+ metaData: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2029
+ }, z.core.$strip>;
2030
+ type MediaRequestUploadDto = z.infer<typeof mediaRequestUploadDto>;
2031
+ type MediaFinalizeDto = z.infer<typeof mediaFinalizeDto>;
2032
+
2033
+ declare const mediaUpdateDto: z.ZodObject<{
2034
+ filename: z.ZodOptional<z.ZodString>;
2035
+ alt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2036
+ caption: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2037
+ }, {
2038
+ out: {};
2039
+ in: {};
2040
+ }>;
2041
+ type MediaUpdateDto = z.infer<typeof mediaUpdateDto>;
2042
+
2043
+ /** Closed allowlist. SVG is excluded on purpose: it is an XSS surface. */
2044
+ declare const ALLOWED_MIME: Set<string>;
2045
+ /** The media shape existing clients consume: `objects` values are public URLs. */
2046
+ interface LegacyMedia {
2047
+ _id: string;
2048
+ id: string;
2049
+ originalName: string;
2050
+ mime: string;
2051
+ metaData?: Record<string, unknown>;
2052
+ objects: Record<string, string>;
2053
+ }
2054
+ /**
2055
+ * Media library. The API hands out a pre-signed PUT URL, the client uploads
2056
+ * DIRECTLY to storage, then `finalize` verifies the object and records the row.
2057
+ *
2058
+ * Writes stay signed; reads do not — objects under `medias/` are public.
2059
+ * Resizing is not implemented yet.
2060
+ */
2061
+ declare class MediaService {
2062
+ private readonly repository;
2063
+ private readonly storage;
2064
+ constructor(repository: MediaRepository, storage: StorageDriver);
2065
+ /** Step 1 (iso legacy `PUT /media/:org`): validate mime, hand out a pre-signed PUT URL (metaData attached to the object). */
2066
+ requestUpload(filename: string, mime: string, metaData?: Record<string, string>): Promise<{
2067
+ key: string;
2068
+ url: string;
2069
+ }>;
2070
+ /** Step 2 (iso legacy `POST /media/:org`): confirm the S3 object, record the media row. */
2071
+ finalize(input: MediaFinalizeDto, actorId?: string): Promise<Media>;
2072
+ /**
2073
+ * In-process upload, for sync tasks: same flow, but the object is written
2074
+ * through the driver instead of a pre-signed URL.
2075
+ */
2076
+ uploadDirect(filename: string, mime: string, body: Uint8Array, metaData?: Record<string, unknown>, actorId?: string): Promise<Media>;
2077
+ list(): Promise<Media[]>;
2078
+ /** List with `objects` resolved to their URLs (iso legacy read shape). */
2079
+ listResolved(): Promise<Array<Media & {
2080
+ objects: Record<string, string>;
2081
+ }>>;
2082
+ /** One media with resolved `objects` (iso legacy `GET /media/:org/:id`). */
2083
+ get(id: string): Promise<Media & {
2084
+ objects: Record<string, string>;
2085
+ }>;
2086
+ updateEditorial(id: string, input: MediaUpdateDto, actorId?: string): Promise<Media>;
2087
+ /** Delete the row AND every stored object (original + variants). */
2088
+ remove(id: string): Promise<void>;
2089
+ /** Public GET URL of a media's original object (null if the media is unknown). */
2090
+ url(id: string): Promise<string | null>;
2091
+ /** The media record public payloads carry, with its URLs resolved. */
2092
+ toLegacyMedia(id: string): Promise<LegacyMedia | null>;
2093
+ /** Walks any JSON value, replacing `_media:<id>` strings with media records. */
2094
+ resolveMediaPlaceholders(node: unknown): Promise<unknown>;
2095
+ private objectUrls;
2096
+ }
2097
+
2098
+ /**
2099
+ * Database access for collection definitions. Methods are async by contract,
2100
+ * even though bun:sqlite executes synchronously.
2101
+ */
2102
+ declare class DefinitionRepository {
2103
+ private readonly db;
2104
+ constructor(db: StoreDb);
2105
+ list(): Promise<CollectionDefinition[]>;
2106
+ findBySlug(slug: string): Promise<CollectionDefinition | undefined>;
2107
+ findById(id: string): Promise<CollectionDefinition | undefined>;
2108
+ /** External import configs reference collections by their legacy id. */
2109
+ findByLegacyId(legacyId: string): Promise<CollectionDefinition | undefined>;
2110
+ insert(input: NewCollectionDefinition): Promise<CollectionDefinition>;
2111
+ update(id: string, input: Partial<NewCollectionDefinition>): Promise<CollectionDefinition | undefined>;
2112
+ delete(id: string): Promise<CollectionDefinition | undefined>;
2113
+ }
2114
+
2115
+ /**
2116
+ * Database access for collection entries. Methods are async by contract, even
2117
+ * though bun:sqlite executes synchronously.
2118
+ */
2119
+ declare class EntryRepository {
2120
+ private readonly db;
2121
+ constructor(db: StoreDb);
2122
+ list(collectionId: string): Promise<Entry[]>;
2123
+ /** Admin listing: most recently updated first, paginated. */
2124
+ listPaginated(collectionId: string, options: {
2125
+ skip: number;
2126
+ limit: number;
2127
+ }): Promise<Entry[]>;
2128
+ listPublished(collectionId: string): Promise<Entry[]>;
2129
+ findBySlug(collectionId: string, slug: string): Promise<Entry | undefined>;
2130
+ findById(id: string): Promise<Entry | undefined>;
2131
+ /** Finds an entry by a key of its data — what makes an external import idempotent. */
2132
+ findByDataField(collectionId: string, name: string, value: string | number): Promise<Entry | undefined>;
2133
+ insert(input: NewEntry): Promise<Entry>;
2134
+ update(id: string, input: Partial<NewEntry>): Promise<Entry | undefined>;
2135
+ delete(id: string): Promise<Entry | undefined>;
2136
+ }
2137
+
2138
+ declare const definitionCreateDto: z.ZodObject<{
2139
+ name: z.ZodString;
2140
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2141
+ editor: z.ZodOptional<z.ZodNullable<z.ZodType<Record<string, unknown>, Record<string, unknown>, z.core.$ZodTypeInternals<Record<string, unknown>, Record<string, unknown>>>>>;
2142
+ display: z.ZodOptional<z.ZodNullable<z.ZodType<Record<string, unknown>, Record<string, unknown>, z.core.$ZodTypeInternals<Record<string, unknown>, Record<string, unknown>>>>>;
2143
+ headings: z.ZodOptional<z.ZodNullable<z.ZodType<Record<string, unknown>, Record<string, unknown>, z.core.$ZodTypeInternals<Record<string, unknown>, Record<string, unknown>>>>>;
2144
+ fields: z.ZodArray<z.ZodObject<{
2145
+ name: z.ZodString;
2146
+ label: z.ZodString;
2147
+ type: z.ZodEnum<{
2148
+ number: "number";
2149
+ boolean: "boolean";
2150
+ text: "text";
2151
+ "rich-text": "rich-text";
2152
+ date: "date";
2153
+ media: "media";
2154
+ relation: "relation";
2155
+ select: "select";
2156
+ steps: "steps";
2157
+ json: "json";
2158
+ }>;
2159
+ required: z.ZodDefault<z.ZodBoolean>;
2160
+ hidden: z.ZodDefault<z.ZodBoolean>;
2161
+ options: z.ZodOptional<z.ZodArray<z.ZodString>>;
2162
+ target: z.ZodOptional<z.ZodString>;
2163
+ }, z.core.$strip>>;
2164
+ slug: z.ZodOptional<z.ZodString>;
2165
+ }, {
2166
+ out: {};
2167
+ in: {};
2168
+ }>;
2169
+ declare const definitionUpdateDto: z.ZodObject<{
2170
+ name: z.ZodOptional<z.ZodString>;
2171
+ slug: z.ZodOptional<z.ZodString>;
2172
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2173
+ editor: z.ZodOptional<z.ZodNullable<z.ZodType<Record<string, unknown>, Record<string, unknown>, z.core.$ZodTypeInternals<Record<string, unknown>, Record<string, unknown>>>>>;
2174
+ display: z.ZodOptional<z.ZodNullable<z.ZodType<Record<string, unknown>, Record<string, unknown>, z.core.$ZodTypeInternals<Record<string, unknown>, Record<string, unknown>>>>>;
2175
+ headings: z.ZodOptional<z.ZodNullable<z.ZodType<Record<string, unknown>, Record<string, unknown>, z.core.$ZodTypeInternals<Record<string, unknown>, Record<string, unknown>>>>>;
2176
+ fields: z.ZodOptional<z.ZodArray<z.ZodObject<{
2177
+ name: z.ZodString;
2178
+ label: z.ZodString;
2179
+ type: z.ZodEnum<{
2180
+ number: "number";
2181
+ boolean: "boolean";
2182
+ text: "text";
2183
+ "rich-text": "rich-text";
2184
+ date: "date";
2185
+ media: "media";
2186
+ relation: "relation";
2187
+ select: "select";
2188
+ steps: "steps";
2189
+ json: "json";
2190
+ }>;
2191
+ required: z.ZodDefault<z.ZodBoolean>;
2192
+ hidden: z.ZodDefault<z.ZodBoolean>;
2193
+ options: z.ZodOptional<z.ZodArray<z.ZodString>>;
2194
+ target: z.ZodOptional<z.ZodString>;
2195
+ }, z.core.$strip>>>;
2196
+ }, {
2197
+ out: {};
2198
+ in: {};
2199
+ }>;
2200
+ type DefinitionCreateDto = z.infer<typeof definitionCreateDto>;
2201
+ type DefinitionUpdateDto = z.infer<typeof definitionUpdateDto>;
2202
+
2203
+ declare const entryCreateDto: z.ZodObject<{
2204
+ data: z.ZodType<Record<string, unknown>, Record<string, unknown>, z.core.$ZodTypeInternals<Record<string, unknown>, Record<string, unknown>>>;
2205
+ title: z.ZodString;
2206
+ status: z.ZodOptional<z.ZodEnum<{
2207
+ draft: "draft";
2208
+ waiting: "waiting";
2209
+ ready: "ready";
2210
+ scheduled: "scheduled";
2211
+ published: "published";
2212
+ }>>;
2213
+ publishedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2214
+ slug: z.ZodOptional<z.ZodString>;
2215
+ }, {
2216
+ out: {};
2217
+ in: {};
2218
+ }>;
2219
+ declare const entryUpdateDto: z.ZodObject<{
2220
+ data: z.ZodOptional<z.ZodType<Record<string, unknown>, Record<string, unknown>, z.core.$ZodTypeInternals<Record<string, unknown>, Record<string, unknown>>>>;
2221
+ slug: z.ZodOptional<z.ZodString>;
2222
+ title: z.ZodOptional<z.ZodString>;
2223
+ status: z.ZodOptional<z.ZodEnum<{
2224
+ draft: "draft";
2225
+ waiting: "waiting";
2226
+ ready: "ready";
2227
+ scheduled: "scheduled";
2228
+ published: "published";
2229
+ }>>;
2230
+ publishedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2231
+ related: z.ZodOptional<z.ZodArray<z.ZodString>>;
2232
+ }, {
2233
+ out: {};
2234
+ in: {};
2235
+ }>;
2236
+ type EntryCreateDto = z.infer<typeof entryCreateDto>;
2237
+ type EntryUpdateDto = z.infer<typeof entryUpdateDto>;
2238
+
2239
+ /**
2240
+ * The content engine: collection definitions over a closed field-type set, and
2241
+ * their entries, validated against the Zod schema generated from each definition.
2242
+ */
2243
+ declare class CollectionsService {
2244
+ private readonly definitions;
2245
+ private readonly entries;
2246
+ private readonly media;
2247
+ constructor(definitions: DefinitionRepository, entries: EntryRepository, media: MediaService);
2248
+ listDefinitions(): Promise<CollectionDefinition[]>;
2249
+ getDefinition(idOrSlug: string): Promise<CollectionDefinition>;
2250
+ createDefinition(input: DefinitionCreateDto, actorId?: string): Promise<CollectionDefinition>;
2251
+ updateDefinition(id: string, input: DefinitionUpdateDto, actorId?: string): Promise<CollectionDefinition>;
2252
+ removeDefinition(id: string): Promise<void>;
2253
+ private validateData;
2254
+ listEntries(collectionIdOrSlug: string): Promise<Entry[]>;
2255
+ getEntry(id: string): Promise<Entry>;
2256
+ /** Paginated admin listing, most recently updated first. */
2257
+ listEntriesPaginated(collectionIdOrSlug: string, options?: {
2258
+ skip?: number;
2259
+ limit?: number;
2260
+ }): Promise<Entry[]>;
2261
+ listPublishedEntries(collectionIdOrSlug: string): Promise<Entry[]>;
2262
+ createEntry(collectionIdOrSlug: string, input: EntryCreateDto, actorId?: string): Promise<Entry>;
2263
+ /** PARTIAL update: `data` is merged field by field with what already exists. */
2264
+ updateEntry(id: string, input: EntryUpdateDto, actorId?: string): Promise<Entry>;
2265
+ removeEntry(id: string): Promise<void>;
2266
+ /**
2267
+ * Hidden fields excluded; rich text resolved then STRINGIFIED; media fields
2268
+ * turned into arrays of media records.
2269
+ */
2270
+ private resolveEntryData;
2271
+ /** Image and file nodes get their `mediaRecord` and a resolved `src`. */
2272
+ private resolveRichTextMedia;
2273
+ /** Events with no scheduled period are never published. */
2274
+ private hasEmptySchedules;
2275
+ /**
2276
+ * ONE flat map of every published entry across all collections, keyed by id.
2277
+ */
2278
+ legacyRecordsPayload(): Promise<Record<string, Record<string, unknown>>>;
2279
+ /** Public slugs of every published entry (`/collection/entry`), for the deployment payload. */
2280
+ publishedSlugs(): Promise<string[]>;
2281
+ private mapSlugConflict;
2282
+ /** Incremental suffix -1/-2… until the slug is unique within the collection. */
2283
+ private uniqueEntrySlug;
2284
+ private uniqueDefinitionSlug;
2285
+ /** Bidirectional `records[]`: maintain the reverse links on the targets. */
2286
+ private linkRelations;
2287
+ }
2288
+
2289
+ /** The domain services — the ONLY surface transport layers (tRPC, REST) talk to. */
2290
+ interface CoreServices {
2291
+ health: HealthService;
2292
+ users: UsersService;
2293
+ organization: OrganizationService;
2294
+ media: MediaService;
2295
+ collections: CollectionsService;
2296
+ }
2297
+ /** The fully-wired dependency graph returned by `createCore({ env })`. */
2298
+ interface Core {
2299
+ env: CoreEnv;
2300
+ db: StoreDb;
2301
+ storage: StorageDriver;
2302
+ services: CoreServices;
2303
+ }
2304
+ /** Per-request context exposed to tRPC procedures. */
2305
+ interface CoreContext {
2306
+ services: CoreServices;
2307
+ /** Authenticated session, or null for anonymous requests. */
2308
+ session: AuthSession | null;
2309
+ requestMeta?: SessionMeta;
2310
+ }
2311
+
2312
+ /**
2313
+ * Typed domain errors. Each domain exports its own catalogue
2314
+ * (`domains/<domain>/errors.ts`); the tRPC layer only forwards them —
2315
+ * `trpcCode` carries the transport code, `type` the client-readable
2316
+ * discriminant the UI matches on.
2317
+ */
2318
+ declare const TRPC_CODES: {
2319
+ readonly NOT_FOUND: "NOT_FOUND";
2320
+ readonly BAD_REQUEST: "BAD_REQUEST";
2321
+ readonly FORBIDDEN: "FORBIDDEN";
2322
+ readonly CONFLICT: "CONFLICT";
2323
+ readonly UNAUTHORIZED: "UNAUTHORIZED";
2324
+ readonly TOO_MANY_REQUESTS: "TOO_MANY_REQUESTS";
2325
+ readonly INTERNAL_SERVER_ERROR: "INTERNAL_SERVER_ERROR";
2326
+ };
2327
+ type TrpcErrorCode = (typeof TRPC_CODES)[keyof typeof TRPC_CODES];
2328
+ /** Base class — lets the tRPC mapper test `instanceof DomainError`. */
2329
+ declare abstract class DomainError extends Error {
2330
+ abstract readonly type: string;
2331
+ abstract readonly trpcCode: TrpcErrorCode;
2332
+ }
2333
+ /**
2334
+ * A type and a transport code fully identify an error; the message is optional
2335
+ * context for logs, never user-facing copy — the interface owns the wording.
2336
+ *
2337
+ * export const EntryNotFoundError = createTypedError(
2338
+ * 'entry-not-found-error', TRPC_CODES.NOT_FOUND);
2339
+ * throw new EntryNotFoundError(`entry not found: ${id}`);
2340
+ */
2341
+ declare function createTypedError(type: string, trpcCode: TrpcErrorCode): {
2342
+ new (message?: string): {
2343
+ readonly type: string;
2344
+ readonly trpcCode: TrpcErrorCode;
2345
+ name: string;
2346
+ message: string;
2347
+ stack?: string;
2348
+ cause?: unknown;
2349
+ };
2350
+ isError(error: unknown): error is Error;
2351
+ isError(value: unknown): value is Error;
2352
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
2353
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
2354
+ prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
2355
+ stackTraceLimit: number;
2356
+ };
2357
+
2358
+ declare const organizationRouter: _trpc_server.TRPCBuiltRouter<{
2359
+ ctx: CoreContext;
2360
+ meta: object;
2361
+ errorShape: {
2362
+ data: {
2363
+ type?: string | undefined;
2364
+ code: _trpc_server.TRPC_ERROR_CODE_KEY;
2365
+ httpStatus: number;
2366
+ path?: string;
2367
+ stack?: string;
2368
+ };
2369
+ message: string;
2370
+ code: _trpc_server.TRPC_ERROR_CODE_NUMBER;
2371
+ };
2372
+ transformer: false;
2373
+ }, _trpc_server.TRPCDecorateCreateRouterOptions<{
2374
+ get: _trpc_server.TRPCQueryProcedure<{
2375
+ input: void;
2376
+ output: {
2377
+ type: "commune" | "intercommunality" | "syndicate" | "other";
2378
+ name: string;
2379
+ id: number;
2380
+ slug: string;
2381
+ description: string | null;
2382
+ address: {
2383
+ street?: string | undefined;
2384
+ postalCode?: string | undefined;
2385
+ city?: string | undefined;
2386
+ } | null;
2387
+ deployment: Record<string, unknown> | null;
2388
+ settings: Record<string, unknown> | null;
2389
+ updatedBy: string | null;
2390
+ legacyExtra: Record<string, unknown> | null;
2391
+ createdAt: string;
2392
+ updatedAt: string;
2393
+ } | null;
2394
+ meta: object;
2395
+ }>;
2396
+ init: _trpc_server.TRPCMutationProcedure<{
2397
+ input: {
2398
+ name: string;
2399
+ slug: string;
2400
+ type?: "commune" | "intercommunality" | "syndicate" | "other" | undefined;
2401
+ description?: string | null | undefined;
2402
+ address?: {
2403
+ street?: string | undefined;
2404
+ postalCode?: string | undefined;
2405
+ city?: string | undefined;
2406
+ } | null | undefined;
2407
+ deployment?: Record<string, unknown> | null | undefined;
2408
+ settings?: Record<string, unknown> | null | undefined;
2409
+ };
2410
+ output: {
2411
+ type: "commune" | "intercommunality" | "syndicate" | "other";
2412
+ name: string;
2413
+ id: number;
2414
+ slug: string;
2415
+ description: string | null;
2416
+ address: {
2417
+ street?: string | undefined;
2418
+ postalCode?: string | undefined;
2419
+ city?: string | undefined;
2420
+ } | null;
2421
+ deployment: Record<string, unknown> | null;
2422
+ settings: Record<string, unknown> | null;
2423
+ updatedBy: string | null;
2424
+ legacyExtra: Record<string, unknown> | null;
2425
+ createdAt: string;
2426
+ updatedAt: string;
2427
+ };
2428
+ meta: object;
2429
+ }>;
2430
+ update: _trpc_server.TRPCMutationProcedure<{
2431
+ input: {
2432
+ type?: "commune" | "intercommunality" | "syndicate" | "other" | undefined;
2433
+ name?: string | undefined;
2434
+ slug?: string | undefined;
2435
+ description?: string | null | undefined;
2436
+ address?: {
2437
+ street?: string | undefined;
2438
+ postalCode?: string | undefined;
2439
+ city?: string | undefined;
2440
+ } | null | undefined;
2441
+ deployment?: Record<string, unknown> | null | undefined;
2442
+ settings?: Record<string, unknown> | null | undefined;
2443
+ };
2444
+ output: {
2445
+ type: "commune" | "intercommunality" | "syndicate" | "other";
2446
+ name: string;
2447
+ id: number;
2448
+ slug: string;
2449
+ description: string | null;
2450
+ address: {
2451
+ street?: string | undefined;
2452
+ postalCode?: string | undefined;
2453
+ city?: string | undefined;
2454
+ } | null;
2455
+ deployment: Record<string, unknown> | null;
2456
+ settings: Record<string, unknown> | null;
2457
+ updatedBy: string | null;
2458
+ legacyExtra: Record<string, unknown> | null;
2459
+ createdAt: string;
2460
+ updatedAt: string;
2461
+ };
2462
+ meta: object;
2463
+ }>;
2464
+ deploy: _trpc_server.TRPCMutationProcedure<{
2465
+ input: void;
2466
+ output: {
2467
+ status: number;
2468
+ };
2469
+ meta: object;
2470
+ }>;
2471
+ }>>;
2472
+
2473
+ declare const OrganizationNotInitializedError: {
2474
+ new (message?: string): {
2475
+ readonly type: string;
2476
+ readonly trpcCode: TrpcErrorCode;
2477
+ name: string;
2478
+ message: string;
2479
+ stack?: string;
2480
+ cause?: unknown;
2481
+ };
2482
+ isError(error: unknown): error is Error;
2483
+ isError(value: unknown): value is Error;
2484
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
2485
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
2486
+ prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
2487
+ stackTraceLimit: number;
2488
+ };
2489
+ declare const OrganizationAlreadyInitializedError: {
2490
+ new (message?: string): {
2491
+ readonly type: string;
2492
+ readonly trpcCode: TrpcErrorCode;
2493
+ name: string;
2494
+ message: string;
2495
+ stack?: string;
2496
+ cause?: unknown;
2497
+ };
2498
+ isError(error: unknown): error is Error;
2499
+ isError(value: unknown): value is Error;
2500
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
2501
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
2502
+ prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
2503
+ stackTraceLimit: number;
2504
+ };
2505
+ declare const DeployHookMissingError: {
2506
+ new (message?: string): {
2507
+ readonly type: string;
2508
+ readonly trpcCode: TrpcErrorCode;
2509
+ name: string;
2510
+ message: string;
2511
+ stack?: string;
2512
+ cause?: unknown;
2513
+ };
2514
+ isError(error: unknown): error is Error;
2515
+ isError(value: unknown): value is Error;
2516
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
2517
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
2518
+ prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
2519
+ stackTraceLimit: number;
2520
+ };
2521
+ declare const DeployFailedError: {
2522
+ new (message?: string): {
2523
+ readonly type: string;
2524
+ readonly trpcCode: TrpcErrorCode;
2525
+ name: string;
2526
+ message: string;
2527
+ stack?: string;
2528
+ cause?: unknown;
2529
+ };
2530
+ isError(error: unknown): error is Error;
2531
+ isError(value: unknown): value is Error;
2532
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
2533
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
2534
+ prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
2535
+ stackTraceLimit: number;
2536
+ };
2537
+
2538
+ declare const loginDto: z.ZodObject<{
2539
+ email: z.ZodEmail;
2540
+ password: z.ZodString;
2541
+ }, z.core.$strip>;
2542
+ declare const acceptInvitationDto: z.ZodObject<{
2543
+ token: z.ZodString;
2544
+ name: z.ZodOptional<z.ZodString>;
2545
+ password: z.ZodString;
2546
+ }, z.core.$strip>;
2547
+ declare const requestPasswordResetDto: z.ZodObject<{
2548
+ email: z.ZodEmail;
2549
+ }, z.core.$strip>;
2550
+ type LoginDto = z.infer<typeof loginDto>;
2551
+ type AcceptInvitationDto = z.infer<typeof acceptInvitationDto>;
2552
+ type RequestPasswordResetDto = z.infer<typeof requestPasswordResetDto>;
2553
+
2554
+ declare const inviteDto: z.ZodObject<{
2555
+ email: z.ZodEmail;
2556
+ role: z.ZodEnum<{
2557
+ admin: "admin";
2558
+ redacteur: "redacteur";
2559
+ }>;
2560
+ }, z.core.$strip>;
2561
+ declare const userUpdateDto: z.ZodObject<{
2562
+ id: z.ZodString;
2563
+ data: z.ZodObject<{
2564
+ name: z.ZodOptional<z.ZodString>;
2565
+ role: z.ZodOptional<z.ZodEnum<{
2566
+ admin: "admin";
2567
+ redacteur: "redacteur";
2568
+ }>>;
2569
+ email: z.ZodOptional<z.ZodEmail>;
2570
+ }, z.core.$strip>;
2571
+ }, z.core.$strip>;
2572
+ /** Public projection of a user — the ONLY user shape transport layers return. */
2573
+ declare const toPublicUser: ({ id, email, name, role }: User) => {
2574
+ id: string;
2575
+ email: string;
2576
+ name: string;
2577
+ role: "admin" | "redacteur";
2578
+ };
2579
+ type PublicUser = ReturnType<typeof toPublicUser>;
2580
+ type InviteDto = z.infer<typeof inviteDto>;
2581
+ type UserUpdateDto = z.infer<typeof userUpdateDto>;
2582
+
2583
+ declare const apiTokenCreateDto: z.ZodObject<{
2584
+ name: z.ZodString;
2585
+ }, z.core.$strip>;
2586
+ type ApiTokenCreateDto = z.infer<typeof apiTokenCreateDto>;
2587
+
2588
+ declare const authRouter: _trpc_server.TRPCBuiltRouter<{
2589
+ ctx: CoreContext;
2590
+ meta: object;
2591
+ errorShape: {
2592
+ data: {
2593
+ type?: string | undefined;
2594
+ code: _trpc_server.TRPC_ERROR_CODE_KEY;
2595
+ httpStatus: number;
2596
+ path?: string;
2597
+ stack?: string;
2598
+ };
2599
+ message: string;
2600
+ code: _trpc_server.TRPC_ERROR_CODE_NUMBER;
2601
+ };
2602
+ transformer: false;
2603
+ }, _trpc_server.TRPCDecorateCreateRouterOptions<{
2604
+ /** Login: the opaque token is returned in the body, and the client
2605
+ * sends it back as `Authorization: Bearer <token>`. No cookies. */
2606
+ login: _trpc_server.TRPCMutationProcedure<{
2607
+ input: {
2608
+ email: string;
2609
+ password: string;
2610
+ };
2611
+ output: {
2612
+ token: string;
2613
+ expiresAt: string;
2614
+ user: {
2615
+ id: string;
2616
+ email: string;
2617
+ name: string;
2618
+ role: "admin" | "redacteur";
2619
+ };
2620
+ };
2621
+ meta: object;
2622
+ }>;
2623
+ logout: _trpc_server.TRPCMutationProcedure<{
2624
+ input: void;
2625
+ output: {
2626
+ loggedOut: boolean;
2627
+ };
2628
+ meta: object;
2629
+ }>;
2630
+ me: _trpc_server.TRPCQueryProcedure<{
2631
+ input: void;
2632
+ output: {
2633
+ user: {
2634
+ id: string;
2635
+ email: string;
2636
+ name: string;
2637
+ role: "admin" | "redacteur";
2638
+ };
2639
+ };
2640
+ meta: object;
2641
+ }>;
2642
+ /** Device management: the sessions listed on the account page. */
2643
+ sessions: _trpc_server.TRPCBuiltRouter<{
2644
+ ctx: CoreContext;
2645
+ meta: object;
2646
+ errorShape: {
2647
+ data: {
2648
+ type?: string | undefined;
2649
+ code: _trpc_server.TRPC_ERROR_CODE_KEY;
2650
+ httpStatus: number;
2651
+ path?: string;
2652
+ stack?: string;
2653
+ };
2654
+ message: string;
2655
+ code: _trpc_server.TRPC_ERROR_CODE_NUMBER;
2656
+ };
2657
+ transformer: false;
2658
+ }, _trpc_server.TRPCDecorateCreateRouterOptions<{
2659
+ list: _trpc_server.TRPCQueryProcedure<{
2660
+ input: void;
2661
+ output: {
2662
+ id: string;
2663
+ createdAt: string;
2664
+ expiresAt: string;
2665
+ ua: string | null;
2666
+ ip: string | null;
2667
+ current: boolean;
2668
+ }[];
2669
+ meta: object;
2670
+ }>;
2671
+ revoke: _trpc_server.TRPCMutationProcedure<{
2672
+ input: {
2673
+ id: string;
2674
+ };
2675
+ output: {
2676
+ revoked: string;
2677
+ };
2678
+ meta: object;
2679
+ }>;
2680
+ }>>;
2681
+ /** Consume an invitation link and set the password (public, single-use). */
2682
+ acceptInvitation: _trpc_server.TRPCMutationProcedure<{
2683
+ input: {
2684
+ token: string;
2685
+ password: string;
2686
+ name?: string | undefined;
2687
+ };
2688
+ output: {
2689
+ user: {
2690
+ id: string;
2691
+ email: string;
2692
+ name: string;
2693
+ role: "admin" | "redacteur";
2694
+ };
2695
+ };
2696
+ meta: object;
2697
+ }>;
2698
+ /**
2699
+ * « Forgotten password » — public, and the response is ALWAYS { ok: true }
2700
+ * so it cannot be used to enumerate accounts. The email is only sent when
2701
+ * the account exists.
2702
+ */
2703
+ requestPasswordReset: _trpc_server.TRPCMutationProcedure<{
2704
+ input: {
2705
+ email: string;
2706
+ };
2707
+ output: {
2708
+ ok: boolean;
2709
+ };
2710
+ meta: object;
2711
+ }>;
2712
+ }>>;
2713
+ declare const usersRouter: _trpc_server.TRPCBuiltRouter<{
2714
+ ctx: CoreContext;
2715
+ meta: object;
2716
+ errorShape: {
2717
+ data: {
2718
+ type?: string | undefined;
2719
+ code: _trpc_server.TRPC_ERROR_CODE_KEY;
2720
+ httpStatus: number;
2721
+ path?: string;
2722
+ stack?: string;
2723
+ };
2724
+ message: string;
2725
+ code: _trpc_server.TRPC_ERROR_CODE_NUMBER;
2726
+ };
2727
+ transformer: false;
2728
+ }, _trpc_server.TRPCDecorateCreateRouterOptions<{
2729
+ list: _trpc_server.TRPCQueryProcedure<{
2730
+ input: void;
2731
+ output: {
2732
+ id: string;
2733
+ email: string;
2734
+ name: string;
2735
+ role: "admin" | "redacteur";
2736
+ }[];
2737
+ meta: object;
2738
+ }>;
2739
+ /**
2740
+ * A {id, name} directory readable by any signed-in member: the admin shows
2741
+ * « edited by <name> » on entries, including for editors, who have no access
2742
+ * to users.list.
2743
+ */
2744
+ directory: _trpc_server.TRPCQueryProcedure<{
2745
+ input: void;
2746
+ output: {
2747
+ id: string;
2748
+ name: string;
2749
+ }[];
2750
+ meta: object;
2751
+ }>;
2752
+ /** Read a single user. */
2753
+ get: _trpc_server.TRPCQueryProcedure<{
2754
+ input: {
2755
+ id: string;
2756
+ };
2757
+ output: {
2758
+ id: string;
2759
+ email: string;
2760
+ name: string;
2761
+ role: "admin" | "redacteur";
2762
+ };
2763
+ meta: object;
2764
+ }>;
2765
+ /** Invite a new member — the single-use link is returned to the admin. */
2766
+ invite: _trpc_server.TRPCMutationProcedure<{
2767
+ input: {
2768
+ email: string;
2769
+ role: "admin" | "redacteur";
2770
+ };
2771
+ output: {
2772
+ token: string;
2773
+ expiresAt: string;
2774
+ };
2775
+ meta: object;
2776
+ }>;
2777
+ update: _trpc_server.TRPCMutationProcedure<{
2778
+ input: {
2779
+ id: string;
2780
+ data: {
2781
+ name?: string | undefined;
2782
+ role?: "admin" | "redacteur" | undefined;
2783
+ email?: string | undefined;
2784
+ };
2785
+ };
2786
+ output: {
2787
+ id: string;
2788
+ email: string;
2789
+ name: string;
2790
+ role: "admin" | "redacteur";
2791
+ };
2792
+ meta: object;
2793
+ }>;
2794
+ remove: _trpc_server.TRPCMutationProcedure<{
2795
+ input: {
2796
+ id: string;
2797
+ };
2798
+ output: {
2799
+ removed: string;
2800
+ };
2801
+ meta: object;
2802
+ }>;
2803
+ }>>;
2804
+ declare const apiTokensRouter: _trpc_server.TRPCBuiltRouter<{
2805
+ ctx: CoreContext;
2806
+ meta: object;
2807
+ errorShape: {
2808
+ data: {
2809
+ type?: string | undefined;
2810
+ code: _trpc_server.TRPC_ERROR_CODE_KEY;
2811
+ httpStatus: number;
2812
+ path?: string;
2813
+ stack?: string;
2814
+ };
2815
+ message: string;
2816
+ code: _trpc_server.TRPC_ERROR_CODE_NUMBER;
2817
+ };
2818
+ transformer: false;
2819
+ }, _trpc_server.TRPCDecorateCreateRouterOptions<{
2820
+ list: _trpc_server.TRPCQueryProcedure<{
2821
+ input: void;
2822
+ output: Pick<{
2823
+ name: string;
2824
+ id: string;
2825
+ createdAt: string;
2826
+ revokedAt: string | null;
2827
+ tokenHash: string;
2828
+ lastUsedAt: string | null;
2829
+ }, "name" | "id" | "createdAt" | "revokedAt" | "lastUsedAt">[];
2830
+ meta: object;
2831
+ }>;
2832
+ /** The plaintext token is returned ONCE — only its hash is stored. */
2833
+ create: _trpc_server.TRPCMutationProcedure<{
2834
+ input: {
2835
+ name: string;
2836
+ };
2837
+ output: {
2838
+ token: string;
2839
+ id: string;
2840
+ name: string;
2841
+ };
2842
+ meta: object;
2843
+ }>;
2844
+ revoke: _trpc_server.TRPCMutationProcedure<{
2845
+ input: {
2846
+ id: string;
2847
+ };
2848
+ output: {
2849
+ revoked: string;
2850
+ };
2851
+ meta: object;
2852
+ }>;
2853
+ }>>;
2854
+
2855
+ declare const UserNotFoundError: {
2856
+ new (message?: string): {
2857
+ readonly type: string;
2858
+ readonly trpcCode: TrpcErrorCode;
2859
+ name: string;
2860
+ message: string;
2861
+ stack?: string;
2862
+ cause?: unknown;
2863
+ };
2864
+ isError(error: unknown): error is Error;
2865
+ isError(value: unknown): value is Error;
2866
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
2867
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
2868
+ prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
2869
+ stackTraceLimit: number;
2870
+ };
2871
+ declare const SessionNotFoundError: {
2872
+ new (message?: string): {
2873
+ readonly type: string;
2874
+ readonly trpcCode: TrpcErrorCode;
2875
+ name: string;
2876
+ message: string;
2877
+ stack?: string;
2878
+ cause?: unknown;
2879
+ };
2880
+ isError(error: unknown): error is Error;
2881
+ isError(value: unknown): value is Error;
2882
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
2883
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
2884
+ prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
2885
+ stackTraceLimit: number;
2886
+ };
2887
+ declare const InvitationInvalidError: {
2888
+ new (message?: string): {
2889
+ readonly type: string;
2890
+ readonly trpcCode: TrpcErrorCode;
2891
+ name: string;
2892
+ message: string;
2893
+ stack?: string;
2894
+ cause?: unknown;
2895
+ };
2896
+ isError(error: unknown): error is Error;
2897
+ isError(value: unknown): value is Error;
2898
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
2899
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
2900
+ prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
2901
+ stackTraceLimit: number;
2902
+ };
2903
+ declare const CannotRemoveSelfError: {
2904
+ new (message?: string): {
2905
+ readonly type: string;
2906
+ readonly trpcCode: TrpcErrorCode;
2907
+ name: string;
2908
+ message: string;
2909
+ stack?: string;
2910
+ cause?: unknown;
2911
+ };
2912
+ isError(error: unknown): error is Error;
2913
+ isError(value: unknown): value is Error;
2914
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
2915
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
2916
+ prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
2917
+ stackTraceLimit: number;
2918
+ };
2919
+ /** Throttled on ONE account — distinct from bad credentials: we refuse to try. */
2920
+ declare const TooManyAttemptsError: {
2921
+ new (message?: string): {
2922
+ readonly type: string;
2923
+ readonly trpcCode: TrpcErrorCode;
2924
+ name: string;
2925
+ message: string;
2926
+ stack?: string;
2927
+ cause?: unknown;
2928
+ };
2929
+ isError(error: unknown): error is Error;
2930
+ isError(value: unknown): value is Error;
2931
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
2932
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
2933
+ prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
2934
+ stackTraceLimit: number;
2935
+ };
2936
+
2937
+ declare const mediaRouter: _trpc_server.TRPCBuiltRouter<{
2938
+ ctx: CoreContext;
2939
+ meta: object;
2940
+ errorShape: {
2941
+ data: {
2942
+ type?: string | undefined;
2943
+ code: _trpc_server.TRPC_ERROR_CODE_KEY;
2944
+ httpStatus: number;
2945
+ path?: string;
2946
+ stack?: string;
2947
+ };
2948
+ message: string;
2949
+ code: _trpc_server.TRPC_ERROR_CODE_NUMBER;
2950
+ };
2951
+ transformer: false;
2952
+ }, _trpc_server.TRPCDecorateCreateRouterOptions<{
2953
+ requestUpload: _trpc_server.TRPCMutationProcedure<{
2954
+ input: {
2955
+ filename: string;
2956
+ mime: string;
2957
+ metaData?: Record<string, string> | undefined;
2958
+ };
2959
+ output: {
2960
+ key: string;
2961
+ url: string;
2962
+ };
2963
+ meta: object;
2964
+ }>;
2965
+ finalize: _trpc_server.TRPCMutationProcedure<{
2966
+ input: {
2967
+ key: string;
2968
+ filename: string;
2969
+ mime: string;
2970
+ alt?: string | undefined;
2971
+ metaData?: Record<string, unknown> | undefined;
2972
+ };
2973
+ output: {
2974
+ filename: string;
2975
+ id: string;
2976
+ updatedBy: string | null;
2977
+ legacyExtra: Record<string, unknown> | null;
2978
+ createdAt: string;
2979
+ updatedAt: string;
2980
+ mime: string;
2981
+ size: number;
2982
+ alt: string | null;
2983
+ caption: string | null;
2984
+ objects: Record<string, unknown>;
2985
+ metaData: Record<string, unknown> | null;
2986
+ createdBy: string | null;
2987
+ };
2988
+ meta: object;
2989
+ }>;
2990
+ list: _trpc_server.TRPCQueryProcedure<{
2991
+ input: void;
2992
+ output: ({
2993
+ filename: string;
2994
+ id: string;
2995
+ updatedBy: string | null;
2996
+ legacyExtra: Record<string, unknown> | null;
2997
+ createdAt: string;
2998
+ updatedAt: string;
2999
+ mime: string;
3000
+ size: number;
3001
+ alt: string | null;
3002
+ caption: string | null;
3003
+ objects: Record<string, unknown>;
3004
+ metaData: Record<string, unknown> | null;
3005
+ createdBy: string | null;
3006
+ } & {
3007
+ objects: Record<string, string>;
3008
+ })[];
3009
+ meta: object;
3010
+ }>;
3011
+ get: _trpc_server.TRPCQueryProcedure<{
3012
+ input: {
3013
+ id: string;
3014
+ };
3015
+ output: {
3016
+ filename: string;
3017
+ id: string;
3018
+ updatedBy: string | null;
3019
+ legacyExtra: Record<string, unknown> | null;
3020
+ createdAt: string;
3021
+ updatedAt: string;
3022
+ mime: string;
3023
+ size: number;
3024
+ alt: string | null;
3025
+ caption: string | null;
3026
+ objects: Record<string, unknown>;
3027
+ metaData: Record<string, unknown> | null;
3028
+ createdBy: string | null;
3029
+ } & {
3030
+ objects: Record<string, string>;
3031
+ };
3032
+ meta: object;
3033
+ }>;
3034
+ update: _trpc_server.TRPCMutationProcedure<{
3035
+ input: {
3036
+ id: string;
3037
+ data: {
3038
+ filename?: string | undefined;
3039
+ alt?: string | null | undefined;
3040
+ caption?: string | null | undefined;
3041
+ };
3042
+ };
3043
+ output: {
3044
+ filename: string;
3045
+ id: string;
3046
+ updatedBy: string | null;
3047
+ legacyExtra: Record<string, unknown> | null;
3048
+ createdAt: string;
3049
+ updatedAt: string;
3050
+ mime: string;
3051
+ size: number;
3052
+ alt: string | null;
3053
+ caption: string | null;
3054
+ objects: Record<string, unknown>;
3055
+ metaData: Record<string, unknown> | null;
3056
+ createdBy: string | null;
3057
+ };
3058
+ meta: object;
3059
+ }>;
3060
+ remove: _trpc_server.TRPCMutationProcedure<{
3061
+ input: {
3062
+ id: string;
3063
+ };
3064
+ output: {
3065
+ removed: string;
3066
+ };
3067
+ meta: object;
3068
+ }>;
3069
+ }>>;
3070
+
3071
+ declare const MediaNotFoundError: {
3072
+ new (message?: string): {
3073
+ readonly type: string;
3074
+ readonly trpcCode: TrpcErrorCode;
3075
+ name: string;
3076
+ message: string;
3077
+ stack?: string;
3078
+ cause?: unknown;
3079
+ };
3080
+ isError(error: unknown): error is Error;
3081
+ isError(value: unknown): value is Error;
3082
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
3083
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
3084
+ prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
3085
+ stackTraceLimit: number;
3086
+ };
3087
+ declare const UnsupportedMimeError: {
3088
+ new (message?: string): {
3089
+ readonly type: string;
3090
+ readonly trpcCode: TrpcErrorCode;
3091
+ name: string;
3092
+ message: string;
3093
+ stack?: string;
3094
+ cause?: unknown;
3095
+ };
3096
+ isError(error: unknown): error is Error;
3097
+ isError(value: unknown): value is Error;
3098
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
3099
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
3100
+ prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
3101
+ stackTraceLimit: number;
3102
+ };
3103
+ declare const UploadIncompleteError: {
3104
+ new (message?: string): {
3105
+ readonly type: string;
3106
+ readonly trpcCode: TrpcErrorCode;
3107
+ name: string;
3108
+ message: string;
3109
+ stack?: string;
3110
+ cause?: unknown;
3111
+ };
3112
+ isError(error: unknown): error is Error;
3113
+ isError(value: unknown): value is Error;
3114
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
3115
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
3116
+ prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
3117
+ stackTraceLimit: number;
3118
+ };
3119
+
3120
+ declare const collectionsRouter: _trpc_server.TRPCBuiltRouter<{
3121
+ ctx: CoreContext;
3122
+ meta: object;
3123
+ errorShape: {
3124
+ data: {
3125
+ type?: string | undefined;
3126
+ code: _trpc_server.TRPC_ERROR_CODE_KEY;
3127
+ httpStatus: number;
3128
+ path?: string;
3129
+ stack?: string;
3130
+ };
3131
+ message: string;
3132
+ code: _trpc_server.TRPC_ERROR_CODE_NUMBER;
3133
+ };
3134
+ transformer: false;
3135
+ }, _trpc_server.TRPCDecorateCreateRouterOptions<{
3136
+ list: _trpc_server.TRPCQueryProcedure<{
3137
+ input: void;
3138
+ output: {
3139
+ name: string;
3140
+ id: string;
3141
+ slug: string;
3142
+ description: string | null;
3143
+ updatedBy: string | null;
3144
+ legacyExtra: Record<string, unknown> | null;
3145
+ createdAt: string;
3146
+ updatedAt: string;
3147
+ createdBy: string | null;
3148
+ fields: {
3149
+ name: string;
3150
+ label: string;
3151
+ type: "number" | "boolean" | "text" | "rich-text" | "date" | "media" | "relation" | "select" | "steps" | "json";
3152
+ required: boolean;
3153
+ hidden: boolean;
3154
+ options?: string[] | undefined;
3155
+ target?: string | undefined;
3156
+ }[];
3157
+ editor: Record<string, unknown> | null;
3158
+ display: Record<string, unknown> | null;
3159
+ headings: Record<string, unknown> | null;
3160
+ }[];
3161
+ meta: object;
3162
+ }>;
3163
+ get: _trpc_server.TRPCQueryProcedure<{
3164
+ input: {
3165
+ idOrSlug: string;
3166
+ };
3167
+ output: {
3168
+ name: string;
3169
+ id: string;
3170
+ slug: string;
3171
+ description: string | null;
3172
+ updatedBy: string | null;
3173
+ legacyExtra: Record<string, unknown> | null;
3174
+ createdAt: string;
3175
+ updatedAt: string;
3176
+ createdBy: string | null;
3177
+ fields: {
3178
+ name: string;
3179
+ label: string;
3180
+ type: "number" | "boolean" | "text" | "rich-text" | "date" | "media" | "relation" | "select" | "steps" | "json";
3181
+ required: boolean;
3182
+ hidden: boolean;
3183
+ options?: string[] | undefined;
3184
+ target?: string | undefined;
3185
+ }[];
3186
+ editor: Record<string, unknown> | null;
3187
+ display: Record<string, unknown> | null;
3188
+ headings: Record<string, unknown> | null;
3189
+ };
3190
+ meta: object;
3191
+ }>;
3192
+ create: _trpc_server.TRPCMutationProcedure<{
3193
+ input: {
3194
+ name: string;
3195
+ fields: {
3196
+ name: string;
3197
+ label: string;
3198
+ type: "number" | "boolean" | "text" | "rich-text" | "date" | "media" | "relation" | "select" | "steps" | "json";
3199
+ required?: boolean | undefined;
3200
+ hidden?: boolean | undefined;
3201
+ options?: string[] | undefined;
3202
+ target?: string | undefined;
3203
+ }[];
3204
+ description?: string | null | undefined;
3205
+ editor?: Record<string, unknown> | null | undefined;
3206
+ display?: Record<string, unknown> | null | undefined;
3207
+ headings?: Record<string, unknown> | null | undefined;
3208
+ slug?: string | undefined;
3209
+ };
3210
+ output: {
3211
+ name: string;
3212
+ id: string;
3213
+ slug: string;
3214
+ description: string | null;
3215
+ updatedBy: string | null;
3216
+ legacyExtra: Record<string, unknown> | null;
3217
+ createdAt: string;
3218
+ updatedAt: string;
3219
+ createdBy: string | null;
3220
+ fields: {
3221
+ name: string;
3222
+ label: string;
3223
+ type: "number" | "boolean" | "text" | "rich-text" | "date" | "media" | "relation" | "select" | "steps" | "json";
3224
+ required: boolean;
3225
+ hidden: boolean;
3226
+ options?: string[] | undefined;
3227
+ target?: string | undefined;
3228
+ }[];
3229
+ editor: Record<string, unknown> | null;
3230
+ display: Record<string, unknown> | null;
3231
+ headings: Record<string, unknown> | null;
3232
+ };
3233
+ meta: object;
3234
+ }>;
3235
+ update: _trpc_server.TRPCMutationProcedure<{
3236
+ input: {
3237
+ id: string;
3238
+ data: {
3239
+ name?: string | undefined;
3240
+ slug?: string | undefined;
3241
+ description?: string | null | undefined;
3242
+ editor?: Record<string, unknown> | null | undefined;
3243
+ display?: Record<string, unknown> | null | undefined;
3244
+ headings?: Record<string, unknown> | null | undefined;
3245
+ fields?: {
3246
+ name: string;
3247
+ label: string;
3248
+ type: "number" | "boolean" | "text" | "rich-text" | "date" | "media" | "relation" | "select" | "steps" | "json";
3249
+ required?: boolean | undefined;
3250
+ hidden?: boolean | undefined;
3251
+ options?: string[] | undefined;
3252
+ target?: string | undefined;
3253
+ }[] | undefined;
3254
+ };
3255
+ };
3256
+ output: {
3257
+ name: string;
3258
+ id: string;
3259
+ slug: string;
3260
+ description: string | null;
3261
+ updatedBy: string | null;
3262
+ legacyExtra: Record<string, unknown> | null;
3263
+ createdAt: string;
3264
+ updatedAt: string;
3265
+ createdBy: string | null;
3266
+ fields: {
3267
+ name: string;
3268
+ label: string;
3269
+ type: "number" | "boolean" | "text" | "rich-text" | "date" | "media" | "relation" | "select" | "steps" | "json";
3270
+ required: boolean;
3271
+ hidden: boolean;
3272
+ options?: string[] | undefined;
3273
+ target?: string | undefined;
3274
+ }[];
3275
+ editor: Record<string, unknown> | null;
3276
+ display: Record<string, unknown> | null;
3277
+ headings: Record<string, unknown> | null;
3278
+ };
3279
+ meta: object;
3280
+ }>;
3281
+ remove: _trpc_server.TRPCMutationProcedure<{
3282
+ input: {
3283
+ id: string;
3284
+ };
3285
+ output: {
3286
+ removed: string;
3287
+ };
3288
+ meta: object;
3289
+ }>;
3290
+ entries: _trpc_server.TRPCBuiltRouter<{
3291
+ ctx: CoreContext;
3292
+ meta: object;
3293
+ errorShape: {
3294
+ data: {
3295
+ type?: string | undefined;
3296
+ code: _trpc_server.TRPC_ERROR_CODE_KEY;
3297
+ httpStatus: number;
3298
+ path?: string;
3299
+ stack?: string;
3300
+ };
3301
+ message: string;
3302
+ code: _trpc_server.TRPC_ERROR_CODE_NUMBER;
3303
+ };
3304
+ transformer: false;
3305
+ }, _trpc_server.TRPCDecorateCreateRouterOptions<{
3306
+ get: _trpc_server.TRPCQueryProcedure<{
3307
+ input: {
3308
+ id: string;
3309
+ };
3310
+ output: {
3311
+ id: string;
3312
+ data: Record<string, unknown>;
3313
+ slug: string;
3314
+ updatedBy: string | null;
3315
+ legacyExtra: Record<string, unknown> | null;
3316
+ createdAt: string;
3317
+ updatedAt: string;
3318
+ createdBy: string | null;
3319
+ collectionId: string;
3320
+ title: string;
3321
+ related: string[] | null;
3322
+ status: "draft" | "waiting" | "ready" | "scheduled" | "published";
3323
+ publishedAt: string | null;
3324
+ };
3325
+ meta: object;
3326
+ }>;
3327
+ list: _trpc_server.TRPCQueryProcedure<{
3328
+ input: {
3329
+ collectionId: string;
3330
+ skip?: number | undefined;
3331
+ limit?: number | undefined;
3332
+ };
3333
+ output: {
3334
+ id: string;
3335
+ data: Record<string, unknown>;
3336
+ slug: string;
3337
+ updatedBy: string | null;
3338
+ legacyExtra: Record<string, unknown> | null;
3339
+ createdAt: string;
3340
+ updatedAt: string;
3341
+ createdBy: string | null;
3342
+ collectionId: string;
3343
+ title: string;
3344
+ related: string[] | null;
3345
+ status: "draft" | "waiting" | "ready" | "scheduled" | "published";
3346
+ publishedAt: string | null;
3347
+ }[];
3348
+ meta: object;
3349
+ }>;
3350
+ create: _trpc_server.TRPCMutationProcedure<{
3351
+ input: {
3352
+ collectionId: string;
3353
+ data: {
3354
+ data: Record<string, unknown>;
3355
+ title: string;
3356
+ status?: "draft" | "waiting" | "ready" | "scheduled" | "published" | undefined;
3357
+ publishedAt?: string | null | undefined;
3358
+ slug?: string | undefined;
3359
+ };
3360
+ };
3361
+ output: {
3362
+ id: string;
3363
+ data: Record<string, unknown>;
3364
+ slug: string;
3365
+ updatedBy: string | null;
3366
+ legacyExtra: Record<string, unknown> | null;
3367
+ createdAt: string;
3368
+ updatedAt: string;
3369
+ createdBy: string | null;
3370
+ collectionId: string;
3371
+ title: string;
3372
+ related: string[] | null;
3373
+ status: "draft" | "waiting" | "ready" | "scheduled" | "published";
3374
+ publishedAt: string | null;
3375
+ };
3376
+ meta: object;
3377
+ }>;
3378
+ update: _trpc_server.TRPCMutationProcedure<{
3379
+ input: {
3380
+ id: string;
3381
+ data: {
3382
+ data?: Record<string, unknown> | undefined;
3383
+ slug?: string | undefined;
3384
+ title?: string | undefined;
3385
+ status?: "draft" | "waiting" | "ready" | "scheduled" | "published" | undefined;
3386
+ publishedAt?: string | null | undefined;
3387
+ related?: string[] | undefined;
3388
+ };
3389
+ };
3390
+ output: {
3391
+ id: string;
3392
+ data: Record<string, unknown>;
3393
+ slug: string;
3394
+ updatedBy: string | null;
3395
+ legacyExtra: Record<string, unknown> | null;
3396
+ createdAt: string;
3397
+ updatedAt: string;
3398
+ createdBy: string | null;
3399
+ collectionId: string;
3400
+ title: string;
3401
+ related: string[] | null;
3402
+ status: "draft" | "waiting" | "ready" | "scheduled" | "published";
3403
+ publishedAt: string | null;
3404
+ };
3405
+ meta: object;
3406
+ }>;
3407
+ remove: _trpc_server.TRPCMutationProcedure<{
3408
+ input: {
3409
+ id: string;
3410
+ };
3411
+ output: {
3412
+ removed: string;
3413
+ };
3414
+ meta: object;
3415
+ }>;
3416
+ }>>;
3417
+ }>>;
3418
+
3419
+ declare const CollectionNotFoundError: {
3420
+ new (message?: string): {
3421
+ readonly type: string;
3422
+ readonly trpcCode: TrpcErrorCode;
3423
+ name: string;
3424
+ message: string;
3425
+ stack?: string;
3426
+ cause?: unknown;
3427
+ };
3428
+ isError(error: unknown): error is Error;
3429
+ isError(value: unknown): value is Error;
3430
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
3431
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
3432
+ prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
3433
+ stackTraceLimit: number;
3434
+ };
3435
+ declare const EntryNotFoundError: {
3436
+ new (message?: string): {
3437
+ readonly type: string;
3438
+ readonly trpcCode: TrpcErrorCode;
3439
+ name: string;
3440
+ message: string;
3441
+ stack?: string;
3442
+ cause?: unknown;
3443
+ };
3444
+ isError(error: unknown): error is Error;
3445
+ isError(value: unknown): value is Error;
3446
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
3447
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
3448
+ prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
3449
+ stackTraceLimit: number;
3450
+ };
3451
+ declare const InvalidEntryDataError: {
3452
+ new (message?: string): {
3453
+ readonly type: string;
3454
+ readonly trpcCode: TrpcErrorCode;
3455
+ name: string;
3456
+ message: string;
3457
+ stack?: string;
3458
+ cause?: unknown;
3459
+ };
3460
+ isError(error: unknown): error is Error;
3461
+ isError(value: unknown): value is Error;
3462
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
3463
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
3464
+ prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
3465
+ stackTraceLimit: number;
3466
+ };
3467
+ declare const DuplicateSlugError: {
3468
+ new (message?: string): {
3469
+ readonly type: string;
3470
+ readonly trpcCode: TrpcErrorCode;
3471
+ name: string;
3472
+ message: string;
3473
+ stack?: string;
3474
+ cause?: unknown;
3475
+ };
3476
+ isError(error: unknown): error is Error;
3477
+ isError(value: unknown): value is Error;
3478
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
3479
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
3480
+ prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
3481
+ stackTraceLimit: number;
3482
+ };
3483
+
3484
+ declare function createCore({ env }?: {
3485
+ env?: CoreEnv;
3486
+ }): Core;
3487
+ declare const appRouter: _trpc_server.TRPCBuiltRouter<{
3488
+ ctx: CoreContext;
3489
+ meta: object;
3490
+ errorShape: {
3491
+ data: {
3492
+ type?: string | undefined;
3493
+ code: _trpc_server.TRPC_ERROR_CODE_KEY;
3494
+ httpStatus: number;
3495
+ path?: string;
3496
+ stack?: string;
3497
+ };
3498
+ message: string;
3499
+ code: _trpc_server.TRPC_ERROR_CODE_NUMBER;
3500
+ };
3501
+ transformer: false;
3502
+ }, _trpc_server.TRPCDecorateCreateRouterOptions<{
3503
+ health: _trpc_server.TRPCBuiltRouter<{
3504
+ ctx: CoreContext;
3505
+ meta: object;
3506
+ errorShape: {
3507
+ data: {
3508
+ type?: string | undefined;
3509
+ code: _trpc_server.TRPC_ERROR_CODE_KEY;
3510
+ httpStatus: number;
3511
+ path?: string;
3512
+ stack?: string;
3513
+ };
3514
+ message: string;
3515
+ code: _trpc_server.TRPC_ERROR_CODE_NUMBER;
3516
+ };
3517
+ transformer: false;
3518
+ }, _trpc_server.TRPCDecorateCreateRouterOptions<{
3519
+ ping: _trpc_server.TRPCQueryProcedure<{
3520
+ input: void;
3521
+ output: HealthStatus;
3522
+ meta: object;
3523
+ }>;
3524
+ }>>;
3525
+ auth: _trpc_server.TRPCBuiltRouter<{
3526
+ ctx: CoreContext;
3527
+ meta: object;
3528
+ errorShape: {
3529
+ data: {
3530
+ type?: string | undefined;
3531
+ code: _trpc_server.TRPC_ERROR_CODE_KEY;
3532
+ httpStatus: number;
3533
+ path?: string;
3534
+ stack?: string;
3535
+ };
3536
+ message: string;
3537
+ code: _trpc_server.TRPC_ERROR_CODE_NUMBER;
3538
+ };
3539
+ transformer: false;
3540
+ }, _trpc_server.TRPCDecorateCreateRouterOptions<{
3541
+ login: _trpc_server.TRPCMutationProcedure<{
3542
+ input: {
3543
+ email: string;
3544
+ password: string;
3545
+ };
3546
+ output: {
3547
+ token: string;
3548
+ expiresAt: string;
3549
+ user: {
3550
+ id: string;
3551
+ email: string;
3552
+ name: string;
3553
+ role: "admin" | "redacteur";
3554
+ };
3555
+ };
3556
+ meta: object;
3557
+ }>;
3558
+ logout: _trpc_server.TRPCMutationProcedure<{
3559
+ input: void;
3560
+ output: {
3561
+ loggedOut: boolean;
3562
+ };
3563
+ meta: object;
3564
+ }>;
3565
+ me: _trpc_server.TRPCQueryProcedure<{
3566
+ input: void;
3567
+ output: {
3568
+ user: {
3569
+ id: string;
3570
+ email: string;
3571
+ name: string;
3572
+ role: "admin" | "redacteur";
3573
+ };
3574
+ };
3575
+ meta: object;
3576
+ }>;
3577
+ sessions: _trpc_server.TRPCBuiltRouter<{
3578
+ ctx: CoreContext;
3579
+ meta: object;
3580
+ errorShape: {
3581
+ data: {
3582
+ type?: string | undefined;
3583
+ code: _trpc_server.TRPC_ERROR_CODE_KEY;
3584
+ httpStatus: number;
3585
+ path?: string;
3586
+ stack?: string;
3587
+ };
3588
+ message: string;
3589
+ code: _trpc_server.TRPC_ERROR_CODE_NUMBER;
3590
+ };
3591
+ transformer: false;
3592
+ }, _trpc_server.TRPCDecorateCreateRouterOptions<{
3593
+ list: _trpc_server.TRPCQueryProcedure<{
3594
+ input: void;
3595
+ output: {
3596
+ id: string;
3597
+ createdAt: string;
3598
+ expiresAt: string;
3599
+ ua: string | null;
3600
+ ip: string | null;
3601
+ current: boolean;
3602
+ }[];
3603
+ meta: object;
3604
+ }>;
3605
+ revoke: _trpc_server.TRPCMutationProcedure<{
3606
+ input: {
3607
+ id: string;
3608
+ };
3609
+ output: {
3610
+ revoked: string;
3611
+ };
3612
+ meta: object;
3613
+ }>;
3614
+ }>>;
3615
+ acceptInvitation: _trpc_server.TRPCMutationProcedure<{
3616
+ input: {
3617
+ token: string;
3618
+ password: string;
3619
+ name?: string | undefined;
3620
+ };
3621
+ output: {
3622
+ user: {
3623
+ id: string;
3624
+ email: string;
3625
+ name: string;
3626
+ role: "admin" | "redacteur";
3627
+ };
3628
+ };
3629
+ meta: object;
3630
+ }>;
3631
+ requestPasswordReset: _trpc_server.TRPCMutationProcedure<{
3632
+ input: {
3633
+ email: string;
3634
+ };
3635
+ output: {
3636
+ ok: boolean;
3637
+ };
3638
+ meta: object;
3639
+ }>;
3640
+ }>>;
3641
+ users: _trpc_server.TRPCBuiltRouter<{
3642
+ ctx: CoreContext;
3643
+ meta: object;
3644
+ errorShape: {
3645
+ data: {
3646
+ type?: string | undefined;
3647
+ code: _trpc_server.TRPC_ERROR_CODE_KEY;
3648
+ httpStatus: number;
3649
+ path?: string;
3650
+ stack?: string;
3651
+ };
3652
+ message: string;
3653
+ code: _trpc_server.TRPC_ERROR_CODE_NUMBER;
3654
+ };
3655
+ transformer: false;
3656
+ }, _trpc_server.TRPCDecorateCreateRouterOptions<{
3657
+ list: _trpc_server.TRPCQueryProcedure<{
3658
+ input: void;
3659
+ output: {
3660
+ id: string;
3661
+ email: string;
3662
+ name: string;
3663
+ role: "admin" | "redacteur";
3664
+ }[];
3665
+ meta: object;
3666
+ }>;
3667
+ directory: _trpc_server.TRPCQueryProcedure<{
3668
+ input: void;
3669
+ output: {
3670
+ id: string;
3671
+ name: string;
3672
+ }[];
3673
+ meta: object;
3674
+ }>;
3675
+ get: _trpc_server.TRPCQueryProcedure<{
3676
+ input: {
3677
+ id: string;
3678
+ };
3679
+ output: {
3680
+ id: string;
3681
+ email: string;
3682
+ name: string;
3683
+ role: "admin" | "redacteur";
3684
+ };
3685
+ meta: object;
3686
+ }>;
3687
+ invite: _trpc_server.TRPCMutationProcedure<{
3688
+ input: {
3689
+ email: string;
3690
+ role: "admin" | "redacteur";
3691
+ };
3692
+ output: {
3693
+ token: string;
3694
+ expiresAt: string;
3695
+ };
3696
+ meta: object;
3697
+ }>;
3698
+ update: _trpc_server.TRPCMutationProcedure<{
3699
+ input: {
3700
+ id: string;
3701
+ data: {
3702
+ name?: string | undefined;
3703
+ role?: "admin" | "redacteur" | undefined;
3704
+ email?: string | undefined;
3705
+ };
3706
+ };
3707
+ output: {
3708
+ id: string;
3709
+ email: string;
3710
+ name: string;
3711
+ role: "admin" | "redacteur";
3712
+ };
3713
+ meta: object;
3714
+ }>;
3715
+ remove: _trpc_server.TRPCMutationProcedure<{
3716
+ input: {
3717
+ id: string;
3718
+ };
3719
+ output: {
3720
+ removed: string;
3721
+ };
3722
+ meta: object;
3723
+ }>;
3724
+ }>>;
3725
+ apiTokens: _trpc_server.TRPCBuiltRouter<{
3726
+ ctx: CoreContext;
3727
+ meta: object;
3728
+ errorShape: {
3729
+ data: {
3730
+ type?: string | undefined;
3731
+ code: _trpc_server.TRPC_ERROR_CODE_KEY;
3732
+ httpStatus: number;
3733
+ path?: string;
3734
+ stack?: string;
3735
+ };
3736
+ message: string;
3737
+ code: _trpc_server.TRPC_ERROR_CODE_NUMBER;
3738
+ };
3739
+ transformer: false;
3740
+ }, _trpc_server.TRPCDecorateCreateRouterOptions<{
3741
+ list: _trpc_server.TRPCQueryProcedure<{
3742
+ input: void;
3743
+ output: Pick<{
3744
+ id: string;
3745
+ name: string;
3746
+ createdAt: string;
3747
+ revokedAt: string | null;
3748
+ tokenHash: string;
3749
+ lastUsedAt: string | null;
3750
+ }, "id" | "name" | "createdAt" | "revokedAt" | "lastUsedAt">[];
3751
+ meta: object;
3752
+ }>;
3753
+ create: _trpc_server.TRPCMutationProcedure<{
3754
+ input: {
3755
+ name: string;
3756
+ };
3757
+ output: {
3758
+ token: string;
3759
+ id: string;
3760
+ name: string;
3761
+ };
3762
+ meta: object;
3763
+ }>;
3764
+ revoke: _trpc_server.TRPCMutationProcedure<{
3765
+ input: {
3766
+ id: string;
3767
+ };
3768
+ output: {
3769
+ revoked: string;
3770
+ };
3771
+ meta: object;
3772
+ }>;
3773
+ }>>;
3774
+ organization: _trpc_server.TRPCBuiltRouter<{
3775
+ ctx: CoreContext;
3776
+ meta: object;
3777
+ errorShape: {
3778
+ data: {
3779
+ type?: string | undefined;
3780
+ code: _trpc_server.TRPC_ERROR_CODE_KEY;
3781
+ httpStatus: number;
3782
+ path?: string;
3783
+ stack?: string;
3784
+ };
3785
+ message: string;
3786
+ code: _trpc_server.TRPC_ERROR_CODE_NUMBER;
3787
+ };
3788
+ transformer: false;
3789
+ }, _trpc_server.TRPCDecorateCreateRouterOptions<{
3790
+ get: _trpc_server.TRPCQueryProcedure<{
3791
+ input: void;
3792
+ output: {
3793
+ type: "commune" | "intercommunality" | "syndicate" | "other";
3794
+ description: string | null;
3795
+ id: number;
3796
+ name: string;
3797
+ createdAt: string;
3798
+ updatedAt: string;
3799
+ slug: string;
3800
+ address: {
3801
+ street?: string | undefined;
3802
+ postalCode?: string | undefined;
3803
+ city?: string | undefined;
3804
+ } | null;
3805
+ deployment: Record<string, unknown> | null;
3806
+ settings: Record<string, unknown> | null;
3807
+ updatedBy: string | null;
3808
+ legacyExtra: Record<string, unknown> | null;
3809
+ } | null;
3810
+ meta: object;
3811
+ }>;
3812
+ init: _trpc_server.TRPCMutationProcedure<{
3813
+ input: {
3814
+ name: string;
3815
+ slug: string;
3816
+ type?: "commune" | "intercommunality" | "syndicate" | "other" | undefined;
3817
+ description?: string | null | undefined;
3818
+ address?: {
3819
+ street?: string | undefined;
3820
+ postalCode?: string | undefined;
3821
+ city?: string | undefined;
3822
+ } | null | undefined;
3823
+ deployment?: Record<string, unknown> | null | undefined;
3824
+ settings?: Record<string, unknown> | null | undefined;
3825
+ };
3826
+ output: {
3827
+ type: "commune" | "intercommunality" | "syndicate" | "other";
3828
+ description: string | null;
3829
+ id: number;
3830
+ name: string;
3831
+ createdAt: string;
3832
+ updatedAt: string;
3833
+ slug: string;
3834
+ address: {
3835
+ street?: string | undefined;
3836
+ postalCode?: string | undefined;
3837
+ city?: string | undefined;
3838
+ } | null;
3839
+ deployment: Record<string, unknown> | null;
3840
+ settings: Record<string, unknown> | null;
3841
+ updatedBy: string | null;
3842
+ legacyExtra: Record<string, unknown> | null;
3843
+ };
3844
+ meta: object;
3845
+ }>;
3846
+ update: _trpc_server.TRPCMutationProcedure<{
3847
+ input: {
3848
+ type?: "commune" | "intercommunality" | "syndicate" | "other" | undefined;
3849
+ description?: string | null | undefined;
3850
+ name?: string | undefined;
3851
+ slug?: string | undefined;
3852
+ address?: {
3853
+ street?: string | undefined;
3854
+ postalCode?: string | undefined;
3855
+ city?: string | undefined;
3856
+ } | null | undefined;
3857
+ deployment?: Record<string, unknown> | null | undefined;
3858
+ settings?: Record<string, unknown> | null | undefined;
3859
+ };
3860
+ output: {
3861
+ type: "commune" | "intercommunality" | "syndicate" | "other";
3862
+ description: string | null;
3863
+ id: number;
3864
+ name: string;
3865
+ createdAt: string;
3866
+ updatedAt: string;
3867
+ slug: string;
3868
+ address: {
3869
+ street?: string | undefined;
3870
+ postalCode?: string | undefined;
3871
+ city?: string | undefined;
3872
+ } | null;
3873
+ deployment: Record<string, unknown> | null;
3874
+ settings: Record<string, unknown> | null;
3875
+ updatedBy: string | null;
3876
+ legacyExtra: Record<string, unknown> | null;
3877
+ };
3878
+ meta: object;
3879
+ }>;
3880
+ deploy: _trpc_server.TRPCMutationProcedure<{
3881
+ input: void;
3882
+ output: {
3883
+ status: number;
3884
+ };
3885
+ meta: object;
3886
+ }>;
3887
+ }>>;
3888
+ media: _trpc_server.TRPCBuiltRouter<{
3889
+ ctx: CoreContext;
3890
+ meta: object;
3891
+ errorShape: {
3892
+ data: {
3893
+ type?: string | undefined;
3894
+ code: _trpc_server.TRPC_ERROR_CODE_KEY;
3895
+ httpStatus: number;
3896
+ path?: string;
3897
+ stack?: string;
3898
+ };
3899
+ message: string;
3900
+ code: _trpc_server.TRPC_ERROR_CODE_NUMBER;
3901
+ };
3902
+ transformer: false;
3903
+ }, _trpc_server.TRPCDecorateCreateRouterOptions<{
3904
+ requestUpload: _trpc_server.TRPCMutationProcedure<{
3905
+ input: {
3906
+ filename: string;
3907
+ mime: string;
3908
+ metaData?: Record<string, string> | undefined;
3909
+ };
3910
+ output: {
3911
+ key: string;
3912
+ url: string;
3913
+ };
3914
+ meta: object;
3915
+ }>;
3916
+ finalize: _trpc_server.TRPCMutationProcedure<{
3917
+ input: {
3918
+ key: string;
3919
+ filename: string;
3920
+ mime: string;
3921
+ alt?: string | undefined;
3922
+ metaData?: Record<string, unknown> | undefined;
3923
+ };
3924
+ output: {
3925
+ id: string;
3926
+ createdAt: string;
3927
+ updatedAt: string;
3928
+ updatedBy: string | null;
3929
+ legacyExtra: Record<string, unknown> | null;
3930
+ filename: string;
3931
+ mime: string;
3932
+ metaData: Record<string, unknown> | null;
3933
+ alt: string | null;
3934
+ size: number;
3935
+ caption: string | null;
3936
+ objects: Record<string, unknown>;
3937
+ createdBy: string | null;
3938
+ };
3939
+ meta: object;
3940
+ }>;
3941
+ list: _trpc_server.TRPCQueryProcedure<{
3942
+ input: void;
3943
+ output: ({
3944
+ id: string;
3945
+ createdAt: string;
3946
+ updatedAt: string;
3947
+ updatedBy: string | null;
3948
+ legacyExtra: Record<string, unknown> | null;
3949
+ filename: string;
3950
+ mime: string;
3951
+ metaData: Record<string, unknown> | null;
3952
+ alt: string | null;
3953
+ size: number;
3954
+ caption: string | null;
3955
+ objects: Record<string, unknown>;
3956
+ createdBy: string | null;
3957
+ } & {
3958
+ objects: Record<string, string>;
3959
+ })[];
3960
+ meta: object;
3961
+ }>;
3962
+ get: _trpc_server.TRPCQueryProcedure<{
3963
+ input: {
3964
+ id: string;
3965
+ };
3966
+ output: {
3967
+ id: string;
3968
+ createdAt: string;
3969
+ updatedAt: string;
3970
+ updatedBy: string | null;
3971
+ legacyExtra: Record<string, unknown> | null;
3972
+ filename: string;
3973
+ mime: string;
3974
+ metaData: Record<string, unknown> | null;
3975
+ alt: string | null;
3976
+ size: number;
3977
+ caption: string | null;
3978
+ objects: Record<string, unknown>;
3979
+ createdBy: string | null;
3980
+ } & {
3981
+ objects: Record<string, string>;
3982
+ };
3983
+ meta: object;
3984
+ }>;
3985
+ update: _trpc_server.TRPCMutationProcedure<{
3986
+ input: {
3987
+ id: string;
3988
+ data: {
3989
+ filename?: string | undefined;
3990
+ alt?: string | null | undefined;
3991
+ caption?: string | null | undefined;
3992
+ };
3993
+ };
3994
+ output: {
3995
+ id: string;
3996
+ createdAt: string;
3997
+ updatedAt: string;
3998
+ updatedBy: string | null;
3999
+ legacyExtra: Record<string, unknown> | null;
4000
+ filename: string;
4001
+ mime: string;
4002
+ metaData: Record<string, unknown> | null;
4003
+ alt: string | null;
4004
+ size: number;
4005
+ caption: string | null;
4006
+ objects: Record<string, unknown>;
4007
+ createdBy: string | null;
4008
+ };
4009
+ meta: object;
4010
+ }>;
4011
+ remove: _trpc_server.TRPCMutationProcedure<{
4012
+ input: {
4013
+ id: string;
4014
+ };
4015
+ output: {
4016
+ removed: string;
4017
+ };
4018
+ meta: object;
4019
+ }>;
4020
+ }>>;
4021
+ collections: _trpc_server.TRPCBuiltRouter<{
4022
+ ctx: CoreContext;
4023
+ meta: object;
4024
+ errorShape: {
4025
+ data: {
4026
+ type?: string | undefined;
4027
+ code: _trpc_server.TRPC_ERROR_CODE_KEY;
4028
+ httpStatus: number;
4029
+ path?: string;
4030
+ stack?: string;
4031
+ };
4032
+ message: string;
4033
+ code: _trpc_server.TRPC_ERROR_CODE_NUMBER;
4034
+ };
4035
+ transformer: false;
4036
+ }, _trpc_server.TRPCDecorateCreateRouterOptions<{
4037
+ list: _trpc_server.TRPCQueryProcedure<{
4038
+ input: void;
4039
+ output: {
4040
+ description: string | null;
4041
+ id: string;
4042
+ name: string;
4043
+ createdAt: string;
4044
+ updatedAt: string;
4045
+ slug: string;
4046
+ updatedBy: string | null;
4047
+ legacyExtra: Record<string, unknown> | null;
4048
+ createdBy: string | null;
4049
+ fields: {
4050
+ name: string;
4051
+ label: string;
4052
+ type: "number" | "boolean" | "json" | "date" | "text" | "select" | "media" | "rich-text" | "relation" | "steps";
4053
+ required: boolean;
4054
+ hidden: boolean;
4055
+ options?: string[] | undefined;
4056
+ target?: string | undefined;
4057
+ }[];
4058
+ editor: Record<string, unknown> | null;
4059
+ display: Record<string, unknown> | null;
4060
+ headings: Record<string, unknown> | null;
4061
+ }[];
4062
+ meta: object;
4063
+ }>;
4064
+ get: _trpc_server.TRPCQueryProcedure<{
4065
+ input: {
4066
+ idOrSlug: string;
4067
+ };
4068
+ output: {
4069
+ description: string | null;
4070
+ id: string;
4071
+ name: string;
4072
+ createdAt: string;
4073
+ updatedAt: string;
4074
+ slug: string;
4075
+ updatedBy: string | null;
4076
+ legacyExtra: Record<string, unknown> | null;
4077
+ createdBy: string | null;
4078
+ fields: {
4079
+ name: string;
4080
+ label: string;
4081
+ type: "number" | "boolean" | "json" | "date" | "text" | "select" | "media" | "rich-text" | "relation" | "steps";
4082
+ required: boolean;
4083
+ hidden: boolean;
4084
+ options?: string[] | undefined;
4085
+ target?: string | undefined;
4086
+ }[];
4087
+ editor: Record<string, unknown> | null;
4088
+ display: Record<string, unknown> | null;
4089
+ headings: Record<string, unknown> | null;
4090
+ };
4091
+ meta: object;
4092
+ }>;
4093
+ create: _trpc_server.TRPCMutationProcedure<{
4094
+ input: {
4095
+ name: string;
4096
+ fields: {
4097
+ name: string;
4098
+ label: string;
4099
+ type: "number" | "boolean" | "json" | "date" | "text" | "select" | "media" | "rich-text" | "relation" | "steps";
4100
+ required?: boolean | undefined;
4101
+ hidden?: boolean | undefined;
4102
+ options?: string[] | undefined;
4103
+ target?: string | undefined;
4104
+ }[];
4105
+ description?: string | null | undefined;
4106
+ editor?: Record<string, unknown> | null | undefined;
4107
+ display?: Record<string, unknown> | null | undefined;
4108
+ headings?: Record<string, unknown> | null | undefined;
4109
+ slug?: string | undefined;
4110
+ };
4111
+ output: {
4112
+ description: string | null;
4113
+ id: string;
4114
+ name: string;
4115
+ createdAt: string;
4116
+ updatedAt: string;
4117
+ slug: string;
4118
+ updatedBy: string | null;
4119
+ legacyExtra: Record<string, unknown> | null;
4120
+ createdBy: string | null;
4121
+ fields: {
4122
+ name: string;
4123
+ label: string;
4124
+ type: "number" | "boolean" | "json" | "date" | "text" | "select" | "media" | "rich-text" | "relation" | "steps";
4125
+ required: boolean;
4126
+ hidden: boolean;
4127
+ options?: string[] | undefined;
4128
+ target?: string | undefined;
4129
+ }[];
4130
+ editor: Record<string, unknown> | null;
4131
+ display: Record<string, unknown> | null;
4132
+ headings: Record<string, unknown> | null;
4133
+ };
4134
+ meta: object;
4135
+ }>;
4136
+ update: _trpc_server.TRPCMutationProcedure<{
4137
+ input: {
4138
+ id: string;
4139
+ data: {
4140
+ description?: string | null | undefined;
4141
+ name?: string | undefined;
4142
+ slug?: string | undefined;
4143
+ editor?: Record<string, unknown> | null | undefined;
4144
+ display?: Record<string, unknown> | null | undefined;
4145
+ headings?: Record<string, unknown> | null | undefined;
4146
+ fields?: {
4147
+ name: string;
4148
+ label: string;
4149
+ type: "number" | "boolean" | "json" | "date" | "text" | "select" | "media" | "rich-text" | "relation" | "steps";
4150
+ required?: boolean | undefined;
4151
+ hidden?: boolean | undefined;
4152
+ options?: string[] | undefined;
4153
+ target?: string | undefined;
4154
+ }[] | undefined;
4155
+ };
4156
+ };
4157
+ output: {
4158
+ description: string | null;
4159
+ id: string;
4160
+ name: string;
4161
+ createdAt: string;
4162
+ updatedAt: string;
4163
+ slug: string;
4164
+ updatedBy: string | null;
4165
+ legacyExtra: Record<string, unknown> | null;
4166
+ createdBy: string | null;
4167
+ fields: {
4168
+ name: string;
4169
+ label: string;
4170
+ type: "number" | "boolean" | "json" | "date" | "text" | "select" | "media" | "rich-text" | "relation" | "steps";
4171
+ required: boolean;
4172
+ hidden: boolean;
4173
+ options?: string[] | undefined;
4174
+ target?: string | undefined;
4175
+ }[];
4176
+ editor: Record<string, unknown> | null;
4177
+ display: Record<string, unknown> | null;
4178
+ headings: Record<string, unknown> | null;
4179
+ };
4180
+ meta: object;
4181
+ }>;
4182
+ remove: _trpc_server.TRPCMutationProcedure<{
4183
+ input: {
4184
+ id: string;
4185
+ };
4186
+ output: {
4187
+ removed: string;
4188
+ };
4189
+ meta: object;
4190
+ }>;
4191
+ entries: _trpc_server.TRPCBuiltRouter<{
4192
+ ctx: CoreContext;
4193
+ meta: object;
4194
+ errorShape: {
4195
+ data: {
4196
+ type?: string | undefined;
4197
+ code: _trpc_server.TRPC_ERROR_CODE_KEY;
4198
+ httpStatus: number;
4199
+ path?: string;
4200
+ stack?: string;
4201
+ };
4202
+ message: string;
4203
+ code: _trpc_server.TRPC_ERROR_CODE_NUMBER;
4204
+ };
4205
+ transformer: false;
4206
+ }, _trpc_server.TRPCDecorateCreateRouterOptions<{
4207
+ get: _trpc_server.TRPCQueryProcedure<{
4208
+ input: {
4209
+ id: string;
4210
+ };
4211
+ output: {
4212
+ id: string;
4213
+ data: Record<string, unknown>;
4214
+ createdAt: string;
4215
+ updatedAt: string;
4216
+ slug: string;
4217
+ updatedBy: string | null;
4218
+ legacyExtra: Record<string, unknown> | null;
4219
+ createdBy: string | null;
4220
+ collectionId: string;
4221
+ title: string;
4222
+ related: string[] | null;
4223
+ status: "draft" | "waiting" | "ready" | "scheduled" | "published";
4224
+ publishedAt: string | null;
4225
+ };
4226
+ meta: object;
4227
+ }>;
4228
+ list: _trpc_server.TRPCQueryProcedure<{
4229
+ input: {
4230
+ collectionId: string;
4231
+ skip?: number | undefined;
4232
+ limit?: number | undefined;
4233
+ };
4234
+ output: {
4235
+ id: string;
4236
+ data: Record<string, unknown>;
4237
+ createdAt: string;
4238
+ updatedAt: string;
4239
+ slug: string;
4240
+ updatedBy: string | null;
4241
+ legacyExtra: Record<string, unknown> | null;
4242
+ createdBy: string | null;
4243
+ collectionId: string;
4244
+ title: string;
4245
+ related: string[] | null;
4246
+ status: "draft" | "waiting" | "ready" | "scheduled" | "published";
4247
+ publishedAt: string | null;
4248
+ }[];
4249
+ meta: object;
4250
+ }>;
4251
+ create: _trpc_server.TRPCMutationProcedure<{
4252
+ input: {
4253
+ collectionId: string;
4254
+ data: {
4255
+ data: Record<string, unknown>;
4256
+ title: string;
4257
+ status?: "draft" | "waiting" | "ready" | "scheduled" | "published" | undefined;
4258
+ publishedAt?: string | null | undefined;
4259
+ slug?: string | undefined;
4260
+ };
4261
+ };
4262
+ output: {
4263
+ id: string;
4264
+ data: Record<string, unknown>;
4265
+ createdAt: string;
4266
+ updatedAt: string;
4267
+ slug: string;
4268
+ updatedBy: string | null;
4269
+ legacyExtra: Record<string, unknown> | null;
4270
+ createdBy: string | null;
4271
+ collectionId: string;
4272
+ title: string;
4273
+ related: string[] | null;
4274
+ status: "draft" | "waiting" | "ready" | "scheduled" | "published";
4275
+ publishedAt: string | null;
4276
+ };
4277
+ meta: object;
4278
+ }>;
4279
+ update: _trpc_server.TRPCMutationProcedure<{
4280
+ input: {
4281
+ id: string;
4282
+ data: {
4283
+ data?: Record<string, unknown> | undefined;
4284
+ slug?: string | undefined;
4285
+ title?: string | undefined;
4286
+ status?: "draft" | "waiting" | "ready" | "scheduled" | "published" | undefined;
4287
+ publishedAt?: string | null | undefined;
4288
+ related?: string[] | undefined;
4289
+ };
4290
+ };
4291
+ output: {
4292
+ id: string;
4293
+ data: Record<string, unknown>;
4294
+ createdAt: string;
4295
+ updatedAt: string;
4296
+ slug: string;
4297
+ updatedBy: string | null;
4298
+ legacyExtra: Record<string, unknown> | null;
4299
+ createdBy: string | null;
4300
+ collectionId: string;
4301
+ title: string;
4302
+ related: string[] | null;
4303
+ status: "draft" | "waiting" | "ready" | "scheduled" | "published";
4304
+ publishedAt: string | null;
4305
+ };
4306
+ meta: object;
4307
+ }>;
4308
+ remove: _trpc_server.TRPCMutationProcedure<{
4309
+ input: {
4310
+ id: string;
4311
+ };
4312
+ output: {
4313
+ removed: string;
4314
+ };
4315
+ meta: object;
4316
+ }>;
4317
+ }>>;
4318
+ }>>;
4319
+ }>>;
4320
+ type AppRouter = typeof appRouter;
4321
+
4322
+ export { ALLOWED_MIME, CannotRemoveSelfError, CollectionNotFoundError, CollectionsService, DefinitionRepository, DeployFailedError, DeployHookMissingError, DomainError, DuplicateSlugError, EmailService, EntryNotFoundError, EntryRepository, FIELD_TYPES, FieldDefinition, FieldType, HealthService, InvalidEntryDataError, InvitationInvalidError, MediaNotFoundError, MediaRepository, MediaService, OrganizationAlreadyInitializedError, OrganizationNotInitializedError, OrganizationRepository, OrganizationService, PUBLICATION_STATUSES, S3Storage, SessionNotFoundError, TooManyAttemptsError, UnsupportedMimeError, UploadIncompleteError, UserNotFoundError, UsersRepository, UsersService, acceptInvitationDto, addressSchema, apiTokenCreateDto, apiTokens, apiTokensRouter, appRouter, authRouter, collectionDefinitions, collectionsRouter, connectDb, createCore, createStorage, createTypedError, definitionCreateDto, definitionUpdateDto, entries, entryCreateDto, entryUpdateDto, fieldDefinitionSchema, invitations, inviteDto, loginDto, media, mediaFinalizeDto, mediaRequestUploadDto, mediaRouter, mediaUpdateDto, organization, organizationInitDto, organizationRouter, organizationUpdateDto, parseEnv, requestPasswordResetDto, sessions, toPublicUser, userUpdateDto, users, usersRouter };
4323
+ export type { AcceptInvitationDto, Address, ApiToken, ApiTokenCreateDto, AppRouter, AuthSession, CollectionDefinition, Core, CoreContext, CoreEnv, CoreServices, DefinitionCreateDto, DefinitionUpdateDto, EmailEvent, Entry, EntryCreateDto, EntryUpdateDto, HealthStatus, Invitation, InviteDto, LoginDto, Media, MediaFinalizeDto, MediaRequestUploadDto, MediaUpdateDto, NewCollectionDefinition, NewEntry, NewMedia, NewOrganization, NewUser, Organization, OrganizationInitDto, OrganizationUpdateDto, PublicUser, RequestPasswordResetDto, S3Config, Session, StorageDriver, StoreDb, TrpcErrorCode, User, UserUpdateDto };