better-auth-studio 1.0.79-beta.60 → 1.0.79-beta.62

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.
@@ -0,0 +1,22 @@
1
+ import type { StudioConfig } from '../types/handler.js';
2
+ /**
3
+ * Astro adapter for Better Auth Studio
4
+ *
5
+ * Usage in a catch-all API route:
6
+ * ```ts
7
+ * // pages/api/studio/[...all].ts
8
+ * import { betterAuthStudio } from 'better-auth-studio/astro';
9
+ * import studioConfig from '../../../../studio.config';
10
+ * import type { APIRoute } from 'astro';
11
+ *
12
+ * const handler = betterAuthStudio(studioConfig);
13
+ *
14
+ * export const ALL: APIRoute = async (ctx) => {
15
+ * return handler(ctx);
16
+ * };
17
+ * ```
18
+ */
19
+ export declare function betterAuthStudio(config: StudioConfig): (ctx: {
20
+ request: Request;
21
+ }) => Promise<Response>;
22
+ //# sourceMappingURL=astro.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"astro.d.ts","sourceRoot":"","sources":["../../src/adapters/astro.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAuC,MAAM,qBAAqB,CAAC;AAE7F;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,YAAY,IACrC,KAAK;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,KAAG,OAAO,CAAC,QAAQ,CAAC,CAa5D"}
@@ -0,0 +1,95 @@
1
+ import { handleStudioRequest } from '../core/handler.js';
2
+ /**
3
+ * Astro adapter for Better Auth Studio
4
+ *
5
+ * Usage in a catch-all API route:
6
+ * ```ts
7
+ * // pages/api/studio/[...all].ts
8
+ * import { betterAuthStudio } from 'better-auth-studio/astro';
9
+ * import studioConfig from '../../../../studio.config';
10
+ * import type { APIRoute } from 'astro';
11
+ *
12
+ * const handler = betterAuthStudio(studioConfig);
13
+ *
14
+ * export const ALL: APIRoute = async (ctx) => {
15
+ * return handler(ctx);
16
+ * };
17
+ * ```
18
+ */
19
+ export function betterAuthStudio(config) {
20
+ return async (ctx) => {
21
+ try {
22
+ const universalReq = await convertAstroToUniversal(ctx, config);
23
+ const universalRes = await handleStudioRequest(universalReq, config);
24
+ return universalToResponse(universalRes);
25
+ }
26
+ catch (error) {
27
+ console.error('Studio handler error:', error);
28
+ return new Response(JSON.stringify({ error: 'Internal server error' }), {
29
+ status: 500,
30
+ headers: { 'Content-Type': 'application/json' },
31
+ });
32
+ }
33
+ };
34
+ }
35
+ async function convertAstroToUniversal(ctx, config) {
36
+ const request = ctx.request;
37
+ let body;
38
+ const method = request.method;
39
+ if (method !== 'GET' && method !== 'HEAD') {
40
+ const contentType = request.headers.get('content-type') || '';
41
+ if (contentType.includes('application/json')) {
42
+ try {
43
+ body = await request.json();
44
+ }
45
+ catch { }
46
+ }
47
+ else if (contentType.includes('application/x-www-form-urlencoded') ||
48
+ contentType.includes('multipart/form-data')) {
49
+ try {
50
+ const formData = await request.formData();
51
+ body = Object.fromEntries(formData.entries());
52
+ }
53
+ catch { }
54
+ }
55
+ else {
56
+ try {
57
+ const text = await request.text();
58
+ if (text && text.trim()) {
59
+ try {
60
+ body = JSON.parse(text);
61
+ }
62
+ catch {
63
+ body = text;
64
+ }
65
+ }
66
+ }
67
+ catch { }
68
+ }
69
+ }
70
+ const headers = {};
71
+ request.headers.forEach((value, key) => {
72
+ headers[key] = value;
73
+ });
74
+ const basePath = config.basePath || '/api/studio';
75
+ const normalizedBasePath = basePath.endsWith('/') ? basePath.slice(0, -1) : basePath;
76
+ const url = new URL(request.url);
77
+ let path = url.pathname;
78
+ if (path.startsWith(normalizedBasePath)) {
79
+ path = path.slice(normalizedBasePath.length) || '/';
80
+ }
81
+ const pathWithQuery = path + url.search;
82
+ return {
83
+ url: pathWithQuery,
84
+ method: method,
85
+ headers,
86
+ body,
87
+ };
88
+ }
89
+ function universalToResponse(res) {
90
+ return new Response(res.body, {
91
+ status: res.status,
92
+ headers: res.headers,
93
+ });
94
+ }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C,CAAC,QAAQ,CAAC;IAErF,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACjC,IAAI,IAAI,GAAG,GAAG,CAAC,QAAQ,CAAC;IAExB,IAAI,IAAI,CAAC,UAAU,CAAC,kBAAkB,CAAC,EAAE,CAAC;QACxC,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,kBAAkB,CAAC,MAAM,CAAC,IAAI,GAAG,CAAC;IACtD,CAAC;IAED,MAAM,aAAa,GAAG,IAAI,GAAG,GAAG,CAAC,MAAM,CAAC;IAExC,OAAO;QACL,GAAG,EAAE,aAAa;QAClB,MAAM,EAAE,MAAM;QACd,OAAO;QACP,IAAI;KACL,CAAC;AACJ,CAAC;AAED,SAAS,mBAAmB,CAAC,GAAsB;IACjD,OAAO,IAAI,QAAQ,CAAC,GAAG,CAAC,IAAI,EAAE;QAC5B,MAAM,EAAE,GAAG,CAAC,MAAM;QAClB,OAAO,EAAE,GAAG,CAAC,OAAO;KACrB,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,32 @@
1
+ import type { StudioConfig } from '../types/handler.js';
2
+ type TanStackStartHandlerContext = {
3
+ request: Request;
4
+ };
5
+ /**
6
+ * TanStack Start adapter for Better Auth Studio
7
+ *
8
+ * Usage in a server route:
9
+ * ```ts
10
+ * // src/routes/api/studio/$.ts
11
+ * import { createFileRoute } from '@tanstack/react-router';
12
+ * import { betterAuthStudio } from 'better-auth-studio/tanstack-start';
13
+ * import studioConfig from '../../../../studio.config';
14
+ *
15
+ * const handler = betterAuthStudio(studioConfig);
16
+ *
17
+ * export const Route = createFileRoute('/api/studio/$')({
18
+ * server: {
19
+ * handlers: {
20
+ * GET: handler,
21
+ * POST: handler,
22
+ * PUT: handler,
23
+ * DELETE: handler,
24
+ * PATCH: handler,
25
+ * },
26
+ * },
27
+ * });
28
+ * ```
29
+ */
30
+ export declare function betterAuthStudio(config: StudioConfig): ({ request }: TanStackStartHandlerContext) => Promise<Response>;
31
+ export {};
32
+ //# sourceMappingURL=tanstack-start.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tanstack-start.d.ts","sourceRoot":"","sources":["../../src/adapters/tanstack-start.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAuC,MAAM,qBAAqB,CAAC;AAG7F,KAAK,2BAA2B,GAAG;IACjC,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,YAAY,IACrC,aAAa,2BAA2B,KAAG,OAAO,CAAC,QAAQ,CAAC,CAa3E"}
@@ -0,0 +1,102 @@
1
+ import { handleStudioRequest } from '../core/handler.js';
2
+ /**
3
+ * TanStack Start adapter for Better Auth Studio
4
+ *
5
+ * Usage in a server route:
6
+ * ```ts
7
+ * // src/routes/api/studio/$.ts
8
+ * import { createFileRoute } from '@tanstack/react-router';
9
+ * import { betterAuthStudio } from 'better-auth-studio/tanstack-start';
10
+ * import studioConfig from '../../../../studio.config';
11
+ *
12
+ * const handler = betterAuthStudio(studioConfig);
13
+ *
14
+ * export const Route = createFileRoute('/api/studio/$')({
15
+ * server: {
16
+ * handlers: {
17
+ * GET: handler,
18
+ * POST: handler,
19
+ * PUT: handler,
20
+ * DELETE: handler,
21
+ * PATCH: handler,
22
+ * },
23
+ * },
24
+ * });
25
+ * ```
26
+ */
27
+ export function betterAuthStudio(config) {
28
+ return async ({ request }) => {
29
+ try {
30
+ const universalReq = await convertTanStackStartToUniversal(request, config);
31
+ const universalRes = await handleStudioRequest(universalReq, config);
32
+ return universalToResponse(universalRes);
33
+ }
34
+ catch (error) {
35
+ console.error('Studio handler error:', error);
36
+ return new Response(JSON.stringify({ error: 'Internal server error' }), {
37
+ status: 500,
38
+ headers: { 'Content-Type': 'application/json' },
39
+ });
40
+ }
41
+ };
42
+ }
43
+ async function convertTanStackStartToUniversal(request, config) {
44
+ let body;
45
+ const method = request.method;
46
+ if (method !== 'GET' && method !== 'HEAD') {
47
+ const contentType = request.headers.get('content-type') || '';
48
+ if (contentType.includes('application/json')) {
49
+ try {
50
+ body = await request.json();
51
+ }
52
+ catch { }
53
+ }
54
+ else if (contentType.includes('application/x-www-form-urlencoded') ||
55
+ contentType.includes('multipart/form-data')) {
56
+ try {
57
+ const formData = await request.formData();
58
+ body = Object.fromEntries(formData.entries());
59
+ }
60
+ catch { }
61
+ }
62
+ else {
63
+ try {
64
+ const text = await request.text();
65
+ if (text && text.trim()) {
66
+ try {
67
+ body = JSON.parse(text);
68
+ }
69
+ catch {
70
+ body = text;
71
+ }
72
+ }
73
+ }
74
+ catch { }
75
+ }
76
+ }
77
+ const headers = {};
78
+ request.headers.forEach((value, key) => {
79
+ headers[key] = value;
80
+ });
81
+ const basePath = config.basePath || '/api/studio';
82
+ const normalizedBasePath = basePath.endsWith('/') ? basePath.slice(0, -1) : basePath;
83
+ const url = new URL(request.url);
84
+ let path = url.pathname;
85
+ if (path.startsWith(normalizedBasePath)) {
86
+ path = path.slice(normalizedBasePath.length) || '/';
87
+ }
88
+ const pathWithQuery = path + url.search;
89
+ return {
90
+ url: pathWithQuery,
91
+ method: method,
92
+ headers,
93
+ body,
94
+ };
95
+ }
96
+ function universalToResponse(res) {
97
+ return new Response(res.body, {
98
+ status: res.status,
99
+ headers: res.headers,
100
+ });
101
+ }
102
+ //# sourceMappingURL=tanstack-start.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tanstack-start.js","sourceRoot":"","sources":["../../src/adapters/tanstack-start.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAQzD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,UAAU,gBAAgB,CAAC,MAAoB;IACnD,OAAO,KAAK,EAAE,EAAE,OAAO,EAA+B,EAAqB,EAAE;QAC3E,IAAI,CAAC;YACH,MAAM,YAAY,GAAG,MAAM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ACL,GAAG,EAAE,aAAa;QAClB,MAAM,EAAE,MAAM;QACd,OAAO;QACP,IAAI;KACL,CAAC;AACJ,CAAC;AAED,SAAS,mBAAmB,CAAC,GAAsB;IACjD,OAAO,IAAI,QAAQ,CAAC,GAAG,CAAC,IAAI,EAAE;QAC5B,MAAM,EAAE,GAAG,CAAC,MAAM;QAClB,OAAO,EAAE,GAAG,CAAC,OAAO;KACrB,CAAC,CAAC;AACL,CAAC"}
package/dist/cli.js CHANGED
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "better-auth-studio",
3
- "version": "1.0.79-beta.60",
3
+ "version": "1.0.79-beta.62",
4
4
  "description": "Studio for Better Auth",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
