@getstrata/core 0.5.10 → 0.5.12

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.
@@ -664,6 +664,66 @@ function indexBelongsToManyRelation(parents, pivotRows, relatedRows, relation) {
664
664
  }
665
665
  return groups;
666
666
  }
667
+ function morphMany(definition) {
668
+ return {
669
+ type: "morphMany",
670
+ ...definition
671
+ };
672
+ }
673
+ function morphOne(definition) {
674
+ return {
675
+ type: "morphOne",
676
+ ...definition
677
+ };
678
+ }
679
+ function morphTo(definition) {
680
+ return {
681
+ type: "morphTo",
682
+ ...definition
683
+ };
684
+ }
685
+ function indexMorphManyRelation(parents, children, relation) {
686
+ const groups = new Map;
687
+ for (const parent of parents) {
688
+ groups.set(parent[relation.localKey], []);
689
+ }
690
+ for (const child of children) {
691
+ if (child[relation.morphTypeKey] !== relation.morphType) {
692
+ continue;
693
+ }
694
+ const key = child[relation.morphIdKey];
695
+ const group = groups.get(key);
696
+ if (!group) {
697
+ continue;
698
+ }
699
+ group.push(child);
700
+ }
701
+ return groups;
702
+ }
703
+ function indexMorphOneRelation(parents, children, relation) {
704
+ const grouped = indexMorphManyRelation(parents, children, relation);
705
+ const result = new Map;
706
+ for (const parent of parents) {
707
+ const matches = grouped.get(parent[relation.localKey]) ?? [];
708
+ result.set(parent[relation.localKey], matches[0]);
709
+ }
710
+ return result;
711
+ }
712
+ function indexMorphToRelation(children, parentsByType, relation) {
713
+ const result = new Map;
714
+ for (const child of children) {
715
+ const morphType = String(child[relation.morphTypeKey]);
716
+ const parents = parentsByType.get(morphType);
717
+ if (!parents) {
718
+ continue;
719
+ }
720
+ const parent = parents.get(child[relation.morphIdKey]);
721
+ if (parent) {
722
+ result.set(child[relation.morphIdKey], parent);
723
+ }
724
+ }
725
+ return result;
726
+ }
667
727
 
668
728
  // ../../src/config/database.ts
669
729
  function readInteger(name, fallback) {
@@ -867,6 +927,37 @@ class RepositoryQuery {
867
927
  });
868
928
  return this;
869
929
  }
930
+ withMorphMany(as, relation, childRepository, options = {}) {
931
+ this.eagerLoads.push({
932
+ kind: "morphMany",
933
+ as,
934
+ relation,
935
+ repository: childRepository,
936
+ options
937
+ });
938
+ return this;
939
+ }
940
+ withMorphOne(as, relation, childRepository, options = {}) {
941
+ this.eagerLoads.push({
942
+ kind: "morphOne",
943
+ as,
944
+ relation,
945
+ repository: childRepository,
946
+ options
947
+ });
948
+ return this;
949
+ }
950
+ withMorphTo(as, relation, repositoriesByType, options = {}) {
951
+ this.eagerLoads.push({
952
+ kind: "morphTo",
953
+ as,
954
+ relation,
955
+ repository: this.repository,
956
+ morphRepositories: repositoriesByType,
957
+ options
958
+ });
959
+ return this;
960
+ }
870
961
  async get() {
871
962
  const rows = await this.repository.findAll(this.buildOptions());
872
963
  return await this.attach(rows);
@@ -927,6 +1018,33 @@ class RepositoryQuery {
927
1018
  }));
928
1019
  continue;
929
1020
  }
