@contentgrowth/content-auth 0.4.6 → 0.4.8

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.
@@ -47,27 +47,50 @@ 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
54
  [x: string]: drizzle_orm_sqlite_core.SQLiteColumn<{
55
- name: string;
55
+ name: any;
56
56
  tableName: string;
57
- dataType: "string" | "boolean" | "date";
58
- columnType: "SQLiteText" | "SQLiteBoolean" | "SQLiteTimestamp";
59
- data: string | boolean | Date;
60
- driverParam: string | number;
57
+ dataType: any;
58
+ columnType: any;
59
+ data: any;
60
+ driverParam: any;
61
61
  notNull: false;
62
62
  hasDefault: false;
63
63
  isPrimaryKey: false;
64
64
  isAutoincrement: false;
65
65
  hasRuntimeDefault: false;
66
- enumValues: [string, ...string[]] | undefined;
66
+ enumValues: any;
67
67
  baseColumn: never;
68
68
  identity: undefined;
69
69
  generated: undefined;
70
- }, {}, {}>;
70
+ }, {}, {
71
+ [x: string]: any;
72
+ [x: number]: any;
73
+ [x: symbol]: any;
74
+ }>;
75
+ id: drizzle_orm_sqlite_core.SQLiteColumn<{
76
+ name: string;
77
+ tableName: string;
78
+ dataType: "string";
79
+ columnType: "SQLiteText";
80
+ data: string;
81
+ driverParam: string;
82
+ notNull: true;
83
+ hasDefault: false;
84
+ isPrimaryKey: true;
85
+ isAutoincrement: false;
86
+ hasRuntimeDefault: false;
87
+ enumValues: [string, ...string[]];
88
+ baseColumn: never;
89
+ identity: undefined;
90
+ generated: undefined;
91
+ }, {}, {
92
+ length: number | undefined;
93
+ }>;
71
94
  name: drizzle_orm_sqlite_core.SQLiteColumn<{
72
95
  name: string;
73
96
  tableName: string;
@@ -87,6 +110,42 @@ declare const createUsersTable: (tableName?: string, fields?: Record<string, str
87
110
  }, {}, {
88
111
  length: number | undefined;
89
112
  }>;
113
+ email: drizzle_orm_sqlite_core.SQLiteColumn<{
114
+ name: string;
115
+ tableName: string;
116
+ dataType: "string";
117
+ columnType: "SQLiteText";
118
+ data: string;
119
+ driverParam: string;
120
+ notNull: true;
121
+ hasDefault: false;
122
+ isPrimaryKey: false;
123
+ isAutoincrement: false;
124
+ hasRuntimeDefault: false;
125
+ enumValues: [string, ...string[]];
126
+ baseColumn: never;
127
+ identity: undefined;
128
+ generated: undefined;
129
+ }, {}, {
130
+ length: number | undefined;
131
+ }>;
132
+ emailVerified: drizzle_orm_sqlite_core.SQLiteColumn<{
133
+ name: string;
134
+ tableName: string;
135
+ dataType: "boolean";
136
+ columnType: "SQLiteBoolean";
137
+ data: boolean;
138
+ driverParam: number;
139
+ notNull: true;
140
+ hasDefault: false;
141
+ isPrimaryKey: false;
142
+ isAutoincrement: false;
143
+ hasRuntimeDefault: false;
144
+ enumValues: undefined;
145
+ baseColumn: never;
146
+ identity: undefined;
147
+ generated: undefined;
148
+ }, {}, {}>;
90
149
  image: drizzle_orm_sqlite_core.SQLiteColumn<{
91
150
  name: string;
92
151
  tableName: string;
@@ -106,30 +165,87 @@ declare const createUsersTable: (tableName?: string, fields?: Record<string, str
106
165
  }, {}, {
107
166
  length: number | undefined;
108
167
  }>;
168
+ createdAt: drizzle_orm_sqlite_core.SQLiteColumn<{
169
+ name: string;
170
+ tableName: string;
171
+ dataType: "date";
172
+ columnType: "SQLiteTimestamp";
173
+ data: Date;
174
+ driverParam: number;
175
+ notNull: true;
176
+ hasDefault: false;
177
+ isPrimaryKey: false;
178
+ isAutoincrement: false;
179
+ hasRuntimeDefault: false;
180
+ enumValues: undefined;
181
+ baseColumn: never;
182
+ identity: undefined;
183
+ generated: undefined;
184
+ }, {}, {}>;
185
+ updatedAt: drizzle_orm_sqlite_core.SQLiteColumn<{
186
+ name: string;
187
+ tableName: string;
188
+ dataType: "date";
189
+ columnType: "SQLiteTimestamp";
190
+ data: Date;
191
+ driverParam: number;
192
+ notNull: true;
193
+ hasDefault: false;
194
+ isPrimaryKey: false;
195
+ isAutoincrement: false;
196
+ hasRuntimeDefault: false;
197
+ enumValues: undefined;
198
+ baseColumn: never;
199
+ identity: undefined;
200
+ generated: undefined;
201
+ }, {}, {}>;
109
202
  };
110
203
  dialect: "sqlite";
111
204
  }>;
112
- declare const createSessionsTable: (tableName?: string, usersTableOrFn?: any, fields?: Record<string, string>, userPkField?: string) => drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
205
+ declare const createSessionsTable: (tableName?: string, usersTableOrFn?: any, fields?: Record<string, string>, userPkField?: string, additionalFields?: Record<string, any>) => drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
113
206
  name: string;
114
207
  schema: undefined;
115
208
  columns: {
116
209
  [x: string]: drizzle_orm_sqlite_core.SQLiteColumn<{
117
- name: string;
210
+ name: any;
118
211
  tableName: string;
119
- dataType: "string" | "date";
120
- columnType: "SQLiteText" | "SQLiteTimestamp";
121
- data: string | Date;
122
- driverParam: string | number;
212
+ dataType: any;
213
+ columnType: any;
214
+ data: any;
215
+ driverParam: any;
123
216
  notNull: false;
124
217
  hasDefault: false;
125
218
  isPrimaryKey: false;
126
219
  isAutoincrement: false;
127
220
  hasRuntimeDefault: false;
128
- enumValues: [string, ...string[]] | undefined;
221
+ enumValues: any;
129
222
  baseColumn: never;
130
223
  identity: undefined;
131
224
  generated: undefined;
132
- }, {}, {}>;
225
+ }, {}, {
226
+ [x: string]: any;
227
+ [x: number]: any;
228
+ [x: symbol]: any;
229
+ }>;
230
+ id: drizzle_orm_sqlite_core.SQLiteColumn<{
231
+ name: string;
232
+ tableName: string;
233
+ dataType: "string";
234
+ columnType: "SQLiteText";
235
+ data: string;
236
+ driverParam: string;
237
+ notNull: true;
238
+ hasDefault: false;
239
+ isPrimaryKey: true;
240
+ isAutoincrement: false;
241
+ hasRuntimeDefault: false;
242
+ enumValues: [string, ...string[]];
243
+ baseColumn: never;
244
+ identity: undefined;
245
+ generated: undefined;
246
+ }, {}, {
247
+ length: number | undefined;
248
+ }>;
133
249
  expiresAt: drizzle_orm_sqlite_core.SQLiteColumn<{
134
250
  name: string;
135
251
  tableName: string;
@@ -279,27 +395,50 @@ declare const createSessionsTable: (tableName?: string, usersTableOrFn?: any, fi
279
395
  };
280
396
  dialect: "sqlite";
281
397
  }>;
