@open-commune/core 0.2.20 → 0.2.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -3,11 +3,12 @@ import * as _trpc_server from '@trpc/server';
3
3
  import { z } from 'zod';
4
4
  import * as drizzle_orm_bun_sqlite from 'drizzle-orm/bun-sqlite';
5
5
  import { Database } from 'bun:sqlite';
6
- import { s as schema, U as User, S as Session, I as Invitation, A as ApiToken, O as Organization, N as NewOrganization, a as OrganizationInitDto, b as OrganizationUpdateDto, c as NewMedia, M as Media, d as MediaFinalizeDto, e as MediaUpdateDto, C as CollectionDefinition, f as NewCollectionDefinition, E as Entry, g as NewEntry, D as DefinitionCreateDto, h as DefinitionUpdateDto, i as EntrySearchHit, j as EntryCreateDto, k as EntryUpdateDto, l as AudienceAsk, m as AudiencePanelData, n as ErrorType } from './shared/core.CUIVeC31.mjs';
7
- export { o as AUDIENCE_PERIODS, p as AcceptInvitationDto, q as Address, r as ApiTokenCreateDto, t as AudienceQuery, u as AudienceSummary, v as ERROR_TYPES, w as InviteDto, L as LoginDto, x as MediaRequestUploadDto, y as NewUser, P as PublicUser, R as RequestPasswordResetDto, z as SessionUser, B as UpdateOwnProfileDto, F as UserUpdateDto, G as acceptInvitationDto, H as addressSchema, J as apiTokenCreateDto, K as apiTokens, Q as audienceAskDto, T as audienceQuerySchema, V as audienceSummarySchema, W as collectionDefinitions, X as definitionCreateDto, Y as definitionDto, Z as definitionUpdateDto, _ as entries, $ as entryCreateDto, a0 as entryDto, a1 as entrySearchHitDto, a2 as entryUpdateDto, a3 as invitations, a4 as inviteDto, a5 as isErrorType, a6 as loginDto, a7 as media, a8 as mediaFinalizeDto, a9 as mediaRequestUploadDto, aa as mediaUpdateDto, ab as organization, ac as organizationInitDto, ad as organizationUpdateDto, ae as requestPasswordResetDto, af as sessions, ag as toPublicUser, ah as toSessionUser, ai as updateOwnProfileDto, aj as userUpdateDto, ak as users } from './shared/core.CUIVeC31.mjs';
6
+ import { s as schema, U as User, S as Session, I as Invitation, A as ApiToken, O as Organization, N as NewOrganization, a as OrganizationInitDto, b as OrganizationUpdateDto, c as NewMedia, M as Media, d as MediaFinalizeDto, e as MediaUpdateDto, C as CollectionDefinition, f as NewCollectionDefinition, E as Entry, g as NewEntry, D as DefinitionCreateDto, h as DefinitionUpdateDto, i as EntrySearchHit, j as EntryCreateDto, k as EntryUpdateDto, l as AudienceAsk, m as AudiencePanelData, n as ErrorType } from './shared/core.C-cdTqDU.mjs';
7
+ export { o as AUDIENCE_PERIODS, p as AcceptInvitationDto, q as Address, r as ApiTokenCreateDto, t as AudienceQuery, u as AudienceSummary, v as ERROR_TYPES, w as InviteDto, L as LoginDto, x as MediaRequestUploadDto, y as NewUser, P as PublicUser, R as RequestPasswordResetDto, z as SessionUser, B as UpdateOwnProfileDto, F as UserUpdateDto, G as acceptInvitationDto, H as addressSchema, J as apiTokenCreateDto, K as apiTokens, Q as audienceAskDto, T as audienceQuerySchema, V as audienceSummarySchema, W as collectionDefinitions, X as definitionCreateDto, Y as definitionDto, Z as definitionUpdateDto, _ as entries, $ as entryCreateDto, a0 as entryDto, a1 as entryListedDto, a2 as entrySearchHitDto, a3 as entryUpdateDto, a4 as invitations, a5 as inviteDto, a6 as isErrorType, a7 as loginDto, a8 as media, a9 as mediaFinalizeDto, aa as mediaRequestUploadDto, ab as mediaUpdateDto, ac as organization, ad as organizationInitDto, ae as organizationUpdateDto, af as requestPasswordResetDto, ag as sessions, ah as toPublicUser, ai as toSessionUser, aj as updateOwnProfileDto, ak as userUpdateDto, al as users } from './shared/core.C-cdTqDU.mjs';
8
+ import * as drizzle_orm from 'drizzle-orm';
9
+ import * as drizzle_orm_sqlite_core from 'drizzle-orm/sqlite-core';
8
10
  export { FIELD_TYPES, FieldType, PUBLICATION_STATUSES, PublicationStatus } from './domains/collections/constants.mjs';
9
11
  export { FIELD_VALUE_SCHEMAS, FieldDefinition, buildDataSchema, fieldDefinitionSchema } from './domains/collections/utils.mjs';
10
- import 'drizzle-orm/sqlite-core';
11
12
 
