@webtwizz/cloud 0.4.0 → 0.5.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/AI_GUIDE.md +63 -5
- package/CHANGELOG.md +26 -0
- package/README.md +4 -2
- package/dist/chunk-4PKQUQZD.js +6 -0
- package/dist/{chunk-G54JBUO3.js → chunk-WX3OU7ED.js} +17 -4
- package/dist/client.d.ts +13 -4
- package/dist/client.js +68 -770
- package/dist/db.js +1 -1
- package/dist/files.js +1 -1
- package/dist/index.js +1 -1
- package/dist/server.d.ts +29 -5
- package/dist/server.js +494 -1428
- package/package.json +7 -10
- package/dist/chunk-7EXXDRMF.js +0 -376
package/dist/db.js
CHANGED
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
import "server-only";
|
|
7
7
|
import postgres from "postgres";
|
|
8
8
|
function createDb({ url, ...options } = {}) {
|
|
9
|
-
return postgres(url ?? env("DATABASE_URL"), { ...options, prepare: false });
|
|
9
|
+
return postgres(url ?? env("DATABASE_URL"), { infer: true, ...options, prepare: false });
|
|
10
10
|
}
|
|
11
11
|
export {
|
|
12
12
|
createDb
|
package/dist/files.js
CHANGED
package/dist/index.js
CHANGED
package/dist/server.d.ts
CHANGED
|
@@ -1,13 +1,37 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { NextRequest, NextResponse } from 'next/server';
|
|
2
|
+
import { adminClient, emailOTPClient, organizationClient } from 'better-auth/client/plugins';
|
|
3
|
+
import { createAuthClient } from 'better-auth/react';
|
|
2
4
|
|
|
3
5
|
type AuthOptions = {
|
|
4
6
|
url?: string;
|
|
5
7
|
secret?: string;
|
|
8
|
+
/** Seconds a signed-in page trusts its cached session before asking again; blocks and role changes take effect within this. */
|
|
6
9
|
sessionDataTtl?: number;
|
|
7
10
|
};
|
|
8
|
-
type
|
|
9
|
-
|
|
10
|
-
|
|
11
|
+
type RouteContext = {
|
|
12
|
+
params: Promise<{
|
|
13
|
+
path?: string[];
|
|
14
|
+
}>;
|
|
15
|
+
};
|
|
16
|
+
type Route = (request: Request, context: RouteContext) => Promise<Response>;
|
|
17
|
+
type AuthServerPlugins = Array<ReturnType<typeof adminClient<{}>> | ReturnType<typeof emailOTPClient> | ReturnType<typeof organizationClient<{}>>>;
|
|
18
|
+
type ServerApi = ReturnType<typeof createAuthClient<{
|
|
19
|
+
plugins: AuthServerPlugins;
|
|
20
|
+
}>>;
|
|
21
|
+
type Auth = Pick<ServerApi, 'getSession' | 'signIn' | 'signUp' | 'signOut' | 'updateUser' | 'changePassword' | 'listSessions' | 'revokeSession' | 'revokeSessions' | 'revokeOtherSessions' | 'emailOtp' | 'forgetPassword' | 'resetPassword' | 'verifyEmail' | 'listAccounts' | 'accountInfo' | 'getAccessToken' | 'admin' | 'organization'> & {
|
|
22
|
+
/** The site's sign-in route: `export const { GET, POST, PUT, DELETE, PATCH } = auth.handler()`. */
|
|
23
|
+
handler(): {
|
|
24
|
+
GET: Route;
|
|
25
|
+
POST: Route;
|
|
26
|
+
PUT: Route;
|
|
27
|
+
DELETE: Route;
|
|
28
|
+
PATCH: Route;
|
|
29
|
+
};
|
|
30
|
+
/** Sends visitors without a session to the sign-in page. */
|
|
31
|
+
middleware(config?: {
|
|
32
|
+
loginUrl?: string;
|
|
33
|
+
}): (request: NextRequest) => Promise<NextResponse>;
|
|
34
|
+
};
|
|
11
35
|
declare function createAuth(options?: AuthOptions): Auth;
|
|
12
36
|
|
|
13
|
-
export { type Auth, type AuthOptions,
|
|
37
|
+
export { type Auth, type AuthOptions, type AuthServerPlugins, createAuth };
|