1021
+ if (load.kind === "morphMany") {
1022
+ const relation2 = load.relation;
1023
+ const grouped2 = await load.repository.withConnection(this.repository.getConnection()).loadMorphManyForParents(rows, relation2, load.options);
1024
+ result = result.map((row) => ({
1025
+ ...row,
1026
+ [load.as]: grouped2.get(row[relation2.localKey]) ?? []
1027
+ }));
1028
+ continue;
1029
+ }
1030
+ if (load.kind === "morphOne") {
1031
+ const relation2 = load.relation;
1032
+ const grouped2 = await load.repository.withConnection(this.repository.getConnection()).loadMorphOneForParents(rows, relation2, load.options);
1033
+ result = result.map((row) => ({
1034
+ ...row,
1035
+ [load.as]: grouped2.get(row[relation2.localKey])
1036
+ }));
1037
+ continue;
1038
+ }
1039
+ if (load.kind === "morphTo") {
1040
+ const relation2 = load.relation;
1041
+ const grouped2 = await this.repository.loadMorphToForChildren(rows, relation2, load.morphRepositories ?? new Map, load.options);
1042
+ result = result.map((row) => ({
1043
+ ...row,
1044
+ [load.as]: grouped2.get(row[relation2.morphIdKey])
1045
+ }));
1046
+ continue;
1047
+ }
930
1048
  const relation = load.relation;
931
1049
  const grouped = await this.repository.loadBelongsToForParents(rows, relation, load.repository, load.options);
932
1050
  result = result.map((row) => ({
@@ -1203,6 +1321,56 @@ class BaseRepository {
1203
1321
  }, options);
1204
1322
  return indexBelongsToRelation(children, parents, relation);
1205
1323
  }
1324
+ async loadMorphManyForParents(parents, relation, options = {}) {
1325
+ if (parents.length === 0) {
1326
+ return indexMorphManyRelation(parents, [], relation);
1327
+ }
1328
+ const parentIds = [...new Set(parents.map((parent) => parent[relation.localKey]))];
1329
+ const children = await this.findWhere({
1330
+ [relation.morphTypeKey]: relation.morphType,
1331
+ [relation.morphIdKey]: parentIds
1332
+ }, options);
1333
+ return indexMorphManyRelation(parents, children, relation);
1334
+ }
1335
+ async loadMorphOneForParents(parents, relation, options = {}) {
1336
+ const grouped = await this.loadMorphManyForParents(parents, relation, options);
1337
+ const result = new Map;
1338
+ for (const parent of parents) {
1339
+ const matches = grouped.get(parent[relation.localKey]) ?? [];
1340
+ result.set(parent[relation.localKey], matches[0]);
1341
+ }
1342
+ return result;
1343
+ }
1344
+ async loadMorphToForChildren(children, relation, repositoriesByType, options = {}) {
1345
+ if (children.length === 0) {
1346
+ return new Map;
1347
+ }
1348
+ const idsByType = new Map;
1349
+ for (const child of children) {
1350
+ const morphType = String(child[relation.morphTypeKey]);
1351
+ const morphId = child[relation.morphIdKey];
1352
+ const ids = idsByType.get(morphType) ?? new Set;
1353
+ ids.add(morphId);
1354
+ idsByType.set(morphType, ids);
1355
+ }
1356
+ const parentsByType = new Map;
1357
+ for (const [morphType, ids] of idsByType) {
1358
+ const repository = repositoriesByType.get(morphType);
1359
+ if (!repository) {
1360
+ continue;
1361
+ }
1362
+ const ownerKey = repository.getTable().primaryKey;
1363
+ const parents = await repository.withConnection(this.connection).findWhere({
1364
+ [ownerKey]: [...ids]
1365
+ }, options);
1366
+ const indexed = new Map;
1367
+ for (const parent of parents) {
1368
+ indexed.set(parent[ownerKey], parent);
1369
+ }
1370
+ parentsByType.set(morphType, indexed);
1371
+ }
1372
+ return indexMorphToRelation(children, parentsByType, relation);
1373
+ }
1206
1374
  }
1207
1375
  var baseRepository_default = BaseRepository;
1208
1376
  // ../../src/core/database/connection.ts
@@ -1142,6 +1142,66 @@ function indexBelongsToManyRelation(parents, pivotRows, relatedRows, relation) {
1142
1142
  }