12
13
  declare const envSchema: z.ZodObject<{
13
14
  COMMUN_DATA_DIR: z.ZodDefault<z.ZodString>;
@@ -296,13 +297,13 @@ declare class UsersService {
296
297
  verifyApiToken(token: string): Promise<boolean>;
297
298
  revokeApiToken(id: string): Promise<void>;
298
299
  listApiTokens(): Promise<Pick<{
299
- id: string;
300
300
  name: string;
301
+ id: string;
301
302
  createdAt: string;
302
303
  revokedAt: string | null;
303
304
  tokenHash: string;
304
305
  lastUsedAt: string | null;
305
- }, "id" | "name" | "createdAt" | "revokedAt" | "lastUsedAt">[]>;
306
+ }, "name" | "id" | "createdAt" | "revokedAt" | "lastUsedAt">[]>;
306
307
  }
307
308
 
308
309
  /**
@@ -343,6 +344,8 @@ declare class MediaRepository {
343
344
  constructor(db: StoreDb);
344
345
  insert(input: NewMedia): Promise<Media>;
345
346
  findById(id: string): Promise<Media | undefined>;
347
+ /** Several media in one query; the ids not found are simply absent. */
348
+ findByIds(ids: string[]): Promise<Media[]>;
346
349
  list(): Promise<Media[]>;
347
350
  /** Retrouve un média par une clé de son metaData — ce qui rend un import idempotent. */
348
351
  findByMetaData(name: string, value: string): Promise<Media | undefined>;
