gemi 0.85.0 → 0.86.0
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/{chunk-6k2czkkh.js → chunk-2dzqrf0z.js} +1 -1
- package/dist/{chunk-2k5kyk0h.js → chunk-eptv0nvv.js} +1 -1
- package/dist/{chunk-5ktfpty1.js → chunk-ptkt4h2j.js} +2 -2
- package/dist/{chunk-5ktfpty1.js.map → chunk-ptkt4h2j.js.map} +1 -1
- package/dist/client/auth/useForgotPassword.d.ts +2 -1
- package/dist/client/auth/useForgotPassword.d.ts.map +1 -1
- package/dist/client/auth/useResetPassword.d.ts +2 -1
- package/dist/client/auth/useResetPassword.d.ts.map +1 -1
- package/dist/client/auth/useSignIn.d.ts +11 -1
- package/dist/client/auth/useSignIn.d.ts.map +1 -1
- package/dist/client/auth/useSignOut.d.ts +2 -1
- package/dist/client/auth/useSignOut.d.ts.map +1 -1
- package/dist/client/auth/useSignUp.d.ts +2 -1
- package/dist/client/auth/useSignUp.d.ts.map +1 -1
- package/dist/client/index.d.ts +1 -0
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +60 -30
- package/dist/client/index.js.map +1 -1
- package/dist/client/useMutation.d.ts +33 -6
- package/dist/client/useMutation.d.ts.map +1 -1
- package/dist/server/index.js +1 -1
- package/package.json +1 -1
- /package/dist/{chunk-6k2czkkh.js.map → chunk-2dzqrf0z.js.map} +0 -0
- /package/dist/{chunk-2k5kyk0h.js.map → chunk-eptv0nvv.js.map} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{h as F,j as w}from"./chunk-
|
|
2
|
+
import{h as F,j as w}from"./chunk-ptkt4h2j.js";import{ia as T,ja as f}from"./chunk-53we503k.js";import"./chunk-zq5m4scz.js";import"./chunk-9a8qz3s7.js";import"./chunk-gvkydx8r.js";import"./chunk-8z37k28d.js";import"./chunk-dadygfkf.js";import{uf as S}from"./chunk-jhe0t7yj.js";import{Hg as b}from"./chunk-ndat0nf0.js";import"./chunk-9tsw1bmt.js";import{join as v}from"path";import{createServer as l}from"vite";import{join as E}from"path";import{IncomingMessage as k,ServerResponse as q}from"http";import{Socket as d}from"net";function P(J){return J.replace(/\x1b\[[0-9;]*m/g,"").replace(/\[[0-9;]*m/g,"").replace(/\n\s*\n/g,`
|
|
3
3
|
`).split(`
|
|
4
4
|
`).map((K)=>K.trim()).filter((K)=>K.length>0).join(`
|
|
5
5
|
`).trim()}function D(J){return`
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{i as N,j as r}from"./chunk-
|
|
2
|
+
import{i as N,j as r}from"./chunk-ptkt4h2j.js";import{ka as P,oa as C,pa as s}from"./chunk-zq5m4scz.js";import"./chunk-8z37k28d.js";import{lc as c,nd as l,od as b}from"./chunk-xx2zg6sk.js";import"./chunk-ha705bcz.js";import"./chunk-k5j65f2c.js";import{Oe as f,Pe as u,Se as m}from"./chunk-174jkg6d.js";import{uf as n}from"./chunk-jhe0t7yj.js";import"./chunk-1jcp8m8h.js";import"./chunk-trdwxm5x.js";import"./chunk-1w5a11cd.js";import"./chunk-4ysar3ev.js";import"./chunk-dwqh79e5.js";import"./chunk-7n5775qx.js";import"./chunk-d3jkypc7.js";import"./chunk-8gexb1gt.js";import"./chunk-swhyp0yw.js";import{Gg as t}from"./chunk-cbycz5z3.js";import{Hg as A}from"./chunk-ndat0nf0.js";import"./chunk-9tsw1bmt.js";import{join as F,resolve as qJ,sep as yJ}from"path";import{Duplex as HJ}from"stream";import{constants as L,createBrotliCompress as KJ,createGzip as OJ}from"zlib";var YJ=["br","gzip"],xJ=1024,UJ=5,VJ=19,CJ=6;function IJ($){if($===void 0)return 1;if(!/^\d+(\.\d{0,3})?$/.test($.trim()))return 1;let J=Number($.trim());return Number.isFinite(J)?Math.min(J,1):1}function LJ($){if($===null||$===void 0)return null;let J=new Map;for(let X of $.split(",")){let[Z,...G]=X.split(";"),W=Z.trim().toLowerCase();if(W==="")continue;let Q=1;for(let j of G){let Y=j.indexOf("=");if(Y===-1)continue;if(j.slice(0,Y).trim().toLowerCase()==="q"){Q=IJ(j.slice(Y+1));break}}J.set(W,Q)}return J}function SJ($,J=YJ){let X=LJ($);if(!X)return null;let Z=X.get("*"),G=null,W=0;for(let Q of J){let j=X.get(Q)??Z??0;if(j>W)G=Q,W=j}return G}function bJ($,J){if(!$)return!1;return $.split(",").some((X)=>X.trim().toLowerCase().split("=")[0].trim()===J)}function AJ($,J){if($==="HEAD")return!1;if(!J.body)return!1;if(J.status<200||J.status===204||J.status===206||J.status===304)return!1;if(J.headers.has("Content-Range"))return!1;let X=J.headers.get("Content-Type");if(!X||!/^\s*text\/html\s*(;|$)/i.test(X))return!1;let Z=J.headers.get("Content-Encoding");if(Z&&Z.trim().toLowerCase()!=="identity")return!1;if(bJ(J.headers.get("Cache-Control"),"no-transform"))return!1;let G=J.headers.get("Content-Length");if(G!==null&&Number(G)<xJ)return!1;return!0}function MJ($){let J=$==="br"?KJ({params:{[L.BROTLI_PARAM_QUALITY]:UJ,[L.BROTLI_PARAM_LGWIN]:VJ},flush:L.BROTLI_OPERATION_FLUSH}):OJ({level:CJ,flush:L.Z_SYNC_FLUSH});return HJ.toWeb(J)}function _J($){let J=$.get("Vary");if(!J){$.set("Vary","Accept-Encoding");return}let X=J.split(",").map((Z)=>Z.trim().toLowerCase());if(X.includes("*")||X.includes("accept-encoding"))return;$.append("Vary","Accept-Encoding")}function v($,J){if(!AJ($.method,J))return J;let X=new Headers(J.headers);_J(X);let Z=SJ($.headers.get("Accept-Encoding"));if(!Z)return new Response(J.body,{status:J.status,statusText:J.statusText,headers:X});let G;try{G=MJ(Z)}catch{return new Response(J.body,{status:J.status,statusText:J.statusText,headers:X})}return X.set("Content-Encoding",Z),X.delete("Content-Length"),new Response(J.body.pipeThrough(G),{status:J.status,statusText:J.statusText,headers:X})}import{readdir as PJ,stat as TJ}from"fs/promises";import{join as DJ}from"path";function E($){let J=$.toString(),X=new Bun.CryptoHasher("sha1");return X.update(J),X.digest("hex")}async function h($){let J=new Set;async function X(Z,G){let W;try{W=await PJ(Z,{withFileTypes:!0})}catch{return}for(let Q of W){if(Q.name.startsWith("."))continue;if(G&&Q.name==="assets")continue;let j=DJ(Z,Q.name),Y=Q.isDirectory(),V=Q.isFile();if(Q.isSymbolicLink())try{let I=await TJ(j);Y=I.isDirectory(),V=I.isFile()}catch{continue}if(V)J.add(j);else if(Y&&!Q.isSymbolicLink())await X(j,!1)}}return await X($,!0),J}var NJ="public, max-age=31536000, must-revalidate";function p($,J){let X=Bun.file(J),Z=X.size,G=E(X.lastModified),W={"Content-Type":X.type||"application/octet-stream","Cache-Control":NJ,"Accept-Ranges":"bytes",ETag:G},Q=f($.headers.get("Range"));if(Q){let j=u(Q,Z);if(!j)return c(Z);return new Response(X.slice(j.start,j.end+1).stream(),{status:206,headers:{...W,"Content-Range":m(j.start,j.end,Z),"Content-Length":String(j.length)}})}return new Response(X.stream(),{headers:{...W,"Content-Length":String(Z)}})}import{stat as wJ}from"fs/promises";var S="app/client.tsx";function d($,J=P){let X=$[S]?.file;if(!X)return;return{module:C(X,J),preload:T($,S,J)}}function T($,J,X=P){let Z=[],G=new Set,W=(Q)=>{if(G.has(Q))return;G.add(Q);let j=$[Q];if(!j?.file)return;Z.push(C(j.file,X));for(let Y of j.imports??[])W(Y)};return W(J),Z}var BJ=new RegExp(`^${l}/.+\\.m?js$`);function FJ($){return BJ.test($)}function o($){if(FJ($))return new Response("window.location.reload();export {}",{headers:{"Content-Type":"application/javascript","Cache-Control":"no-store"}});if(b($))return new Response("Not found",{status:404});return}var kJ=`<!DOCTYPE html>
|
|
3
3
|
<html lang="en">
|
|
4
4
|
<head>
|
|
5
5
|
<meta charset="UTF-8" />
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{va as j}from"./chunk-8z37k28d.js";import{createElement as x}from"react";function h(i,n){let s=Object.keys(n).sort((u,r)=>r.length-u.length).map((u)=>u.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")),b=new RegExp(s.join("|"),"g");return i.replace(b,(u)=>n[u])}async function J(i,n,s=[]){let b=[...s.map((t)=>`${i}/views/${t}.tsx`),`${i}/views/RootLayout.tsx`],u=new Set;for(let t of b){let e=n.moduleGraph.getModulesByFile(t);if(e)for(let g of e)u.add(g)}let r=[],p=[],l={};for(let t of u)if(t)for(let e of t.importedModules){if(e.file.includes("module.css"))l[e.file]=e.ssrTransformResult.map.sourcesContent.join("");if(e.file.includes(".css"))p.push(e.file)}for(let t of p){let e=await n.transformRequest(t+"?direct"),g=t.includes("module.css"),a="";if(g)a=h(l[t],e.default);r.push({isDev:!0,id:t,content:g?a:e.code})}return r.map((t,e)=>{return x("style",{key:e,type:"text/css","data-vite-dev-id":t.id,dangerouslySetInnerHTML:{__html:t.content}})})}async function L(i=[]){return i.map((n,s)=>{return x("style",{key:s,id:n?.id,type:"text/css",dangerouslySetInnerHTML:{__html:n.content}})})}import{existsSync as v}from"fs";import{basename as f}from"path";import{networkInterfaces as k}from"os";var y={name:"gemi",version:"0.
|
|
2
|
+
import{va as j}from"./chunk-8z37k28d.js";import{createElement as x}from"react";function h(i,n){let s=Object.keys(n).sort((u,r)=>r.length-u.length).map((u)=>u.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")),b=new RegExp(s.join("|"),"g");return i.replace(b,(u)=>n[u])}async function J(i,n,s=[]){let b=[...s.map((t)=>`${i}/views/${t}.tsx`),`${i}/views/RootLayout.tsx`],u=new Set;for(let t of b){let e=n.moduleGraph.getModulesByFile(t);if(e)for(let g of e)u.add(g)}let r=[],p=[],l={};for(let t of u)if(t)for(let e of t.importedModules){if(e.file.includes("module.css"))l[e.file]=e.ssrTransformResult.map.sourcesContent.join("");if(e.file.includes(".css"))p.push(e.file)}for(let t of p){let e=await n.transformRequest(t+"?direct"),g=t.includes("module.css"),a="";if(g)a=h(l[t],e.default);r.push({isDev:!0,id:t,content:g?a:e.code})}return r.map((t,e)=>{return x("style",{key:e,type:"text/css","data-vite-dev-id":t.id,dangerouslySetInnerHTML:{__html:t.content}})})}async function L(i=[]){return i.map((n,s)=>{return x("style",{key:s,id:n?.id,type:"text/css",dangerouslySetInnerHTML:{__html:n.content}})})}import{existsSync as v}from"fs";import{basename as f}from"path";import{networkInterfaces as k}from"os";var y={name:"gemi",version:"0.86.0",private:!1,license:"MIT",author:"Enes Tufekci <enes@gemijs.dev>",repository:{type:"git",url:"git+https://github.com/nstfkc/gemi.git",directory:"packages/gemi"},bin:{gemi:"./dist/bin/gemi.js","gemi-orm-generator":"./dist/bin/orm-generator.js"},files:["dist/**/*","ide/typescript-plugin/package.json","skills/**/*"],module:!0,exports:{"./http":"./http/index.ts","./client":"./client/index.ts","./ai":"./ai/index.ts","./ai/client":"./ai/client/index.ts","./testing":"./testing/index.ts","./app":"./app/index.ts","./facades":"./facades/index.ts","./email":"./email/index.ts","./vite":"./dist/vite/index.mjs","./kernel":"./kernel/index.ts","./services":"./services/index.ts","./i18n":"./i18n/index.ts","./dictionary":"./i18n/dictionaryRuntime.ts","./server":"./server/index.ts","./config":"./config/index.ts","./container":"./container/index.ts","./foundation":"./foundation/index.ts","./database":"./database/index.ts","./orm":"./orm/index.ts","./support":"./support/index.ts","./console/run":"./console/run.ts","./queue/work":"./services/queue/work.ts","./ide/typescript-plugin":"./ide/typescript-plugin/index.ts","./bun/preload":"./bun/preload.ts","./bun/plugin":"./bun/plugin.ts"},scripts:{lint:"oxlint",typecheck:"tsc --noEmit -p tsconfig.json && tsc --noEmit -p tsconfig.browser.json && tsc --noEmit -p ide/typescript-plugin/tsconfig.json",build:"NODE_ENV=production bun run build:core && bun run build:bin && bun run build:types && bun run build:client && bun run build:plugin && bun run build:ts-plugin && bun run build:client-types && bun run build:augmentation","build:core":"bun ./scripts/build.ts","build:bin":"bun build --outdir=./dist/bin --target=bun --external=vite --external=react-dom --external=react/jsx-runtime --external=bun --external=sharp --external=@azure/storage-blob --external=typescript --sourcemap ./bin/gemi.ts ./bin/orm-generator.ts && bun ./scripts/prepare-bin.ts","build:client":"rm -rf dist/client dist/testing dist/ai/client dist/chunks && vite build -c vite.client.config.mts","build:plugin":"vite build -c vite.plugin.config.mts","build:ts-plugin":"bun ./scripts/build-ts-plugin.ts","build:types":"tsc -p tsconfig.build.json","build:client-types":"tsc -p tsconfig.browser.json",test:"bun --bun vitest","test:types":"vitest run --typecheck.only","test:live":"bun --bun vitest run ai/live","test:packaging":"bun --bun vitest run --config vitest.packaging.config.ts","build:publish":"bun scripts/build-publish.ts",prepublishOnly:"echo 'Do not publish from this directory \u2014 its exports point at TS source. Run: bun run build:publish, then publish from .publish/' && exit 1","build:augmentation":"bun ./scripts/wire-augmentation.ts"},dependencies:{"@aws-sdk/client-s3":"^3.629.0","@aws-sdk/s3-request-presigner":"^3.629.0","ast-types":"^0.14.2",commander:"^12.1.0",history:"^5.3.0","jsx-email":"2.0.0-rc2.1","magic-string":"^0.30.17",open:"^10.1.0","react-error-boundary":"^6.0.0",recast:"^0.23.9",resend:"^6.12.3",satori:"^0.12.2","temporal-polyfill":"^0.2.5","twitter-api-v2":"^1.20.2","urlpattern-polyfill":"^10.0.0",uuid:"^9.0.1"},devDependencies:{"@babel/parser":"^7.25.4","@prisma/generator-helper":"^6.5.0","@repo/typescript-config":"*","@testing-library/react":"^16.3.2","@types/bun":"^1.3.14","@types/eslint":"^8.56.5","@types/node":"^20.11.24","@types/react":"^19.0.2","@types/react-dom":"^19.0.2",eslint:"^8.57.0",jsdom:"^30.0.1",oxlint:"^1.39.0",react:"19.2.3","react-dom":"19.2.3",typescript:"^5.7.3",vitest:"^4.0.0"},peerDependencies:{"@azure/storage-blob":"^12.28.0",react:">=19","react-dom":">=19",sharp:"^0.34.2",typescript:">=5",vite:"^8.0.0"},peerDependenciesMeta:{"@azure/storage-blob":{optional:!0},typescript:{optional:!0}}};var q=[" \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2557\u2588\u2588\u2557","\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D \u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2551\u2588\u2588\u2551","\u2588\u2588\u2551 \u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2554\u2588\u2588\u2588\u2588\u2554\u2588\u2588\u2551\u2588\u2588\u2551","\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u255D \u2588\u2588\u2551\u255A\u2588\u2588\u2554\u255D\u2588\u2588\u2551\u2588\u2588\u2551","\u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2551 \u255A\u2550\u255D \u2588\u2588\u2551\u2588\u2588\u2551"," \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D\u255A\u2550\u255D \u255A\u2550\u255D\u255A\u2550\u255D"],z=Boolean(process.stdout.isTTY)&&!process.env.NO_COLOR,c=(i,n)=>z?`\x1B[${i}m${n}\x1B[0m`:n,E=(i)=>c("1",i),d=(i)=>c("2",i),o=(i)=>c("36",i),O=(i)=>c("32",i),T=(i)=>c("35",i);function R(){return y.version??"?"}function _(i){for(let n of Object.values(k()))for(let s of n??[])if((s.family==="IPv4"||s.family===4)&&!s.internal)return`http://${s.address}:${i}`;return null}function G(i){return j(i).filter((n)=>v(n)).map((n)=>f(n))}function A(i){let{port:n,rootDir:s}=i,b=`http://localhost:${n}`,u=_(n),r=G(s),p=(t,e)=>` ${O("\u279C")} ${E(t.padEnd(9))}${e}`,l=["",...q.map((t)=>T(t)),"",` ${d("gemi")} ${o(`v${R()}`)}`,"",p("Local:",o(b)),p("Network:",u?o(u):d("unavailable")),p("Env:",r.length?r.join(", "):d("none")),""];console.log(l.join(`
|
|
3
3
|
`))}
|
|
4
4
|
export{J as h,L as i,A as j};
|
|
5
5
|
|
|
6
|
-
//# debugId=
|
|
6
|
+
//# debugId=3753CBDDF3BE028464756E2164756E21
|
|
@@ -6,6 +6,6 @@
|
|
|
6
6
|
"import { existsSync } from \"node:fs\";\nimport { basename } from \"node:path\";\nimport { networkInterfaces } from \"node:os\";\nimport { envFiles } from \"./watchEnv\";\nimport pkg from \"../package.json\";\n\n// \"GEMI\" — ANSI Shadow figlet font.\nconst ART = [\n \" ██████╗ ███████╗███╗ ███╗██╗\",\n \"██╔════╝ ██╔════╝████╗ ████║██║\",\n \"██║ ███╗█████╗ ██╔████╔██║██║\",\n \"██║ ██║██╔══╝ ██║╚██╔╝██║██║\",\n \"╚██████╔╝███████╗██║ ╚═╝ ██║██║\",\n \" ╚═════╝ ╚══════╝╚═╝ ╚═╝╚═╝\",\n];\n\nconst useColor = Boolean(process.stdout.isTTY) && !process.env.NO_COLOR;\nconst paint = (code: string, text: string) =>\n useColor ? `\\x1b[${code}m${text}\\x1b[0m` : text;\nconst bold = (t: string) => paint(\"1\", t);\nconst dim = (t: string) => paint(\"2\", t);\nconst cyan = (t: string) => paint(\"36\", t);\nconst green = (t: string) => paint(\"32\", t);\nconst magenta = (t: string) => paint(\"35\", t);\n\nfunction gemiVersion(): string {\n return (pkg as { version?: string }).version ?? \"?\";\n}\n\nfunction networkUrl(port: number | string): string | null {\n for (const ifaces of Object.values(networkInterfaces())) {\n for (const iface of ifaces ?? []) {\n // Node <18 reported `family` as the number 4; newer Bun/Node use \"IPv4\".\n const isV4 = iface.family === \"IPv4\" || (iface.family as unknown) === 4;\n if (isV4 && !iface.internal) return `http://${iface.address}:${port}`;\n }\n }\n return null;\n}\n\nfunction loadedEnvFiles(rootDir: string): string[] {\n return envFiles(rootDir)\n .filter((file) => existsSync(file))\n .map((file) => basename(file));\n}\n\nexport function printStartupBanner(params: {\n port: number | string;\n rootDir: string;\n}) {\n const { port, rootDir } = params;\n const local = `http://localhost:${port}`;\n const network = networkUrl(port);\n const env = loadedEnvFiles(rootDir);\n\n const row = (label: string, value: string) =>\n ` ${green(\"➜\")} ${bold(label.padEnd(9))}${value}`;\n\n const out = [\n \"\",\n ...ART.map((line) => magenta(line)),\n \"\",\n ` ${dim(\"gemi\")} ${cyan(`v${gemiVersion()}`)}`,\n \"\",\n row(\"Local:\", cyan(local)),\n row(\"Network:\", network ? cyan(network) : dim(\"unavailable\")),\n row(\"Env:\", env.length ? env.join(\", \") : dim(\"none\")),\n \"\",\n ];\n\n console.log(out.join(\"\\n\"));\n}\n"
|
|
7
7
|
],
|
|
8
8
|
"mappings": ";yCAAA,wBAAS,cAGT,SAAS,CAAc,CAAC,EAAc,EAAwC,CAC5E,IAAM,EAAc,OAAO,KAAK,CAAM,EACnC,KAAK,CAAC,EAAG,IAAM,EAAE,OAAS,EAAE,MAAM,EAClC,IAAI,CAAC,IAAQ,EAAI,QAAQ,sBAAuB,MAAM,CAAC,EAGpD,EAAQ,IAAI,OAAO,EAAY,KAAK,GAAG,EAAG,GAAG,EAEnD,OAAO,EAAK,QAAQ,EAAO,CAAC,IAAU,EAAO,EAAM,EAGrD,eAAsB,CAAe,CACnC,EACA,EACA,EAAyB,CAAC,EAC1B,CACA,IAAM,EAAQ,CACZ,GAAG,EAAa,IAAI,CAAC,IAAS,GAAG,WAAgB,OAAU,EAC3D,GAAG,wBACL,EAEM,EAAU,IAAI,IACpB,QAAW,KAAQ,EAAO,CACxB,IAAM,EAAM,EAAK,YAAY,iBAAiB,CAAI,EAClD,GAAI,EACF,QAAW,KAAK,EAAK,EAAQ,IAAI,CAAC,EAItC,IAAM,EAAS,CAAC,EACV,EAAa,CAAC,EACd,EAA2C,CAAC,EAClD,QAAW,KAAO,EAChB,GAAI,EACF,QAAW,KAAY,EAAI,gBAAiB,CAC1C,GAAI,EAAS,KAAK,SAAS,YAAY,EACrC,EAAiB,EAAS,MAAQ,E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B,SAAW,IAGlD,SAAS,CAAU,CAAC,EAAsC,CACxD,QAAW,KAAU,OAAO,OAAO,EAAkB,CAAC,EACpD,QAAW,KAAS,GAAU,CAAC,EAG7B,IADa,EAAM,SAAW,QAAW,EAAM,SAAuB,IAC1D,CAAC,EAAM,SAAU,MAAO,UAAU,EAAM,WAAW,IAGnE,OAAO,KAGT,SAAS,CAAc,CAAC,EAA2B,CACjD,OAAO,EAAS,CAAO,EACpB,OAAO,CAAC,IAAS,EAAW,CAAI,CAAC,EACjC,IAAI,CAAC,IAAS,EAAS,CAAI,CAAC,EAG1B,SAAS,CAAkB,CAAC,EAGhC,CACD,IAAQ,OAAM,WAAY,EACpB,EAAQ,oBAAoB,IAC5B,EAAU,EAAW,CAAI,EACzB,EAAM,EAAe,CAAO,EAE5B,EAAM,CAAC,EAAe,IAC1B,KAAK,EAAM,QAAE,MAAM,EAAK,EAAM,OAAO,CAAC,CAAC,IAAI,IAEvC,EAAM,CACV,GACA,GAAG,EAAI,IAAI,CAAC,IAAS,EAAQ,CAAI,CAAC,EAClC,GACA,KAAK,EAAI,MAAM,KAAK,EAAK,IAAI,EAAY,GAAG,IAC5C,GACA,EAAI,SAAU,EAAK,CAAK,CAAC,EACzB,EAAI,WAAY,EAAU,EAAK,CAAO,EAAI,EAAI,aAAa,CAAC,EAC5D,EAAI,OAAQ,EAAI,OAAS,EAAI,KAAK,IAAI,EAAI,EAAI,MAAM,CAAC,EACrD,EACF,EAEA,QAAQ,IAAI,EAAI,KAAK;AAAA,CAAI,CAAC",
|
|
9
|
-
"debugId": "
|
|
9
|
+
"debugId": "3753CBDDF3BE028464756E2164756E21",
|
|
10
10
|
"names": []
|
|
11
11
|
}
|
|
@@ -5,12 +5,13 @@ export declare function useForgotPassword(args?: UseForgotPasswordArgs): {
|
|
|
5
5
|
data: {};
|
|
6
6
|
error: import("gemi/client").MutationError;
|
|
7
7
|
loading: boolean;
|
|
8
|
+
pending: number;
|
|
8
9
|
formData: FormData;
|
|
9
10
|
cancel: () => void;
|
|
10
11
|
trigger: {
|
|
11
12
|
(input?: {
|
|
12
13
|
email: string;
|
|
13
|
-
}): Promise<{}>;
|
|
14
|
+
}, call?: import("../useMutation").MutationCallConfig<{}>): Promise<{}>;
|
|
14
15
|
formData(formData: FormData): Promise<{}>;
|
|
15
16
|
};
|
|
16
17
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useForgotPassword.d.ts","sourceRoot":"","sources":["../../../client/auth/useForgotPassword.ts"],"names":[],"mappings":"AAEA,UAAU,qBAAqB;IAC7B,SAAS,EAAE,MAAM,IAAI,CAAC;CACvB;AAMD,wBAAgB,iBAAiB,CAAC,IAAI,GAAE,qBAAmC
|
|
1
|
+
{"version":3,"file":"useForgotPassword.d.ts","sourceRoot":"","sources":["../../../client/auth/useForgotPassword.ts"],"names":[],"mappings":"AAEA,UAAU,qBAAqB;IAC7B,SAAS,EAAE,MAAM,IAAI,CAAC;CACvB;AAMD,wBAAgB,iBAAiB,CAAC,IAAI,GAAE,qBAAmC;;;;;;;;;;;;;EAU1E"}
|
|
@@ -5,13 +5,14 @@ export declare function useResetPassword(args?: UseResetPasswordArgs): {
|
|
|
5
5
|
data: {};
|
|
6
6
|
error: import("gemi/client").MutationError;
|
|
7
7
|
loading: boolean;
|
|
8
|
+
pending: number;
|
|
8
9
|
formData: FormData;
|
|
9
10
|
cancel: () => void;
|
|
10
11
|
trigger: {
|
|
11
12
|
(input?: {
|
|
12
13
|
password: string;
|
|
13
14
|
token: string;
|
|
14
|
-
}): Promise<{}>;
|
|
15
|
+
}, call?: import("../useMutation").MutationCallConfig<{}>): Promise<{}>;
|
|
15
16
|
formData(formData: FormData): Promise<{}>;
|
|
16
17
|
};
|
|
17
18
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useResetPassword.d.ts","sourceRoot":"","sources":["../../../client/auth/useResetPassword.ts"],"names":[],"mappings":"AAEA,UAAU,oBAAoB;IAC5B,SAAS,EAAE,MAAM,IAAI,CAAC;CACvB;AAMD,wBAAgB,gBAAgB,CAAC,IAAI,GAAE,oBAAkC
|
|
1
|
+
{"version":3,"file":"useResetPassword.d.ts","sourceRoot":"","sources":["../../../client/auth/useResetPassword.ts"],"names":[],"mappings":"AAEA,UAAU,oBAAoB;IAC5B,SAAS,EAAE,MAAM,IAAI,CAAC;CACvB;AAMD,wBAAgB,gBAAgB,CAAC,IAAI,GAAE,oBAAkC;;;;;;;;;;;;;;EAUxE"}
|
|
@@ -14,13 +14,23 @@ export declare function useSignIn(args?: UseSignInArgs): {
|
|
|
14
14
|
};
|
|
15
15
|
error: import("gemi/client").MutationError;
|
|
16
16
|
loading: boolean;
|
|
17
|
+
pending: number;
|
|
17
18
|
formData: FormData;
|
|
18
19
|
cancel: () => void;
|
|
19
20
|
trigger: {
|
|
20
21
|
(input?: {
|
|
21
22
|
email: string;
|
|
22
23
|
password: string;
|
|
23
|
-
})
|
|
24
|
+
}, call?: import("../useMutation").MutationCallConfig<{
|
|
25
|
+
id: number;
|
|
26
|
+
publicId: string;
|
|
27
|
+
name: string | null;
|
|
28
|
+
email: string | null;
|
|
29
|
+
emailVerifiedAt: Date | null;
|
|
30
|
+
globalRole: number;
|
|
31
|
+
accounts: import("../../auth/types").Account[];
|
|
32
|
+
extension: Record<string, any>;
|
|
33
|
+
}>): Promise<{
|
|
24
34
|
id: number;
|
|
25
35
|
publicId: string;
|
|
26
36
|
name: string | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSignIn.d.ts","sourceRoot":"","sources":["../../../client/auth/useSignIn.tsx"],"names":[],"mappings":"AAGA,UAAU,aAAa;IACrB,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,IAAI,CAAC;CACjC;AAMD,wBAAgB,SAAS,CAAC,IAAI,GAAE,aAA2B
|
|
1
|
+
{"version":3,"file":"useSignIn.d.ts","sourceRoot":"","sources":["../../../client/auth/useSignIn.tsx"],"names":[],"mappings":"AAGA,UAAU,aAAa;IACrB,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,IAAI,CAAC;CACjC;AAMD,wBAAgB,SAAS,CAAC,IAAI,GAAE,aAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAe1D"}
|
|
@@ -5,10 +5,11 @@ export declare function useSignOut(args?: UseSignOutArgs): {
|
|
|
5
5
|
data: {};
|
|
6
6
|
error: import("gemi/client").MutationError;
|
|
7
7
|
loading: boolean;
|
|
8
|
+
pending: number;
|
|
8
9
|
formData: FormData;
|
|
9
10
|
cancel: () => void;
|
|
10
11
|
trigger: {
|
|
11
|
-
(input?: Record<string, never>): Promise<{}>;
|
|
12
|
+
(input?: Record<string, never>, call?: import("../useMutation").MutationCallConfig<{}>): Promise<{}>;
|
|
12
13
|
formData(formData: FormData): Promise<{}>;
|
|
13
14
|
};
|
|
14
15
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSignOut.d.ts","sourceRoot":"","sources":["../../../client/auth/useSignOut.ts"],"names":[],"mappings":"AAGA,UAAU,cAAc;IACtB,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;CACxB;AAMD,wBAAgB,UAAU,CAAC,IAAI,GAAE,cAA4B
|
|
1
|
+
{"version":3,"file":"useSignOut.d.ts","sourceRoot":"","sources":["../../../client/auth/useSignOut.ts"],"names":[],"mappings":"AAGA,UAAU,cAAc;IACtB,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;CACxB;AAMD,wBAAgB,UAAU,CAAC,IAAI,GAAE,cAA4B;;;;;;;;;;;EAY5D"}
|
|
@@ -2,10 +2,11 @@ export declare function useSignUp(): {
|
|
|
2
2
|
data: import("../../auth/types").User;
|
|
3
3
|
error: import("gemi/client").MutationError;
|
|
4
4
|
loading: boolean;
|
|
5
|
+
pending: number;
|
|
5
6
|
formData: FormData;
|
|
6
7
|
cancel: () => void;
|
|
7
8
|
trigger: {
|
|
8
|
-
(input?: import("../../http/HttpRequest").Body): Promise<import("../../auth/types").User>;
|
|
9
|
+
(input?: import("../../http/HttpRequest").Body, call?: import("../useMutation").MutationCallConfig<import("../../auth/types").User>): Promise<import("../../auth/types").User>;
|
|
9
10
|
formData(formData: FormData): Promise<import("../../auth/types").User>;
|
|
10
11
|
};
|
|
11
12
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSignUp.d.ts","sourceRoot":"","sources":["../../../client/auth/useSignUp.ts"],"names":[],"mappings":"AAEA,wBAAgB,SAAS
|
|
1
|
+
{"version":3,"file":"useSignUp.d.ts","sourceRoot":"","sources":["../../../client/auth/useSignUp.ts"],"names":[],"mappings":"AAEA,wBAAgB,SAAS;;;;;;;;;;;EAExB"}
|
package/dist/client/index.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export { QueryError } from "./QueryError";
|
|
|
7
7
|
export { isRetryableQueryError } from "./retryPolicy";
|
|
8
8
|
export type { QueryFailure, RetryOption, RetryDelayOption, } from "./retryPolicy";
|
|
9
9
|
export { useMutation, useDelete, usePatch, usePost, usePut, useUpload } from "./useMutation";
|
|
10
|
+
export type { MutationCallConfig, MutationConcurrency } from "./useMutation";
|
|
10
11
|
export { useMutate } from "./useMutate";
|
|
11
12
|
export { isValidationError, isFormError, isAuthenticationError, isPermissionError, isCsrfError, isNotFoundError, isRateLimitError, isServerError, isNetworkError, mutationErrorKind, } from "./MutationError";
|
|
12
13
|
export type { MutationError, MutationErrorKind, MutationValidationError, MutationFormError, MutationServerError, MutationRefusal, MutationRefusalKind, MutationMessageError, } from "./MutationError";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../client/index.ts"],"names":[],"mappings":";AAMA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,YAAY,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AACjE,OAAO,EAAE,gBAAg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E,MAAM,kBAAkB,CAAC;AAElD,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC"}
|
package/dist/client/index.js
CHANGED
|
@@ -652,26 +652,49 @@ function useMutation(method, url, ...args) {
|
|
|
652
652
|
const [state, setState] = useState({
|
|
653
653
|
data: null,
|
|
654
654
|
error: null,
|
|
655
|
-
loading: false
|
|
655
|
+
loading: false,
|
|
656
|
+
pending: 0
|
|
656
657
|
});
|
|
657
658
|
const abortController = useRef(new AbortController());
|
|
658
659
|
const latestRequest = useRef(0);
|
|
660
|
+
const inFlight = useRef(/* @__PURE__ */ new Set());
|
|
659
661
|
const formData = useRef(new FormData());
|
|
660
662
|
const [inputs = {}, config] = args ?? [];
|
|
661
663
|
const options = {
|
|
662
664
|
...defaultOptions,
|
|
663
665
|
...config
|
|
664
666
|
};
|
|
665
|
-
|
|
667
|
+
const parallel = options.concurrency === "parallel";
|
|
668
|
+
async function trigger(input, call = {}) {
|
|
666
669
|
const controller = new AbortController();
|
|
667
670
|
abortController.current = controller;
|
|
671
|
+
if (parallel) inFlight.current.add(controller);
|
|
668
672
|
const requestId = ++latestRequest.current;
|
|
669
|
-
const
|
|
673
|
+
const isSuperseded = () => !parallel && latestRequest.current !== requestId;
|
|
670
674
|
setState((prev) => ({
|
|
671
675
|
data: prev.data,
|
|
672
|
-
error: null,
|
|
673
|
-
loading: true
|
|
676
|
+
error: parallel ? prev.error : null,
|
|
677
|
+
loading: true,
|
|
678
|
+
pending: prev.pending + 1
|
|
674
679
|
}));
|
|
680
|
+
let left = false;
|
|
681
|
+
const settle = (update, superseded = false) => {
|
|
682
|
+
inFlight.current.delete(controller);
|
|
683
|
+
const leaving = !left;
|
|
684
|
+
left = true;
|
|
685
|
+
setState((prev) => {
|
|
686
|
+
const pending = leaving ? prev.pending - 1 : prev.pending;
|
|
687
|
+
return {
|
|
688
|
+
...update(prev),
|
|
689
|
+
pending,
|
|
690
|
+
loading: parallel ? pending > 0 : superseded ? prev.loading : false
|
|
691
|
+
};
|
|
692
|
+
});
|
|
693
|
+
};
|
|
694
|
+
const sentFormData = typeof input === "undefined" ? formData.current : null;
|
|
695
|
+
const resetFormData = () => {
|
|
696
|
+
if (!parallel || formData.current === sentFormData) formData.current = new FormData();
|
|
697
|
+
};
|
|
675
698
|
const params = "params" in inputs ? {
|
|
676
699
|
..._params,
|
|
677
700
|
...inputs.params
|
|
@@ -692,42 +715,45 @@ function useMutation(method, url, ...args) {
|
|
|
692
715
|
signal: controller.signal
|
|
693
716
|
});
|
|
694
717
|
const data = await response.json();
|
|
695
|
-
if (
|
|
696
|
-
|
|
718
|
+
if (isSuperseded()) {
|
|
719
|
+
settle((prev) => prev, true);
|
|
720
|
+
return;
|
|
721
|
+
}
|
|
722
|
+
resetFormData();
|
|
697
723
|
if (!response.ok) {
|
|
698
724
|
const error = mutationErrorFromBody(data, response.status);
|
|
699
|
-
|
|
725
|
+
settle((prev) => ({
|
|
700
726
|
data: prev.data,
|
|
701
|
-
error
|
|
702
|
-
loading: false
|
|
727
|
+
error
|
|
703
728
|
}));
|
|
704
729
|
options.onError(error);
|
|
730
|
+
call.onError?.(error);
|
|
705
731
|
return;
|
|
706
732
|
}
|
|
707
733
|
clearPrefetchCache?.();
|
|
708
734
|
options.onSuccess(data);
|
|
709
|
-
|
|
735
|
+
call.onSuccess?.(data);
|
|
736
|
+
settle(() => ({
|
|
710
737
|
data,
|
|
711
|
-
error: null
|
|
712
|
-
|
|
713
|
-
});
|
|
738
|
+
error: null
|
|
739
|
+
}));
|
|
714
740
|
return data;
|
|
715
741
|
} catch (error) {
|
|
716
|
-
if (
|
|
717
|
-
|
|
742
|
+
if (isSuperseded()) {
|
|
743
|
+
settle((prev) => prev, true);
|
|
744
|
+
return;
|
|
745
|
+
}
|
|
746
|
+
resetFormData();
|
|
718
747
|
if (error?.name === "AbortError") {
|
|
719
|
-
|
|
720
|
-
...prev,
|
|
721
|
-
loading: false
|
|
722
|
-
}));
|
|
748
|
+
settle((prev) => prev);
|
|
723
749
|
return;
|
|
724
750
|
}
|
|
725
751
|
options.onError(error);
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
});
|
|
752
|
+
call.onError?.(error);
|
|
753
|
+
settle((prev) => ({
|
|
754
|
+
data: parallel ? prev.data : null,
|
|
755
|
+
error
|
|
756
|
+
}));
|
|
731
757
|
}
|
|
732
758
|
}
|
|
733
759
|
trigger.formData = (formData) => {
|
|
@@ -737,13 +763,17 @@ function useMutation(method, url, ...args) {
|
|
|
737
763
|
data: state.data,
|
|
738
764
|
error: state.error,
|
|
739
765
|
loading: state.loading,
|
|
766
|
+
pending: state.pending,
|
|
740
767
|
formData: formData.current,
|
|
741
768
|
cancel: () => {
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
769
|
+
if (parallel) for (const controller of inFlight.current) controller.abort();
|
|
770
|
+
else {
|
|
771
|
+
abortController.current.abort();
|
|
772
|
+
setState((prev) => ({
|
|
773
|
+
...prev,
|
|
774
|
+
loading: false
|
|
775
|
+
}));
|
|
776
|
+
}
|
|
747
777
|
formData.current = new FormData();
|
|
748
778
|
options.onCanceled?.();
|
|
749
779
|
},
|