1143
1143
  return groups;
1144
1144
  }
1145
+ function morphMany(definition) {
1146
+ return {
1147
+ type: "morphMany",
1148
+ ...definition
1149
+ };
1150
+ }
1151
+ function morphOne(definition) {
1152
+ return {
1153
+ type: "morphOne",
1154
+ ...definition
1155
+ };
1156
+ }
1157
+ function morphTo(definition) {
1158
+ return {
1159
+ type: "morphTo",
1160
+ ...definition
1161
+ };
1162
+ }
1163
+ function indexMorphManyRelation(parents, children, relation) {
1164
+ const groups = new Map;
1165
+ for (const parent of parents) {
1166
+ groups.set(parent[relation.localKey], []);
1167
+ }
1168
+ for (const child of children) {
1169
+ if (child[relation.morphTypeKey] !== relation.morphType) {
1170
+ continue;
1171
+ }
1172
+ const key = child[relation.morphIdKey];
1173
+ const group = groups.get(key);
1174
+ if (!group) {
1175
+ continue;
1176
+ }
1177
+ group.push(child);
1178
+ }
1179
+ return groups;
1180
+ }
1181
+ function indexMorphOneRelation(parents, children, relation) {
1182
+ const grouped = indexMorphManyRelation(parents, children, relation);
1183
+ const result = new Map;
1184
+ for (const parent of parents) {
1185
+ const matches = grouped.get(parent[relation.localKey]) ?? [];
1186
+ result.set(parent[relation.localKey], matches[0]);
1187
+ }
1188
+ return result;
1189
+ }
1190
+ function indexMorphToRelation(children, parentsByType, relation) {
1191
+ const result = new Map;
1192
+ for (const child of children) {
1193
+ const morphType = String(child[relation.morphTypeKey]);
1194
+ const parents = parentsByType.get(morphType);
1195
+ if (!parents) {
1196
+ continue;
1197
+ }
1198
+ const parent = parents.get(child[relation.morphIdKey]);
1199
+ if (parent) {
1200
+ result.set(child[relation.morphIdKey], parent);
1201
+ }
1202
+ }
1203
+ return result;
1204
+ }
1145
1205
 
1146
1206
  // ../../src/core/database/boundConnection.ts
1147
1207
  var boundConnectionHolder = {
@@ -1275,6 +1335,37 @@ class RepositoryQuery {
1275
1335
  });
1276
1336
  return this;
1277
1337
  }
1338
+ withMorphMany(as, relation, childRepository, options = {}) {
1339
+ this.eagerLoads.push({
1340
+ kind: "morphMany",
1341
+ as,
1342
+ relation,
1343
+ repository: childRepository,
1344
+ options
1345
+ });
1346
+ return this;
1347
+ }
1348
+ withMorphOne(as, relation, childRepository, options = {}) {
1349
+ this.eagerLoads.push({
1350
+ kind: "morphOne",
1351
+ as,
1352
+ relation,
1353
+ repository: childRepository,
1354
+ options
1355
+ });
1356
+ return this;
1357
+ }
1358
+ withMorphTo(as, relation, repositoriesByType, options = {}) {
1359
+ this.eagerLoads.push({
1360
+ kind: "morphTo",
1361
+ as,
1362
+ relation,
1363
+ repository: this.repository,
1364
+ morphRepositories: repositoriesByType,
1365
+ options
1366
+ });
1367
+ return this;
1368
+ }
1278
1369
  async get() {
1279
1370
  const rows = await this.repository.findAll(this.buildOptions());
1280
1371
  return await this.attach(rows);
@@ -1335,6 +1426,33 @@ class RepositoryQuery {
1335
1426
  }));
1336
1427
  continue;
1337
1428
  }