282
- declare const createAccountsTable: (tableName?: string, usersTableOrFn?: any, fields?: Record<string, string>, userPkField?: string) => drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
398
+ declare const createAccountsTable: (tableName?: string, usersTableOrFn?: any, fields?: Record<string, string>, userPkField?: string, additionalFields?: Record<string, any>) => drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
283
399
  name: string;
284
400
  schema: undefined;
285
401
  columns: {
286
402
  [x: string]: drizzle_orm_sqlite_core.SQLiteColumn<{
287
- name: string;
403
+ name: any;
288
404
  tableName: string;
289
- dataType: "string" | "date";
290
- columnType: "SQLiteText" | "SQLiteTimestamp";
291
- data: string | Date;
292
- driverParam: string | number;
405
+ dataType: any;
406
+ columnType: any;
407
+ data: any;
408
+ driverParam: any;
293
409
  notNull: false;
294
410
  hasDefault: false;
295
411
  isPrimaryKey: false;
296
412
  isAutoincrement: false;
297
413
  hasRuntimeDefault: false;
298
- enumValues: [string, ...string[]] | undefined;
414
+ enumValues: any;
299
415
  baseColumn: never;
300
416
  identity: undefined;
301
417
  generated: undefined;
302
- }, {}, {}>;
418
+ }, {}, {
419
+ [x: string]: any;
420
+ [x: number]: any;
421
+ [x: symbol]: any;
422
+ }>;
423
+ id: drizzle_orm_sqlite_core.SQLiteColumn<{
424
+ name: string;
425
+ tableName: string;
426
+ dataType: "string";
427
+ columnType: "SQLiteText";
428
+ data: string;
429
+ driverParam: string;
430
+ notNull: true;
431
+ hasDefault: false;
432
+ isPrimaryKey: true;
433
+ isAutoincrement: false;
434
+ hasRuntimeDefault: false;
435
+ enumValues: [string, ...string[]];
436
+ baseColumn: never;
437
+ identity: undefined;
438
+ generated: undefined;
439
+ }, {}, {
440
+ length: number | undefined;
441
+ }>;
303
442
  accountId: drizzle_orm_sqlite_core.SQLiteColumn<{
304
443
  name: string;
305
444
  tableName: string;
@@ -523,27 +662,50 @@ declare const createAccountsTable: (tableName?: string, usersTableOrFn?: any, fi
523
662
  };
524
663
  dialect: "sqlite";
525
664
  }>;
526
- declare const createVerificationsTable: (tableName?: string, fields?: Record<string, string>) => drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
665
+ declare const createVerificationsTable: (tableName?: string, fields?: Record<string, string>, additionalFields?: Record<string, any>) => drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
527
666
  name: string;
528
667
  schema: undefined;
529
668
  columns: {
530
669
  [x: string]: drizzle_orm_sqlite_core.SQLiteColumn<{
531
- name: string;
670
+ name: any;
532
671
  tableName: string;
533
- dataType: "string" | "date";
534
- columnType: "SQLiteText" | "SQLiteTimestamp";
535
- data: string | Date;
536
- driverParam: string | number;
672
+ dataType: any;
673
+ columnType: any;
674
+ data: any;
675
+ driverParam: any;
537
676
  notNull: false;
538
677
  hasDefault: false;
539
678
  isPrimaryKey: false;
540
679
  isAutoincrement: false;
541
680
  hasRuntimeDefault: false;
542
- enumValues: [string, ...string[]] | undefined;
681
+ enumValues: any;
543
682
  baseColumn: never;
544
683
  identity: undefined;
545
684
  generated: undefined;
546
- }, {}, {}>;
685
+ }, {}, {
686
+ [x: string]: any;
687
+ [x: number]: any;
688
+ [x: symbol]: any;
689
+ }>;
690
+ id: drizzle_orm_sqlite_core.SQLiteColumn<{
691
+ name: string;
692
+ tableName: string;
693
+ dataType: "string";
694
+ columnType: "SQLiteText";
695
+ data: string;
696
+ driverParam: string;
697
+ notNull: true;
698
+ hasDefault: false;
699
+ isPrimaryKey: true;
700
+ isAutoincrement: false;
701
+ hasRuntimeDefault: false;
702
+ enumValues: [string, ...string[]];
703
+ baseColumn: never;
704
+ identity: undefined;
705
+ generated: undefined;
706
+ }, {}, {
707
+ length: number | undefined;
708
+ }>;
547
709
  identifier: drizzle_orm_sqlite_core.SQLiteColumn<{
548
710
  name: string;
549
711
  tableName: string;
@@ -636,27 +798,50 @@ declare const createVerificationsTable: (tableName?: string, fields?: Record<str
636
798
  };
637
799
  dialect: "sqlite";
638
800
  }>;
639
- declare const createOrganizationsTable: (tableName?: string, fields?: Record<string, string>) => drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
801
+ declare const createOrganizationsTable: (tableName?: string, fields?: Record<string, string>, additionalFields?: Record<string, any>) => drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
640
802
  name: string;
641
803
  schema: undefined;
642
804
  columns: {
643
805
  [x: string]: drizzle_orm_sqlite_core.SQLiteColumn<{
644
- name: string;
806
+ name: any;
645
807
  tableName: string;
646
- dataType: "string" | "date";
647
- columnType: "SQLiteText" | "SQLiteTimestamp";
648
- data: string | Date;
649
- driverParam: string | number;
808
+ dataType: any;
809
+ columnType: any;
810
+ data: any;
811
+ driverParam: any;
650
812
  notNull: false;
651
813
  hasDefault: false;
652
814
  isPrimaryKey: false;
653
815
  isAutoincrement: false;
654
816
  hasRuntimeDefault: false;
655
- enumValues: [string, ...string[]] | undefined;
817
+ enumValues: any;
656
818
  baseColumn: never;
657
819
  identity: undefined;
658
820
  generated: undefined;
659
- }, {}, {}>;
821
+ }, {}, {
822
+ [x: string]: any;
823
+ [x: number]: any;
824
+ [x: symbol]: any;
825
+ }>;
826
+ id: drizzle_orm_sqlite_core.SQLiteColumn<{
827
+ name: string;
828
+ tableName: string;
829
+ dataType: "string";
830
+ columnType: "SQLiteText";
831
+ data: string;
832
+ driverParam: string;
833
+ notNull: true;
834
+ hasDefault: false;
835
+ isPrimaryKey: true;
836
+ isAutoincrement: false;
837
+ hasRuntimeDefault: false;
838
+ enumValues: [string, ...string[]];
839
+ baseColumn: never;
840
+ identity: undefined;
841
+ generated: undefined;
842
+ }, {}, {
843
+ length: number | undefined;
844
+ }>;
660
845
  name: drizzle_orm_sqlite_core.SQLiteColumn<{
661
846
  name: string;
662
847
  tableName: string;
@@ -753,27 +938,50 @@ declare const createOrganizationsTable: (tableName?: string, fields?: Record<str
753
938
  };
754
939
  dialect: "sqlite";
755
940
  }>;
756
- declare const createMembersTable: (tableName?: string, organizationsTableOrFn?: any, usersTableOrFn?: any, fields?: Record<string, string>, userPkField?: string) => drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
941
+ declare const createMembersTable: (tableName?: string, organizationsTableOrFn?: any, usersTableOrFn?: any, fields?: Record<string, string>, userPkField?: string, additionalFields?: Record<string, any>) => drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
757
942
  name: string;
758
943
  schema: undefined;
