gemi 0.178.0 → 0.180.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/ai/index.js +2 -2
- package/dist/ai/index.js.map +1 -1
- package/dist/app/index.js +1 -1
- package/dist/auth/AuthManager.d.ts +5 -4
- package/dist/auth/AuthManager.d.ts.map +1 -1
- package/dist/auth/UserProvider.d.ts +1 -1
- package/dist/auth/UserProvider.d.ts.map +1 -1
- package/dist/auth/connections/ConnectionManager.d.ts +7 -0
- package/dist/auth/connections/ConnectionManager.d.ts.map +1 -1
- package/dist/auth/connections/InstagramPublisher.d.ts +186 -0
- package/dist/auth/connections/InstagramPublisher.d.ts.map +1 -0
- package/dist/auth/oauth/instagram.d.ts +6 -0
- package/dist/auth/oauth/instagram.d.ts.map +1 -1
- package/dist/bun/plugin.js +1 -1
- package/dist/bun/preload.js +1 -1
- package/dist/{chunk-bhaae60h.js → chunk-47cjayhh.js} +4 -4
- package/dist/{chunk-bhaae60h.js.map → chunk-47cjayhh.js.map} +3 -3
- package/dist/{chunk-a2r94jbz.js → chunk-4hj0q8fs.js} +2 -2
- package/dist/{chunk-a2r94jbz.js.map → chunk-4hj0q8fs.js.map} +1 -1
- package/dist/{chunk-ygdmm1h4.js → chunk-520hnb9j.js} +2 -2
- package/dist/{chunk-ygdmm1h4.js.map → chunk-520hnb9j.js.map} +1 -1
- package/dist/{chunk-hthdwnfr.js → chunk-5cf61bb5.js} +2 -2
- package/dist/{chunk-hthdwnfr.js.map → chunk-5cf61bb5.js.map} +1 -1
- package/dist/{chunk-pv3152gj.js → chunk-5db4v8gv.js} +1 -1
- package/dist/{chunk-10ap3vpj.js → chunk-5v07y14d.js} +2 -2
- package/dist/{chunk-10ap3vpj.js.map → chunk-5v07y14d.js.map} +1 -1
- package/dist/{chunk-yhdwr77h.js → chunk-6nrd3djs.js} +2 -2
- package/dist/{chunk-yhdwr77h.js.map → chunk-6nrd3djs.js.map} +1 -1
- package/dist/{chunk-x9h1hchj.js → chunk-6t9zjhm6.js} +2 -2
- package/dist/{chunk-x9h1hchj.js.map → chunk-6t9zjhm6.js.map} +1 -1
- package/dist/{chunk-mg9m53kk.js → chunk-6vdvhj14.js} +2 -2
- package/dist/{chunk-mg9m53kk.js.map → chunk-6vdvhj14.js.map} +1 -1
- package/dist/{chunk-p779zv1n.js → chunk-6wwk0psy.js} +2 -2
- package/dist/{chunk-p779zv1n.js.map → chunk-6wwk0psy.js.map} +1 -1
- package/dist/{chunk-e4f6xw7b.js → chunk-6x3315an.js} +2 -2
- package/dist/{chunk-e4f6xw7b.js.map → chunk-6x3315an.js.map} +1 -1
- package/dist/{chunk-n8egkp1k.js → chunk-7jxf0kys.js} +2 -2
- package/dist/{chunk-n8egkp1k.js.map → chunk-7jxf0kys.js.map} +1 -1
- package/dist/{chunk-c6ms23fk.js → chunk-8v95cjc5.js} +2 -2
- package/dist/{chunk-c6ms23fk.js.map → chunk-8v95cjc5.js.map} +1 -1
- package/dist/{chunk-hmvbj1rq.js → chunk-8zwm5n7d.js} +2 -2
- package/dist/{chunk-hmvbj1rq.js.map → chunk-8zwm5n7d.js.map} +1 -1
- package/dist/{chunk-gr4vynwd.js → chunk-93s13x3v.js} +2 -2
- package/dist/{chunk-gr4vynwd.js.map → chunk-93s13x3v.js.map} +1 -1
- package/dist/{chunk-nwdtdq2k.js → chunk-9522w4e4.js} +2 -2
- package/dist/{chunk-nwdtdq2k.js.map → chunk-9522w4e4.js.map} +1 -1
- package/dist/{chunk-5yjseh8g.js → chunk-9mcweetq.js} +2 -2
- package/dist/{chunk-5yjseh8g.js.map → chunk-9mcweetq.js.map} +1 -1
- package/dist/{chunk-3szc00gq.js → chunk-b53n5696.js} +2 -2
- package/dist/{chunk-3szc00gq.js.map → chunk-b53n5696.js.map} +1 -1
- package/dist/{chunk-eq252sbg.js → chunk-bm2zz2j1.js} +2 -2
- package/dist/{chunk-eq252sbg.js.map → chunk-bm2zz2j1.js.map} +1 -1
- package/dist/{chunk-gr625kyj.js → chunk-bptarxbq.js} +2 -2
- package/dist/{chunk-gr625kyj.js.map → chunk-bptarxbq.js.map} +1 -1
- package/dist/{chunk-7e1fgzcv.js → chunk-cv496s8h.js} +2 -2
- package/dist/{chunk-7e1fgzcv.js.map → chunk-cv496s8h.js.map} +1 -1
- package/dist/{chunk-jj4w6ce5.js → chunk-czzyrw7d.js} +2 -2
- package/dist/{chunk-jj4w6ce5.js.map → chunk-czzyrw7d.js.map} +1 -1
- package/dist/{chunk-a2br22hp.js → chunk-dp5ha6qy.js} +2 -2
- package/dist/{chunk-a2br22hp.js.map → chunk-dp5ha6qy.js.map} +1 -1
- package/dist/{chunk-8bnmvhrv.js → chunk-e14fgtk1.js} +2 -2
- package/dist/{chunk-8bnmvhrv.js.map → chunk-e14fgtk1.js.map} +1 -1
- package/dist/{chunk-tpx30rbj.js → chunk-e7hb47yy.js} +2 -2
- package/dist/{chunk-tpx30rbj.js.map → chunk-e7hb47yy.js.map} +1 -1
- package/dist/{chunk-5zfwvabd.js → chunk-gjb7cfr4.js} +2 -2
- package/dist/{chunk-5zfwvabd.js.map → chunk-gjb7cfr4.js.map} +1 -1
- package/dist/chunk-gtfwk0ss.js +15 -0
- package/dist/{chunk-5d7qhnt9.js.map → chunk-gtfwk0ss.js.map} +5 -4
- package/dist/{chunk-rhqcv3te.js → chunk-hbjatkm9.js} +2 -2
- package/dist/{chunk-rhqcv3te.js.map → chunk-hbjatkm9.js.map} +1 -1
- package/dist/{chunk-bmzznzhz.js → chunk-hm1xy515.js} +3 -3
- package/dist/{chunk-bmzznzhz.js.map → chunk-hm1xy515.js.map} +1 -1
- package/dist/{chunk-y13dsype.js → chunk-ht0atvyc.js} +3 -3
- package/dist/{chunk-y13dsype.js.map → chunk-ht0atvyc.js.map} +1 -1
- package/dist/{chunk-q21wxx5y.js → chunk-jpq74abh.js} +1 -1
- package/dist/{chunk-96gnm8zb.js → chunk-jwvwve00.js} +2 -2
- package/dist/{chunk-96gnm8zb.js.map → chunk-jwvwve00.js.map} +1 -1
- package/dist/{chunk-hkjfyhv4.js → chunk-ks99tx7f.js} +2 -2
- package/dist/{chunk-hkjfyhv4.js.map → chunk-ks99tx7f.js.map} +1 -1
- package/dist/{chunk-344f6c5q.js → chunk-mby1wdny.js} +2 -2
- package/dist/{chunk-344f6c5q.js.map → chunk-mby1wdny.js.map} +1 -1
- package/dist/{chunk-tdbm67bb.js → chunk-me14hs9k.js} +2 -2
- package/dist/{chunk-tdbm67bb.js.map → chunk-me14hs9k.js.map} +1 -1
- package/dist/{chunk-cmjmy3gt.js → chunk-mpv431ga.js} +1 -1
- package/dist/{chunk-9tt0bb0p.js → chunk-najr8410.js} +2 -2
- package/dist/{chunk-9tt0bb0p.js.map → chunk-najr8410.js.map} +1 -1
- package/dist/{chunk-yszn7ses.js → chunk-nv2ecda9.js} +2 -2
- package/dist/{chunk-yszn7ses.js.map → chunk-nv2ecda9.js.map} +1 -1
- package/dist/{chunk-sq2ccgxy.js → chunk-nwg70wza.js} +3 -3
- package/dist/{chunk-sq2ccgxy.js.map → chunk-nwg70wza.js.map} +1 -1
- package/dist/{chunk-fsesx3mr.js → chunk-pqnva7v8.js} +2 -2
- package/dist/{chunk-fsesx3mr.js.map → chunk-pqnva7v8.js.map} +1 -1
- package/dist/{chunk-0mye000w.js → chunk-pw6ssy3a.js} +2 -2
- package/dist/{chunk-64m4fmf0.js.map → chunk-pw6ssy3a.js.map} +1 -1
- package/dist/{chunk-cnnmb8p3.js → chunk-q3g4xs1z.js} +2 -2
- package/dist/{chunk-cnnmb8p3.js.map → chunk-q3g4xs1z.js.map} +1 -1
- package/dist/{chunk-wap1efbn.js → chunk-qry4bf38.js} +5 -5
- package/dist/{chunk-wap1efbn.js.map → chunk-qry4bf38.js.map} +4 -4
- package/dist/{chunk-h2yyyzsv.js → chunk-r36kq8x1.js} +3 -3
- package/dist/{chunk-h2yyyzsv.js.map → chunk-r36kq8x1.js.map} +1 -1
- package/dist/{chunk-h3xpvksc.js → chunk-r7j4c5t2.js} +2 -2
- package/dist/{chunk-h3xpvksc.js.map → chunk-r7j4c5t2.js.map} +1 -1
- package/dist/{chunk-w1y6x2rm.js → chunk-rv0r5fde.js} +2 -2
- package/dist/{chunk-w1y6x2rm.js.map → chunk-rv0r5fde.js.map} +1 -1
- package/dist/{chunk-8ym912fj.js → chunk-s0m717j8.js} +3 -3
- package/dist/{chunk-8ym912fj.js.map → chunk-s0m717j8.js.map} +1 -1
- package/dist/{chunk-9nks1y2h.js → chunk-s208599z.js} +2 -2
- package/dist/{chunk-9nks1y2h.js.map → chunk-s208599z.js.map} +1 -1
- package/dist/{chunk-brcn3h9b.js → chunk-sen7c0e6.js} +3 -3
- package/dist/{chunk-brcn3h9b.js.map → chunk-sen7c0e6.js.map} +1 -1
- package/dist/{chunk-fbbqy4af.js → chunk-sr1gv50s.js} +2 -2
- package/dist/{chunk-fbbqy4af.js.map → chunk-sr1gv50s.js.map} +1 -1
- package/dist/{chunk-q5j1bwny.js → chunk-sx6jmyaf.js} +1 -1
- package/dist/{chunk-mkb9nt5n.js → chunk-tefb1nz7.js} +2 -2
- package/dist/{chunk-mkb9nt5n.js.map → chunk-tefb1nz7.js.map} +1 -1
- package/dist/{chunk-j6sbfa2q.js → chunk-tjmw2z5z.js} +2 -2
- package/dist/{chunk-j6sbfa2q.js.map → chunk-tjmw2z5z.js.map} +1 -1
- package/dist/{chunk-r4ewwmcr.js → chunk-tv13vbcm.js} +2 -2
- package/dist/{chunk-r4ewwmcr.js.map → chunk-tv13vbcm.js.map} +1 -1
- package/dist/{chunk-2cw1et3n.js → chunk-v8qzdvpj.js} +2 -2
- package/dist/{chunk-2cw1et3n.js.map → chunk-v8qzdvpj.js.map} +1 -1
- package/dist/{chunk-bcdst4fd.js → chunk-vhk6735r.js} +2 -2
- package/dist/{chunk-bcdst4fd.js.map → chunk-vhk6735r.js.map} +1 -1
- package/dist/chunk-vq2a7qd8.js +5 -0
- package/dist/{chunk-sz8w3kwt.js.map → chunk-vq2a7qd8.js.map} +1 -1
- package/dist/{chunk-q21p7bq9.js → chunk-vv1na1vj.js} +1 -1
- package/dist/{chunk-xvaan2fe.js → chunk-w6br58a9.js} +4 -4
- package/dist/{chunk-xvaan2fe.js.map → chunk-w6br58a9.js.map} +1 -1
- package/dist/{chunk-zn6j65pg.js → chunk-wjkcqe8w.js} +2 -2
- package/dist/{chunk-zn6j65pg.js.map → chunk-wjkcqe8w.js.map} +1 -1
- package/dist/{chunk-z0q126b1.js → chunk-wtjfjh0x.js} +2 -2
- package/dist/{chunk-z0q126b1.js.map → chunk-wtjfjh0x.js.map} +1 -1
- package/dist/{chunk-a4s0kf20.js → chunk-xgmc7cp5.js} +2 -2
- package/dist/{chunk-a4s0kf20.js.map → chunk-xgmc7cp5.js.map} +1 -1
- package/dist/{chunk-nbmzs80j.js → chunk-xvaryyd0.js} +2 -2
- package/dist/{chunk-nbmzs80j.js.map → chunk-xvaryyd0.js.map} +1 -1
- package/dist/{chunk-64m4fmf0.js → chunk-xzzdywf6.js} +2 -2
- package/dist/{chunk-0mye000w.js.map → chunk-xzzdywf6.js.map} +1 -1
- package/dist/{chunk-640mjh9h.js → chunk-y2rzqpgd.js} +2 -2
- package/dist/{chunk-640mjh9h.js.map → chunk-y2rzqpgd.js.map} +1 -1
- package/dist/{chunk-aat9zhrj.js → chunk-y3pnwpvp.js} +3 -3
- package/dist/{chunk-aat9zhrj.js.map → chunk-y3pnwpvp.js.map} +1 -1
- package/dist/{chunk-h9kgvg25.js → chunk-yef8dvmg.js} +2 -2
- package/dist/{chunk-h9kgvg25.js.map → chunk-yef8dvmg.js.map} +1 -1
- package/dist/{chunk-kx3etqsr.js → chunk-yx26j5vk.js} +2 -2
- package/dist/{chunk-kx3etqsr.js.map → chunk-yx26j5vk.js.map} +1 -1
- package/dist/{chunk-v9g2np6k.js → chunk-z8mq4g46.js} +2 -2
- package/dist/{chunk-v9g2np6k.js.map → chunk-z8mq4g46.js.map} +1 -1
- package/dist/{chunk-s1x12f0b.js → chunk-zd67c5rp.js} +2 -2
- package/dist/{chunk-s1x12f0b.js.map → chunk-zd67c5rp.js.map} +1 -1
- package/dist/{chunk-zczvbygf.js → chunk-zm4fdsq5.js} +2 -2
- package/dist/{chunk-zczvbygf.js.map → chunk-zm4fdsq5.js.map} +1 -1
- package/dist/{chunk-ay60f8dy.js → chunk-znrk326r.js} +1 -1
- package/dist/{chunk-574s5sgz.js → chunk-zpshgset.js} +2 -2
- package/dist/{chunk-574s5sgz.js.map → chunk-zpshgset.js.map} +1 -1
- package/dist/{chunk-nfx1p5z2.js → chunk-zrrpab1x.js} +3 -3
- package/dist/{chunk-nfx1p5z2.js.map → chunk-zrrpab1x.js.map} +1 -1
- package/dist/{chunk-8tyxtp36.js → chunk-zx5tp1c6.js} +2 -2
- package/dist/{chunk-8tyxtp36.js.map → chunk-zx5tp1c6.js.map} +1 -1
- package/dist/chunks/{RealtimeClient-DpAJYcF5.js → RealtimeClient-CHNbqDr7.js} +2 -2
- package/dist/chunks/{RealtimeClient-DpAJYcF5.js.map → RealtimeClient-CHNbqDr7.js.map} +1 -1
- package/dist/chunks/{ThemeProvider-DAbL-cqC.js → ThemeProvider-Bkc6A9Nn.js} +240 -9
- package/dist/chunks/ThemeProvider-Bkc6A9Nn.js.map +1 -0
- package/dist/chunks/{fetchFileRequest-yAKa_pKx.js → fetchFileRequest-BGEW4Wd7.js} +2 -2
- package/dist/chunks/{fetchFileRequest-yAKa_pKx.js.map → fetchFileRequest-BGEW4Wd7.js.map} +1 -1
- package/dist/chunks/{live-BvhWo-yY.js → live-l4vtaqXd.js} +3 -3
- package/dist/chunks/{live-BvhWo-yY.js.map → live-l4vtaqXd.js.map} +1 -1
- package/dist/chunks/{mutationExtras-_hbHxr6-.js → mutationExtras-C7UPW9XP.js} +2 -2
- package/dist/chunks/{mutationExtras-_hbHxr6-.js.map → mutationExtras-C7UPW9XP.js.map} +1 -1
- package/dist/client/ClientRouter.d.ts.map +1 -1
- package/dist/client/QueryResource.d.ts.map +1 -1
- package/dist/client/authenticationErrors.d.ts +116 -0
- package/dist/client/authenticationErrors.d.ts.map +1 -0
- package/dist/client/index.d.ts +1 -0
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +41 -53
- package/dist/client/index.js.map +1 -1
- package/dist/client/init.d.ts +15 -0
- package/dist/client/init.d.ts.map +1 -1
- package/dist/client/retryPolicy.d.ts +14 -3
- package/dist/client/retryPolicy.d.ts.map +1 -1
- package/dist/client/useMutation.d.ts.map +1 -1
- package/dist/config/index.js +1 -1
- package/dist/console/run.js +2 -2
- package/dist/console/run.js.map +1 -1
- package/dist/container/index.js +2 -2
- package/dist/container/index.js.map +1 -1
- package/dist/database/index.js +2 -2
- package/dist/database/index.js.map +1 -1
- package/dist/email/index.js +2 -2
- package/dist/email/index.js.map +1 -1
- package/dist/facades/index.js +2 -2
- package/dist/facades/index.js.map +1 -1
- package/dist/foundation/index.js +2 -2
- package/dist/foundation/index.js.map +1 -1
- package/dist/http/errors.d.ts.map +1 -1
- package/dist/http/index.js +2 -2
- package/dist/http/index.js.map +1 -1
- package/dist/http/signInHeader.d.ts +14 -0
- package/dist/http/signInHeader.d.ts.map +1 -0
- package/dist/i18n/dictionaryRuntime.js +2 -2
- package/dist/i18n/dictionaryRuntime.js.map +1 -1
- package/dist/i18n/index.js +2 -2
- package/dist/i18n/index.js.map +1 -1
- package/dist/kernel/index.js +2 -2
- package/dist/kernel/index.js.map +1 -1
- package/dist/orm/index.js +2 -2
- package/dist/orm/index.js.map +1 -1
- package/dist/probe/index.js +2 -2
- package/dist/probe/index.js.map +1 -1
- package/dist/server/index.js +2 -2
- package/dist/server/index.js.map +1 -1
- package/dist/services/index.d.ts +2 -0
- package/dist/services/index.d.ts.map +1 -1
- package/dist/services/index.js +13 -13
- package/dist/services/index.js.map +5 -4
- package/dist/services/queue/work.js +2 -2
- package/dist/services/queue/work.js.map +1 -1
- package/dist/stats/route-table.js +1 -1
- package/dist/support/index.js +2 -2
- package/dist/support/index.js.map +1 -1
- package/dist/testing/index.js +2 -2
- package/dist/vitest/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-5d7qhnt9.js +0 -15
- package/dist/chunk-sz8w3kwt.js +0 -5
- package/dist/chunks/ThemeProvider-DAbL-cqC.js.map +0 -1
- /package/dist/{chunk-pv3152gj.js.map → chunk-5db4v8gv.js.map} +0 -0
- /package/dist/{chunk-q21wxx5y.js.map → chunk-jpq74abh.js.map} +0 -0
- /package/dist/{chunk-cmjmy3gt.js.map → chunk-mpv431ga.js.map} +0 -0
- /package/dist/{chunk-q5j1bwny.js.map → chunk-sx6jmyaf.js.map} +0 -0
- /package/dist/{chunk-q21p7bq9.js.map → chunk-vv1na1vj.js.map} +0 -0
- /package/dist/{chunk-ay60f8dy.js.map → chunk-znrk326r.js.map} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { X as applyParams,
|
|
1
|
+
import { X as applyParams, ft as parseRetryAfter, ht as QueryError } from "./ThemeProvider-Bkc6A9Nn.js";
|
|
2
2
|
//#region client/fetchFileRequest.ts
|
|
3
3
|
/**
|
|
4
4
|
* `fetchBlob` / `fetchText` once loaded: the `GET`, a `QueryError` for a
|
|
@@ -54,4 +54,4 @@ function filenameOf(response) {
|
|
|
54
54
|
//#endregion
|
|
55
55
|
export { fetchFile, filenameOf };
|
|
56
56
|
|
|
57
|
-
//# sourceMappingURL=fetchFileRequest-
|
|
57
|
+
//# sourceMappingURL=fetchFileRequest-BGEW4Wd7.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetchFileRequest-
|
|
1
|
+
{"version":3,"file":"fetchFileRequest-BGEW4Wd7.js","names":[],"sources":["../../client/fetchFileRequest.ts"],"sourcesContent":["import { applyParams } from \"../utils/applyParams\";\nimport type { FetchedBlob, FetchedText, FetchFileOptions } from \"./fetchFile\";\nimport { QueryError } from \"./QueryError\";\nimport { parseRetryAfter } from \"./retryPolicy\";\n\n// What `fetchBlob` and `fetchText` in `./fetchFile` load on their first call\n// (#915).\n\ntype RequestOptions = Omit<FetchFileOptions<string>, \"params\"> & {\n params?: Record<string, string | number | undefined>;\n};\n\n/**\n * `fetchBlob` / `fetchText` once loaded: the `GET`, a `QueryError` for a\n * non-2xx, and the body read `as` a blob or text.\n */\nexport async function fetchFile(\n path: string,\n // The caller's `FetchFileOptions<P>`, checked against its path there.\n options: object | undefined,\n as: \"blob\" | \"text\",\n): Promise<FetchedBlob | FetchedText> {\n const response = await request(path, options as RequestOptions);\n const body = as === \"blob\" ? { blob: await response.blob() } : { text: await response.text() };\n return { ...body, filename: filenameOf(response), response } as FetchedBlob | FetchedText;\n}\n\nasync function request(path: string, options: RequestOptions = {}) {\n const { params = {}, search, signal, init } = options;\n const url = applyParams(path, params);\n const query = searchString(search);\n const response = await fetch(`/api${url}${query ? `?${query}` : \"\"}`, {\n ...init,\n method: \"GET\",\n signal,\n });\n if (!response.ok) {\n // An error body that is not JSON (a proxy's HTML 502) is still that status.\n const body = await response.json().catch(() => null);\n throw new QueryError(\n url,\n query,\n response.status,\n body,\n parseRetryAfter(response.headers.get(\"retry-after\")),\n );\n }\n return response;\n}\n\nfunction searchString(search: FetchFileOptions<string>[\"search\"]) {\n if (!search) return \"\";\n if (search instanceof URLSearchParams) return search.toString();\n const params = new URLSearchParams();\n for (const [key, value] of Object.entries(search)) {\n if (value !== null && value !== undefined) params.append(key, String(value));\n }\n return params.toString();\n}\n\n/**\n * The file name in a `Content-Disposition` header: the RFC 5987\n * `filename*=UTF-8''...` form when present and decodable, else `filename`.\n *\n * @internal Exported for tests.\n */\nexport function filenameOf(response: Response): string | null {\n const header = response.headers.get(\"content-disposition\");\n if (!header) return null;\n const extended = /filename\\*\\s*=\\s*([^']*)'[^']*'([^;]+)/i.exec(header);\n if (extended) {\n try {\n return decodeURIComponent(extended[2].trim());\n } catch {\n // A malformed escape: fall back to the plain form.\n }\n }\n const plain = /filename\\s*=\\s*(?:\"((?:[^\"\\\\]|\\\\.)*)\"|([^;]+))/i.exec(header);\n if (!plain) return null;\n const name = plain[1] !== undefined ? plain[1].replace(/\\\\(.)/g, \"$1\") : plain[2].trim();\n return name || null;\n}\n"],"mappings":";;;;;;AAgBA,eAAsB,UACpB,MAEA,SACA,IACoC;CACpC,MAAM,WAAW,MAAM,QAAQ,MAAM,OAAyB;CAE9D,OAAO;EAAE,GADI,OAAO,SAAS,EAAE,MAAM,MAAM,SAAS,KAAK,EAAE,IAAI,EAAE,MAAM,MAAM,SAAS,KAAK,EAAE;EAC3E,UAAU,WAAW,QAAQ;EAAG;CAAS;AAC7D;AAEA,eAAe,QAAQ,MAAc,UAA0B,CAAC,GAAG;CACjE,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,QAAQ,SAAS;CAC9C,MAAM,MAAM,YAAY,MAAM,MAAM;CACpC,MAAM,QAAQ,aAAa,MAAM;CACjC,MAAM,WAAW,MAAM,MAAM,OAAO,MAAM,QAAQ,IAAI,UAAU,MAAM;EACpE,GAAG;EACH,QAAQ;EACR;CACF,CAAC;CACD,IAAI,CAAC,SAAS,IAAI;EAEhB,MAAM,OAAO,MAAM,SAAS,KAAK,CAAC,CAAC,YAAY,IAAI;EACnD,MAAM,IAAI,WACR,KACA,OACA,SAAS,QACT,MACA,gBAAgB,SAAS,QAAQ,IAAI,aAAa,CAAC,CACrD;CACF;CACA,OAAO;AACT;AAEA,SAAS,aAAa,QAA4C;CAChE,IAAI,CAAC,QAAQ,OAAO;CACpB,IAAI,kBAAkB,iBAAiB,OAAO,OAAO,SAAS;CAC9D,MAAM,SAAS,IAAI,gBAAgB;CACnC,KAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAAQ,MAAM,GAC9C,IAAI,UAAU,QAAQ,UAAU,KAAA,GAAW,OAAO,OAAO,KAAK,OAAO,KAAK,CAAC;CAE7E,OAAO,OAAO,SAAS;AACzB;;;;;;;AAQA,SAAgB,WAAW,UAAmC;CAC5D,MAAM,SAAS,SAAS,QAAQ,IAAI,qBAAqB;CACzD,IAAI,CAAC,QAAQ,OAAO;CACpB,MAAM,WAAW,0CAA0C,KAAK,MAAM;CACtE,IAAI,UACF,IAAI;EACF,OAAO,mBAAmB,SAAS,EAAE,CAAC,KAAK,CAAC;CAC9C,QAAQ,CAER;CAEF,MAAM,QAAQ,kDAAkD,KAAK,MAAM;CAC3E,IAAI,CAAC,OAAO,OAAO;CAEnB,QADa,MAAM,OAAO,KAAA,IAAY,MAAM,EAAE,CAAC,QAAQ,UAAU,IAAI,IAAI,MAAM,EAAE,CAAC,KAAK,MACxE;AACjB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { G as realtime, J as loadedModule } from "./ThemeProvider-
|
|
1
|
+
import { G as realtime, J as loadedModule } from "./ThemeProvider-Bkc6A9Nn.js";
|
|
2
2
|
//#region \0rolldown/runtime.js
|
|
3
3
|
var __defProp = Object.defineProperty;
|
|
4
4
|
var __exportAll = (all, no_symbols) => {
|
|
@@ -76,7 +76,7 @@ function followLive(provided, live, resource, setOpen) {
|
|
|
76
76
|
};
|
|
77
77
|
const socket = provided ?? realtime.client;
|
|
78
78
|
if (socket) start(socket);
|
|
79
|
-
else import("./RealtimeClient-
|
|
79
|
+
else import("./RealtimeClient-CHNbqDr7.js").then((module) => start(loadedModule(module).tabClient())).catch(() => {});
|
|
80
80
|
return () => {
|
|
81
81
|
stop?.();
|
|
82
82
|
stop = null;
|
|
@@ -85,4 +85,4 @@ function followLive(provided, live, resource, setOpen) {
|
|
|
85
85
|
//#endregion
|
|
86
86
|
export { live_exports as n, followLive as t };
|
|
87
87
|
|
|
88
|
-
//# sourceMappingURL=live-
|
|
88
|
+
//# sourceMappingURL=live-l4vtaqXd.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"live-
|
|
1
|
+
{"version":3,"file":"live-l4vtaqXd.js","names":[],"sources":["../../client/realtime/live.ts"],"sourcesContent":["import type { QueryResource } from \"../QueryResource\";\nimport type { ChannelPattern } from \"../useChannel\";\nimport { EVENT_COALESCE_MS } from \"./useChannelSubscription\";\nimport type { ChannelParamValues, RealtimeSocket } from \"./RealtimeClient\";\nimport { loadedModule } from \"../lazyModule\";\nimport { realtime } from \"./loader\";\n\n/**\n * `useQuery`'s `live` option: the channel whose events and resyncs refetch\n * the query. A pattern without params (`\"user\"`), `[pattern, params]`, or\n * `{ channel, params }`.\n */\nexport type LiveChannel =\n | ChannelPattern\n | readonly [ChannelPattern, ChannelParamValues]\n | { channel: ChannelPattern; params?: ChannelParamValues };\n\nexport function resolveLiveChannel(\n live: LiveChannel | null | undefined | false,\n): { pattern: string; params: ChannelParamValues } | null {\n if (!live) return null;\n if (typeof live === \"string\") return { pattern: live, params: {} };\n if (Array.isArray(live)) return { pattern: live[0], params: live[1] ?? {} };\n const object = live as { channel: string; params?: ChannelParamValues };\n return { pattern: object.channel, params: object.params ?? {} };\n}\n\n/**\n * `useQuery`'s `live` subscription, loaded on first use by `followLive` in\n * `./loader` (#891). The channel's events refetch every cached variant of the\n * query (the rendered ones now), a burst of them once per\n * `EVENT_COALESCE_MS`; a resync refetches at once. `setOpen` follows whether\n * the channel is open, which pauses the query's polling.\n */\nexport function subscribeLive(\n socket: RealtimeSocket,\n live: LiveChannel,\n resource: () => QueryResource,\n setOpen: (open: boolean) => void,\n): () => void {\n const channel = resolveLiveChannel(live);\n if (!channel) return () => {};\n const refresh = () => {\n const target = resource();\n for (const key of target.variantKeys()) target.invalidate(key);\n };\n let timer: ReturnType<typeof setTimeout> | null = null;\n const release = socket.subscribe(channel.pattern, channel.params, {\n onEvent: () => {\n if (timer) return;\n timer = setTimeout(() => {\n timer = null;\n refresh();\n }, EVENT_COALESCE_MS);\n },\n onResync: refresh,\n onStatus: (status) => setOpen(status === \"open\"),\n });\n return () => {\n if (timer) clearTimeout(timer);\n release();\n };\n}\n\n/**\n * What `followLive` in `./loader` hands over to once this module is loaded:\n * subscribes on the provided socket, or the tab's client, loading that first\n * when it is not there yet. Returns the function that stops it.\n */\nexport function followLive(\n provided: RealtimeSocket | null,\n live: LiveChannel,\n resource: () => QueryResource,\n setOpen: (open: boolean) => void,\n): () => void {\n // `undefined` until it subscribes, `null` once stopped.\n let stop: (() => void) | null | undefined;\n const start = (socket: RealtimeSocket) => {\n if (stop === undefined) stop = subscribeLive(socket, live, resource, setOpen);\n };\n const socket = provided ?? realtime.client;\n if (socket) start(socket);\n // Its own `import()` of the client rather than `loadRealtimeClient`, which\n // would keep that in the entry chunk of every app with a `useQuery`. A\n // failed load leaves the channel closed, so the query keeps polling.\n else\n import(\"./RealtimeClient.js\")\n .then((module) => start(loadedModule(module).tabClient()))\n .catch(() => {});\n return () => {\n stop?.();\n stop = null;\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAiBA,SAAgB,mBACd,MACwD;CACxD,IAAI,CAAC,MAAM,OAAO;CAClB,IAAI,OAAO,SAAS,UAAU,OAAO;EAAE,SAAS;EAAM,QAAQ,CAAC;CAAE;CACjE,IAAI,MAAM,QAAQ,IAAI,GAAG,OAAO;EAAE,SAAS,KAAK;EAAI,QAAQ,KAAK,MAAM,CAAC;CAAE;CAC1E,MAAM,SAAS;CACf,OAAO;EAAE,SAAS,OAAO;EAAS,QAAQ,OAAO,UAAU,CAAC;CAAE;AAChE;;;;;;;;AASA,SAAgB,cACd,QACA,MACA,UACA,SACY;CACZ,MAAM,UAAU,mBAAmB,IAAI;CACvC,IAAI,CAAC,SAAS,aAAa,CAAC;CAC5B,MAAM,gBAAgB;EACpB,MAAM,SAAS,SAAS;EACxB,KAAK,MAAM,OAAO,OAAO,YAAY,GAAG,OAAO,WAAW,GAAG;CAC/D;CACA,IAAI,QAA8C;CAClD,MAAM,UAAU,OAAO,UAAU,QAAQ,SAAS,QAAQ,QAAQ;EAChE,eAAe;GACb,IAAI,OAAO;GACX,QAAQ,iBAAiB;IACvB,QAAQ;IACR,QAAQ;GACV,GAAA,GAAoB;EACtB;EACA,UAAU;EACV,WAAW,WAAW,QAAQ,WAAW,MAAM;CACjD,CAAC;CACD,aAAa;EACX,IAAI,OAAO,aAAa,KAAK;EAC7B,QAAQ;CACV;AACF;;;;;;AAOA,SAAgB,WACd,UACA,MACA,UACA,SACY;CAEZ,IAAI;CACJ,MAAM,SAAS,WAA2B;EACxC,IAAI,SAAS,KAAA,GAAW,OAAO,cAAc,QAAQ,MAAM,UAAU,OAAO;CAC9E;CACA,MAAM,SAAS,YAAY,SAAS;CACpC,IAAI,QAAQ,MAAM,MAAM;MAKtB,OAAO,+BAAsB,CAC1B,MAAM,WAAW,MAAM,aAAa,MAAM,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CACzD,YAAY,CAAC,CAAC;CACnB,aAAa;EACX,OAAO;EACP,OAAO;CACT;AACF"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { X as applyParams, Y as toVariantKey } from "./ThemeProvider-
|
|
1
|
+
import { X as applyParams, Y as toVariantKey } from "./ThemeProvider-Bkc6A9Nn.js";
|
|
2
2
|
import { p as mutationErrorFromBody, s as isObject } from "./MutationError-DuKqBW8o.js";
|
|
3
3
|
//#region client/mutationErrorHelpers.ts
|
|
4
4
|
var FALLBACK_MESSAGE = "Something went wrong. Try again.";
|
|
@@ -112,4 +112,4 @@ function applyQueryUpdates(getResource, routeParams, updates, answer) {
|
|
|
112
112
|
//#endregion
|
|
113
113
|
export { applyQueryUpdates, withMutationErrorHelpers, writeQueryData };
|
|
114
114
|
|
|
115
|
-
//# sourceMappingURL=mutationExtras-
|
|
115
|
+
//# sourceMappingURL=mutationExtras-C7UPW9XP.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mutationExtras-
|
|
1
|
+
{"version":3,"file":"mutationExtras-C7UPW9XP.js","names":[],"sources":["../../client/mutationErrorHelpers.ts","../../client/queryUpdates.ts"],"sourcesContent":["import {\n isObject,\n mutationErrorFromBody,\n type MutationErrorHelpers,\n type MutationValidationError,\n type WithMutationErrorHelpers,\n} from \"./MutationError\";\n\n// `error.list()` and `error.field(name)` on what the mutation hooks hand over.\n// Loaded with the hooks' other extras when one mounts (see\n// `./mutationModules`), so no route's entry chunk carries it (#915).\n//\n// `list` and `field` repeat `mutationErrorList` and `mutationErrorField` from\n// `./MutationError` on purpose. Those are public and synchronous, so they sit\n// in whatever chunk calls them; importing them here would put them, and so\n// this code, back in every entry chunk. `MutationError.helpers.test` runs the\n// same cases through both.\n\nconst FALLBACK_MESSAGE = \"Something went wrong. Try again.\";\n\n// `isValidationError`, which an import would keep in the entry chunk.\nfunction isValidationError(error: unknown): error is MutationValidationError {\n return isObject(error) && error.kind === \"validation_error\";\n}\n\n// A `QueryError`'s refusal, read as the mutation hooks read a body. Read by\n// shape, not `instanceof`, so a copy of the class from another bundle works.\nfunction unwrapQueryError(error: unknown): unknown {\n if (error instanceof Error && error.name === \"QueryError\" && \"body\" in error) {\n const { body, status } = error as Error & { body: unknown; status: number };\n return body == null ? error : mutationErrorFromBody(body, status);\n }\n return error;\n}\n\n// `error.list(fallback)`: see `mutationErrorList`.\nfunction list(\n error: unknown,\n fallback: string = FALLBACK_MESSAGE,\n): string[] {\n const value = unwrapQueryError(error);\n if (isValidationError(value)) {\n const messages = Object.values(value.messages ?? {})\n .flat()\n .filter((message) => typeof message === \"string\" && message !== \"\");\n return messages.length > 0 ? messages : [fallback];\n }\n if (\n isObject(value) &&\n !(value instanceof Error) &&\n value.kind !== \"server_error\" &&\n typeof value.message === \"string\" &&\n value.message !== \"\"\n ) {\n return [value.message];\n }\n return [fallback];\n}\n\n// `error.field(name)`: see `mutationErrorField`.\nfunction field(error: unknown, name: string): string[] {\n const value = unwrapQueryError(error);\n if (!isValidationError(value)) return [];\n const messages = value.messages?.[name];\n return Array.isArray(messages) ? [...messages] : [];\n}\n\n/**\n * Puts `list` and `field` on an error the hooks hand over, as non-enumerable\n * properties, so `toEqual`, a spread and `JSON.stringify` see the same object\n * as before. A key the error already has is left alone; a primitive or a\n * frozen value is returned as it is.\n *\n * @internal\n */\nexport function withMutationErrorHelpers<T>(error: T): WithMutationErrorHelpers<T> {\n if (!isObject(error) || !Object.isExtensible(error)) {\n return error as WithMutationErrorHelpers<T>;\n }\n const helpers: MutationErrorHelpers = {\n list: (fallback) => list(error, fallback),\n field: (name) => field(error, name),\n };\n for (const key of [\"list\", \"field\"] as const) {\n if (key in error) continue;\n Object.defineProperty(error, key, {\n value: helpers[key],\n configurable: true,\n writable: true,\n enumerable: false,\n });\n }\n return error as WithMutationErrorHelpers<T>;\n}\n","import type { QueryResource } from \"./QueryResource\";\nimport type { QueryTarget, QueryUpdate } from \"./useSetQueryData\";\nimport { applyParams } from \"../utils/applyParams\";\nimport { toVariantKey } from \"../utils/variantKey\";\n\n// The cache writes behind a mutation's `updates` and `useSetQueryData()`\n// (#897). Loaded with the hooks' other extras when one mounts (see\n// `./mutationModules`), so no route's entry chunk carries it (#915).\n\ntype Resolve = (key: string) => QueryResource;\n\n/**\n * Write data the server just produced (a mutation's answer) into a variant,\n * with no refetch: unlike `mutate`, the value is not a guess to reconcile.\n * The variant counts as freshly fetched, so its `staleTime` starts again, and\n * a GET already on the wire for it is dropped when it lands, since it may\n * carry the data from before the write. A reader suspended on the variant\n * wakes up with it (#897). Here rather than on `QueryResource`, which every\n * entry chunk carries (#915).\n */\nfunction setVariant(resource: QueryResource, variantKey: string, data: unknown) {\n resource.dropHttpCache(variantKey);\n resource.markApplied(variantKey);\n const store = resource.store.getValue();\n resource.fill(store, variantKey, data, Date.now());\n resource.store.next(store);\n}\n\n/** The value to write, or a function of the cached one. */\nexport type WriteQueryNext = { value: unknown } | { update: (current: any) => unknown };\n\n/**\n * Write into every variant `target` names. `next` is the value to write, or\n * a function of the cached value; a function skips a variant with nothing\n * cached. A value seeds a single variant that is not cached yet; a predicate\n * only ever reaches variants that are.\n */\nexport function writeQueryData(\n getResource: Resolve,\n routeParams: Record<string, any>,\n target: QueryTarget<any>,\n next: WriteQueryNext,\n) {\n const { path, params = {}, search = {} } = target;\n const resource = getResource(applyParams(String(path), { ...routeParams, ...params }));\n const write = (variantKey: string) => {\n if (\"value\" in next) {\n setVariant(resource, variantKey, next.value);\n return;\n }\n const state = resource.peek(variantKey);\n if (!state?.hasData) return;\n setVariant(resource, variantKey, next.update(state.data));\n };\n\n if (typeof search === \"function\") {\n for (const variantKey of resource.variantKeys()) {\n if (!resource.peek(variantKey)?.hasData) continue;\n if (search(new URLSearchParams(variantKey))) write(variantKey);\n }\n return;\n }\n write(toVariantKey(search));\n}\n\n/**\n * Write a mutation's `updates` with its answer.\n */\nexport function applyQueryUpdates(\n getResource: Resolve,\n routeParams: Record<string, any>,\n updates: ReadonlyArray<QueryUpdate<any>> | undefined,\n answer: unknown,\n) {\n for (const update of updates ?? []) {\n const { data } = update as { data?: (answer: any, current: any) => any };\n writeQueryData(\n getResource,\n routeParams,\n update,\n data ? { update: (current) => data(answer, current) } : { value: answer },\n );\n }\n}\n"],"mappings":";;;AAkBA,IAAM,mBAAmB;AAGzB,SAAS,kBAAkB,OAAkD;CAC3E,OAAO,SAAS,KAAK,KAAK,MAAM,SAAS;AAC3C;AAIA,SAAS,iBAAiB,OAAyB;CACjD,IAAI,iBAAiB,SAAS,MAAM,SAAS,gBAAgB,UAAU,OAAO;EAC5E,MAAM,EAAE,MAAM,WAAW;EACzB,OAAO,QAAQ,OAAO,QAAQ,sBAAsB,MAAM,MAAM;CAClE;CACA,OAAO;AACT;AAGA,SAAS,KACP,OACA,WAAmB,kBACT;CACV,MAAM,QAAQ,iBAAiB,KAAK;CACpC,IAAI,kBAAkB,KAAK,GAAG;EAC5B,MAAM,WAAW,OAAO,OAAO,MAAM,YAAY,CAAC,CAAC,CAAC,CACjD,KAAK,CAAC,CACN,QAAQ,YAAY,OAAO,YAAY,YAAY,YAAY,EAAE;EACpE,OAAO,SAAS,SAAS,IAAI,WAAW,CAAC,QAAQ;CACnD;CACA,IACE,SAAS,KAAK,KACd,EAAE,iBAAiB,UACnB,MAAM,SAAS,kBACf,OAAO,MAAM,YAAY,YACzB,MAAM,YAAY,IAElB,OAAO,CAAC,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AI,CAAC,OAAO,SAAS;EACrB,WAAW,UAAU,YAAY,KAAK,OAAO,MAAM,IAAI,CAAC;CAC1D;CAEA,IAAI,OAAO,WAAW,YAAY;EAChC,KAAK,MAAM,cAAc,SAAS,YAAY,GAAG;GAC/C,IAAI,CAAC,SAAS,KAAK,UAAU,CAAC,EAAE,SAAS;GACzC,IAAI,OAAO,IAAI,gBAAgB,UAAU,CAAC,GAAG,MAAM,UAAU;EAC/D;EACA;CACF;CACA,MAAM,aAAa,MAAM,CAAC;AAC5B;;;;AAKA,SAAgB,kBACd,aACA,aACA,SACA,QACA;CACA,KAAK,MAAM,UAAU,WAAW,CAAC,GAAG;EAClC,MAAM,EAAE,SAAS;EACjB,eACE,aACA,aACA,QACA,OAAO,EAAE,SAAS,YAAY,KAAK,QAAQ,OAAO,EAAE,IAAI,EAAE,OAAO,OAAO,CAC1E;CACF;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClientRouter.d.ts","sourceRoot":"","sources":["../../client/ClientRouter.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAqB,aAAa,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AAKpE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAO7C,OAAO,EAA6C,KAAK,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAKpG,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAGjC,OAAO,EAAyB,KAAK,eAAe,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"ClientRouter.d.ts","sourceRoot":"","sources":["../../client/ClientRouter.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAqB,aAAa,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AAKpE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAO7C,OAAO,EAA6C,KAAK,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAKpG,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAGjC,OAAO,EAAyB,KAAK,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAc/E,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,aAAa,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QACnC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,IAAI,CAAC,CAAC;KACrC;CACF;AAkGD,eAAO,MAAM,IAAI,8CACP;IACN,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,aAAa,CAAC;IACpB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,2DAA2D;IAC3D,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,6CAoDF,CAAC;AAqSF,eAAO,MAAM,YAAY,GAAI,OAAO;IAClC,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,OAAO,IAAI,CAAC,CAAC,CAAC;IACxD,sEAAsE;IACtE,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC;IAClD,UAAU,EAAE,aAAa,CAAC,eAAe,CAAC,CAAC;IAC3C,iEAAiE;IACjE,WAAW,CAAC,EAAE,WAAW,CAAC;CAC3B,4CAkDA,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QueryResource.d.ts","sourceRoot":"","sources":["../../client/QueryResource.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"QueryResource.d.ts","sourceRoot":"","sources":["../../client/QueryResource.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAM3C,KAAK,KAAK,GAAG;IACX,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,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|
|
3
|
+
* because nobody is signed in any more — the session expired while the tab
|
|
4
|
+
* stayed open (#1119).
|
|
5
|
+
*
|
|
6
|
+
* A page load or a navigation already handles that: the server answers with a
|
|
7
|
+
* redirect to sign-in. An `/api` request only gets a 401, which a query stores
|
|
8
|
+
* as its error (keeping the data it had) and a mutation hands its caller. With
|
|
9
|
+
* `onAuthenticationError` set on `init()`, gemi notices it once per incident
|
|
10
|
+
* and lets the app react — `"redirect"` sends the tab to sign-in.
|
|
11
|
+
*
|
|
12
|
+
* **Not acted on blindly.** A 401 is confirmed first: gemi waits a moment and
|
|
13
|
+
* asks `/auth/me` once, uncached. Only when that is refused as well is the
|
|
14
|
+
* hook called. When `/auth/me` answers with a user (or anything else), the
|
|
15
|
+
* refusal was not "signed out" — the failed queries are fetched again and
|
|
16
|
+
* nothing else happens.
|
|
17
|
+
*
|
|
18
|
+
* **Only `authentication`.** An `authorization` or `permission` refusal (a
|
|
19
|
+
* signed-in user who may not do this) is never reported; neither is `/auth/me`
|
|
20
|
+
* itself, which a signed-out visitor on a public page is refused as a matter
|
|
21
|
+
* of course.
|
|
22
|
+
*
|
|
23
|
+
* No DOM or React import at module scope: the module is reached from the
|
|
24
|
+
* query cache, which also runs on the server.
|
|
25
|
+
*/
|
|
26
|
+
export interface AuthenticationErrorContext {
|
|
27
|
+
/** What was refused first in this incident: a query or a mutation. */
|
|
28
|
+
source: "query" | "mutation";
|
|
29
|
+
/** The `/api` path that was refused, without `/api`. */
|
|
30
|
+
path: string;
|
|
31
|
+
/** The error as its caller saw it: a `QueryError`, or a `MutationError`. */
|
|
32
|
+
error: unknown;
|
|
33
|
+
/**
|
|
34
|
+
* The sign-in page with the page on screen as `?redirect=` — the same
|
|
35
|
+
* intended-URL contract `Auth.intendedUrl()` and `useIntendedUrl()` read.
|
|
36
|
+
* The sign-in path is the one the server refused with (`auth.signInPath`, or
|
|
37
|
+
* the route's own `"auth:/x"`). On another origin it carries the path only,
|
|
38
|
+
* as the server's redirect does.
|
|
39
|
+
*/
|
|
40
|
+
signInUrl: string;
|
|
41
|
+
/** Sends the tab to `signInUrl`: through the router when it is a path here. */
|
|
42
|
+
redirect(): void;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* `"redirect"` sends the tab to sign-in. A function is called instead, once
|
|
46
|
+
* per incident, and decides: show a "your session expired" prompt, clear local
|
|
47
|
+
* state, or call `ctx.redirect()` itself.
|
|
48
|
+
*/
|
|
49
|
+
export type OnAuthenticationError = "redirect" | ((context: AuthenticationErrorContext) => void);
|
|
50
|
+
/** Where an older server, which sends no sign-in header, would have sent pages. */
|
|
51
|
+
export declare const DEFAULT_SIGN_IN_PATH = "/auth/sign-in";
|
|
52
|
+
/** How long after the refusal `/auth/me` is asked. */
|
|
53
|
+
export declare const AUTHENTICATION_RECHECK_DELAY_MS = 1000;
|
|
54
|
+
/**
|
|
55
|
+
* How many inconclusive checks one page gets. A route refused for a reason
|
|
56
|
+
* `/auth/me` does not share would otherwise check, refetch and be refused
|
|
57
|
+
* again forever.
|
|
58
|
+
*/
|
|
59
|
+
export declare const MAX_AUTHENTICATION_RECHECKS = 2;
|
|
60
|
+
type HeaderSource = {
|
|
61
|
+
get(name: string): string | null | undefined;
|
|
62
|
+
} | null | undefined;
|
|
63
|
+
interface Navigator {
|
|
64
|
+
/** Navigate to a same-origin path, replacing the current entry. */
|
|
65
|
+
replace(path: string): void;
|
|
66
|
+
/** The page on screen, without the locale segment. */
|
|
67
|
+
current(): {
|
|
68
|
+
pathname: string;
|
|
69
|
+
search: string;
|
|
70
|
+
} | null;
|
|
71
|
+
}
|
|
72
|
+
/** Called by `init()`. `undefined` turns it off, which is the default. */
|
|
73
|
+
export declare function configureAuthenticationErrors(option: OnAuthenticationError | undefined): void;
|
|
74
|
+
/** Called by the client router; returns the unregister function. */
|
|
75
|
+
export declare function setAuthenticationNavigator(next: Navigator): () => void;
|
|
76
|
+
/**
|
|
77
|
+
* The page changed: a new incident may start. A check under way finishes on
|
|
78
|
+
* its own, since its answer is still about this session.
|
|
79
|
+
*/
|
|
80
|
+
export declare function resetAuthenticationIncident(): void;
|
|
81
|
+
/** @internal For tests. */
|
|
82
|
+
export declare function resetAuthenticationErrorsForTests(): void;
|
|
83
|
+
/**
|
|
84
|
+
* Whether a response is an `authentication` refusal: a 401 whose `error` is
|
|
85
|
+
* `{ kind: "authentication" }`, or the bare `"Authentication error"` a server
|
|
86
|
+
* under `RequestBreakerError.legacyStringPayload` sends. An `AuthorizationError`
|
|
87
|
+
* is a 401 too, and is told apart by its kind (or, as a string, by its
|
|
88
|
+
* message: an `AuthenticationError` always says "Authentication error").
|
|
89
|
+
*/
|
|
90
|
+
export declare function isAuthenticationRefusal(status: number, body: unknown): boolean;
|
|
91
|
+
/**
|
|
92
|
+
* The sign-in URL for the page on screen, or `null` when that page is the
|
|
93
|
+
* sign-in page itself — sending it back to itself would only be a loop.
|
|
94
|
+
*/
|
|
95
|
+
export declare function signInUrlFor(signInPath: string, page: {
|
|
96
|
+
pathname: string;
|
|
97
|
+
search: string;
|
|
98
|
+
}): string | null;
|
|
99
|
+
/**
|
|
100
|
+
* Reports a refused `/api` request. Returns at once; the check and the hook
|
|
101
|
+
* run later. A no-op unless `onAuthenticationError` is set, outside a browser,
|
|
102
|
+
* and for anything but an `authentication` refusal.
|
|
103
|
+
*
|
|
104
|
+
* `refetch` (queries) runs when the check finds the session alive.
|
|
105
|
+
*/
|
|
106
|
+
export declare function reportAuthenticationRefusal(report: {
|
|
107
|
+
source: "query" | "mutation";
|
|
108
|
+
path: string;
|
|
109
|
+
status: number;
|
|
110
|
+
body: unknown;
|
|
111
|
+
headers: HeaderSource;
|
|
112
|
+
error: unknown;
|
|
113
|
+
refetch?: () => void;
|
|
114
|
+
}): void;
|
|
115
|
+
export {};
|
|
116
|
+
//# sourceMappingURL=authenticationErrors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authenticationErrors.d.ts","sourceRoot":"","sources":["../../client/authenticationErrors.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B,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,GAAG,OAAO,CAO9E;AAmBD;;;GAGG;AACH,wBAAgB,YAAY,CAC1B,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GACzC,MAAM,GAAG,IAAI,CAQf;AAUD;;;;;;GAMG;AACH,wBAAgB,2BAA2B,CAAC,MAAM,EAAE;IAClD,MAAM,EAAE,OAAO,GAAG,UAAU,CAAC;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,YAAY,CAAC;IACtB,KAAK,EAAE,OAAO,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB,QAeA"}
|
package/dist/client/index.d.ts
CHANGED
|
@@ -41,6 +41,7 @@ export type { ExternalLinkProps, LinkProps, PrefetchStrategy } from "./Link";
|
|
|
41
41
|
export { Redirect } from "./Redirect";
|
|
42
42
|
export { init, create } from "./init";
|
|
43
43
|
export type { InitOptions } from "./init";
|
|
44
|
+
export type { AuthenticationErrorContext, OnAuthenticationError, } from "./authenticationErrors";
|
|
44
45
|
export { isChunkLoadError, recoverFromChunkLoadError, CHUNK_RELOAD_MARKER, } from "./chunkLoadRecovery";
|
|
45
46
|
export type { ChunkLoadErrorContext, ChunkLoadErrorSource, ChunkLoadRecoveryOptions, BuildMismatchContext, ChunkReloadBlock, } from "./chunkLoadRecovery";
|
|
46
47
|
export { createRoot } from "./createRoot";
|
|
@@ -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,EA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ryForRender, D as routeDataUrl, E as readRoutePayload, F as useLocation, G as realtime, H as configureRealtime, I as domainUrl, J as loadedModule, K as reconnectRealtime, L as isAbsoluteUrl, M as I18nProvider, N as ServerDataContext, O as useRoute, P as ServerDataProvider, Q as QueryManagerContext, S as loadDictionary, T as setActiveLocale, U as followLive, V as RealtimeContext, X as applyParams$1, Y as toVariantKey, Z as QueryConfigContext, _ as isChunkLoadError, a as useRouteTransition, b as recoverFromBuildMismatch, c as ClientRouterContext, ct as
|
|
1
|
+
import { $ as QueryManagerProvider, A as useNavigate, C as loadDictionaryForRender, D as routeDataUrl, E as readRoutePayload, F as useLocation, G as realtime, H as configureRealtime, I as domainUrl, J as loadedModule, K as reconnectRealtime, L as isAbsoluteUrl, M as I18nProvider, N as ServerDataContext, O as useRoute, P as ServerDataProvider, Q as QueryManagerContext, S as loadDictionary, T as setActiveLocale, U as followLive, V as RealtimeContext, X as applyParams$1, Y as toVariantKey, Z as QueryConfigContext, _ as isChunkLoadError, a as useRouteTransition, at as resetAuthenticationIncident, b as recoverFromBuildMismatch, c as ClientRouterContext, ct as isExternalRedirect, d as ComponentsProvider, dt as isRetryableQueryError, et as USER_QUERY_CONFIG_KEYS, f as initialViewModulesReady, g as configureChunkLoadRecovery, gt as Subject, h as CHUNK_RELOAD_MARKER, ht as QueryError, i as RouteTransitionProvider, it as reportAuthenticationRefusal, j as I18nContext, k as useSearchParams, l as ClientRouterProvider, lt as safeRedirectPath, m as subscribeViewModules, mt as shouldRetryQuery, n as useTheme, nt as DEFAULT_STALE_TIME, o as useChannelSubscription, ot as setAuthenticationNavigator, p as loadViewModule, pt as retryDelayFor, q as loadLazy, r as m, rt as configureAuthenticationErrors, s as useCoalesced, st as INTENDED_URL_PARAM, t as ThemeProvider, tt as pickDefined, u as ComponentsContext, ut as readResponseBody, v as navigationStarted, w as registerDictionary, x as recoverFromChunkLoadError, y as otherBuild, z as Action } from "../chunks/ThemeProvider-Bkc6A9Nn.js";
|
|
2
2
|
import { n as RouteStateContext, r as RouteStateProvider, t as useParams } from "../chunks/useParams-BN3XXfmG.js";
|
|
3
3
|
import { a as isNetworkError, c as isPermissionError, d as isValidationError, f as mutationErrorField, h as mutationErrorList, i as isHttpError, l as isRateLimitError, m as mutationErrorKind, n as isCsrfError, o as isNotFoundError, p as mutationErrorFromBody, r as isFormError, s as isObject, t as isAuthenticationError, u as isServerError } from "../chunks/MutationError-DuKqBW8o.js";
|
|
4
4
|
import { Fragment, StrictMode, Suspense, createContext, createElement, isValidElement, lazy, memo, use, useCallback, useContext, useDeferredValue, useEffect, useInsertionEffect, useMemo, useRef, useState, useSyncExternalStore, useTransition } from "react";
|
|
@@ -561,7 +561,7 @@ var SOCKET_ID_HEADER = "x-gemi-socket";
|
|
|
561
561
|
*/
|
|
562
562
|
var mutationExtras = {
|
|
563
563
|
current: null,
|
|
564
|
-
load: () => import("../chunks/mutationExtras-
|
|
564
|
+
load: () => import("../chunks/mutationExtras-C7UPW9XP.js")
|
|
565
565
|
};
|
|
566
566
|
/** Starts loading `./mutationExtras`: the hooks' mount effect. */
|
|
567
567
|
function preloadMutationExtras() {
|
|
@@ -669,6 +669,14 @@ function useMutation(method, url, ...args) {
|
|
|
669
669
|
}));
|
|
670
670
|
options.onError(error);
|
|
671
671
|
call.onError?.(error);
|
|
672
|
+
reportAuthenticationRefusal({
|
|
673
|
+
source: "mutation",
|
|
674
|
+
path: finalUrl,
|
|
675
|
+
status: response.status,
|
|
676
|
+
body: data,
|
|
677
|
+
headers: response.headers,
|
|
678
|
+
error
|
|
679
|
+
});
|
|
672
680
|
return;
|
|
673
681
|
}
|
|
674
682
|
clearPrefetchCache?.();
|
|
@@ -816,6 +824,18 @@ function useUpload(url, ...args) {
|
|
|
816
824
|
const failure = await withErrorHelpers(error);
|
|
817
825
|
setState("error");
|
|
818
826
|
options?.onError?.(failure);
|
|
827
|
+
let body = null;
|
|
828
|
+
try {
|
|
829
|
+
body = JSON.parse(outcome.body);
|
|
830
|
+
} catch {}
|
|
831
|
+
reportAuthenticationRefusal({
|
|
832
|
+
source: "mutation",
|
|
833
|
+
path: finalUrl,
|
|
834
|
+
status: outcome.status,
|
|
835
|
+
body,
|
|
836
|
+
headers: { get: (name) => xhr.getResponseHeader(name) },
|
|
837
|
+
error: failure
|
|
838
|
+
});
|
|
819
839
|
return;
|
|
820
840
|
}
|
|
821
841
|
const json = JSON.parse(outcome.body);
|
|
@@ -899,7 +919,7 @@ function useMutate() {
|
|
|
899
919
|
//#region client/fetchFile.ts
|
|
900
920
|
var request = {
|
|
901
921
|
current: null,
|
|
902
|
-
load: () => import("../chunks/fetchFileRequest-
|
|
922
|
+
load: () => import("../chunks/fetchFileRequest-BGEW4Wd7.js")
|
|
903
923
|
};
|
|
904
924
|
/**
|
|
905
925
|
* Downloads a file route's body as a `Blob`.
|
|
@@ -1994,56 +2014,6 @@ async function loadRoutePayload(options) {
|
|
|
1994
2014
|
return payload;
|
|
1995
2015
|
}
|
|
1996
2016
|
//#endregion
|
|
1997
|
-
//#region utils/intendedUrl.ts
|
|
1998
|
-
/**
|
|
1999
|
-
* The search parameter carrying the page a signed-out visitor was trying to
|
|
2000
|
-
* reach. `AuthenticationMiddleware` writes it onto the sign-in redirect —
|
|
2001
|
-
* `/auth/sign-in?redirect=%2Finvoices%3Fpage%3D2` — and `Auth.intendedUrl()` /
|
|
2002
|
-
* `useIntendedUrl()` read it back after sign-in.
|
|
2003
|
-
*/
|
|
2004
|
-
var INTENDED_URL_PARAM = "redirect";
|
|
2005
|
-
var PROBE_ORIGIN = "http://gemi.invalid";
|
|
2006
|
-
/**
|
|
2007
|
-
* `value` if it is a path on this origin, `fallback` otherwise.
|
|
2008
|
-
*
|
|
2009
|
-
* The intended URL arrives in a query string anybody can write, so reading it
|
|
2010
|
-
* back unchecked is an open redirect: `?redirect=https://evil.example` signs
|
|
2011
|
-
* the user in and hands them to a look-alike. Only a same-origin path passes:
|
|
2012
|
-
* `//evil.example` and `/\evil.example` are protocol-relative to a browser and
|
|
2013
|
-
* are refused, as is anything a browser would strip control characters out of
|
|
2014
|
-
* before resolving.
|
|
2015
|
-
*
|
|
2016
|
-
* Returns path, search and hash — never an origin — so the result is safe to
|
|
2017
|
-
* hand to `push`, `Redirect.to` or a `Location` header alike.
|
|
2018
|
-
*/
|
|
2019
|
-
function safeRedirectPath(value, fallback = "/") {
|
|
2020
|
-
if (typeof value !== "string" || !value.startsWith("/")) return fallback;
|
|
2021
|
-
if (/[\u0000-\u001f\u007f\\]/.test(value) || value.startsWith("//")) return fallback;
|
|
2022
|
-
try {
|
|
2023
|
-
const url = new URL(value, PROBE_ORIGIN);
|
|
2024
|
-
if (url.origin !== PROBE_ORIGIN) return fallback;
|
|
2025
|
-
const tail = `${url.search}${url.hash}`.replaceAll("/", "%2F");
|
|
2026
|
-
const path = `${url.pathname}${tail}`.replaceAll(":", "%3A");
|
|
2027
|
-
return path.startsWith("//") ? fallback : path;
|
|
2028
|
-
} catch {
|
|
2029
|
-
return fallback;
|
|
2030
|
-
}
|
|
2031
|
-
}
|
|
2032
|
-
/**
|
|
2033
|
-
* Whether a `Redirect` directive names somewhere outside the router — an
|
|
2034
|
-
* absolute http(s) URL or a protocol-relative one — and so has to leave the
|
|
2035
|
-
* page rather than be looked up as a route.
|
|
2036
|
-
*
|
|
2037
|
-
* Only those two shapes. The value goes to `location.replace`, and *any*
|
|
2038
|
-
* scheme that parses would include `javascript:`, which runs in this document
|
|
2039
|
-
* rather than navigating away from it: an app passing a user-influenced value
|
|
2040
|
-
* to `Redirect.external` would be handing out same-origin script execution.
|
|
2041
|
-
* Anything else falls through to the router, which cannot leave the origin.
|
|
2042
|
-
*/
|
|
2043
|
-
function isExternalRedirect(path) {
|
|
2044
|
-
return /^(https?:\/\/|\/\/)/i.test(path ?? "");
|
|
2045
|
-
}
|
|
2046
|
-
//#endregion
|
|
2047
2017
|
//#region client/ClientRouter.tsx
|
|
2048
2018
|
function restoreScroll(action = null, _pathname = "no path") {
|
|
2049
2019
|
if (action === null) return;
|
|
@@ -2159,6 +2129,23 @@ var Routes = (props) => {
|
|
|
2159
2129
|
appId: currentAppId
|
|
2160
2130
|
});
|
|
2161
2131
|
const { replace } = useNavigate();
|
|
2132
|
+
const replaceRef = useRef(replace);
|
|
2133
|
+
replaceRef.current = replace;
|
|
2134
|
+
useEffect(() => setAuthenticationNavigator({
|
|
2135
|
+
replace: (path) => {
|
|
2136
|
+
replaceRef.current(path);
|
|
2137
|
+
},
|
|
2138
|
+
current: () => {
|
|
2139
|
+
const state = routerSubject?.getValue();
|
|
2140
|
+
return state ? {
|
|
2141
|
+
pathname: state.pathname,
|
|
2142
|
+
search: state.search ?? ""
|
|
2143
|
+
} : null;
|
|
2144
|
+
}
|
|
2145
|
+
}), [routerSubject]);
|
|
2146
|
+
useEffect(() => {
|
|
2147
|
+
resetAuthenticationIncident();
|
|
2148
|
+
}, [routeState.pathname, routeState.search]);
|
|
2162
2149
|
useEffect(() => {
|
|
2163
2150
|
hydrate(prefetchedData);
|
|
2164
2151
|
}, [hydrate, prefetchedData]);
|
|
@@ -2347,6 +2334,7 @@ var StackTrace = () => {
|
|
|
2347
2334
|
};
|
|
2348
2335
|
function init(RootLayout, options = {}) {
|
|
2349
2336
|
configureChunkLoadRecovery(options.chunkLoadRecovery);
|
|
2337
|
+
configureAuthenticationErrors(options.onAuthenticationError);
|
|
2350
2338
|
if (options.realtime) configureRealtime(options.realtime);
|
|
2351
2339
|
if (typeof window !== "undefined" && options.chunkLoadRecovery !== false) installPreloadErrorRecovery();
|
|
2352
2340
|
if (typeof window !== "undefined" && window.render_error) createRoot$1(document.body).render(/* @__PURE__ */ jsx(StackTrace, {}));
|