1429
+ if (load.kind === "morphMany") {
1430
+ const relation2 = load.relation;
1431
+ const grouped2 = await load.repository.withConnection(this.repository.getConnection()).loadMorphManyForParents(rows, relation2, load.options);
1432
+ result = result.map((row) => ({
1433
+ ...row,
1434
+ [load.as]: grouped2.get(row[relation2.localKey]) ?? []
1435
+ }));
1436
+ continue;
1437
+ }
1438
+ if (load.kind === "morphOne") {
1439
+ const relation2 = load.relation;
1440
+ const grouped2 = await load.repository.withConnection(this.repository.getConnection()).loadMorphOneForParents(rows, relation2, load.options);
1441
+ result = result.map((row) => ({
1442
+ ...row,
1443
+ [load.as]: grouped2.get(row[relation2.localKey])
1444
+ }));
1445
+ continue;
1446
+ }
1447
+ if (load.kind === "morphTo") {
1448
+ const relation2 = load.relation;
1449
+ const grouped2 = await this.repository.loadMorphToForChildren(rows, relation2, load.morphRepositories ?? new Map, load.options);
1450
+ result = result.map((row) => ({
1451
+ ...row,
1452
+ [load.as]: grouped2.get(row[relation2.morphIdKey])
1453
+ }));
1454
+ continue;
1455
+ }
1338
1456
  const relation = load.relation;
1339
1457
  const grouped = await this.repository.loadBelongsToForParents(rows, relation, load.repository, load.options);
1340
1458
  result = result.map((row) => ({
@@ -1611,6 +1729,56 @@ class BaseRepository {
1611
1729
  }, options);
1612
1730
  return indexBelongsToRelation(children, parents, relation);
1613
1731
  }
1732
+ async loadMorphManyForParents(parents, relation, options = {}) {
1733
+ if (parents.length === 0) {
1734
+ return indexMorphManyRelation(parents, [], relation);
1735
+ }
1736
+ const parentIds = [...new Set(parents.map((parent) => parent[relation.localKey]))];
1737
+ const children = await this.findWhere({
1738
+ [relation.morphTypeKey]: relation.morphType,
1739
+ [relation.morphIdKey]: parentIds
1740
+ }, options);
1741
+ return indexMorphManyRelation(parents, children, relation);
1742
+ }
1743
+ async loadMorphOneForParents(parents, relation, options = {}) {
1744
+ const grouped = await this.loadMorphManyForParents(parents, relation, options);
1745
+ const result = new Map;
1746
+ for (const parent of parents) {
1747
+ const matches = grouped.get(parent[relation.localKey]) ?? [];
1748
+ result.set(parent[relation.localKey], matches[0]);
1749
+ }
1750
+ return result;
1751
+ }
1752
+ async loadMorphToForChildren(children, relation, repositoriesByType, options = {}) {
1753
+ if (children.length === 0) {
1754
+ return new Map;
1755
+ }
1756
+ const idsByType = new Map;
1757
+ for (const child of children) {
1758
+ const morphType = String(child[relation.morphTypeKey]);
1759
+ const morphId = child[relation.morphIdKey];
1760
+ const ids = idsByType.get(morphType) ?? new Set;
1761
+ ids.add(morphId);
1762
+ idsByType.set(morphType, ids);
1763
+ }
1764
+ const parentsByType = new Map;
1765
+ for (const [morphType, ids] of idsByType) {
1766
+ const repository = repositoriesByType.get(morphType);
1767
+ if (!repository) {
1768
+ continue;
1769
+ }
1770
+ const ownerKey = repository.getTable().primaryKey;
1771
+ const parents = await repository.withConnection(this.connection).findWhere({
1772
+ [ownerKey]: [...ids]
1773
+ }, options);
1774
+ const indexed = new Map;
1775
+ for (const parent of parents) {
1776
+ indexed.set(parent[ownerKey], parent);
1777
+ }
1778
+ parentsByType.set(morphType, indexed);
1779
+ }
1780
+ return indexMorphToRelation(children, parentsByType, relation);
1781
+ }
1614
1782
  }
1615
1783
  var baseRepository_default = BaseRepository;
1616
1784
  // ../../src/core/database/connection.ts
