@contentgrowth/content-auth 0.4.6 → 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 +163 -107
- package/dist/backend/index.js +1 -1
- package/dist/{chunk-KMN5YLY5.js → chunk-SGGYHP5S.js} +55 -21
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/backend/index.d.ts
CHANGED
|
@@ -47,27 +47,31 @@ 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:
|
|
55
|
+
name: any;
|
|
56
56
|
tableName: string;
|
|
57
|
-
dataType:
|
|
58
|
-
columnType:
|
|
59
|
-
data:
|
|
60
|
-
driverParam:
|
|
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:
|
|
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
|
+
}>;
|
|
71
75
|
name: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
72
76
|
name: string;
|
|
73
77
|
tableName: string;
|
|
@@ -109,27 +113,31 @@ declare const createUsersTable: (tableName?: string, fields?: Record<string, str
|
|
|
109
113
|
};
|
|
110
114
|
dialect: "sqlite";
|
|
111
115
|
}>;
|
|
112
|
-
declare const createSessionsTable: (tableName?: string, usersTableOrFn?: any, fields?: Record<string, string>, userPkField?: 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<{
|
|
113
117
|
name: string;
|
|
114
118
|
schema: undefined;
|
|
115
119
|
columns: {
|
|
116
120
|
[x: string]: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
117
|
-
name:
|
|
121
|
+
name: any;
|
|
118
122
|
tableName: string;
|
|
119
|
-
dataType:
|
|
120
|
-
columnType:
|
|
121
|
-
data:
|
|
122
|
-
driverParam:
|
|
123
|
+
dataType: any;
|
|
124
|
+
columnType: any;
|
|
125
|
+
data: any;
|
|
126
|
+
driverParam: any;
|
|
123
127
|
notNull: false;
|
|
124
128
|
hasDefault: false;
|
|
125
129
|
isPrimaryKey: false;
|
|
126
130
|
isAutoincrement: false;
|
|
127
131
|
hasRuntimeDefault: false;
|
|
128
|
-
enumValues:
|
|
132
|
+
enumValues: any;
|
|
129
133
|
baseColumn: never;
|
|
130
134
|
identity: undefined;
|
|
131
135
|
generated: undefined;
|
|
132
|
-
}, {}, {
|
|
136
|
+
}, {}, {
|
|
137
|
+
[x: string]: any;
|
|
138
|
+
[x: number]: any;
|
|
139
|
+
[x: symbol]: any;
|
|
140
|
+
}>;
|
|
133
141
|
expiresAt: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
134
142
|
name: string;
|
|
135
143
|
tableName: string;
|
|
@@ -279,27 +287,31 @@ declare const createSessionsTable: (tableName?: string, usersTableOrFn?: any, fi
|
|
|
279
287
|
};
|
|
280
288
|
dialect: "sqlite";
|
|
281
289
|
}>;
|
|
282
|
-
declare const createAccountsTable: (tableName?: string, usersTableOrFn?: any, fields?: Record<string, string>, userPkField?: 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<{
|
|
283
291
|
name: string;
|
|
284
292
|
schema: undefined;
|
|
285
293
|
columns: {
|
|
286
294
|
[x: string]: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
287
|
-
name:
|
|
295
|
+
name: any;
|
|
288
296
|
tableName: string;
|
|
289
|
-
dataType:
|
|
290
|
-
columnType:
|
|
291
|
-
data:
|
|
292
|
-
driverParam:
|
|
297
|
+
dataType: any;
|
|
298
|
+
columnType: any;
|
|
299
|
+
data: any;
|
|
300
|
+
driverParam: any;
|
|
293
301
|
notNull: false;
|
|
294
302
|
hasDefault: false;
|
|
295
303
|
isPrimaryKey: false;
|
|
296
304
|
isAutoincrement: false;
|
|
297
305
|
hasRuntimeDefault: false;
|
|
298
|
-
enumValues:
|
|
306
|
+
enumValues: any;
|
|
299
307
|
baseColumn: never;
|
|
300
308
|
identity: undefined;
|
|
301
309
|
generated: undefined;
|
|
302
|
-
}, {}, {
|
|
310
|
+
}, {}, {
|
|
311
|
+
[x: string]: any;
|
|
312
|
+
[x: number]: any;
|
|
313
|
+
[x: symbol]: any;
|
|
314
|
+
}>;
|
|
303
315
|
accountId: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
304
316
|
name: string;
|
|
305
317
|
tableName: string;
|
|
@@ -523,27 +535,31 @@ declare const createAccountsTable: (tableName?: string, usersTableOrFn?: any, fi
|
|
|
523
535
|
};
|
|
524
536
|
dialect: "sqlite";
|
|
525
537
|
}>;
|
|
526
|
-
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<{
|
|
527
539
|
name: string;
|
|
528
540
|
schema: undefined;
|
|
529
541
|
columns: {
|
|
530
542
|
[x: string]: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
531
|
-
name:
|
|
543
|
+
name: any;
|
|
532
544
|
tableName: string;
|
|
533
|
-
dataType:
|
|
534
|
-
columnType:
|
|
535
|
-
data:
|
|
536
|
-
driverParam:
|
|
545
|
+
dataType: any;
|
|
546
|
+
columnType: any;
|
|
547
|
+
data: any;
|
|
548
|
+
driverParam: any;
|
|
537
549
|
notNull: false;
|
|
538
550
|
hasDefault: false;
|
|
539
551
|
isPrimaryKey: false;
|
|
540
552
|
isAutoincrement: false;
|
|
541
553
|
hasRuntimeDefault: false;
|
|
542
|
-
enumValues:
|
|
554
|
+
enumValues: any;
|
|
543
555
|
baseColumn: never;
|
|
544
556
|
identity: undefined;
|
|
545
557
|
generated: undefined;
|
|
546
|
-
}, {}, {
|
|
558
|
+
}, {}, {
|
|
559
|
+
[x: string]: any;
|
|
560
|
+
[x: number]: any;
|
|
561
|
+
[x: symbol]: any;
|
|
562
|
+
}>;
|
|
547
563
|
identifier: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
548
564
|
name: string;
|
|
549
565
|
tableName: string;
|
|
@@ -636,27 +652,31 @@ declare const createVerificationsTable: (tableName?: string, fields?: Record<str
|
|
|
636
652
|
};
|
|
637
653
|
dialect: "sqlite";
|
|
638
654
|
}>;
|
|
639
|
-
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<{
|
|
640
656
|
name: string;
|
|
641
657
|
schema: undefined;
|
|
642
658
|
columns: {
|
|
643
659
|
[x: string]: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
644
|
-
name:
|
|
660
|
+
name: any;
|
|
645
661
|
tableName: string;
|
|
646
|
-
dataType:
|
|
647
|
-
columnType:
|
|
648
|
-
data:
|
|
649
|
-
driverParam:
|
|
662
|
+
dataType: any;
|
|
663
|
+
columnType: any;
|
|
664
|
+
data: any;
|
|
665
|
+
driverParam: any;
|
|
650
666
|
notNull: false;
|
|
651
667
|
hasDefault: false;
|
|
652
668
|
isPrimaryKey: false;
|
|
653
669
|
isAutoincrement: false;
|
|
654
670
|
hasRuntimeDefault: false;
|
|
655
|
-
enumValues:
|
|
671
|
+
enumValues: any;
|
|
656
672
|
baseColumn: never;
|
|
657
673
|
identity: undefined;
|
|
658
674
|
generated: undefined;
|
|
659
|
-
}, {}, {
|
|
675
|
+
}, {}, {
|
|
676
|
+
[x: string]: any;
|
|
677
|
+
[x: number]: any;
|
|
678
|
+
[x: symbol]: any;
|
|
679
|
+
}>;
|
|
660
680
|
name: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
661
681
|
name: string;
|
|
662
682
|
tableName: string;
|
|
@@ -753,27 +773,31 @@ declare const createOrganizationsTable: (tableName?: string, fields?: Record<str
|
|
|
753
773
|
};
|
|
754
774
|
dialect: "sqlite";
|
|
755
775
|
}>;
|
|
756
|
-
declare const createMembersTable: (tableName?: string, organizationsTableOrFn?: any, usersTableOrFn?: any, fields?: Record<string, string>, userPkField?: 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<{
|
|
757
777
|
name: string;
|
|
758
778
|
schema: undefined;
|
|
759
779
|
columns: {
|
|
760
780
|
[x: string]: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
761
|
-
name:
|
|
781
|
+
name: any;
|
|
762
782
|
tableName: string;
|
|
763
|
-
dataType:
|
|
764
|
-
columnType:
|
|
765
|
-
data:
|
|
766
|
-
driverParam:
|
|
767
|
-
notNull:
|
|
783
|
+
dataType: any;
|
|
784
|
+
columnType: any;
|
|
785
|
+
data: any;
|
|
786
|
+
driverParam: any;
|
|
787
|
+
notNull: false;
|
|
768
788
|
hasDefault: false;
|
|
769
789
|
isPrimaryKey: false;
|
|
770
790
|
isAutoincrement: false;
|
|
771
791
|
hasRuntimeDefault: false;
|
|
772
|
-
enumValues:
|
|
792
|
+
enumValues: any;
|
|
773
793
|
baseColumn: never;
|
|
774
794
|
identity: undefined;
|
|
775
795
|
generated: undefined;
|
|
776
|
-
}, {}, {
|
|
796
|
+
}, {}, {
|
|
797
|
+
[x: string]: any;
|
|
798
|
+
[x: number]: any;
|
|
799
|
+
[x: symbol]: any;
|
|
800
|
+
}>;
|
|
777
801
|
organizationId: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
778
802
|
name: string;
|
|
779
803
|
tableName: string;
|
|
@@ -851,27 +875,31 @@ declare const createMembersTable: (tableName?: string, organizationsTableOrFn?:
|
|
|
851
875
|
};
|
|
852
876
|
dialect: "sqlite";
|
|
853
877
|
}>;
|
|
854
|
-
declare const createInvitationsTable: (tableName?: string, organizationsTableOrFn?: any, usersTableOrFn?: any, fields?: Record<string, string>, userPkField?: 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<{
|
|
855
879
|
name: string;
|
|
856
880
|
schema: undefined;
|
|
857
881
|
columns: {
|
|
858
882
|
[x: string]: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
859
|
-
name:
|
|
883
|
+
name: any;
|
|
860
884
|
tableName: string;
|
|
861
|
-
dataType:
|
|
862
|
-
columnType:
|
|
863
|
-
data:
|
|
864
|
-
driverParam:
|
|
885
|
+
dataType: any;
|
|
886
|
+
columnType: any;
|
|
887
|
+
data: any;
|
|
888
|
+
driverParam: any;
|
|
865
889
|
notNull: false;
|
|
866
890
|
hasDefault: false;
|
|
867
891
|
isPrimaryKey: false;
|
|
868
892
|
isAutoincrement: false;
|
|
869
893
|
hasRuntimeDefault: false;
|
|
870
|
-
enumValues:
|
|
894
|
+
enumValues: any;
|
|
871
895
|
baseColumn: never;
|
|
872
896
|
identity: undefined;
|
|
873
897
|
generated: undefined;
|
|
874
|
-
}, {}, {
|
|
898
|
+
}, {}, {
|
|
899
|
+
[x: string]: any;
|
|
900
|
+
[x: number]: any;
|
|
901
|
+
[x: symbol]: any;
|
|
902
|
+
}>;
|
|
875
903
|
organizationId: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
876
904
|
name: string;
|
|
877
905
|
tableName: string;
|
|
@@ -1009,22 +1037,26 @@ declare const users: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
|
|
|
1009
1037
|
schema: undefined;
|
|
1010
1038
|
columns: {
|
|
1011
1039
|
[x: string]: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
1012
|
-
name:
|
|
1040
|
+
name: any;
|
|
1013
1041
|
tableName: string;
|
|
1014
|
-
dataType:
|
|
1015
|
-
columnType:
|
|
1016
|
-
data:
|
|
1017
|
-
driverParam:
|
|
1042
|
+
dataType: any;
|
|
1043
|
+
columnType: any;
|
|
1044
|
+
data: any;
|
|
1045
|
+
driverParam: any;
|
|
1018
1046
|
notNull: false;
|
|
1019
1047
|
hasDefault: false;
|
|
1020
1048
|
isPrimaryKey: false;
|
|
1021
1049
|
isAutoincrement: false;
|
|
1022
1050
|
hasRuntimeDefault: false;
|
|
1023
|
-
enumValues:
|
|
1051
|
+
enumValues: any;
|
|
1024
1052
|
baseColumn: never;
|
|
1025
1053
|
identity: undefined;
|
|
1026
1054
|
generated: undefined;
|
|
1027
|
-
}, {}, {
|
|
1055
|
+
}, {}, {
|
|
1056
|
+
[x: string]: any;
|
|
1057
|
+
[x: number]: any;
|
|
1058
|
+
[x: symbol]: any;
|
|
1059
|
+
}>;
|
|
1028
1060
|
name: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
1029
1061
|
name: string;
|
|
1030
1062
|
tableName: string;
|
|
@@ -1071,22 +1103,26 @@ declare const organizations: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
|
|
|
1071
1103
|
schema: undefined;
|
|
1072
1104
|
columns: {
|
|
1073
1105
|
[x: string]: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
1074
|
-
name:
|
|
1106
|
+
name: any;
|
|
1075
1107
|
tableName: string;
|
|
1076
|
-
dataType:
|
|
1077
|
-
columnType:
|
|
1078
|
-
data:
|
|
1079
|
-
driverParam:
|
|
1108
|
+
dataType: any;
|
|
1109
|
+
columnType: any;
|
|
1110
|
+
data: any;
|
|
1111
|
+
driverParam: any;
|
|
1080
1112
|
notNull: false;
|
|
1081
1113
|
hasDefault: false;
|
|
1082
1114
|
isPrimaryKey: false;
|
|
1083
1115
|
isAutoincrement: false;
|
|
1084
1116
|
hasRuntimeDefault: false;
|
|
1085
|
-
enumValues:
|
|
1117
|
+
enumValues: any;
|
|
1086
1118
|
baseColumn: never;
|
|
1087
1119
|
identity: undefined;
|
|
1088
1120
|
generated: undefined;
|
|
1089
|
-
}, {}, {
|
|
1121
|
+
}, {}, {
|
|
1122
|
+
[x: string]: any;
|
|
1123
|
+
[x: number]: any;
|
|
1124
|
+
[x: symbol]: any;
|
|
1125
|
+
}>;
|
|
1090
1126
|
name: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
1091
1127
|
name: string;
|
|
1092
1128
|
tableName: string;
|
|
@@ -1188,22 +1224,26 @@ declare const sessions: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
|
|
|
1188
1224
|
schema: undefined;
|
|
1189
1225
|
columns: {
|
|
1190
1226
|
[x: string]: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
1191
|
-
name:
|
|
1227
|
+
name: any;
|
|
1192
1228
|
tableName: string;
|
|
1193
|
-
dataType:
|
|
1194
|
-
columnType:
|
|
1195
|
-
data:
|
|
1196
|
-
driverParam:
|
|
1229
|
+
dataType: any;
|
|
1230
|
+
columnType: any;
|
|
1231
|
+
data: any;
|
|
1232
|
+
driverParam: any;
|
|
1197
1233
|
notNull: false;
|
|
1198
1234
|
hasDefault: false;
|
|
1199
1235
|
isPrimaryKey: false;
|
|
1200
1236
|
isAutoincrement: false;
|
|
1201
1237
|
hasRuntimeDefault: false;
|
|
1202
|
-
enumValues:
|
|
1238
|
+
enumValues: any;
|
|
1203
1239
|
baseColumn: never;
|
|
1204
1240
|
identity: undefined;
|
|
1205
1241
|
generated: undefined;
|
|
1206
|
-
}, {}, {
|
|
1242
|
+
}, {}, {
|
|
1243
|
+
[x: string]: any;
|
|
1244
|
+
[x: number]: any;
|
|
1245
|
+
[x: symbol]: any;
|
|
1246
|
+
}>;
|
|
1207
1247
|
expiresAt: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
1208
1248
|
name: string;
|
|
1209
1249
|
tableName: string;
|
|
@@ -1358,22 +1398,26 @@ declare const accounts: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
|
|
|
1358
1398
|
schema: undefined;
|
|
1359
1399
|
columns: {
|
|
1360
1400
|
[x: string]: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
1361
|
-
name:
|
|
1401
|
+
name: any;
|
|
1362
1402
|
tableName: string;
|
|
1363
|
-
dataType:
|
|
1364
|
-
columnType:
|
|
1365
|
-
data:
|
|
1366
|
-
driverParam:
|
|
1403
|
+
dataType: any;
|
|
1404
|
+
columnType: any;
|
|
1405
|
+
data: any;
|
|
1406
|
+
driverParam: any;
|
|
1367
1407
|
notNull: false;
|
|
1368
1408
|
hasDefault: false;
|
|
1369
1409
|
isPrimaryKey: false;
|
|
1370
1410
|
isAutoincrement: false;
|
|
1371
1411
|
hasRuntimeDefault: false;
|
|
1372
|
-
enumValues:
|
|
1412
|
+
enumValues: any;
|
|
1373
1413
|
baseColumn: never;
|
|
1374
1414
|
identity: undefined;
|
|
1375
1415
|
generated: undefined;
|
|
1376
|
-
}, {}, {
|
|
1416
|
+
}, {}, {
|
|
1417
|
+
[x: string]: any;
|
|
1418
|
+
[x: number]: any;
|
|
1419
|
+
[x: symbol]: any;
|
|
1420
|
+
}>;
|
|
1377
1421
|
accountId: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
1378
1422
|
name: string;
|
|
1379
1423
|
tableName: string;
|
|
@@ -1602,22 +1646,26 @@ declare const verifications: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
|
|
|
1602
1646
|
schema: undefined;
|
|
1603
1647
|
columns: {
|
|
1604
1648
|
[x: string]: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
1605
|
-
name:
|
|
1649
|
+
name: any;
|
|
1606
1650
|
tableName: string;
|
|
1607
|
-
dataType:
|
|
1608
|
-
columnType:
|
|
1609
|
-
data:
|
|
1610
|
-
driverParam:
|
|
1651
|
+
dataType: any;
|
|
1652
|
+
columnType: any;
|
|
1653
|
+
data: any;
|
|
1654
|
+
driverParam: any;
|
|
1611
1655
|
notNull: false;
|
|
1612
1656
|
hasDefault: false;
|
|
1613
1657
|
isPrimaryKey: false;
|
|
1614
1658
|
isAutoincrement: false;
|
|
1615
1659
|
hasRuntimeDefault: false;
|
|
1616
|
-
enumValues:
|
|
1660
|
+
enumValues: any;
|
|
1617
1661
|
baseColumn: never;
|
|
1618
1662
|
identity: undefined;
|
|
1619
1663
|
generated: undefined;
|
|
1620
|
-
}, {}, {
|
|
1664
|
+
}, {}, {
|
|
1665
|
+
[x: string]: any;
|
|
1666
|
+
[x: number]: any;
|
|
1667
|
+
[x: symbol]: any;
|
|
1668
|
+
}>;
|
|
1621
1669
|
identifier: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
1622
1670
|
name: string;
|
|
1623
1671
|
tableName: string;
|
|
@@ -1715,22 +1763,26 @@ declare const members: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
|
|
|
1715
1763
|
schema: undefined;
|
|
1716
1764
|
columns: {
|
|
1717
1765
|
[x: string]: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
1718
|
-
name:
|
|
1766
|
+
name: any;
|
|
1719
1767
|
tableName: string;
|
|
1720
|
-
dataType:
|
|
1721
|
-
columnType:
|
|
1722
|
-
data:
|
|
1723
|
-
driverParam:
|
|
1724
|
-
notNull:
|
|
1768
|
+
dataType: any;
|
|
1769
|
+
columnType: any;
|
|
1770
|
+
data: any;
|
|
1771
|
+
driverParam: any;
|
|
1772
|
+
notNull: false;
|
|
1725
1773
|
hasDefault: false;
|
|
1726
1774
|
isPrimaryKey: false;
|
|
1727
1775
|
isAutoincrement: false;
|
|
1728
1776
|
hasRuntimeDefault: false;
|
|
1729
|
-
enumValues:
|
|
1777
|
+
enumValues: any;
|
|
1730
1778
|
baseColumn: never;
|
|
1731
1779
|
identity: undefined;
|
|
1732
1780
|
generated: undefined;
|
|
1733
|
-
}, {}, {
|
|
1781
|
+
}, {}, {
|
|
1782
|
+
[x: string]: any;
|
|
1783
|
+
[x: number]: any;
|
|
1784
|
+
[x: symbol]: any;
|
|
1785
|
+
}>;
|
|
1734
1786
|
organizationId: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
1735
1787
|
name: string;
|
|
1736
1788
|
tableName: string;
|
|
@@ -1813,22 +1865,26 @@ declare const invitations: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
|
|
|
1813
1865
|
schema: undefined;
|
|
1814
1866
|
columns: {
|
|
1815
1867
|
[x: string]: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
1816
|
-
name:
|
|
1868
|
+
name: any;
|
|
1817
1869
|
tableName: string;
|
|
1818
|
-
dataType:
|
|
1819
|
-
columnType:
|
|
1820
|
-
data:
|
|
1821
|
-
driverParam:
|
|
1870
|
+
dataType: any;
|
|
1871
|
+
columnType: any;
|
|
1872
|
+
data: any;
|
|
1873
|
+
driverParam: any;
|
|
1822
1874
|
notNull: false;
|
|
1823
1875
|
hasDefault: false;
|
|
1824
1876
|
isPrimaryKey: false;
|
|
1825
1877
|
isAutoincrement: false;
|
|
1826
1878
|
hasRuntimeDefault: false;
|
|
1827
|
-
enumValues:
|
|
1879
|
+
enumValues: any;
|
|
1828
1880
|
baseColumn: never;
|
|
1829
1881
|
identity: undefined;
|
|
1830
1882
|
generated: undefined;
|
|
1831
|
-
}, {}, {
|
|
1883
|
+
}, {}, {
|
|
1884
|
+
[x: string]: any;
|
|
1885
|
+
[x: number]: any;
|
|
1886
|
+
[x: symbol]: any;
|
|
1887
|
+
}>;
|
|
1832
1888
|
organizationId: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
1833
1889
|
name: string;
|
|
1834
1890
|
tableName: string;
|
package/dist/backend/index.js
CHANGED
|
@@ -120,16 +120,44 @@ __export(schema_exports, {
|
|
|
120
120
|
verifications: () => verifications
|
|
121
121
|
});
|
|
122
122
|
import { sqliteTable, text, integer } from "drizzle-orm/sqlite-core";
|
|
123
|
-
var
|
|
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, {
|
|
124
151
|
[fields?.id || "id"]: text(fields?.id || "id").primaryKey(),
|
|
125
152
|
name: text(fields?.name || "name").notNull(),
|
|
126
153
|
[fields?.email || "email"]: text(fields?.email || "email").notNull().unique(),
|
|
127
154
|
[fields?.emailVerified || "emailVerified"]: integer(fields?.emailVerified || "emailVerified", { mode: "boolean" }).notNull(),
|
|
128
155
|
image: text(fields?.image || "image"),
|
|
129
156
|
[fields?.createdAt || "createdAt"]: integer(fields?.createdAt || "createdAt", { mode: "timestamp" }).notNull(),
|
|
130
|
-
[fields?.updatedAt || "updatedAt"]: integer(fields?.updatedAt || "updatedAt", { 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, userPkField = "id") => {
|
|
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
163
|
[fields?.id || "id"]: text(fields?.id || "id").primaryKey(),
|
|
@@ -140,10 +168,11 @@ var createSessionsTable = (tableName = "sessions", usersTableOrFn = users, field
|
|
|
140
168
|
ipAddress: text(fields?.ipAddress || "ipAddress"),
|
|
141
169
|
userAgent: text(fields?.userAgent || "userAgent"),
|
|
142
170
|
userId: text(fields?.userId || "userId").notNull().references(() => usersTable[userPkField], { onDelete: "cascade" }),
|
|
143
|
-
activeOrganizationId: text(fields?.activeOrganizationId || "activeOrganizationId")
|
|
171
|
+
activeOrganizationId: text(fields?.activeOrganizationId || "activeOrganizationId"),
|
|
172
|
+
...createAdditionalColumns(additionalFields)
|
|
144
173
|
});
|
|
145
174
|
};
|
|
146
|
-
var createAccountsTable = (tableName = "accounts", usersTableOrFn = users, fields, userPkField = "id") => {
|
|
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
178
|
[fields?.id || "id"]: text(fields?.id || "id").primaryKey(),
|
|
@@ -158,26 +187,29 @@ 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, {
|
|
194
|
+
var createVerificationsTable = (tableName = "verifications", fields, additionalFields) => sqliteTable(tableName, {
|
|
165
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, {
|
|
203
|
+
var createOrganizationsTable = (tableName = "organizations", fields, additionalFields) => sqliteTable(tableName, {
|
|
173
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, userPkField = "id") => {
|
|
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, {
|
|
@@ -186,10 +218,11 @@ var createMembersTable = (tableName = "members", organizationsTableOrFn = organi
|
|
|
186
218
|
// Partial fix for org FK too?
|
|
187
219
|
userId: text(fields?.userId || "userId").notNull().references(() => usersTable[userPkField], { onDelete: "cascade" }),
|
|
188
220
|
role: text(fields?.role || "role").notNull(),
|
|
189
|
-
createdAt: integer(fields?.createdAt || "createdAt", { mode: "timestamp" }).notNull()
|
|
221
|
+
createdAt: integer(fields?.createdAt || "createdAt", { mode: "timestamp" }).notNull(),
|
|
222
|
+
...createAdditionalColumns(additionalFields)
|
|
190
223
|
});
|
|
191
224
|
};
|
|
192
|
-
var createInvitationsTable = (tableName = "invitations", organizationsTableOrFn = organizations, usersTableOrFn = users, fields, userPkField = "id") => {
|
|
225
|
+
var createInvitationsTable = (tableName = "invitations", organizationsTableOrFn = organizations, usersTableOrFn = users, fields, userPkField = "id", additionalFields) => {
|
|
193
226
|
const organizationsTable = typeof organizationsTableOrFn === "function" ? organizationsTableOrFn() : organizationsTableOrFn;
|
|
194
227
|
const usersTable = typeof usersTableOrFn === "function" ? usersTableOrFn() : usersTableOrFn;
|
|
195
228
|
return sqliteTable(tableName, {
|
|
@@ -200,7 +233,8 @@ var createInvitationsTable = (tableName = "invitations", organizationsTableOrFn
|
|
|
200
233
|
status: text(fields?.status || "status").notNull(),
|
|
201
234
|
expiresAt: integer(fields?.expiresAt || "expiresAt", { mode: "timestamp" }).notNull(),
|
|
202
235
|
inviterId: text(fields?.inviterId || "inviterId").notNull().references(() => usersTable[userPkField], { onDelete: "cascade" }),
|
|
203
|
-
createdAt: integer(fields?.createdAt || "createdAt", { mode: "timestamp" }).notNull()
|
|
236
|
+
createdAt: integer(fields?.createdAt || "createdAt", { mode: "timestamp" }).notNull(),
|
|
237
|
+
...createAdditionalColumns(additionalFields)
|
|
204
238
|
});
|
|
205
239
|
};
|
|
206
240
|
var users = createUsersTable();
|
|
@@ -350,13 +384,13 @@ var createAuth = (config) => {
|
|
|
350
384
|
const memberTableName = schemaMapping?.member?.tableName || "members";
|
|
351
385
|
const invitationTableName = schemaMapping?.invitation?.tableName || "invitations";
|
|
352
386
|
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);
|
|
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);
|
|
360
394
|
const userKey = schemaMapping?.user?.tableName || "user";
|
|
361
395
|
const sessionKey = schemaMapping?.session?.tableName || "session";
|
|
362
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",
|