better-auth-studio 1.0.59-beta.1 → 1.0.59-beta.3

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.
@@ -1 +1 @@
1
- {"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../src/routes.ts"],"names":[],"mappings":"AAOA,OAAO,EAA+B,MAAM,EAAE,MAAM,SAAS,CAAC;AAS9D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AA8D9C,wBAAsB,oBAAoB,CAAC,cAAc,EAAE,MAAM,EAAE,OAAO,UAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,CAyLhG;AAwBD,wBAAgB,YAAY,CAC1B,UAAU,EAAE,UAAU,EACtB,UAAU,CAAC,EAAE,MAAM,EACnB,SAAS,CAAC,EAAE,MAAM,GACjB,MAAM,CAi8KR"}
1
+ {"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../src/routes.ts"],"names":[],"mappings":"AAOA,OAAO,EAA+B,MAAM,EAAE,MAAM,SAAS,CAAC;AAS9D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AA8D9C,wBAAsB,oBAAoB,CAAC,cAAc,EAAE,MAAM,EAAE,OAAO,UAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,CAyLhG;AAwBD,wBAAgB,YAAY,CAC1B,UAAU,EAAE,UAAU,EACtB,UAAU,CAAC,EAAE,MAAM,EACnB,SAAS,CAAC,EAAE,MAAM,GACjB,MAAM,CAo9KR"}
package/dist/routes.js CHANGED
@@ -4354,15 +4354,26 @@ export function createRoutes(authConfig, configPath, geoDbPath) {
4354
4354
  const fields = table.fields
4355
4355
  ?.filter((f) => f.name.trim())
4356
4356
  .map((field) => {
4357
- let attrStr = `type: "${field.type}"`;
4358
- if (field.required)
4359
- attrStr += ',\n required: true';
4360
- if (field.unique)
4361
- attrStr += ',\n unique: true';
4357
+ const attrs = [`type: "${field.type}"`];
4358
+ // Always include required (default to false)
4359
+ attrs.push(`required: ${field.required ? 'true' : 'false'}`);
4360
+ // Always include unique (default to false)
4361
+ attrs.push(`unique: ${field.unique ? 'true' : 'false'}`);
4362
+ // Always include input (default to false)
4363
+ attrs.push('input: false');
4364
+ // Add defaultValue for boolean fields
4365
+ if (field.type === 'boolean') {
4366
+ attrs.push('defaultValue: false');
4367
+ }
4368
+ const attrStr = attrs.join(',\n ');
4362
4369
  return ` ${field.name}: {\n ${attrStr}\n }`;
4363
4370
  })
4364
4371
  .join(',\n') || '';
4365
- return ` ${table.name}: {
4372
+ // If extending an existing table, use the extended table name
4373
+ const tableName = table.isExtending && table.extendedTableName
4374
+ ? table.extendedTableName.trim()
4375
+ : table.name.trim();
4376
+ return ` ${tableName}: {
4366
4377
  fields: {
4367
4378
  ${fields}
4368
4379
  },
@@ -4577,7 +4588,7 @@ import type { ${camelCaseName} } from "..";
4577
4588
 
4578
4589
  export const ${camelCaseName}Client = () => {
4579
4590
  return {
4580
- id: "${camelCaseName}" as const,
4591
+ id: "${camelCaseName}",
4581
4592
  $InferServerPlugin: {} as ReturnType<typeof ${camelCaseName}>,${pathMethods ? `\n pathMethods: {\n${pathMethods}\n },` : ''}${atomListenersCode}
4582
4593
  } satisfies BetterAuthClientPlugin;
4583
4594
  };