759
944
  columns: {
760
945
  [x: string]: drizzle_orm_sqlite_core.SQLiteColumn<{
946
+ name: any;
947
+ tableName: string;
948
+ dataType: any;
949
+ columnType: any;
950
+ data: any;
951
+ driverParam: any;
952
+ notNull: false;
953
+ hasDefault: false;
954
+ isPrimaryKey: false;
955
+ isAutoincrement: false;
956
+ hasRuntimeDefault: false;
957
+ enumValues: any;
958
+ baseColumn: never;
959
+ identity: undefined;
960
+ generated: undefined;
961
+ }, {}, {
962
+ [x: string]: any;
963
+ [x: number]: any;
964
+ [x: symbol]: any;
965
+ }>;
966
+ id: drizzle_orm_sqlite_core.SQLiteColumn<{
761
967
  name: string;
762
968
  tableName: string;
763
- dataType: "string" | "date";
764
- columnType: "SQLiteText" | "SQLiteTimestamp";
765
- data: string | Date;
766
- driverParam: string | number;
969
+ dataType: "string";
970
+ columnType: "SQLiteText";
971
+ data: string;
972
+ driverParam: string;
767
973
  notNull: true;
768
974
  hasDefault: false;
769
- isPrimaryKey: false;
975
+ isPrimaryKey: true;
770
976
  isAutoincrement: false;
771
977
  hasRuntimeDefault: false;
772
- enumValues: [string, ...string[]] | undefined;
978
+ enumValues: [string, ...string[]];
773
979
  baseColumn: never;
774
980
  identity: undefined;
775
981
  generated: undefined;
776
- }, {}, {}>;
982
+ }, {}, {
983
+ length: number | undefined;
984
+ }>;
777
985
  organizationId: drizzle_orm_sqlite_core.SQLiteColumn<{
778
986
  name: string;
779
987
  tableName: string;
@@ -851,27 +1059,50 @@ declare const createMembersTable: (tableName?: string, organizationsTableOrFn?:
851
1059
  };
852
1060
  dialect: "sqlite";
853
1061
  }>;
854
- declare const createInvitationsTable: (tableName?: string, organizationsTableOrFn?: any, usersTableOrFn?: any, fields?: Record<string, string>, userPkField?: string) => drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
1062
+ declare const createInvitationsTable: (tableName?: string, organizationsTableOrFn?: any, usersTableOrFn?: any, fields?: Record<string, string>, userPkField?: string, additionalFields?: Record<string, any>) => drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
855
1063
  name: string;
856
1064
  schema: undefined;
857
1065
  columns: {
858
1066
  [x: string]: drizzle_orm_sqlite_core.SQLiteColumn<{
859
- name: string;
1067
+ name: any;
860
1068
  tableName: string;
861
- dataType: "string" | "date";
862
- columnType: "SQLiteText" | "SQLiteTimestamp";
863
- data: string | Date;
864
- driverParam: string | number;
1069
+ dataType: any;
1070
+ columnType: any;
1071
+ data: any;
1072
+ driverParam: any;
865
1073
  notNull: false;
866
1074
  hasDefault: false;
867
1075
  isPrimaryKey: false;
868
1076
  isAutoincrement: false;
869
1077
  hasRuntimeDefault: false;
870
- enumValues: [string, ...string[]] | undefined;
1078
+ enumValues: any;
871
1079
  baseColumn: never;
872
1080
  identity: undefined;
873
1081
  generated: undefined;
874
- }, {}, {}>;
1082
+ }, {}, {
1083
+ [x: string]: any;
1084
+ [x: number]: any;
1085
+ [x: symbol]: any;
1086
+ }>;
1087
+ id: drizzle_orm_sqlite_core.SQLiteColumn<{
1088
+ name: string;
1089
+ tableName: string;
1090
+ dataType: "string";
1091
+ columnType: "SQLiteText";
1092
+ data: string;
1093
+ driverParam: string;
1094
+ notNull: true;
1095
+ hasDefault: false;
1096
+ isPrimaryKey: true;
1097
+ isAutoincrement: false;
1098
+ hasRuntimeDefault: false;
1099
+ enumValues: [string, ...string[]];
1100
+ baseColumn: never;
1101
+ identity: undefined;
1102
+ generated: undefined;
1103
+ }, {}, {
1104
+ length: number | undefined;
1105
+ }>;
875
1106
  organizationId: drizzle_orm_sqlite_core.SQLiteColumn<{
876
1107
  name: string;
877
1108
  tableName: string;
@@ -1009,22 +1240,45 @@ declare const users: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
1009
1240
  schema: undefined;
1010
1241
  columns: {
1011
1242
  [x: string]: drizzle_orm_sqlite_core.SQLiteColumn<{
1012
- name: string;
1243
+ name: any;
1013
1244
  tableName: string;
1014
- dataType: "string" | "boolean" | "date";
1015
- columnType: "SQLiteText" | "SQLiteBoolean" | "SQLiteTimestamp";
1016
- data: string | boolean | Date;
1017
- driverParam: string | number;
1245
+ dataType: any;
1246
+ columnType: any;
1247
+ data: any;
1248
+ driverParam: any;
1018
1249
  notNull: false;
1019
1250
  hasDefault: false;
1020
1251
  isPrimaryKey: false;
1021
1252
  isAutoincrement: false;
1022
1253
  hasRuntimeDefault: false;
1023
- enumValues: [string, ...string[]] | undefined;
1254
+ enumValues: any;
1024
1255
  baseColumn: never;
1025
1256
  identity: undefined;
1026
1257
  generated: undefined;
1027
- }, {}, {}>;
1258
+ }, {}, {
1259
+ [x: string]: any;
1260
+ [x: number]: any;
1261
+ [x: symbol]: any;
1262
+ }>;
1263
+ id: drizzle_orm_sqlite_core.SQLiteColumn<{
1264
+ name: string;
1265
+ tableName: string;
1266
+ dataType: "string";
1267
+ columnType: "SQLiteText";
1268
+ data: string;
1269
+ driverParam: string;
1270
+ notNull: true;
1271
+ hasDefault: false;
1272
+ isPrimaryKey: true;
1273
+ isAutoincrement: false;
1274
+ hasRuntimeDefault: false;
1275
+ enumValues: [string, ...string[]];
1276
+ baseColumn: never;
1277
+ identity: undefined;
1278
+ generated: undefined;
1279
+ }, {}, {
1280
+ length: number | undefined;
1281
+ }>;
1028
1282
  name: drizzle_orm_sqlite_core.SQLiteColumn<{
1029
1283
  name: string;
1030
1284
  tableName: string;
@@ -1044,6 +1298,42 @@ declare const users: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
1044
1298
  }, {}, {
1045
1299
  length: number | undefined;
1046
1300
  }>;
1301
+ email: drizzle_orm_sqlite_core.SQLiteColumn<{
1302
+ name: string;
1303
+ tableName: string;
1304
+ dataType: "string";
1305
+ columnType: "SQLiteText";
1306
+ data: string;
1307
+ driverParam: string;
1308
+ notNull: true;
1309
+ hasDefault: false;
1310
+ isPrimaryKey: false;
1311
+ isAutoincrement: false;
1312
+ hasRuntimeDefault: false;
1313
+ enumValues: [string, ...string[]];
1314
+ baseColumn: never;
1315
+ identity: undefined;
1316
+ generated: undefined;
1317
+ }, {}, {
1318
+ length: number | undefined;
1319
+ }>;
1320
+ emailVerified: drizzle_orm_sqlite_core.SQLiteColumn<{
1321
+ name: string;
1322
+ tableName: string;
1323
+ dataType: "boolean";
1324
+ columnType: "SQLiteBoolean";
1325
+ data: boolean;
1326
+ driverParam: number;
1327
+ notNull: true;
1328
+ hasDefault: false;
1329
+ isPrimaryKey: false;
1330
+ isAutoincrement: false;
1331
+ hasRuntimeDefault: false;
1332
+ enumValues: undefined;
1333
+ baseColumn: never;
1334
+ identity: undefined;
1335
+ generated: undefined;
1336
+ }, {}, {}>;
1047
1337
  image: drizzle_orm_sqlite_core.SQLiteColumn<{
1048
1338
  name: string;
1049
1339
  tableName: string;
@@ -1063,6 +1353,40 @@ declare const users: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
1063
1353
  }, {}, {
1064
1354
  length: number | undefined;
1065
1355
  }>;
1356
+ createdAt: drizzle_orm_sqlite_core.SQLiteColumn<{
1357
+ name: string;
1358
+ tableName: string;
1359
+ dataType: "date";
1360
+ columnType: "SQLiteTimestamp";
1361
+ data: Date;
1362
+ driverParam: number;
1363
+ notNull: true;
1364
+ hasDefault: false;
1365
+ isPrimaryKey: false;
1366
+ isAutoincrement: false;
1367
+ hasRuntimeDefault: false;
1368
+ enumValues: undefined;
1369
+ baseColumn: never;
1370
+ identity: undefined;
1371
+ generated: undefined;
1372
+ }, {}, {}>;
1373
+ updatedAt: drizzle_orm_sqlite_core.SQLiteColumn<{
1374
+ name: string;
1375
+ tableName: string;
1376
+ dataType: "date";
1377
+ columnType: "SQLiteTimestamp";
1378
+ data: Date;
1379
+ driverParam: number;
1380
+ notNull: true;
1381
+ hasDefault: false;
1382
+ isPrimaryKey: false;
1383
+ isAutoincrement: false;
1384
+ hasRuntimeDefault: false;
1385
+ enumValues: undefined;
1386
+ baseColumn: never;
1387
+ identity: undefined;
1388
+ generated: undefined;
1389
+ }, {}, {}>;
1066
1390
  };
