@vite-hub/auth 0.5.0 → 0.5.1
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/README.md +1 -1
- package/dist/{abilities-9jC7iuN0.d.ts → abilities-3L1Y5Pnw.d.ts} +1 -3
- package/dist/abilities.d.ts +1 -1
- package/dist/abilities.js +1 -2
- package/dist/{ability-error-DmnUGicq.js → ability-error-BHhPkrZd.js} +3 -5
- package/dist/{ability-error-DUWJ6Q1W.d.ts → ability-error-C1c30O6E.d.ts} +0 -4
- package/dist/{access-pages-FNQTyGRD.js → access-pages-BwImVHN_.js} +3 -5
- package/dist/{admin-claim-code-CDipqeAU.js → admin-claim-code-C3X_U43x.js} +1 -2
- package/dist/agent.d.ts +1 -3
- package/dist/agent.js +5 -6
- package/dist/{application-path-DuTpfGFj.js → application-path-zKi7NrvK.js} +1 -2
- package/dist/{auth-instance-zYMjldPG.js → auth-instance-_J7R9Qs1.js} +34 -47
- package/dist/{cli-NCtitmny.d.ts → cli-C5pAfY4x.d.ts} +0 -6
- package/dist/cli.d.ts +2 -4
- package/dist/cli.js +3 -4
- package/dist/{console-runtime-Dqidb3zF.d.ts → console-runtime-BP1ZKJB0.d.ts} +1 -3
- package/dist/{console-runtime-CuXRDhGy.js → console-runtime-vc3JQEuq.js} +7 -9
- package/dist/console-runtime.d.ts +2 -2
- package/dist/console-runtime.js +1 -2
- package/dist/{console-types-CmmnKGMx.js → console-types-51lkf0lk.js} +1 -2
- package/dist/console.d.ts +1 -5
- package/dist/console.js +2 -3
- package/dist/{database-options-CcjUG-us.js → database-options-DQ-8qYMl.js} +2 -3
- package/dist/{database-schema-options-CTKCAfqW.js → database-schema-options-CkSeU9V3.js} +2 -3
- package/dist/database.d.ts +1 -3
- package/dist/database.js +4 -5
- package/dist/{definition-BFT9T6In.js → definition-MDGMNKrK.js} +11 -17
- package/dist/{error-diagnostics-uEbxSY2G.js → error-diagnostics-BssJr_2t.js} +1 -2
- package/dist/{events-DJmO9a9I.js → events-DZqMiae_.js} +4 -6
- package/dist/forward.d.ts +1 -3
- package/dist/forward.js +2 -3
- package/dist/index.d.ts +3 -7
- package/dist/index.js +3 -3
- package/dist/internal/server.d.ts +3 -3
- package/dist/internal/server.js +4 -4
- package/dist/{invariant-DolT9EEx.js → invariant-Dj2R1eMr.js} +1 -2
- package/dist/{mcp-config-DRRlCAWN.js → mcp-config-C7srUMIZ.js} +2 -3
- package/dist/{mcp-token-BhonlK9C.js → mcp-token--KuLYEub.js} +7 -18
- package/dist/mcp.d.ts +0 -4
- package/dist/mcp.js +4 -5
- package/dist/{members-Cl3hFRjk.js → members-D3_Q5XJb.js} +10 -14
- package/dist/{nitro-kit-32CVgbWS.js → nitro-kit-Bg4xUZAI.js} +2 -3
- package/dist/{nuxt-bridge-Cl988STZ.js → nuxt-bridge-pRyfYD5c.js} +1 -2
- package/dist/nuxt.d.ts +1 -7
- package/dist/nuxt.js +6 -9
- package/dist/{object-Da1zyPCR.js → object-CAK6UYR5.js} +1 -2
- package/dist/{own-access-CdgEICjO.d.ts → own-access-C22hSIuF.d.ts} +1 -3
- package/dist/{own-access-C8pwo_Kn.js → own-access-DQgqxTbI.js} +3 -4
- package/dist/{page-tools-shared-l4eyj53D.js → page-tools-shared-CtoKaNQZ.js} +1 -2
- package/dist/{presets-CHndEv5i.d.ts → presets-C6AtiRdI.d.ts} +0 -2
- package/dist/presets.d.ts +1 -1
- package/dist/presets.js +2 -3
- package/dist/{request-z6DHHmrb.js → request-Dpq7GO8B.js} +2 -4
- package/dist/runtime/console.d.ts +1 -1
- package/dist/runtime/console.js +2 -2
- package/dist/runtime/empty-abilities.d.ts +1 -3
- package/dist/runtime/empty-abilities.js +1 -2
- package/dist/runtime/empty-client.d.ts +0 -2
- package/dist/runtime/empty-client.js +1 -2
- package/dist/runtime/empty-definition.d.ts +1 -3
- package/dist/runtime/empty-definition.js +1 -2
- package/dist/runtime/nuxt.d.ts +1 -3
- package/dist/runtime/nuxt.js +1 -2
- package/dist/runtime/server.d.ts +2 -2
- package/dist/runtime/server.js +6 -7
- package/dist/runtime/vue-nuxt.d.ts +0 -2
- package/dist/runtime/vue-nuxt.js +5 -6
- package/dist/{runtime-state-ojQCzKOc.js → runtime-state-DtKUfxKq.js} +1 -2
- package/dist/schema.d.ts +1 -5
- package/dist/schema.js +2 -3
- package/dist/{server-Ci2i6p1S.d.ts → server-CFWlYQJb.d.ts} +5 -13
- package/dist/{server-CyqLFm3L.js → server-D4Hi4TBI.js} +16 -18
- package/dist/{server-B-zNtSvm.d.ts → server-DCsgxFPP.d.ts} +2 -6
- package/dist/server.d.ts +2 -2
- package/dist/server.js +2 -2
- package/dist/{session-cookies-CZmZS5QF.js → session-cookies-1FMcMnRh.js} +6 -8
- package/dist/{set-cookie-DWIyCCJO.js → set-cookie-DkqM1kvj.js} +3 -5
- package/dist/{table-specs-BhWz_U0M.d.ts → table-specs-BLm_Zlss.d.ts} +0 -2
- package/dist/{table-specs-D0VLp1U4.js → table-specs-jw0jjU6l.js} +1 -2
- package/dist/test.d.ts +2 -4
- package/dist/test.js +3 -4
- package/dist/{types-gl-myjZc.d.ts → types-BHSgxyvV.d.ts} +2 -10
- package/dist/{vite-QKjsPLwP.js → vite-D1xC9n1O.js} +25 -41
- package/dist/vite.d.ts +3 -14
- package/dist/vite.js +1 -2
- package/dist/vue.d.ts +3 -7
- package/dist/vue.js +4 -5
- package/package.json +32 -31
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { t as
|
|
2
|
-
import { t as
|
|
3
|
-
import {
|
|
4
|
-
import { t as
|
|
5
|
-
import {
|
|
6
|
-
import { a as normalizeAuthBasePath, n as assertAuthPages } from "./access-pages-
|
|
7
|
-
import { a as authDatabaseSchemaError, i as authDatabasePlacementError, n as authDatabaseAdditionalFieldsError, o as authMemoryDatabaseError, t as assertAuthDatabaseIdStrategy } from "./database-options-
|
|
8
|
-
import {
|
|
9
|
-
import { i as
|
|
1
|
+
import { t as invariant } from "./invariant-Dj2R1eMr.js";
|
|
2
|
+
import { t as createNitroServerKit } from "./nitro-kit-Bg4xUZAI.js";
|
|
3
|
+
import { t as isRecord$1 } from "./object-CAK6UYR5.js";
|
|
4
|
+
import { r as resolveAccessRoutePath, t as accessRouteSyntaxError } from "./application-path-zKi7NrvK.js";
|
|
5
|
+
import { t as authErrorDiagnostics } from "./error-diagnostics-BssJr_2t.js";
|
|
6
|
+
import { a as normalizeAuthBasePath, n as assertAuthPages } from "./access-pages-BwImVHN_.js";
|
|
7
|
+
import { a as authDatabaseSchemaError, i as authDatabasePlacementError, n as authDatabaseAdditionalFieldsError, o as authMemoryDatabaseError, t as assertAuthDatabaseIdStrategy } from "./database-options-DQ-8qYMl.js";
|
|
8
|
+
import { i as resolveAuthTableSpecs, n as authSqlName } from "./table-specs-jw0jjU6l.js";
|
|
9
|
+
import { i as resetAuth } from "./runtime-state-DtKUfxKq.js";
|
|
10
10
|
import { existsSync, readFileSync, readdirSync, statSync } from "node:fs";
|
|
11
11
|
import { basename, dirname, join, parse, relative, resolve } from "node:path";
|
|
12
12
|
import { fileURLToPath } from "node:url";
|
|
13
13
|
import { tmpdir } from "node:os";
|
|
14
14
|
import { mkdir, readFile, rm, writeFile } from "node:fs/promises";
|
|
15
15
|
import { parseSync } from "vite";
|
|
16
|
-
|
|
16
|
+
// ../../node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.mjs
|
|
17
17
|
const _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
|
|
18
18
|
function normalizeWindowsPath(input = "") {
|
|
19
19
|
if (!input) return input;
|
|
@@ -110,8 +110,7 @@ const dirname$1 = function(p) {
|
|
|
110
110
|
if (segments.length === 1 && _DRIVE_LETTER_RE.test(segments[0])) segments[0] += "/";
|
|
111
111
|
return segments.join("/") || (isAbsolute$1(p) ? "/" : ".");
|
|
112
112
|
};
|
|
113
|
-
|
|
114
|
-
//#region ../internal/src/inspect.ts
|
|
113
|
+
// ../internal/src/inspect.ts
|
|
115
114
|
function relativeDefinitionFile(projectRoot, file) {
|
|
116
115
|
return relative$1(projectRoot, file).replaceAll("\\", "/");
|
|
117
116
|
}
|
|
@@ -127,8 +126,7 @@ function summarizeDefinitions(projectRoot, definitions, fallbackSource) {
|
|
|
127
126
|
const secretKeyPattern = /secret|token|passw(?:or)?d|credential|api[-_\s]?key|private[-_\s]?key|authorization|cookie|signature|dsn|connection[-_\s]?string/i;
|
|
128
127
|
new RegExp(String.raw`\b([\w-]*authorization[\w-]*["']?\s*[:=]\s*)(?!\[redacted\](?=$|[\s,;}&]))(?:"(?:\\[^\r\n]|[^"\\\r\n])*"|'(?:\\[^\r\n]|[^'\\\r\n])*'|[^\r\n]+?(?=\s*(?:[,;])?\s*(?:${secretKeyPattern.source})[\w-]*\s*[:=]|\s+rejected\b|$))`, "gi");
|
|
129
128
|
new RegExp(String.raw`\b([\w-]*(?:${secretKeyPattern.source})[\w-]*["']?\s*[:=]\s*)(?!\[redacted\](?=$|[\s,;}&]))(?:"(?:\\[^\r\n]|[^"\\\r\n])*"|'(?:\\[^\r\n]|[^'\\\r\n])*'|[^\s,;&#&]+)`, "gi");
|
|
130
|
-
|
|
131
|
-
//#region ../internal/src/build/vite.ts
|
|
129
|
+
// ../internal/src/build/vite.ts
|
|
132
130
|
const generatedViteHubFilesPattern = "**/.vitehub/**";
|
|
133
131
|
const projectRootDirectoryMarkers = [
|
|
134
132
|
["server", "agents"],
|
|
@@ -238,8 +236,7 @@ function isMissingProjectMarker(error) {
|
|
|
238
236
|
const code = error.code;
|
|
239
237
|
return code === "ENOENT" || code === "ENOTDIR";
|
|
240
238
|
}
|
|
241
|
-
|
|
242
|
-
//#region src/route-rule-cache.ts
|
|
239
|
+
// src/route-rule-cache.ts
|
|
243
240
|
/** Route rules that keep one response and serve it to many visitors. */
|
|
244
241
|
const cachingRuleNames = [
|
|
245
242
|
"cache",
|
|
@@ -305,8 +302,7 @@ async function createCachingRouteRuleFinder(routeRules, toPattern = (path) => pa
|
|
|
305
302
|
}
|
|
306
303
|
};
|
|
307
304
|
}
|
|
308
|
-
|
|
309
|
-
//#region ../internal/src/build/paths.ts
|
|
305
|
+
// ../internal/src/build/paths.ts
|
|
310
306
|
function resolveRuntimeModule(packageDir, modulePath) {
|
|
311
307
|
const distFile = resolve$1(packageDir, "dist", `${modulePath}.js`);
|
|
312
308
|
return existsSync(distFile) ? distFile : resolve$1(packageDir, "src", `${modulePath}.ts`);
|
|
@@ -333,16 +329,14 @@ function findPackageDir(file) {
|
|
|
333
329
|
function ownModule(importMetaUrl, modulePath) {
|
|
334
330
|
return resolveRuntimeModule(findPackageDir(fileURLToPath(importMetaUrl)), modulePath);
|
|
335
331
|
}
|
|
336
|
-
|
|
337
|
-
//#region ../internal/src/definition-catalog.ts
|
|
332
|
+
// ../internal/src/definition-catalog.ts
|
|
338
333
|
/** `writeFileIfChangedSync` for async callers. */
|
|
339
334
|
async function writeFileIfChanged(file, contents) {
|
|
340
335
|
if (await readFile(file, "utf8").catch(() => void 0) === contents) return;
|
|
341
336
|
await mkdir(resolve$1(file, ".."), { recursive: true });
|
|
342
337
|
await writeFile(file, contents, "utf8");
|
|
343
338
|
}
|
|
344
|
-
|
|
345
|
-
//#region ../internal/src/contributions.ts
|
|
339
|
+
// ../internal/src/contributions.ts
|
|
346
340
|
function isThenable(value) {
|
|
347
341
|
return typeof value.then === "function";
|
|
348
342
|
}
|
|
@@ -369,8 +363,7 @@ async function flattenPluginOptions(plugins) {
|
|
|
369
363
|
await flattenPlugins(plugins ?? [], flattened, /* @__PURE__ */ new Set());
|
|
370
364
|
return flattened;
|
|
371
365
|
}
|
|
372
|
-
|
|
373
|
-
//#region src/access-route-cache.ts
|
|
366
|
+
// src/access-route-cache.ts
|
|
374
367
|
/**
|
|
375
368
|
* The rou3 pattern of the paths that the access middleware guards for a route. The middleware matches the path
|
|
376
369
|
* literally, so the pattern escapes every character that rou3 reads as syntax. In rou3, `/**` also matches the path
|
|
@@ -403,8 +396,7 @@ async function assertNoCachedAccessRoutes(routes, routeRules, baseURL = "/", pub
|
|
|
403
396
|
throw authErrorDiagnostics.AUTH_B0002({ message: `[vitehub] Route rule ${JSON.stringify(cached.key)} sets \`${cached.name}\` on ${cached.method} requests to paths that the \`access.routes\` entry ${JSON.stringify(guard.route)} guards. A cached or prerendered response is made for one visitor and served to others.` });
|
|
404
397
|
}
|
|
405
398
|
}
|
|
406
|
-
|
|
407
|
-
//#region ../internal/src/build/ast-walk.ts
|
|
399
|
+
// ../internal/src/build/ast-walk.ts
|
|
408
400
|
/** The oxc parser grammar for a file, from its extension. Defaults to TypeScript. */
|
|
409
401
|
function moduleLanguage(file) {
|
|
410
402
|
if (/\.(?:c|m)?tsx$/i.test(file)) return "tsx";
|
|
@@ -427,8 +419,7 @@ function walk(node, visit, parent) {
|
|
|
427
419
|
} else if (isNode(child)) walk(child, visit, node);
|
|
428
420
|
}
|
|
429
421
|
}
|
|
430
|
-
|
|
431
|
-
//#region ../internal/src/build/scan-module.ts
|
|
422
|
+
// ../internal/src/build/scan-module.ts
|
|
432
423
|
/**
|
|
433
424
|
* Reads facts from JavaScript and TypeScript modules at build and dev time. The scanner parses each module once with
|
|
434
425
|
* the oxc parser that Vite ships through Rolldown, and never runs it. Values that are not static literals read as
|
|
@@ -559,8 +550,7 @@ function staticString(node) {
|
|
|
559
550
|
const value = staticValue(node);
|
|
560
551
|
return typeof value === "string" ? value : void 0;
|
|
561
552
|
}
|
|
562
|
-
|
|
563
|
-
//#region src/discovery.ts
|
|
553
|
+
// src/discovery.ts
|
|
564
554
|
const authDefinitionExtensions = [
|
|
565
555
|
".ts",
|
|
566
556
|
".mts",
|
|
@@ -633,8 +623,7 @@ function discoverAuthAbilities(rootDir, options = {}) {
|
|
|
633
623
|
if (found.length > 1) throw authErrorDiagnostics.AUTH_C0060({ message: ["[vitehub] Only one abilities file is allowed. Found:", ...found.map((file) => ` - ${file}`)].join("\n") });
|
|
634
624
|
return found[0];
|
|
635
625
|
}
|
|
636
|
-
|
|
637
|
-
//#region src/config.ts
|
|
626
|
+
// src/config.ts
|
|
638
627
|
const authDatabaseModules = /* @__PURE__ */ new Set(["@vite-hub/auth/database", "vite-hub/auth/database"]);
|
|
639
628
|
function readAuthDatabaseImports(module) {
|
|
640
629
|
const names = /* @__PURE__ */ new Set();
|
|
@@ -1227,8 +1216,7 @@ function resolveAuthViteConfig(options, rootDir = process.cwd(), discovery = {})
|
|
|
1227
1216
|
...!definitionObject.callback && !["database", "preset"].some((key) => hasObjectProperty(body, key)) ? { implicitMemory: true } : {}
|
|
1228
1217
|
};
|
|
1229
1218
|
}
|
|
1230
|
-
|
|
1231
|
-
//#region src/deployment-env.ts
|
|
1219
|
+
// src/deployment-env.ts
|
|
1232
1220
|
const owners = ["auth"];
|
|
1233
1221
|
/**
|
|
1234
1222
|
* The variables that Auth reads on the deployed host. Better Auth signs with the first Better Auth secret that is
|
|
@@ -1272,8 +1260,7 @@ function authDeploymentEnv(config) {
|
|
|
1272
1260
|
}
|
|
1273
1261
|
];
|
|
1274
1262
|
}
|
|
1275
|
-
|
|
1276
|
-
//#region src/table-names.ts
|
|
1263
|
+
// src/table-names.ts
|
|
1277
1264
|
/**
|
|
1278
1265
|
* The schema keys of the Auth schemas and their SQL names. Its own module, so the Vite plugin lists the tables without
|
|
1279
1266
|
* loading Drizzle or the schema module.
|
|
@@ -1297,8 +1284,7 @@ const authTableNames = {
|
|
|
1297
1284
|
invitation: "invitation",
|
|
1298
1285
|
passkey: "passkey"
|
|
1299
1286
|
};
|
|
1300
|
-
|
|
1301
|
-
//#region src/existing-tables.ts
|
|
1287
|
+
// src/existing-tables.ts
|
|
1302
1288
|
function isRecord(value) {
|
|
1303
1289
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
1304
1290
|
}
|
|
@@ -1360,8 +1346,7 @@ function readAuthExistingTables(migrationsDir, tableNames) {
|
|
|
1360
1346
|
}
|
|
1361
1347
|
return tables;
|
|
1362
1348
|
}
|
|
1363
|
-
|
|
1364
|
-
//#region src/vite.ts
|
|
1349
|
+
// src/vite.ts
|
|
1365
1350
|
const AUTH_ABILITIES_ID = "#vitehub/auth/abilities";
|
|
1366
1351
|
const AUTH_CLIENT_ID = "#vitehub/auth/client";
|
|
1367
1352
|
const AUTH_DEFINITION_ID = "#vitehub/auth/definition";
|
|
@@ -1827,5 +1812,4 @@ function hubAuth(options, internalOptions = {}) {
|
|
|
1827
1812
|
}
|
|
1828
1813
|
};
|
|
1829
1814
|
}
|
|
1830
|
-
//#endregion
|
|
1831
1815
|
export { AUTH_VITE_PLUGIN_NAME as a, writeNuxtAuthDefinition as c, cachingRuleNames as d, createCachingRouteRuleFinder as f, resolveViteHubProjectRoot as h, AUTH_SERVER_ID as i, resolveAuthViteConfig as l, resolveNuxtServerDirs as m, AUTH_CLIENT_ID as n, createAuthNitroConfig as o, methodOrder as p, AUTH_DEFINITION_ID as r, hubAuth as s, AUTH_ABILITIES_ID as t, authAbilitiesCandidates as u };
|
package/dist/vite.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
/// <reference path="./host-declarations.d.ts" />
|
|
2
|
-
import { U as ResolvedAuthViteConfig, w as AuthOptions } from "./types-
|
|
3
|
-
import { n as ViteHubCliPluginMetadata } from "./cli-
|
|
2
|
+
import { U as ResolvedAuthViteConfig, w as AuthOptions } from "./types-BHSgxyvV.js";
|
|
3
|
+
import { n as ViteHubCliPluginMetadata } from "./cli-C5pAfY4x.js";
|
|
4
4
|
import { Plugin } from "vite";
|
|
5
|
-
//#region ../internal/src/inspect.d.ts
|
|
6
5
|
interface ViteHubDefinitionField {
|
|
7
6
|
label: string;
|
|
8
7
|
value: string;
|
|
@@ -64,17 +63,11 @@ type ViteHubInspectionContributorFactory = () => ViteHubInspectionContributor |
|
|
|
64
63
|
interface ViteHubInspectionPluginMetadata {
|
|
65
64
|
inspect?: ViteHubInspectionContributor | ViteHubInspectionContributorFactory;
|
|
66
65
|
}
|
|
67
|
-
//#endregion
|
|
68
|
-
//#region src/config.d.ts
|
|
69
66
|
export declare function resolveAuthViteConfig(options?: AuthOptions, rootDir?: string, discovery?: {
|
|
70
67
|
serverDirs?: string[];
|
|
71
68
|
}): ResolvedAuthViteConfig | undefined;
|
|
72
|
-
//#endregion
|
|
73
|
-
//#region ../internal/src/deployment.d.ts
|
|
74
69
|
/** The host that ViteHub builds for: the `host` option of `vitehub()` and the value of `VITEHUB_HOST`. */
|
|
75
70
|
type ViteHubHost = "cloudflare" | "deno" | "netlify" | "node" | "vercel";
|
|
76
|
-
//#endregion
|
|
77
|
-
//#region ../internal/src/build/deployment-plan-output.d.ts
|
|
78
71
|
/**
|
|
79
72
|
* One set of host variables that the deployed app reads, as `deployment.json` lists it: a Server Env declaration, or
|
|
80
73
|
* a variable that a primitive reads itself, such as `VITEHUB_SECRET` or `BLOB_READ_WRITE_TOKEN`.
|
|
@@ -104,8 +97,6 @@ interface DeploymentEnvContext {
|
|
|
104
97
|
* Return names only, never values.
|
|
105
98
|
*/
|
|
106
99
|
type DeploymentEnvContribution = (context: DeploymentEnvContext) => readonly DeploymentEnvEntry[];
|
|
107
|
-
//#endregion
|
|
108
|
-
//#region ../internal/src/contributions.d.ts
|
|
109
100
|
/** Roots that ViteHub passes to every contribution factory. */
|
|
110
101
|
interface ContributionContext {
|
|
111
102
|
/** Vite root. */
|
|
@@ -117,8 +108,6 @@ interface ContributionContext {
|
|
|
117
108
|
/** The flat list of Vite plugins, so a factory can read what sibling plugins declare. */
|
|
118
109
|
plugins?: readonly unknown[];
|
|
119
110
|
}
|
|
120
|
-
//#endregion
|
|
121
|
-
//#region src/vite.d.ts
|
|
122
111
|
export declare const AUTH_ABILITIES_ID = "#vitehub/auth/abilities";
|
|
123
112
|
export declare const AUTH_CLIENT_ID = "#vitehub/auth/client";
|
|
124
113
|
export declare const AUTH_DEFINITION_ID = "#vitehub/auth/definition";
|
|
@@ -166,4 +155,4 @@ interface InternalAuthModuleOptions {
|
|
|
166
155
|
}
|
|
167
156
|
export declare function writeNuxtAuthDefinition(root: string, config: ResolvedAuthViteConfig): Promise<string>;
|
|
168
157
|
export declare function hubAuth(options?: AuthOptions, internalOptions?: InternalAuthModuleOptions): AuthVitePlugin;
|
|
169
|
-
|
|
158
|
+
export {};
|
package/dist/vite.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { AUTH_ABILITIES_ID, AUTH_CLIENT_ID, AUTH_DEFINITION_ID, AUTH_SERVER_ID, AUTH_VITE_PLUGIN_NAME, createAuthNitroConfig, hubAuth, resolveAuthViteConfig, writeNuxtAuthDefinition };
|
|
1
|
+
export { t as AUTH_ABILITIES_ID, n as AUTH_CLIENT_ID, r as AUTH_DEFINITION_ID, i as AUTH_SERVER_ID, a as AUTH_VITE_PLUGIN_NAME, o as createAuthNitroConfig, s as hubAuth, l as resolveAuthViteConfig, c as writeNuxtAuthDefinition } from "./vite-D1xC9n1O.js";
|
package/dist/vue.d.ts
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
/// <reference path="./host-declarations.d.ts" />
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { n as AbilityErrorData } from "./ability-error-
|
|
2
|
+
import { a as AbilityRefusal, i as AbilityName, t as AbilityArgs } from "./abilities-3L1Y5Pnw.js";
|
|
3
|
+
import { S as AuthFor, _ as AuthDefinition } from "./types-BHSgxyvV.js";
|
|
4
|
+
import { n as AbilityErrorData } from "./ability-error-C1c30O6E.js";
|
|
5
5
|
import { BetterAuthClientOptions } from "better-auth";
|
|
6
6
|
import { ComputedRef, VNode } from "vue";
|
|
7
7
|
import { inferAdditionalFields } from "better-auth/client/plugins";
|
|
8
8
|
import { BetterFetchError, VueAuthClient, VueAuthClient as VueAuthClient$1, createAuthClient as createAuthClient$1 } from "better-auth/vue";
|
|
9
|
-
//#region src/nuxt-bridge.d.ts
|
|
10
9
|
/** The members of the Nuxt app that the composables read. */
|
|
11
10
|
type AuthNuxtApp = {
|
|
12
11
|
runWithContext<T>(run: () => T): T;
|
|
@@ -57,8 +56,6 @@ export declare function setSessionSeedResolver(resolver: ((read: boolean) => unk
|
|
|
57
56
|
* `undefined` outside a request.
|
|
58
57
|
*/
|
|
59
58
|
export declare function setRequestFetchResolver(resolver: (() => RequestFetch | undefined) | undefined): void;
|
|
60
|
-
//#endregion
|
|
61
|
-
//#region src/vue.d.ts
|
|
62
59
|
/**
|
|
63
60
|
* The members of a client that the composables read. Every Better Auth Vue client has them. `VueAuthClient<any>`
|
|
64
61
|
* rejects a client with a required additional field, because its `signUp.email()` needs that field.
|
|
@@ -294,5 +291,4 @@ export type AuthPermissionComponent = <const Name extends AbilityName>(props: Au
|
|
|
294
291
|
};
|
|
295
292
|
/** Render the allowed or denied slot. The default slot is shorthand for allowed. */
|
|
296
293
|
export declare const AuthPermission: AuthPermissionComponent;
|
|
297
|
-
//#endregion
|
|
298
294
|
export type { RequestFetch, VueAuthClient };
|
package/dist/vue.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { a as setRequestFetchResolver, i as setNuxtErrorFactory, n as setDefaultAuthBasePath, o as setSessionSeedResolver, r as setNuxtAppResolver, s as setSignOutHandler, t as authNuxtBridge } from "./nuxt-bridge-
|
|
1
|
+
import { n as checkAbility, t as AbilityError } from "./ability-error-BHhPkrZd.js";
|
|
2
|
+
import { i as resolveAuthMountPath } from "./application-path-zKi7NrvK.js";
|
|
3
|
+
import { a as setRequestFetchResolver, i as setNuxtErrorFactory, n as setDefaultAuthBasePath, o as setSessionSeedResolver, r as setNuxtAppResolver, s as setSignOutHandler, t as authNuxtBridge } from "./nuxt-bridge-pRyfYD5c.js";
|
|
4
4
|
import abilities from "#vitehub/auth/abilities";
|
|
5
5
|
import { computed, defineComponent, effectScope, getCurrentInstance, getCurrentScope, inject, onScopeDispose, onServerPrefetch, provide, shallowRef, watch } from "vue";
|
|
6
|
-
|
|
6
|
+
// src/vue.ts
|
|
7
7
|
const LOAD = Symbol.for("vitehub.auth.client.load");
|
|
8
8
|
const ON_LOAD = Symbol.for("vitehub.auth.client.on-load");
|
|
9
9
|
const OPTIONS = Symbol.for("vitehub.auth.client.options");
|
|
@@ -605,5 +605,4 @@ const AuthPermission = defineComponent({
|
|
|
605
605
|
};
|
|
606
606
|
}
|
|
607
607
|
});
|
|
608
|
-
//#endregion
|
|
609
608
|
export { AuthPermission, authClient, createAuthClient, defineAuthClient, loadAuthClient, onSignOut, provideAuthClient, setDefaultAuthBasePath, setNuxtAppResolver, setNuxtErrorFactory, setRequestFetchResolver, setSessionSeedResolver, setSignOutHandler, useAbility, useAuthClient, useUserSession };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vite-hub/auth",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.1",
|
|
4
4
|
"description": "Better Auth-powered authentication primitives and Vite integration for ViteHub.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"auth",
|
|
@@ -142,58 +142,59 @@
|
|
|
142
142
|
"./package.json": "./package.json"
|
|
143
143
|
},
|
|
144
144
|
"dependencies": {
|
|
145
|
-
"@noble/hashes": "^2.
|
|
146
|
-
"@types/node": "^24.19.
|
|
147
|
-
"@vite-hub/env": "0.5.
|
|
148
|
-
"@vite-hub/runtime": "0.5.
|
|
149
|
-
"@vite-hub/web-container": "0.5.
|
|
150
|
-
"better-auth": "^1.7.
|
|
145
|
+
"@noble/hashes": "^2.4.0",
|
|
146
|
+
"@types/node": "^24.19.2",
|
|
147
|
+
"@vite-hub/env": "0.5.1",
|
|
148
|
+
"@vite-hub/runtime": "0.5.1",
|
|
149
|
+
"@vite-hub/web-container": "0.5.1",
|
|
150
|
+
"better-auth": "^1.7.27",
|
|
151
151
|
"h3": "^2.0.8",
|
|
152
152
|
"nostics": "1.4.0",
|
|
153
153
|
"rou3": "^1.0.0",
|
|
154
154
|
"scule": "^1.3.0",
|
|
155
155
|
"unrouting": "^0.3.2",
|
|
156
156
|
"valibot": "^1.5.0",
|
|
157
|
-
"vue-router": "^5.
|
|
157
|
+
"vue-router": "^5.5.1"
|
|
158
158
|
},
|
|
159
159
|
"devDependencies": {
|
|
160
|
-
"@better-auth/api-key": "1.7.
|
|
161
|
-
"@better-auth/oauth-provider": "^1.7.
|
|
162
|
-
"@better-auth/passkey": "1.7.
|
|
163
|
-
"@better-auth/stripe": "1.7.
|
|
164
|
-
"@cloudflare/workers-types": "^5.
|
|
160
|
+
"@better-auth/api-key": "1.7.27",
|
|
161
|
+
"@better-auth/oauth-provider": "^1.7.27",
|
|
162
|
+
"@better-auth/passkey": "1.7.27",
|
|
163
|
+
"@better-auth/stripe": "1.7.27",
|
|
164
|
+
"@cloudflare/workers-types": "^5.20261123.1",
|
|
165
165
|
"@types/json-schema": "^7.0.15",
|
|
166
166
|
"@types/mdast": "^4.0.4",
|
|
167
|
-
"@types/node": "^24.19.
|
|
168
|
-
"@vite-hub/agent": "0.5.
|
|
169
|
-
"@vite-hub/database": "0.5.
|
|
167
|
+
"@types/node": "^24.19.2",
|
|
168
|
+
"@vite-hub/agent": "0.5.1",
|
|
169
|
+
"@vite-hub/database": "0.5.1",
|
|
170
170
|
"@vite-hub/internal": "0.0.1",
|
|
171
|
-
"bun-types": "^1.4.
|
|
172
|
-
"evlog": "2.
|
|
173
|
-
"happy-dom": "
|
|
171
|
+
"bun-types": "^1.4.5",
|
|
172
|
+
"evlog": "2.37.1",
|
|
173
|
+
"happy-dom": "21.0.4",
|
|
174
174
|
"miniflare": "4.20260730.0",
|
|
175
175
|
"nitro": "^3.0.261103-rc",
|
|
176
176
|
"publint": "^0.3.25",
|
|
177
|
-
"stripe": "23.
|
|
177
|
+
"stripe": "23.2.0",
|
|
178
178
|
"typescript": "^6.0.3",
|
|
179
|
-
"undici": "8.
|
|
180
|
-
"vite": "^8.
|
|
181
|
-
"vite-plus": "^
|
|
182
|
-
"vitest": "
|
|
183
|
-
"vue": "3.5.
|
|
184
|
-
"drizzle-kit": "1.0.0-rc.
|
|
185
|
-
"drizzle-orm": "1.0.0-rc.
|
|
179
|
+
"undici": "8.13.1",
|
|
180
|
+
"vite": "^8.3.8",
|
|
181
|
+
"vite-plus": "^1.7.0",
|
|
182
|
+
"vitest": "5.1.0",
|
|
183
|
+
"vue": "3.5.46",
|
|
184
|
+
"drizzle-kit": "1.0.0-rc.6",
|
|
185
|
+
"drizzle-orm": "1.0.0-rc.6",
|
|
186
|
+
"postgres": "^3.4.9"
|
|
186
187
|
},
|
|
187
188
|
"peerDependencies": {
|
|
188
|
-
"@better-auth/oauth-provider": "^1.7.
|
|
189
|
+
"@better-auth/oauth-provider": "^1.7.27",
|
|
189
190
|
"@types/json-schema": "^7.0.15",
|
|
190
191
|
"@types/mdast": "^4.0.4",
|
|
191
|
-
"@vite-hub/agent": "0.5.
|
|
192
|
-
"@vite-hub/database": "0.5.
|
|
192
|
+
"@vite-hub/agent": "0.5.1",
|
|
193
|
+
"@vite-hub/database": "0.5.1",
|
|
193
194
|
"nitro": "3.0.261102-rc || ^3.0.261103-rc",
|
|
194
195
|
"vite": ">=8.0.0",
|
|
195
196
|
"vue": "^3.5.0",
|
|
196
|
-
"drizzle-orm": "1.0.0-rc.5 || ^1.0.0"
|
|
197
|
+
"drizzle-orm": "1.0.0-rc.5 || 1.0.0-rc.6 || ^1.0.0"
|
|
197
198
|
},
|
|
198
199
|
"peerDependenciesMeta": {
|
|
199
200
|
"@better-auth/oauth-provider": {
|