auth 1.6.18 → 1.6.20
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/dist/api.mjs +4 -0
- package/dist/index.mjs +10 -0
- package/package.json +6 -6
package/dist/api.mjs
CHANGED
|
@@ -133,6 +133,10 @@ const generateDrizzleSchema = async ({ options, file, adapter }) => {
|
|
|
133
133
|
if (attr.type === "date" && attr.defaultValue.toString().includes("new Date()")) if (databaseType === "sqlite") type += `.default(sql\`(cast(unixepoch('subsecond') * 1000 as integer))\`)`;
|
|
134
134
|
else type += `.defaultNow()`;
|
|
135
135
|
} else if (typeof attr.defaultValue === "string") type += `.default("${attr.defaultValue}")`;
|
|
136
|
+
else if (Array.isArray(attr.defaultValue)) {
|
|
137
|
+
const elements = attr.defaultValue.map((value) => JSON.stringify(value)).join(", ");
|
|
138
|
+
type += `.default([${elements}])`;
|
|
139
|
+
} else if (typeof attr.defaultValue === "object" && attr.defaultValue !== null) type += `.default(${JSON.stringify(attr.defaultValue)})`;
|
|
136
140
|
else type += `.default(${attr.defaultValue})`;
|
|
137
141
|
if (attr.onUpdate && attr.type === "date") {
|
|
138
142
|
if (typeof attr.onUpdate === "function") type += `.$onUpdate(${attr.onUpdate})`;
|
package/dist/index.mjs
CHANGED
|
@@ -703,6 +703,10 @@ const generateDrizzleSchema = async ({ options, file, adapter }) => {
|
|
|
703
703
|
if (attr.type === "date" && attr.defaultValue.toString().includes("new Date()")) if (databaseType === "sqlite") type += `.default(sql\`(cast(unixepoch('subsecond') * 1000 as integer))\`)`;
|
|
704
704
|
else type += `.defaultNow()`;
|
|
705
705
|
} else if (typeof attr.defaultValue === "string") type += `.default("${attr.defaultValue}")`;
|
|
706
|
+
else if (Array.isArray(attr.defaultValue)) {
|
|
707
|
+
const elements = attr.defaultValue.map((value) => JSON.stringify(value)).join(", ");
|
|
708
|
+
type += `.default([${elements}])`;
|
|
709
|
+
} else if (typeof attr.defaultValue === "object" && attr.defaultValue !== null) type += `.default(${JSON.stringify(attr.defaultValue)})`;
|
|
706
710
|
else type += `.default(${attr.defaultValue})`;
|
|
707
711
|
if (attr.onUpdate && attr.type === "date") {
|
|
708
712
|
if (typeof attr.onUpdate === "function") type += `.$onUpdate(${attr.onUpdate})`;
|
|
@@ -1927,6 +1931,12 @@ async function generateAction(opts) {
|
|
|
1927
1931
|
console.error(`The directory "${cwd}" does not exist.`);
|
|
1928
1932
|
process.exit(1);
|
|
1929
1933
|
}
|
|
1934
|
+
if (options.output) {
|
|
1935
|
+
const resolvedOutput = path.resolve(cwd, options.output);
|
|
1936
|
+
try {
|
|
1937
|
+
if ((await fs$1.stat(resolvedOutput)).isDirectory()) options.output = path.join(options.output, "auth-schema.ts");
|
|
1938
|
+
} catch {}
|
|
1939
|
+
}
|
|
1930
1940
|
const config = await getConfig({
|
|
1931
1941
|
cwd,
|
|
1932
1942
|
configPath: options.config
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "auth",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.20",
|
|
4
4
|
"description": "The CLI for Better Auth",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"@babel/core": "^7.29.0",
|
|
47
47
|
"@babel/preset-react": "^7.28.5",
|
|
48
48
|
"@babel/preset-typescript": "^7.28.5",
|
|
49
|
-
"@better-auth/utils": "0.4.
|
|
49
|
+
"@better-auth/utils": "0.4.2",
|
|
50
50
|
"@clack/prompts": "^0.11.0",
|
|
51
51
|
"@mrleebo/prisma-ast": "^0.13.1",
|
|
52
52
|
"c12": "^3.3.3",
|
|
@@ -60,9 +60,9 @@
|
|
|
60
60
|
"semver": "^7.7.4",
|
|
61
61
|
"yocto-spinner": "^0.2.3",
|
|
62
62
|
"zod": "^4.3.6",
|
|
63
|
-
"@better-auth/core": "1.6.
|
|
64
|
-
"@better-auth/telemetry": "1.6.
|
|
65
|
-
"better-auth": "1.6.
|
|
63
|
+
"@better-auth/core": "1.6.20",
|
|
64
|
+
"@better-auth/telemetry": "1.6.20",
|
|
65
|
+
"better-auth": "1.6.20"
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
|
68
68
|
"@types/better-sqlite3": "^7.6.13",
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
"tsx": "^4.21.0",
|
|
76
76
|
"type-fest": "^5.4.4",
|
|
77
77
|
"typescript": "^5.9.3",
|
|
78
|
-
"@better-auth/passkey": "1.6.
|
|
78
|
+
"@better-auth/passkey": "1.6.20"
|
|
79
79
|
},
|
|
80
80
|
"scripts": {
|
|
81
81
|
"build": "tsdown",
|