deesse 0.1.4 → 0.1.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.
@@ -1,9 +1,10 @@
1
1
  import { Pool } from "pg";
2
- export declare const auth: import("better-auth").Auth<{
2
+ import { Config } from "../config/types";
3
+ export declare const createAuth: (config: Config) => import("better-auth").Auth<{
3
4
  secret: string | undefined;
4
- appName?: string | undefined | undefined;
5
- baseURL?: string | undefined | undefined;
6
- basePath?: string | undefined | undefined;
5
+ appName?: string | undefined;
6
+ baseURL?: string | undefined;
7
+ basePath?: string | undefined;
7
8
  secondaryStorage?: import("better-auth").SecondaryStorage | undefined;
8
9
  emailVerification?: {
9
10
  sendVerificationEmail?: (data: {
@@ -17,7 +18,7 @@ export declare const auth: import("better-auth").Auth<{
17
18
  expiresIn?: number;
18
19
  onEmailVerification?: (user: import("better-auth").User, request?: Request) => Promise<void>;
19
20
  afterEmailVerification?: (user: import("better-auth").User, request?: Request) => Promise<void>;
20
- } | undefined | undefined;
21
+ } | undefined;
21
22
  emailAndPassword?: {
22
23
  enabled: boolean;
23
24
  disableSignUp?: boolean;
@@ -42,9 +43,9 @@ export declare const auth: import("better-auth").Auth<{
42
43
  };
43
44
  autoSignIn?: boolean;
44
45
  revokeSessionsOnPasswordReset?: boolean;
45
- } | undefined | undefined;
46
+ } | undefined;
46
47
  socialProviders?: import("@better-auth/core/dist/index-CVLGS-cz.mjs").w | undefined;
47
- plugins?: ([] | import("better-auth").BetterAuthPlugin[]) | undefined | undefined;
48
+ plugins?: ([] | import("better-auth").BetterAuthPlugin[]) | undefined;
48
49
  user?: {
49
50
  modelName?: string;
50
51
  fields?: Partial<Record<"email" | "createdAt" | "updatedAt" | "emailVerified" | "name" | "image", string>>;
@@ -78,7 +79,7 @@ export declare const auth: import("better-auth").Auth<{
78
79
  afterDelete?: (user: import("better-auth").User, request?: Request) => Promise<void>;
79
80
  deleteTokenExpiresIn?: number;
80
81
  };
81
- } | undefined | undefined;
82
+ } | undefined;
82
83
  session?: {
83
84
  modelName?: string;
84
85
  fields?: Partial<Record<"createdAt" | "updatedAt" | "userId" | "expiresAt" | "token" | "ipAddress" | "userAgent", string>>;
@@ -100,7 +101,7 @@ export declare const auth: import("better-auth").Auth<{
100
101
  version?: string | ((session: import("better-auth").Session & Record<string, any>, user: import("better-auth").User & Record<string, any>) => string) | ((session: import("better-auth").Session & Record<string, any>, user: import("better-auth").User & Record<string, any>) => Promise<string>);
101
102
  };
102
103
  freshAge?: number;
103
- } | undefined | undefined;
104
+ } | undefined;
104
105
  account?: {
105
106
  modelName?: string;
106
107
  fields?: Partial<Record<"createdAt" | "updatedAt" | "userId" | "refreshToken" | "idToken" | "accessToken" | "password" | "providerId" | "accountId" | "accessTokenExpiresAt" | "refreshTokenExpiresAt" | "scope", string>>;
@@ -119,13 +120,13 @@ export declare const auth: import("better-auth").Auth<{
119
120
  skipStateCookieCheck?: boolean;
120
121
  storeStateStrategy?: "database" | "cookie";
121
122
  storeAccountCookie?: boolean;
122
- } | undefined | undefined;
123
+ } | undefined;
123
124
  verification?: {
124
125
  modelName?: string;
125
126
  fields?: Partial<Record<"createdAt" | "updatedAt" | "expiresAt" | "value" | "identifier", string>>;
126
127
  disableCleanup?: boolean;
127
- } | undefined | undefined;
128
- trustedOrigins?: (string[] | ((request: Request) => string[] | Promise<string[]>)) | undefined | undefined;
128
+ } | undefined;
129
+ trustedOrigins?: (string[] | ((request: Request) => string[] | Promise<string[]>)) | undefined;
129
130
  rateLimit?: import("better-auth").BetterAuthRateLimitOptions | undefined;