@@ -15,34 +15,10 @@
15
15
  "./elysia": "./dist/adapters/elysia.js",
16
16
  "./svelte-kit": "./dist/adapters/svelte-kit.js",
17
17
  "./solid-start": "./dist/adapters/solid-start.js",
18
+ "./tanstack-start": "./dist/adapters/tanstack-start.js",
19
+ "./astro": "./dist/adapters/astro.js",
18
20
  "./config": "./dist/types/handler.js"
19
21
  },
20
- "scripts": {
21
- "build": "tsc && pnpm run frontend:build && pnpm run copy:public && pnpm run verify:public",
22
- "copy:public": "rm -rf dist/public && cp -r public dist/",
23
- "verify:public": "test -f dist/public/index.html && echo '✓ Public directory copied successfully' || (echo '✗ ERROR: Public directory not copied!' && exit 1)",
24
- "postinstall": "node scripts/postinstall.js",
25
- "dev": "tsx src/cli.ts",
26
- "start": "node dist/cli.js",
27
- "studio": "tsx src/cli.ts",
28
- "clean": "rm -rf dist",
29
- "frontend:dev": "cd frontend && pnpm run dev",
30
- "frontend:build": "cd frontend && pnpm run build",
31
- "frontend:preview": "cd frontend && pnpm run preview",
32
- "lint": "biome check . --max-diagnostics=1000",
33
- "lint:fix": "biome check --write .",
34
- "format": "biome format --write .",
35
- "type-check": "tsc --noEmit",
36
- "test": "vitest",
37
- "test:watch": "vitest --watch",
38
- "test:coverage": "vitest --coverage",
39
- "test:ci": "pnpm test --run",
40
- "release": "pnpm build && bumpp && pnpm publish --access public --no-git-checks",
41
- "release:beta": "pnpm build && bumpp --preid beta && pnpm publish --access public --tag beta --no-git-checks",
42
- "release:no-build": "bumpp && pnpm publish --access public --no-git-checks --tag next",
43
- "release:canary": "pnpm build && bumpp --preid canary --no-commit --no-tag --no-push && pnpm publish --access public --tag canary --no-git-checks",
44
- "bump": "bumpp"
45
- },
46
22
  "keywords": [
47
23
  "better-auth",
48
24
  "studio",
@@ -91,16 +67,37 @@
91
67
  "engines": {
92
68
  "node": ">=18.0.0"
93
69
  },
94
- "pnpm": {
95
- "overrides": {
96
- "qs": ">=6.14.1"
97
- }
98
- },
99
70
  "files": [
100
71
  "dist/",
101
72
  "public/",
102
73
  "data/default-geo.json",
103
74
  "scripts/",
104
75
  "README.md"
105
- ]
76
+ ],
77
+ "scripts": {
78
+ "build": "tsc && pnpm run frontend:build && pnpm run copy:public && pnpm run verify:public",
79
+ "copy:public": "rm -rf dist/public && cp -r public dist/",
80
+ "verify:public": "test -f dist/public/index.html && echo '✓ Public directory copied successfully' || (echo '✗ ERROR: Public directory not copied!' && exit 1)",
81
+ "postinstall": "node scripts/postinstall.js",
82
+ "dev": "tsx src/cli.ts",
83
+ "start": "node dist/cli.js",
84
+ "studio": "tsx src/cli.ts",
85
+ "clean": "rm -rf dist",
86
+ "frontend:dev": "cd frontend && pnpm run dev",
87
+ "frontend:build": "cd frontend && pnpm run build",
88
+ "frontend:preview": "cd frontend && pnpm run preview",
89
+ "lint": "biome check . --max-diagnostics=1000",
90
+ "lint:fix": "biome check --write .",
91
+ "format": "biome format --write .",
92
+ "type-check": "tsc --noEmit",
93
+ "test": "vitest",
94
+ "test:watch": "vitest --watch",
95
+ "test:coverage": "vitest --coverage",
96
+ "test:ci": "pnpm test --run",
97
+ "release": "pnpm build && bumpp && pnpm publish --access public --no-git-checks",
98
+ "release:beta": "pnpm build && bumpp --preid beta && pnpm publish --access public --tag beta --no-git-checks",
99
+ "release:no-build": "bumpp && pnpm publish --access public --no-git-checks --tag next",
100
+ "release:canary": "pnpm build && bumpp --preid canary --no-commit --no-tag --no-push && pnpm publish --access public --tag canary --no-git-checks",
101
+ "bump": "bumpp"
102
+ }
106
103
  }