@@ -873,6 +873,66 @@ function indexBelongsToManyRelation(parents, pivotRows, relatedRows, relation) {
873
873
  }
874
874
  return groups;
875
875
  }
876
+ function morphMany(definition) {
877
+ return {
878
+ type: "morphMany",
879
+ ...definition
880
+ };
881
+ }
882
+ function morphOne(definition) {
883
+ return {
884
+ type: "morphOne",
885
+ ...definition
886
+ };
887
+ }
888
+ function morphTo(definition) {
889
+ return {
890
+ type: "morphTo",
891
+ ...definition
892
+ };
893
+ }
894
+ function indexMorphManyRelation(parents, children, relation) {
895
+ const groups = new Map;
896
+ for (const parent of parents) {
897
+ groups.set(parent[relation.localKey], []);
898
+ }
899
+ for (const child of children) {
900
+ if (child[relation.morphTypeKey] !== relation.morphType) {
901
+ continue;
902
+ }
903
+ const key = child[relation.morphIdKey];
904
+ const group = groups.get(key);
905
+ if (!group) {
906
+ continue;
907
+ }
908
+ group.push(child);
909
+ }
910
+ return groups;
911
+ }
912
+ function indexMorphOneRelation(parents, children, relation) {
913
+ const grouped = indexMorphManyRelation(parents, children, relation);
914
+ const result = new Map;
915
+ for (const parent of parents) {
916
+ const matches = grouped.get(parent[relation.localKey]) ?? [];
917
+ result.set(parent[relation.localKey], matches[0]);
918
+ }
919
+ return result;
920
+ }
921
+ function indexMorphToRelation(children, parentsByType, relation) {
922
+ const result = new Map;
923
+ for (const child of children) {
924
+ const morphType = String(child[relation.morphTypeKey]);
925
+ const parents = parentsByType.get(morphType);
926
+ if (!parents) {
927
+ continue;
928
+ }
929
+ const parent = parents.get(child[relation.morphIdKey]);
930
+ if (parent) {
931
+ result.set(child[relation.morphIdKey], parent);
932
+ }
933
+ }
934
+ return result;
935
+ }
876
936
 
877
937
  // ../../src/config/database.ts
878
938
  function readInteger(name, fallback) {
@@ -1076,6 +1136,37 @@ class RepositoryQuery {
1076
1136
  });
1077
1137
  return this;
1078
1138
  }
1139
+ withMorphMany(as, relation, childRepository, options = {}) {
1140
+ this.eagerLoads.push({
1141
+ kind: "morphMany",
1142
+ as,
1143
+ relation,
1144
+ repository: childRepository,
1145
+ options
1146
+ });
1147
+ return this;
1148
+ }
1149
+ withMorphOne(as, relation, childRepository, options = {}) {
1150
+ this.eagerLoads.push({
1151
+ kind: "morphOne",
1152
+ as,
1153
+ relation,
1154
+ repository: childRepository,
1155
+ options
1156
+ });
1157
+ return this;
1158
+ }
1159
+ withMorphTo(as, relation, repositoriesByType, options = {}) {
1160
+ this.eagerLoads.push({
1161
+ kind: "morphTo",
1162
+ as,
1163
+ relation,
1164
+ repository: this.repository,
1165
+ morphRepositories: repositoriesByType,
1166
+ options
1167
+ });
1168
+ return this;
1169
+ }
1079
1170
  async get() {
1080
1171
  const rows = await this.repository.findAll(this.buildOptions());
1081
1172
  return await this.attach(rows);
@@ -1136,6 +1227,33 @@ class RepositoryQuery {
1136
1227
  }));
1137
1228
  continue;
1138
1229
  }