130
131
  advanced?: import("better-auth").BetterAuthAdvancedOptions | undefined;
131
132
  logger?: import("better-auth").Logger | undefined;
@@ -282,7 +283,7 @@ export declare const auth: import("better-auth").Auth<{
282
283
  after?: (verification: import("better-auth").Verification & Record<string, unknown>, context?: import("better-auth").GenericEndpointContext) => Promise<void>;
283
284
  };
284
285
  };
285
- } | undefined | undefined;
286
+ } | undefined;
286
287
  onAPIError?: {
287
288
  throw?: boolean;
288
289
  onError?: (error: unknown, ctx: import("better-auth").AuthContext) => void | Promise<void>;
@@ -319,22 +320,22 @@ export declare const auth: import("better-auth").Auth<{
319
320
  disableCornerDecorations?: boolean;
320
321
  disableBackgroundGrid?: boolean;
321
322
  };
322
- } | undefined | undefined;
323
+ } | undefined;
323
324
  hooks?: {
324
325
  before?: import("@better-auth/core/api").AuthMiddleware;
325
326
  after?: import("@better-auth/core/api").AuthMiddleware;
326
- } | undefined | undefined;
327
- disabledPaths?: string[] | undefined | undefined;
327
+ } | undefined;
328
+ disabledPaths?: string[] | undefined;
328
329
  telemetry?: {
329
330
  enabled?: boolean;
330
331
  debug?: boolean;
331
- } | undefined | undefined;
332
+ } | undefined;
332
333
  experimental?: {
333
334
  joins?: boolean;
334
- } | undefined;
335
+ };
335
336
  database: Pool;
336
337
  }>;
337
- export declare const authClient: {
338
+ export declare const createAuthClient: () => {
338
339
  signIn: {
339
340
  social: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
340
341
  provider: "github" | "apple" | "atlassian" | "cognito" | "discord" | "facebook" | "figma" | "microsoft" | "google" | "huggingface" | "slack" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linear" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "salesforce" | "vk" | "zoom" | "notion" | "kakao" | "naver" | "line" | "paybin" | "paypal" | "polar" | "vercel" | (string & {});
@@ -14,19 +14,19 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.authClient = exports.auth = void 0;
17
+ exports.createAuthClient = exports.createAuth = void 0;
18
18
  const better_auth_1 = require("better-auth");
19
19
  const react_1 = require("better-auth/react");
20
20
  const pg_1 = require("pg");
21
- const config_1 = require("../config");
22
- const config = (0, config_1.getConfig)();
23
- exports.auth = (0, better_auth_1.betterAuth)({
21
+ const createAuth = (config) => (0, better_auth_1.betterAuth)({
24
22
  database: new pg_1.Pool({
25
23
  connectionString: config.databaseUrl,
26
24
  }),
27
25
  ...config.auth,
28
26
  secret: process.env.DEESSE_SECRET,
29
27
  });
30
- exports.authClient = (0, react_1.createAuthClient)();
28
+ exports.createAuth = createAuth;
29
+ const createAuthClient = () => (0, react_1.createAuthClient)();
30
+ exports.createAuthClient = createAuthClient;
31
31
  __exportStar(require("better-auth"), exports);
32
32
  __exportStar(require("better-auth/next-js"), exports);
@@ -1,5 +1,5 @@
1
1
  import { BetterAuthOptions } from "better-auth";
2
2
  export type Config = {
3
3
  databaseUrl: string;
4
- auth: Omit<BetterAuthOptions, "secret" | "database">;
4
+ auth?: Omit<BetterAuthOptions, "secret" | "database">;
5
5
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "deesse",
3
- "version": "0.1.4",
3
+ "version": "0.1.6",
4
4
  "description": "The fullstack web framework",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",