1067
1391
  dialect: "sqlite";
1068
1392
  }>;
@@ -1071,22 +1395,45 @@ declare const organizations: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
1071
1395
  schema: undefined;
1072
1396
  columns: {
1073
1397
  [x: string]: drizzle_orm_sqlite_core.SQLiteColumn<{
1074
- name: string;
1398
+ name: any;
1075
1399
  tableName: string;
1076
- dataType: "string" | "date";
1077
- columnType: "SQLiteText" | "SQLiteTimestamp";
1078
- data: string | Date;
1079
- driverParam: string | number;
1400
+ dataType: any;
1401
+ columnType: any;
1402
+ data: any;
1403
+ driverParam: any;
1080
1404
  notNull: false;
1081
1405
  hasDefault: false;
1082
1406
  isPrimaryKey: false;
1083
1407
  isAutoincrement: false;
1084
1408
  hasRuntimeDefault: false;
1085
- enumValues: [string, ...string[]] | undefined;
1409
+ enumValues: any;
1086
1410
  baseColumn: never;
1087
1411
  identity: undefined;
1088
1412
  generated: undefined;
1089
- }, {}, {}>;
1413
+ }, {}, {
1414
+ [x: string]: any;
1415
+ [x: number]: any;
1416
+ [x: symbol]: any;
1417
+ }>;
1418
+ id: drizzle_orm_sqlite_core.SQLiteColumn<{
1419
+ name: string;
1420
+ tableName: string;
1421
+ dataType: "string";
1422
+ columnType: "SQLiteText";
1423
+ data: string;
1424
+ driverParam: string;
1425
+ notNull: true;
1426
+ hasDefault: false;
1427
+ isPrimaryKey: true;
1428
+ isAutoincrement: false;
1429
+ hasRuntimeDefault: false;
1430
+ enumValues: [string, ...string[]];
1431
+ baseColumn: never;
1432
+ identity: undefined;
1433
+ generated: undefined;
1434
+ }, {}, {
1435
+ length: number | undefined;
1436
+ }>;
1090
1437
  name: drizzle_orm_sqlite_core.SQLiteColumn<{
1091
1438
  name: string;
1092
1439
  tableName: string;
@@ -1188,22 +1535,45 @@ declare const sessions: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
1188
1535
  schema: undefined;
1189
1536
  columns: {
1190
1537
  [x: string]: drizzle_orm_sqlite_core.SQLiteColumn<{
1191
- name: string;
1538
+ name: any;
1192
1539
  tableName: string;
1193
- dataType: "string" | "date";
1194
- columnType: "SQLiteText" | "SQLiteTimestamp";
1195
- data: string | Date;
1196
- driverParam: string | number;
1540
+ dataType: any;
1541
+ columnType: any;
1542
+ data: any;
1543
+ driverParam: any;
1197
1544
  notNull: false;
1198
1545
  hasDefault: false;
1199
1546
  isPrimaryKey: false;
1200
1547
  isAutoincrement: false;
1201
1548
  hasRuntimeDefault: false;
1202
- enumValues: [string, ...string[]] | undefined;
1549
+ enumValues: any;
1203
1550
  baseColumn: never;
1204
1551
  identity: undefined;
1205
1552
  generated: undefined;
1206
- }, {}, {}>;
1553
+ }, {}, {
1554
+ [x: string]: any;
1555
+ [x: number]: any;
1556
+ [x: symbol]: any;
1557
+ }>;
1558
+ id: drizzle_orm_sqlite_core.SQLiteColumn<{
1559
+ name: string;
1560
+ tableName: string;
1561
+ dataType: "string";
1562
+ columnType: "SQLiteText";
1563
+ data: string;
1564
+ driverParam: string;
1565
+ notNull: true;
1566
+ hasDefault: false;
1567
+ isPrimaryKey: true;
1568
+ isAutoincrement: false;
1569
+ hasRuntimeDefault: false;
1570
+ enumValues: [string, ...string[]];
1571
+ baseColumn: never;
1572
+ identity: undefined;
1573
+ generated: undefined;
1574
+ }, {}, {
1575
+ length: number | undefined;
1576
+ }>;
1207
1577
  expiresAt: drizzle_orm_sqlite_core.SQLiteColumn<{
1208
1578
  name: string;
1209
1579
  tableName: string;
@@ -1358,22 +1728,45 @@ declare const accounts: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
1358
1728
  schema: undefined;
1359
1729
  columns: {
1360
1730
  [x: string]: drizzle_orm_sqlite_core.SQLiteColumn<{
1361
- name: string;
1731
+ name: any;
1362
1732
  tableName: string;
1363
- dataType: "string" | "date";
1364
- columnType: "SQLiteText" | "SQLiteTimestamp";
1365
- data: string | Date;
1366
- driverParam: string | number;
1733
+ dataType: any;
1734
+ columnType: any;
1735
+ data: any;
1736
+ driverParam: any;
1367
1737
  notNull: false;
1368
1738
  hasDefault: false;
1369
1739
  isPrimaryKey: false;
1370
1740
  isAutoincrement: false;
1371
1741
  hasRuntimeDefault: false;
1372
- enumValues: [string, ...string[]] | undefined;
1742
+ enumValues: any;
1373
1743
  baseColumn: never;
1374
1744
  identity: undefined;
1375
1745
  generated: undefined;
1376
- }, {}, {}>;
1746
+ }, {}, {
1747
+ [x: string]: any;
1748
+ [x: number]: any;
1749
+ [x: symbol]: any;
1750
+ }>;
1751
+ id: drizzle_orm_sqlite_core.SQLiteColumn<{
1752
+ name: string;
1753
+ tableName: string;
1754
+ dataType: "string";
1755
+ columnType: "SQLiteText";
1756
+ data: string;
1757
+ driverParam: string;
1758
+ notNull: true;
1759
+ hasDefault: false;
1760
+ isPrimaryKey: true;
1761
+ isAutoincrement: false;
1762
+ hasRuntimeDefault: false;
1763
+ enumValues: [string, ...string[]];
1764
+ baseColumn: never;
1765
+ identity: undefined;
1766
+ generated: undefined;
1767
+ }, {}, {
1768
+ length: number | undefined;
1769
+ }>;
1377
1770
  accountId: drizzle_orm_sqlite_core.SQLiteColumn<{
1378
1771
  name: string;
1379
1772
  tableName: string;
@@ -1602,22 +1995,45 @@ declare const verifications: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
1602
1995
  schema: undefined;
1603
1996
  columns: {
1604
1997
  [x: string]: drizzle_orm_sqlite_core.SQLiteColumn<{
1605
- name: string;
1998
+ name: any;
1606
1999
  tableName: string;
1607
- dataType: "string" | "date";
1608
- columnType: "SQLiteText" | "SQLiteTimestamp";
1609
- data: string | Date;
1610
- driverParam: string | number;
2000
+ dataType: any;
2001
+ columnType: any;
2002
+ data: any;
2003
+ driverParam: any;
1611
2004
  notNull: false;
1612
2005
  hasDefault: false;
1613
2006
  isPrimaryKey: false;
1614
2007
  isAutoincrement: false;
1615
2008
  hasRuntimeDefault: false;
1616
- enumValues: [string, ...string[]] | undefined;
2009
+ enumValues: any;
1617
2010
  baseColumn: never;
1618
2011
  identity: undefined;
1619
2012
  generated: undefined;
1620
- }, {}, {}>;
2013
+ }, {}, {
2014
+ [x: string]: any;
2015
+ [x: number]: any;
2016
+ [x: symbol]: any;
2017
+ }>;
2018
+ id: drizzle_orm_sqlite_core.SQLiteColumn<{
2019
+ name: string;
2020
+ tableName: string;
2021
+ dataType: "string";
2022
+ columnType: "SQLiteText";
2023
+ data: string;
2024
+ driverParam: string;
2025
+ notNull: true;
2026
+ hasDefault: false;
2027
+ isPrimaryKey: true;
2028
+ isAutoincrement: false;
2029
+ hasRuntimeDefault: false;
2030
+ enumValues: [string, ...string[]];
2031
+ baseColumn: never;
2032
+ identity: undefined;
2033
+ generated: undefined;
2034
+ }, {}, {
2035
+ length: number | undefined;
2036
+ }>;
1621
2037
  identifier: drizzle_orm_sqlite_core.SQLiteColumn<{
1622
2038
  name: string;
1623
2039
  tableName: string;
@@ -1715,22 +2131,45 @@ declare const members: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
1715
2131
  schema: undefined;
1716
2132
  columns: {
1717
2133
  [x: string]: drizzle_orm_sqlite_core.SQLiteColumn<{
2134
+ name: any;
2135
+ tableName: string;
2136
+ dataType: any;
2137
+ columnType: any;
2138
+ data: any;
2139
+ driverParam: any;
2140
+ notNull: false;
2141
+ hasDefault: false;
2142
+ isPrimaryKey: false;
2143
+ isAutoincrement: false;
2144
+ hasRuntimeDefault: false;
2145
+ enumValues: any;
2146
+ baseColumn: never;
2147
+ identity: undefined;
2148
+ generated: undefined;
2149
+ }, {}, {
2150
+ [x: string]: any;
2151
+ [x: number]: any;
2152
+ [x: symbol]: any;
2153
+ }>;
2154
+ id: drizzle_orm_sqlite_core.SQLiteColumn<{
1718
2155
  name: string;
1719
2156
  tableName: string;
1720
- dataType: "string" | "date";
1721
- columnType: "SQLiteText" | "SQLiteTimestamp";
1722
- data: string | Date;
1723
- driverParam: string | number;
2157
+ dataType: "string";
2158
+ columnType: "SQLiteText";
2159
+ data: string;
2160
+ driverParam: string;
1724
2161
  notNull: true;
1725
2162
  hasDefault: false;
1726
- isPrimaryKey: false;
2163
+ isPrimaryKey: true;
1727
2164
  isAutoincrement: false;
1728
2165
  hasRuntimeDefault: false;
1729
- enumValues: [string, ...string[]] | undefined;
2166
+ enumValues: [string, ...string[]];
1730
2167
  baseColumn: never;
1731
2168
  identity: undefined;
1732
2169
  generated: undefined;
1733
- }, {}, {}>;
2170
+ }, {}, {
2171
+ length: number | undefined;
2172
+ }>;
1734
2173
  organizationId: drizzle_orm_sqlite_core.SQLiteColumn<{
1735
2174
  name: string;
1736
2175
  tableName: string;
@@ -1813,22 +2252,45 @@ declare const invitations: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
1813
2252
  schema: undefined;
1814
2253
  columns: {
1815
2254
  [x: string]: drizzle_orm_sqlite_core.SQLiteColumn<{
1816
- name: string;
2255
+ name: any;
1817
2256
  tableName: string;
1818
- dataType: "string" | "date";
1819
- columnType: "SQLiteText" | "SQLiteTimestamp";
1820
- data: string | Date;
1821
- driverParam: string | number;
2257
+ dataType: any;
2258
+ columnType: any;
2259
+ data: any;
2260
+ driverParam: any;
1822
2261
  notNull: false;
1823
2262
  hasDefault: false;
1824
2263
  isPrimaryKey: false;
1825
2264
  isAutoincrement: false;
1826
2265
  hasRuntimeDefault: false;
1827
- enumValues: [string, ...string[]] | undefined;
2266
+ enumValues: any;
1828
2267
  baseColumn: never;
1829
2268
  identity: undefined;
1830
2269
  generated: undefined;
1831
- }, {}, {}>;
2270
+ }, {}, {
2271
+ [x: string]: any;
2272
+ [x: number]: any;
2273
+ [x: symbol]: any;
2274
+ }>;
2275
+ id: drizzle_orm_sqlite_core.SQLiteColumn<{
2276
+ name: string;
2277
+ tableName: string;
2278
+ dataType: "string";
2279
+ columnType: "SQLiteText";
2280
+ data: string;
2281
+ driverParam: string;
2282
+ notNull: true;
2283
+ hasDefault: false;
2284
+ isPrimaryKey: true;
2285
+ isAutoincrement: false;
2286
+ hasRuntimeDefault: false;
2287
+ enumValues: [string, ...string[]];
2288
+ baseColumn: never;
2289
+ identity: undefined;
2290
+ generated: undefined;
2291
+ }, {}, {
2292
+ length: number | undefined;
2293
+ }>;
1832
2294
  organizationId: drizzle_orm_sqlite_core.SQLiteColumn<{
1833
2295
  name: string;
1834
2296
  tableName: string;
@@ -9,7 +9,7 @@ import {
9
9
  normalizeEmail,
10
10
  schema_exports,
11
11
  verifyTurnstile
12
- } from "../chunk-KMN5YLY5.js";
12
+ } from "../chunk-WI4UHTAT.js";
13
13
  import "../chunk-R5U7XKVJ.js";
14
14
  export {
15
15
  Hono,
@@ -120,87 +120,234 @@ __export(schema_exports, {
120
120
  verifications: () => verifications
121
121
  });
122
122
  import { sqliteTable, text, integer } from "drizzle-orm/sqlite-core";
123
- var createUsersTable = (tableName = "users", fields) => sqliteTable(tableName, {
124
- [fields?.id || "id"]: text(fields?.id || "id").primaryKey(),
125
- name: text(fields?.name || "name").notNull(),
126
- [fields?.email || "email"]: text(fields?.email || "email").notNull().unique(),
127
- [fields?.emailVerified || "emailVerified"]: integer(fields?.emailVerified || "emailVerified", { mode: "boolean" }).notNull(),
128
- image: text(fields?.image || "image"),
129
- [fields?.createdAt || "createdAt"]: integer(fields?.createdAt || "createdAt", { mode: "timestamp" }).notNull(),
130
- [fields?.updatedAt || "updatedAt"]: integer(fields?.updatedAt || "updatedAt", { mode: "timestamp" }).notNull()
131
- });
132
- var createSessionsTable = (tableName = "sessions", usersTableOrFn = users, fields, userPkField = "id") => {
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) => {
151
+ const idCol = text(fields?.id || "id").primaryKey();
152
+ const nameCol = text(fields?.name || "name").notNull();
153
+ const emailCol = text(fields?.email || "email").notNull().unique();
154
+ const emailVerifiedCol = integer(fields?.emailVerified || "emailVerified", { mode: "boolean" }).notNull();
155
+ const imageCol = text(fields?.image || "image");
156
+ const createdAtCol = integer(fields?.createdAt || "createdAt", { mode: "timestamp" }).notNull();
157
+ const updatedAtCol = integer(fields?.updatedAt || "updatedAt", { mode: "timestamp" }).notNull();
158
+ return sqliteTable(tableName, {
159
+ id: idCol,
160
+ [fields?.id || "id"]: idCol,
161
+ name: nameCol,
162
+ [fields?.name || "name"]: nameCol,
163
+ email: emailCol,
164
+ [fields?.email || "email"]: emailCol,
165
+ emailVerified: emailVerifiedCol,
166
+ [fields?.emailVerified || "emailVerified"]: emailVerifiedCol,
167
+ image: imageCol,
168
+ [fields?.image || "image"]: imageCol,
169
+ createdAt: createdAtCol,
170
+ [fields?.createdAt || "createdAt"]: createdAtCol,
171
+ updatedAt: updatedAtCol,
172
+ [fields?.updatedAt || "updatedAt"]: updatedAtCol,
173
+ ...createAdditionalColumns(additionalFields)
174
+ });
175
+ };
176
+ var createSessionsTable = (tableName = "sessions", usersTableOrFn = users, fields, userPkField = "id", additionalFields) => {
133
177
  const usersTable = typeof usersTableOrFn === "function" ? usersTableOrFn() : usersTableOrFn;
178
+ const idCol = text(fields?.id || "id").primaryKey();
179
+ const expiresAtCol = integer(fields?.expiresAt || "expiresAt", { mode: "timestamp" }).notNull();
180
+ const tokenCol = text(fields?.token || "token").notNull().unique();
181
+ const createdAtCol = integer(fields?.createdAt || "createdAt", { mode: "timestamp" }).notNull();
182
+ const updatedAtCol = integer(fields?.updatedAt || "updatedAt", { mode: "timestamp" }).notNull();
183
+ const ipAddressCol = text(fields?.ipAddress || "ipAddress");
184
+ const userAgentCol = text(fields?.userAgent || "userAgent");
185
+ const userIdCol = text(fields?.userId || "userId").notNull().references(() => usersTable[userPkField] || usersTable.id, { onDelete: "cascade" });
186
+ const activeOrganizationIdCol = text(fields?.activeOrganizationId || "activeOrganizationId");
134
187
  return sqliteTable(tableName, {
135
- [fields?.id || "id"]: text(fields?.id || "id").primaryKey(),
136
- expiresAt: integer(fields?.expiresAt || "expiresAt", { mode: "timestamp" }).notNull(),
137
- token: text(fields?.token || "token").notNull().unique(),
138
- createdAt: integer(fields?.createdAt || "createdAt", { mode: "timestamp" }).notNull(),
139
- updatedAt: integer(fields?.updatedAt || "updatedAt", { mode: "timestamp" }).notNull(),
140
- ipAddress: text(fields?.ipAddress || "ipAddress"),
141
- userAgent: text(fields?.userAgent || "userAgent"),
142
- userId: text(fields?.userId || "userId").notNull().references(() => usersTable[userPkField], { onDelete: "cascade" }),
143
- activeOrganizationId: text(fields?.activeOrganizationId || "activeOrganizationId")
188
+ id: idCol,
189
+ [fields?.id || "id"]: idCol,
190
+ expiresAt: expiresAtCol,
191
+ [fields?.expiresAt || "expiresAt"]: expiresAtCol,
192
+ token: tokenCol,
193
+ [fields?.token || "token"]: tokenCol,
194
+ createdAt: createdAtCol,
195
+ [fields?.createdAt || "createdAt"]: createdAtCol,
196
+ updatedAt: updatedAtCol,
197
+ [fields?.updatedAt || "updatedAt"]: updatedAtCol,
198
+ ipAddress: ipAddressCol,
199
+ [fields?.ipAddress || "ipAddress"]: ipAddressCol,
200
+ userAgent: userAgentCol,
201
+ [fields?.userAgent || "userAgent"]: userAgentCol,
202
+ userId: userIdCol,
203
+ [fields?.userId || "userId"]: userIdCol,
204
+ activeOrganizationId: activeOrganizationIdCol,
205
+ [fields?.activeOrganizationId || "activeOrganizationId"]: activeOrganizationIdCol,
206
+ ...createAdditionalColumns(additionalFields)
144
207
  });
145
208
  };
146
- var createAccountsTable = (tableName = "accounts", usersTableOrFn = users, fields, userPkField = "id") => {
209
+ var createAccountsTable = (tableName = "accounts", usersTableOrFn = users, fields, userPkField = "id", additionalFields) => {
147
210
  const usersTable = typeof usersTableOrFn === "function" ? usersTableOrFn() : usersTableOrFn;
211
+ const idCol = text(fields?.id || "id").primaryKey();
212
+ const accountIdCol = text(fields?.accountId || "accountId").notNull();
213
+ const providerIdCol = text(fields?.providerId || "providerId").notNull();
214
+ const userIdCol = text(fields?.userId || "userId").notNull().references(() => usersTable[userPkField] || usersTable.id, { onDelete: "cascade" });
215
+ const accessTokenCol = text(fields?.accessToken || "accessToken");
216
+ const refreshTokenCol = text(fields?.refreshToken || "refreshToken");
217
+ const idTokenCol = text(fields?.idToken || "idToken");
218
+ const accessTokenExpiresAtCol = integer(fields?.accessTokenExpiresAt || "accessTokenExpiresAt", { mode: "timestamp" });
219
+ const refreshTokenExpiresAtCol = integer(fields?.refreshTokenExpiresAt || "refreshTokenExpiresAt", { mode: "timestamp" });
220
+ const scopeCol = text(fields?.scope || "scope");
221
+ const passwordCol = text(fields?.password || "password");
222
+ const createdAtCol = integer(fields?.createdAt || "createdAt", { mode: "timestamp" }).notNull();
223
+ const updatedAtCol = integer(fields?.updatedAt || "updatedAt", { mode: "timestamp" }).notNull();
148
224
  return sqliteTable(tableName, {
149
- [fields?.id || "id"]: text(fields?.id || "id").primaryKey(),
150
- accountId: text(fields?.accountId || "accountId").notNull(),
151
- providerId: text(fields?.providerId || "providerId").notNull(),
152
- userId: text(fields?.userId || "userId").notNull().references(() => usersTable[userPkField], { onDelete: "cascade" }),
153
- accessToken: text(fields?.accessToken || "accessToken"),
154
- refreshToken: text(fields?.refreshToken || "refreshToken"),
155
- idToken: text(fields?.idToken || "idToken"),
156
- accessTokenExpiresAt: integer(fields?.accessTokenExpiresAt || "accessTokenExpiresAt", { mode: "timestamp" }),
157
- refreshTokenExpiresAt: integer(fields?.refreshTokenExpiresAt || "refreshTokenExpiresAt", { mode: "timestamp" }),
158
- scope: text(fields?.scope || "scope"),
159
- password: text(fields?.password || "password"),
160
- createdAt: integer(fields?.createdAt || "createdAt", { mode: "timestamp" }).notNull(),
161
- updatedAt: integer(fields?.updatedAt || "updatedAt", { mode: "timestamp" }).notNull()
225
+ id: idCol,
226
+ [fields?.id || "id"]: idCol,
227
+ accountId: accountIdCol,
228
+ [fields?.accountId || "accountId"]: accountIdCol,
229
+ providerId: providerIdCol,
230
+ [fields?.providerId || "providerId"]: providerIdCol,
231
+ userId: userIdCol,
232
+ [fields?.userId || "userId"]: userIdCol,
233
+ accessToken: accessTokenCol,
234
+ [fields?.accessToken || "accessToken"]: accessTokenCol,
235
+ refreshToken: refreshTokenCol,
236
+ [fields?.refreshToken || "refreshToken"]: refreshTokenCol,
237
+ idToken: idTokenCol,
238
+ [fields?.idToken || "idToken"]: idTokenCol,
239
+ accessTokenExpiresAt: accessTokenExpiresAtCol,
240
+ [fields?.accessTokenExpiresAt || "accessTokenExpiresAt"]: accessTokenExpiresAtCol,
241
+ refreshTokenExpiresAt: refreshTokenExpiresAtCol,
242
+ [fields?.refreshTokenExpiresAt || "refreshTokenExpiresAt"]: refreshTokenExpiresAtCol,
243
+ scope: scopeCol,
244
+ [fields?.scope || "scope"]: scopeCol,
245
+ password: passwordCol,
246
+ [fields?.password || "password"]: passwordCol,
247
+ createdAt: createdAtCol,
248
+ [fields?.createdAt || "createdAt"]: createdAtCol,
249
+ updatedAt: updatedAtCol,
250
+ [fields?.updatedAt || "updatedAt"]: updatedAtCol,
251
+ ...createAdditionalColumns(additionalFields)
162
252
  });
163
253
  };
164
- var createVerificationsTable = (tableName = "verifications", fields) => sqliteTable(tableName, {
165
- [fields?.id || "id"]: text(fields?.id || "id").primaryKey(),
166
- identifier: text(fields?.identifier || "identifier").notNull(),
167
- value: text(fields?.value || "value").notNull(),
168
- expiresAt: integer(fields?.expiresAt || "expiresAt", { mode: "timestamp" }).notNull(),
169
- createdAt: integer(fields?.createdAt || "createdAt", { mode: "timestamp" }),
170
- updatedAt: integer(fields?.updatedAt || "updatedAt", { mode: "timestamp" })
171
- });
172
- var createOrganizationsTable = (tableName = "organizations", fields) => sqliteTable(tableName, {
173
- [fields?.id || "id"]: text(fields?.id || "id").primaryKey(),
174
- name: text(fields?.name || "name").notNull(),
175
- slug: text(fields?.slug || "slug").unique(),
176
- logo: text(fields?.logo || "logo"),
177
- createdAt: integer(fields?.createdAt || "createdAt", { mode: "timestamp" }).notNull(),
178
- metadata: text(fields?.metadata || "metadata")
179
- });
180
- var createMembersTable = (tableName = "members", organizationsTableOrFn = organizations, usersTableOrFn = users, fields, userPkField = "id") => {
254
+ var createVerificationsTable = (tableName = "verifications", fields, additionalFields) => {
255
+ const idCol = text(fields?.id || "id").primaryKey();
256
+ const identifierCol = text(fields?.identifier || "identifier").notNull();
257
+ const valueCol = text(fields?.value || "value").notNull();
258
+ const expiresAtCol = integer(fields?.expiresAt || "expiresAt", { mode: "timestamp" }).notNull();
259
+ const createdAtCol = integer(fields?.createdAt || "createdAt", { mode: "timestamp" });
260
+ const updatedAtCol = integer(fields?.updatedAt || "updatedAt", { mode: "timestamp" });
261
+ return sqliteTable(tableName, {
262
+ id: idCol,
263
+ [fields?.id || "id"]: idCol,
264
+ identifier: identifierCol,
265
+ [fields?.identifier || "identifier"]: identifierCol,
266
+ value: valueCol,
267
+ [fields?.value || "value"]: valueCol,
268
+ expiresAt: expiresAtCol,
269
+ [fields?.expiresAt || "expiresAt"]: expiresAtCol,
270
+ createdAt: createdAtCol,
271
+ [fields?.createdAt || "createdAt"]: createdAtCol,
272
+ updatedAt: updatedAtCol,
273
+ [fields?.updatedAt || "updatedAt"]: updatedAtCol,
274
+ ...createAdditionalColumns(additionalFields)
275
+ });
276
+ };
277
+ var createOrganizationsTable = (tableName = "organizations", fields, additionalFields) => {
278
+ const idCol = text(fields?.id || "id").primaryKey();
279
+ const nameCol = text(fields?.name || "name").notNull();
280
+ const slugCol = text(fields?.slug || "slug").unique();
281
+ const logoCol = text(fields?.logo || "logo");
282
+ const createdAtCol = integer(fields?.createdAt || "createdAt", { mode: "timestamp" }).notNull();
283
+ const metadataCol = text(fields?.metadata || "metadata");
284
+ return sqliteTable(tableName, {
285
+ id: idCol,
286
+ [fields?.id || "id"]: idCol,
287
+ name: nameCol,
288
+ [fields?.name || "name"]: nameCol,
289
+ slug: slugCol,
290
+ [fields?.slug || "slug"]: slugCol,
291
+ logo: logoCol,
292
+ [fields?.logo || "logo"]: logoCol,
293
+ createdAt: createdAtCol,
294
+ [fields?.createdAt || "createdAt"]: createdAtCol,
295
+ metadata: metadataCol,
296
+ [fields?.metadata || "metadata"]: metadataCol,
297
+ ...createAdditionalColumns(additionalFields)
298
+ });
299
+ };
300
+ var createMembersTable = (tableName = "members", organizationsTableOrFn = organizations, usersTableOrFn = users, fields, userPkField = "id", additionalFields) => {
181
301
  const organizationsTable = typeof organizationsTableOrFn === "function" ? organizationsTableOrFn() : organizationsTableOrFn;
182
302
  const usersTable = typeof usersTableOrFn === "function" ? usersTableOrFn() : usersTableOrFn;
303
+ const idCol = text(fields?.id || "id").primaryKey();
304
+ const organizationIdCol = text(fields?.organizationId || "organizationId").notNull().references(() => organizationsTable[fields?.organizationId || "id"] || organizationsTable.id, { onDelete: "cascade" });
305
+ const userIdCol = text(fields?.userId || "userId").notNull().references(() => usersTable[userPkField] || usersTable.id, { onDelete: "cascade" });
306
+ const roleCol = text(fields?.role || "role").notNull();
307
+ const createdAtCol = integer(fields?.createdAt || "createdAt", { mode: "timestamp" }).notNull();
183
308
  return sqliteTable(tableName, {
184
- [fields?.id || "id"]: text(fields?.id || "id").primaryKey(),
185
- organizationId: text(fields?.organizationId || "organizationId").notNull().references(() => organizationsTable[fields?.organizationId || "id"] || organizationsTable.id, { onDelete: "cascade" }),
186
- // Partial fix for org FK too?
187
- userId: text(fields?.userId || "userId").notNull().references(() => usersTable[userPkField], { onDelete: "cascade" }),
188
- role: text(fields?.role || "role").notNull(),
189
- createdAt: integer(fields?.createdAt || "createdAt", { mode: "timestamp" }).notNull()
309
+ id: idCol,
310
+ [fields?.id || "id"]: idCol,
311
+ organizationId: organizationIdCol,
312
+ [fields?.organizationId || "organizationId"]: organizationIdCol,
313
+ userId: userIdCol,
314
+ [fields?.userId || "userId"]: userIdCol,
315
+ role: roleCol,
316
+ [fields?.role || "role"]: roleCol,
317
+ createdAt: createdAtCol,
318
+ [fields?.createdAt || "createdAt"]: createdAtCol,
319
+ ...createAdditionalColumns(additionalFields)
190
320
  });
191
321
  };
192
- var createInvitationsTable = (tableName = "invitations", organizationsTableOrFn = organizations, usersTableOrFn = users, fields, userPkField = "id") => {
322
+ var createInvitationsTable = (tableName = "invitations", organizationsTableOrFn = organizations, usersTableOrFn = users, fields, userPkField = "id", additionalFields) => {
193
323
  const organizationsTable = typeof organizationsTableOrFn === "function" ? organizationsTableOrFn() : organizationsTableOrFn;
194
324
  const usersTable = typeof usersTableOrFn === "function" ? usersTableOrFn() : usersTableOrFn;
325
+ const idCol = text(fields?.id || "id").primaryKey();
326
+ const organizationIdCol = text(fields?.organizationId || "organizationId").notNull().references(() => organizationsTable[fields?.organizationId || "id"] || organizationsTable.id, { onDelete: "cascade" });
327
+ const emailCol = text(fields?.email || "email").notNull();
328
+ const roleCol = text(fields?.role || "role");
329
+ const statusCol = text(fields?.status || "status").notNull();
330
+ const expiresAtCol = integer(fields?.expiresAt || "expiresAt", { mode: "timestamp" }).notNull();
331
+ const inviterIdCol = text(fields?.inviterId || "inviterId").notNull().references(() => usersTable[userPkField] || usersTable.id, { onDelete: "cascade" });
332
+ const createdAtCol = integer(fields?.createdAt || "createdAt", { mode: "timestamp" }).notNull();
195
333
  return sqliteTable(tableName, {
196
- [fields?.id || "id"]: text(fields?.id || "id").primaryKey(),
197
- organizationId: text(fields?.organizationId || "organizationId").notNull().references(() => organizationsTable[fields?.organizationId || "id"] || organizationsTable.id, { onDelete: "cascade" }),
198
- email: text(fields?.email || "email").notNull(),
199
- role: text(fields?.role || "role"),
200
- status: text(fields?.status || "status").notNull(),
201
- expiresAt: integer(fields?.expiresAt || "expiresAt", { mode: "timestamp" }).notNull(),
202
- inviterId: text(fields?.inviterId || "inviterId").notNull().references(() => usersTable[userPkField], { onDelete: "cascade" }),
203
- createdAt: integer(fields?.createdAt || "createdAt", { mode: "timestamp" }).notNull()
334
+ id: idCol,
335
+ [fields?.id || "id"]: idCol,
336
+ organizationId: organizationIdCol,
337
+ [fields?.organizationId || "organizationId"]: organizationIdCol,
338
+ email: emailCol,
339
+ [fields?.email || "email"]: emailCol,
340
+ role: roleCol,
341
+ [fields?.role || "role"]: roleCol,
342
+ status: statusCol,
343
+ [fields?.status || "status"]: statusCol,
344
+ expiresAt: expiresAtCol,
345
+ [fields?.expiresAt || "expiresAt"]: expiresAtCol,
346
+ inviterId: inviterIdCol,
347
+ [fields?.inviterId || "inviterId"]: inviterIdCol,
348
+ createdAt: createdAtCol,
349
+ [fields?.createdAt || "createdAt"]: createdAtCol,
350
+ ...createAdditionalColumns(additionalFields)
204
351
  });
205
352
  };
206
353
  var users = createUsersTable();
@@ -350,13 +497,13 @@ var createAuth = (config) => {
350
497
  const memberTableName = schemaMapping?.member?.tableName || "members";
351
498
  const invitationTableName = schemaMapping?.invitation?.tableName || "invitations";
352
499
  const userPkField = schemaMapping?.user?.fields?.id || "id";
353
- const usersTable = createUsersTable(userTableName, schemaMapping?.user?.fields);
354
- const organizationsTable = createOrganizationsTable(orgTableName, schemaMapping?.organization?.fields);
355
- const sessionsTable = createSessionsTable(sessionTableName, usersTable, schemaMapping?.session?.fields, userPkField);
356
- const accountsTable = createAccountsTable(accountTableName, usersTable, schemaMapping?.account?.fields, userPkField);
357
- const verificationsTable = createVerificationsTable(verificationTableName, schemaMapping?.verification?.fields);
358
- const membersTable = createMembersTable(memberTableName, organizationsTable, usersTable, schemaMapping?.member?.fields, userPkField);
359
- const invitationsTable = createInvitationsTable(invitationTableName, organizationsTable, usersTable, schemaMapping?.invitation?.fields, userPkField);
500
+ const usersTable = createUsersTable(userTableName, schemaMapping?.user?.fields, schemaMapping?.user?.additionalFields);
501
+ const organizationsTable = createOrganizationsTable(orgTableName, schemaMapping?.organization?.fields, schemaMapping?.organization?.additionalFields);
502
+ const sessionsTable = createSessionsTable(sessionTableName, usersTable, schemaMapping?.session?.fields, userPkField, schemaMapping?.session?.additionalFields);
503
+ const accountsTable = createAccountsTable(accountTableName, usersTable, schemaMapping?.account?.fields, userPkField, schemaMapping?.account?.additionalFields);
504
+ const verificationsTable = createVerificationsTable(verificationTableName, schemaMapping?.verification?.fields, schemaMapping?.verification?.additionalFields);
505
+ const membersTable = createMembersTable(memberTableName, organizationsTable, usersTable, schemaMapping?.member?.fields, userPkField, schemaMapping?.member?.additionalFields);
506
+ const invitationsTable = createInvitationsTable(invitationTableName, organizationsTable, usersTable, schemaMapping?.invitation?.fields, userPkField, schemaMapping?.invitation?.additionalFields);
360
507
  const userKey = schemaMapping?.user?.tableName || "user";
361
508
  const sessionKey = schemaMapping?.session?.tableName || "session";
362
509
  const accountKey = schemaMapping?.account?.tableName || "account";
package/dist/index.js CHANGED
@@ -9,7 +9,7 @@ import {
9
9
  normalizeEmail,
10
10
  schema_exports,
11
11
  verifyTurnstile
12
- } from "./chunk-KMN5YLY5.js";
12
+ } from "./chunk-WI4UHTAT.js";
13
13
  import {
14
14
  AuthForm,
15
15
  CreateOrganizationForm,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contentgrowth/content-auth",
3
- "version": "0.4.6",
3
+ "version": "0.4.8",
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",