@sqrzro/server 2.0.0-bz.26 → 2.0.0-bz.28

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/auth.js CHANGED
@@ -1 +1 @@
1
- module.exports = require('./dist/auth/index');
1
+ export * from './dist/auth/index';
package/cache.js CHANGED
@@ -1 +1 @@
1
- module.exports = require('./dist/cache/index');
1
+ export * from './dist/cache/index';
@@ -74,7 +74,7 @@ async function createPasswordResetToken(email) {
74
74
  return null;
75
75
  }
76
76
  await db.delete(authResetTable).where(eq(authResetTable.userId, user.id));
77
- const id = generateID(RESET_TOKEN_LENGTH);
77
+ const id = generateID('', RESET_TOKEN_LENGTH);
78
78
  await db.insert(authResetTable).values({
79
79
  id,
80
80
  userId: user.id,
@@ -18,8 +18,8 @@ export async function registerClient({ alias, id, secret, }) {
18
18
  .insert(authClientTable)
19
19
  .values({
20
20
  alias,
21
- id: id || generateID(ID_LENGTH),
22
- secret: await hashPassword(secret || generateID(SECRET_LENGTH)),
21
+ id: id || generateID('', ID_LENGTH),
22
+ secret: await hashPassword(secret || generateID('', SECRET_LENGTH)),
23
23
  })
24
24
  .returning();
25
25
  return client;
@@ -23,7 +23,7 @@ declare module 'lucia' {
23
23
  }
24
24
  }
25
25
  export declare const lucia: Lucia<DatabaseSessionAttributes, DatabaseUserAttributes>;
26
- export declare function generateID(length?: number): string;
26
+ export declare function generateID(prefix?: string, length?: number): string;
27
27
  export declare function invalidateSession(id: string): Promise<void>;
28
28
  export declare function invalidateUserSessions(id: string): Promise<void>;
29
29
  export declare function createUserSession(id: string, scope?: Scope): Promise<boolean>;
@@ -41,8 +41,8 @@ export const lucia = new Lucia(adapter, {
41
41
  role: attributes.role,
42
42
  }),
43
43
  });
44
- export function generateID(length = ID_LENGTH) {
45
- return generateId(length);
44
+ export function generateID(prefix = '', length = ID_LENGTH) {
45
+ return `${prefix ? `${prefix}_` : ''}${generateId(length)}`;
46
46
  }
47
47
  export async function invalidateSession(id) {
48
48
  const cookie = lucia.createBlankSessionCookie();
package/forms.js CHANGED
@@ -1 +1 @@
1
- module.exports = require('./dist/forms/index');
1
+ export * from './dist/forms/index';
package/lists.js CHANGED
@@ -1 +1 @@
1
- module.exports = require('./dist/lists/index');
1
+ export * from './dist/lists/index';
package/mail.js CHANGED
@@ -1 +1 @@
1
- module.exports = require('./dist/mail/index');
1
+ export * from './dist/mail/index';
package/middleware.js CHANGED
@@ -1 +1 @@
1
- module.exports = require('./dist/middleware');
1
+ export * from './dist/middleware';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sqrzro/server",
3
- "version": "2.0.0-bz.26",
3
+ "version": "2.0.0-bz.28",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -47,6 +47,7 @@
47
47
  "@types/bcryptjs": "^2.4.6",
48
48
  "@types/jest": "^29.5.12",
49
49
  "@types/qrcode": "^1.5.5",
50
+ "@types/react": "^18.2.0",
50
51
  "@types/react-dom": "^18.2.21",
51
52
  "eslint": "^8.57.0",
52
53
  "jest": "^29.7.0",
package/schema.js CHANGED
@@ -1 +1 @@
1
- module.exports = require('./dist/database/schema');
1
+ export * from './dist/database/schema';
package/url.js CHANGED
@@ -1 +1 @@
1
- module.exports = require('./dist/url/index');
1
+ export * from './dist/url/index';