@murumets-ee/entity 0.1.6 → 0.2.1
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/admin/index.d.mts +17 -0
- package/dist/admin/index.d.mts.map +1 -1
- package/dist/admin/index.mjs +1 -1
- package/dist/admin/index.mjs.map +1 -1
- package/dist/index.d.mts +675 -51
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +1 -64
- package/dist/index.mjs.map +1 -1
- package/dist/query/index.d.mts +17 -0
- package/dist/query/index.d.mts.map +1 -1
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as _$drizzle_orm0 from "drizzle-orm";
|
|
2
2
|
import { SQL } from "drizzle-orm";
|
|
3
3
|
import * as _$drizzle_orm_pg_core0 from "drizzle-orm/pg-core";
|
|
4
|
-
import { PgTableWithColumns } from "drizzle-orm/pg-core";
|
|
4
|
+
import { PgTable, PgTableWithColumns } from "drizzle-orm/pg-core";
|
|
5
5
|
import { PostgresJsDatabase } from "drizzle-orm/postgres-js";
|
|
6
6
|
|
|
7
7
|
//#region src/admin-config.d.ts
|
|
@@ -44,6 +44,23 @@ interface EntityAdminConfig {
|
|
|
44
44
|
disableCreate?: boolean;
|
|
45
45
|
/** Order within sidebar group. Default: 0 */
|
|
46
46
|
sortOrder?: number;
|
|
47
|
+
/**
|
|
48
|
+
* Hide the entity from BOTH dashboard and sidebar.
|
|
49
|
+
* Use for system entities that should not appear in any UI.
|
|
50
|
+
* Shorthand for `hideFromMenu: true` + `hideFromDashboard: true`.
|
|
51
|
+
*/
|
|
52
|
+
hidden?: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* Hide from sidebar menu only. Entity remains accessible via dashboard, direct URL,
|
|
55
|
+
* and the entity API. Use for storage models accessed through specialized UI
|
|
56
|
+
* (e.g., Ticket entities accessed via the inbox/board, not as a CRUD table).
|
|
57
|
+
*/
|
|
58
|
+
hideFromMenu?: boolean;
|
|
59
|
+
/**
|
|
60
|
+
* Hide from dashboard widget grid only. Entity still appears in sidebar.
|
|
61
|
+
* Use for entities that don't have meaningful counts/stats to show.
|
|
62
|
+
*/
|
|
63
|
+
hideFromDashboard?: boolean;
|
|
47
64
|
}
|
|
48
65
|
//#endregion
|
|
49
66
|
//#region src/fields/base.d.ts
|
|
@@ -568,6 +585,13 @@ declare class ReferencedEntityError extends Error {
|
|
|
568
585
|
}
|
|
569
586
|
//#endregion
|
|
570
587
|
//#region src/schema-generator.d.ts
|
|
588
|
+
type AnyTable = PgTable<any>;
|
|
589
|
+
/**
|
|
590
|
+
* Convert a field config to a Drizzle column.
|
|
591
|
+
*
|
|
592
|
+
* @param nullable - When true, skips notNull and default constraints.
|
|
593
|
+
* Used for translation table columns (translations are partial overrides).
|
|
594
|
+
*/
|
|
571
595
|
/**
|
|
572
596
|
* Generate a runtime Drizzle schema from an entity definition.
|
|
573
597
|
* Every field becomes its own column — no JSONB.
|
|
@@ -596,16 +620,16 @@ declare function generateSchema(entity: Entity): _$drizzle_orm_pg_core0.PgTableW
|
|
|
596
620
|
};
|
|
597
621
|
dialect: "pg";
|
|
598
622
|
}>;
|
|
599
|
-
/**
|
|
600
|
-
* Generate TypeScript code string for an entity schema.
|
|
601
|
-
* Every field becomes its own column — no JSONB.
|
|
602
|
-
*/
|
|
603
|
-
declare function generateSchemaCode(entity: Entity): string;
|
|
604
623
|
/**
|
|
605
624
|
* Generate runtime translation table schema.
|
|
606
625
|
* Each translatable field gets its own nullable column.
|
|
626
|
+
*
|
|
627
|
+
* When `parent` is provided, `entityId` gets a `.references()` FK — used
|
|
628
|
+
* by `lumi migrate` so generated SQL includes `REFERENCES parent(id) ON
|
|
629
|
+
* DELETE CASCADE`. Callers that only need the table shape for query
|
|
630
|
+
* building (core/app.ts, content/plugin.ts) can omit `parent`.
|
|
607
631
|
*/
|
|
608
|
-
declare function generateTranslationSchema(entity: Entity): _$drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
632
|
+
declare function generateTranslationSchema(entity: Entity, parent?: AnyTable): _$drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
609
633
|
name: string;
|
|
610
634
|
schema: undefined;
|
|
611
635
|
columns: {
|
|
@@ -629,11 +653,6 @@ declare function generateTranslationSchema(entity: Entity): _$drizzle_orm_pg_cor
|
|
|
629
653
|
};
|
|
630
654
|
dialect: "pg";
|
|
631
655
|
}> | null;
|
|
632
|
-
/**
|
|
633
|
-
* Generate TypeScript code string for a translation table.
|
|
634
|
-
* Each translatable field gets its own nullable column.
|
|
635
|
-
*/
|
|
636
|
-
declare function generateTranslationSchemaCode(entity: Entity): string | null;
|
|
637
656
|
/**
|
|
638
657
|
* Check if an entity has any blocks fields
|
|
639
658
|
*/
|
|
@@ -644,8 +663,11 @@ declare function hasBlocksFields(entity: Entity): boolean;
|
|
|
644
663
|
*
|
|
645
664
|
* When blocks field has localized: false (default), locale is NULL (shared layout).
|
|
646
665
|
* When blocks field has localized: true, locale is set per-locale.
|
|
666
|
+
*
|
|
667
|
+
* `parent` is optional — when provided, emits a `.references()` FK (for
|
|
668
|
+
* migration generation); query-runtime callers can omit it.
|
|
647
669
|
*/
|
|
648
|
-
declare function generateLayoutSchema(entity: Entity): _$drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
670
|
+
declare function generateLayoutSchema(entity: Entity, parent?: AnyTable): _$drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
649
671
|
name: string;
|
|
650
672
|
schema: undefined;
|
|
651
673
|
columns: {
|
|
@@ -786,42 +808,12 @@ declare function isVersionable(entity: Entity): boolean;
|
|
|
786
808
|
* Requires both publishable() behavior AND at least one translatable field.
|
|
787
809
|
*/
|
|
788
810
|
declare function needsLocaleStatus(entity: Entity): boolean;
|
|
789
|
-
/**
|
|
790
|
-
* Generate TypeScript code string for a per-locale publish status table.
|
|
791
|
-
*/
|
|
792
|
-
declare function generateLocaleStatusCode(entity: Entity): string;
|
|
793
811
|
/**
|
|
794
812
|
* Check if an entity is publishable (has publishable() behavior).
|
|
795
813
|
*/
|
|
796
814
|
declare function isPublishable(entity: Entity): boolean;
|
|
797
|
-
/**
|
|
798
|
-
|
|
799
|
-
*/
|
|
800
|
-
declare function generateDraftsCode(entity: Entity): string;
|
|
801
|
-
/**
|
|
802
|
-
* Generate TypeScript code string for the shared content locks table.
|
|
803
|
-
*/
|
|
804
|
-
declare function generateContentLocksCode(): string;
|
|
805
|
-
/**
|
|
806
|
-
* Check if an entity has blocks fields with translatable block content (non-localized mode).
|
|
807
|
-
*/
|
|
808
|
-
declare function hasTranslatableBlocks(entity: Entity): boolean;
|
|
809
|
-
/**
|
|
810
|
-
* Generate TypeScript code string for a layout table (blocks storage).
|
|
811
|
-
*/
|
|
812
|
-
declare function generateLayoutCode(entity: Entity): string;
|
|
813
|
-
/**
|
|
814
|
-
* Generate TypeScript code string for a layout translation table.
|
|
815
|
-
*/
|
|
816
|
-
declare function generateLayoutTranslationCode(entity: Entity): string;
|
|
817
|
-
/**
|
|
818
|
-
* Generate TypeScript code string for a versions table.
|
|
819
|
-
*/
|
|
820
|
-
declare function generateVersionsCode(entity: Entity): string;
|
|
821
|
-
/**
|
|
822
|
-
* Generate layout translation table for non-localized blocks with translatable fields.
|
|
823
|
-
*/
|
|
824
|
-
declare function generateLayoutTranslationSchema(entity: Entity): _$drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
815
|
+
/** Per-locale publish status table for publishable + translatable entities. */
|
|
816
|
+
declare function generateLocaleStatusSchema(entity: Entity, parent: AnyTable): _$drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
825
817
|
name: string;
|
|
826
818
|
schema: undefined;
|
|
827
819
|
columns: {
|
|
@@ -842,8 +834,8 @@ declare function generateLayoutTranslationSchema(entity: Entity): _$drizzle_orm_
|
|
|
842
834
|
identity: undefined;
|
|
843
835
|
generated: undefined;
|
|
844
836
|
}, {}, {}>;
|
|
845
|
-
|
|
846
|
-
name: "
|
|
837
|
+
entityId: _$drizzle_orm_pg_core0.PgColumn<{
|
|
838
|
+
name: "entity_id";
|
|
847
839
|
tableName: string;
|
|
848
840
|
dataType: "string";
|
|
849
841
|
columnType: "PgUUID";
|
|
@@ -878,8 +870,105 @@ declare function generateLayoutTranslationSchema(entity: Entity): _$drizzle_orm_
|
|
|
878
870
|
}, {}, {
|
|
879
871
|
length: 10;
|
|
880
872
|
}>;
|
|
881
|
-
|
|
882
|
-
name: "
|
|
873
|
+
status: _$drizzle_orm_pg_core0.PgColumn<{
|
|
874
|
+
name: "status";
|
|
875
|
+
tableName: string;
|
|
876
|
+
dataType: "string";
|
|
877
|
+
columnType: "PgVarchar";
|
|
878
|
+
data: string;
|
|
879
|
+
driverParam: string;
|
|
880
|
+
notNull: true;
|
|
881
|
+
hasDefault: true;
|
|
882
|
+
isPrimaryKey: false;
|
|
883
|
+
isAutoincrement: false;
|
|
884
|
+
hasRuntimeDefault: false;
|
|
885
|
+
enumValues: [string, ...string[]];
|
|
886
|
+
baseColumn: never;
|
|
887
|
+
identity: undefined;
|
|
888
|
+
generated: undefined;
|
|
889
|
+
}, {}, {
|
|
890
|
+
length: 20;
|
|
891
|
+
}>;
|
|
892
|
+
publishedAt: _$drizzle_orm_pg_core0.PgColumn<{
|
|
893
|
+
name: "published_at";
|
|
894
|
+
tableName: string;
|
|
895
|
+
dataType: "date";
|
|
896
|
+
columnType: "PgTimestamp";
|
|
897
|
+
data: Date;
|
|
898
|
+
driverParam: string;
|
|
899
|
+
notNull: false;
|
|
900
|
+
hasDefault: false;
|
|
901
|
+
isPrimaryKey: false;
|
|
902
|
+
isAutoincrement: false;
|
|
903
|
+
hasRuntimeDefault: false;
|
|
904
|
+
enumValues: undefined;
|
|
905
|
+
baseColumn: never;
|
|
906
|
+
identity: undefined;
|
|
907
|
+
generated: undefined;
|
|
908
|
+
}, {}, {}>;
|
|
909
|
+
};
|
|
910
|
+
dialect: "pg";
|
|
911
|
+
}>;
|
|
912
|
+
/** Drafts overlay table for publishable entities. */
|
|
913
|
+
declare function generateDraftsSchema(entity: Entity, parent: AnyTable): _$drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
914
|
+
name: string;
|
|
915
|
+
schema: undefined;
|
|
916
|
+
columns: {
|
|
917
|
+
id: _$drizzle_orm_pg_core0.PgColumn<{
|
|
918
|
+
name: "id";
|
|
919
|
+
tableName: string;
|
|
920
|
+
dataType: "string";
|
|
921
|
+
columnType: "PgUUID";
|
|
922
|
+
data: string;
|
|
923
|
+
driverParam: string;
|
|
924
|
+
notNull: true;
|
|
925
|
+
hasDefault: true;
|
|
926
|
+
isPrimaryKey: true;
|
|
927
|
+
isAutoincrement: false;
|
|
928
|
+
hasRuntimeDefault: false;
|
|
929
|
+
enumValues: undefined;
|
|
930
|
+
baseColumn: never;
|
|
931
|
+
identity: undefined;
|
|
932
|
+
generated: undefined;
|
|
933
|
+
}, {}, {}>;
|
|
934
|
+
entityId: _$drizzle_orm_pg_core0.PgColumn<{
|
|
935
|
+
name: "entity_id";
|
|
936
|
+
tableName: string;
|
|
937
|
+
dataType: "string";
|
|
938
|
+
columnType: "PgUUID";
|
|
939
|
+
data: string;
|
|
940
|
+
driverParam: string;
|
|
941
|
+
notNull: true;
|
|
942
|
+
hasDefault: false;
|
|
943
|
+
isPrimaryKey: false;
|
|
944
|
+
isAutoincrement: false;
|
|
945
|
+
hasRuntimeDefault: false;
|
|
946
|
+
enumValues: undefined;
|
|
947
|
+
baseColumn: never;
|
|
948
|
+
identity: undefined;
|
|
949
|
+
generated: undefined;
|
|
950
|
+
}, {}, {}>;
|
|
951
|
+
locale: _$drizzle_orm_pg_core0.PgColumn<{
|
|
952
|
+
name: "locale";
|
|
953
|
+
tableName: string;
|
|
954
|
+
dataType: "string";
|
|
955
|
+
columnType: "PgVarchar";
|
|
956
|
+
data: string;
|
|
957
|
+
driverParam: string;
|
|
958
|
+
notNull: true;
|
|
959
|
+
hasDefault: true;
|
|
960
|
+
isPrimaryKey: false;
|
|
961
|
+
isAutoincrement: false;
|
|
962
|
+
hasRuntimeDefault: false;
|
|
963
|
+
enumValues: [string, ...string[]];
|
|
964
|
+
baseColumn: never;
|
|
965
|
+
identity: undefined;
|
|
966
|
+
generated: undefined;
|
|
967
|
+
}, {}, {
|
|
968
|
+
length: 10;
|
|
969
|
+
}>;
|
|
970
|
+
data: _$drizzle_orm_pg_core0.PgColumn<{
|
|
971
|
+
name: "data";
|
|
883
972
|
tableName: string;
|
|
884
973
|
dataType: "json";
|
|
885
974
|
columnType: "PgJsonb";
|
|
@@ -895,9 +984,544 @@ declare function generateLayoutTranslationSchema(entity: Entity): _$drizzle_orm_
|
|
|
895
984
|
identity: undefined;
|
|
896
985
|
generated: undefined;
|
|
897
986
|
}, {}, {}>;
|
|
987
|
+
createdBy: _$drizzle_orm_pg_core0.PgColumn<{
|
|
988
|
+
name: "created_by";
|
|
989
|
+
tableName: string;
|
|
990
|
+
dataType: "string";
|
|
991
|
+
columnType: "PgVarchar";
|
|
992
|
+
data: string;
|
|
993
|
+
driverParam: string;
|
|
994
|
+
notNull: true;
|
|
995
|
+
hasDefault: false;
|
|
996
|
+
isPrimaryKey: false;
|
|
997
|
+
isAutoincrement: false;
|
|
998
|
+
hasRuntimeDefault: false;
|
|
999
|
+
enumValues: [string, ...string[]];
|
|
1000
|
+
baseColumn: never;
|
|
1001
|
+
identity: undefined;
|
|
1002
|
+
generated: undefined;
|
|
1003
|
+
}, {}, {
|
|
1004
|
+
length: 255;
|
|
1005
|
+
}>;
|
|
1006
|
+
createdByName: _$drizzle_orm_pg_core0.PgColumn<{
|
|
1007
|
+
name: "created_by_name";
|
|
1008
|
+
tableName: string;
|
|
1009
|
+
dataType: "string";
|
|
1010
|
+
columnType: "PgVarchar";
|
|
1011
|
+
data: string;
|
|
1012
|
+
driverParam: string;
|
|
1013
|
+
notNull: false;
|
|
1014
|
+
hasDefault: false;
|
|
1015
|
+
isPrimaryKey: false;
|
|
1016
|
+
isAutoincrement: false;
|
|
1017
|
+
hasRuntimeDefault: false;
|
|
1018
|
+
enumValues: [string, ...string[]];
|
|
1019
|
+
baseColumn: never;
|
|
1020
|
+
identity: undefined;
|
|
1021
|
+
generated: undefined;
|
|
1022
|
+
}, {}, {
|
|
1023
|
+
length: 255;
|
|
1024
|
+
}>;
|
|
1025
|
+
createdAt: _$drizzle_orm_pg_core0.PgColumn<{
|
|
1026
|
+
name: "created_at";
|
|
1027
|
+
tableName: string;
|
|
1028
|
+
dataType: "date";
|
|
1029
|
+
columnType: "PgTimestamp";
|
|
1030
|
+
data: Date;
|
|
1031
|
+
driverParam: string;
|
|
1032
|
+
notNull: true;
|
|
1033
|
+
hasDefault: true;
|
|
1034
|
+
isPrimaryKey: false;
|
|
1035
|
+
isAutoincrement: false;
|
|
1036
|
+
hasRuntimeDefault: false;
|
|
1037
|
+
enumValues: undefined;
|
|
1038
|
+
baseColumn: never;
|
|
1039
|
+
identity: undefined;
|
|
1040
|
+
generated: undefined;
|
|
1041
|
+
}, {}, {}>;
|
|
1042
|
+
updatedAt: _$drizzle_orm_pg_core0.PgColumn<{
|
|
1043
|
+
name: "updated_at";
|
|
1044
|
+
tableName: string;
|
|
1045
|
+
dataType: "date";
|
|
1046
|
+
columnType: "PgTimestamp";
|
|
1047
|
+
data: Date;
|
|
1048
|
+
driverParam: string;
|
|
1049
|
+
notNull: true;
|
|
1050
|
+
hasDefault: true;
|
|
1051
|
+
isPrimaryKey: false;
|
|
1052
|
+
isAutoincrement: false;
|
|
1053
|
+
hasRuntimeDefault: false;
|
|
1054
|
+
enumValues: undefined;
|
|
1055
|
+
baseColumn: never;
|
|
1056
|
+
identity: undefined;
|
|
1057
|
+
generated: undefined;
|
|
1058
|
+
}, {}, {}>;
|
|
898
1059
|
};
|
|
899
1060
|
dialect: "pg";
|
|
900
|
-
}
|
|
1061
|
+
}>;
|
|
1062
|
+
/** Versions history table for versionable entities. */
|
|
1063
|
+
declare function generateVersionsSchema(entity: Entity, parent: AnyTable): _$drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
1064
|
+
name: string;
|
|
1065
|
+
schema: undefined;
|
|
1066
|
+
columns: {
|
|
1067
|
+
id: _$drizzle_orm_pg_core0.PgColumn<{
|
|
1068
|
+
name: "id";
|
|
1069
|
+
tableName: string;
|
|
1070
|
+
dataType: "string";
|
|
1071
|
+
columnType: "PgUUID";
|
|
1072
|
+
data: string;
|
|
1073
|
+
driverParam: string;
|
|
1074
|
+
notNull: true;
|
|
1075
|
+
hasDefault: true;
|
|
1076
|
+
isPrimaryKey: true;
|
|
1077
|
+
isAutoincrement: false;
|
|
1078
|
+
hasRuntimeDefault: false;
|
|
1079
|
+
enumValues: undefined;
|
|
1080
|
+
baseColumn: never;
|
|
1081
|
+
identity: undefined;
|
|
1082
|
+
generated: undefined;
|
|
1083
|
+
}, {}, {}>;
|
|
1084
|
+
entityId: _$drizzle_orm_pg_core0.PgColumn<{
|
|
1085
|
+
name: "entity_id";
|
|
1086
|
+
tableName: string;
|
|
1087
|
+
dataType: "string";
|
|
1088
|
+
columnType: "PgUUID";
|
|
1089
|
+
data: string;
|
|
1090
|
+
driverParam: string;
|
|
1091
|
+
notNull: true;
|
|
1092
|
+
hasDefault: false;
|
|
1093
|
+
isPrimaryKey: false;
|
|
1094
|
+
isAutoincrement: false;
|
|
1095
|
+
hasRuntimeDefault: false;
|
|
1096
|
+
enumValues: undefined;
|
|
1097
|
+
baseColumn: never;
|
|
1098
|
+
identity: undefined;
|
|
1099
|
+
generated: undefined;
|
|
1100
|
+
}, {}, {}>;
|
|
1101
|
+
version: _$drizzle_orm_pg_core0.PgColumn<{
|
|
1102
|
+
name: "version";
|
|
1103
|
+
tableName: string;
|
|
1104
|
+
dataType: "number";
|
|
1105
|
+
columnType: "PgInteger";
|
|
1106
|
+
data: number;
|
|
1107
|
+
driverParam: string | number;
|
|
1108
|
+
notNull: true;
|
|
1109
|
+
hasDefault: false;
|
|
1110
|
+
isPrimaryKey: false;
|
|
1111
|
+
isAutoincrement: false;
|
|
1112
|
+
hasRuntimeDefault: false;
|
|
1113
|
+
enumValues: undefined;
|
|
1114
|
+
baseColumn: never;
|
|
1115
|
+
identity: undefined;
|
|
1116
|
+
generated: undefined;
|
|
1117
|
+
}, {}, {}>;
|
|
1118
|
+
locale: _$drizzle_orm_pg_core0.PgColumn<{
|
|
1119
|
+
name: "locale";
|
|
1120
|
+
tableName: string;
|
|
1121
|
+
dataType: "string";
|
|
1122
|
+
columnType: "PgVarchar";
|
|
1123
|
+
data: string;
|
|
1124
|
+
driverParam: string;
|
|
1125
|
+
notNull: true;
|
|
1126
|
+
hasDefault: true;
|
|
1127
|
+
isPrimaryKey: false;
|
|
1128
|
+
isAutoincrement: false;
|
|
1129
|
+
hasRuntimeDefault: false;
|
|
1130
|
+
enumValues: [string, ...string[]];
|
|
1131
|
+
baseColumn: never;
|
|
1132
|
+
identity: undefined;
|
|
1133
|
+
generated: undefined;
|
|
1134
|
+
}, {}, {
|
|
1135
|
+
length: 10;
|
|
1136
|
+
}>;
|
|
1137
|
+
data: _$drizzle_orm_pg_core0.PgColumn<{
|
|
1138
|
+
name: "data";
|
|
1139
|
+
tableName: string;
|
|
1140
|
+
dataType: "json";
|
|
1141
|
+
columnType: "PgJsonb";
|
|
1142
|
+
data: unknown;
|
|
1143
|
+
driverParam: unknown;
|
|
1144
|
+
notNull: true;
|
|
1145
|
+
hasDefault: false;
|
|
1146
|
+
isPrimaryKey: false;
|
|
1147
|
+
isAutoincrement: false;
|
|
1148
|
+
hasRuntimeDefault: false;
|
|
1149
|
+
enumValues: undefined;
|
|
1150
|
+
baseColumn: never;
|
|
1151
|
+
identity: undefined;
|
|
1152
|
+
generated: undefined;
|
|
1153
|
+
}, {}, {}>;
|
|
1154
|
+
delta: _$drizzle_orm_pg_core0.PgColumn<{
|
|
1155
|
+
name: "delta";
|
|
1156
|
+
tableName: string;
|
|
1157
|
+
dataType: "json";
|
|
1158
|
+
columnType: "PgJsonb";
|
|
1159
|
+
data: unknown;
|
|
1160
|
+
driverParam: unknown;
|
|
1161
|
+
notNull: false;
|
|
1162
|
+
hasDefault: false;
|
|
1163
|
+
isPrimaryKey: false;
|
|
1164
|
+
isAutoincrement: false;
|
|
1165
|
+
hasRuntimeDefault: false;
|
|
1166
|
+
enumValues: undefined;
|
|
1167
|
+
baseColumn: never;
|
|
1168
|
+
identity: undefined;
|
|
1169
|
+
generated: undefined;
|
|
1170
|
+
}, {}, {}>;
|
|
1171
|
+
status: _$drizzle_orm_pg_core0.PgColumn<{
|
|
1172
|
+
name: "status";
|
|
1173
|
+
tableName: string;
|
|
1174
|
+
dataType: "string";
|
|
1175
|
+
columnType: "PgVarchar";
|
|
1176
|
+
data: string;
|
|
1177
|
+
driverParam: string;
|
|
1178
|
+
notNull: false;
|
|
1179
|
+
hasDefault: false;
|
|
1180
|
+
isPrimaryKey: false;
|
|
1181
|
+
isAutoincrement: false;
|
|
1182
|
+
hasRuntimeDefault: false;
|
|
1183
|
+
enumValues: [string, ...string[]];
|
|
1184
|
+
baseColumn: never;
|
|
1185
|
+
identity: undefined;
|
|
1186
|
+
generated: undefined;
|
|
1187
|
+
}, {}, {
|
|
1188
|
+
length: 20;
|
|
1189
|
+
}>;
|
|
1190
|
+
createdBy: _$drizzle_orm_pg_core0.PgColumn<{
|
|
1191
|
+
name: "created_by";
|
|
1192
|
+
tableName: string;
|
|
1193
|
+
dataType: "string";
|
|
1194
|
+
columnType: "PgVarchar";
|
|
1195
|
+
data: string;
|
|
1196
|
+
driverParam: string;
|
|
1197
|
+
notNull: false;
|
|
1198
|
+
hasDefault: false;
|
|
1199
|
+
isPrimaryKey: false;
|
|
1200
|
+
isAutoincrement: false;
|
|
1201
|
+
hasRuntimeDefault: false;
|
|
1202
|
+
enumValues: [string, ...string[]];
|
|
1203
|
+
baseColumn: never;
|
|
1204
|
+
identity: undefined;
|
|
1205
|
+
generated: undefined;
|
|
1206
|
+
}, {}, {
|
|
1207
|
+
length: 255;
|
|
1208
|
+
}>;
|
|
1209
|
+
createdByName: _$drizzle_orm_pg_core0.PgColumn<{
|
|
1210
|
+
name: "created_by_name";
|
|
1211
|
+
tableName: string;
|
|
1212
|
+
dataType: "string";
|
|
1213
|
+
columnType: "PgVarchar";
|
|
1214
|
+
data: string;
|
|
1215
|
+
driverParam: string;
|
|
1216
|
+
notNull: false;
|
|
1217
|
+
hasDefault: false;
|
|
1218
|
+
isPrimaryKey: false;
|
|
1219
|
+
isAutoincrement: false;
|
|
1220
|
+
hasRuntimeDefault: false;
|
|
1221
|
+
enumValues: [string, ...string[]];
|
|
1222
|
+
baseColumn: never;
|
|
1223
|
+
identity: undefined;
|
|
1224
|
+
generated: undefined;
|
|
1225
|
+
}, {}, {
|
|
1226
|
+
length: 255;
|
|
1227
|
+
}>;
|
|
1228
|
+
createdAt: _$drizzle_orm_pg_core0.PgColumn<{
|
|
1229
|
+
name: "created_at";
|
|
1230
|
+
tableName: string;
|
|
1231
|
+
dataType: "date";
|
|
1232
|
+
columnType: "PgTimestamp";
|
|
1233
|
+
data: Date;
|
|
1234
|
+
driverParam: string;
|
|
1235
|
+
notNull: true;
|
|
1236
|
+
hasDefault: true;
|
|
1237
|
+
isPrimaryKey: false;
|
|
1238
|
+
isAutoincrement: false;
|
|
1239
|
+
hasRuntimeDefault: false;
|
|
1240
|
+
enumValues: undefined;
|
|
1241
|
+
baseColumn: never;
|
|
1242
|
+
identity: undefined;
|
|
1243
|
+
generated: undefined;
|
|
1244
|
+
}, {}, {}>;
|
|
1245
|
+
isAutosave: _$drizzle_orm_pg_core0.PgColumn<{
|
|
1246
|
+
name: "is_autosave";
|
|
1247
|
+
tableName: string;
|
|
1248
|
+
dataType: "boolean";
|
|
1249
|
+
columnType: "PgBoolean";
|
|
1250
|
+
data: boolean;
|
|
1251
|
+
driverParam: boolean;
|
|
1252
|
+
notNull: true;
|
|
1253
|
+
hasDefault: true;
|
|
1254
|
+
isPrimaryKey: false;
|
|
1255
|
+
isAutoincrement: false;
|
|
1256
|
+
hasRuntimeDefault: false;
|
|
1257
|
+
enumValues: undefined;
|
|
1258
|
+
baseColumn: never;
|
|
1259
|
+
identity: undefined;
|
|
1260
|
+
generated: undefined;
|
|
1261
|
+
}, {}, {}>;
|
|
1262
|
+
};
|
|
1263
|
+
dialect: "pg";
|
|
1264
|
+
}>;
|
|
1265
|
+
/**
|
|
1266
|
+
* Shared content locks table — one per project, independent of any entity.
|
|
1267
|
+
* Included exactly once in `buildRuntimeSchema()` when any entity is publishable.
|
|
1268
|
+
*/
|
|
1269
|
+
declare function generateContentLocksSchema(): _$drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
1270
|
+
name: "toolkit_content_locks";
|
|
1271
|
+
schema: undefined;
|
|
1272
|
+
columns: {
|
|
1273
|
+
id: _$drizzle_orm_pg_core0.PgColumn<{
|
|
1274
|
+
name: "id";
|
|
1275
|
+
tableName: "toolkit_content_locks";
|
|
1276
|
+
dataType: "string";
|
|
1277
|
+
columnType: "PgUUID";
|
|
1278
|
+
data: string;
|
|
1279
|
+
driverParam: string;
|
|
1280
|
+
notNull: true;
|
|
1281
|
+
hasDefault: true;
|
|
1282
|
+
isPrimaryKey: true;
|
|
1283
|
+
isAutoincrement: false;
|
|
1284
|
+
hasRuntimeDefault: false;
|
|
1285
|
+
enumValues: undefined;
|
|
1286
|
+
baseColumn: never;
|
|
1287
|
+
identity: undefined;
|
|
1288
|
+
generated: undefined;
|
|
1289
|
+
}, {}, {}>;
|
|
1290
|
+
entityType: _$drizzle_orm_pg_core0.PgColumn<{
|
|
1291
|
+
name: "entity_type";
|
|
1292
|
+
tableName: "toolkit_content_locks";
|
|
1293
|
+
dataType: "string";
|
|
1294
|
+
columnType: "PgVarchar";
|
|
1295
|
+
data: string;
|
|
1296
|
+
driverParam: string;
|
|
1297
|
+
notNull: true;
|
|
1298
|
+
hasDefault: false;
|
|
1299
|
+
isPrimaryKey: false;
|
|
1300
|
+
isAutoincrement: false;
|
|
1301
|
+
hasRuntimeDefault: false;
|
|
1302
|
+
enumValues: [string, ...string[]];
|
|
1303
|
+
baseColumn: never;
|
|
1304
|
+
identity: undefined;
|
|
1305
|
+
generated: undefined;
|
|
1306
|
+
}, {}, {
|
|
1307
|
+
length: 100;
|
|
1308
|
+
}>;
|
|
1309
|
+
entityId: _$drizzle_orm_pg_core0.PgColumn<{
|
|
1310
|
+
name: "entity_id";
|
|
1311
|
+
tableName: "toolkit_content_locks";
|
|
1312
|
+
dataType: "string";
|
|
1313
|
+
columnType: "PgVarchar";
|
|
1314
|
+
data: string;
|
|
1315
|
+
driverParam: string;
|
|
1316
|
+
notNull: true;
|
|
1317
|
+
hasDefault: false;
|
|
1318
|
+
isPrimaryKey: false;
|
|
1319
|
+
isAutoincrement: false;
|
|
1320
|
+
hasRuntimeDefault: false;
|
|
1321
|
+
enumValues: [string, ...string[]];
|
|
1322
|
+
baseColumn: never;
|
|
1323
|
+
identity: undefined;
|
|
1324
|
+
generated: undefined;
|
|
1325
|
+
}, {}, {
|
|
1326
|
+
length: 255;
|
|
1327
|
+
}>;
|
|
1328
|
+
locale: _$drizzle_orm_pg_core0.PgColumn<{
|
|
1329
|
+
name: "locale";
|
|
1330
|
+
tableName: "toolkit_content_locks";
|
|
1331
|
+
dataType: "string";
|
|
1332
|
+
columnType: "PgVarchar";
|
|
1333
|
+
data: string;
|
|
1334
|
+
driverParam: string;
|
|
1335
|
+
notNull: true;
|
|
1336
|
+
hasDefault: true;
|
|
1337
|
+
isPrimaryKey: false;
|
|
1338
|
+
isAutoincrement: false;
|
|
1339
|
+
hasRuntimeDefault: false;
|
|
1340
|
+
enumValues: [string, ...string[]];
|
|
1341
|
+
baseColumn: never;
|
|
1342
|
+
identity: undefined;
|
|
1343
|
+
generated: undefined;
|
|
1344
|
+
}, {}, {
|
|
1345
|
+
length: 10;
|
|
1346
|
+
}>;
|
|
1347
|
+
lockedBy: _$drizzle_orm_pg_core0.PgColumn<{
|
|
1348
|
+
name: "locked_by";
|
|
1349
|
+
tableName: "toolkit_content_locks";
|
|
1350
|
+
dataType: "string";
|
|
1351
|
+
columnType: "PgVarchar";
|
|
1352
|
+
data: string;
|
|
1353
|
+
driverParam: string;
|
|
1354
|
+
notNull: true;
|
|
1355
|
+
hasDefault: false;
|
|
1356
|
+
isPrimaryKey: false;
|
|
1357
|
+
isAutoincrement: false;
|
|
1358
|
+
hasRuntimeDefault: false;
|
|
1359
|
+
enumValues: [string, ...string[]];
|
|
1360
|
+
baseColumn: never;
|
|
1361
|
+
identity: undefined;
|
|
1362
|
+
generated: undefined;
|
|
1363
|
+
}, {}, {
|
|
1364
|
+
length: 255;
|
|
1365
|
+
}>;
|
|
1366
|
+
lockedByName: _$drizzle_orm_pg_core0.PgColumn<{
|
|
1367
|
+
name: "locked_by_name";
|
|
1368
|
+
tableName: "toolkit_content_locks";
|
|
1369
|
+
dataType: "string";
|
|
1370
|
+
columnType: "PgVarchar";
|
|
1371
|
+
data: string;
|
|
1372
|
+
driverParam: string;
|
|
1373
|
+
notNull: false;
|
|
1374
|
+
hasDefault: false;
|
|
1375
|
+
isPrimaryKey: false;
|
|
1376
|
+
isAutoincrement: false;
|
|
1377
|
+
hasRuntimeDefault: false;
|
|
1378
|
+
enumValues: [string, ...string[]];
|
|
1379
|
+
baseColumn: never;
|
|
1380
|
+
identity: undefined;
|
|
1381
|
+
generated: undefined;
|
|
1382
|
+
}, {}, {
|
|
1383
|
+
length: 255;
|
|
1384
|
+
}>;
|
|
1385
|
+
lockedAt: _$drizzle_orm_pg_core0.PgColumn<{
|
|
1386
|
+
name: "locked_at";
|
|
1387
|
+
tableName: "toolkit_content_locks";
|
|
1388
|
+
dataType: "date";
|
|
1389
|
+
columnType: "PgTimestamp";
|
|
1390
|
+
data: Date;
|
|
1391
|
+
driverParam: string;
|
|
1392
|
+
notNull: true;
|
|
1393
|
+
hasDefault: true;
|
|
1394
|
+
isPrimaryKey: false;
|
|
1395
|
+
isAutoincrement: false;
|
|
1396
|
+
hasRuntimeDefault: false;
|
|
1397
|
+
enumValues: undefined;
|
|
1398
|
+
baseColumn: never;
|
|
1399
|
+
identity: undefined;
|
|
1400
|
+
generated: undefined;
|
|
1401
|
+
}, {}, {}>;
|
|
1402
|
+
expiresAt: _$drizzle_orm_pg_core0.PgColumn<{
|
|
1403
|
+
name: "expires_at";
|
|
1404
|
+
tableName: "toolkit_content_locks";
|
|
1405
|
+
dataType: "date";
|
|
1406
|
+
columnType: "PgTimestamp";
|
|
1407
|
+
data: Date;
|
|
1408
|
+
driverParam: string;
|
|
1409
|
+
notNull: true;
|
|
1410
|
+
hasDefault: false;
|
|
1411
|
+
isPrimaryKey: false;
|
|
1412
|
+
isAutoincrement: false;
|
|
1413
|
+
hasRuntimeDefault: false;
|
|
1414
|
+
enumValues: undefined;
|
|
1415
|
+
baseColumn: never;
|
|
1416
|
+
identity: undefined;
|
|
1417
|
+
generated: undefined;
|
|
1418
|
+
}, {}, {}>;
|
|
1419
|
+
};
|
|
1420
|
+
dialect: "pg";
|
|
1421
|
+
}>;
|
|
1422
|
+
/**
|
|
1423
|
+
* Check if an entity has blocks fields with translatable block content (non-localized mode).
|
|
1424
|
+
*/
|
|
1425
|
+
declare function hasTranslatableBlocks(entity: Entity): boolean;
|
|
1426
|
+
/**
|
|
1427
|
+
* Generate layout translation table for non-localized blocks with translatable fields.
|
|
1428
|
+
*
|
|
1429
|
+
* `layoutParent` is optional — when provided, emits a `.references()` FK
|
|
1430
|
+
* pointing at the corresponding `{entity}_layout` table (for migration
|
|
1431
|
+
* generation).
|
|
1432
|
+
*/
|
|
1433
|
+
declare function generateLayoutTranslationSchema(entity: Entity, layoutParent?: AnyTable): _$drizzle_orm_pg_core0.PgTableWithColumns<{
|
|
1434
|
+
name: string;
|
|
1435
|
+
schema: undefined;
|
|
1436
|
+
columns: {
|
|
1437
|
+
id: _$drizzle_orm_pg_core0.PgColumn<{
|
|
1438
|
+
name: "id";
|
|
1439
|
+
tableName: string;
|
|
1440
|
+
dataType: "string";
|
|
1441
|
+
columnType: "PgUUID";
|
|
1442
|
+
data: string;
|
|
1443
|
+
driverParam: string;
|
|
1444
|
+
notNull: true;
|
|
1445
|
+
hasDefault: true;
|
|
1446
|
+
isPrimaryKey: true;
|
|
1447
|
+
isAutoincrement: false;
|
|
1448
|
+
hasRuntimeDefault: false;
|
|
1449
|
+
enumValues: undefined;
|
|
1450
|
+
baseColumn: never;
|
|
1451
|
+
identity: undefined;
|
|
1452
|
+
generated: undefined;
|
|
1453
|
+
}, {}, {}>;
|
|
1454
|
+
layoutId: _$drizzle_orm_pg_core0.PgColumn<{
|
|
1455
|
+
name: "layout_id";
|
|
1456
|
+
tableName: string;
|
|
1457
|
+
dataType: "string";
|
|
1458
|
+
columnType: "PgUUID";
|
|
1459
|
+
data: string;
|
|
1460
|
+
driverParam: string;
|
|
1461
|
+
notNull: true;
|
|
1462
|
+
hasDefault: false;
|
|
1463
|
+
isPrimaryKey: false;
|
|
1464
|
+
isAutoincrement: false;
|
|
1465
|
+
hasRuntimeDefault: false;
|
|
1466
|
+
enumValues: undefined;
|
|
1467
|
+
baseColumn: never;
|
|
1468
|
+
identity: undefined;
|
|
1469
|
+
generated: undefined;
|
|
1470
|
+
}, {}, {}>;
|
|
1471
|
+
locale: _$drizzle_orm_pg_core0.PgColumn<{
|
|
1472
|
+
name: "locale";
|
|
1473
|
+
tableName: string;
|
|
1474
|
+
dataType: "string";
|
|
1475
|
+
columnType: "PgVarchar";
|
|
1476
|
+
data: string;
|
|
1477
|
+
driverParam: string;
|
|
1478
|
+
notNull: true;
|
|
1479
|
+
hasDefault: false;
|
|
1480
|
+
isPrimaryKey: false;
|
|
1481
|
+
isAutoincrement: false;
|
|
1482
|
+
hasRuntimeDefault: false;
|
|
1483
|
+
enumValues: [string, ...string[]];
|
|
1484
|
+
baseColumn: never;
|
|
1485
|
+
identity: undefined;
|
|
1486
|
+
generated: undefined;
|
|
1487
|
+
}, {}, {
|
|
1488
|
+
length: 10;
|
|
1489
|
+
}>;
|
|
1490
|
+
fields: _$drizzle_orm_pg_core0.PgColumn<{
|
|
1491
|
+
name: "fields";
|
|
1492
|
+
tableName: string;
|
|
1493
|
+
dataType: "json";
|
|
1494
|
+
columnType: "PgJsonb";
|
|
1495
|
+
data: unknown;
|
|
1496
|
+
driverParam: unknown;
|
|
1497
|
+
notNull: true;
|
|
1498
|
+
hasDefault: false;
|
|
1499
|
+
isPrimaryKey: false;
|
|
1500
|
+
isAutoincrement: false;
|
|
1501
|
+
hasRuntimeDefault: false;
|
|
1502
|
+
enumValues: undefined;
|
|
1503
|
+
baseColumn: never;
|
|
1504
|
+
identity: undefined;
|
|
1505
|
+
generated: undefined;
|
|
1506
|
+
}, {}, {}>;
|
|
1507
|
+
};
|
|
1508
|
+
dialect: "pg";
|
|
1509
|
+
}> | null;
|
|
1510
|
+
/**
|
|
1511
|
+
* Build the full runtime schema map for a list of entities.
|
|
1512
|
+
*
|
|
1513
|
+
* Returns a `Record<string, PgTable>` suitable for feeding into
|
|
1514
|
+
* `drizzle-kit/api`'s `generateDrizzleJson()`. Includes every table
|
|
1515
|
+
* that would have been emitted into `generated/schema.ts` by the old
|
|
1516
|
+
* codegen pipeline: main entity, translations, layout, layout
|
|
1517
|
+
* translations, versions, drafts, locale status, and the shared
|
|
1518
|
+
* content locks table.
|
|
1519
|
+
*
|
|
1520
|
+
* This is the single entry point used by `lumi migrate` — plugin
|
|
1521
|
+
* internal tables are added separately by reading each plugin's
|
|
1522
|
+
* `tables` field.
|
|
1523
|
+
*/
|
|
1524
|
+
declare function buildEntitySchemaMap(entities: Entity[]): Record<string, AnyTable>;
|
|
901
1525
|
//#endregion
|
|
902
|
-
export { type AuditableFields, type Behavior, type BehaviorFactory, type BlockDefinitionRef, type BlocksField, type BooleanField, CountCache, type CountCacheLike, type CursorInput, type DateField, type Entity, type EntityAdminConfig, type EntityDefinition, type EntityInput, type EntityUsage, type FieldConfig, type FieldToTS, type HierarchicalFields, type IdField, type InferCreateInput, type InferEntity, type InferEntityDTO, type InferUpdateInput, type JsonField, type MediaField, type NumberField, type PublishableFields, type ReferenceField, ReferencedEntityError, type RevisionableFields, type RichTextField, type SelectField, type SlugField, type SluggableFields, type SluggableOptions, type TextField, auditable, behavior, buildCursorCondition, decodeCursor, defineEntity, encodeCursor, estimateRowCount, field,
|
|
1526
|
+
export { type AuditableFields, type Behavior, type BehaviorFactory, type BlockDefinitionRef, type BlocksField, type BooleanField, CountCache, type CountCacheLike, type CursorInput, type DateField, type Entity, type EntityAdminConfig, type EntityDefinition, type EntityInput, type EntityUsage, type FieldConfig, type FieldToTS, type HierarchicalFields, type IdField, type InferCreateInput, type InferEntity, type InferEntityDTO, type InferUpdateInput, type JsonField, type MediaField, type NumberField, type PublishableFields, type ReferenceField, ReferencedEntityError, type RevisionableFields, type RichTextField, type SelectField, type SlugField, type SluggableFields, type SluggableOptions, type TextField, auditable, behavior, buildCursorCondition, buildEntitySchemaMap, decodeCursor, defineEntity, encodeCursor, estimateRowCount, field, generateContentLocksSchema, generateDraftsSchema, generateLayoutSchema, generateLayoutTranslationSchema, generateLocaleStatusSchema, generateSchema, generateTranslationSchema, generateVersionsSchema, hasBlocksFields, hasTranslatableBlocks, hierarchical, isPublishable, isVersionable, needsLocaleStatus, publishable, revisionable, sluggable, slugify, timestamped };
|
|
903
1527
|
//# sourceMappingURL=index.d.mts.map
|