@dunx/auth 0.2.6 → 0.2.8

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,76 @@
1
+ // @bun
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __name = (target, name) => {
6
+ Object.defineProperty(target, "name", {
7
+ value: name,
8
+ enumerable: false,
9
+ configurable: true
10
+ });
11
+ return target;
12
+ };
13
+ var __knownSymbol = (name, symbol) => (symbol = Symbol[name]) ? symbol : Symbol.for("Symbol." + name);
14
+ var __typeError = (msg) => {
15
+ throw TypeError(msg);
16
+ };
17
+ var __defNormalProp = (obj, key, value) => (key in obj) ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
18
+ var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
19
+ var __privateIn = (member, obj) => Object(obj) !== obj ? __typeError('Cannot use the "in" operator on this value') : member.has(obj);
20
+ var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
21
+ var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
22
+ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
23
+ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
24
+ var __decoratorStart = (base) => [, , , __create(base?.[__knownSymbol("metadata")] ?? null)];
25
+ var __decoratorStrings = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"];
26
+ var __expectFn = (fn) => fn !== undefined && typeof fn !== "function" ? __typeError("Function expected") : fn;
27
+ var __decoratorContext = (kind, name, done, metadata, fns) => ({
28
+ kind: __decoratorStrings[kind],
29
+ name,
30
+ metadata,
31
+ addInitializer: (fn) => done._ ? __typeError("Already initialized") : fns.push(__expectFn(fn || null))
32
+ });
33
+ var __decoratorMetadata = (array, target) => __defNormalProp(target, __knownSymbol("metadata"), array[3]);
34
+ var __runInitializers = (array, flags, self, value) => {
35
+ for (var i = 0, fns = array[flags >> 1], n = fns && fns.length;i < n; i++)
36
+ flags & 1 ? fns[i].call(self) : value = fns[i].call(self, value);
37
+ return value;
38
+ };
39
+ var __decorateElement = (array, flags, name, decorators, target, extra) => {
40
+ var fn, it, done, ctx, access, k = flags & 7, s = !!(flags & 8), p = !!(flags & 16);
41
+ var j = k > 3 ? array.length + 1 : k ? s ? 1 : 2 : 0, key = __decoratorStrings[k + 5];
42
+ var initializers = k > 3 && (array[j - 1] = []), extraInitializers = array[j] || (array[j] = []);
43
+ var desc = k && (!p && !s && (target = target.prototype), k < 5 && (k > 3 || !p) && __getOwnPropDesc(k < 4 ? target : {
44
+ get [name]() {
45
+ return __privateGet(this, extra);
46
+ },
47
+ set [name](x) {
48
+ __privateSet(this, extra, x);
49
+ }
50
+ }, name));
51
+ k ? p && k < 4 && __name(extra, (k > 2 ? "set " : k > 1 ? "get " : "") + name) : __name(target, name);
52
+ for (var i = decorators.length - 1;i >= 0; i--) {
53
+ ctx = __decoratorContext(k, name, done = {}, array[3], extraInitializers);
54
+ if (k) {
55
+ ctx.static = s, ctx.private = p, access = ctx.access = { has: p ? (x) => __privateIn(target, x) : (x) => (name in x) };
56
+ if (k ^ 3)
57
+ access.get = p ? (x) => (k ^ 1 ? __privateGet : __privateMethod)(x, target, k ^ 4 ? extra : desc.get) : (x) => x[name];
58
+ if (k > 2)
59
+ access.set = p ? (x, y) => __privateSet(x, target, y, k ^ 4 ? extra : desc.set) : (x, y) => x[name] = y;
60
+ }
61
+ it = (0, decorators[i])(k ? k < 4 ? p ? extra : desc[key] : k > 4 ? undefined : { get: desc.get, set: desc.set } : target, ctx);
62
+ done._ = 1;
63
+ if (k ^ 4 || it === undefined)
64
+ __expectFn(it) && (k > 4 ? initializers.unshift(it) : k ? p ? extra = it : desc[key] = it : target = it);
65
+ else if (typeof it !== "object" || it === null)
66
+ __typeError("Object expected");
67
+ else
68
+ __expectFn(fn = it.get) && (desc.get = fn), __expectFn(fn = it.set) && (desc.set = fn), __expectFn(fn = it.init) && initializers.unshift(fn);
69
+ }
70
+ return k || __decoratorMetadata(array, target), desc && __defProp(target, name, desc), p ? k ^ 4 ? extra : desc : target;
71
+ };
72
+
73
+ export { __privateGet, __privateAdd, __privateSet, __privateMethod, __decoratorStart, __decoratorMetadata, __runInitializers, __decorateElement };
74
+
75
+ //# debugId=B8D015D42BC8A4C864756E2164756E21
76
+ //# sourceMappingURL=chunk-dtq1p1zv.js.map
@@ -0,0 +1,9 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [
5
+ ],
6
+ "mappings": "",
7
+ "debugId": "B8D015D42BC8A4C864756E2164756E21",
8
+ "names": []
9
+ }
package/dist/drizzle.d.ts CHANGED
@@ -30,8 +30,22 @@ export interface DrizzleSource {
30
30
  * The `provider` comes from the connection's own dialect, so swapping `bun:sqlite`
31
31
  * for `Bun.SQL` needs no edit at the call site. The schema does not have to be passed
32
32
  * either - `@dunx/infra/db` builds its handle with `drizzle({ client, schema })` and
33
- * the adapter reads `db._.fullSchema`, so the better-auth tables being in the app's
34
- * schema object is the whole requirement.
33
+ * the adapter reads `db._.fullSchema`.
34
+ *
35
+ * **The tables have to be exported under the names better-auth looks up**, which is
36
+ * the singular model name and not the table name. The adapter does `fullSchema['user']`,
37
+ * so a barrel exporting `users` fails on the first query rather than at boot:
38
+ *
39
+ * ```
40
+ * BetterAuthError: [# Drizzle Adapter]: The model "user" was not found in the schema object.
41
+ * ```
42
+ *
43
+ * Either name the exports `user`, `session`, `account` and `verification`, or map them
44
+ * where the schema is assembled:
45
+ *
46
+ * ```ts
47
+ * schema: { user: users, session: sessions, account: accounts, verification: verifications }
48
+ * ```
35
49
  *
36
50
  * dunx ships **no** schema for those tables. They are better-auth's, they change with
37
51
  * its plugins, and its own CLI generates them: `bunx @better-auth/cli generate`. A
package/dist/drizzle.js CHANGED
@@ -1,74 +1,5 @@
1
1
  // @bun
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __name = (target, name) => {
6
- Object.defineProperty(target, "name", {
7
- value: name,
8
- enumerable: false,
9
- configurable: true
10
- });
11
- return target;
12
- };
13
- var __knownSymbol = (name, symbol) => (symbol = Symbol[name]) ? symbol : Symbol.for("Symbol." + name);
14
- var __typeError = (msg) => {
15
- throw TypeError(msg);
16
- };
17
- var __defNormalProp = (obj, key, value) => (key in obj) ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
18
- var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
19
- var __privateIn = (member, obj) => Object(obj) !== obj ? __typeError('Cannot use the "in" operator on this value') : member.has(obj);
20
- var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
21
- var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
22
- var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
23
- var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
24
- var __decoratorStart = (base) => [, , , __create(base?.[__knownSymbol("metadata")] ?? null)];
25
- var __decoratorStrings = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"];
26
- var __expectFn = (fn) => fn !== undefined && typeof fn !== "function" ? __typeError("Function expected") : fn;
27
- var __decoratorContext = (kind, name, done, metadata, fns) => ({
28
- kind: __decoratorStrings[kind],
29
- name,
30
- metadata,
31
- addInitializer: (fn) => done._ ? __typeError("Already initialized") : fns.push(__expectFn(fn || null))
32
- });
33
- var __decoratorMetadata = (array, target) => __defNormalProp(target, __knownSymbol("metadata"), array[3]);
34
- var __runInitializers = (array, flags, self, value) => {
35
- for (var i = 0, fns = array[flags >> 1], n = fns && fns.length;i < n; i++)
36
- flags & 1 ? fns[i].call(self) : value = fns[i].call(self, value);
37
- return value;
38
- };
39
- var __decorateElement = (array, flags, name, decorators, target, extra) => {
40
- var fn, it, done, ctx, access, k = flags & 7, s = !!(flags & 8), p = !!(flags & 16);
41
- var j = k > 3 ? array.length + 1 : k ? s ? 1 : 2 : 0, key = __decoratorStrings[k + 5];
42
- var initializers = k > 3 && (array[j - 1] = []), extraInitializers = array[j] || (array[j] = []);
43
- var desc = k && (!p && !s && (target = target.prototype), k < 5 && (k > 3 || !p) && __getOwnPropDesc(k < 4 ? target : {
44
- get [name]() {
45
- return __privateGet(this, extra);
46
- },
47
- set [name](x) {
48
- __privateSet(this, extra, x);
49
- }
50
- }, name));
51
- k ? p && k < 4 && __name(extra, (k > 2 ? "set " : k > 1 ? "get " : "") + name) : __name(target, name);
52
- for (var i = decorators.length - 1;i >= 0; i--) {
53
- ctx = __decoratorContext(k, name, done = {}, array[3], extraInitializers);
54
- if (k) {
55
- ctx.static = s, ctx.private = p, access = ctx.access = { has: p ? (x) => __privateIn(target, x) : (x) => (name in x) };
56
- if (k ^ 3)
57
- access.get = p ? (x) => (k ^ 1 ? __privateGet : __privateMethod)(x, target, k ^ 4 ? extra : desc.get) : (x) => x[name];
58
- if (k > 2)
59
- access.set = p ? (x, y) => __privateSet(x, target, y, k ^ 4 ? extra : desc.set) : (x, y) => x[name] = y;
60
- }
61
- it = (0, decorators[i])(k ? k < 4 ? p ? extra : desc[key] : k > 4 ? undefined : { get: desc.get, set: desc.set } : target, ctx);
62
- done._ = 1;
63
- if (k ^ 4 || it === undefined)
64
- __expectFn(it) && (k > 4 ? initializers.unshift(it) : k ? p ? extra = it : desc[key] = it : target = it);
65
- else if (typeof it !== "object" || it === null)
66
- __typeError("Object expected");
67
- else
68
- __expectFn(fn = it.get) && (desc.get = fn), __expectFn(fn = it.set) && (desc.set = fn), __expectFn(fn = it.init) && initializers.unshift(fn);
69
- }
70
- return k || __decoratorMetadata(array, target), desc && __defProp(target, name, desc), p ? k ^ 4 ? extra : desc : target;
71
- };
2
+ import"./chunk-dtq1p1zv.js";
72
3
 
73
4
  // src/drizzle.ts
74
5
  import {
@@ -88,5 +19,5 @@ export {
88
19
  drizzleDatabase
89
20
  };
90
21
 
91
- //# debugId=FE2DA2CE89A5EE9A64756E2164756E21
22
+ //# debugId=F599C8B7916586AE64756E2164756E21
92
23
  //# sourceMappingURL=drizzle.js.map
@@ -2,9 +2,9 @@
2
2
  "version": 3,
3
3
  "sources": ["../src/drizzle.ts"],
4
4
  "sourcesContent": [
5
- "import {\n drizzleAdapter,\n type DB,\n type DrizzleAdapterConfig,\n} from 'better-auth/adapters/drizzle';\n\n/**\n * The two members of `@dunx/infra/db`'s `DbConnection` this reads.\n *\n * Restated structurally rather than imported, for the same reason `@dunx/http`\n * restates Standard Schema: it keeps `@dunx/auth`'s dependency list at `@dunx/core`\n * and `@dunx/http`, and it means a bare `drizzle({ client, schema })` handle works\n * here too. An `@dunx/infra/db` connection satisfies it with no adapter in between -\n * `dialect` is exactly that union and `db` is exactly `unknown`.\n */\nexport interface DrizzleSource {\n readonly dialect: 'postgres' | 'mysql' | 'mariadb' | 'sqlite';\n /** The drizzle handle - `BunSQLiteDatabase` or `BunSQLDatabase`. */\n readonly db: unknown;\n}\n\n/** What better-auth's drizzle adapter calls each of the dialects `@dunx/infra/db` reports. */\nconst PROVIDERS: Readonly<\n Record<DrizzleSource['dialect'], DrizzleAdapterConfig['provider']>\n> = Object.freeze({\n postgres: 'pg',\n mysql: 'mysql',\n mariadb: 'mysql',\n sqlite: 'sqlite',\n});\n\n/**\n * better-auth's `database` option over a connection the app already opened. Nothing\n * here connects: the point is that the app keeps **one** pool, one SQLite handle and\n * one shutdown path, instead of better-auth opening a second.\n *\n * ```ts\n * AuthModule.forRootAsync({\n * useFactory: (connection: DbConnection) => ({\n * database: drizzleDatabase(connection),\n * }),\n * inject: [DbConnection],\n * });\n * ```\n *\n * The `provider` comes from the connection's own dialect, so swapping `bun:sqlite`\n * for `Bun.SQL` needs no edit at the call site. The schema does not have to be passed\n * either - `@dunx/infra/db` builds its handle with `drizzle({ client, schema })` and\n * the adapter reads `db._.fullSchema`, so the better-auth tables being in the app's\n * schema object is the whole requirement.\n *\n * dunx ships **no** schema for those tables. They are better-auth's, they change with\n * its plugins, and its own CLI generates them: `bunx @better-auth/cli generate`. A\n * copy of them inside a framework is a copy that silently rots against the library\n * that reads it.\n */\nexport const drizzleDatabase = (\n connection: DrizzleSource,\n config: Omit<DrizzleAdapterConfig, 'provider'> = {},\n): ReturnType<typeof drizzleAdapter> =>\n // `db` is `unknown` on the contract because it cannot promise either backend's\n // handle. Narrowing it is what that contract documents.\n drizzleAdapter(connection.db as DB, {\n ...config,\n provider: PROVIDERS[connection.dialect],\n });\n"
5
+ "import {\n drizzleAdapter,\n type DB,\n type DrizzleAdapterConfig,\n} from 'better-auth/adapters/drizzle';\n\n/**\n * The two members of `@dunx/infra/db`'s `DbConnection` this reads.\n *\n * Restated structurally rather than imported, for the same reason `@dunx/http`\n * restates Standard Schema: it keeps `@dunx/auth`'s dependency list at `@dunx/core`\n * and `@dunx/http`, and it means a bare `drizzle({ client, schema })` handle works\n * here too. An `@dunx/infra/db` connection satisfies it with no adapter in between -\n * `dialect` is exactly that union and `db` is exactly `unknown`.\n */\nexport interface DrizzleSource {\n readonly dialect: 'postgres' | 'mysql' | 'mariadb' | 'sqlite';\n /** The drizzle handle - `BunSQLiteDatabase` or `BunSQLDatabase`. */\n readonly db: unknown;\n}\n\n/** What better-auth's drizzle adapter calls each of the dialects `@dunx/infra/db` reports. */\nconst PROVIDERS: Readonly<\n Record<DrizzleSource['dialect'], DrizzleAdapterConfig['provider']>\n> = Object.freeze({\n postgres: 'pg',\n mysql: 'mysql',\n mariadb: 'mysql',\n sqlite: 'sqlite',\n});\n\n/**\n * better-auth's `database` option over a connection the app already opened. Nothing\n * here connects: the point is that the app keeps **one** pool, one SQLite handle and\n * one shutdown path, instead of better-auth opening a second.\n *\n * ```ts\n * AuthModule.forRootAsync({\n * useFactory: (connection: DbConnection) => ({\n * database: drizzleDatabase(connection),\n * }),\n * inject: [DbConnection],\n * });\n * ```\n *\n * The `provider` comes from the connection's own dialect, so swapping `bun:sqlite`\n * for `Bun.SQL` needs no edit at the call site. The schema does not have to be passed\n * either - `@dunx/infra/db` builds its handle with `drizzle({ client, schema })` and\n * the adapter reads `db._.fullSchema`.\n *\n * **The tables have to be exported under the names better-auth looks up**, which is\n * the singular model name and not the table name. The adapter does `fullSchema['user']`,\n * so a barrel exporting `users` fails on the first query rather than at boot:\n *\n * ```\n * BetterAuthError: [# Drizzle Adapter]: The model \"user\" was not found in the schema object.\n * ```\n *\n * Either name the exports `user`, `session`, `account` and `verification`, or map them\n * where the schema is assembled:\n *\n * ```ts\n * schema: { user: users, session: sessions, account: accounts, verification: verifications }\n * ```\n *\n * dunx ships **no** schema for those tables. They are better-auth's, they change with\n * its plugins, and its own CLI generates them: `bunx @better-auth/cli generate`. A\n * copy of them inside a framework is a copy that silently rots against the library\n * that reads it.\n */\nexport const drizzleDatabase = (\n connection: DrizzleSource,\n config: Omit<DrizzleAdapterConfig, 'provider'> = {},\n): ReturnType<typeof drizzleAdapter> =>\n // `db` is `unknown` on the contract because it cannot promise either backend's\n // handle. Narrowing it is what that contract documents.\n drizzleAdapter(connection.db as DB, {\n ...config,\n provider: PROVIDERS[connection.dialect],\n });\n"
6
6
  ],
7
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAsBA,IAAM,YAEF,OAAO,OAAO;AAAA,EAChB,UAAU;AAAA,EACV,OAAO;AAAA,EACP,SAAS;AAAA,EACT,QAAQ;AACV,CAAC;AA2BM,IAAM,kBAAkB,CAC7B,YACA,SAAiD,CAAC,MAIlD,eAAe,WAAW,IAAU;AAAA,KAC/B;AAAA,EACH,UAAU,UAAU,WAAW;AACjC,CAAC;",
8
- "debugId": "FE2DA2CE89A5EE9A64756E2164756E21",
7
+ "mappings": ";;;;AAAA;AAAA;AAAA;AAsBA,IAAM,YAEF,OAAO,OAAO;AAAA,EAChB,UAAU;AAAA,EACV,OAAO;AAAA,EACP,SAAS;AAAA,EACT,QAAQ;AACV,CAAC;AAyCM,IAAM,kBAAkB,CAC7B,YACA,SAAiD,CAAC,MAIlD,eAAe,WAAW,IAAU;AAAA,KAC/B;AAAA,EACH,UAAU,UAAU,WAAW;AACjC,CAAC;",
8
+ "debugId": "F599C8B7916586AE64756E2164756E21",
9
9
  "names": []
10
10
  }
package/dist/index.js CHANGED
@@ -1,74 +1,14 @@
1
1
  // @bun
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __name = (target, name) => {
6
- Object.defineProperty(target, "name", {
7
- value: name,
8
- enumerable: false,
9
- configurable: true
10
- });
11
- return target;
12
- };
13
- var __knownSymbol = (name, symbol) => (symbol = Symbol[name]) ? symbol : Symbol.for("Symbol." + name);
14
- var __typeError = (msg) => {
15
- throw TypeError(msg);
16
- };
17
- var __defNormalProp = (obj, key, value) => (key in obj) ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
18
- var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
19
- var __privateIn = (member, obj) => Object(obj) !== obj ? __typeError('Cannot use the "in" operator on this value') : member.has(obj);
20
- var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
21
- var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
22
- var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
23
- var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
24
- var __decoratorStart = (base) => [, , , __create(base?.[__knownSymbol("metadata")] ?? null)];
25
- var __decoratorStrings = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"];
26
- var __expectFn = (fn) => fn !== undefined && typeof fn !== "function" ? __typeError("Function expected") : fn;
27
- var __decoratorContext = (kind, name, done, metadata, fns) => ({
28
- kind: __decoratorStrings[kind],
29
- name,
30
- metadata,
31
- addInitializer: (fn) => done._ ? __typeError("Already initialized") : fns.push(__expectFn(fn || null))
32
- });
33
- var __decoratorMetadata = (array, target) => __defNormalProp(target, __knownSymbol("metadata"), array[3]);
34
- var __runInitializers = (array, flags, self, value) => {
35
- for (var i = 0, fns = array[flags >> 1], n = fns && fns.length;i < n; i++)
36
- flags & 1 ? fns[i].call(self) : value = fns[i].call(self, value);
37
- return value;
38
- };
39
- var __decorateElement = (array, flags, name, decorators, target, extra) => {
40
- var fn, it, done, ctx, access, k = flags & 7, s = !!(flags & 8), p = !!(flags & 16);
41
- var j = k > 3 ? array.length + 1 : k ? s ? 1 : 2 : 0, key = __decoratorStrings[k + 5];
42
- var initializers = k > 3 && (array[j - 1] = []), extraInitializers = array[j] || (array[j] = []);
43
- var desc = k && (!p && !s && (target = target.prototype), k < 5 && (k > 3 || !p) && __getOwnPropDesc(k < 4 ? target : {
44
- get [name]() {
45
- return __privateGet(this, extra);
46
- },
47
- set [name](x) {
48
- __privateSet(this, extra, x);
49
- }
50
- }, name));
51
- k ? p && k < 4 && __name(extra, (k > 2 ? "set " : k > 1 ? "get " : "") + name) : __name(target, name);
52
- for (var i = decorators.length - 1;i >= 0; i--) {
53
- ctx = __decoratorContext(k, name, done = {}, array[3], extraInitializers);
54
- if (k) {
55
- ctx.static = s, ctx.private = p, access = ctx.access = { has: p ? (x) => __privateIn(target, x) : (x) => (name in x) };
56
- if (k ^ 3)
57
- access.get = p ? (x) => (k ^ 1 ? __privateGet : __privateMethod)(x, target, k ^ 4 ? extra : desc.get) : (x) => x[name];
58
- if (k > 2)
59
- access.set = p ? (x, y) => __privateSet(x, target, y, k ^ 4 ? extra : desc.set) : (x, y) => x[name] = y;
60
- }
61
- it = (0, decorators[i])(k ? k < 4 ? p ? extra : desc[key] : k > 4 ? undefined : { get: desc.get, set: desc.set } : target, ctx);
62
- done._ = 1;
63
- if (k ^ 4 || it === undefined)
64
- __expectFn(it) && (k > 4 ? initializers.unshift(it) : k ? p ? extra = it : desc[key] = it : target = it);
65
- else if (typeof it !== "object" || it === null)
66
- __typeError("Object expected");
67
- else
68
- __expectFn(fn = it.get) && (desc.get = fn), __expectFn(fn = it.set) && (desc.set = fn), __expectFn(fn = it.init) && initializers.unshift(fn);
69
- }
70
- return k || __decoratorMetadata(array, target), desc && __defProp(target, name, desc), p ? k ^ 4 ? extra : desc : target;
71
- };
2
+ import {
3
+ __decorateElement,
4
+ __decoratorMetadata,
5
+ __decoratorStart,
6
+ __privateAdd,
7
+ __privateGet,
8
+ __privateMethod,
9
+ __privateSet,
10
+ __runInitializers
11
+ } from "./chunk-dtq1p1zv.js";
72
12
 
73
13
  // src/errors.ts
74
14
  import { AppError } from "@dunx/core";
@@ -395,5 +335,5 @@ export {
395
335
  Auth
396
336
  };
397
337
 
398
- //# debugId=8234AC9581E74BE264756E2164756E21
338
+ //# debugId=BB049603DF9F22A664756E2164756E21
399
339
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -11,9 +11,9 @@
11
11
  "import type { BetterAuthOptions } from 'better-auth';\nimport { AuthError } from './errors.js';\nimport { bunPassword } from './password.js';\n\n/** better-auth's own default, and where `AuthHandler` mounts unless told otherwise. */\nexport const DEFAULT_BASE_PATH = '/api/auth';\n\n/**\n * One leading slash, no trailing one - the shape `@dunx/http`'s route paths take,\n * so the mount and better-auth's own URL building agree character for character.\n *\n * The root is rejected: the mount is `<basePath>/*`, and at `/` that wildcard would\n * claim every path in the app.\n */\nexport const normalizeBasePath = (basePath: string): string => {\n const normalized = `/${basePath}`.replace(/\\/{2,}/g, '/').replace(/\\/$/, '');\n\n if (normalized.length < 2) {\n throw new AuthError(\n `\"${basePath}\" is not a usable basePath. The handler mounts at ` +\n '<basePath>/*, so at the root it would claim every route in the app. ' +\n `Use something like ${DEFAULT_BASE_PATH}.`,\n );\n }\n return normalized;\n};\n\n/**\n * Bun's native bcrypt in place of better-auth's pure-JavaScript scrypt, unless a\n * `password` of your own is already there. See {@link bunPassword} for the\n * migration caveat.\n */\nconst withBunPassword = <O extends BetterAuthOptions>(options: O): O => {\n const email = options.emailAndPassword;\n if (!email?.enabled || email.password) return options;\n\n // The one cast in the package: TypeScript cannot prove a spread of a generic with\n // one key replaced is still that generic, and widening the return to\n // `BetterAuthOptions` would lose the plugin types `betterAuth()` infers from it.\n return {\n ...options,\n emailAndPassword: { ...email, password: bunPassword },\n } as O;\n};\n\n/**\n * What `betterAuth()` gets called with, where the handler mounts, and the difference\n * between the two. Bound in the container so all of it is readable, and constructed\n * by `AuthModule` rather than by the app.\n */\nexport class AuthOptions<O extends BetterAuthOptions = BetterAuthOptions> {\n readonly options: O;\n\n /**\n * What better-auth matches an incoming pathname against, and builds its URLs from.\n * Normalized here and written back into `options`, so the two cannot drift.\n */\n readonly basePath: string;\n\n /**\n * The **route** path `AuthHandler` is mounted at, which is `basePath` unless the\n * app calls `setGlobalPrefix`. better-auth compares the whole pathname to\n * `basePath`, so with `setGlobalPrefix('api')` the two are different strings for\n * the same URL: mount at `/auth`, and tell better-auth `basePath: '/api/auth'`.\n */\n readonly mountAt: string;\n\n constructor(init: O, mountAt?: string) {\n this.basePath = normalizeBasePath(init.basePath ?? DEFAULT_BASE_PATH);\n this.mountAt =\n mountAt === undefined ? this.basePath : normalizeBasePath(mountAt);\n this.options = withBunPassword({ ...init, basePath: this.basePath });\n }\n}\nObject.defineProperty(AuthOptions, Symbol.for('dunx.deps'), {\n value: () => [{ unresolved: \"init: O\" }, { unresolved: \"mountAt?: string\" }],\n});\n",
12
12
  "import {\n provide,\n type AbstractCtor,\n type Deps,\n type DynamicModule,\n type FactoryProvider,\n type Registration,\n RequestContext,\n} from '@dunx/core';\nimport { betterAuth, type BetterAuthOptions } from 'better-auth';\nimport { Auth } from './auth.js';\nimport { AuthContext } from './context.js';\nimport { AuthError } from './errors.js';\nimport { SessionGuard } from './guard.js';\nimport { mountHandler } from './handler.js';\nimport {\n AuthOptions,\n DEFAULT_BASE_PATH,\n normalizeBasePath,\n} from './options.js';\n\nconst build = (options: Registration, mountAt: string): DynamicModule => {\n // Instantiated to the token type rather than left as `typeof Auth`, which is what\n // lets the factory below hand back a plain better-auth instance with no cast.\n const auth: AbstractCtor<Auth> = Auth;\n\n return {\n module: AuthModule,\n controllers: [mountHandler(mountAt)],\n // Every binding declares its own `inject`, so nothing here needs\n // `@dunx/transform`'s transform to have run - the same reason\n // `RequestLoggingMiddleware` and `@dunx/infra/redis`'s `Redis` are bound this way.\n providers: [\n options,\n provide(auth, {\n useFactory: (resolved: AuthOptions) => betterAuth(resolved.options),\n inject: [AuthOptions] as const,\n }),\n provide(AuthContext, {\n useFactory: (context: RequestContext) => new AuthContext(context),\n inject: [RequestContext] as const,\n }),\n provide(SessionGuard, {\n useFactory: (instance: Auth, context: AuthContext) =>\n new SessionGuard(instance, context),\n inject: [auth, AuthContext] as const,\n }),\n ],\n };\n};\n\n/**\n * Binds three tokens and one controller:\n *\n * - `AuthOptions` - what `betterAuth()` was called with, and where it is mounted.\n * - `Auth` - the better-auth instance itself.\n * - `AuthContext` - the authenticated caller, per request.\n * - a prefixed `AuthHandler`, serving every better-auth endpoint under `basePath`.\n *\n * `SessionGuard` is registered as a provider rather than installed as global\n * middleware, because whether it guards the whole app or one controller is the app's\n * decision - pass it to `HttpFactory.create(root, { middleware: [SessionGuard] })`\n * or to `@UseGuards(SessionGuard)`.\n */\nexport class AuthModule {\n /**\n * ```ts\n * AuthModule.forRoot({\n * secret: process.env.BETTER_AUTH_SECRET,\n * baseURL: 'http://localhost:3000',\n * database: drizzleDatabase(connection),\n * emailAndPassword: { enabled: true },\n * plugins: [admin(), bearer()],\n * });\n * ```\n *\n * `const O` is load-bearing: it keeps the literal `plugins` tuple, which is what\n * `betterAuth()` infers the plugin endpoints from - and therefore what\n * `Auth<typeof options>` resolves to at an injection site.\n *\n * `mountAt` only matters under a global prefix - see {@link AuthOptions.mountAt}.\n */\n static forRoot<const O extends BetterAuthOptions>(\n options: O,\n mountAt?: string,\n ): DynamicModule {\n const resolved = new AuthOptions(options, mountAt);\n return build(\n provide(AuthOptions, { useValue: resolved }),\n resolved.mountAt,\n );\n }\n\n /**\n * `forRoot` with the options behind a factory that may await and may inject -\n * which is the only way the secret, the base URL and the database can come from\n * `ConfigService` rather than from module scope:\n *\n * ```ts\n * AuthModule.forRootAsync({\n * useFactory: (config: AppConfigService, connection: DbConnection) => ({\n * secret: config.get('authSecret'),\n * baseURL: config.get('appUrl'),\n * database: drizzleDatabase(connection),\n * emailAndPassword: { enabled: true },\n * }),\n * inject: [AppConfigService, DbConnection],\n * });\n * ```\n *\n * `mountAt` is a second, **synchronous** argument for the same reason\n * `DbModule.forRootAsync` takes its token positionally: the mount is a route in\n * Bun's table, and that table is built before any factory has run. It is only\n * needed under a global prefix - see {@link AuthOptions.mountAt}. Omitting it while\n * the factory returns a non-default `basePath` is a boot error, because that\n * combination could only ever have mounted the handler where better-auth is not\n * looking.\n */\n static forRootAsync<const D extends Deps>(\n provider: FactoryProvider<BetterAuthOptions, D>,\n mountAt?: string,\n ): DynamicModule;\n static forRootAsync(\n provider: FactoryProvider<BetterAuthOptions, Deps>,\n mountAt?: string,\n ): DynamicModule {\n const mounted = normalizeBasePath(mountAt ?? DEFAULT_BASE_PATH);\n\n return build(\n provide(AuthOptions, {\n useFactory: async (\n ...deps: readonly unknown[]\n ): Promise<AuthOptions> => {\n const resolved = new AuthOptions(\n await provider.useFactory(...deps),\n mounted,\n );\n if (mountAt === undefined && resolved.basePath !== mounted) {\n throw new AuthError(\n `The factory returned basePath ${resolved.basePath}, but the handler ` +\n `is mounted at ${mounted} - the table was built before the factory ` +\n 'ran, so it could not follow. Pass the route path as ' +\n \"forRootAsync's second argument.\",\n );\n }\n return resolved;\n },\n inject: provider.inject ?? [],\n }),\n mounted,\n );\n }\n}\n",
13
13
  "import type { BetterAuthOptions } from 'better-auth';\n\ntype SecondaryStorage = NonNullable<BetterAuthOptions['secondaryStorage']>;\n\n/**\n * The six commands this needs, restated rather than imported from\n * `@dunx/infra/redis` - same reasoning as {@link DrizzleSource}. A `RedisConnection`\n * satisfies it structurally (its parameters are wider, which is the assignable\n * direction), and a test double is six methods instead of the whole surface.\n */\nexport interface RedisStore {\n get(key: string): Promise<string | null>;\n getdel(key: string): Promise<string | null>;\n incr(key: string): Promise<number>;\n expire(key: string, seconds: number): Promise<boolean>;\n set(\n key: string,\n value: string,\n options?: { readonly ex?: number },\n ): Promise<string | null>;\n del(key: string): Promise<number>;\n}\n\n/**\n * better-auth's `secondaryStorage` over `Bun.RedisClient`, so sessions, verification\n * values and rate-limit counters live in Redis instead of costing a database round\n * trip on every request.\n *\n * All five methods are implemented, not the three that are mandatory.\n * `getAndDelete` and `increment` are optional in better-auth's interface because most\n * clients cannot do them atomically - `Bun.RedisClient` can, through `GETDEL` and\n * `INCR`, both already on `@dunx/infra/redis`'s contract. Without them better-auth\n * falls back to read-then-delete for single-use credentials, which is a race, and to\n * a non-atomic rate-limit counter.\n *\n * `increment`'s TTL applies on creation only, which is what makes the counter expire\n * a fixed window after the first hit rather than sliding forever: `INCR` returning\n * `1` is the signal that this call created the key.\n *\n * Redis being unreachable is deliberately **not** softened here. Bun's client\n * connects lazily and queues, so a command against a down server rejects and\n * better-auth's own error path is what should see it - a swallowed `null` from `get`\n * would read as \"no session\" and sign every user out.\n */\nexport const redisStorage = (connection: RedisStore): SecondaryStorage => ({\n get: (key) => connection.get(key),\n getAndDelete: (key) => connection.getdel(key),\n increment: async (key, ttl) => {\n const value = await connection.incr(key);\n if (value === 1) await connection.expire(key, ttl);\n return value;\n },\n set: (key, value, ttl) =>\n connection.set(key, value, ttl === undefined ? {} : { ex: ttl }),\n delete: async (key) => {\n await connection.del(key);\n },\n});\n",
14
- "import { normalizeBasePath } from './options.js';\n\n/**\n * The shape `@dunx/openapi` accepts as a contribution. Restated here rather than\n * imported, for the same reason `DrizzleSource` restates `DbConnection`:\n * `@dunx/auth` must not depend on `@dunx/openapi`. An app that documents nothing\n * still uses this package, and an app that never mounts auth still uses that one.\n */\nexport interface AuthDocumentFragment {\n readonly paths: Readonly<Record<string, Record<string, unknown>>>;\n readonly schemas: Readonly<Record<string, unknown>>;\n readonly tags: readonly {\n readonly name: string;\n readonly description?: string;\n }[];\n}\n\n/** Just enough of a Better Auth instance to ask it for its schema. */\nexport interface OpenApiCapableAuth {\n readonly api: {\n generateOpenAPISchema?: () => Promise<unknown>;\n };\n}\n\nexport interface AuthDocumentOptions {\n /** Where the handler is mounted. Matches `AuthOptions.basePath`. */\n readonly basePath: string;\n /** Tag every contributed operation carries. Default `auth`. */\n readonly tag?: string;\n}\n\nconst METHODS = ['get', 'post', 'put', 'patch', 'delete', 'options', 'head'];\n\ninterface RawSchema {\n paths?: Record<string, Record<string, unknown>>;\n components?: { schemas?: Record<string, unknown> };\n}\n\n/**\n * Better Auth's own endpoints, as a contribution to the app's OpenAPI document.\n *\n * Better Auth serves `<basePath>/*` from its own handler rather than from dunx\n * controllers, so route discovery cannot see any of it and the document would\n * describe an API missing its entire authentication surface. This asks the\n * library for its schema and hands it over:\n *\n * ```ts\n * OpenApiModule.forRoot({\n * title: 'API',\n * version: '1.0.0',\n * root: AppModule,\n * contribute: [betterAuthDocument(auth, { basePath: '/api/auth' })],\n * });\n * ```\n *\n * **Better Auth only generates a schema when the `openAPI()` plugin is enabled.**\n * Without it `generateOpenAPISchema` is absent and this contributes nothing rather\n * than throwing, because a missing plugin should cost documentation and not boot.\n * Pass `openAPI({ disableDefaultReference: true })` if you want the schema without\n * Better Auth also mounting its own reference page next to the dunx one.\n *\n * Paths are rewritten to sit under `basePath`, since the library reports them\n * relative to its own mount.\n */\nexport const betterAuthDocument =\n (auth: OpenApiCapableAuth, options: AuthDocumentOptions) =>\n async (): Promise<AuthDocumentFragment> => {\n const empty: AuthDocumentFragment = { paths: {}, schemas: {}, tags: [] };\n if (typeof auth.api.generateOpenAPISchema !== 'function') return empty;\n\n const raw = (await auth.api.generateOpenAPISchema()) as RawSchema;\n const prefix = normalizeBasePath(options.basePath);\n const tag = options.tag ?? 'auth';\n\n const paths: Record<string, Record<string, unknown>> = {};\n for (const [path, item] of Object.entries(raw.paths ?? {})) {\n // Tagged so the explorer groups them, instead of scattering a dozen auth\n // endpoints through the rest of the API.\n for (const method of METHODS) {\n const operation = item[method];\n if (operation && typeof operation === 'object') {\n (operation as { tags?: string[] }).tags = [tag];\n }\n }\n paths[path.startsWith(prefix) ? path : `${prefix}${path}`] = item;\n }\n\n return {\n paths,\n schemas: raw.components?.schemas ?? {},\n tags: [{ name: tag, description: 'Served by Better Auth' }],\n };\n };\n"
14
+ "import { normalizeBasePath } from './options.js';\n\n/**\n * The shape `@dunx/openapi` accepts as a contribution. Restated here rather than\n * imported, for the same reason `DrizzleSource` restates `DbConnection`:\n * `@dunx/auth` must not depend on `@dunx/openapi`. An app that documents nothing\n * still uses this package, and an app that never mounts auth still uses that one.\n */\nexport interface AuthDocumentFragment {\n readonly paths: Readonly<Record<string, Record<string, unknown>>>;\n readonly schemas: Readonly<Record<string, unknown>>;\n readonly tags: readonly {\n readonly name: string;\n readonly description?: string;\n }[];\n}\n\n/**\n * Just enough of a Better Auth instance to ask it for its schema.\n *\n * `api` is `object` with the method optional on top, rather than an interface\n * whose only member is optional. Every-property-optional triggers TypeScript's\n * weak-type check, which rejects any argument sharing no property with it - so an\n * instance built without the `openAPI()` plugin failed to compile, and the doc\n * below promising it \"contributes nothing rather than throwing\" described a path\n * that could not be written.\n */\nexport interface OpenApiCapableAuth {\n readonly api: object & {\n generateOpenAPISchema?: () => Promise<unknown>;\n };\n}\n\nexport interface AuthDocumentOptions {\n /**\n * Where the handler is mounted. Matches `AuthOptions.basePath`, including the\n * global prefix if there is one: these paths go into the document as-is and\n * are not moved again by `setGlobalPrefix()`.\n */\n readonly basePath: string;\n /** Tag every contributed operation carries. Default `auth`. */\n readonly tag?: string;\n}\n\nconst METHODS = ['get', 'post', 'put', 'patch', 'delete', 'options', 'head'];\n\ninterface RawSchema {\n paths?: Record<string, Record<string, unknown>>;\n components?: { schemas?: Record<string, unknown> };\n}\n\n/**\n * Better Auth's own endpoints, as a contribution to the app's OpenAPI document.\n *\n * Better Auth serves `<basePath>/*` from its own handler rather than from dunx\n * controllers, so route discovery cannot see any of it and the document would\n * describe an API missing its entire authentication surface. This asks the\n * library for its schema and hands it over:\n *\n * ```ts\n * OpenApiModule.forRoot({\n * title: 'API',\n * version: '1.0.0',\n * root: AppModule,\n * contribute: [betterAuthDocument(auth, { basePath: '/api/auth' })],\n * });\n * ```\n *\n * **Better Auth only generates a schema when the `openAPI()` plugin is enabled.**\n * Without it `generateOpenAPISchema` is absent and this contributes nothing rather\n * than throwing, because a missing plugin should cost documentation and not boot.\n * Pass `openAPI({ disableDefaultReference: true })` if you want the schema without\n * Better Auth also mounting its own reference page next to the dunx one.\n *\n * Paths are rewritten to sit under `basePath`, since the library reports them\n * relative to its own mount.\n */\nexport const betterAuthDocument =\n (auth: OpenApiCapableAuth, options: AuthDocumentOptions) =>\n async (): Promise<AuthDocumentFragment> => {\n const empty: AuthDocumentFragment = { paths: {}, schemas: {}, tags: [] };\n if (typeof auth.api.generateOpenAPISchema !== 'function') return empty;\n\n const raw = (await auth.api.generateOpenAPISchema()) as RawSchema;\n const prefix = normalizeBasePath(options.basePath);\n const tag = options.tag ?? 'auth';\n\n const paths: Record<string, Record<string, unknown>> = {};\n for (const [path, item] of Object.entries(raw.paths ?? {})) {\n // Tagged so the explorer groups them, instead of scattering a dozen auth\n // endpoints through the rest of the API.\n for (const method of METHODS) {\n const operation = item[method];\n if (operation && typeof operation === 'object') {\n (operation as { tags?: string[] }).tags = [tag];\n }\n }\n paths[path.startsWith(prefix) ? path : `${prefix}${path}`] = item;\n }\n\n return {\n paths,\n schemas: raw.components?.schemas ?? {},\n tags: [{ name: tag, description: 'Served by Better Auth' }],\n };\n };\n"
15
15
  ],
