@axium/server 0.0.9 → 0.1.0
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/auth.d.ts +7 -0
- package/dist/auth.js +1 -0
- package/dist/database.d.ts +2 -0
- package/dist/database.js +1 -0
- package/package.json +1 -1
package/dist/auth.d.ts
CHANGED
|
@@ -2,10 +2,17 @@ import type { Adapter } from '@auth/core/adapters';
|
|
|
2
2
|
import type { Provider } from '@auth/core/providers';
|
|
3
3
|
import type { AuthConfig } from '@auth/core/types';
|
|
4
4
|
import { Registration } from '@axium/core/schemas';
|
|
5
|
+
/**
|
|
6
|
+
* User preferences.
|
|
7
|
+
* Modify with `declare module ...`
|
|
8
|
+
*/
|
|
9
|
+
export interface Preferences {
|
|
10
|
+
}
|
|
5
11
|
declare module '@auth/core/adapters' {
|
|
6
12
|
interface AdapterUser {
|
|
7
13
|
password: string | null;
|
|
8
14
|
salt: string | null;
|
|
15
|
+
preferences: Preferences;
|
|
9
16
|
}
|
|
10
17
|
}
|
|
11
18
|
export declare let adapter: Adapter;
|
package/dist/auth.js
CHANGED
|
@@ -59,6 +59,7 @@ export async function register(credentials) {
|
|
|
59
59
|
emailVerified: null,
|
|
60
60
|
salt: password ? salt : null,
|
|
61
61
|
password: password ? hashSync(password, salt) : null,
|
|
62
|
+
preferences: {},
|
|
62
63
|
});
|
|
63
64
|
const expires = new Date();
|
|
64
65
|
expires.setMonth(expires.getMonth() + 1);
|
package/dist/database.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { AdapterAccountType as db } from '@auth/core/adapters';
|
|
2
2
|
import { Kysely, type GeneratedAlways } from 'kysely';
|
|
3
|
+
import type { Preferences } from './auth.js';
|
|
3
4
|
import * as config from './config.js';
|
|
4
5
|
export interface Schema {
|
|
5
6
|
User: {
|
|
@@ -10,6 +11,7 @@ export interface Schema {
|
|
|
10
11
|
image: string | null;
|
|
11
12
|
password: string | null;
|
|
12
13
|
salt: string | null;
|
|
14
|
+
preferences: Preferences;
|
|
13
15
|
};
|
|
14
16
|
Account: {
|
|
15
17
|
id: GeneratedAlways<string>;
|
package/dist/database.js
CHANGED
|
@@ -177,6 +177,7 @@ export async function init(opt) {
|
|
|
177
177
|
.addColumn('image', 'text')
|
|
178
178
|
.addColumn('password', 'text')
|
|
179
179
|
.addColumn('salt', 'text')
|
|
180
|
+
.addColumn('preferences', 'jsonb', col => col.notNull().defaultTo(sql `'{}'::jsonb`))
|
|
180
181
|
.execute()
|
|
181
182
|
.catch(relationExists('User'));
|
|
182
183
|
opt.output('done');
|