1230
+ if (load.kind === "morphMany") {
1231
+ const relation2 = load.relation;
1232
+ const grouped2 = await load.repository.withConnection(this.repository.getConnection()).loadMorphManyForParents(rows, relation2, load.options);
1233
+ result = result.map((row) => ({
1234
+ ...row,
1235
+ [load.as]: grouped2.get(row[relation2.localKey]) ?? []
1236
+ }));
1237
+ continue;
1238
+ }
1239
+ if (load.kind === "morphOne") {
1240
+ const relation2 = load.relation;
1241
+ const grouped2 = await load.repository.withConnection(this.repository.getConnection()).loadMorphOneForParents(rows, relation2, load.options);
1242
+ result = result.map((row) => ({
1243
+ ...row,
1244
+ [load.as]: grouped2.get(row[relation2.localKey])
1245
+ }));
1246
+ continue;
1247
+ }
1248
+ if (load.kind === "morphTo") {
1249
+ const relation2 = load.relation;
1250
+ const grouped2 = await this.repository.loadMorphToForChildren(rows, relation2, load.morphRepositories ?? new Map, load.options);
1251
+ result = result.map((row) => ({
1252
+ ...row,
1253
+ [load.as]: grouped2.get(row[relation2.morphIdKey])
1254
+ }));
1255
+ continue;
1256
+ }
1139
1257
  const relation = load.relation;
1140
1258
  const grouped = await this.repository.loadBelongsToForParents(rows, relation, load.repository, load.options);
1141
1259
  result = result.map((row) => ({
@@ -1412,6 +1530,56 @@ class BaseRepository {
1412
1530
  }, options);
1413
1531
  return indexBelongsToRelation(children, parents, relation);
1414
1532
  }
1533
+ async loadMorphManyForParents(parents, relation, options = {}) {
1534
+ if (parents.length === 0) {
1535
+ return indexMorphManyRelation(parents, [], relation);
1536
+ }
1537
+ const parentIds = [...new Set(parents.map((parent) => parent[relation.localKey]))];
1538
+ const children = await this.findWhere({
1539
+ [relation.morphTypeKey]: relation.morphType,
1540
+ [relation.morphIdKey]: parentIds
1541
+ }, options);
1542
+ return indexMorphManyRelation(parents, children, relation);
1543
+ }
1544
+ async loadMorphOneForParents(parents, relation, options = {}) {
1545
+ const grouped = await this.loadMorphManyForParents(parents, relation, options);
1546
+ const result = new Map;
1547
+ for (const parent of parents) {
1548
+ const matches = grouped.get(parent[relation.localKey]) ?? [];
1549
+ result.set(parent[relation.localKey], matches[0]);
1550
+ }
1551
+ return result;
1552
+ }
1553
+ async loadMorphToForChildren(children, relation, repositoriesByType, options = {}) {
1554
+ if (children.length === 0) {
1555
+ return new Map;
1556
+ }
1557
+ const idsByType = new Map;
1558
+ for (const child of children) {
1559
+ const morphType = String(child[relation.morphTypeKey]);
1560
+ const morphId = child[relation.morphIdKey];
1561
+ const ids = idsByType.get(morphType) ?? new Set;
1562
+ ids.add(morphId);
1563
+ idsByType.set(morphType, ids);
1564
+ }
1565
+ const parentsByType = new Map;
1566
+ for (const [morphType, ids] of idsByType) {
1567
+ const repository = repositoriesByType.get(morphType);
1568
+ if (!repository) {
1569
+ continue;
1570
+ }
1571
+ const ownerKey = repository.getTable().primaryKey;
1572
+ const parents = await repository.withConnection(this.connection).findWhere({
1573
+ [ownerKey]: [...ids]
1574
+ }, options);
1575
+ const indexed = new Map;
1576
+ for (const parent of parents) {
1577
+ indexed.set(parent[ownerKey], parent);
1578
+ }
1579
+ parentsByType.set(morphType, indexed);
1580
+ }
1581
+ return indexMorphToRelation(children, parentsByType, relation);
1582
+ }
1415
1583
  }
1416
1584
  var baseRepository_default = BaseRepository;
1417
1585
  // ../../src/core/database/connection.ts
