gemi 0.4.23 → 0.4.25
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/app/createFlatViewRoutes.d.ts.map +1 -1
- package/dist/app/index.js +2 -2
- package/dist/auth/adapters/types.d.ts +13 -0
- package/dist/auth/adapters/types.d.ts.map +1 -1
- package/dist/chunk-61973614facb50a8.js +2 -0
- package/dist/email/index.js +1 -1
- package/dist/http/ViewRouter.d.ts +8 -6
- package/dist/http/ViewRouter.d.ts.map +1 -1
- package/dist/http/index.js +1 -1
- package/dist/kernel/index.js +1 -1
- package/package.json +1 -1
- package/dist/client/useUser.d.ts +0 -2
- package/dist/client/useUser.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createFlatViewRoutes.d.ts","sourceRoot":"","sources":["../../app/createFlatViewRoutes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEjE,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,YAAY;UAG7C,aAAa,EAAE;gBAAc,CAAC,MAAM,GAAG,GAAG,CAAC,EAAE;
|
|
1
|
+
{"version":3,"file":"createFlatViewRoutes.d.ts","sourceRoot":"","sources":["../../app/createFlatViewRoutes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEjE,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,YAAY;UAG7C,aAAa,EAAE;gBAAc,CAAC,MAAM,GAAG,GAAG,CAAC,EAAE;GA+CxD"}
|
package/dist/app/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import"../http/index.js";import{f as D1,k as w6,m as $2} from"../chunk-
|
|
2
|
+
import"../http/index.js";import{f as D1,k as w6,m as $2} from"../chunk-61973614facb50a8.js";import{p as _A,q as l1} from"../chunk-9350baa090b5a424.js";import{r as J2,s as G3} from"../chunk-06eebef7eb056baa.js";import{t as I1,v as i0,x as H6} from"../chunk-c8f1115d77efc1c0.js";var K3=l1((s5,Z3)=>{var I6=function(w){return typeof w=="function"?w:(H)=>H.$extends(w)},k6=function(w){return w},T6=function(...w){return(H)=>H},N=function(w,H){let X=new RegExp(`\\x1b\\[${H}m`,"g"),A=`\x1B[${w}m`,V=`\x1B[${H}m`;return function(W){return!L4.enabled||W==null?W:A+(~(""+W).indexOf(V)?W.replace(X,V+A):W)+V}},l6=function(w){let H={color:F3[u6++%F3.length],enabled:e0.enabled(w),namespace:w,log:e0.log,extend:()=>{}};return new Proxy((...A)=>{let{enabled:V,namespace:W,color:$,log:J}=H;if(A.length!==0&&t0.push([W,...A]),t0.length>p6&&t0.shift(),e0.enabled(W)||V){let Y=A.map((K)=>typeof K=="string"?K:s6(K)),Z=`+${Date.now()-O3}ms`;O3=Date.now(),globalThis.DEBUG_COLORS?J(F2[$](J0(W)),...Y,F2[$](Z)):J(W,...Y,Z)}},{get:(A,V)=>H[V],set:(A,V,W)=>H[V]=W})},s6=function(w,H=2){let X=new Set;return JSON.stringify(w,(A,V)=>{if(typeof V=="object"&&V!==null){if(X.has(V))return"[Circular *]";X.add(V)}else if(typeof V=="bigint")return V.toString();return V},H)},a6=function(w=7500){let H=t0.map(([X,...A])=>`${X} ${A.map((V)=>typeof V=="string"?V:JSON.stringify(V)).join(" ")}`).join(`
|
|
3
3
|
`);return H.length<w?H:H.slice(-w)},o6=function(){t0.length=0},n6=function(){let w=process.env.PRISMA_QUERY_ENGINE_LIBRARY;if(!(w&&i6.default.existsSync(w))&&process.arch==="ia32")throw new Error('The default query engine type (Node-API, "library") is currently not supported for 32bit Node. Please set `engineType = "binary"` in the "generator" block of your "schema.prisma" file (or use the environment variables "PRISMA_CLIENT_ENGINE_TYPE=binary" and/or "PRISMA_CLI_QUERY_ENGINE_TYPE=binary".)')},t6=function(w,H){let X=H==="url";return w.includes("windows")?X?"query_engine.dll.node":`query_engine-${w}.dll.node`:w.includes("darwin")?X?`${k1}.dylib.node`:`${k1}-${w}.dylib.node`:X?`${k1}.so.node`:`${k1}-${w}.so.node`},A0=function(w){return Object.assign(w,{optional:()=>H7(w),and:(H)=>g(w,H),or:(H)=>X7(w,H),select:(H)=>H===void 0?L3(w):L3(H,w)})},H7=function(w){return A0({[x0]:()=>({match:(H)=>{let X={},A=(V,W)=>{X[V]=W};return H===void 0?(N0(w).forEach((V)=>A(V,void 0)),{matched:!0,selections:X}):{matched:G0(w,H,A),selections:X}},getSelectionKeys:()=>N0(w),matcherType:"optional"})})},g=function(...w){return A0({[x0]:()=>({match:(H)=>{let X={},A=(V,W)=>{X[V]=W};return{matched:w.every((V)=>G0(V,H,A)),selections:X}},getSelectionKeys:()=>V1(w,N0),matcherType:"and"})})},X7=function(...w){return A0({[x0]:()=>({match:(H)=>{let X={},A=(V,W)=>{X[V]=W};return V1(w,N0).forEach((V)=>A(V,void 0)),{matched:w.some((V)=>G0(V,H,A)),selections:X}},getSelectionKeys:()=>V1(w,N0),matcherType:"or"})})},S=function(w){return{[x0]:()=>({match:(H)=>({matched:!!w(H)})})}},L3=function(...w){let H=typeof w[0]=="string"?w[0]:void 0,X=w.length===2?w[1]:typeof w[0]=="string"?void 0:w[0];return A0({[x0]:()=>({match:(A)=>{let V={[H??g1]:A};return{matched:X===void 0||G0(X,A,(W,$)=>{V[W]=$}),selections:V}},getSelectionKeys:()=>[H??g1].concat(X===void 0?[]:N0(X))})})},K0=function(w){return typeof w=="number"},T0=function(w){return typeof w=="string"},C0=function(w){return typeof w=="bigint"},a1=function(w){return new A7(w,U2)},Y2=function(w,...H){$7.warn()&&console.warn(`${W7.warn} ${w}`,...H)};async function Z7(){let w=_2.default.platform(),H=process.arch;if(w==="freebsd"){let $=await E1("freebsd-version");if($&&$.trim().length>0){let J=/^(\d+)\.?/.exec($);if(J)return{platform:"freebsd",targetDistro:`freebsd${J[1]}`,arch:H}}}if(w!=="linux")return{platform:w,arch:H};let X=await z7(),A=await U7(),V=G7({arch:H,archFromUname:A,familyDistro:X.familyDistro}),{libssl:W}=await B7(V);return{platform:"linux",libssl:W,arch:H,archFromUname:A,...X}}var K7=function(w){let H=/^ID="?([^"\n]*)"?$/im,X=/^ID_LIKE="?([^"\n]*)"?$/im,A=H.exec(w),V=A&&A[1]&&A[1].toLowerCase()||"",W=X.exec(w),$=W&&W[1]&&W[1].toLowerCase()||"",J=a1({id:V,idLike:$}).with({id:"alpine"},({id:Y})=>({targetDistro:"musl",familyDistro:Y,originalDistro:Y})).with({id:"raspbian"},({id:Y})=>({targetDistro:"arm",familyDistro:"debian",originalDistro:Y})).with({id:"nixos"},({id:Y})=>({targetDistro:"nixos",originalDistro:Y,familyDistro:"nixos"})).with({id:"debian"},{id:"ubuntu"},({id:Y})=>({targetDistro:"debian",familyDistro:"debian",originalDistro:Y})).with({id:"rhel"},{id:"centos"},{id:"fedora"},({id:Y})=>({targetDistro:"rhel",familyDistro:"rhel",originalDistro:Y})).when(({idLike:Y})=>Y.includes("debian")||Y.includes("ubuntu"),({id:Y})=>({targetDistro:"debian",familyDistro:"debian",originalDistro:Y})).when(({idLike:Y})=>V==="arch"||Y.includes("arch"),({id:Y})=>({targetDistro:"debian",familyDistro:"arch",originalDistro:Y})).when(({idLike:Y})=>Y.includes("centos")||Y.includes("fedora")||Y.includes("rhel")||Y.includes("suse"),({id:Y})=>({targetDistro:"rhel",familyDistro:"rhel",originalDistro:Y})).otherwise(({id:Y})=>({targetDistro:void 0,familyDistro:void 0,originalDistro:Y}));return o(`Found distro info:
|
|
4
4
|
${JSON.stringify(J,null,2)}`),J};async function z7(){let w="/etc/os-release";try{let H=await Q4.default.readFile(w,{encoding:"utf-8"});return K7(H)}catch{return{targetDistro:void 0,familyDistro:void 0,originalDistro:void 0}}}var j7=function(w){let H=/^OpenSSL\s(\d+\.\d+)\.\d+/.exec(w);if(H){let X=`${H[1]}.x`;return U4(X)}},_3=function(w){let H=/libssl\.so\.(\d)(\.\d)?/.exec(w);if(H){let X=`${H[1]}${H[2]??".0"}.x`;return U4(X)}},U4=function(w){let H=(()=>{if(D4(w))return w;let X=w.split(".");return X[1]="0",X.join(".")})();if(Y7.includes(H))return H},G7=function(w){return a1(w).with({familyDistro:"musl"},()=>(o('Trying platform-specific paths for "alpine"'),["/lib"])).with({familyDistro:"debian"},({archFromUname:H})=>(o('Trying platform-specific paths for "debian" (and "ubuntu")'),[`/usr/lib/${H}-linux-gnu`,`/lib/${H}-linux-gnu`])).with({familyDistro:"rhel"},()=>(o('Trying platform-specific paths for "rhel"'),["/lib64","/usr/lib64"])).otherwise(({familyDistro:H,arch:X,archFromUname:A})=>(o(`Don't know any platform-specific paths for "${H}" on ${X} (${A})`),[]))};async function B7(w){let H='grep -v "libssl.so.0"',X=await Q3(w);if(X){o(`Found libssl.so file using platform-specific paths: ${X}`);let W=_3(X);if(o(`The parsed libssl version is: ${W}`),W)return{libssl:W,strategy:"libssl-specific-path"}}o('Falling back to "ldconfig" and other generic paths');let A=await E1(`ldconfig -p | sed "s/.*=>s*//" | sed "s|.*/||" | grep libssl | sort | ${H}`);if(A||(A=await Q3(["/lib64","/usr/lib64","/lib"])),A){o(`Found libssl.so file using "ldconfig" or other generic paths: ${A}`);let W=_3(A);if(o(`The parsed libssl version is: ${W}`),W)return{libssl:W,strategy:"ldconfig"}}let V=await E1("openssl version -v");if(V){o(`Found openssl binary with version: ${V}`);let W=j7(V);if(o(`The parsed openssl version is: ${W}`),W)return{libssl:W,strategy:"openssl-binary"}}return o("Couldn't find any version of libssl or OpenSSL in the system"),{}}async function Q3(w){for(let H of w){let X=await F7(H);if(X)return X}}async function F7(w){try{return(await Q4.default.readdir(w)).find((H)=>H.startsWith("libssl.so.")&&!H.startsWith("libssl.so.0"))}catch(H){if(H.code==="ENOENT")return;throw H}}async function u2(){let{binaryTarget:w}=await x4();return w}var O7=function(w){return w.binaryTarget!==void 0};async function L7(){let{memoized:w,...H}=await x4();return H}async function x4(){if(O7(T1))return Promise.resolve({...T1,memoized:!0});let w=await Z7(),H=_7(w);return T1={...w,binaryTarget:H},{...T1,memoized:!1}}var _7=function(w){let{platform:H,arch:X,archFromUname:A,libssl:V,targetDistro:W,familyDistro:$,originalDistro:J}=w;H==="linux"&&!["x64","arm64"].includes(X)&&Y2(`Prisma only officially supports Linux on amd64 (x86_64) and arm64 (aarch64) system architectures (detected "${X}" instead). If you are using your own custom Prisma engines, you can ignore this warning, as long as you've compiled the engines for your system architecture "${A}".`);let Y="1.1.x";if(H==="linux"&&V===void 0){let K=a1({familyDistro:$}).with({familyDistro:"debian"},()=>"Please manually install OpenSSL via `apt-get update -y && apt-get install -y openssl` and try installing Prisma again. If you're running Prisma on Docker, add this command to your Dockerfile, or switch to an image that already has OpenSSL installed.").otherwise(()=>"Please manually install OpenSSL and try installing Prisma again.");Y2(`Prisma failed to detect the libssl/openssl version to use, and may not work as expected. Defaulting to "openssl-${Y}".
|
|
5
5
|
${K}`)}let Z="debian";if(H==="linux"&&W===void 0&&o(`Distro is "${J}". Falling back to Prisma engines built for "${Z}".`),H==="darwin"&&X==="arm64")return"darwin-arm64";if(H==="darwin")return"darwin";if(H==="win32")return"windows";if(H==="freebsd")return W;if(H==="openbsd")return"openbsd";if(H==="netbsd")return"netbsd";if(H==="linux"&&W==="nixos")return"linux-nixos";if(H==="linux"&&X==="arm64")return`${W==="musl"?"linux-musl-arm64":"linux-arm64"}-openssl-${V||Y}`;if(H==="linux"&&X==="arm")return`linux-arm-openssl-${V||Y}`;if(H==="linux"&&W==="musl"){let K="linux-musl";return!V||D4(V)?K:`${K}-openssl-${V}`}return H==="linux"&&W&&V?`${W}-openssl-${V}`:(H!=="linux"&&Y2(`Prisma detected unknown OS "${H}" and may not work as expected. Defaulting to "linux".`),V?`${Z}-openssl-${V}`:W?`${W}-openssl-${Y}`:`${Z}-openssl-${Y}`)};async function Q7(w){try{return await w()}catch{return}}var E1=function(w){return Q7(async()=>{let H=await J7(w);return o(`Command "${w}" successfully returned "${H.stdout}"`),H.stdout})};async function U7(){return typeof _2.default.machine=="function"?_2.default.machine():(await E1("uname -m"))?.trim()}var D4=function(w){return w.startsWith("1.")},D7=function(w){return x7.default(w,w,{fallback:H0})},I7=function(){return f.default.join(__dirname,"../")},k7=function(w){if(process.platform==="win32")return;let H=U3.default.statSync(w),X=H.mode|64|8|1;if(H.mode===X){x3(`Execution permissions of ${w} are fine`);return}let A=X.toString(8).slice(-3);x3(`Have to call chmodPlusX on ${w}`),U3.default.chmodSync(w,A)},T7=function(w){let H=w.e,X=(J)=>`Prisma cannot find the required \`${J}\` system library in your system`,A=H.message.includes("cannot open shared object file"),V=`Please refer to the documentation about Prisma's system requirements: ${D7("https://pris.ly/d/system-requirements")}`,W=`Unable to require(\`${z1(w.id)}\`).`,$=a1({message:H.message,code:H.code}).with({code:"ENOENT"},()=>"File does not exist.").when(({message:J})=>A&&J.includes("libz"),()=>`${X("libz")}. Please install it and try again.`).when(({message:J})=>A&&J.includes("libgcc_s"),()=>`${X("libgcc_s")}. Please install it and try again.`).when(({message:J})=>A&&J.includes("libssl"),()=>{let J=w.platformInfo.libssl?`openssl-${w.platformInfo.libssl}`:"openssl";return`${X("libssl")}. Please install ${J} and try again.`}).when(({message:J})=>J.includes("GLIBC"),()=>`Prisma has detected an incompatible version of the \`glibc\` C standard library installed in your system. This probably means your system may be too old to run Prisma. ${V}`).when(({message:J})=>w.platformInfo.platform==="linux"&&J.includes("symbol not found"),()=>`The Prisma engines are not compatible with your system ${w.platformInfo.originalDistro} on (${w.platformInfo.archFromUname}) which uses the \`${w.platformInfo.binaryTarget}\` binaryTarget by default. ${V}`).otherwise(()=>`The Prisma engines do not seem to be compatible with your system. ${V}`);return`${W}
|
|
@@ -139,4 +139,4 @@ decimal.js/decimal.mjs:
|
|
|
139
139
|
* Copyright (c) 2022 Michael Mclaughlin <M8ch88l@gmail.com>
|
|
140
140
|
* MIT Licence
|
|
141
141
|
*)
|
|
142
|
-
*/});var i5=l1((z3)=>{var __dirname="/Users/enes.tuefekci/personal/projects/gemi/node_modules/.prisma/client";Object.defineProperty(z3,"__esModule",{value:!0});var{PrismaClientKnownRequestError:eX,PrismaClientUnknownRequestError:wA,PrismaClientRustPanicError:HA,PrismaClientInitializationError:XA,PrismaClientValidationError:AA,NotFoundError:VA,getPrismaClient:WA,sqltag:$A,empty:JA,join:YA,raw:ZA,Decimal:KA,Debug:HW,objectEnumValues:o0,makeStrictEnum:zA,Extensions:o5,warnOnce:XW,defineDmmfProperty:jA,Public:GA,getRuntime:AW}=K3(),d={};z3.Prisma=d;z3.$Enums={};d.prismaVersion={client:"5.14.0",engine:"34ace0eb2704183d2c05b60b52fba5c43c13f303"};d.PrismaClientKnownRequestError=eX;d.PrismaClientUnknownRequestError=wA;d.PrismaClientRustPanicError=HA;d.PrismaClientInitializationError=XA;d.PrismaClientValidationError=AA;d.NotFoundError=VA;d.Decimal=KA;d.sql=$A;d.empty=JA;d.join=YA;d.raw=ZA;d.validator=GA.validator;d.getExtensionContext=o5.getExtensionContext;d.defineExtension=o5.defineExtension;d.DbNull=o0.instances.DbNull;d.JsonNull=o0.instances.JsonNull;d.AnyNull=o0.instances.AnyNull;d.NullTypes={DbNull:o0.classes.DbNull,JsonNull:o0.classes.JsonNull,AnyNull:o0.classes.AnyNull};var D0=import.meta.require("path");z3.Prisma.TransactionIsolationLevel=zA({Serializable:"Serializable"});z3.Prisma.UserScalarFieldEnum={id:"id",email:"email",name:"name"};z3.Prisma.PostScalarFieldEnum={id:"id",publicId:"publicId",title:"title",content:"content",published:"published",authorId:"authorId"};z3.Prisma.SortOrder={asc:"asc",desc:"desc"};z3.Prisma.NullsOrder={first:"first",last:"last"};z3.Prisma.ModelName={User:"User",Post:"Post"};var e={generator:{name:"client",provider:{fromEnvVar:null,value:"prisma-client-js"},output:{value:"/Users/enes.tuefekci/personal/projects/gemi/node_modules/@prisma/client",fromEnvVar:null},config:{engineType:"library"},binaryTargets:[{fromEnvVar:null,value:"darwin-arm64",native:!0}],previewFeatures:["driverAdapters"],sourceFilePath:"/Users/enes.tuefekci/personal/projects/gemi/templates/saas-starter/prisma/schema.prisma"},relativeEnvPaths:{rootEnvPath:null,schemaEnvPath:"../../../templates/saas-starter/.env"},relativePath:"../../../templates/saas-starter/prisma",clientVersion:"5.14.0",engineVersion:"34ace0eb2704183d2c05b60b52fba5c43c13f303",datasourceNames:["db"],activeProvider:"sqlite",postinstall:!1,inlineDatasources:{db:{url:{fromEnvVar:"DATABASE_URL",value:null}}},inlineSchema:"// This is your Prisma schema file,\n// learn more about it in the docs: https://pris.ly/d/prisma-schema\n\ngenerator client {\n provider = \"prisma-client-js\"\n previewFeatures = [\"driverAdapters\"]\n}\n\ndatasource db {\n provider = \"sqlite\"\n url = env(\"DATABASE_URL\")\n}\n\nmodel User {\n id Int @id @default(autoincrement())\n email String @unique\n name String?\n posts Post[]\n}\n\nmodel Post {\n id Int @id @default(autoincrement())\n publicId String @unique @default(cuid())\n title String\n content String?\n published Boolean @default(false)\n author User? @relation(fields: [authorId], references: [id])\n authorId Int?\n}\n",inlineSchemaHash:"0fdc645180adab0c748b9fa16f9aca5de0687497c0b03b12504201d9f6937ff9",copyEngine:!0},a5=import.meta.require("fs");e.dirname=__dirname;if(!a5.existsSync(D0.join(__dirname,"schema.prisma"))){const w=["../../node_modules/.prisma/client","../node_modules/.prisma/client"],H=w.find((X)=>{return a5.existsSync(D0.join(process.cwd(),X,"schema.prisma"))})??w[0];e.dirname=D0.join(process.cwd(),H),e.isBundled=!0}e.runtimeDataModel=JSON.parse("{\"models\":{\"User\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Int\",\"default\":{\"name\":\"autoincrement\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"email\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":true,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"name\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"posts\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Post\",\"relationName\":\"PostToUser\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"Post\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Int\",\"default\":{\"name\":\"autoincrement\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"publicId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":true,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"title\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"content\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"published\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"default\":false,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"author\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"User\",\"relationName\":\"PostToUser\",\"relationFromFields\":[\"authorId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"authorId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"Int\",\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false}},\"enums\":{},\"types\":{}}");jA(z3.Prisma,e.runtimeDataModel);e.engineWasm=void 0;var{warnEnvConflicts:BA}=K3();BA({rootEnvPath:e.relativeEnvPaths.rootEnvPath&&D0.resolve(e.dirname,e.relativeEnvPaths.rootEnvPath),schemaEnvPath:e.relativeEnvPaths.schemaEnvPath&&D0.resolve(e.dirname,e.relativeEnvPaths.schemaEnvPath)});var FA=WA(e);z3.PrismaClient=FA;Object.assign(z3,d);D0.join(__dirname,"libquery_engine-darwin-arm64.dylib.node");D0.join(process.cwd(),"../../node_modules/.prisma/client/libquery_engine-darwin-arm64.dylib.node");D0.join(__dirname,"schema.prisma");D0.join(process.cwd(),"../../node_modules/.prisma/client/schema.prisma")});var r5=l1((WW,n5)=>{n5.exports={...i5()}});var e5=l1(($W,t5)=>{t5.exports={...r5()}});function V2(w){let H=[];for(let[X,A]of w)H.push(X,...V2(A).flat());return Array.from(new Set(H))}function Q1(w){const H=[];for(let[X,A]of Object.entries(w))if("prepare"in A){const{viewPath:V,children:W}=A.prepare();if(Object.entries(W).length>0){const $=Q1(W);H.push([V,$])}else H.push([V,[]])}else{const V=new A,W=Q1(V.routes);H.push(...W)}return H}function U1(w){const H={};for(let[X,A]of Object.entries(w))if("prepare"in A){const V=A.prepare();if(Object.entries(V.children).length>0){const W=U1(V.children);if(V.kind==="view")H[X]={exec:[V.exec],middleware:V.middlewares};for(let[$,{exec:J,middleware:Y}]of Object.entries(W)){const Z=X==="/"?$:`${X}${$}`,K=$==="/"&&X!=="/"?X:Z;H[K]={exec:J,middleware:[...V.middlewares,...Y]}}}else H[X]={exec:[V.exec],middleware:V.middlewares}}else{const V=new A,W=U1(V.routes);for(let[$,{exec:J,middleware:Y}]of Object.entries(W)){const Z=X==="/"?$:`${X}${$}`,K=$==="/"&&X!=="/"?X:Z;H[K]={exec:J,middleware:[...V.middlewares,...Y]}}}return H}function x1(w){const H={};for(let[X,A]of Object.entries(w))if("prepare"in A){const{viewPath:V,children:W,kind:$}=A.prepare();if($==="view")H[X]=[V];if(Object.entries(W).length>0){const J=x1(W);for(let[Y,Z]of Object.entries(J)){const K=X==="/"?Y:`${X}${Y}`,z=Y==="/"&&X!=="/"?X:K;H[z]=[V,...Z]}}else H[X]=[V]}else{const V=new A,W=x1(V.routes);for(let[$,J]of Object.entries(W)){const Y=X==="/"?$:`${X}${$}`,Z=$==="/"&&X!=="/"?X:Y;H[Z]=J}}return H}var V6=function(w){return D1(w)};function W2(w){const H={};for(let[X,A]of Object.entries(w))if("run"in A){const V=A;if(!H[X])H[X]={};const{method:W,middlewares:$}=V,J=V.run.bind(V);H[X][W]={exec:J,middleware:[...$]}}else if(V6(A)){const V=new A,W=W2(V.routes);for(let[$,J]of Object.entries(W)){const Y=$==="/"?"":$,Z=X==="/"?"":X,K=`${Z}${Y}`===""?"/":`${Z}${Y}`;if(!H[K])H[K]={};for(let[z,j]of Object.entries(J))H[K][z]={exec:j.exec,middleware:[V.middleware,...V.middlewares,...j.middleware]}}}else for(let V of Object.values(A)){if(!H[X])H[X]={};const{method:W,middlewares:$}=V,J=V.run.bind(V);H[X][W]={exec:J,middleware:$}}return H}import{renderToReadableStream as W6} from"react-dom/server.browser";import{createElement as j3,Fragment as $6} from"react";class B3{renderParams={styles:[],manifest:{},serverManifest:{},bootstrapModules:[]};flatViewRoutes={};flatApiRoutes={};routeManifest={};name="APP";appId;componentTree;middlewareAliases={};devVersion=0;params;apiRouter;viewRouter;Root;kernel;constructor(w){this.params=w,this.apiRouter=w.apiRouter,this.viewRouter=w.viewRouter,this.Root=w.root,this.kernel=new w.kernel,this.prepare(),this.appId=G3(Date.now())}prepare(){const w=this.params;this.middlewareAliases=w.middlewareAliases??{};const H=this.kernel.getServices.call(this.kernel),X=H.authenticationServiceProvider.basePath;let A={"/":this.viewRouter,[X]:H.authenticationServiceProvider.routers.view},V={"/":this.apiRouter,[X]:H.authenticationServiceProvider.routers.api};for(let W of w.plugins??[]){const $=new W;if($.viewRouter)A={...A,[$.viewRoutesBasePath]:$.viewRouter};if($.apiRouter)V={...V,[$.apiRoutesBasePath]:$.apiRouter}}this.flatViewRoutes=U1(A),this.componentTree=Q1(A),this.routeManifest=x1(A),this.flatApiRoutes=W2(V)}getComponentTree(){return this.componentTree}setRenderParams(w){this.renderParams=w}runMiddleware(w){return w.map((H)=>{if(typeof H==="string"){const X=H,V=this.kernel.getServices.call(this.kernel).middlewareServiceProvider.aliases[X];if(V)return new V().run}else{if(D1(H))return new H().run;return H}}).filter(Boolean).reduce((H,X)=>{return async(A,V)=>{return{...await H(A,V),...await X(A,V)}}},(H)=>Promise.resolve({}))}async handleApiRequest(w){const X=new URL(w.url).pathname.replace("/api","");for(let[A,V]of Object.entries(this.flatApiRoutes)){const W=new J2({pathname:A});if(W.test({pathname:X})){const $=W.exec({pathname:X})?.pathname.groups;if(!V[w.method])return new Response(JSON.stringify({error:{message:"Not found"}}));const J=V[w.method].exec,Y=V[w.method].middleware,Z=this.runMiddleware(Y);return await i0.run(async()=>{const K=new $2(w,$),z=i0.getStore();z.setRequest(K);let j=J?()=>J(K,$):()=>Promise.resolve({});try{await Z(K)}catch(F){if(F.kind===I1){const{status:U=400,data:I,headers:L}=F.payload.api;return new Response(JSON.stringify(I),{status:U,headers:{"Content-Type":"application/json",...L}})}else throw console.error(F),F}let G={};try{G=await j()}catch(F){if(F.kind===I1){const{status:U=400,data:I,headers:L}=F.payload.api;return new Response(JSON.stringify(I),{status:U,headers:{"Content-Type":"application/json",...L}})}else throw console.error(F),F}const O=new Headers;return O.append("Content-Type","application/json"),z.cookies.forEach((F)=>O.append("Set-Cookie",F.toString())),new Response(JSON.stringify(G),{headers:O})})}}return new Response(JSON.stringify({error:{message:"Not found"}}),{status:404})}async handleViewRequest(w){const H=new URL(w.url);let X=null;try{let T=[],C=[],t=null,b={};const u=Object.entries(this.flatViewRoutes).sort(([w0],[y])=>y.length-w0.length);for(let[w0,y]of u){const M=new J2({pathname:w0});if(M.test({pathname:H.pathname}))t=w0,b=M.exec({pathname:H.pathname})?.pathname.groups,T=y.exec,C=y.middleware}const W0=this.runMiddleware(C),{data:c,cookies:I0,user:m0}=await i0.run(async()=>{const w0=new $2(w,b),y=i0.getStore();return y.setRequest(w0),await W0(w0),{data:await Promise.all(T.map((A6)=>A6(w0))),cookies:y.cookies,user:y.user}});X={data:c,currentPathName:t,user:m0,params:b,cookies:I0}}catch(T){if(T.kind===I1)return new Response(null,{...T.payload.view});else throw T}const{data:A,params:V,currentPathName:W,user:$,cookies:J}=X,Y=A.reduce((T,C)=>{return{...T,...C}},{});if(H.searchParams.get("json")){const T=new Headers;return T.set("Content-Type","application/json"),J.forEach((C)=>T.append("Set-Cookie",C.toString())),new Response(JSON.stringify({data:{[H.pathname]:Y},is404:!W}),{headers:T})}const{styles:Z,manifest:K,serverManifest:z,bootstrapModules:j}=this.renderParams,G={};let O=null;const F=(T,C)=>`"${T}": () => import("${C}")`,U=[];for(let T of["404",...V2(this.componentTree)])if(!K){O=`${process.env.APP_DIR}`;const C=await import(`${O}/views/${T}.tsx`);G[T]=C.default,U.push(F(T,`${O}/views/${T}.tsx`))}else{const C=z[`app/views/${T}.tsx`],t=await import(`${process.env.DIST_DIR}/server/${C?.file}`);G[T]=t.default;const b=K[`app/views/${T}.tsx`];if(b)U.push(F(T,`/${b?.file}`))}const I=`{${U.join(",")}}`,L=new Headers;L.set("Content-Type","text/html"),L.set("Cache-Control",$?"private, no-cache, no-store, max-age=0, must-revalidate":"public, max-age=864000, must-revalidate"),L.set("ETag",this.appId),X.cookies.forEach((T)=>L.append("Set-Cookie",T.toString()));const x={kind:"view",data:{pageData:{[H.pathname]:Y},auth:{user:$},routeManifest:this.routeManifest,router:{pathname:W,params:V,currentPath:H.pathname,searchParams:H.search,is404:!W?!0:!1},componentTree:[["404",[]],...this.componentTree]},head:{}},P=await W6(j3($6,{children:[Z,j3(this.Root,{data:x.data,viewImportMap:G})]}),{bootstrapScriptContent:`window.__GEMI_DATA__ = ${JSON.stringify(x.data)}; window.loaders=${I}`,bootstrapModules:j});return new Response(P,{status:!W?404:200,headers:L})}async fetch(w){const H=new URL(w.url);return this.kernel.run.bind(this.kernel)(async()=>{if(H.pathname.startsWith("/api"))return await this.handleApiRequest(w);else return await this.handleViewRequest(w)})}handleWebSocketMessage=(w,H)=>{};handleWebSocketOpen=(w)=>{console.log("socket opened")};handleWebSocketClose=(w,H,X)=>{console.log("socket closed")};websocket={message:this.handleWebSocketMessage,open:this.handleWebSocketOpen,close:this.handleWebSocketClose}}var X6=_A(e5(),1);var QA=X6.Prisma.defineExtension({name:"Gemi Policies",query:{async $allOperations({args:w,operation:H,query:X,model:A}){const W=H6.getStore().policiesServiceProvider.policiesList[`${A}Policies`];if(!W)return await X(w);if(!await W.all.call(W,H,w))throw new w6;return await X(w)}}});export{QA as prismaExtension,B3 as App};
|
|
142
|
+
*/});var i5=l1((z3)=>{var __dirname="/Users/enes.tuefekci/personal/projects/gemi/node_modules/.prisma/client";Object.defineProperty(z3,"__esModule",{value:!0});var{PrismaClientKnownRequestError:eX,PrismaClientUnknownRequestError:wA,PrismaClientRustPanicError:HA,PrismaClientInitializationError:XA,PrismaClientValidationError:AA,NotFoundError:VA,getPrismaClient:WA,sqltag:$A,empty:JA,join:YA,raw:ZA,Decimal:KA,Debug:HW,objectEnumValues:o0,makeStrictEnum:zA,Extensions:o5,warnOnce:XW,defineDmmfProperty:jA,Public:GA,getRuntime:AW}=K3(),d={};z3.Prisma=d;z3.$Enums={};d.prismaVersion={client:"5.14.0",engine:"34ace0eb2704183d2c05b60b52fba5c43c13f303"};d.PrismaClientKnownRequestError=eX;d.PrismaClientUnknownRequestError=wA;d.PrismaClientRustPanicError=HA;d.PrismaClientInitializationError=XA;d.PrismaClientValidationError=AA;d.NotFoundError=VA;d.Decimal=KA;d.sql=$A;d.empty=JA;d.join=YA;d.raw=ZA;d.validator=GA.validator;d.getExtensionContext=o5.getExtensionContext;d.defineExtension=o5.defineExtension;d.DbNull=o0.instances.DbNull;d.JsonNull=o0.instances.JsonNull;d.AnyNull=o0.instances.AnyNull;d.NullTypes={DbNull:o0.classes.DbNull,JsonNull:o0.classes.JsonNull,AnyNull:o0.classes.AnyNull};var D0=import.meta.require("path");z3.Prisma.TransactionIsolationLevel=zA({Serializable:"Serializable"});z3.Prisma.UserScalarFieldEnum={id:"id",email:"email",name:"name"};z3.Prisma.PostScalarFieldEnum={id:"id",publicId:"publicId",title:"title",content:"content",published:"published",authorId:"authorId"};z3.Prisma.SortOrder={asc:"asc",desc:"desc"};z3.Prisma.NullsOrder={first:"first",last:"last"};z3.Prisma.ModelName={User:"User",Post:"Post"};var e={generator:{name:"client",provider:{fromEnvVar:null,value:"prisma-client-js"},output:{value:"/Users/enes.tuefekci/personal/projects/gemi/node_modules/@prisma/client",fromEnvVar:null},config:{engineType:"library"},binaryTargets:[{fromEnvVar:null,value:"darwin-arm64",native:!0}],previewFeatures:["driverAdapters"],sourceFilePath:"/Users/enes.tuefekci/personal/projects/gemi/templates/saas-starter/prisma/schema.prisma"},relativeEnvPaths:{rootEnvPath:null,schemaEnvPath:"../../../templates/saas-starter/.env"},relativePath:"../../../templates/saas-starter/prisma",clientVersion:"5.14.0",engineVersion:"34ace0eb2704183d2c05b60b52fba5c43c13f303",datasourceNames:["db"],activeProvider:"sqlite",postinstall:!1,inlineDatasources:{db:{url:{fromEnvVar:"DATABASE_URL",value:null}}},inlineSchema:"// This is your Prisma schema file,\n// learn more about it in the docs: https://pris.ly/d/prisma-schema\n\ngenerator client {\n provider = \"prisma-client-js\"\n previewFeatures = [\"driverAdapters\"]\n}\n\ndatasource db {\n provider = \"sqlite\"\n url = env(\"DATABASE_URL\")\n}\n\nmodel User {\n id Int @id @default(autoincrement())\n email String @unique\n name String?\n posts Post[]\n}\n\nmodel Post {\n id Int @id @default(autoincrement())\n publicId String @unique @default(cuid())\n title String\n content String?\n published Boolean @default(false)\n author User? @relation(fields: [authorId], references: [id])\n authorId Int?\n}\n",inlineSchemaHash:"0fdc645180adab0c748b9fa16f9aca5de0687497c0b03b12504201d9f6937ff9",copyEngine:!0},a5=import.meta.require("fs");e.dirname=__dirname;if(!a5.existsSync(D0.join(__dirname,"schema.prisma"))){const w=["../../node_modules/.prisma/client","../node_modules/.prisma/client"],H=w.find((X)=>{return a5.existsSync(D0.join(process.cwd(),X,"schema.prisma"))})??w[0];e.dirname=D0.join(process.cwd(),H),e.isBundled=!0}e.runtimeDataModel=JSON.parse("{\"models\":{\"User\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Int\",\"default\":{\"name\":\"autoincrement\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"email\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":true,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"name\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"posts\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Post\",\"relationName\":\"PostToUser\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"Post\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Int\",\"default\":{\"name\":\"autoincrement\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"publicId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":true,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"title\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"content\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"published\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"default\":false,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"author\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"User\",\"relationName\":\"PostToUser\",\"relationFromFields\":[\"authorId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"authorId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"Int\",\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false}},\"enums\":{},\"types\":{}}");jA(z3.Prisma,e.runtimeDataModel);e.engineWasm=void 0;var{warnEnvConflicts:BA}=K3();BA({rootEnvPath:e.relativeEnvPaths.rootEnvPath&&D0.resolve(e.dirname,e.relativeEnvPaths.rootEnvPath),schemaEnvPath:e.relativeEnvPaths.schemaEnvPath&&D0.resolve(e.dirname,e.relativeEnvPaths.schemaEnvPath)});var FA=WA(e);z3.PrismaClient=FA;Object.assign(z3,d);D0.join(__dirname,"libquery_engine-darwin-arm64.dylib.node");D0.join(process.cwd(),"../../node_modules/.prisma/client/libquery_engine-darwin-arm64.dylib.node");D0.join(__dirname,"schema.prisma");D0.join(process.cwd(),"../../node_modules/.prisma/client/schema.prisma")});var r5=l1((WW,n5)=>{n5.exports={...i5()}});var e5=l1(($W,t5)=>{t5.exports={...r5()}});function V2(w){let H=[];for(let[X,A]of w)H.push(X,...V2(A).flat());return Array.from(new Set(H))}function Q1(w){const H=[];for(let[X,A]of Object.entries(w))if("prepare"in A){const{viewPath:V,children:W}=A.prepare();if(Object.entries(W).length>0){const $=Q1(W);H.push([V,$])}else H.push([V,[]])}else{const V=new A,W=Q1(V.routes);H.push(...W)}return H}function U1(w){const H={};for(let[X,A]of Object.entries(w))if("prepare"in A){const V=A.prepare();if(Object.entries(V.children).length>0){const W=U1(V.children);if(V.kind==="view")H[X]={exec:[V.exec],middleware:V.middlewares};for(let[$,{exec:J,middleware:Y}]of Object.entries(W)){const Z=X==="/"?$:`${X}${$}`,K=$==="/"&&X!=="/"?X:Z;H[K]={exec:[V.exec,...J],middleware:[...V.middlewares,...Y]}}}else H[X]={exec:[V.exec],middleware:V.middlewares}}else{const V=new A,W=U1(V.routes);for(let[$,{exec:J,middleware:Y}]of Object.entries(W)){const Z=X==="/"?$:`${X}${$}`,K=$==="/"&&X!=="/"?X:Z;H[K]={exec:J,middleware:[...V.middlewares,...Y]}}}return H}function x1(w){const H={};for(let[X,A]of Object.entries(w))if("prepare"in A){const{viewPath:V,children:W,kind:$}=A.prepare();if($==="view")H[X]=[V];if(Object.entries(W).length>0){const J=x1(W);for(let[Y,Z]of Object.entries(J)){const K=X==="/"?Y:`${X}${Y}`,z=Y==="/"&&X!=="/"?X:K;H[z]=[V,...Z]}}else H[X]=[V]}else{const V=new A,W=x1(V.routes);for(let[$,J]of Object.entries(W)){const Y=X==="/"?$:`${X}${$}`,Z=$==="/"&&X!=="/"?X:Y;H[Z]=J}}return H}var V6=function(w){return D1(w)};function W2(w){const H={};for(let[X,A]of Object.entries(w))if("run"in A){const V=A;if(!H[X])H[X]={};const{method:W,middlewares:$}=V,J=V.run.bind(V);H[X][W]={exec:J,middleware:[...$]}}else if(V6(A)){const V=new A,W=W2(V.routes);for(let[$,J]of Object.entries(W)){const Y=$==="/"?"":$,Z=X==="/"?"":X,K=`${Z}${Y}`===""?"/":`${Z}${Y}`;if(!H[K])H[K]={};for(let[z,j]of Object.entries(J))H[K][z]={exec:j.exec,middleware:[V.middleware,...V.middlewares,...j.middleware]}}}else for(let V of Object.values(A)){if(!H[X])H[X]={};const{method:W,middlewares:$}=V,J=V.run.bind(V);H[X][W]={exec:J,middleware:$}}return H}import{renderToReadableStream as W6} from"react-dom/server.browser";import{createElement as j3,Fragment as $6} from"react";class B3{renderParams={styles:[],manifest:{},serverManifest:{},bootstrapModules:[]};flatViewRoutes={};flatApiRoutes={};routeManifest={};name="APP";appId;componentTree;middlewareAliases={};devVersion=0;params;apiRouter;viewRouter;Root;kernel;constructor(w){this.params=w,this.apiRouter=w.apiRouter,this.viewRouter=w.viewRouter,this.Root=w.root,this.kernel=new w.kernel,this.prepare(),this.appId=G3(Date.now())}prepare(){const w=this.params;this.middlewareAliases=w.middlewareAliases??{};const H=this.kernel.getServices.call(this.kernel),X=H.authenticationServiceProvider.basePath;let A={"/":this.viewRouter,[X]:H.authenticationServiceProvider.routers.view},V={"/":this.apiRouter,[X]:H.authenticationServiceProvider.routers.api};for(let W of w.plugins??[]){const $=new W;if($.viewRouter)A={...A,[$.viewRoutesBasePath]:$.viewRouter};if($.apiRouter)V={...V,[$.apiRoutesBasePath]:$.apiRouter}}this.flatViewRoutes=U1(A),this.componentTree=Q1(A),this.routeManifest=x1(A),this.flatApiRoutes=W2(V)}getComponentTree(){return this.componentTree}setRenderParams(w){this.renderParams=w}runMiddleware(w){return w.map((H)=>{if(typeof H==="string"){const X=H,V=this.kernel.getServices.call(this.kernel).middlewareServiceProvider.aliases[X];if(V)return new V().run}else{if(D1(H))return new H().run;return H}}).filter(Boolean).reduce((H,X)=>{return async(A,V)=>{return{...await H(A,V),...await X(A,V)}}},(H)=>Promise.resolve({}))}async handleApiRequest(w){const X=new URL(w.url).pathname.replace("/api","");for(let[A,V]of Object.entries(this.flatApiRoutes)){const W=new J2({pathname:A});if(W.test({pathname:X})){const $=W.exec({pathname:X})?.pathname.groups;if(!V[w.method])return new Response(JSON.stringify({error:{message:"Not found"}}));const J=V[w.method].exec,Y=V[w.method].middleware,Z=this.runMiddleware(Y);return await i0.run(async()=>{const K=new $2(w,$),z=i0.getStore();z.setRequest(K);let j=J?()=>J(K,$):()=>Promise.resolve({});try{await Z(K)}catch(F){if(F.kind===I1){const{status:U=400,data:I,headers:L}=F.payload.api;return new Response(JSON.stringify(I),{status:U,headers:{"Content-Type":"application/json",...L}})}else throw console.error(F),F}let G={};try{G=await j()}catch(F){if(F.kind===I1){const{status:U=400,data:I,headers:L}=F.payload.api;return new Response(JSON.stringify(I),{status:U,headers:{"Content-Type":"application/json",...L}})}else throw console.error(F),F}const O=new Headers;return O.append("Content-Type","application/json"),z.cookies.forEach((F)=>O.append("Set-Cookie",F.toString())),new Response(JSON.stringify(G),{headers:O})})}}return new Response(JSON.stringify({error:{message:"Not found"}}),{status:404})}async handleViewRequest(w){const H=new URL(w.url);let X=null;try{let T=[],C=[],t=null,b={};const u=Object.entries(this.flatViewRoutes).sort(([w0],[y])=>y.length-w0.length);for(let[w0,y]of u){const M=new J2({pathname:w0});if(M.test({pathname:H.pathname}))t=w0,b=M.exec({pathname:H.pathname})?.pathname.groups,T=y.exec,C=y.middleware}const W0=this.runMiddleware(C),{data:c,cookies:I0,user:m0}=await i0.run(async()=>{const w0=new $2(w,b),y=i0.getStore();return y.setRequest(w0),await W0(w0),{data:await Promise.all(T.map((A6)=>A6(w0))),cookies:y.cookies,user:y.user}});X={data:c,currentPathName:t,user:m0,params:b,cookies:I0}}catch(T){if(T.kind===I1)return new Response(null,{...T.payload.view});else throw T}const{data:A,params:V,currentPathName:W,user:$,cookies:J}=X,Y=A.reduce((T,C)=>{return{...T,...C}},{});if(H.searchParams.get("json")){const T=new Headers;return T.set("Content-Type","application/json"),J.forEach((C)=>T.append("Set-Cookie",C.toString())),new Response(JSON.stringify({data:{[H.pathname]:Y},is404:!W}),{headers:T})}const{styles:Z,manifest:K,serverManifest:z,bootstrapModules:j}=this.renderParams,G={};let O=null;const F=(T,C)=>`"${T}": () => import("${C}")`,U=[];for(let T of["404",...V2(this.componentTree)])if(!K){O=`${process.env.APP_DIR}`;const C=await import(`${O}/views/${T}.tsx`);G[T]=C.default,U.push(F(T,`${O}/views/${T}.tsx`))}else{const C=z[`app/views/${T}.tsx`],t=await import(`${process.env.DIST_DIR}/server/${C?.file}`);G[T]=t.default;const b=K[`app/views/${T}.tsx`];if(b)U.push(F(T,`/${b?.file}`))}const I=`{${U.join(",")}}`,L=new Headers;L.set("Content-Type","text/html"),L.set("Cache-Control",$?"private, no-cache, no-store, max-age=0, must-revalidate":"public, max-age=864000, must-revalidate"),L.set("ETag",this.appId),X.cookies.forEach((T)=>L.append("Set-Cookie",T.toString()));const x={kind:"view",data:{pageData:{[H.pathname]:Y},auth:{user:$},routeManifest:this.routeManifest,router:{pathname:W,params:V,currentPath:H.pathname,searchParams:H.search,is404:!W?!0:!1},componentTree:[["404",[]],...this.componentTree]},head:{}},P=await W6(j3($6,{children:[Z,j3(this.Root,{data:x.data,viewImportMap:G})]}),{bootstrapScriptContent:`window.__GEMI_DATA__ = ${JSON.stringify(x.data)}; window.loaders=${I}`,bootstrapModules:j});return new Response(P,{status:!W?404:200,headers:L})}async fetch(w){const H=new URL(w.url);return this.kernel.run.bind(this.kernel)(async()=>{if(H.pathname.startsWith("/api"))return await this.handleApiRequest(w);else return await this.handleViewRequest(w)})}handleWebSocketMessage=(w,H)=>{};handleWebSocketOpen=(w)=>{console.log("socket opened")};handleWebSocketClose=(w,H,X)=>{console.log("socket closed")};websocket={message:this.handleWebSocketMessage,open:this.handleWebSocketOpen,close:this.handleWebSocketClose}}var X6=_A(e5(),1);var QA=X6.Prisma.defineExtension({name:"Gemi Policies",query:{async $allOperations({args:w,operation:H,query:X,model:A}){const W=H6.getStore().policiesServiceProvider.policiesList[`${A}Policies`];if(!W)return await X(w);if(!await W.all.call(W,H,w))throw new w6;return await X(w)}}});export{QA as prismaExtension,B3 as App};
|
|
@@ -27,6 +27,18 @@ export interface CreatePasswordResetTokenArgs {
|
|
|
27
27
|
user: User;
|
|
28
28
|
token: string;
|
|
29
29
|
}
|
|
30
|
+
export type Organization = {
|
|
31
|
+
id: number;
|
|
32
|
+
publicId: string;
|
|
33
|
+
name: string;
|
|
34
|
+
};
|
|
35
|
+
export type Account = {
|
|
36
|
+
id: number;
|
|
37
|
+
publicId: string;
|
|
38
|
+
name: string;
|
|
39
|
+
organizationRole: number;
|
|
40
|
+
organization: Organization;
|
|
41
|
+
};
|
|
30
42
|
export interface User {
|
|
31
43
|
id: number;
|
|
32
44
|
publicId: string;
|
|
@@ -36,6 +48,7 @@ export interface User {
|
|
|
36
48
|
globalRole: number;
|
|
37
49
|
password: string | null;
|
|
38
50
|
organizationId: number | null;
|
|
51
|
+
accounts: Account[];
|
|
39
52
|
}
|
|
40
53
|
export interface CreateSessionArgs {
|
|
41
54
|
token: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../auth/adapters/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,sBAAsB;IACrC,UAAU,EAAE,CAAC,IAAI,EAAE,cAAc,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACpD,kBAAkB,EAAE,CAAC,IAAI,EAAE,sBAAsB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACpE,aAAa,EAAE,CAAC,IAAI,EAAE,iBAAiB,KAAK,OAAO,CAAC,eAAe,CAAC,CAAC;IACrE,aAAa,EAAE,CAAC,IAAI,EAAE,iBAAiB,KAAK,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC,CAAC;IAC5E,WAAW,EAAE,CAAC,IAAI,EAAE,eAAe,KAAK,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC,CAAC;IACxE,aAAa,EAAE,CAAC,IAAI,EAAE,iBAAiB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1D,sBAAsB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACzD,wBAAwB,EAAE,CACxB,IAAI,EAAE,4BAA4B,KAC/B,OAAO,CAAC,MAAM,CAAC,CAAC;IACrB,wBAAwB,EAAE,CACxB,IAAI,EAAE,4BAA4B,KAC/B,OAAO,CAAC,MAAM,CAAC,CAAC;IACrB,sBAAsB,EAAE,CACtB,IAAI,EAAE,0BAA0B,KAC7B,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAAC,CAAC;IACxC,qBAAqB,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CAC1D;AAED,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,MAAM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
+
import{u as l,v as w} from"./chunk-c8f1115d77efc1c0.js";class m{requests={};static kind="controller";constructor(){}}class C extends m{constructor(){super(...arguments)}}function P(e){return typeof e==="function"&&e.prototype!==void 0}var H=function(e){return P(e)};class d{e;t;n;middlewares=[];constructor(e,t,n){this.method=e;this.handler=t;this.methodName=n;this.handler=t,this.methodName=n,this.method=e}run(e){let t=e;if(H(this.handler)){const n=new this.handler,r=n[this.methodName].bind(n);return t=n.requests[this.methodName]?new n.requests[this.methodName](e.rawRequest,e.params):t,r(t)}else return this.handler(e)}middleware(e){return this.middlewares=e,this}}class R{routes={};middlewares=[];middleware(e){}get(e,t){return new d("GET",e,t)}post(e,t){return new d("POST",e,t)}put(e,t){return new d("PUT",e,t)}patch(e,t){return new d("PATCH",e,t)}delete(e,t){return new d("DELETE",e,t)}resource(e){class t extends R{constructor(){super(...arguments)}routes={"/":{list:this.get(e,"list"),create:this.post(e,"create")},"/:id":{show:this.get(e,"show"),update:this.put(e,"update"),delete:this.delete(e,"delete")}}}return t}}class f{routes={};middlewares=[];middleware(e){}layout(e,...t){function n(r=[]){const[o,a]=t;let s=a??{};if(o&&o.constructor===Object)s=o;return{exec:async(u)=>{let i=()=>Promise.resolve({data:{[e]:{}},headers:{},head:{}});if(typeof o==="function")i=o;if(Array.isArray(o)){const[T,y]=o,p=new T;i=p[y].bind(p)}const h=await i(u);return{[e]:h}},children:s,viewPath:e,middlewares:r,kind:"layout"}}return{prepare:n,middleware:(r)=>({prepare:()=>n(r)})}}view(e,...t){function n(r=[]){const[o,a]=t;let s=a??{};if(o&&o.constructor===Object)s=o;return{exec:async(u)=>{let i=()=>Promise.resolve({data:{[e]:{}},headers:{},head:{}});if(typeof handler==="function")i=handler;if(Array.isArray(o)){const[T,y]=o,p=new T;i=p[y].bind(p)}const h=await i(u);return{[e]:h}},children:s,viewPath:e,middlewares:r,kind:"view"}}return{prepare:n,middleware:(r)=>({prepare:()=>n(r)})}}}class c extends l{errors={};constructor(e){super("Validation error");this.name="ValidationError",this.errors=e,this.payload={api:{status:400,data:{error:{kind:"validation_error",messages:e}},headers:{"Content-Type":"application/json"}},view:{status:400}}}}class K extends l{error;constructor(e="Not authorized"){super("Authentication error");this.name="AuthenticationError",this.error=e,this.payload={api:{status:401,data:{error:this.error}},view:{}}}}class g extends l{error;constructor(e="Insufficient permissions"){super("Authentication error");this.name="AuthenticationError",this.error=e,this.payload={api:{status:401,data:{error:this.error}},view:{}}}}class b extends l{constructor(){super("Authentication error");this.name="AuthenticationError"}payload={api:{status:401,data:{error:"Authentication error"}},view:{status:302,headers:{"Cache-Control":"private, no-cache, no-store, max-age=0, must-revalidate",Location:"/auth/sign-in"}}}}var O=function(e){const[t,n]=e.split(":");switch(t){case"required":return(r)=>{return r!==null&&r!==void 0&&r?.length>0};case"password":return(r)=>{return/^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[^a-zA-Z0-9]).{8,}$/.test(r)};case"number":return(r)=>{if(typeof r!=="number")return!1;return!isNaN(r)};case"min":return(r)=>{return r?.length>=parseInt(n)};case"max":return(r)=>{return r?.length<=parseInt(n)};case"email":return(r)=>{return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(r)};default:return()=>!0}};class x{e;constructor(e){this.data=e}get(e){return this.data[e]}set(e,t){this.data[e]=t}has(e){return this.data[e]!==void 0}toJSON(){return this.data}}class M{rawRequest;headers;cookies;schema={};params;ctx=w.getStore();constructor(e,t){this.params=t,this.rawRequest=e,this.headers=e.headers;const n=this.rawRequest.headers.get("Cookie"),r=new Map;if(n){const o=n.split(";");for(let a of o){const[s,u]=a.split("=");r.set(s.trim(),u.trim())}}this.cookies=r}async parseBody(){const e=new x({});if(this.rawRequest.headers.get("Content-Type")==="application/json"){const t=await this.rawRequest.json();for(let[n,r]of Object.entries(t))e.set(n,r)}if(this.rawRequest.headers.get("Content-Type")==="application/x-www-form-urlencoded"){const t=await this.rawRequest.formData();for(let[n,r]of t)e.set(n,r)}if(this.rawRequest.headers.get("Content-Type").startsWith("multipart/form-data")){const t=await this.rawRequest.formData();for(let[n,r]of t)if(e.has(n)){const o=e.get(n);if(Array.isArray(o))o.push(r),e.set(n,o);else e.set(n,[o,r])}else e.set(n,r)}return e}validateInput(e){const t={};for(let[n,r]of Object.entries(this.schema))for(let[o,a]of Object.entries(r))if(!O(o)(e.get(n))){if(!t[n])t[n]=[];if(o==="required"){t[n]=[String(a)];break}else t[n].push(String(a))}if(Object.keys(t).length>0)throw new c(t);else return e}async input(){return this.validateInput(await this.parseBody())}async safeInput(){const e=await this.parseBody();try{return this.validateInput(e),{isValid:!0,errors:{},input:e}}catch(t){if(!(t instanceof c))throw t;return{isValid:!1,errors:t.errors,input:e}}}async terminate(e){throw"not implemented"}}class I{aliases={}}class q{policiesList={};constructor(){const e=this.register();for(let t of e){const n=new t;this.policiesList[t.name]=n}}register(){return[]}}
|
|
2
|
+
export{m as d,C as e,P as f,R as g,f as h,c as i,K as j,g as k,b as l,M as m,I as n,q as o};
|
package/dist/email/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import"../facades/index.js";import{b as w,c} from"../kernel/index.js";import"../chunk-
|
|
2
|
+
import"../facades/index.js";import{b as w,c} from"../kernel/index.js";import"../chunk-61973614facb50a8.js";import"../chunk-9350baa090b5a424.js";import"../chunk-c8f1115d77efc1c0.js";import{renderToStaticMarkup as u} from"react-dom/server";var x=(t)=>{return`<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">${u(t)}`};class s{static async send(t,r){const e=new t,{to:a=e.to,from:l=e.from,subject:m=e.subject,cc:p=e.cc,bcc:T=e.bcc,attachments:d=e.attachments,data:E}=r,n=x(e.render(E));if(process.env.EMAIL_DEBUG){const o=`${process.env.ROOT_DIR}/.debug/emails/${(new Date()).toISOString()}${m}.html`;await Bun.write(o,n),Bun.spawnSync(["open",o]);return}await c.getContext().emailServiceProvider.send({bcc:T,cc:p,from:l,subject:m,to:a,attachments:d,html:n})}}import{createElement as f,Fragment as g} from"react";class i{from="doe@gemijs.dev";to=["hi@gemijs.dev"];subject="Welcome";cc=[];bcc=[];attachments=[];render(t){return console.log("EmailTemplate"),f(g,null,"EmailTemplate")}}export{i as EmailTemplate,w as EmailServiceProvider,s as Email};
|
|
@@ -22,12 +22,14 @@ export declare class ViewRouter {
|
|
|
22
22
|
routes: ViewChildren;
|
|
23
23
|
middlewares: string[];
|
|
24
24
|
middleware(req: Request): MiddlewareReturnType;
|
|
25
|
-
protected layout<T extends new () => Controller>(viewPath: string
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
protected view<T extends new () => Controller>(viewPath: string,
|
|
30
|
-
|
|
25
|
+
protected layout<T extends new () => Controller>(viewPath: string, ...args: [
|
|
26
|
+
handlerOrChildren?: ViewHandler<T> | ViewChildren,
|
|
27
|
+
children?: ViewChildren
|
|
28
|
+
]): ViewConfig;
|
|
29
|
+
protected view<T extends new () => Controller>(viewPath: string, ...args: [
|
|
30
|
+
handlerOrChildren?: ViewHandler<T> | ViewChildren,
|
|
31
|
+
children?: ViewChildren
|
|
32
|
+
]): ViewConfig;
|
|
31
33
|
}
|
|
32
34
|
export {};
|
|
33
35
|
//# sourceMappingURL=ViewRouter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ViewRouter.d.ts","sourceRoot":"","sources":["../../http/ViewRouter.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,KAAK,iBAAiB,CAAC,CAAC,SAAS,UAAU,UAAU,IAAI;KACtD,CAAC,IAAI,MAAM,YAAY,CAAC,CAAC,CAAC,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,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IACd,MAAM,EAAE,YAAY,CAAM;IAC1B,WAAW,EAAE,MAAM,EAAE,CAAM;IAE3B,UAAU,CAAC,GAAG,EAAE,OAAO,GAAG,oBAAoB;IAErD,SAAS,CAAC,MAAM,CAAC,CAAC,SAAS,UAAU,UAAU,EAC7C,QAAQ,EAAE,MAAM,EAChB,GAAG,IAAI,EAAE;QACP,iBAAiB,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,YAAY;QACjD,QAAQ,CAAC,EAAE,YAAY;KACxB,GACA,UAAU;IA2Cb,SAAS,CAAC,IAAI,CAAC,CAAC,SAAS,UAAU,UAAU,EAC3C,QAAQ,EAAE,MAAM,EAChB,GAAG,IAAI,EAAE;QACP,iBAAiB,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,YAAY;QACjD,QAAQ,CAAC,EAAE,YAAY;KACxB,GACA,UAAU;CA0Cd"}
|
package/dist/http/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{d,e as x,g,h as w,i as k,l as n,m as R,n as h,o as C} from"../chunk-
|
|
2
|
+
import{d,e as x,g,h as w,i as k,l as n,m as R,n as h,o as C} from"../chunk-61973614facb50a8.js";import"../chunk-9350baa090b5a424.js";import{u as q,v as a,x as p} from"../chunk-c8f1115d77efc1c0.js";class s{async run(o){return{}}}function l(o){const e=o.headers.get("cookie");if(!e)return new Map;const r=new Map,t=e.split(";");for(let i of t){const[m,f]=i.split("=");r.set(m.trim(),f)}return r}class c extends s{constructor(){super(...arguments)}async run(o){const e=a.getStore(),r=e.req.cookies.get("access_token");if(!r)throw new n;let t=e.user;if(!t){const i=await p.getStore().authenticationServiceProvider.adapter.findSession({token:r,userAgent:e.req.headers.get("User-Agent")});if(!i)throw new n;t=i?.user,e.setUser(t)}return{}}}class u{all(o,e){return!0}}export{l as getCookies,w as ViewRouter,k as ValidationError,x as ResourceController,q as RequestBreakerError,C as PoliciesServiceProvider,u as Policies,h as MiddlewareServiceProvider,s as Middleware,R as HttpRequest,d as Controller,c as AuthenticationMiddleware,n as AuthenticationError,g as ApiRouter};
|