16
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAMO,MAAM,kBAAkB,SAAS;AAAA,EAC7B,OAAO;AAClB;;;ACYO,MAAe,KAAsD;AAAA,EAO1E,WAAW,GAAG;AAAA,IACZ,IAAI,eAAe,MAAM;AAAA,MACvB,MAAM,IAAI,UACR,8DACE,yEACJ;AAAA,IACF;AAAA;AAYJ;;AC7CA;AACA;AACA;AAAA;AAqBO,MAAM,YAAY;AAAA,EAGM;AAAA,EAFpB,WAAW,IAAI;AAAA,EAExB,WAAW,CAAkB,SAAyB;AAAA,IAAzB;AAAA;AAAA,EAW7B,OAAwD,GAE1C;AAAA,IACZ,OAAO,KAAK,SAAS,SAAS;AAAA;AAAA,EAIhC,OAAwD,GAAiB;AAAA,IACvE,MAAM,YAAY,KAAK,QAAW;AAAA,IAClC,IAAI,CAAC,WAAW;AAAA,MACd,MAAM,IAAI,UAAU,eAAe,cAAc,iBAAiB;AAAA,IACpE;AAAA,IACA,OAAO;AAAA;AAAA,EAUT,GAAM,CAAC,WAAsB,UAAsB;AAAA,IACjD,KAAK,QAAQ,cAAc,EAAE,QAAQ,UAAU,KAAK,GAAG,CAAC;AAAA,IACxD,OAAO,KAAK,SAAS,IAAI,WAAW,QAAQ;AAAA;AAEhD;AACA,OAAO,eAAe,aAAa,OAAO,IAAI,WAAW,GAAG;AAAA,EAC1D,OAAO,MAAM,CAAC,cAAc;AAC9B,CAAC;;AClED;AAAA,eACE;AAAA,oBACA;AAAA;AAAA;AAAA;AAqBK,IAAM,UAAU,CAAC,SA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kB,QAAQ,QAAQ;AAAA,EACjD,MAAM,MAAM,QAAQ,OAAO;AAAA,EAE3B,MAAM,QAAiD,CAAC;AAAA,EACxD,YAAY,MAAM,SAAS,OAAO,QAAQ,IAAI,SAAS,CAAC,CAAC,GAAG;AAAA,IAG1D,WAAW,UAAU,SAAS;AAAA,MAC5B,MAAM,YAAY,KAAK;AAAA,MACvB,IAAI,aAAa,OAAO,cAAc,UAAU;AAAA,QAC7C,UAAkC,OAAO,CAAC,GAAG;AAAA,MAChD;AAAA,IACF;AAAA,IACA,MAAM,KAAK,WAAW,MAAM,IAAI,OAAO,GAAG,SAAS,UAAU;AAAA,EAC/D;AAAA,EAEA,OAAO;AAAA,IACL;AAAA,IACA,SAAS,IAAI,YAAY,WAAW,CAAC;AAAA,IACrC,MAAM,CAAC,EAAE,MAAM,KAAK,aAAa,wBAAwB,CAAC;AAAA,EAC5D;AAAA;",
17
+ "debugId": "BB049603DF9F22A664756E2164756E21",
18
18
  "names": []
