UNPKG

@hedystia/better-auth-typeorm

Version:

<div align="center"> <p> <strong>📦 @hedystia/better-auth-typeorm</strong> </p>

2 lines (1 loc) • 6.79 kB
var D=Object.defineProperty;var o=(n,e)=>D(n,"name",{value:e,configurable:!0});import{Column as c,Entity as S}from"typeorm";function f(n,e,a,i){var r=arguments.length,t=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,a):i,d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")t=Reflect.decorate(n,e,a,i);else for(var l=n.length-1;l>=0;l--)(d=n[l])&&(t=(r<3?d(t):r>3?d(e,a,t):d(e,a))||t);return r>3&&t&&Object.defineProperty(e,a,t),t}o(f,"_ts_decorate");function s(n,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,e)}o(s,"_ts_metadata");var p=class{static{o(this,"Account")}id;accountId;providerId;userId;accessToken;refreshToken;idToken;accessTokenExpiresAt;refreshTokenExpiresAt;scope;password;createdAt;updatedAt};f([c("varchar",{primary:!0,name:"id",length:36}),s("design:type",String)],p.prototype,"id",void 0);f([c("text",{name:"accountId",nullable:!1}),s("design:type",String)],p.prototype,"accountId",void 0);f([c("text",{name:"providerId",nullable:!1}),s("design:type",String)],p.prototype,"providerId",void 0);f([c("varchar",{name:"userId",length:36,nullable:!1}),s("design:type",String)],p.prototype,"userId",void 0);f([c("text",{name:"accessToken",nullable:!0}),s("design:type",String)],p.prototype,"accessToken",void 0);f([c("text",{name:"refreshToken",nullable:!0}),s("design:type",String)],p.prototype,"refreshToken",void 0);f([c("text",{name:"idToken",nullable:!0}),s("design:type",String)],p.prototype,"idToken",void 0);f([c("datetime",{name:"accessTokenExpiresAt",nullable:!0}),s("design:type",typeof Date>"u"?Object:Date)],p.prototype,"accessTokenExpiresAt",void 0);f([c("datetime",{name:"refreshTokenExpiresAt",nullable:!0}),s("design:type",typeof Date>"u"?Object:Date)],p.prototype,"refreshTokenExpiresAt",void 0);f([c("text",{name:"scope",nullable:!0}),s("design:type",String)],p.prototype,"scope",void 0);f([c("text",{name:"password",nullable:!0}),s("design:type",String)],p.prototype,"password",void 0);f([c("datetime",{name:"createdAt",nullable:!1,default:o(()=>"CURRENT_TIMESTAMP","default")}),s("design:type",typeof Date>"u"?Object:Date)],p.prototype,"createdAt",void 0);f([c("datetime",{name:"updatedAt",nullable:!1,default:o(()=>"CURRENT_TIMESTAMP","default")}),s("design:type",typeof Date>"u"?Object:Date)],p.prototype,"updatedAt",void 0);p=f([S("account")],p);import{Column as v,Entity as O}from"typeorm";function g(n,e,a,i){var r=arguments.length,t=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,a):i,d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")t=Reflect.decorate(n,e,a,i);else for(var l=n.length-1;l>=0;l--)(d=n[l])&&(t=(r<3?d(t):r>3?d(e,a,t):d(e,a))||t);return r>3&&t&&Object.defineProperty(e,a,t),t}o(g,"_ts_decorate");function b(n,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,e)}o(b,"_ts_metadata");var u=class{static{o(this,"Session")}id;expiresAt;token;createdAt;updatedAt;ipAddress;userAgent;userId};g([v("varchar",{primary:!0,name:"id",length:36}),b("design:type",String)],u.prototype,"id",void 0);g([v("datetime",{name:"expiresAt",nullable:!1}),b("design:type",typeof Date>"u"?Object:Date)],u.prototype,"expiresAt",void 0);g([v("text",{name:"token",nullable:!1}),b("design:type",String)],u.prototype,"token",void 0);g([v("datetime",{name:"createdAt",nullable:!1,default:o(()=>"CURRENT_TIMESTAMP","default")}),b("design:type",typeof Date>"u"?Object:Date)],u.prototype,"createdAt",void 0);g([v("datetime",{name:"updatedAt",nullable:!1,default:o(()=>"CURRENT_TIMESTAMP","default")}),b("design:type",typeof Date>"u"?Object:Date)],u.prototype,"updatedAt",void 0);g([v("text",{name:"ipAddress",nullable:!0}),b("design:type",String)],u.prototype,"ipAddress",void 0);g([v("text",{name:"userAgent",nullable:!0}),b("design:type",String)],u.prototype,"userAgent",void 0);g([v("varchar",{name:"userId",length:36,nullable:!1}),b("design:type",String)],u.prototype,"userId",void 0);u=g([O("session")],u);import{Column as T,Entity as E}from"typeorm";function A(n,e,a,i){var r=arguments.length,t=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,a):i,d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")t=Reflect.decorate(n,e,a,i);else for(var l=n.length-1;l>=0;l--)(d=n[l])&&(t=(r<3?d(t):r>3?d(e,a,t):d(e,a))||t);return r>3&&t&&Object.defineProperty(e,a,t),t}o(A,"_ts_decorate");function R(n,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,e)}o(R,"_ts_metadata");var m=class{static{o(this,"User")}id;name;email;emailVerified;image;createdAt;updatedAt};A([T("varchar",{primary:!0,name:"id",length:36}),R("design:type",String)],m.prototype,"id",void 0);A([T("text",{name:"name",nullable:!1}),R("design:type",String)],m.prototype,"name",void 0);A([T("varchar",{name:"email",length:255,nullable:!1}),R("design:type",String)],m.prototype,"email",void 0);A([T("boolean",{name:"emailVerified",default:!1}),R("design:type",Boolean)],m.prototype,"emailVerified",void 0);A([T("text",{name:"image",nullable:!0}),R("design:type",String)],m.prototype,"image",void 0);A([T("datetime",{name:"createdAt",nullable:!1,default:o(()=>"CURRENT_TIMESTAMP","default")}),R("design:type",typeof Date>"u"?Object:Date)],m.prototype,"createdAt",void 0);A([T("datetime",{name:"updatedAt",nullable:!1,default:o(()=>"CURRENT_TIMESTAMP","default")}),R("design:type",typeof Date>"u"?Object:Date)],m.prototype,"updatedAt",void 0);m=A([E("user")],m);import{Column as j,Entity as _}from"typeorm";function x(n,e,a,i){var r=arguments.length,t=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,a):i,d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")t=Reflect.decorate(n,e,a,i);else for(var l=n.length-1;l>=0;l--)(d=n[l])&&(t=(r<3?d(t):r>3?d(e,a,t):d(e,a))||t);return r>3&&t&&Object.defineProperty(e,a,t),t}o(x,"_ts_decorate");function h(n,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,e)}o(h,"_ts_metadata");var y=class{static{o(this,"Verification")}id;identifier;value;expiresAt;createdAt;updatedAt};x([j("varchar",{primary:!0,name:"id",length:36}),h("design:type",String)],y.prototype,"id",void 0);x([j("text",{name:"identifier",nullable:!1}),h("design:type",String)],y.prototype,"identifier",void 0);x([j("text",{name:"value",nullable:!1}),h("design:type",String)],y.prototype,"value",void 0);x([j("datetime",{name:"expiresAt",nullable:!1}),h("design:type",typeof Date>"u"?Object:Date)],y.prototype,"expiresAt",void 0);x([j("datetime",{name:"createdAt",nullable:!0}),h("design:type",typeof Date>"u"?Object:Date)],y.prototype,"createdAt",void 0);x([j("datetime",{name:"updatedAt",nullable:!0}),h("design:type",typeof Date>"u"?Object:Date)],y.prototype,"updatedAt",void 0);y=x([_("verification")],y);var L=[p,u,m,y];export{L as entities};