@@ -384,6 +387,13 @@ declare class MediaService {
384
387
  get(id: string): Promise<Media & {
385
388
  objects: Record<string, string>;
386
389
  }>;
390
+ /**
391
+ * Several media with resolved `objects`, in one read: a listing shows a
392
+ * cover per row. An id that matches nothing is left out.
393
+ */
394
+ getMany(ids: string[]): Promise<Array<Media & {
395
+ objects: Record<string, string>;
396
+ }>>;
387
397
  updateEditorial(id: string, input: MediaUpdateDto, actorId?: string): Promise<Media>;
388
398
  /** Delete the row AND every stored object (original + variants). */
389
399
  remove(id: string): Promise<void>;
@@ -397,7 +407,7 @@ declare class MediaService {
397
407
  * even though bun:sqlite executes synchronously.
398
408
  */
399
409
  declare class DefinitionRepository {
400
- private readonly db;
410
+ protected readonly db: StoreDb;
401
411
  constructor(db: StoreDb);
402
412
  list(): Promise<CollectionDefinition[]>;
403
413
  findBySlug(slug: string): Promise<CollectionDefinition | undefined>;
@@ -429,7 +439,8 @@ type EntryOrder = 'recent' | 'oldest' | 'title' | 'date_asc' | 'date_desc';
429
439
  * though bun:sqlite executes synchronously.
430
440
  */
431
441
  declare class EntryRepository {
432
- private readonly db;
442
+ protected readonly db: StoreDb;
443
+ private readonly fullText;
433
444
  constructor(db: StoreDb);
434
445
  list(collectionId: string): Promise<Entry[]>;
435
446
  /**
@@ -457,13 +468,16 @@ declare class EntryRepository {
457
468
  */
458
469
  private dateKey;
459
470
  /**
460
- * Text match on the title and the data. One LIKE is enough at a commune's
461
- * scale, and it leaves the title index usable.
471
+ * The entries, joined to what the full-text index finds for a search when
472
+ * there is one: an entry it does not find is left out, and `rank` orders
473
+ * the others, the best first.
462
474
  */
463
- private matching;
475
+ private found;
464
476
  /**
465
- * Text search across collections, most recently updated first — how one
466
- * finds content without knowing where it lives.
477
+ * Text search across collections, the closest first — how one finds content
478
+ * without knowing where it lives. The full-text index ranks them: a word in
479
+ * the title counts more than one in the body. When no entry holds every
480
+ * word, those that hold any of them are returned instead.
467
481
  */
468
482
  search(options: {
469
483
  search: string;
@@ -487,6 +501,8 @@ declare class EntryRepository {
487
501
  listPublished(collectionId: string): Promise<Entry[]>;
488
502
  findBySlug(collectionId: string, slug: string): Promise<Entry | undefined>;
489
503
  findById(id: string): Promise<Entry | undefined>;
504
+ /** Several entries in one query; the ids not found are simply absent. */
505
+ findByIds(ids: string[]): Promise<Entry[]>;
490
506
  /** Finds an entry by a key of its data — what makes an external import idempotent. */
491
507
  findByDataField(collectionId: string, name: string, value: string | number): Promise<Entry | undefined>;
492
508
  insert(input: NewEntry): Promise<Entry>;
@@ -494,6 +510,79 @@ declare class EntryRepository {
494
510
  delete(id: string): Promise<Entry | undefined>;
495
511
  }
496
512
 
513
+ /** An entry's title and texts, with the words a search found between OPEN and CLOSE. */
514
+ interface MarkedRow {
515
+ entryId: string;
516
+ title: string;
517
+ body: string;
518
+ extra: string;
519
+ }
520
+ /**
521
+ * Database access for the full-text index of the entries. What an entry gives
522
+ * it is computed by SQLite itself, in the view `entries_search_text`: writing
523
+ * the index is copying from it.
524
+ */
525
+ declare class SearchRepository {
526
+ private readonly db;
527
+ constructor(db: StoreDb);
528
+ /** (Re)indexes one entry as it now is; a deleted one leaves the index. */
529
+ reindexEntry(entryId: string): void;
530
+ /** (Re)indexes every entry of a collection: its fields decide what each gives. */
531
+ reindexCollection(collectionId: string): void;
532
+ /**
533
+ * The entries a search matches, to join a query on: `entryId`, and `rank`
534
+ * to order by, the best first. Undefined when nothing searchable was typed.
535
+ */
536
+ matching(search: string, every?: boolean): drizzle_orm_sqlite_core.SubqueryWithSelection<{
537
+ entryId: drizzle_orm_sqlite_core.SQLiteColumn<{
538
+ name: "entry_id";
539
+ tableName: "entries_fts";
540
+ dataType: "string";
541
+ columnType: "SQLiteText";
542
+ data: string;
543
+ driverParam: string;
544
+ notNull: true;
545
+ hasDefault: false;
546
+ isPrimaryKey: false;
547
+ isAutoincrement: false;
548
+ hasRuntimeDefault: false;
549
+ enumValues: [string, ...string[]];
550
+ baseColumn: never;
551
+ identity: undefined;
552
+ generated: undefined;
553
+ }, {}, {
554
+ length: number | undefined;
555
+ }>;
556
+ rank: drizzle_orm.SQL.Aliased<number>;
557
+ }, "fts"> | undefined;
558
+ /** The title of these entries with the found words marked, and a passage of each text around them. */
559
+ marked(search: string, entryIds: string[]): MarkedRow[];
560
+ /** The words of these entries, field by field, in their collection's order. */
561
+ words(entryIds: string[]): {
562
+ entryId: string;
563
+ position: number;
564
+ field: string;
565
+ extra: boolean;
566
+ word: string;
567
+ }[];
568
+ }
569
+
570
+ /**
571
+ * Where a search found an entry: its title and texts as the index marked
572
+ * them, the words found between \u0002 and \u0003, and the field the first
573
+ * one comes from. Cutting them into what a screen shows is the screen's
574
+ * business.
575
+ */
576
+ interface Found {
577
+ title: string;
578
+ /** A passage of what a reader may search, around the words found. */
579
+ body: string;
580
+ /** A passage of what only the admin searches. */
581
+ extra: string;
582
+ /** The label of the field holding the first word found outside the title. */
583
+ field?: string;
584
+ }
585
+
497
586
  /**
498
587
  * The content engine: collection definitions over a closed field-type set, and
499
588
  * their entries, validated against the Zod schema generated from each definition.
@@ -502,7 +591,8 @@ declare class CollectionsService {
502
591
  private readonly definitions;
503
592
  private readonly entries;
504
593
  private readonly media;
505
- constructor(definitions: DefinitionRepository, entries: EntryRepository, media: MediaService);
594
+ private readonly fullText;
595
+ constructor(definitions: DefinitionRepository, entries: EntryRepository, media: MediaService, fullText: SearchRepository);
506
596
  listDefinitions(): Promise<CollectionDefinition[]>;
507
597
  getDefinition(idOrSlug: string): Promise<CollectionDefinition>;
508
598
  createDefinition(input: DefinitionCreateDto, actorId?: string): Promise<CollectionDefinition>;
@@ -511,6 +601,12 @@ declare class CollectionsService {
511
601
  private validateData;
512
602
  listEntries(collectionIdOrSlug: string): Promise<Entry[]>;
513
603
  getEntry(id: string): Promise<Entry>;
604
+ /**
605
+ * Several entries by id, in one read: what a listing needs to title the
606
+ * entries its rows link to. An id that matches nothing is left out rather
607
+ * than failing the whole set.
608
+ */
609
+ getEntries(ids: string[]): Promise<Entry[]>;
514
610
  /** Paginated admin listing, most recently updated first. */
515
611
  /**
516
612
  * A page of entries, from one collection or, without one, from every
@@ -521,7 +617,9 @@ declare class CollectionsService {
521
617
  skip?: number;
522
618
  limit?: number;
523
619
  order?: EntryOrder;
524
- }): Promise<Entry[]>;
620
+ }): Promise<(Entry & {
621
+ found?: Found;
622
+ })[]>;
525
623
  /** A collection's id from its id or its slug; none, for the whole site. */
526
624
  private collectionIdOf;
527
625
  /** The entries last touched across every collection, most recent first. */
@@ -738,13 +836,9 @@ declare const organizationRouter: _trpc_server.TRPCBuiltRouter<{
738
836
  output: {
739
837
  type: "commune" | "intercommunality" | "syndicate" | "other";
740
838
  description: string | null;
741
- id: number;
742
839
  name: string;
840
+ id: number;
743
841
  slug: string;
744
- updatedBy: string | null;
745
- legacyExtra: Record<string, unknown> | null;
746
- createdAt: string;
747
- updatedAt: string;
748
842
  address: {
749
843
  street?: string | undefined;
750
844
  postalCode?: string | undefined;
@@ -752,6 +846,10 @@ declare const organizationRouter: _trpc_server.TRPCBuiltRouter<{
752
846
  } | null;
753
847
  deployment: Record<string, unknown> | null;
754
848
  settings: Record<string, unknown> | null;
849
+ updatedBy: string | null;
850
+ legacyExtra: Record<string, unknown> | null;
851
+ createdAt: string;
852
+ updatedAt: string;
755
853
  } | null;
756
854
  meta: object;
757
855
  }>;
@@ -772,13 +870,9 @@ declare const organizationRouter: _trpc_server.TRPCBuiltRouter<{
772
870
  output: {
773
871
  type: "commune" | "intercommunality" | "syndicate" | "other";
774
872
  description: string | null;
775
- id: number;
776
873
  name: string;
874
+ id: number;
777
875
  slug: string;
778
- updatedBy: string | null;
779
- legacyExtra: Record<string, unknown> | null;
780
- createdAt: string;
781
- updatedAt: string;
782
876
  address: {
783
877
  street?: string | undefined;
784
878
  postalCode?: string | undefined;
@@ -786,6 +880,10 @@ declare const organizationRouter: _trpc_server.TRPCBuiltRouter<{
786
880
  } | null;
787
881
  deployment: Record<string, unknown> | null;
788
882
  settings: Record<string, unknown> | null;
883
+ updatedBy: string | null;
884
+ legacyExtra: Record<string, unknown> | null;
885
+ createdAt: string;
886
+ updatedAt: string;
789
887
  };
790
888
  meta: object;
791
889
  }>;
@@ -806,13 +904,9 @@ declare const organizationRouter: _trpc_server.TRPCBuiltRouter<{
806
904
  output: {
807
905
  type: "commune" | "intercommunality" | "syndicate" | "other";
808
906
  description: string | null;
809
- id: number;
810
907
  name: string;
908
+ id: number;
811
909
  slug: string;
812
- updatedBy: string | null;
813
- legacyExtra: Record<string, unknown> | null;
814
- createdAt: string;
815
- updatedAt: string;
816
910
  address: {
817
911
  street?: string | undefined;
818
912
  postalCode?: string | undefined;
@@ -820,6 +914,10 @@ declare const organizationRouter: _trpc_server.TRPCBuiltRouter<{
820
914
  } | null;
821
915
  deployment: Record<string, unknown> | null;
822
916
  settings: Record<string, unknown> | null;
917
+ updatedBy: string | null;
918
+ legacyExtra: Record<string, unknown> | null;
919
+ createdAt: string;
920
+ updatedAt: string;
823
921
  };
824
922
  meta: object;
825
923
  }>;
@@ -1152,13 +1250,13 @@ declare const apiTokensRouter: _trpc_server.TRPCBuiltRouter<{
1152
1250
  list: _trpc_server.TRPCQueryProcedure<{
1153
1251
  input: void;
1154
1252
  output: Pick<{
1155
- id: string;
1156
1253
  name: string;
1254
+ id: string;
1157
1255
  createdAt: string;
1158
1256
  revokedAt: string | null;
1159
1257
  tokenHash: string;
1160
1258
  lastUsedAt: string | null;
1161
- }, "id" | "name" | "createdAt" | "revokedAt" | "lastUsedAt">[];
1259
+ }, "name" | "id" | "createdAt" | "revokedAt" | "lastUsedAt">[];
1162
1260
  meta: object;
1163
1261
  }>;
1164
1262
  /** The plaintext token is returned ONCE — only its hash is stored. */
@@ -1385,38 +1483,38 @@ declare const mediaRouter: _trpc_server.TRPCBuiltRouter<{
1385
1483
  metaData?: Record<string, unknown> | undefined;
1386
1484
  };
1387
1485
  output: {
1486
+ filename: string;
1388
1487
  id: string;
1389
- createdBy: string | null;
1390
1488
  updatedBy: string | null;
1391
1489
  legacyExtra: Record<string, unknown> | null;
1392
1490
  createdAt: string;
1393
1491
  updatedAt: string;
1394
- filename: string;
1395
1492
  mime: string;
1396
1493
  size: number;
1397
1494
  alt: string | null;
1398
1495
  caption: string | null;
1399
1496
  objects: Record<string, unknown>;
1400
1497
  metaData: Record<string, unknown> | null;
1498
+ createdBy: string | null;
1401
1499
  };
1402
1500
  meta: object;
1403
1501
  }>;
1404
1502
  list: _trpc_server.TRPCQueryProcedure<{
1405
1503
  input: void;
1406
1504
  output: ({
1505
+ filename: string;
1407
1506
  id: string;
1408
- createdBy: string | null;
1409
1507
  updatedBy: string | null;
1410
1508
  legacyExtra: Record<string, unknown> | null;
1411
1509
  createdAt: string;
1412
1510
  updatedAt: string;
1413
- filename: string;
1414
1511
  mime: string;
1415
1512
  size: number;
1416
1513
  alt: string | null;
1417
1514
  caption: string | null;
1418
1515
  objects: Record<string, unknown>;
1419
1516
  metaData: Record<string, unknown> | null;
1517
+ createdBy: string | null;
1420
1518
  } & {
1421
1519
  objects: Record<string, string>;
1422
1520
  })[];
@@ -1427,24 +1525,48 @@ declare const mediaRouter: _trpc_server.TRPCBuiltRouter<{
1427
1525
  id: string;
1428
1526
  };
1429
1527
  output: {
1528
+ filename: string;
1430
1529
  id: string;
1431
- createdBy: string | null;
1432
1530
  updatedBy: string | null;
1433
1531
  legacyExtra: Record<string, unknown> | null;
1434
1532
  createdAt: string;
1435
1533
  updatedAt: string;
1436
- filename: string;
1437
1534
  mime: string;
1438
1535
  size: number;
1439
1536
  alt: string | null;
1440
1537
  caption: string | null;
1441
1538
  objects: Record<string, unknown>;
1442
1539
  metaData: Record<string, unknown> | null;
1540
+ createdBy: string | null;
1443
1541
  } & {
1444
1542
  objects: Record<string, string>;
1445
1543
  };
1446
1544
  meta: object;
1447
1545
  }>;
1546
+ /** Several media in one call; the ids that match nothing are left out. */
1547
+ getMany: _trpc_server.TRPCQueryProcedure<{
1548
+ input: {
1549
+ ids: string[];
1550
+ };
1551
+ output: ({
1552
+ filename: string;
1553
+ id: string;
1554
+ updatedBy: string | null;
1555
+ legacyExtra: Record<string, unknown> | null;
1556
+ createdAt: string;
1557
+ updatedAt: string;
1558
+ mime: string;
1559
+ size: number;
1560
+ alt: string | null;
1561
+ caption: string | null;
1562
+ objects: Record<string, unknown>;
1563
+ metaData: Record<string, unknown> | null;
1564
+ createdBy: string | null;
1565
+ } & {
1566
+ objects: Record<string, string>;
1567
+ })[];
1568
+ meta: object;
1569
+ }>;
1448
1570
  update: _trpc_server.TRPCMutationProcedure<{
1449
1571
  input: {
1450
1572
  id: string;
@@ -1455,19 +1577,19 @@ declare const mediaRouter: _trpc_server.TRPCBuiltRouter<{
1455
1577
  };
1456
1578
  };
1457
1579
  output: {
1580
+ filename: string;
1458
1581
  id: string;
1459
- createdBy: string | null;
1460
1582
  updatedBy: string | null;
1461
1583
  legacyExtra: Record<string, unknown> | null;
1462
1584
  createdAt: string;
1463
1585
  updatedAt: string;
1464
- filename: string;
1465
1586
  mime: string;
1466
1587
  size: number;
1467
1588
  alt: string | null;
1468
1589
  caption: string | null;
1469
1590
  objects: Record<string, unknown>;
1470
1591
  metaData: Record<string, unknown> | null;
1592
+ createdBy: string | null;
1471
1593
  };
1472
1594
  meta: object;
1473
1595
  }>;
@@ -1531,6 +1653,25 @@ declare const UploadIncompleteError: {
1531
1653
  stackTraceLimit: number;
1532
1654
  };
1533
1655
 
1656
+ declare class IndexedEntryRepository extends EntryRepository {
1657
+ private readonly index;
1658
+ insert(input: NewEntry): Promise<Entry>;
1659
+ update(id: string, input: Partial<NewEntry>): Promise<Entry | undefined>;
1660
+ delete(id: string): Promise<Entry | undefined>;
1661
+ }
1662
+ declare class IndexedDefinitionRepository extends DefinitionRepository {
1663
+ private readonly index;
1664
+ update(id: string, input: Partial<NewCollectionDefinition>): Promise<CollectionDefinition | undefined>;
1665
+ delete(id: string): Promise<CollectionDefinition | undefined>;
1666
+ }
1667
+
1668
+ /**
1669
+ * What someone typed, as an FTS5 query: every word must be found, each as the
1670
+ * start of a word (« ecol » finds « école »). Quoted, so that nothing typed is
1671
+ * read as FTS5 syntax. With `every` false, any one word is enough.
1672
+ */
1673
+ declare function toMatchQuery(search: string, every?: boolean): string;
1674
+
1534
1675
  declare const collectionsRouter: _trpc_server.TRPCBuiltRouter<{
1535
1676
  ctx: CoreContext;
1536
1677
  meta: object;
@@ -1551,13 +1692,18 @@ declare const collectionsRouter: _trpc_server.TRPCBuiltRouter<{
1551
1692
  input: void;
1552
1693
  output: {
1553
1694
  description: string | null;
1554
- id: string;
1555
1695
  name: string;
1696
+ id: string;
1556
1697
  slug: string;
1698
+ updatedBy: string | null;
1699
+ legacyExtra: Record<string, unknown> | null;
1700
+ createdAt: string;
1701
+ updatedAt: string;
1702
+ createdBy: string | null;
1557
1703
  fields: {
1558
1704
  name: string;
1559
1705
  label: string;
1560
- type: "number" | "boolean" | "json" | "date" | "text" | "rich-text" | "media" | "relation" | "select" | "steps";
1706
+ type: "number" | "boolean" | "text" | "rich-text" | "date" | "media" | "relation" | "select" | "steps" | "json";
1561
1707
  required: boolean;
1562
1708
  hidden: boolean;
1563
1709
  options?: string[] | undefined;
@@ -1566,11 +1712,6 @@ declare const collectionsRouter: _trpc_server.TRPCBuiltRouter<{
1566
1712
  editor: Record<string, unknown> | null;
1567
1713
  display: Record<string, unknown> | null;
1568
1714
  headings: Record<string, unknown> | null;
1569
- createdBy: string | null;
1570
- updatedBy: string | null;
1571
- legacyExtra: Record<string, unknown> | null;
1572
- createdAt: string;
1573
- updatedAt: string;
1574
1715
  }[];
1575
1716
  meta: object;
1576
1717
  }>;
@@ -1610,7 +1751,7 @@ declare const collectionsRouter: _trpc_server.TRPCBuiltRouter<{
1610
1751
  fields: {
1611
1752
  name: string;
1612
1753
  label: string;
1613
- type: "number" | "boolean" | "json" | "date" | "text" | "rich-text" | "media" | "relation" | "select" | "steps";
1754
+ type: "number" | "boolean" | "text" | "rich-text" | "date" | "media" | "relation" | "select" | "steps" | "json";
1614
1755
  required?: boolean | undefined;
1615
1756
  hidden?: boolean | undefined;
1616
1757
  options?: string[] | undefined;
@@ -1624,13 +1765,18 @@ declare const collectionsRouter: _trpc_server.TRPCBuiltRouter<{
1624
1765
  };
1625
1766
  output: {
1626
1767
  description: string | null;
1627
- id: string;
1628
1768
  name: string;
1769
+ id: string;
1629
1770
  slug: string;
1771
+ updatedBy: string | null;
1772
+ legacyExtra: Record<string, unknown> | null;
1773
+ createdAt: string;
1774
+ updatedAt: string;
1775
+ createdBy: string | null;
1630
1776
  fields: {
1631
1777
  name: string;
1632
1778
  label: string;
1633
- type: "number" | "boolean" | "json" | "date" | "text" | "rich-text" | "media" | "relation" | "select" | "steps";
1779
+ type: "number" | "boolean" | "text" | "rich-text" | "date" | "media" | "relation" | "select" | "steps" | "json";
1634
1780
  required: boolean;
1635
1781
  hidden: boolean;
1636
1782
  options?: string[] | undefined;
@@ -1639,11 +1785,6 @@ declare const collectionsRouter: _trpc_server.TRPCBuiltRouter<{
1639
1785
  editor: Record<string, unknown> | null;
1640
1786
  display: Record<string, unknown> | null;
1641
1787
  headings: Record<string, unknown> | null;
1642
- createdBy: string | null;
1643
- updatedBy: string | null;
1644
- legacyExtra: Record<string, unknown> | null;
1645
- createdAt: string;
1646
- updatedAt: string;
1647
1788
  };
1648
1789
  meta: object;
1649
1790
  }>;
@@ -1660,7 +1801,7 @@ declare const collectionsRouter: _trpc_server.TRPCBuiltRouter<{
1660
1801
  fields?: {
1661
1802
  name: string;
1662
1803
  label: string;
1663
- type: "number" | "boolean" | "json" | "date" | "text" | "rich-text" | "media" | "relation" | "select" | "steps";
1804
+ type: "number" | "boolean" | "text" | "rich-text" | "date" | "media" | "relation" | "select" | "steps" | "json";
1664
1805
  required?: boolean | undefined;
1665
1806
  hidden?: boolean | undefined;
1666
1807
  options?: string[] | undefined;
@@ -1670,13 +1811,18 @@ declare const collectionsRouter: _trpc_server.TRPCBuiltRouter<{
1670
1811
  };
1671
1812
  output: {
1672
1813
  description: string | null;
1673
- id: string;
1674
1814
  name: string;
1815
+ id: string;
1675
1816
  slug: string;
1817
+ updatedBy: string | null;
1818
+ legacyExtra: Record<string, unknown> | null;
1819
+ createdAt: string;
1820
+ updatedAt: string;
1821
+ createdBy: string | null;
1676
1822
  fields: {
1677
1823
  name: string;
1678
1824
  label: string;
1679
- type: "number" | "boolean" | "json" | "date" | "text" | "rich-text" | "media" | "relation" | "select" | "steps";
1825
+ type: "number" | "boolean" | "text" | "rich-text" | "date" | "media" | "relation" | "select" | "steps" | "json";
1680
1826
  required: boolean;
1681
1827
  hidden: boolean;
1682
1828
  options?: string[] | undefined;
@@ -1685,11 +1831,6 @@ declare const collectionsRouter: _trpc_server.TRPCBuiltRouter<{
1685
1831
  editor: Record<string, unknown> | null;
1686
1832
  display: Record<string, unknown> | null;
1687
1833
  headings: Record<string, unknown> | null;
1688
- createdBy: string | null;
1689
- updatedBy: string | null;
1690
- legacyExtra: Record<string, unknown> | null;
1691
- createdAt: string;
1692
- updatedAt: string;
1693
1834
  };
1694
1835
  meta: object;
1695
1836
  }>;
@@ -1739,6 +1880,28 @@ declare const collectionsRouter: _trpc_server.TRPCBuiltRouter<{
1739
1880
  };
1740
1881
  meta: object;
1741
1882
  }>;
1883
+ /** Several entries in one call; the ids that match nothing are left out. */
1884
+ getMany: _trpc_server.TRPCQueryProcedure<{
1885
+ input: {
1886
+ ids: string[];
1887
+ };
1888
+ output: {
1889
+ id: string;
1890
+ collectionId: string;
1891
+ title: string;
1892
+ slug: string;
1893
+ data: Record<string, unknown>;
1894
+ related: string[] | null;
1895
+ createdBy: string | null;
1896
+ updatedBy: string | null;
1897
+ status: "draft" | "waiting" | "ready" | "scheduled" | "published";
1898
+ publishedAt: string | null;
1899
+ legacyExtra: drizzle_zod.Json;
1900
+ createdAt: string;
1901
+ updatedAt: string;
1902
+ }[];
1903
+ meta: object;
1904
+ }>;
1742
1905
  /** Across collections: finds content without knowing where it lives. */
1743
1906
  search: _trpc_server.TRPCQueryProcedure<{
1744
1907
  input: {
@@ -1794,6 +1957,12 @@ declare const collectionsRouter: _trpc_server.TRPCBuiltRouter<{
1794
1957
  legacyExtra: drizzle_zod.Json;
1795
1958
  createdAt: string;
1796
1959
  updatedAt: string;
1960
+ found?: {
1961
+ title: string;
1962
+ body: string;
1963
+ extra: string;
1964
+ field?: string | undefined;
1965
+ } | undefined;
1797
1966
  }[];
1798
1967
  meta: object;
1799
1968
  }>;
@@ -1849,13 +2018,13 @@ declare const collectionsRouter: _trpc_server.TRPCBuiltRouter<{
1849
2018
  id: string;
1850
2019
  data: Record<string, unknown>;
1851
2020
  slug: string;
1852
- createdBy: string | null;
1853
2021
  updatedBy: string | null;
1854
2022
  legacyExtra: Record<string, unknown> | null;
1855
2023
  createdAt: string;
1856
2024
  updatedAt: string;
1857
- title: string;
2025
+ createdBy: string | null;
1858
2026
  collectionId: string;
2027
+ title: string;
1859
2028
  related: string[] | null;
1860
2029
  status: "draft" | "waiting" | "ready" | "scheduled" | "published";
1861
2030
  publishedAt: string | null;
@@ -1878,13 +2047,13 @@ declare const collectionsRouter: _trpc_server.TRPCBuiltRouter<{
1878
2047
  id: string;
1879
2048
  data: Record<string, unknown>;
1880
2049
  slug: string;
1881
- createdBy: string | null;
1882
2050
  updatedBy: string | null;
1883
2051
  legacyExtra: Record<string, unknown> | null;
1884
2052
  createdAt: string;
1885
2053
  updatedAt: string;
1886
- title: string;
2054
+ createdBy: string | null;
1887
2055
  collectionId: string;
2056
+ title: string;
1888
2057
  related: string[] | null;
1889
2058
  status: "draft" | "waiting" | "ready" | "scheduled" | "published";
1890
2059
  publishedAt: string | null;
@@ -2606,6 +2775,29 @@ declare const appRouter: _trpc_server.TRPCBuiltRouter<{
2606
2775
  };
2607
2776
  meta: object;
2608
2777
  }>;
2778
+ getMany: _trpc_server.TRPCQueryProcedure<{
2779
+ input: {
2780
+ ids: string[];
2781
+ };
2782
+ output: ({
2783
+ id: string;
2784
+ createdAt: string;
2785
+ updatedAt: string;
2786
+ updatedBy: string | null;
2787
+ legacyExtra: Record<string, unknown> | null;
2788
+ filename: string;
2789
+ mime: string;
2790
+ metaData: Record<string, unknown> | null;
2791
+ alt: string | null;
2792
+ size: number;
2793
+ caption: string | null;
2794
+ objects: Record<string, unknown>;
2795
+ createdBy: string | null;
2796
+ } & {
2797
+ objects: Record<string, string>;
2798
+ })[];
2799
+ meta: object;
2800
+ }>;
2609
2801
  update: _trpc_server.TRPCMutationProcedure<{
2610
2802
  input: {
2611
2803
  id: string;
@@ -2850,6 +3042,27 @@ declare const appRouter: _trpc_server.TRPCBuiltRouter<{
2850
3042
  };
2851
3043
  meta: object;
2852
3044
  }>;
3045
+ getMany: _trpc_server.TRPCQueryProcedure<{
3046
+ input: {
3047
+ ids: string[];
3048
+ };
3049
+ output: {
3050
+ id: string;
3051
+ collectionId: string;
3052
+ title: string;
3053
+ slug: string;
3054
+ data: Record<string, unknown>;
3055
+ related: string[] | null;
3056
+ createdBy: string | null;
3057
+ updatedBy: string | null;
3058
+ status: "draft" | "waiting" | "ready" | "scheduled" | "published";
3059
+ publishedAt: string | null;
3060
+ legacyExtra: drizzle_zod.Json;
3061
+ createdAt: string;
3062
+ updatedAt: string;
3063
+ }[];
3064
+ meta: object;
3065
+ }>;
2853
3066
  search: _trpc_server.TRPCQueryProcedure<{
2854
3067
  input: {
2855
3068
  query: string;
@@ -2903,6 +3116,12 @@ declare const appRouter: _trpc_server.TRPCBuiltRouter<{
2903
3116
  legacyExtra: drizzle_zod.Json;
2904
3117
  createdAt: string;
2905
3118
  updatedAt: string;
3119
+ found?: {
3120
+ title: string;
3121
+ body: string;
3122
+ extra: string;
3123
+ field?: string | undefined;
3124
+ } | undefined;
2906
3125
  }[];
2907
3126
  meta: object;
2908
3127
  }>;
@@ -3038,5 +3257,5 @@ declare const appRouter: _trpc_server.TRPCBuiltRouter<{
3038
3257
  }>>;
3039
3258
  type AppRouter = typeof appRouter;
3040
3259
 
3041
- export { ALLOWED_MIME, ApiToken, AudienceAsk, AudiencePanelData, AudienceService, AudienceUnavailableError, CannotRemoveSelfError, CollectionDefinition, CollectionNotFoundError, CollectionsService, DefinitionCreateDto, DefinitionRepository, DefinitionUpdateDto, DeployFailedError, DeployHookMissingError, DomainError, DuplicateSlugError, EmailService, Entry, EntryCreateDto, EntryNotFoundError, EntryRepository, EntrySearchHit, EntryUpdateDto, ErrorType, HealthService, InvalidEntryDataError, Invitation, InvitationInvalidError, Media, MediaFinalizeDto, MediaNotFoundError, MediaRepository, MediaService, MediaUpdateDto, NewCollectionDefinition, NewEntry, NewMedia, NewOrganization, Organization, OrganizationAlreadyInitializedError, OrganizationInitDto, OrganizationNotInitializedError, OrganizationRepository, OrganizationService, OrganizationUpdateDto, S3Storage, Session, SessionNotFoundError, TooManyAttemptsError, UnsupportedMimeError, UploadIncompleteError, User, UserNotFoundError, UsersRepository, UsersService, adminProcedure, apiTokensRouter, appRouter, audienceRouter, authRouter, collectionsRouter, connectDb, createCore, createStorage, createTypedError, invitationsRouter, isUniqueViolation, mediaRouter, mergeRouters, middleware, organizationRouter, parseEnv, procedure, protectedProcedure, publicProcedure, router, usersRouter };
3042
- export type { AppRouter, AuthSession, Core, CoreContext, CoreEnv, CoreServices, EmailEvent, HealthStatus, S3Config, StorageDriver, StoreDb, TrpcErrorCode };
3260
+ export { ALLOWED_MIME, ApiToken, AudienceAsk, AudiencePanelData, AudienceService, AudienceUnavailableError, CannotRemoveSelfError, CollectionDefinition, CollectionNotFoundError, CollectionsService, DefinitionCreateDto, IndexedDefinitionRepository as DefinitionRepository, DefinitionUpdateDto, DeployFailedError, DeployHookMissingError, DomainError, DuplicateSlugError, EmailService, Entry, EntryCreateDto, EntryNotFoundError, IndexedEntryRepository as EntryRepository, EntrySearchHit, EntryUpdateDto, ErrorType, HealthService, InvalidEntryDataError, Invitation, InvitationInvalidError, Media, MediaFinalizeDto, MediaNotFoundError, MediaRepository, MediaService, MediaUpdateDto, NewCollectionDefinition, NewEntry, NewMedia, NewOrganization, Organization, OrganizationAlreadyInitializedError, OrganizationInitDto, OrganizationNotInitializedError, OrganizationRepository, OrganizationService, OrganizationUpdateDto, S3Storage, SearchRepository, Session, SessionNotFoundError, TooManyAttemptsError, UnsupportedMimeError, UploadIncompleteError, User, UserNotFoundError, UsersRepository, UsersService, adminProcedure, apiTokensRouter, appRouter, audienceRouter, authRouter, collectionsRouter, connectDb, createCore, createStorage, createTypedError, invitationsRouter, isUniqueViolation, mediaRouter, mergeRouters, middleware, organizationRouter, parseEnv, procedure, protectedProcedure, publicProcedure, router, toMatchQuery, usersRouter };
3261
+ export type { AppRouter, AuthSession, Core, CoreContext, CoreEnv, CoreServices, EmailEvent, Found, HealthStatus, S3Config, StorageDriver, StoreDb, TrpcErrorCode };