better-auth-studio 1.0.59-beta.7 → 1.0.59-beta.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.
@@ -1 +1 @@
1
- {"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../src/routes.ts"],"names":[],"mappings":"AAeA,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,CAqLhG;AAeD,wBAAgB,YAAY,CAC1B,UAAU,EAAE,UAAU,EACtB,UAAU,CAAC,EAAE,MAAM,EACnB,SAAS,CAAC,EAAE,MAAM,GACjB,MAAM,CAqlLR"}
1
+ {"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../src/routes.ts"],"names":[],"mappings":"AAeA,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,CAqLhG;AAeD,wBAAgB,YAAY,CAC1B,UAAU,EAAE,UAAU,EACtB,UAAU,CAAC,EAAE,MAAM,EACnB,SAAS,CAAC,EAAE,MAAM,GACjB,MAAM,CAsmLR"}
package/dist/routes.js CHANGED
@@ -4347,7 +4347,28 @@ export function createRoutes(authConfig, configPath, geoDbPath) {
4347
4347
  attrs.push(`required: ${field.required ? 'true' : 'false'}`);
4348
4348
  attrs.push(`unique: ${field.unique ? 'true' : 'false'}`);
4349
4349
  attrs.push('input: false');
4350
- if (field.type === 'boolean') {
4350
+ // Handle defaultValue
4351
+ if (field.defaultValue !== undefined && field.defaultValue !== null && field.defaultValue !== '') {
4352
+ if (field.type === 'string') {
4353
+ attrs.push(`defaultValue: "${field.defaultValue}"`);
4354
+ }
4355
+ else if (field.type === 'boolean') {
4356
+ attrs.push(`defaultValue: ${field.defaultValue === 'true' || field.defaultValue === true}`);
4357
+ }
4358
+ else if (field.type === 'number') {
4359
+ attrs.push(`defaultValue: ${field.defaultValue}`);
4360
+ }
4361
+ else if (field.type === 'date') {
4362
+ if (field.defaultValue === 'now()') {
4363
+ attrs.push('defaultValue: new Date()');
4364
+ }
4365
+ else {
4366
+ attrs.push(`defaultValue: new Date("${field.defaultValue}")`);
4367
+ }
4368
+ }
4369
+ }
4370
+ else if (field.type === 'boolean') {
4371
+ // Default to false for boolean if no defaultValue specified
4351
4372
  attrs.push('defaultValue: false');
4352
4373
  }
4353
4374
  const attrStr = attrs.join(',\n ');