@better-auth/cli 1.4.0-beta.10 → 1.4.0-beta.11
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/index.js +10 -2
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -645,8 +645,8 @@ const supportedPlugins = [
|
|
|
645
645
|
id: "sso",
|
|
646
646
|
name: "sso",
|
|
647
647
|
clientName: "ssoClient",
|
|
648
|
-
path:
|
|
649
|
-
clientPath: "better-auth/client
|
|
648
|
+
path: `@better-auth/sso`,
|
|
649
|
+
clientPath: "@better-auth/sso/client"
|
|
650
650
|
},
|
|
651
651
|
{
|
|
652
652
|
id: "bearer",
|
|
@@ -1779,6 +1779,12 @@ const generateDrizzleSchema = async ({ options, file, adapter }) => {
|
|
|
1779
1779
|
return `text('${name}')`;
|
|
1780
1780
|
}
|
|
1781
1781
|
const type = field.type;
|
|
1782
|
+
if (typeof type !== "string") if (Array.isArray(type) && type.every((x) => typeof x === "string")) return {
|
|
1783
|
+
sqlite: `text({ enum: [${type.map((x) => `'${x}'`).join(", ")}] })`,
|
|
1784
|
+
pg: `pgEnum('${name}', [${type.map((x) => `'${x}'`).join(", ")}])`,
|
|
1785
|
+
mysql: `mysqlEnum([${type.map((x) => `'${x}'`).join(", ")}])`
|
|
1786
|
+
}[databaseType];
|
|
1787
|
+
else throw new TypeError(`Invalid field type for field ${name} in model ${modelName}`);
|
|
1782
1788
|
return {
|
|
1783
1789
|
string: {
|
|
1784
1790
|
sqlite: `text('${name}')`,
|
|
@@ -1869,10 +1875,12 @@ function generateImport({ databaseType, tables, options }) {
|
|
|
1869
1875
|
if (databaseType === "mysql") {
|
|
1870
1876
|
const hasNonBigintNumber = Object.values(tables).some((table) => Object.values(table.fields).some((field) => (field.type === "number" || field.type === "number[]") && !field.bigint));
|
|
1871
1877
|
if (!!useNumberId || hasNonBigintNumber) coreImports.push("int");
|
|
1878
|
+
if (Object.values(tables).some((table) => Object.values(table.fields).some((field) => typeof field.type !== "string" && Array.isArray(field.type) && field.type.every((x) => typeof x === "string")))) coreImports.push("mysqlEnum");
|
|
1872
1879
|
} else if (databaseType === "pg") {
|
|
1873
1880
|
const hasNonBigintNumber = Object.values(tables).some((table) => Object.values(table.fields).some((field) => (field.type === "number" || field.type === "number[]") && !field.bigint));
|
|
1874
1881
|
const hasFkToId = Object.values(tables).some((table) => Object.values(table.fields).some((field) => field.references?.field === "id"));
|
|
1875
1882
|
if (hasNonBigintNumber || options.advanced?.database?.useNumberId && hasFkToId) coreImports.push("integer");
|
|
1883
|
+
if (Object.values(tables).some((table) => Object.values(table.fields).some((field) => typeof field.type !== "string" && Array.isArray(field.type) && field.type.every((x) => typeof x === "string")))) coreImports.push("pgEnum");
|
|
1876
1884
|
} else coreImports.push("integer");
|
|
1877
1885
|
coreImports.push(useNumberId ? databaseType === "pg" ? "serial" : "" : "");
|
|
1878
1886
|
if (hasJson) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@better-auth/cli",
|
|
3
|
-
"version": "1.4.0-beta.
|
|
3
|
+
"version": "1.4.0-beta.11",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "The CLI for Better Auth",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"tinyexec": "^0.3.2",
|
|
59
59
|
"yocto-spinner": "^0.2.3",
|
|
60
60
|
"zod": "^4.1.5",
|
|
61
|
-
"better-auth": "1.4.0-beta.
|
|
61
|
+
"better-auth": "1.4.0-beta.11"
|
|
62
62
|
},
|
|
63
63
|
"files": [
|
|
64
64
|
"dist"
|