19
19
  }
package/dist/openapi.d.ts CHANGED
@@ -12,14 +12,27 @@ export interface AuthDocumentFragment {
12
12
  readonly description?: string;
13
13
  }[];
14
14
  }
15
- /** Just enough of a Better Auth instance to ask it for its schema. */
15
+ /**
16
+ * Just enough of a Better Auth instance to ask it for its schema.
17
+ *
18
+ * `api` is `object` with the method optional on top, rather than an interface
19
+ * whose only member is optional. Every-property-optional triggers TypeScript's
20
+ * weak-type check, which rejects any argument sharing no property with it - so an
21
+ * instance built without the `openAPI()` plugin failed to compile, and the doc
22
+ * below promising it "contributes nothing rather than throwing" described a path
23
+ * that could not be written.
24
+ */
16
25
  export interface OpenApiCapableAuth {
17
- readonly api: {
26
+ readonly api: object & {
18
27
  generateOpenAPISchema?: () => Promise<unknown>;
19
28
  };
20
29
  }
21
30
  export interface AuthDocumentOptions {
22
- /** Where the handler is mounted. Matches `AuthOptions.basePath`. */
31
+ /**
32
+ * Where the handler is mounted. Matches `AuthOptions.basePath`, including the
33
+ * global prefix if there is one: these paths go into the document as-is and
34
+ * are not moved again by `setGlobalPrefix()`.
35
+ */
23
36
  readonly basePath: string;
24
37
  /** Tag every contributed operation carries. Default `auth`. */
25
38
  readonly tag?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dunx/auth",
3
- "version": "0.2.6",
3
+ "version": "0.2.8",
4
4
  "description": "Better Auth for dunx: its handler mounted on Bun.serve, a session guard reading @Public() and @Roles(), the caller in async context, and Bun.password hashing",
5
5
  "keywords": [
6
6
  "auth",
@@ -58,8 +58,8 @@
58
58
  "drizzle-orm": "^0.45.2"
59
59
  },
60
60
  "peerDependencies": {
61
- "@dunx/core": "^0.2.6",
62
- "@dunx/http": "^0.2.6",
61
+ "@dunx/core": "^0.2.8",
62
+ "@dunx/http": "^0.2.8",
63
63
  "@types/bun": ">=1.3.0",
64
64
  "better-auth": "^1.6.25",
65
65
  "drizzle-orm": "^0.45.2"