@@ -21,8 +21,8 @@ export { freshDatabase, getMigrationStatus, loadMigrationsFromDirectory, migrate
21
21
  export type { Migration, MigrationDatabase, MigrationStatus, } from "../core/database/migrations/types.ts";
22
22
  export type { CastType, GlobalScopeFn, ModelConstructor } from "../core/database/model.ts";
23
23
  export { applyCasts, dehydrateValue, filterMassAssignable, hydrateValue, Model, registerModelRepository, } from "../core/database/model.ts";
24
- export type { BelongsToManyRelation, BelongsToRelation, HasManyRelation, HasOneRelation, } from "../core/database/relationships.ts";
25
- export { belongsTo, belongsToMany, hasMany, hasOne, indexBelongsToManyRelation, indexBelongsToRelation, indexHasManyRelation, indexHasOneRelation, } from "../core/database/relationships.ts";
24
+ export type { BelongsToManyRelation, BelongsToRelation, HasManyRelation, HasOneRelation, MorphManyRelation, MorphOneRelation, MorphToRelation, } from "../core/database/relationships.ts";
25
+ export { belongsTo, belongsToMany, hasMany, hasOne, indexBelongsToManyRelation, indexBelongsToRelation, indexHasManyRelation, indexHasOneRelation, indexMorphManyRelation, indexMorphOneRelation, indexMorphToRelation, morphMany, morphOne, morphTo, } from "../core/database/relationships.ts";
26
26
  export { RepositoryQuery } from "../core/database/repositoryQuery.ts";
27
27
  export type { BlueprintAction, BlueprintCallback, ColumnKind, DatabaseDriver, ForeignKeyOptions, Grammar, IndexDefinition, IndexKind, ResolveDatabaseDriverOptions, SchemaBuilder, } from "../core/database/schema/index.ts";
28
28
  export { Blueprint, ColumnDefinition, compileBlueprint, createSchemaBuilder, ForeignIdColumnDefinition, grammarForDriver, inferReferencedTable, MySqlGrammar, PostgresGrammar, resolveDatabaseDriver, Schema, SqliteGrammar, UnsupportedSchemaFeatureError, } from "../core/database/schema/index.ts";
@@ -56,7 +56,13 @@ export { createThrottleMiddleware } from "../core/http/throttleMiddleware.ts";
56
56
  export { WebFormRequest } from "../core/http/webFormRequest.ts";
57
57
  export { installGracefulShutdownSignals, registerShutdownHandler, runGracefulShutdown, } from "../core/lifecycle/gracefulShutdown.ts";
58
58
  export type { MailDriver, MailMessage } from "../core/mail/mailer.ts";
59
- export { LogMailDriver, Mailer, mailer } from "../core/mail/mailer.ts";
59
+ export { buildSmtpPayload, LogMailDriver, Mailer, mailer, } from "../core/mail/mailer.ts";
60
+ export type { MarkdownMailLayoutOptions, RenderedMarkdownMail } from "../core/mail/markdownMail.ts";
61
+ export { markdownToHtml, renderMarkdownMail, stripMarkdown, wrapMarkdownMailLayout, } from "../core/mail/markdownMail.ts";
62
+ export type { MarkdownMailableInput } from "../core/mail/markdownMailable.ts";
63
+ export { buildMarkdownMailMessage, sendMarkdownMail } from "../core/mail/markdownMailable.ts";
64
+ export type { DatabaseNotificationPayload, DatabaseNotificationStore, MailNotificationMessage, Notifiable, NotificationChannelName, } from "../core/notifications/index.ts";
65
+ export { createNotificationDispatcher, Notification, NotificationDispatcher, } from "../core/notifications/index.ts";
60
66
  export type { MetricLabels } from "../core/metrics/prometheus.ts";
61
67
  export { PrometheusRegistry, prometheusRegistry } from "../core/metrics/prometheus.ts";
62
68
  export type { CursorPaginatedResult, PaginatedResult, PaginationMeta, } from "../core/pagination/index.ts";