@contentgrowth/content-auth 0.4.5 → 0.4.7
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/backend/index.d.ts +175 -287
- package/dist/backend/index.js +1 -1
- package/dist/{chunk-EXLDH66W.js → chunk-SGGYHP5S.js} +73 -37
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/backend/index.d.ts
CHANGED
|
@@ -47,49 +47,32 @@ declare function normalizeEmail(email: string): string;
|
|
|
47
47
|
*/
|
|
48
48
|
declare function isGmailAddress(email: string): boolean;
|
|
49
49
|
|
|
50
|
-
declare const createUsersTable: (tableName?: string, fields?: Record<string, string>) => drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
|
|
50
|
+
declare const createUsersTable: (tableName?: string, fields?: Record<string, string>, additionalFields?: Record<string, any>) => drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
|
|
51
51
|
name: string;
|
|
52
52
|
schema: undefined;
|
|
53
53
|
columns: {
|
|
54
|
-
|
|
55
|
-
name:
|
|
56
|
-
tableName: string;
|
|
57
|
-
dataType: "string";
|
|
58
|
-
columnType: "SQLiteText";
|
|
59
|
-
data: string;
|
|
60
|
-
driverParam: string;
|
|
61
|
-
notNull: true;
|
|
62
|
-
hasDefault: false;
|
|
63
|
-
isPrimaryKey: true;
|
|
64
|
-
isAutoincrement: false;
|
|
65
|
-
hasRuntimeDefault: false;
|
|
66
|
-
enumValues: [string, ...string[]];
|
|
67
|
-
baseColumn: never;
|
|
68
|
-
identity: undefined;
|
|
69
|
-
generated: undefined;
|
|
70
|
-
}, {}, {
|
|
71
|
-
length: number | undefined;
|
|
72
|
-
}>;
|
|
73
|
-
name: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
74
|
-
name: string;
|
|
54
|
+
[x: string]: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
55
|
+
name: any;
|
|
75
56
|
tableName: string;
|
|
76
|
-
dataType:
|
|
77
|
-
columnType:
|
|
78
|
-
data:
|
|
79
|
-
driverParam:
|
|
80
|
-
notNull:
|
|
57
|
+
dataType: any;
|
|
58
|
+
columnType: any;
|
|
59
|
+
data: any;
|
|
60
|
+
driverParam: any;
|
|
61
|
+
notNull: false;
|
|
81
62
|
hasDefault: false;
|
|
82
63
|
isPrimaryKey: false;
|
|
83
64
|
isAutoincrement: false;
|
|
84
65
|
hasRuntimeDefault: false;
|
|
85
|
-
enumValues:
|
|
66
|
+
enumValues: any;
|
|
86
67
|
baseColumn: never;
|
|
87
68
|
identity: undefined;
|
|
88
69
|
generated: undefined;
|
|
89
70
|
}, {}, {
|
|
90
|
-
|
|
71
|
+
[x: string]: any;
|
|
72
|
+
[x: number]: any;
|
|
73
|
+
[x: symbol]: any;
|
|
91
74
|
}>;
|
|
92
|
-
|
|
75
|
+
name: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
93
76
|
name: string;
|
|
94
77
|
tableName: string;
|
|
95
78
|
dataType: "string";
|
|
@@ -108,23 +91,6 @@ declare const createUsersTable: (tableName?: string, fields?: Record<string, str
|
|
|
108
91
|
}, {}, {
|
|
109
92
|
length: number | undefined;
|
|
110
93
|
}>;
|
|
111
|
-
emailVerified: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
112
|
-
name: string;
|
|
113
|
-
tableName: string;
|
|
114
|
-
dataType: "boolean";
|
|
115
|
-
columnType: "SQLiteBoolean";
|
|
116
|
-
data: boolean;
|
|
117
|
-
driverParam: number;
|
|
118
|
-
notNull: true;
|
|
119
|
-
hasDefault: false;
|
|
120
|
-
isPrimaryKey: false;
|
|
121
|
-
isAutoincrement: false;
|
|
122
|
-
hasRuntimeDefault: false;
|
|
123
|
-
enumValues: undefined;
|
|
124
|
-
baseColumn: never;
|
|
125
|
-
identity: undefined;
|
|
126
|
-
generated: undefined;
|
|
127
|
-
}, {}, {}>;
|
|
128
94
|
image: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
129
95
|
name: string;
|
|
130
96
|
tableName: string;
|
|
@@ -144,65 +110,33 @@ declare const createUsersTable: (tableName?: string, fields?: Record<string, str
|
|
|
144
110
|
}, {}, {
|
|
145
111
|
length: number | undefined;
|
|
146
112
|
}>;
|
|
147
|
-
createdAt: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
148
|
-
name: string;
|
|
149
|
-
tableName: string;
|
|
150
|
-
dataType: "date";
|
|
151
|
-
columnType: "SQLiteTimestamp";
|
|
152
|
-
data: Date;
|
|
153
|
-
driverParam: number;
|
|
154
|
-
notNull: true;
|
|
155
|
-
hasDefault: false;
|
|
156
|
-
isPrimaryKey: false;
|
|
157
|
-
isAutoincrement: false;
|
|
158
|
-
hasRuntimeDefault: false;
|
|
159
|
-
enumValues: undefined;
|
|
160
|
-
baseColumn: never;
|
|
161
|
-
identity: undefined;
|
|
162
|
-
generated: undefined;
|
|
163
|
-
}, {}, {}>;
|
|
164
|
-
updatedAt: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
165
|
-
name: string;
|
|
166
|
-
tableName: string;
|
|
167
|
-
dataType: "date";
|
|
168
|
-
columnType: "SQLiteTimestamp";
|
|
169
|
-
data: Date;
|
|
170
|
-
driverParam: number;
|
|
171
|
-
notNull: true;
|
|
172
|
-
hasDefault: false;
|
|
173
|
-
isPrimaryKey: false;
|
|
174
|
-
isAutoincrement: false;
|
|
175
|
-
hasRuntimeDefault: false;
|
|
176
|
-
enumValues: undefined;
|
|
177
|
-
baseColumn: never;
|
|
178
|
-
identity: undefined;
|
|
179
|
-
generated: undefined;
|
|
180
|
-
}, {}, {}>;
|
|
181
113
|
};
|
|
182
114
|
dialect: "sqlite";
|
|
183
115
|
}>;
|
|
184
|
-
declare const createSessionsTable: (tableName?: string, usersTableOrFn?: any, fields?: Record<string, string>) => drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
|
|
116
|
+
declare const createSessionsTable: (tableName?: string, usersTableOrFn?: any, fields?: Record<string, string>, userPkField?: string, additionalFields?: Record<string, any>) => drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
|
|
185
117
|
name: string;
|
|
186
118
|
schema: undefined;
|
|
187
119
|
columns: {
|
|
188
|
-
|
|
189
|
-
name:
|
|
120
|
+
[x: string]: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
121
|
+
name: any;
|
|
190
122
|
tableName: string;
|
|
191
|
-
dataType:
|
|
192
|
-
columnType:
|
|
193
|
-
data:
|
|
194
|
-
driverParam:
|
|
195
|
-
notNull:
|
|
123
|
+
dataType: any;
|
|
124
|
+
columnType: any;
|
|
125
|
+
data: any;
|
|
126
|
+
driverParam: any;
|
|
127
|
+
notNull: false;
|
|
196
128
|
hasDefault: false;
|
|
197
|
-
isPrimaryKey:
|
|
129
|
+
isPrimaryKey: false;
|
|
198
130
|
isAutoincrement: false;
|
|
199
131
|
hasRuntimeDefault: false;
|
|
200
|
-
enumValues:
|
|
132
|
+
enumValues: any;
|
|
201
133
|
baseColumn: never;
|
|
202
134
|
identity: undefined;
|
|
203
135
|
generated: undefined;
|
|
204
136
|
}, {}, {
|
|
205
|
-
|
|
137
|
+
[x: string]: any;
|
|
138
|
+
[x: number]: any;
|
|
139
|
+
[x: symbol]: any;
|
|
206
140
|
}>;
|
|
207
141
|
expiresAt: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
208
142
|
name: string;
|
|
@@ -353,28 +287,30 @@ declare const createSessionsTable: (tableName?: string, usersTableOrFn?: any, fi
|
|
|
353
287
|
};
|
|
354
288
|
dialect: "sqlite";
|
|
355
289
|
}>;
|
|
356
|
-
declare const createAccountsTable: (tableName?: string, usersTableOrFn?: any, fields?: Record<string, string>) => drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
|
|
290
|
+
declare const createAccountsTable: (tableName?: string, usersTableOrFn?: any, fields?: Record<string, string>, userPkField?: string, additionalFields?: Record<string, any>) => drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
|
|
357
291
|
name: string;
|
|
358
292
|
schema: undefined;
|
|
359
293
|
columns: {
|
|
360
|
-
|
|
361
|
-
name:
|
|
294
|
+
[x: string]: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
295
|
+
name: any;
|
|
362
296
|
tableName: string;
|
|
363
|
-
dataType:
|
|
364
|
-
columnType:
|
|
365
|
-
data:
|
|
366
|
-
driverParam:
|
|
367
|
-
notNull:
|
|
297
|
+
dataType: any;
|
|
298
|
+
columnType: any;
|
|
299
|
+
data: any;
|
|
300
|
+
driverParam: any;
|
|
301
|
+
notNull: false;
|
|
368
302
|
hasDefault: false;
|
|
369
|
-
isPrimaryKey:
|
|
303
|
+
isPrimaryKey: false;
|
|
370
304
|
isAutoincrement: false;
|
|
371
305
|
hasRuntimeDefault: false;
|
|
372
|
-
enumValues:
|
|
306
|
+
enumValues: any;
|
|
373
307
|
baseColumn: never;
|
|
374
308
|
identity: undefined;
|
|
375
309
|
generated: undefined;
|
|
376
310
|
}, {}, {
|
|
377
|
-
|
|
311
|
+
[x: string]: any;
|
|
312
|
+
[x: number]: any;
|
|
313
|
+
[x: symbol]: any;
|
|
378
314
|
}>;
|
|
379
315
|
accountId: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
380
316
|
name: string;
|
|
@@ -599,28 +535,30 @@ declare const createAccountsTable: (tableName?: string, usersTableOrFn?: any, fi
|
|
|
599
535
|
};
|
|
600
536
|
dialect: "sqlite";
|
|
601
537
|
}>;
|
|
602
|
-
declare const createVerificationsTable: (tableName?: string, fields?: Record<string, string>) => drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
|
|
538
|
+
declare const createVerificationsTable: (tableName?: string, fields?: Record<string, string>, additionalFields?: Record<string, any>) => drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
|
|
603
539
|
name: string;
|
|
604
540
|
schema: undefined;
|
|
605
541
|
columns: {
|
|
606
|
-
|
|
607
|
-
name:
|
|
542
|
+
[x: string]: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
543
|
+
name: any;
|
|
608
544
|
tableName: string;
|
|
609
|
-
dataType:
|
|
610
|
-
columnType:
|
|
611
|
-
data:
|
|
612
|
-
driverParam:
|
|
613
|
-
notNull:
|
|
545
|
+
dataType: any;
|
|
546
|
+
columnType: any;
|
|
547
|
+
data: any;
|
|
548
|
+
driverParam: any;
|
|
549
|
+
notNull: false;
|
|
614
550
|
hasDefault: false;
|
|
615
|
-
isPrimaryKey:
|
|
551
|
+
isPrimaryKey: false;
|
|
616
552
|
isAutoincrement: false;
|
|
617
553
|
hasRuntimeDefault: false;
|
|
618
|
-
enumValues:
|
|
554
|
+
enumValues: any;
|
|
619
555
|
baseColumn: never;
|
|
620
556
|
identity: undefined;
|
|
621
557
|
generated: undefined;
|
|
622
558
|
}, {}, {
|
|
623
|
-
|
|
559
|
+
[x: string]: any;
|
|
560
|
+
[x: number]: any;
|
|
561
|
+
[x: symbol]: any;
|
|
624
562
|
}>;
|
|
625
563
|
identifier: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
626
564
|
name: string;
|
|
@@ -714,28 +652,30 @@ declare const createVerificationsTable: (tableName?: string, fields?: Record<str
|
|
|
714
652
|
};
|
|
715
653
|
dialect: "sqlite";
|
|
716
654
|
}>;
|
|
717
|
-
declare const createOrganizationsTable: (tableName?: string, fields?: Record<string, string>) => drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
|
|
655
|
+
declare const createOrganizationsTable: (tableName?: string, fields?: Record<string, string>, additionalFields?: Record<string, any>) => drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
|
|
718
656
|
name: string;
|
|
719
657
|
schema: undefined;
|
|
720
658
|
columns: {
|
|
721
|
-
|
|
722
|
-
name:
|
|
659
|
+
[x: string]: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
660
|
+
name: any;
|
|
723
661
|
tableName: string;
|
|
724
|
-
dataType:
|
|
725
|
-
columnType:
|
|
726
|
-
data:
|
|
727
|
-
driverParam:
|
|
728
|
-
notNull:
|
|
662
|
+
dataType: any;
|
|
663
|
+
columnType: any;
|
|
664
|
+
data: any;
|
|
665
|
+
driverParam: any;
|
|
666
|
+
notNull: false;
|
|
729
667
|
hasDefault: false;
|
|
730
|
-
isPrimaryKey:
|
|
668
|
+
isPrimaryKey: false;
|
|
731
669
|
isAutoincrement: false;
|
|
732
670
|
hasRuntimeDefault: false;
|
|
733
|
-
enumValues:
|
|
671
|
+
enumValues: any;
|
|
734
672
|
baseColumn: never;
|
|
735
673
|
identity: undefined;
|
|
736
674
|
generated: undefined;
|
|
737
675
|
}, {}, {
|
|
738
|
-
|
|
676
|
+
[x: string]: any;
|
|
677
|
+
[x: number]: any;
|
|
678
|
+
[x: symbol]: any;
|
|
739
679
|
}>;
|
|
740
680
|
name: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
741
681
|
name: string;
|
|
@@ -833,28 +773,30 @@ declare const createOrganizationsTable: (tableName?: string, fields?: Record<str
|
|
|
833
773
|
};
|
|
834
774
|
dialect: "sqlite";
|
|
835
775
|
}>;
|
|
836
|
-
declare const createMembersTable: (tableName?: string, organizationsTableOrFn?: any, usersTableOrFn?: any, fields?: Record<string, string>) => drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
|
|
776
|
+
declare const createMembersTable: (tableName?: string, organizationsTableOrFn?: any, usersTableOrFn?: any, fields?: Record<string, string>, userPkField?: string, additionalFields?: Record<string, any>) => drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
|
|
837
777
|
name: string;
|
|
838
778
|
schema: undefined;
|
|
839
779
|
columns: {
|
|
840
|
-
|
|
841
|
-
name:
|
|
780
|
+
[x: string]: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
781
|
+
name: any;
|
|
842
782
|
tableName: string;
|
|
843
|
-
dataType:
|
|
844
|
-
columnType:
|
|
845
|
-
data:
|
|
846
|
-
driverParam:
|
|
847
|
-
notNull:
|
|
783
|
+
dataType: any;
|
|
784
|
+
columnType: any;
|
|
785
|
+
data: any;
|
|
786
|
+
driverParam: any;
|
|
787
|
+
notNull: false;
|
|
848
788
|
hasDefault: false;
|
|
849
|
-
isPrimaryKey:
|
|
789
|
+
isPrimaryKey: false;
|
|
850
790
|
isAutoincrement: false;
|
|
851
791
|
hasRuntimeDefault: false;
|
|
852
|
-
enumValues:
|
|
792
|
+
enumValues: any;
|
|
853
793
|
baseColumn: never;
|
|
854
794
|
identity: undefined;
|
|
855
795
|
generated: undefined;
|
|
856
796
|
}, {}, {
|
|
857
|
-
|
|
797
|
+
[x: string]: any;
|
|
798
|
+
[x: number]: any;
|
|
799
|
+
[x: symbol]: any;
|
|
858
800
|
}>;
|
|
859
801
|
organizationId: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
860
802
|
name: string;
|
|
@@ -933,28 +875,30 @@ declare const createMembersTable: (tableName?: string, organizationsTableOrFn?:
|
|
|
933
875
|
};
|
|
934
876
|
dialect: "sqlite";
|
|
935
877
|
}>;
|
|
936
|
-
declare const createInvitationsTable: (tableName?: string, organizationsTableOrFn?: any, usersTableOrFn?: any, fields?: Record<string, string>) => drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
|
|
878
|
+
declare const createInvitationsTable: (tableName?: string, organizationsTableOrFn?: any, usersTableOrFn?: any, fields?: Record<string, string>, userPkField?: string, additionalFields?: Record<string, any>) => drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
|
|
937
879
|
name: string;
|
|
938
880
|
schema: undefined;
|
|
939
881
|
columns: {
|
|
940
|
-
|
|
941
|
-
name:
|
|
882
|
+
[x: string]: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
883
|
+
name: any;
|
|
942
884
|
tableName: string;
|
|
943
|
-
dataType:
|
|
944
|
-
columnType:
|
|
945
|
-
data:
|
|
946
|
-
driverParam:
|
|
947
|
-
notNull:
|
|
885
|
+
dataType: any;
|
|
886
|
+
columnType: any;
|
|
887
|
+
data: any;
|
|
888
|
+
driverParam: any;
|
|
889
|
+
notNull: false;
|
|
948
890
|
hasDefault: false;
|
|
949
|
-
isPrimaryKey:
|
|
891
|
+
isPrimaryKey: false;
|
|
950
892
|
isAutoincrement: false;
|
|
951
893
|
hasRuntimeDefault: false;
|
|
952
|
-
enumValues:
|
|
894
|
+
enumValues: any;
|
|
953
895
|
baseColumn: never;
|
|
954
896
|
identity: undefined;
|
|
955
897
|
generated: undefined;
|
|
956
898
|
}, {}, {
|
|
957
|
-
|
|
899
|
+
[x: string]: any;
|
|
900
|
+
[x: number]: any;
|
|
901
|
+
[x: symbol]: any;
|
|
958
902
|
}>;
|
|
959
903
|
organizationId: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
960
904
|
name: string;
|
|
@@ -1092,45 +1036,28 @@ declare const users: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
|
|
|
1092
1036
|
name: string;
|
|
1093
1037
|
schema: undefined;
|
|
1094
1038
|
columns: {
|
|
1095
|
-
|
|
1096
|
-
name:
|
|
1097
|
-
tableName: string;
|
|
1098
|
-
dataType: "string";
|
|
1099
|
-
columnType: "SQLiteText";
|
|
1100
|
-
data: string;
|
|
1101
|
-
driverParam: string;
|
|
1102
|
-
notNull: true;
|
|
1103
|
-
hasDefault: false;
|
|
1104
|
-
isPrimaryKey: true;
|
|
1105
|
-
isAutoincrement: false;
|
|
1106
|
-
hasRuntimeDefault: false;
|
|
1107
|
-
enumValues: [string, ...string[]];
|
|
1108
|
-
baseColumn: never;
|
|
1109
|
-
identity: undefined;
|
|
1110
|
-
generated: undefined;
|
|
1111
|
-
}, {}, {
|
|
1112
|
-
length: number | undefined;
|
|
1113
|
-
}>;
|
|
1114
|
-
name: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
1115
|
-
name: string;
|
|
1039
|
+
[x: string]: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
1040
|
+
name: any;
|
|
1116
1041
|
tableName: string;
|
|
1117
|
-
dataType:
|
|
1118
|
-
columnType:
|
|
1119
|
-
data:
|
|
1120
|
-
driverParam:
|
|
1121
|
-
notNull:
|
|
1042
|
+
dataType: any;
|
|
1043
|
+
columnType: any;
|
|
1044
|
+
data: any;
|
|
1045
|
+
driverParam: any;
|
|
1046
|
+
notNull: false;
|
|
1122
1047
|
hasDefault: false;
|
|
1123
1048
|
isPrimaryKey: false;
|
|
1124
1049
|
isAutoincrement: false;
|
|
1125
1050
|
hasRuntimeDefault: false;
|
|
1126
|
-
enumValues:
|
|
1051
|
+
enumValues: any;
|
|
1127
1052
|
baseColumn: never;
|
|
1128
1053
|
identity: undefined;
|
|
1129
1054
|
generated: undefined;
|
|
1130
1055
|
}, {}, {
|
|
1131
|
-
|
|
1056
|
+
[x: string]: any;
|
|
1057
|
+
[x: number]: any;
|
|
1058
|
+
[x: symbol]: any;
|
|
1132
1059
|
}>;
|
|
1133
|
-
|
|
1060
|
+
name: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
1134
1061
|
name: string;
|
|
1135
1062
|
tableName: string;
|
|
1136
1063
|
dataType: "string";
|
|
@@ -1149,23 +1076,6 @@ declare const users: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
|
|
|
1149
1076
|
}, {}, {
|
|
1150
1077
|
length: number | undefined;
|
|
1151
1078
|
}>;
|
|
1152
|
-
emailVerified: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
1153
|
-
name: string;
|
|
1154
|
-
tableName: string;
|
|
1155
|
-
dataType: "boolean";
|
|
1156
|
-
columnType: "SQLiteBoolean";
|
|
1157
|
-
data: boolean;
|
|
1158
|
-
driverParam: number;
|
|
1159
|
-
notNull: true;
|
|
1160
|
-
hasDefault: false;
|
|
1161
|
-
isPrimaryKey: false;
|
|
1162
|
-
isAutoincrement: false;
|
|
1163
|
-
hasRuntimeDefault: false;
|
|
1164
|
-
enumValues: undefined;
|
|
1165
|
-
baseColumn: never;
|
|
1166
|
-
identity: undefined;
|
|
1167
|
-
generated: undefined;
|
|
1168
|
-
}, {}, {}>;
|
|
1169
1079
|
image: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
1170
1080
|
name: string;
|
|
1171
1081
|
tableName: string;
|
|
@@ -1185,40 +1095,6 @@ declare const users: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
|
|
|
1185
1095
|
}, {}, {
|
|
1186
1096
|
length: number | undefined;
|
|
1187
1097
|
}>;
|
|
1188
|
-
createdAt: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
1189
|
-
name: string;
|
|
1190
|
-
tableName: string;
|
|
1191
|
-
dataType: "date";
|
|
1192
|
-
columnType: "SQLiteTimestamp";
|
|
1193
|
-
data: Date;
|
|
1194
|
-
driverParam: number;
|
|
1195
|
-
notNull: true;
|
|
1196
|
-
hasDefault: false;
|
|
1197
|
-
isPrimaryKey: false;
|
|
1198
|
-
isAutoincrement: false;
|
|
1199
|
-
hasRuntimeDefault: false;
|
|
1200
|
-
enumValues: undefined;
|
|
1201
|
-
baseColumn: never;
|
|
1202
|
-
identity: undefined;
|
|
1203
|
-
generated: undefined;
|
|
1204
|
-
}, {}, {}>;
|
|
1205
|
-
updatedAt: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
1206
|
-
name: string;
|
|
1207
|
-
tableName: string;
|
|
1208
|
-
dataType: "date";
|
|
1209
|
-
columnType: "SQLiteTimestamp";
|
|
1210
|
-
data: Date;
|
|
1211
|
-
driverParam: number;
|
|
1212
|
-
notNull: true;
|
|
1213
|
-
hasDefault: false;
|
|
1214
|
-
isPrimaryKey: false;
|
|
1215
|
-
isAutoincrement: false;
|
|
1216
|
-
hasRuntimeDefault: false;
|
|
1217
|
-
enumValues: undefined;
|
|
1218
|
-
baseColumn: never;
|
|
1219
|
-
identity: undefined;
|
|
1220
|
-
generated: undefined;
|
|
1221
|
-
}, {}, {}>;
|
|
1222
1098
|
};
|
|
1223
1099
|
dialect: "sqlite";
|
|
1224
1100
|
}>;
|
|
@@ -1226,24 +1102,26 @@ declare const organizations: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
|
|
|
1226
1102
|
name: string;
|
|
1227
1103
|
schema: undefined;
|
|
1228
1104
|
columns: {
|
|
1229
|
-
|
|
1230
|
-
name:
|
|
1105
|
+
[x: string]: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
1106
|
+
name: any;
|
|
1231
1107
|
tableName: string;
|
|
1232
|
-
dataType:
|
|
1233
|
-
columnType:
|
|
1234
|
-
data:
|
|
1235
|
-
driverParam:
|
|
1236
|
-
notNull:
|
|
1108
|
+
dataType: any;
|
|
1109
|
+
columnType: any;
|
|
1110
|
+
data: any;
|
|
1111
|
+
driverParam: any;
|
|
1112
|
+
notNull: false;
|
|
1237
1113
|
hasDefault: false;
|
|
1238
|
-
isPrimaryKey:
|
|
1114
|
+
isPrimaryKey: false;
|
|
1239
1115
|
isAutoincrement: false;
|
|
1240
1116
|
hasRuntimeDefault: false;
|
|
1241
|
-
enumValues:
|
|
1117
|
+
enumValues: any;
|
|
1242
1118
|
baseColumn: never;
|
|
1243
1119
|
identity: undefined;
|
|
1244
1120
|
generated: undefined;
|
|
1245
1121
|
}, {}, {
|
|
1246
|
-
|
|
1122
|
+
[x: string]: any;
|
|
1123
|
+
[x: number]: any;
|
|
1124
|
+
[x: symbol]: any;
|
|
1247
1125
|
}>;
|
|
1248
1126
|
name: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
1249
1127
|
name: string;
|
|
@@ -1345,24 +1223,26 @@ declare const sessions: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
|
|
|
1345
1223
|
name: string;
|
|
1346
1224
|
schema: undefined;
|
|
1347
1225
|
columns: {
|
|
1348
|
-
|
|
1349
|
-
name:
|
|
1226
|
+
[x: string]: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
1227
|
+
name: any;
|
|
1350
1228
|
tableName: string;
|
|
1351
|
-
dataType:
|
|
1352
|
-
columnType:
|
|
1353
|
-
data:
|
|
1354
|
-
driverParam:
|
|
1355
|
-
notNull:
|
|
1229
|
+
dataType: any;
|
|
1230
|
+
columnType: any;
|
|
1231
|
+
data: any;
|
|
1232
|
+
driverParam: any;
|
|
1233
|
+
notNull: false;
|
|
1356
1234
|
hasDefault: false;
|
|
1357
|
-
isPrimaryKey:
|
|
1235
|
+
isPrimaryKey: false;
|
|
1358
1236
|
isAutoincrement: false;
|
|
1359
1237
|
hasRuntimeDefault: false;
|
|
1360
|
-
enumValues:
|
|
1238
|
+
enumValues: any;
|
|
1361
1239
|
baseColumn: never;
|
|
1362
1240
|
identity: undefined;
|
|
1363
1241
|
generated: undefined;
|
|
1364
1242
|
}, {}, {
|
|
1365
|
-
|
|
1243
|
+
[x: string]: any;
|
|
1244
|
+
[x: number]: any;
|
|
1245
|
+
[x: symbol]: any;
|
|
1366
1246
|
}>;
|
|
1367
1247
|
expiresAt: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
1368
1248
|
name: string;
|
|
@@ -1517,24 +1397,26 @@ declare const accounts: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
|
|
|
1517
1397
|
name: string;
|
|
1518
1398
|
schema: undefined;
|
|
1519
1399
|
columns: {
|
|
1520
|
-
|
|
1521
|
-
name:
|
|
1400
|
+
[x: string]: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
1401
|
+
name: any;
|
|
1522
1402
|
tableName: string;
|
|
1523
|
-
dataType:
|
|
1524
|
-
columnType:
|
|
1525
|
-
data:
|
|
1526
|
-
driverParam:
|
|
1527
|
-
notNull:
|
|
1403
|
+
dataType: any;
|
|
1404
|
+
columnType: any;
|
|
1405
|
+
data: any;
|
|
1406
|
+
driverParam: any;
|
|
1407
|
+
notNull: false;
|
|
1528
1408
|
hasDefault: false;
|
|
1529
|
-
isPrimaryKey:
|
|
1409
|
+
isPrimaryKey: false;
|
|
1530
1410
|
isAutoincrement: false;
|
|
1531
1411
|
hasRuntimeDefault: false;
|
|
1532
|
-
enumValues:
|
|
1412
|
+
enumValues: any;
|
|
1533
1413
|
baseColumn: never;
|
|
1534
1414
|
identity: undefined;
|
|
1535
1415
|
generated: undefined;
|
|
1536
1416
|
}, {}, {
|
|
1537
|
-
|
|
1417
|
+
[x: string]: any;
|
|
1418
|
+
[x: number]: any;
|
|
1419
|
+
[x: symbol]: any;
|
|
1538
1420
|
}>;
|
|
1539
1421
|
accountId: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
1540
1422
|
name: string;
|
|
@@ -1763,24 +1645,26 @@ declare const verifications: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
|
|
|
1763
1645
|
name: string;
|
|
1764
1646
|
schema: undefined;
|
|
1765
1647
|
columns: {
|
|
1766
|
-
|
|
1767
|
-
name:
|
|
1648
|
+
[x: string]: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
1649
|
+
name: any;
|
|
1768
1650
|
tableName: string;
|
|
1769
|
-
dataType:
|
|
1770
|
-
columnType:
|
|
1771
|
-
data:
|
|
1772
|
-
driverParam:
|
|
1773
|
-
notNull:
|
|
1651
|
+
dataType: any;
|
|
1652
|
+
columnType: any;
|
|
1653
|
+
data: any;
|
|
1654
|
+
driverParam: any;
|
|
1655
|
+
notNull: false;
|
|
1774
1656
|
hasDefault: false;
|
|
1775
|
-
isPrimaryKey:
|
|
1657
|
+
isPrimaryKey: false;
|
|
1776
1658
|
isAutoincrement: false;
|
|
1777
1659
|
hasRuntimeDefault: false;
|
|
1778
|
-
enumValues:
|
|
1660
|
+
enumValues: any;
|
|
1779
1661
|
baseColumn: never;
|
|
1780
1662
|
identity: undefined;
|
|
1781
1663
|
generated: undefined;
|
|
1782
1664
|
}, {}, {
|
|
1783
|
-
|
|
1665
|
+
[x: string]: any;
|
|
1666
|
+
[x: number]: any;
|
|
1667
|
+
[x: symbol]: any;
|
|
1784
1668
|
}>;
|
|
1785
1669
|
identifier: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
1786
1670
|
name: string;
|
|
@@ -1878,24 +1762,26 @@ declare const members: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
|
|
|
1878
1762
|
name: string;
|
|
1879
1763
|
schema: undefined;
|
|
1880
1764
|
columns: {
|
|
1881
|
-
|
|
1882
|
-
name:
|
|
1765
|
+
[x: string]: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
1766
|
+
name: any;
|
|
1883
1767
|
tableName: string;
|
|
1884
|
-
dataType:
|
|
1885
|
-
columnType:
|
|
1886
|
-
data:
|
|
1887
|
-
driverParam:
|
|
1888
|
-
notNull:
|
|
1768
|
+
dataType: any;
|
|
1769
|
+
columnType: any;
|
|
1770
|
+
data: any;
|
|
1771
|
+
driverParam: any;
|
|
1772
|
+
notNull: false;
|
|
1889
1773
|
hasDefault: false;
|
|
1890
|
-
isPrimaryKey:
|
|
1774
|
+
isPrimaryKey: false;
|
|
1891
1775
|
isAutoincrement: false;
|
|
1892
1776
|
hasRuntimeDefault: false;
|
|
1893
|
-
enumValues:
|
|
1777
|
+
enumValues: any;
|
|
1894
1778
|
baseColumn: never;
|
|
1895
1779
|
identity: undefined;
|
|
1896
1780
|
generated: undefined;
|
|
1897
1781
|
}, {}, {
|
|
1898
|
-
|
|
1782
|
+
[x: string]: any;
|
|
1783
|
+
[x: number]: any;
|
|
1784
|
+
[x: symbol]: any;
|
|
1899
1785
|
}>;
|
|
1900
1786
|
organizationId: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
1901
1787
|
name: string;
|
|
@@ -1978,24 +1864,26 @@ declare const invitations: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
|
|
|
1978
1864
|
name: string;
|
|
1979
1865
|
schema: undefined;
|
|
1980
1866
|
columns: {
|
|
1981
|
-
|
|
1982
|
-
name:
|
|
1867
|
+
[x: string]: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
1868
|
+
name: any;
|
|
1983
1869
|
tableName: string;
|
|
1984
|
-
dataType:
|
|
1985
|
-
columnType:
|
|
1986
|
-
data:
|
|
1987
|
-
driverParam:
|
|
1988
|
-
notNull:
|
|
1870
|
+
dataType: any;
|
|
1871
|
+
columnType: any;
|
|
1872
|
+
data: any;
|
|
1873
|
+
driverParam: any;
|
|
1874
|
+
notNull: false;
|
|
1989
1875
|
hasDefault: false;
|
|
1990
|
-
isPrimaryKey:
|
|
1876
|
+
isPrimaryKey: false;
|
|
1991
1877
|
isAutoincrement: false;
|
|
1992
1878
|
hasRuntimeDefault: false;
|
|
1993
|
-
enumValues:
|
|
1879
|
+
enumValues: any;
|
|
1994
1880
|
baseColumn: never;
|
|
1995
1881
|
identity: undefined;
|
|
1996
1882
|
generated: undefined;
|
|
1997
1883
|
}, {}, {
|
|
1998
|
-
|
|
1884
|
+
[x: string]: any;
|
|
1885
|
+
[x: number]: any;
|
|
1886
|
+
[x: symbol]: any;
|
|
1999
1887
|
}>;
|
|
2000
1888
|
organizationId: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
2001
1889
|
name: string;
|
package/dist/backend/index.js
CHANGED
|
@@ -120,36 +120,65 @@ __export(schema_exports, {
|
|
|
120
120
|
verifications: () => verifications
|
|
121
121
|
});
|
|
122
122
|
import { sqliteTable, text, integer } from "drizzle-orm/sqlite-core";
|
|
123
|
-
var
|
|
124
|
-
|
|
123
|
+
var createAdditionalColumns = (additionalFields) => {
|
|
124
|
+
if (!additionalFields) return {};
|
|
125
|
+
const columns = {};
|
|
126
|
+
Object.entries(additionalFields).forEach(([key, config]) => {
|
|
127
|
+
const type = typeof config === "string" ? config : config.type;
|
|
128
|
+
const isRequired = typeof config === "object" && config.required;
|
|
129
|
+
let col;
|
|
130
|
+
if (type === "string") {
|
|
131
|
+
col = text(key);
|
|
132
|
+
} else if (type === "number") {
|
|
133
|
+
col = integer(key);
|
|
134
|
+
} else if (type === "boolean") {
|
|
135
|
+
col = integer(key, { mode: "boolean" });
|
|
136
|
+
} else if (type === "date") {
|
|
137
|
+
col = integer(key, { mode: "timestamp" });
|
|
138
|
+
} else {
|
|
139
|
+
col = text(key);
|
|
140
|
+
}
|
|
141
|
+
if (isRequired && col) {
|
|
142
|
+
col = col.notNull();
|
|
143
|
+
}
|
|
144
|
+
if (col) {
|
|
145
|
+
columns[key] = col;
|
|
146
|
+
}
|
|
147
|
+
});
|
|
148
|
+
return columns;
|
|
149
|
+
};
|
|
150
|
+
var createUsersTable = (tableName = "users", fields, additionalFields) => sqliteTable(tableName, {
|
|
151
|
+
[fields?.id || "id"]: text(fields?.id || "id").primaryKey(),
|
|
125
152
|
name: text(fields?.name || "name").notNull(),
|
|
126
|
-
email: text(fields?.email || "email").notNull().unique(),
|
|
127
|
-
emailVerified: integer(fields?.emailVerified || "emailVerified", { mode: "boolean" }).notNull(),
|
|
153
|
+
[fields?.email || "email"]: text(fields?.email || "email").notNull().unique(),
|
|
154
|
+
[fields?.emailVerified || "emailVerified"]: integer(fields?.emailVerified || "emailVerified", { mode: "boolean" }).notNull(),
|
|
128
155
|
image: text(fields?.image || "image"),
|
|
129
|
-
createdAt: integer(fields?.createdAt || "createdAt", { mode: "timestamp" }).notNull(),
|
|
130
|
-
updatedAt: integer(fields?.updatedAt || "updatedAt", { mode: "timestamp" }).notNull()
|
|
156
|
+
[fields?.createdAt || "createdAt"]: integer(fields?.createdAt || "createdAt", { mode: "timestamp" }).notNull(),
|
|
157
|
+
[fields?.updatedAt || "updatedAt"]: integer(fields?.updatedAt || "updatedAt", { mode: "timestamp" }).notNull(),
|
|
158
|
+
...createAdditionalColumns(additionalFields)
|
|
131
159
|
});
|
|
132
|
-
var createSessionsTable = (tableName = "sessions", usersTableOrFn = users, fields) => {
|
|
160
|
+
var createSessionsTable = (tableName = "sessions", usersTableOrFn = users, fields, userPkField = "id", additionalFields) => {
|
|
133
161
|
const usersTable = typeof usersTableOrFn === "function" ? usersTableOrFn() : usersTableOrFn;
|
|
134
162
|
return sqliteTable(tableName, {
|
|
135
|
-
id: text(fields?.id || "id").primaryKey(),
|
|
163
|
+
[fields?.id || "id"]: text(fields?.id || "id").primaryKey(),
|
|
136
164
|
expiresAt: integer(fields?.expiresAt || "expiresAt", { mode: "timestamp" }).notNull(),
|
|
137
165
|
token: text(fields?.token || "token").notNull().unique(),
|
|
138
166
|
createdAt: integer(fields?.createdAt || "createdAt", { mode: "timestamp" }).notNull(),
|
|
139
167
|
updatedAt: integer(fields?.updatedAt || "updatedAt", { mode: "timestamp" }).notNull(),
|
|
140
168
|
ipAddress: text(fields?.ipAddress || "ipAddress"),
|
|
141
169
|
userAgent: text(fields?.userAgent || "userAgent"),
|
|
142
|
-
userId: text(fields?.userId || "userId").notNull().references(() => usersTable
|
|
143
|
-
activeOrganizationId: text(fields?.activeOrganizationId || "activeOrganizationId")
|
|
170
|
+
userId: text(fields?.userId || "userId").notNull().references(() => usersTable[userPkField], { onDelete: "cascade" }),
|
|
171
|
+
activeOrganizationId: text(fields?.activeOrganizationId || "activeOrganizationId"),
|
|
172
|
+
...createAdditionalColumns(additionalFields)
|
|
144
173
|
});
|
|
145
174
|
};
|
|
146
|
-
var createAccountsTable = (tableName = "accounts", usersTableOrFn = users, fields) => {
|
|
175
|
+
var createAccountsTable = (tableName = "accounts", usersTableOrFn = users, fields, userPkField = "id", additionalFields) => {
|
|
147
176
|
const usersTable = typeof usersTableOrFn === "function" ? usersTableOrFn() : usersTableOrFn;
|
|
148
177
|
return sqliteTable(tableName, {
|
|
149
|
-
id: text(fields?.id || "id").primaryKey(),
|
|
178
|
+
[fields?.id || "id"]: text(fields?.id || "id").primaryKey(),
|
|
150
179
|
accountId: text(fields?.accountId || "accountId").notNull(),
|
|
151
180
|
providerId: text(fields?.providerId || "providerId").notNull(),
|
|
152
|
-
userId: text(fields?.userId || "userId").notNull().references(() => usersTable
|
|
181
|
+
userId: text(fields?.userId || "userId").notNull().references(() => usersTable[userPkField], { onDelete: "cascade" }),
|
|
153
182
|
accessToken: text(fields?.accessToken || "accessToken"),
|
|
154
183
|
refreshToken: text(fields?.refreshToken || "refreshToken"),
|
|
155
184
|
idToken: text(fields?.idToken || "idToken"),
|
|
@@ -158,48 +187,54 @@ var createAccountsTable = (tableName = "accounts", usersTableOrFn = users, field
|
|
|
158
187
|
scope: text(fields?.scope || "scope"),
|
|
159
188
|
password: text(fields?.password || "password"),
|
|
160
189
|
createdAt: integer(fields?.createdAt || "createdAt", { mode: "timestamp" }).notNull(),
|
|
161
|
-
updatedAt: integer(fields?.updatedAt || "updatedAt", { mode: "timestamp" }).notNull()
|
|
190
|
+
updatedAt: integer(fields?.updatedAt || "updatedAt", { mode: "timestamp" }).notNull(),
|
|
191
|
+
...createAdditionalColumns(additionalFields)
|
|
162
192
|
});
|
|
163
193
|
};
|
|
164
|
-
var createVerificationsTable = (tableName = "verifications", fields) => sqliteTable(tableName, {
|
|
165
|
-
id: text(fields?.id || "id").primaryKey(),
|
|
194
|
+
var createVerificationsTable = (tableName = "verifications", fields, additionalFields) => sqliteTable(tableName, {
|
|
195
|
+
[fields?.id || "id"]: text(fields?.id || "id").primaryKey(),
|
|
166
196
|
identifier: text(fields?.identifier || "identifier").notNull(),
|
|
167
197
|
value: text(fields?.value || "value").notNull(),
|
|
168
198
|
expiresAt: integer(fields?.expiresAt || "expiresAt", { mode: "timestamp" }).notNull(),
|
|
169
199
|
createdAt: integer(fields?.createdAt || "createdAt", { mode: "timestamp" }),
|
|
170
|
-
updatedAt: integer(fields?.updatedAt || "updatedAt", { mode: "timestamp" })
|
|
200
|
+
updatedAt: integer(fields?.updatedAt || "updatedAt", { mode: "timestamp" }),
|
|
201
|
+
...createAdditionalColumns(additionalFields)
|
|
171
202
|
});
|
|
172
|
-
var createOrganizationsTable = (tableName = "organizations", fields) => sqliteTable(tableName, {
|
|
173
|
-
id: text(fields?.id || "id").primaryKey(),
|
|
203
|
+
var createOrganizationsTable = (tableName = "organizations", fields, additionalFields) => sqliteTable(tableName, {
|
|
204
|
+
[fields?.id || "id"]: text(fields?.id || "id").primaryKey(),
|
|
174
205
|
name: text(fields?.name || "name").notNull(),
|
|
175
206
|
slug: text(fields?.slug || "slug").unique(),
|
|
176
207
|
logo: text(fields?.logo || "logo"),
|
|
177
208
|
createdAt: integer(fields?.createdAt || "createdAt", { mode: "timestamp" }).notNull(),
|
|
178
|
-
metadata: text(fields?.metadata || "metadata")
|
|
209
|
+
metadata: text(fields?.metadata || "metadata"),
|
|
210
|
+
...createAdditionalColumns(additionalFields)
|
|
179
211
|
});
|
|
180
|
-
var createMembersTable = (tableName = "members", organizationsTableOrFn = organizations, usersTableOrFn = users, fields) => {
|
|
212
|
+
var createMembersTable = (tableName = "members", organizationsTableOrFn = organizations, usersTableOrFn = users, fields, userPkField = "id", additionalFields) => {
|
|
181
213
|
const organizationsTable = typeof organizationsTableOrFn === "function" ? organizationsTableOrFn() : organizationsTableOrFn;
|
|
182
214
|
const usersTable = typeof usersTableOrFn === "function" ? usersTableOrFn() : usersTableOrFn;
|
|
183
215
|
return sqliteTable(tableName, {
|
|
184
|
-
id: text(fields?.id || "id").primaryKey(),
|
|
185
|
-
organizationId: text(fields?.organizationId || "organizationId").notNull().references(() => organizationsTable.id, { onDelete: "cascade" }),
|
|
186
|
-
|
|
216
|
+
[fields?.id || "id"]: text(fields?.id || "id").primaryKey(),
|
|
217
|
+
organizationId: text(fields?.organizationId || "organizationId").notNull().references(() => organizationsTable[fields?.organizationId || "id"] || organizationsTable.id, { onDelete: "cascade" }),
|
|
218
|
+
// Partial fix for org FK too?
|
|
219
|
+
userId: text(fields?.userId || "userId").notNull().references(() => usersTable[userPkField], { onDelete: "cascade" }),
|
|
187
220
|
role: text(fields?.role || "role").notNull(),
|
|
188
|
-
createdAt: integer(fields?.createdAt || "createdAt", { mode: "timestamp" }).notNull()
|
|
221
|
+
createdAt: integer(fields?.createdAt || "createdAt", { mode: "timestamp" }).notNull(),
|
|
222
|
+
...createAdditionalColumns(additionalFields)
|
|
189
223
|
});
|
|
190
224
|
};
|
|
191
|
-
var createInvitationsTable = (tableName = "invitations", organizationsTableOrFn = organizations, usersTableOrFn = users, fields) => {
|
|
225
|
+
var createInvitationsTable = (tableName = "invitations", organizationsTableOrFn = organizations, usersTableOrFn = users, fields, userPkField = "id", additionalFields) => {
|
|
192
226
|
const organizationsTable = typeof organizationsTableOrFn === "function" ? organizationsTableOrFn() : organizationsTableOrFn;
|
|
193
227
|
const usersTable = typeof usersTableOrFn === "function" ? usersTableOrFn() : usersTableOrFn;
|
|
194
228
|
return sqliteTable(tableName, {
|
|
195
|
-
id: text(fields?.id || "id").primaryKey(),
|
|
196
|
-
organizationId: text(fields?.organizationId || "organizationId").notNull().references(() => organizationsTable.id, { onDelete: "cascade" }),
|
|
229
|
+
[fields?.id || "id"]: text(fields?.id || "id").primaryKey(),
|
|
230
|
+
organizationId: text(fields?.organizationId || "organizationId").notNull().references(() => organizationsTable[fields?.organizationId || "id"] || organizationsTable.id, { onDelete: "cascade" }),
|
|
197
231
|
email: text(fields?.email || "email").notNull(),
|
|
198
232
|
role: text(fields?.role || "role"),
|
|
199
233
|
status: text(fields?.status || "status").notNull(),
|
|
200
234
|
expiresAt: integer(fields?.expiresAt || "expiresAt", { mode: "timestamp" }).notNull(),
|
|
201
|
-
inviterId: text(fields?.inviterId || "inviterId").notNull().references(() => usersTable
|
|
202
|
-
createdAt: integer(fields?.createdAt || "createdAt", { mode: "timestamp" }).notNull()
|
|
235
|
+
inviterId: text(fields?.inviterId || "inviterId").notNull().references(() => usersTable[userPkField], { onDelete: "cascade" }),
|
|
236
|
+
createdAt: integer(fields?.createdAt || "createdAt", { mode: "timestamp" }).notNull(),
|
|
237
|
+
...createAdditionalColumns(additionalFields)
|
|
203
238
|
});
|
|
204
239
|
};
|
|
205
240
|
var users = createUsersTable();
|
|
@@ -348,13 +383,14 @@ var createAuth = (config) => {
|
|
|
348
383
|
const orgTableName = schemaMapping?.organization?.tableName || "organizations";
|
|
349
384
|
const memberTableName = schemaMapping?.member?.tableName || "members";
|
|
350
385
|
const invitationTableName = schemaMapping?.invitation?.tableName || "invitations";
|
|
351
|
-
const
|
|
352
|
-
const
|
|
353
|
-
const
|
|
354
|
-
const
|
|
355
|
-
const
|
|
356
|
-
const
|
|
357
|
-
const
|
|
386
|
+
const userPkField = schemaMapping?.user?.fields?.id || "id";
|
|
387
|
+
const usersTable = createUsersTable(userTableName, schemaMapping?.user?.fields, schemaMapping?.user?.additionalFields);
|
|
388
|
+
const organizationsTable = createOrganizationsTable(orgTableName, schemaMapping?.organization?.fields, schemaMapping?.organization?.additionalFields);
|
|
389
|
+
const sessionsTable = createSessionsTable(sessionTableName, usersTable, schemaMapping?.session?.fields, userPkField, schemaMapping?.session?.additionalFields);
|
|
390
|
+
const accountsTable = createAccountsTable(accountTableName, usersTable, schemaMapping?.account?.fields, userPkField, schemaMapping?.account?.additionalFields);
|
|
391
|
+
const verificationsTable = createVerificationsTable(verificationTableName, schemaMapping?.verification?.fields, schemaMapping?.verification?.additionalFields);
|
|
392
|
+
const membersTable = createMembersTable(memberTableName, organizationsTable, usersTable, schemaMapping?.member?.fields, userPkField, schemaMapping?.member?.additionalFields);
|
|
393
|
+
const invitationsTable = createInvitationsTable(invitationTableName, organizationsTable, usersTable, schemaMapping?.invitation?.fields, userPkField, schemaMapping?.invitation?.additionalFields);
|
|
358
394
|
const userKey = schemaMapping?.user?.tableName || "user";
|
|
359
395
|
const sessionKey = schemaMapping?.session?.tableName || "session";
|
|
360
396
|
const accountKey = schemaMapping?.account?.tableName || "account";
|
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentgrowth/content-auth",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.7",
|
|
4
4
|
"description": "Better Auth wrapper with UI components for Cloudflare Workers & Pages. Includes custom schema mapping, Turnstile bot protection, and email normalization.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|