@hedystia/better-auth-typeorm
Version:
<div align="center"> <p> <strong>📦 @hedystia/better-auth-typeorm</strong> </p>
288 lines (243 loc) • 23.6 kB
JavaScript
var L=Object.defineProperty;var l=(a,e)=>L(a,"name",{value:e,configurable:!0});import{LessThan as W,LessThanOrEqual as G,MoreThan as z,MoreThanOrEqual as H,Like as B,Not as J,In as Y}from"typeorm";import{BetterAuthError as D}from"better-auth";import{getAuthTables as Z}from"better-auth/db";import*as N from"fs";import*as P from"path";function ee(a,e,s){return s==="update"?a:a==null&&e.defaultValue?typeof e.defaultValue=="function"?e.defaultValue():e.defaultValue:a}l(ee,"withApplyDefault");var ge=l(a=>e=>{let s=Z(e),y=l(()=>{function g(n,t){if(t==="id")return t;let o=s[n];if(!o)throw new Error(`Model ${n} not found in schema`);return o.fields[t].fieldName||t}l(g,"getField");function r(n,t){switch(n){case"eq":return t;case"ne":return J(t);case"gt":return z(t);case"lt":return W(t);case"gte":return H(t);case"lte":return G(t);case"in":return Y(t);case"contains":return B(`%${t}%`);case"starts_with":return B(`${t}%`);case"ends_with":return B(`%${t}`);default:return t}}l(r,"convertOperatorToTypeORM");function c(n,t){if(!t||t.length===0)return{};let o={};for(let d of t){let T=g(n,d.field);!d.operator||d.operator==="eq"?o[T]=d.value:o[T]=r(d.operator,d.value)}return o}l(c,"convertWhereToFindOptions");function f(n){let t=s[n];if(!t)throw new Error(`Model ${n} not found in schema`);return t.modelName}l(f,"getModelName");let b=e?.advanced?.generateId===!1;return{transformInput(n,t,o){let d=b||o==="update"?{}:{id:n.id},T=s[t];if(!T)throw new Error(`Model ${t} not found in schema`);let A=T.fields;for(let C in A){let U=n[C];U===void 0&&(!A[C].defaultValue||o==="update")||(d[A[C].fieldName||C]=ee(U,A[C],o))}return d},transformOutput(n,t,o=[]){if(!n)return null;let d=n.id||n._id?o.length===0||o.includes("id")?{id:n.id||n._id}:{}:{},T=s[t];if(!T)throw new Error(`Model ${t} not found in schema`);let A=T.fields;for(let C in A){if(o.length&&!o.includes(C))continue;let U=A[C];U&&(d[C]=n[U.fieldName||C])}return d},convertWhereToFindOptions:c,getModelName:f,getField:g}},"createTransform"),{transformInput:p,transformOutput:i,convertWhereToFindOptions:u,getModelName:m}=y();return{id:"typeorm",async create(g){let{model:r,data:c,select:f}=g,b=p(c,r,"create"),n=m(r),t=a.getRepository(n);try{let o=await t.save(b);return i(o,r,f)}catch(o){throw new D(`Failed to create ${r}: ${o instanceof Error?o.message:String(o)}`)}},async update(g){let{model:r,where:c,update:f,select:b=[]}=g,n=m(r),t=a.getRepository(n);try{let o=u(r,c),d=p(f,r,"update");if(c.length===1&&await t.findOne({where:o})){await t.update(o,d);let A=await t.findOne({where:o});return i(A,r,b)}return await t.update(o,d),null}catch(o){throw new D(`Failed to update ${r}: ${o instanceof Error?o.message:String(o)}`)}},async delete(g){let{model:r,where:c}=g,f=m(r),b=a.getRepository(f);try{let n=u(r,c);await b.delete(n)}catch(n){throw new D(`Failed to delete ${r}: ${n instanceof Error?n.message:String(n)}`)}},async findOne(g){let{model:r,where:c,select:f}=g,b=m(r),n=a.getRepository(b);try{let t=u(r,c),o=await n.findOne({where:t,select:f});return i(o,r,f)}catch(t){throw new D(`Failed to find ${r}: ${t instanceof Error?t.message:String(t)}`)}},async findMany(g){let{model:r,where:c,limit:f,offset:b,sortBy:n}=g,t=m(r),o=a.getRepository(t);try{let d=u(r,c);return(await o.find({where:d,take:f||100,skip:b||0,order:n?.field?{[n.field]:n.direction==="desc"?"DESC":"ASC"}:void 0})).map(A=>i(A,r))}catch(d){throw new D(`Failed to find many ${r}: ${d instanceof Error?d.message:String(d)}`)}},async count(g){let{model:r,where:c}=g,f=m(r),b=a.getRepository(f);try{let n=u(r,c);return await b.count({where:n})}catch(n){throw new D(`Failed to count ${r}: ${n instanceof Error?n.message:String(n)}`)}},async updateMany(g){let{model:r,where:c,update:f}=g,b=m(r),n=a.getRepository(b);try{let t=u(r,c),o=p(f,r,"update");return(await n.update(t,o)).affected||0}catch(t){throw new D(`Failed to update many ${r}: ${t instanceof Error?t.message:String(t)}`)}},async deleteMany(g){let{model:r,where:c}=g,f=m(r),b=a.getRepository(f);try{let n=u(r,c);return(await b.delete(n)).affected||0}catch(n){throw new D(`Failed to delete many ${r}: ${n instanceof Error?n.message:String(n)}`)}},async createSchema(g,r){let c=P.join(process.cwd(),"typeorm"),f=P.join(c,"entities"),b=P.join(c,"migrations");N.existsSync(c)||N.mkdirSync(c,{recursive:!0}),N.existsSync(f)||N.mkdirSync(f,{recursive:!0}),N.existsSync(b)||N.mkdirSync(b,{recursive:!0});let n={User:`import { Column, Entity } from "typeorm";
@Entity("user")
export class User {
@Column("varchar", { primary: true, name: "id", length: 36 })
id: string;
@Column("text", { name: "name", nullable: false })
name: string;
@Column("varchar", { name: "email", length: 255, nullable: false })
email: string;
@Column("boolean", { name: "emailVerified", default: false })
emailVerified: boolean;
@Column("text", { name: "image", nullable: true })
image: string;
@Column("datetime", { name: "createdAt", nullable: false, default: () => "CURRENT_TIMESTAMP" })
createdAt: Date;
@Column("datetime", { name: "updatedAt", nullable: false, default: () => "CURRENT_TIMESTAMP" })
updatedAt: Date;
}
`,Account:`import { Column, Entity } from "typeorm";
@Entity("account")
export class Account {
@Column("varchar", { primary: true, name: "id", length: 36 })
id: string;
@Column("text", { name: "accountId", nullable: false })
accountId: string;
@Column("text", { name: "providerId", nullable: false })
providerId: string;
@Column("varchar", { name: "userId", length: 36, nullable: false })
userId: string;
@Column("text", { name: "accessToken", nullable: true })
accessToken: string;
@Column("text", { name: "refreshToken", nullable: true })
refreshToken: string;
@Column("text", { name: "idToken", nullable: true })
idToken: string;
@Column("datetime", { name: "accessTokenExpiresAt", nullable: true })
accessTokenExpiresAt: Date;
@Column("datetime", { name: "refreshTokenExpiresAt", nullable: true })
refreshTokenExpiresAt: Date;
@Column("text", { name: "scope", nullable: true })
scope: string;
@Column("text", { name: "password", nullable: true })
password: string;
@Column("datetime", { name: "createdAt", nullable: false, default: () => "CURRENT_TIMESTAMP" })
createdAt: Date;
@Column("datetime", { name: "updatedAt", nullable: false, default: () => "CURRENT_TIMESTAMP" })
updatedAt: Date;
}
`,Session:`import { Column, Entity } from "typeorm";
@Entity("session")
export class Session {
@Column("varchar", { primary: true, name: "id", length: 36 })
id: string;
@Column("datetime", { name: "expiresAt", nullable: false })
expiresAt: Date;
@Column("text", { name: "token", nullable: false })
token: string;
@Column("datetime", { name: "createdAt", nullable: false, default: () => "CURRENT_TIMESTAMP" })
createdAt: Date;
@Column("datetime", { name: "updatedAt", nullable: false, default: () => "CURRENT_TIMESTAMP" })
updatedAt: Date;
@Column("text", { name: "ipAddress", nullable: true })
ipAddress: string;
@Column("text", { name: "userAgent", nullable: true })
userAgent: string;
@Column("varchar", { name: "userId", length: 36, nullable: false })
userId: string;
}
`,Verification:`import { Column, Entity } from "typeorm";
@Entity("verification")
export class Verification {
@Column("varchar", { primary: true, name: "id", length: 36 })
id: string;
@Column("text", { name: "identifier", nullable: false })
identifier: string;
@Column("text", { name: "value", nullable: false })
value: string;
@Column("datetime", { name: "expiresAt", nullable: false })
expiresAt: Date;
@Column("datetime", { name: "createdAt", nullable: true })
createdAt: Date;
@Column("datetime", { name: "updatedAt", nullable: true })
updatedAt: Date;
}
`},t=["User","Account","Session","Verification"];for(let T of t){let A=P.join(f,`${T}.ts`);N.existsSync(A)||N.writeFileSync(A,n[T])}let o={User1743030454220:`import { type MigrationInterface, type QueryRunner, Table, TableIndex } from "typeorm";
export class User1743030454220 implements MigrationInterface {
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.createTable(
new Table({
name: "user",
columns: [
{
name: "id",
type: "varchar",
length: "36",
isPrimary: true,
},
{ name: "name", type: "text", isNullable: false },
{ name: "email", type: "varchar", length: "255", isNullable: false },
{ name: "emailVerified", type: "boolean", isNullable: false },
{ name: "image", type: "text", isNullable: true },
{ name: "createdAt", type: "datetime", isNullable: false },
{ name: "updatedAt", type: "datetime", isNullable: false },
],
}),
);
await queryRunner.createIndex(
"user",
new TableIndex({
name: "IDX_user_email",
columnNames: ["email"],
isUnique: true,
}),
);
}
public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.dropTable("user");
}
}
`,Account1743030465550:`import { type MigrationInterface, type QueryRunner, Table, TableForeignKey } from "typeorm";
export class Account1743030465550 implements MigrationInterface {
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.createTable(
new Table({
name: "account",
columns: [
{
name: "id",
type: "varchar",
length: "36",
isPrimary: true,
},
{ name: "accountId", type: "text", isNullable: false },
{ name: "providerId", type: "text", isNullable: false },
{ name: "userId", type: "varchar", length: "36", isNullable: false },
{ name: "accessToken", type: "text", isNullable: true },
{ name: "refreshToken", type: "text", isNullable: true },
{ name: "idToken", type: "text", isNullable: true },
{ name: "accessTokenExpiresAt", type: "datetime", isNullable: true },
{ name: "refreshTokenExpiresAt", type: "datetime", isNullable: true },
{ name: "scope", type: "text", isNullable: true },
{ name: "password", type: "text", isNullable: true },
{ name: "createdAt", type: "datetime", isNullable: false },
{ name: "updatedAt", type: "datetime", isNullable: false },
],
}),
);
await queryRunner.createForeignKey(
"account",
new TableForeignKey({
name: "FK_account_userId_user_id",
columnNames: ["userId"],
referencedColumnNames: ["id"],
referencedTableName: "user",
onDelete: "CASCADE",
}),
);
}
public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.dropTable("account");
}
}
`,Verification1743030486793:`import { type MigrationInterface, type QueryRunner, Table } from "typeorm";
export class Verification1743030486793 implements MigrationInterface {
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.createTable(
new Table({
name: "verification",
columns: [
{
name: "id",
type: "varchar",
length: "36",
isPrimary: true,
},
{ name: "identifier", type: "text", isNullable: false },
{ name: "value", type: "text", isNullable: false },
{ name: "expiresAt", type: "datetime", isNullable: false },
{ name: "createdAt", type: "datetime", isNullable: true },
{ name: "updatedAt", type: "datetime", isNullable: true },
],
}),
);
}
public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.dropTable("verification");
}
}
`,Session1743030537958:`import {
type MigrationInterface,
type QueryRunner,
Table,
TableForeignKey,
TableIndex,
} from "typeorm";
export class Session1743030537958 implements MigrationInterface {
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.createTable(
new Table({
name: "session",
columns: [
{
name: "id",
type: "varchar",
length: "36",
isPrimary: true,
},
{ name: "expiresAt", type: "datetime", isNullable: false },
{ name: "token", type: "varchar", length: "255" },
{ name: "createdAt", type: "datetime", isNullable: false },
{ name: "updatedAt", type: "datetime", isNullable: false },
{ name: "ipAddress", type: "text", isNullable: true },
{ name: "userAgent", type: "text", isNullable: true },
{ name: "userId", type: "varchar", length: "36", isNullable: false },
],
}),
);
await queryRunner.createIndex(
"session",
new TableIndex({
name: "IDX_session_token",
columnNames: ["token"],
isUnique: true,
}),
);
await queryRunner.createForeignKey(
"session",
new TableForeignKey({
name: "FK_session_userId_user_id",
columnNames: ["userId"],
referencedColumnNames: ["id"],
referencedTableName: "user",
onDelete: "CASCADE",
}),
);
}
public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.dropTable("session");
}
}
`},d=["User1743030454220","Account1743030465550","Verification1743030486793","Session1743030537958"];for(let T of d){let A=P.join(b,`${T}.ts`);N.existsSync(A)||N.writeFileSync(A,o[T])}return{code:`// TypeORM schema files created successfully
// Entities: ${t.join(", ")}
// Migrations: ${d.join(", ")}`,path:r||P.join(c,"schema-info.txt")}}}},"typeormAdapter");import{Table as te,TableIndex as ne}from"typeorm";var V=class{static{l(this,"User1743030454220")}async up(e){await e.createTable(new te({name:"user",columns:[{name:"id",type:"varchar",length:"36",isPrimary:!0},{name:"name",type:"text",isNullable:!1},{name:"email",type:"varchar",length:"255",isNullable:!1},{name:"emailVerified",type:"boolean",isNullable:!1},{name:"image",type:"text",isNullable:!0},{name:"createdAt",type:"datetime",isNullable:!1},{name:"updatedAt",type:"datetime",isNullable:!1}]})),await e.createIndex("user",new ne({name:"IDX_user_email",columnNames:["email"],isUnique:!0}))}async down(e){await e.dropTable("user")}};import{Table as ae,TableForeignKey as re}from"typeorm";var K=class{static{l(this,"Account1743030465550")}async up(e){await e.createTable(new ae({name:"account",columns:[{name:"id",type:"varchar",length:"36",isPrimary:!0},{name:"accountId",type:"text",isNullable:!1},{name:"providerId",type:"text",isNullable:!1},{name:"userId",type:"varchar",length:"36",isNullable:!1},{name:"accessToken",type:"text",isNullable:!0},{name:"refreshToken",type:"text",isNullable:!0},{name:"idToken",type:"text",isNullable:!0},{name:"accessTokenExpiresAt",type:"datetime",isNullable:!0},{name:"refreshTokenExpiresAt",type:"datetime",isNullable:!0},{name:"scope",type:"text",isNullable:!0},{name:"password",type:"text",isNullable:!0},{name:"createdAt",type:"datetime",isNullable:!1},{name:"updatedAt",type:"datetime",isNullable:!1}]})),await e.createForeignKey("account",new re({name:"FK_account_userId_user_id",columnNames:["userId"],referencedColumnNames:["id"],referencedTableName:"user",onDelete:"CASCADE"}))}async down(e){await e.dropTable("account")}};import{Table as ie}from"typeorm";var Q=class{static{l(this,"Verification1743030486793")}async up(e){await e.createTable(new ie({name:"verification",columns:[{name:"id",type:"varchar",length:"36",isPrimary:!0},{name:"identifier",type:"text",isNullable:!1},{name:"value",type:"text",isNullable:!1},{name:"expiresAt",type:"datetime",isNullable:!1},{name:"createdAt",type:"datetime",isNullable:!0},{name:"updatedAt",type:"datetime",isNullable:!0}]}))}async down(e){await e.dropTable("verification")}};import{Table as oe,TableForeignKey as le,TableIndex as se}from"typeorm";var X=class{static{l(this,"Session1743030537958")}async up(e){await e.createTable(new oe({name:"session",columns:[{name:"id",type:"varchar",length:"36",isPrimary:!0},{name:"expiresAt",type:"datetime",isNullable:!1},{name:"token",type:"varchar",length:"255"},{name:"createdAt",type:"datetime",isNullable:!1},{name:"updatedAt",type:"datetime",isNullable:!1},{name:"ipAddress",type:"text",isNullable:!0},{name:"userAgent",type:"text",isNullable:!0},{name:"userId",type:"varchar",length:"36",isNullable:!1}]})),await e.createIndex("session",new se({name:"IDX_session_token",columnNames:["token"],isUnique:!0})),await e.createForeignKey("session",new le({name:"FK_session_userId_user_id",columnNames:["userId"],referencedColumnNames:["id"],referencedTableName:"user",onDelete:"CASCADE"}))}async down(e){await e.dropTable("session")}};var je=[V,K,Q,X];import{Column as R,Entity as ue}from"typeorm";function x(a,e,s,y){var p=arguments.length,i=p<3?e:y===null?y=Object.getOwnPropertyDescriptor(e,s):y,u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(a,e,s,y);else for(var m=a.length-1;m>=0;m--)(u=a[m])&&(i=(p<3?u(i):p>3?u(e,s,i):u(e,s))||i);return p>3&&i&&Object.defineProperty(e,s,i),i}l(x,"_ts_decorate");function v(a,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(a,e)}l(v,"_ts_metadata");var h=class{static{l(this,"Account")}id;accountId;providerId;userId;accessToken;refreshToken;idToken;accessTokenExpiresAt;refreshTokenExpiresAt;scope;password;createdAt;updatedAt};x([R("varchar",{primary:!0,name:"id",length:36}),v("design:type",String)],h.prototype,"id",void 0);x([R("text",{name:"accountId",nullable:!1}),v("design:type",String)],h.prototype,"accountId",void 0);x([R("text",{name:"providerId",nullable:!1}),v("design:type",String)],h.prototype,"providerId",void 0);x([R("varchar",{name:"userId",length:36,nullable:!1}),v("design:type",String)],h.prototype,"userId",void 0);x([R("text",{name:"accessToken",nullable:!0}),v("design:type",String)],h.prototype,"accessToken",void 0);x([R("text",{name:"refreshToken",nullable:!0}),v("design:type",String)],h.prototype,"refreshToken",void 0);x([R("text",{name:"idToken",nullable:!0}),v("design:type",String)],h.prototype,"idToken",void 0);x([R("datetime",{name:"accessTokenExpiresAt",nullable:!0}),v("design:type",typeof Date>"u"?Object:Date)],h.prototype,"accessTokenExpiresAt",void 0);x([R("datetime",{name:"refreshTokenExpiresAt",nullable:!0}),v("design:type",typeof Date>"u"?Object:Date)],h.prototype,"refreshTokenExpiresAt",void 0);x([R("text",{name:"scope",nullable:!0}),v("design:type",String)],h.prototype,"scope",void 0);x([R("text",{name:"password",nullable:!0}),v("design:type",String)],h.prototype,"password",void 0);x([R("datetime",{name:"createdAt",nullable:!1,default:l(()=>"CURRENT_TIMESTAMP","default")}),v("design:type",typeof Date>"u"?Object:Date)],h.prototype,"createdAt",void 0);x([R("datetime",{name:"updatedAt",nullable:!1,default:l(()=>"CURRENT_TIMESTAMP","default")}),v("design:type",typeof Date>"u"?Object:Date)],h.prototype,"updatedAt",void 0);h=x([ue("account")],h);import{Column as M,Entity as de}from"typeorm";function S(a,e,s,y){var p=arguments.length,i=p<3?e:y===null?y=Object.getOwnPropertyDescriptor(e,s):y,u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(a,e,s,y);else for(var m=a.length-1;m>=0;m--)(u=a[m])&&(i=(p<3?u(i):p>3?u(e,s,i):u(e,s))||i);return p>3&&i&&Object.defineProperty(e,s,i),i}l(S,"_ts_decorate");function _(a,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(a,e)}l(_,"_ts_metadata");var w=class{static{l(this,"Session")}id;expiresAt;token;createdAt;updatedAt;ipAddress;userAgent;userId};S([M("varchar",{primary:!0,name:"id",length:36}),_("design:type",String)],w.prototype,"id",void 0);S([M("datetime",{name:"expiresAt",nullable:!1}),_("design:type",typeof Date>"u"?Object:Date)],w.prototype,"expiresAt",void 0);S([M("text",{name:"token",nullable:!1}),_("design:type",String)],w.prototype,"token",void 0);S([M("datetime",{name:"createdAt",nullable:!1,default:l(()=>"CURRENT_TIMESTAMP","default")}),_("design:type",typeof Date>"u"?Object:Date)],w.prototype,"createdAt",void 0);S([M("datetime",{name:"updatedAt",nullable:!1,default:l(()=>"CURRENT_TIMESTAMP","default")}),_("design:type",typeof Date>"u"?Object:Date)],w.prototype,"updatedAt",void 0);S([M("text",{name:"ipAddress",nullable:!0}),_("design:type",String)],w.prototype,"ipAddress",void 0);S([M("text",{name:"userAgent",nullable:!0}),_("design:type",String)],w.prototype,"userAgent",void 0);S([M("varchar",{name:"userId",length:36,nullable:!1}),_("design:type",String)],w.prototype,"userId",void 0);w=S([de("session")],w);import{Column as j,Entity as me}from"typeorm";function O(a,e,s,y){var p=arguments.length,i=p<3?e:y===null?y=Object.getOwnPropertyDescriptor(e,s):y,u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(a,e,s,y);else for(var m=a.length-1;m>=0;m--)(u=a[m])&&(i=(p<3?u(i):p>3?u(e,s,i):u(e,s))||i);return p>3&&i&&Object.defineProperty(e,s,i),i}l(O,"_ts_decorate");function k(a,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(a,e)}l(k,"_ts_metadata");var I=class{static{l(this,"User")}id;name;email;emailVerified;image;createdAt;updatedAt};O([j("varchar",{primary:!0,name:"id",length:36}),k("design:type",String)],I.prototype,"id",void 0);O([j("text",{name:"name",nullable:!1}),k("design:type",String)],I.prototype,"name",void 0);O([j("varchar",{name:"email",length:255,nullable:!1}),k("design:type",String)],I.prototype,"email",void 0);O([j("boolean",{name:"emailVerified",default:!1}),k("design:type",Boolean)],I.prototype,"emailVerified",void 0);O([j("text",{name:"image",nullable:!0}),k("design:type",String)],I.prototype,"image",void 0);O([j("datetime",{name:"createdAt",nullable:!1,default:l(()=>"CURRENT_TIMESTAMP","default")}),k("design:type",typeof Date>"u"?Object:Date)],I.prototype,"createdAt",void 0);O([j("datetime",{name:"updatedAt",nullable:!1,default:l(()=>"CURRENT_TIMESTAMP","default")}),k("design:type",typeof Date>"u"?Object:Date)],I.prototype,"updatedAt",void 0);I=O([me("user")],I);import{Column as q,Entity as ce}from"typeorm";function F(a,e,s,y){var p=arguments.length,i=p<3?e:y===null?y=Object.getOwnPropertyDescriptor(e,s):y,u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(a,e,s,y);else for(var m=a.length-1;m>=0;m--)(u=a[m])&&(i=(p<3?u(i):p>3?u(e,s,i):u(e,s))||i);return p>3&&i&&Object.defineProperty(e,s,i),i}l(F,"_ts_decorate");function $(a,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(a,e)}l($,"_ts_metadata");var E=class{static{l(this,"Verification")}id;identifier;value;expiresAt;createdAt;updatedAt};F([q("varchar",{primary:!0,name:"id",length:36}),$("design:type",String)],E.prototype,"id",void 0);F([q("text",{name:"identifier",nullable:!1}),$("design:type",String)],E.prototype,"identifier",void 0);F([q("text",{name:"value",nullable:!1}),$("design:type",String)],E.prototype,"value",void 0);F([q("datetime",{name:"expiresAt",nullable:!1}),$("design:type",typeof Date>"u"?Object:Date)],E.prototype,"expiresAt",void 0);F([q("datetime",{name:"createdAt",nullable:!0}),$("design:type",typeof Date>"u"?Object:Date)],E.prototype,"createdAt",void 0);F([q("datetime",{name:"updatedAt",nullable:!0}),$("design:type",typeof Date>"u"?Object:Date)],E.prototype,"updatedAt",void 0);E=F([ce("verification")],E);var et=[h,w,I,E];export{et as entities,je as migrations,ge as typeormAdapter};