@axium/server 0.12.0 → 0.12.2

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.
Files changed (2) hide show
  1. package/dist/database.d.ts +6 -11
  2. package/package.json +1 -1
@@ -1,7 +1,6 @@
1
1
  import type { Preferences } from '@axium/core';
2
2
  import type { AuthenticatorTransportFuture, CredentialDeviceType } from '@simplewebauthn/server';
3
- import type * as Kys from 'kysely';
4
- import type { GeneratedAlways } from 'kysely';
3
+ import type * as kysely from 'kysely';
5
4
  import { Kysely } from 'kysely';
6
5
  import type { UserInternal, VerificationRole } from './auth.js';
7
6
  export interface Schema {
@@ -15,11 +14,11 @@ export interface Schema {
15
14
  isAdmin: boolean;
16
15
  roles: string[];
17
16
  tags: string[];
18
- registeredAt: GeneratedAlways<Date>;
17
+ registeredAt: kysely.GeneratedAlways<Date>;
19
18
  };
20
19
  sessions: {
21
- id: GeneratedAlways<string>;
22
- created: GeneratedAlways<Date>;
20
+ id: kysely.GeneratedAlways<string>;
21
+ created: kysely.GeneratedAlways<Date>;
23
22
  userId: string;
24
23
  token: string;
25
24
  expires: Date;
@@ -34,7 +33,7 @@ export interface Schema {
34
33
  passkeys: {
35
34
  id: string;
36
35
  name: string | null;
37
- createdAt: GeneratedAlways<Date>;
36
+ createdAt: kysely.GeneratedAlways<Date>;
38
37
  userId: string;
39
38
  publicKey: Uint8Array;
40
39
  counter: number;
@@ -50,13 +49,10 @@ export declare function count<const T extends keyof Schema>(table: T): Promise<n
50
49
  export type TablesMatching<T> = (string & keyof Schema) & keyof {
51
50
  [K in keyof Schema as Schema[K] extends T ? K : never]: null;
52
51
  };
53
- type TableWithId = TablesMatching<{
54
- userId: string;
55
- }>;
56
52
  /**
57
53
  * Select the user with the id from the userId column of a table, placing it in the `user` property.
58
54
  */
59
- export declare function userFromId(eb: Kys.ExpressionBuilder<Schema, TableWithId>): Kys.AliasedRawBuilder<UserInternal, 'user'>;
55
+ export declare function userFromId(eb: kysely.ExpressionBuilder<Schema, any>): kysely.AliasedRawBuilder<UserInternal, 'user'>;
60
56
  export interface Stats {
61
57
  users: number;
62
58
  passkeys: number;
@@ -85,4 +81,3 @@ export declare function uninstall(opt: OpOptions): Promise<void>;
85
81
  * Removes all data from tables.
86
82
  */
87
83
  export declare function wipe(opt: OpOptions): Promise<void>;
88
- export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@axium/server",
3
- "version": "0.12.0",
3
+ "version": "0.12.2",
4
4
  "author": "James Prevett <axium@jamespre.dev> (https://jamespre.dev)",
5
5
  "funding": {
6
6
  "type": "individual",