@sanoma-ai/connector-better-auth 0.2.4 → 0.2.6
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/README.md +5 -5
- package/dist/db/staff.d.ts +695 -0
- package/dist/db/staff.js +4 -0
- package/dist/db/staff.js.map +1 -0
- package/dist/db/tables.d.ts +702 -0
- package/dist/db/tables.js +69 -0
- package/dist/db/tables.js.map +1 -0
- package/dist/db/visitors.d.ts +695 -0
- package/dist/db/visitors.js +4 -0
- package/dist/db/visitors.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/instance.d.ts +137 -78
- package/dist/instance.js +133 -59
- package/dist/instance.js.map +1 -1
- package/dist/login.d.ts +5 -5
- package/dist/login.js +19 -21
- package/dist/login.js.map +1 -1
- package/dist/staff.d.ts +3 -2
- package/dist/staff.js +56 -32
- package/dist/staff.js.map +1 -1
- package/drizzle/staff/0000_closed_toro.sql +64 -0
- package/drizzle/staff/meta/0000_snapshot.json +431 -0
- package/drizzle/staff/meta/_journal.json +13 -0
- package/drizzle/visitors/0000_natural_dexter_bennett.sql +64 -0
- package/drizzle/visitors/meta/0000_snapshot.json +431 -0
- package/drizzle/visitors/meta/_journal.json +13 -0
- package/package.json +11 -8
|
@@ -0,0 +1,431 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "e7e93283-cf2d-4284-a029-0339cdce13a7",
|
|
3
|
+
"prevId": "00000000-0000-0000-0000-000000000000",
|
|
4
|
+
"version": "7",
|
|
5
|
+
"dialect": "postgresql",
|
|
6
|
+
"tables": {
|
|
7
|
+
"better_auth.account": {
|
|
8
|
+
"name": "account",
|
|
9
|
+
"schema": "better_auth",
|
|
10
|
+
"columns": {
|
|
11
|
+
"id": {
|
|
12
|
+
"name": "id",
|
|
13
|
+
"type": "text",
|
|
14
|
+
"primaryKey": true,
|
|
15
|
+
"notNull": true
|
|
16
|
+
},
|
|
17
|
+
"account_id": {
|
|
18
|
+
"name": "account_id",
|
|
19
|
+
"type": "text",
|
|
20
|
+
"primaryKey": false,
|
|
21
|
+
"notNull": true
|
|
22
|
+
},
|
|
23
|
+
"provider_id": {
|
|
24
|
+
"name": "provider_id",
|
|
25
|
+
"type": "text",
|
|
26
|
+
"primaryKey": false,
|
|
27
|
+
"notNull": true
|
|
28
|
+
},
|
|
29
|
+
"user_id": {
|
|
30
|
+
"name": "user_id",
|
|
31
|
+
"type": "text",
|
|
32
|
+
"primaryKey": false,
|
|
33
|
+
"notNull": true
|
|
34
|
+
},
|
|
35
|
+
"access_token": {
|
|
36
|
+
"name": "access_token",
|
|
37
|
+
"type": "text",
|
|
38
|
+
"primaryKey": false,
|
|
39
|
+
"notNull": false
|
|
40
|
+
},
|
|
41
|
+
"refresh_token": {
|
|
42
|
+
"name": "refresh_token",
|
|
43
|
+
"type": "text",
|
|
44
|
+
"primaryKey": false,
|
|
45
|
+
"notNull": false
|
|
46
|
+
},
|
|
47
|
+
"id_token": {
|
|
48
|
+
"name": "id_token",
|
|
49
|
+
"type": "text",
|
|
50
|
+
"primaryKey": false,
|
|
51
|
+
"notNull": false
|
|
52
|
+
},
|
|
53
|
+
"access_token_expires_at": {
|
|
54
|
+
"name": "access_token_expires_at",
|
|
55
|
+
"type": "timestamp with time zone",
|
|
56
|
+
"primaryKey": false,
|
|
57
|
+
"notNull": false
|
|
58
|
+
},
|
|
59
|
+
"refresh_token_expires_at": {
|
|
60
|
+
"name": "refresh_token_expires_at",
|
|
61
|
+
"type": "timestamp with time zone",
|
|
62
|
+
"primaryKey": false,
|
|
63
|
+
"notNull": false
|
|
64
|
+
},
|
|
65
|
+
"scope": {
|
|
66
|
+
"name": "scope",
|
|
67
|
+
"type": "text",
|
|
68
|
+
"primaryKey": false,
|
|
69
|
+
"notNull": false
|
|
70
|
+
},
|
|
71
|
+
"password": {
|
|
72
|
+
"name": "password",
|
|
73
|
+
"type": "text",
|
|
74
|
+
"primaryKey": false,
|
|
75
|
+
"notNull": false
|
|
76
|
+
},
|
|
77
|
+
"created_at": {
|
|
78
|
+
"name": "created_at",
|
|
79
|
+
"type": "timestamp with time zone",
|
|
80
|
+
"primaryKey": false,
|
|
81
|
+
"notNull": true,
|
|
82
|
+
"default": "now()"
|
|
83
|
+
},
|
|
84
|
+
"updated_at": {
|
|
85
|
+
"name": "updated_at",
|
|
86
|
+
"type": "timestamp with time zone",
|
|
87
|
+
"primaryKey": false,
|
|
88
|
+
"notNull": true,
|
|
89
|
+
"default": "now()"
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
"indexes": {
|
|
93
|
+
"account_user_id_index": {
|
|
94
|
+
"name": "account_user_id_index",
|
|
95
|
+
"columns": [
|
|
96
|
+
{
|
|
97
|
+
"expression": "user_id",
|
|
98
|
+
"isExpression": false,
|
|
99
|
+
"asc": true,
|
|
100
|
+
"nulls": "last"
|
|
101
|
+
}
|
|
102
|
+
],
|
|
103
|
+
"isUnique": false,
|
|
104
|
+
"concurrently": false,
|
|
105
|
+
"method": "btree",
|
|
106
|
+
"with": {}
|
|
107
|
+
}
|
|
108
|
+
},
|
|
109
|
+
"foreignKeys": {
|
|
110
|
+
"account_user_id_user_id_fk": {
|
|
111
|
+
"name": "account_user_id_user_id_fk",
|
|
112
|
+
"tableFrom": "account",
|
|
113
|
+
"tableTo": "user",
|
|
114
|
+
"schemaTo": "better_auth",
|
|
115
|
+
"columnsFrom": [
|
|
116
|
+
"user_id"
|
|
117
|
+
],
|
|
118
|
+
"columnsTo": [
|
|
119
|
+
"id"
|
|
120
|
+
],
|
|
121
|
+
"onDelete": "cascade",
|
|
122
|
+
"onUpdate": "no action"
|
|
123
|
+
}
|
|
124
|
+
},
|
|
125
|
+
"compositePrimaryKeys": {},
|
|
126
|
+
"uniqueConstraints": {},
|
|
127
|
+
"policies": {},
|
|
128
|
+
"checkConstraints": {},
|
|
129
|
+
"isRLSEnabled": false
|
|
130
|
+
},
|
|
131
|
+
"better_auth.rate_limit": {
|
|
132
|
+
"name": "rate_limit",
|
|
133
|
+
"schema": "better_auth",
|
|
134
|
+
"columns": {
|
|
135
|
+
"id": {
|
|
136
|
+
"name": "id",
|
|
137
|
+
"type": "text",
|
|
138
|
+
"primaryKey": true,
|
|
139
|
+
"notNull": true
|
|
140
|
+
},
|
|
141
|
+
"key": {
|
|
142
|
+
"name": "key",
|
|
143
|
+
"type": "text",
|
|
144
|
+
"primaryKey": false,
|
|
145
|
+
"notNull": true
|
|
146
|
+
},
|
|
147
|
+
"count": {
|
|
148
|
+
"name": "count",
|
|
149
|
+
"type": "integer",
|
|
150
|
+
"primaryKey": false,
|
|
151
|
+
"notNull": true
|
|
152
|
+
},
|
|
153
|
+
"last_request": {
|
|
154
|
+
"name": "last_request",
|
|
155
|
+
"type": "bigint",
|
|
156
|
+
"primaryKey": false,
|
|
157
|
+
"notNull": true
|
|
158
|
+
}
|
|
159
|
+
},
|
|
160
|
+
"indexes": {},
|
|
161
|
+
"foreignKeys": {},
|
|
162
|
+
"compositePrimaryKeys": {},
|
|
163
|
+
"uniqueConstraints": {
|
|
164
|
+
"rate_limit_key_unique": {
|
|
165
|
+
"name": "rate_limit_key_unique",
|
|
166
|
+
"nullsNotDistinct": false,
|
|
167
|
+
"columns": [
|
|
168
|
+
"key"
|
|
169
|
+
]
|
|
170
|
+
}
|
|
171
|
+
},
|
|
172
|
+
"policies": {},
|
|
173
|
+
"checkConstraints": {},
|
|
174
|
+
"isRLSEnabled": false
|
|
175
|
+
},
|
|
176
|
+
"better_auth.session": {
|
|
177
|
+
"name": "session",
|
|
178
|
+
"schema": "better_auth",
|
|
179
|
+
"columns": {
|
|
180
|
+
"id": {
|
|
181
|
+
"name": "id",
|
|
182
|
+
"type": "text",
|
|
183
|
+
"primaryKey": true,
|
|
184
|
+
"notNull": true
|
|
185
|
+
},
|
|
186
|
+
"expires_at": {
|
|
187
|
+
"name": "expires_at",
|
|
188
|
+
"type": "timestamp with time zone",
|
|
189
|
+
"primaryKey": false,
|
|
190
|
+
"notNull": true
|
|
191
|
+
},
|
|
192
|
+
"token": {
|
|
193
|
+
"name": "token",
|
|
194
|
+
"type": "text",
|
|
195
|
+
"primaryKey": false,
|
|
196
|
+
"notNull": true
|
|
197
|
+
},
|
|
198
|
+
"created_at": {
|
|
199
|
+
"name": "created_at",
|
|
200
|
+
"type": "timestamp with time zone",
|
|
201
|
+
"primaryKey": false,
|
|
202
|
+
"notNull": true,
|
|
203
|
+
"default": "now()"
|
|
204
|
+
},
|
|
205
|
+
"updated_at": {
|
|
206
|
+
"name": "updated_at",
|
|
207
|
+
"type": "timestamp with time zone",
|
|
208
|
+
"primaryKey": false,
|
|
209
|
+
"notNull": true,
|
|
210
|
+
"default": "now()"
|
|
211
|
+
},
|
|
212
|
+
"ip_address": {
|
|
213
|
+
"name": "ip_address",
|
|
214
|
+
"type": "text",
|
|
215
|
+
"primaryKey": false,
|
|
216
|
+
"notNull": false
|
|
217
|
+
},
|
|
218
|
+
"user_agent": {
|
|
219
|
+
"name": "user_agent",
|
|
220
|
+
"type": "text",
|
|
221
|
+
"primaryKey": false,
|
|
222
|
+
"notNull": false
|
|
223
|
+
},
|
|
224
|
+
"user_id": {
|
|
225
|
+
"name": "user_id",
|
|
226
|
+
"type": "text",
|
|
227
|
+
"primaryKey": false,
|
|
228
|
+
"notNull": true
|
|
229
|
+
}
|
|
230
|
+
},
|
|
231
|
+
"indexes": {
|
|
232
|
+
"session_user_id_index": {
|
|
233
|
+
"name": "session_user_id_index",
|
|
234
|
+
"columns": [
|
|
235
|
+
{
|
|
236
|
+
"expression": "user_id",
|
|
237
|
+
"isExpression": false,
|
|
238
|
+
"asc": true,
|
|
239
|
+
"nulls": "last"
|
|
240
|
+
}
|
|
241
|
+
],
|
|
242
|
+
"isUnique": false,
|
|
243
|
+
"concurrently": false,
|
|
244
|
+
"method": "btree",
|
|
245
|
+
"with": {}
|
|
246
|
+
}
|
|
247
|
+
},
|
|
248
|
+
"foreignKeys": {
|
|
249
|
+
"session_user_id_user_id_fk": {
|
|
250
|
+
"name": "session_user_id_user_id_fk",
|
|
251
|
+
"tableFrom": "session",
|
|
252
|
+
"tableTo": "user",
|
|
253
|
+
"schemaTo": "better_auth",
|
|
254
|
+
"columnsFrom": [
|
|
255
|
+
"user_id"
|
|
256
|
+
],
|
|
257
|
+
"columnsTo": [
|
|
258
|
+
"id"
|
|
259
|
+
],
|
|
260
|
+
"onDelete": "cascade",
|
|
261
|
+
"onUpdate": "no action"
|
|
262
|
+
}
|
|
263
|
+
},
|
|
264
|
+
"compositePrimaryKeys": {},
|
|
265
|
+
"uniqueConstraints": {
|
|
266
|
+
"session_token_unique": {
|
|
267
|
+
"name": "session_token_unique",
|
|
268
|
+
"nullsNotDistinct": false,
|
|
269
|
+
"columns": [
|
|
270
|
+
"token"
|
|
271
|
+
]
|
|
272
|
+
}
|
|
273
|
+
},
|
|
274
|
+
"policies": {},
|
|
275
|
+
"checkConstraints": {},
|
|
276
|
+
"isRLSEnabled": false
|
|
277
|
+
},
|
|
278
|
+
"better_auth.user": {
|
|
279
|
+
"name": "user",
|
|
280
|
+
"schema": "better_auth",
|
|
281
|
+
"columns": {
|
|
282
|
+
"id": {
|
|
283
|
+
"name": "id",
|
|
284
|
+
"type": "text",
|
|
285
|
+
"primaryKey": true,
|
|
286
|
+
"notNull": true
|
|
287
|
+
},
|
|
288
|
+
"name": {
|
|
289
|
+
"name": "name",
|
|
290
|
+
"type": "text",
|
|
291
|
+
"primaryKey": false,
|
|
292
|
+
"notNull": true
|
|
293
|
+
},
|
|
294
|
+
"email": {
|
|
295
|
+
"name": "email",
|
|
296
|
+
"type": "text",
|
|
297
|
+
"primaryKey": false,
|
|
298
|
+
"notNull": true
|
|
299
|
+
},
|
|
300
|
+
"email_verified": {
|
|
301
|
+
"name": "email_verified",
|
|
302
|
+
"type": "boolean",
|
|
303
|
+
"primaryKey": false,
|
|
304
|
+
"notNull": true,
|
|
305
|
+
"default": false
|
|
306
|
+
},
|
|
307
|
+
"image": {
|
|
308
|
+
"name": "image",
|
|
309
|
+
"type": "text",
|
|
310
|
+
"primaryKey": false,
|
|
311
|
+
"notNull": false
|
|
312
|
+
},
|
|
313
|
+
"created_at": {
|
|
314
|
+
"name": "created_at",
|
|
315
|
+
"type": "timestamp with time zone",
|
|
316
|
+
"primaryKey": false,
|
|
317
|
+
"notNull": true,
|
|
318
|
+
"default": "now()"
|
|
319
|
+
},
|
|
320
|
+
"updated_at": {
|
|
321
|
+
"name": "updated_at",
|
|
322
|
+
"type": "timestamp with time zone",
|
|
323
|
+
"primaryKey": false,
|
|
324
|
+
"notNull": true,
|
|
325
|
+
"default": "now()"
|
|
326
|
+
},
|
|
327
|
+
"github": {
|
|
328
|
+
"name": "github",
|
|
329
|
+
"type": "text",
|
|
330
|
+
"primaryKey": false,
|
|
331
|
+
"notNull": false
|
|
332
|
+
}
|
|
333
|
+
},
|
|
334
|
+
"indexes": {},
|
|
335
|
+
"foreignKeys": {},
|
|
336
|
+
"compositePrimaryKeys": {},
|
|
337
|
+
"uniqueConstraints": {
|
|
338
|
+
"user_email_unique": {
|
|
339
|
+
"name": "user_email_unique",
|
|
340
|
+
"nullsNotDistinct": false,
|
|
341
|
+
"columns": [
|
|
342
|
+
"email"
|
|
343
|
+
]
|
|
344
|
+
}
|
|
345
|
+
},
|
|
346
|
+
"policies": {},
|
|
347
|
+
"checkConstraints": {},
|
|
348
|
+
"isRLSEnabled": false
|
|
349
|
+
},
|
|
350
|
+
"better_auth.verification": {
|
|
351
|
+
"name": "verification",
|
|
352
|
+
"schema": "better_auth",
|
|
353
|
+
"columns": {
|
|
354
|
+
"id": {
|
|
355
|
+
"name": "id",
|
|
356
|
+
"type": "text",
|
|
357
|
+
"primaryKey": true,
|
|
358
|
+
"notNull": true
|
|
359
|
+
},
|
|
360
|
+
"identifier": {
|
|
361
|
+
"name": "identifier",
|
|
362
|
+
"type": "text",
|
|
363
|
+
"primaryKey": false,
|
|
364
|
+
"notNull": true
|
|
365
|
+
},
|
|
366
|
+
"value": {
|
|
367
|
+
"name": "value",
|
|
368
|
+
"type": "text",
|
|
369
|
+
"primaryKey": false,
|
|
370
|
+
"notNull": true
|
|
371
|
+
},
|
|
372
|
+
"expires_at": {
|
|
373
|
+
"name": "expires_at",
|
|
374
|
+
"type": "timestamp with time zone",
|
|
375
|
+
"primaryKey": false,
|
|
376
|
+
"notNull": true
|
|
377
|
+
},
|
|
378
|
+
"created_at": {
|
|
379
|
+
"name": "created_at",
|
|
380
|
+
"type": "timestamp with time zone",
|
|
381
|
+
"primaryKey": false,
|
|
382
|
+
"notNull": true,
|
|
383
|
+
"default": "now()"
|
|
384
|
+
},
|
|
385
|
+
"updated_at": {
|
|
386
|
+
"name": "updated_at",
|
|
387
|
+
"type": "timestamp with time zone",
|
|
388
|
+
"primaryKey": false,
|
|
389
|
+
"notNull": true,
|
|
390
|
+
"default": "now()"
|
|
391
|
+
}
|
|
392
|
+
},
|
|
393
|
+
"indexes": {
|
|
394
|
+
"verification_identifier_index": {
|
|
395
|
+
"name": "verification_identifier_index",
|
|
396
|
+
"columns": [
|
|
397
|
+
{
|
|
398
|
+
"expression": "identifier",
|
|
399
|
+
"isExpression": false,
|
|
400
|
+
"asc": true,
|
|
401
|
+
"nulls": "last"
|
|
402
|
+
}
|
|
403
|
+
],
|
|
404
|
+
"isUnique": false,
|
|
405
|
+
"concurrently": false,
|
|
406
|
+
"method": "btree",
|
|
407
|
+
"with": {}
|
|
408
|
+
}
|
|
409
|
+
},
|
|
410
|
+
"foreignKeys": {},
|
|
411
|
+
"compositePrimaryKeys": {},
|
|
412
|
+
"uniqueConstraints": {},
|
|
413
|
+
"policies": {},
|
|
414
|
+
"checkConstraints": {},
|
|
415
|
+
"isRLSEnabled": false
|
|
416
|
+
}
|
|
417
|
+
},
|
|
418
|
+
"enums": {},
|
|
419
|
+
"schemas": {
|
|
420
|
+
"better_auth": "better_auth"
|
|
421
|
+
},
|
|
422
|
+
"sequences": {},
|
|
423
|
+
"roles": {},
|
|
424
|
+
"policies": {},
|
|
425
|
+
"views": {},
|
|
426
|
+
"_meta": {
|
|
427
|
+
"columns": {},
|
|
428
|
+
"schemas": {},
|
|
429
|
+
"tables": {}
|
|
430
|
+
}
|
|
431
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sanoma-ai/connector-better-auth",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.6",
|
|
4
4
|
"description": "Better Auth for Sanoma: the visitor login of public sites (email and password, or an email code) and the staff sign-in on a host (email code, invite links, GitHub), on the company's own database",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"auth",
|
|
@@ -20,6 +20,8 @@
|
|
|
20
20
|
},
|
|
21
21
|
"files": [
|
|
22
22
|
"dist",
|
|
23
|
+
"drizzle",
|
|
24
|
+
"!drizzle/*.config.ts",
|
|
23
25
|
"logo.svg",
|
|
24
26
|
"logo-dark.svg",
|
|
25
27
|
"README.md",
|
|
@@ -39,18 +41,18 @@
|
|
|
39
41
|
"access": "public"
|
|
40
42
|
},
|
|
41
43
|
"dependencies": {
|
|
42
|
-
"better-auth": "
|
|
43
|
-
"
|
|
44
|
+
"better-auth": "1.7.12",
|
|
45
|
+
"drizzle-orm": "0.45.4",
|
|
44
46
|
"pg": "^8.23.1"
|
|
45
47
|
},
|
|
46
48
|
"devDependencies": {
|
|
47
|
-
"@sanoma-ai/app": "0.10.9",
|
|
48
49
|
"@sanoma-ai/testing": "0.1.1",
|
|
49
|
-
"@sanoma-ai/workflows": "0.11.
|
|
50
|
-
"@types/pg": "^8.23.1"
|
|
50
|
+
"@sanoma-ai/workflows": "0.11.14",
|
|
51
|
+
"@types/pg": "^8.23.1",
|
|
52
|
+
"drizzle-kit": "0.31.11"
|
|
51
53
|
},
|
|
52
54
|
"peerDependencies": {
|
|
53
|
-
"@sanoma-ai/workflows": "^0.11.
|
|
55
|
+
"@sanoma-ai/workflows": "^0.11.14"
|
|
54
56
|
},
|
|
55
57
|
"engines": {
|
|
56
58
|
"node": ">=26"
|
|
@@ -63,6 +65,7 @@
|
|
|
63
65
|
"scripts": {
|
|
64
66
|
"build": "tsc -p tsconfig.build.json",
|
|
65
67
|
"clean": "rm -rf dist",
|
|
66
|
-
"watch": "tsc -p tsconfig.build.json --watch --preserveWatchOutput"
|
|
68
|
+
"watch": "tsc -p tsconfig.build.json --watch --preserveWatchOutput",
|
|
69
|
+
"generate": "drizzle-kit generate --config drizzle/visitors.config.ts && drizzle-kit generate --config drizzle/staff.config.ts"
|
|
67
70
|
}
|
|
68
71
|
}
|