gemi 0.236.1 → 0.237.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/Agent.d.ts +2 -1
- package/dist/ai/Agent.d.ts.map +1 -1
- package/dist/ai/AgentController.d.ts.map +1 -1
- package/dist/ai/AgentProvider.d.ts +22 -0
- package/dist/ai/AgentProvider.d.ts.map +1 -1
- package/dist/ai/FallbackProvider.d.ts +6 -0
- package/dist/ai/FallbackProvider.d.ts.map +1 -1
- package/dist/ai/ImageModel.d.ts.map +1 -1
- package/dist/ai/contextCompaction.d.ts.map +1 -1
- package/dist/ai/generate.d.ts.map +1 -1
- package/dist/ai/index.d.ts +1 -1
- package/dist/ai/index.d.ts.map +1 -1
- package/dist/ai/index.js +40 -40
- package/dist/ai/index.js.map +5 -5
- package/dist/ai/runtime.d.ts +8 -0
- package/dist/ai/runtime.d.ts.map +1 -1
- package/dist/ai/testing/index.js +2 -2
- package/dist/ai/testing/index.js.map +1 -1
- package/dist/ai/types.d.ts +13 -0
- package/dist/ai/types.d.ts.map +1 -1
- package/dist/ai/usageLimits.d.ts +12 -1
- package/dist/ai/usageLimits.d.ts.map +1 -1
- package/dist/ai/usageMeter.d.ts +67 -10
- package/dist/ai/usageMeter.d.ts.map +1 -1
- package/dist/app/index.js +1 -1
- package/dist/bun/plugin.js +1 -1
- package/dist/bun/preload.js +1 -1
- package/dist/{chunk-0e5sq42y.js → chunk-07fy1618.js} +2 -2
- package/dist/{chunk-0e5sq42y.js.map → chunk-07fy1618.js.map} +1 -1
- package/dist/{chunk-ca5kp6cn.js → chunk-0kjcd94c.js} +2 -2
- package/dist/{chunk-ca5kp6cn.js.map → chunk-0kjcd94c.js.map} +1 -1
- package/dist/{chunk-naj8bmj5.js → chunk-0xmk4jyj.js} +2 -2
- package/dist/{chunk-naj8bmj5.js.map → chunk-0xmk4jyj.js.map} +1 -1
- package/dist/{chunk-hprgj13q.js → chunk-185k67yf.js} +2 -2
- package/dist/{chunk-hprgj13q.js.map → chunk-185k67yf.js.map} +1 -1
- package/dist/{chunk-hy54f691.js → chunk-2d757e1s.js} +2 -2
- package/dist/{chunk-hy54f691.js.map → chunk-2d757e1s.js.map} +1 -1
- package/dist/{chunk-h1wmpa03.js → chunk-2g1h9ktj.js} +2 -2
- package/dist/{chunk-h1wmpa03.js.map → chunk-2g1h9ktj.js.map} +1 -1
- package/dist/{chunk-4vn8gyzy.js → chunk-2gj2nhve.js} +2 -2
- package/dist/{chunk-4vn8gyzy.js.map → chunk-2gj2nhve.js.map} +1 -1
- package/dist/{chunk-x6a5qxpa.js → chunk-2h1ta6cv.js} +2 -2
- package/dist/{chunk-x6a5qxpa.js.map → chunk-2h1ta6cv.js.map} +1 -1
- package/dist/chunk-2mjtssv3.js +5 -0
- package/dist/{chunk-0hy5dsbt.js.map → chunk-2mjtssv3.js.map} +1 -1
- package/dist/{chunk-m3fbewhz.js → chunk-3jr6d0cb.js} +3 -3
- package/dist/{chunk-m3fbewhz.js.map → chunk-3jr6d0cb.js.map} +1 -1
- package/dist/{chunk-17bva6b1.js → chunk-3p4wdpag.js} +2 -2
- package/dist/{chunk-17bva6b1.js.map → chunk-3p4wdpag.js.map} +1 -1
- package/dist/{chunk-wbj4jh1h.js → chunk-5c538k7m.js} +2 -2
- package/dist/{chunk-wbj4jh1h.js.map → chunk-5c538k7m.js.map} +1 -1
- package/dist/{chunk-3y1h3ncf.js → chunk-5fxdjmgd.js} +2 -2
- package/dist/{chunk-3y1h3ncf.js.map → chunk-5fxdjmgd.js.map} +1 -1
- package/dist/{chunk-9sbhqscs.js → chunk-5kjnbmwp.js} +3 -3
- package/dist/{chunk-9sbhqscs.js.map → chunk-5kjnbmwp.js.map} +1 -1
- package/dist/{chunk-sh2bd09k.js → chunk-5nn0pgxg.js} +2 -2
- package/dist/{chunk-sh2bd09k.js.map → chunk-5nn0pgxg.js.map} +1 -1
- package/dist/{chunk-qvn0w2rt.js → chunk-5pbjc6tm.js} +2 -2
- package/dist/{chunk-qvn0w2rt.js.map → chunk-5pbjc6tm.js.map} +1 -1
- package/dist/{chunk-x2dmgge8.js → chunk-6wv3k8ap.js} +2 -2
- package/dist/{chunk-x2dmgge8.js.map → chunk-6wv3k8ap.js.map} +1 -1
- package/dist/{chunk-px9h2qgv.js → chunk-7159w4qq.js} +3 -3
- package/dist/{chunk-px9h2qgv.js.map → chunk-7159w4qq.js.map} +1 -1
- package/dist/{chunk-jssjfvsz.js → chunk-768yza4f.js} +2 -2
- package/dist/{chunk-jssjfvsz.js.map → chunk-768yza4f.js.map} +1 -1
- package/dist/{chunk-fbk79z21.js → chunk-7b4tsj9x.js} +2 -2
- package/dist/{chunk-fbk79z21.js.map → chunk-7b4tsj9x.js.map} +1 -1
- package/dist/{chunk-kak3vc71.js → chunk-8591j0cj.js} +2 -2
- package/dist/{chunk-kak3vc71.js.map → chunk-8591j0cj.js.map} +1 -1
- package/dist/{chunk-1mb7kaxs.js → chunk-89jc9yg9.js} +3 -3
- package/dist/{chunk-1mb7kaxs.js.map → chunk-89jc9yg9.js.map} +1 -1
- package/dist/{chunk-1w6ra6jc.js → chunk-9447c20x.js} +1 -1
- package/dist/{chunk-np6vee9d.js → chunk-96v1bwg4.js} +3 -3
- package/dist/{chunk-np6vee9d.js.map → chunk-96v1bwg4.js.map} +1 -1
- package/dist/{chunk-a119av2z.js → chunk-9a3wbbr6.js} +2 -2
- package/dist/{chunk-a119av2z.js.map → chunk-9a3wbbr6.js.map} +1 -1
- package/dist/{chunk-n4kz9vft.js → chunk-9ey725pw.js} +1 -1
- package/dist/chunk-a3s6cp49.js +48 -0
- package/dist/chunk-a3s6cp49.js.map +26 -0
- package/dist/{chunk-yahabnz4.js → chunk-a9p3djqm.js} +3 -3
- package/dist/{chunk-yahabnz4.js.map → chunk-a9p3djqm.js.map} +1 -1
- package/dist/{chunk-ka8dzc6q.js → chunk-ack021d9.js} +2 -2
- package/dist/{chunk-ka8dzc6q.js.map → chunk-ack021d9.js.map} +1 -1
- package/dist/{chunk-4n3jva4e.js → chunk-b9gf8sqq.js} +2 -2
- package/dist/{chunk-4n3jva4e.js.map → chunk-b9gf8sqq.js.map} +1 -1
- package/dist/{chunk-73541m4t.js → chunk-bcb1dwhb.js} +4 -4
- package/dist/{chunk-73541m4t.js.map → chunk-bcb1dwhb.js.map} +1 -1
- package/dist/{chunk-4800w7qx.js → chunk-bg0da5pd.js} +3 -3
- package/dist/{chunk-4800w7qx.js.map → chunk-bg0da5pd.js.map} +3 -3
- package/dist/{chunk-9kt24ctk.js → chunk-bhycdjcv.js} +2 -2
- package/dist/{chunk-9kt24ctk.js.map → chunk-bhycdjcv.js.map} +1 -1
- package/dist/{chunk-2kzysesp.js → chunk-c3c37k46.js} +3 -3
- package/dist/{chunk-2kzysesp.js.map → chunk-c3c37k46.js.map} +1 -1
- package/dist/{chunk-t6x1r5n6.js → chunk-c6zpn9yp.js} +3 -3
- package/dist/{chunk-t6x1r5n6.js.map → chunk-c6zpn9yp.js.map} +1 -1
- package/dist/{chunk-y2vayxcd.js → chunk-dj5d9wcc.js} +2 -2
- package/dist/{chunk-y2vayxcd.js.map → chunk-dj5d9wcc.js.map} +1 -1
- package/dist/{chunk-5exrgw07.js → chunk-dmzgw2d8.js} +3 -3
- package/dist/{chunk-5exrgw07.js.map → chunk-dmzgw2d8.js.map} +1 -1
- package/dist/chunk-ejf6sz1d.js +5 -0
- package/dist/{chunk-gvr7cwxn.js.map → chunk-ejf6sz1d.js.map} +3 -3
- package/dist/{chunk-74dzzd64.js → chunk-fb0bazw9.js} +2 -2
- package/dist/{chunk-74dzzd64.js.map → chunk-fb0bazw9.js.map} +1 -1
- package/dist/{chunk-8476xvk9.js → chunk-fgnpyj44.js} +2 -2
- package/dist/{chunk-8476xvk9.js.map → chunk-fgnpyj44.js.map} +1 -1
- package/dist/{chunk-1xz206e1.js → chunk-fp31t0ey.js} +3 -3
- package/dist/{chunk-1xz206e1.js.map → chunk-fp31t0ey.js.map} +1 -1
- package/dist/{chunk-8yb9jrj5.js → chunk-fp6mxxkq.js} +2 -2
- package/dist/{chunk-8yb9jrj5.js.map → chunk-fp6mxxkq.js.map} +1 -1
- package/dist/{chunk-hgwkxn0g.js → chunk-fx45rbbn.js} +2 -2
- package/dist/{chunk-hgwkxn0g.js.map → chunk-fx45rbbn.js.map} +1 -1
- package/dist/{chunk-ts75gcfd.js → chunk-g29wz7h7.js} +2 -2
- package/dist/{chunk-k2mpxwh2.js.map → chunk-g29wz7h7.js.map} +1 -1
- package/dist/{chunk-byv7b79h.js → chunk-gakdsme3.js} +2 -2
- package/dist/{chunk-byv7b79h.js.map → chunk-gakdsme3.js.map} +1 -1
- package/dist/{chunk-28yb0q82.js → chunk-gj4hg8xk.js} +2 -2
- package/dist/{chunk-28yb0q82.js.map → chunk-gj4hg8xk.js.map} +1 -1
- package/dist/{chunk-h0dch3vh.js → chunk-h6z5k6yh.js} +2 -2
- package/dist/{chunk-h0dch3vh.js.map → chunk-h6z5k6yh.js.map} +1 -1
- package/dist/{chunk-fqndtpwm.js → chunk-jfqfvx3t.js} +3 -3
- package/dist/{chunk-fqndtpwm.js.map → chunk-jfqfvx3t.js.map} +1 -1
- package/dist/{chunk-at82qczv.js → chunk-jwh7t982.js} +3 -3
- package/dist/{chunk-at82qczv.js.map → chunk-jwh7t982.js.map} +1 -1
- package/dist/{chunk-2ver7cdt.js → chunk-k2jxxdj1.js} +1 -1
- package/dist/{chunk-t2p5n8fe.js → chunk-k9devrb5.js} +2 -2
- package/dist/{chunk-t2p5n8fe.js.map → chunk-k9devrb5.js.map} +1 -1
- package/dist/{chunk-sv2mv2q2.js → chunk-kpbm4mbc.js} +2 -2
- package/dist/{chunk-sv2mv2q2.js.map → chunk-kpbm4mbc.js.map} +1 -1
- package/dist/{chunk-gt9ftnhn.js → chunk-krfz1rzm.js} +2 -2
- package/dist/{chunk-gt9ftnhn.js.map → chunk-krfz1rzm.js.map} +1 -1
- package/dist/{chunk-zt4hybgg.js → chunk-mwe7hpbd.js} +2 -2
- package/dist/{chunk-zt4hybgg.js.map → chunk-mwe7hpbd.js.map} +1 -1
- package/dist/{chunk-x185900b.js → chunk-n78b8pp5.js} +3 -3
- package/dist/{chunk-x185900b.js.map → chunk-n78b8pp5.js.map} +1 -1
- package/dist/{chunk-fs94x6ef.js → chunk-nznkpf8r.js} +3 -3
- package/dist/{chunk-fs94x6ef.js.map → chunk-nznkpf8r.js.map} +1 -1
- package/dist/{chunk-2j45vbs2.js → chunk-p91yn1b8.js} +2 -2
- package/dist/{chunk-2j45vbs2.js.map → chunk-p91yn1b8.js.map} +1 -1
- package/dist/{chunk-h5wjk91m.js → chunk-pqaha4f1.js} +2 -2
- package/dist/{chunk-h5wjk91m.js.map → chunk-pqaha4f1.js.map} +1 -1
- package/dist/{chunk-8gz07168.js → chunk-q4b79hjb.js} +4 -4
- package/dist/{chunk-8gz07168.js.map → chunk-q4b79hjb.js.map} +1 -1
- package/dist/{chunk-ezea9fpd.js → chunk-qj2r0v7w.js} +2 -2
- package/dist/{chunk-ezea9fpd.js.map → chunk-qj2r0v7w.js.map} +1 -1
- package/dist/{chunk-8jc8x9tc.js → chunk-rmwhvgvg.js} +2 -2
- package/dist/{chunk-8jc8x9tc.js.map → chunk-rmwhvgvg.js.map} +1 -1
- package/dist/{chunk-4mha212g.js → chunk-sxtg2qha.js} +1 -1
- package/dist/{chunk-t60krz4g.js → chunk-t4yx1jqb.js} +2 -2
- package/dist/{chunk-t60krz4g.js.map → chunk-t4yx1jqb.js.map} +1 -1
- package/dist/{chunk-yknc5rgh.js → chunk-t6xe3jr4.js} +2 -2
- package/dist/{chunk-yknc5rgh.js.map → chunk-t6xe3jr4.js.map} +1 -1
- package/dist/{chunk-kvtvx64t.js → chunk-tmpfcx0v.js} +2 -2
- package/dist/{chunk-kvtvx64t.js.map → chunk-tmpfcx0v.js.map} +1 -1
- package/dist/{chunk-8n40a2sn.js → chunk-trbwk80g.js} +2 -2
- package/dist/{chunk-8n40a2sn.js.map → chunk-trbwk80g.js.map} +1 -1
- package/dist/{chunk-aj9atkwk.js → chunk-va2p7e59.js} +1 -1
- package/dist/{chunk-17ewxwga.js → chunk-vbmtyxr4.js} +3 -3
- package/dist/{chunk-17ewxwga.js.map → chunk-vbmtyxr4.js.map} +1 -1
- package/dist/{chunk-406ef17s.js → chunk-vc7ny5zs.js} +2 -2
- package/dist/{chunk-406ef17s.js.map → chunk-vc7ny5zs.js.map} +1 -1
- package/dist/{chunk-zm6b938z.js → chunk-vcmwp7pv.js} +3 -3
- package/dist/{chunk-zm6b938z.js.map → chunk-vcmwp7pv.js.map} +1 -1
- package/dist/{chunk-8mpptpn5.js → chunk-vrp3zzz4.js} +3 -3
- package/dist/{chunk-8mpptpn5.js.map → chunk-vrp3zzz4.js.map} +1 -1
- package/dist/{chunk-y56xd7sv.js → chunk-w7rgnjt5.js} +2 -2
- package/dist/{chunk-y56xd7sv.js.map → chunk-w7rgnjt5.js.map} +1 -1
- package/dist/{chunk-g7hz0dmk.js → chunk-w9v8bbp8.js} +2 -2
- package/dist/{chunk-g7hz0dmk.js.map → chunk-w9v8bbp8.js.map} +1 -1
- package/dist/{chunk-k2mpxwh2.js → chunk-x8pk6qqs.js} +2 -2
- package/dist/{chunk-ts75gcfd.js.map → chunk-x8pk6qqs.js.map} +1 -1
- package/dist/{chunk-9jt5qj1b.js → chunk-xj3ebwrj.js} +2 -2
- package/dist/{chunk-9jt5qj1b.js.map → chunk-xj3ebwrj.js.map} +1 -1
- package/dist/{chunk-6v1fbe70.js → chunk-y9efbqmp.js} +2 -2
- package/dist/{chunk-6v1fbe70.js.map → chunk-y9efbqmp.js.map} +1 -1
- package/dist/{chunk-7fbnw7e2.js → chunk-yb7yw0cp.js} +1 -1
- package/dist/{chunk-z3tk66vh.js → chunk-yca8nznt.js} +2 -2
- package/dist/{chunk-z3tk66vh.js.map → chunk-yca8nznt.js.map} +1 -1
- package/dist/{chunk-pfkbhqp7.js → chunk-z0xmyrjb.js} +2 -2
- package/dist/{chunk-pfkbhqp7.js.map → chunk-z0xmyrjb.js.map} +1 -1
- package/dist/{chunk-ehtj7zs2.js → chunk-z55c52fm.js} +2 -2
- package/dist/{chunk-ehtj7zs2.js.map → chunk-z55c52fm.js.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/index.js +2 -2
- package/dist/http/index.js.map +1 -1
- 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.js +2 -2
- package/dist/services/index.js.map +1 -1
- 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/vitest/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-0hy5dsbt.js +0 -5
- package/dist/chunk-dav7mv8t.js +0 -48
- package/dist/chunk-dav7mv8t.js.map +0 -26
- package/dist/chunk-gvr7cwxn.js +0 -5
- /package/dist/{chunk-1w6ra6jc.js.map → chunk-9447c20x.js.map} +0 -0
- /package/dist/{chunk-n4kz9vft.js.map → chunk-9ey725pw.js.map} +0 -0
- /package/dist/{chunk-2ver7cdt.js.map → chunk-k2jxxdj1.js.map} +0 -0
- /package/dist/{chunk-4mha212g.js.map → chunk-sxtg2qha.js.map} +0 -0
- /package/dist/{chunk-aj9atkwk.js.map → chunk-va2p7e59.js.map} +0 -0
- /package/dist/{chunk-7fbnw7e2.js.map → chunk-yb7yw0cp.js.map} +0 -0
|
@@ -9,6 +9,6 @@
|
|
|
9
9
|
"import { type MetaFont, type NormalizedFont, normalizeFonts } from \"../client/fonts\";\nimport { configuredAppOrigin } from \"../utils/appOrigin\";\n\nexport type { MetaFont };\n\nexport type OpenGraphParams = {\n title: string;\n description?: string;\n type: string;\n url: string;\n /** Rendered as `og:image` only when set. A path is prefixed with the app origin. */\n image?: string;\n imageAlt?: string;\n imageWidth?: number;\n imageHeight?: number;\n /** `og:site_name`, rendered only when set. */\n siteName?: string;\n /** `twitter:title`, rendered only when set (it does not follow `title`). */\n twitterTitle?: string;\n /** `twitter:description`, rendered only when set (it does not follow `description`). */\n twitterDescription?: string;\n twitterImage?: string;\n /** Defaults to `imageAlt`; `null` leaves `twitter:image:alt` out. */\n twitterImageAlt?: string | null;\n /** Defaults to `imageWidth`; `null` leaves `twitter:image:width` out. */\n twitterImageWidth?: number | null;\n /** Defaults to `imageHeight`; `null` leaves `twitter:image:height` out. */\n twitterImageHeight?: number | null;\n /**\n * The `twitter:card` type. Defaults to `\"summary_large_image\"` when the page\n * has an image (`twitterImage ?? image`), `\"summary\"` otherwise.\n */\n twitterCard?: \"summary\" | \"summary_large_image\";\n};\n/**\n * The app-wide default title and metadata (`route.view.meta`, #1042): used for\n * each field that no handler (or `onNotFound`) set. See `ViewRouteConfig.meta`.\n */\nexport type DefaultViewMeta = {\n title?: string;\n description?: string;\n /**\n * Every field is optional: `title` and `description` default to the page's\n * own, `type` to `\"website\"`. `url` is left out of the page unless given.\n */\n openGraph?: Partial<OpenGraphParams>;\n};\n\n/**\n * Attributes for the document's `<html>` element, handed to the root (or a\n * static view's) layout as its `htmlAttributes` prop.\n */\nexport type HtmlAttributes = {\n /** The document's language, e.g. `\"tr\"`. Defaults to the request's locale. */\n lang?: string;\n /** Text direction. Defaults to the one `lang` is written in. */\n dir?: \"ltr\" | \"rtl\" | \"auto\";\n};\n\n/** One `<link rel=\"alternate\" hreflang>`: the same page in another language. */\nexport type AlternateLink = {\n /** A BCP 47 tag, or `\"x-default\"` for the page to use when none matches. */\n hrefLang: string;\n href: string;\n};\n\n/**\n * A `<link rel=\"alternate\" type>` without `hreflang`: the same page in another\n * format, e.g. `{ type: \"text/markdown\", href: \"/docs/intro.md\" }`.\n */\nexport type TypedAlternateLink = {\n /** The linked document's media type. */\n type: string;\n href: string;\n};\n\n/** What `Meta.alternates` takes: a language alternate, or one in another format. */\nexport type MetaAlternate = AlternateLink | TypedAlternateLink;\n\n/**\n * One `<meta>` that `Meta.tags` adds: `name` (e.g. a site-verification token,\n * `{ name: \"google-site-verification\", content }`) or `property`.\n */\nexport type MetaTag =\n | { name: string; property?: never; content: string }\n | { property: string; name?: never; content: string };\n\nexport class Metadata {\n content: any = {\n title: \"Gemi App\",\n description: null,\n openGraph: null,\n htmlAttributes: null,\n canonical: null,\n alternates: null,\n fonts: null,\n robots: null,\n translate: null,\n tags: null,\n };\n\n /**\n * Whether a handler set anything, as opposed to `content` still being the\n * defaults. A partially rendered response that touched no metadata sends\n * none, so the client keeps what the skipped segments put there.\n */\n touched = false;\n\n /** The fields a handler set, which the app's default (`route.view.meta`) leaves alone. */\n private setFields = new Set<keyof DefaultViewMeta>();\n\n render() {\n return {\n title: this.content.title,\n description: this.content.description,\n openGraph: this.content.openGraph,\n htmlAttributes: this.content.htmlAttributes,\n canonical: this.content.canonical,\n alternates: this.content.alternates,\n fonts: this.content.fonts,\n robots: this.content.robots,\n translate: this.content.translate,\n tags: this.content.tags,\n };\n }\n\n /** Merged into what earlier calls set; `undefined` leaves an attribute alone. */\n htmlAttributes(attributes: HtmlAttributes) {\n this.touched = true;\n const defined = Object.fromEntries(\n Object.entries(attributes).filter(([, value]) => value !== undefined),\n );\n this.content.htmlAttributes = { ...this.content.htmlAttributes, ...defined };\n }\n\n canonical(url: string) {\n this.touched = true;\n this.content.canonical = url;\n }\n\n /** `<meta name=\"robots\">`'s content, e.g. `\"noindex, nofollow\"`; the last call wins. */\n robots(content: string) {\n this.touched = true;\n this.content.robots = content;\n }\n\n /**\n * Whether browsers and Google Search may translate the page (#1087). `true`\n * leaves `<meta name=\"google\" content=\"notranslate\">` out; `false` (or no\n * call) keeps it. The last call wins.\n */\n translate(allow = true) {\n this.touched = true;\n this.translateSet = true;\n this.content.translate = allow;\n }\n\n /** Whether a handler called `translate`, which the views' default (`route.view.translate`) leaves alone. */\n private translateSet = false;\n\n /**\n * The views' default (`route.view.translate`, #1087), for a response whose\n * handlers didn't call `translate`. Not a handler call, so `touched` stays\n * as it was.\n */\n applyTranslateDefault(allow: boolean) {\n if (!this.translateSet) {\n this.content.translate = allow;\n }\n }\n\n alternates(links: MetaAlternate[]) {\n this.touched = true;\n this.content.alternates = links;\n }\n\n /** Added to what earlier calls set, so a layout and its page can both add tags. */\n tags(tags: MetaTag[]) {\n const normalized = tags.map((tag) => {\n const key = tag.name !== undefined ? \"name\" : \"property\";\n const value = tag.name ?? tag.property;\n if (typeof value !== \"string\" || value === \"\" || (tag.name !== undefined && tag.property !== undefined)) {\n throw new TypeError(\"Meta.tags: each tag needs either a `name` or a `property`.\");\n }\n if (typeof tag.content !== \"string\") {\n throw new TypeError(`Meta.tags: the tag ${value} has no string \\`content\\`.`);\n }\n return { [key]: value, content: tag.content } as MetaTag;\n });\n this.touched = true;\n this.content.tags = [...(this.content.tags ?? []), ...normalized];\n }\n\n /** Added to what earlier calls declared, so a layout and its page can both declare fonts. */\n fonts(fonts: MetaFont[]) {\n const normalized: NormalizedFont[] = normalizeFonts(fonts);\n this.touched = true;\n this.content.fonts = [...(this.content.fonts ?? []), ...normalized];\n }\n\n title(title: string) {\n this.touched = true;\n this.setFields.add(\"title\");\n this.content.title = title;\n }\n\n description(description: string) {\n this.touched = true;\n this.setFields.add(\"description\");\n this.content.description = description;\n }\n\n /** Whether every field the app's default could fill was set by a handler. */\n get hasAllDefaultFields() {\n return this.setFields.size === 3;\n }\n\n /**\n * Fills each of `title`, `description` and `openGraph` that no handler set\n * from the app's default (`route.view.meta`, #1042). Field by field: a\n * handler's `Meta.title` keeps its title and still gets the default\n * description. Not a handler call, so `touched` stays as it was.\n *\n * The default's Open Graph fields fall back to the page's title and\n * description and to `type: \"website\"`; `url` is only rendered when given.\n */\n applyDefaults(defaults: DefaultViewMeta) {\n if (!this.setFields.has(\"title\") && defaults.title !== undefined) {\n this.content.title = defaults.title;\n }\n if (!this.setFields.has(\"description\") && defaults.description !== undefined) {\n this.content.description = defaults.description;\n }\n if (!this.setFields.has(\"openGraph\") && defaults.openGraph) {\n const { title, description, type, ...rest } = defaults.openGraph;\n this.content.openGraph = this.normalizeOpenGraph({\n ...rest,\n title: title ?? this.content.title,\n description: description ?? this.content.description ?? undefined,\n type: type ?? \"website\",\n });\n }\n }\n\n openGraph(params: OpenGraphParams) {\n this.touched = true;\n this.setFields.add(\"openGraph\");\n this.content.openGraph = this.normalizeOpenGraph(params);\n }\n\n private normalizeOpenGraph({\n title,\n description,\n type,\n url,\n image,\n imageAlt,\n imageWidth,\n imageHeight,\n siteName,\n twitterTitle,\n twitterDescription,\n twitterImage = image,\n twitterImageAlt = imageAlt,\n twitterImageWidth = imageWidth,\n twitterImageHeight = imageHeight,\n twitterCard = twitterImage ? \"summary_large_image\" : \"summary\",\n }: Omit<OpenGraphParams, \"url\"> & { url?: string }) {\n const absolute = (src: string | undefined) =>\n src && !src.startsWith(\"http\") ? `${configuredAppOrigin()}${src}` : src;\n return Object.fromEntries(\n Object.entries({\n title,\n description,\n type,\n url,\n image: absolute(image),\n imageAlt,\n imageWidth,\n imageHeight,\n siteName,\n twitterTitle,\n twitterDescription,\n twitterImage: absolute(twitterImage),\n twitterImageAlt,\n twitterImageWidth,\n twitterImageHeight,\n twitterCard,\n })\n // `null` (a twitter image field turned off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SAAS,EACtC,GAAI,CAAC,EACH,OAAO,KAET,IAAM,EAAW,EAAU,EAC3B,GAAI,EACF,OAAO,EAGT,IAAM,EAAS,IAAI,aAAa,EAehC,OAdA,EAAM,UAAY,EAClB,EAAM,UAAU,EAAmB,EAAQ,CACzC,SAAU,GACV,OAAQ,mBAAyB,aAQjC,SAAU,MACV,QAAS,IAAI,KAAK,KAAK,IAAI,EAAI,WAAyB,CAC1D,CAAC,EACM,EAGF,MAAM,CAAe,OACnB,SAAQ,EAAG,CAChB,OAAO,EAAe,SAAS,QAG1B,WAAU,CAAC,EAA4B,CAC5C,EAAe,SAAS,EAAE,IAAM,QAO3B,IAAM,CACX,EACA,EACA,EACG,CACH,IAAM,EAAQ,IAAI,EAAM,CAAW,EACnC,GAAI,GAEF,GADA,EAAM,KAAO,EAAQ,KACjB,EAAQ,OAAS,EAAY,MAC/B,EAAa,MAAM,EAAQ,MAAO,EAAY,KAAK,EAGvD,OAAO,EAAe,IAAI,EAAO,CAAE,QAU9B,QAAU,CAAC,EAAc,EAAgB,CAC9C,OAAO,EAAe,IAAI,EAAO,CAAE,QAQ9B,KAAO,CAAC,EAAgB,CAC7B,OAAO,EAAe,KAAK,CAAE,EAEjC",
|
|
12
|
-
"debugId": "
|
|
12
|
+
"debugId": "69B4F5C691FD26CE64756E2164756E21",
|
|
13
13
|
"names": []
|
|
14
14
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{W as re}from"./chunk-
|
|
2
|
+
import{W as re}from"./chunk-b9gf8sqq.js";import{Vm as _,Ym as a}from"./chunk-g29wz7h7.js";var I=_((b)=>{Object.defineProperty(b,"__esModule",{value:!0});b.getHomeDir=void 0;var W=a("os"),V=a("path"),x={},G=()=>{if(process&&process.geteuid)return`${process.geteuid()}`;return"DEFAULT"},U=()=>{let{HOME:e,USERPROFILE:t,HOMEPATH:r,HOMEDRIVE:o=`C:${V.sep}`}=process.env;if(e)return e;if(t)return t;if(r)return`${o}${r}`;let i=G();if(!x[i])x[i]=(0,W.homedir)();return x[i]};b.getHomeDir=U});var P=_((j)=>{Object.defineProperty(j,"__esModule",{value:!0});j.getSSOTokenFilepath=void 0;var X=a("crypto"),B=a("path"),J=I(),z=(e)=>{let r=(0,X.createHash)("sha1").update(e).digest("hex");return(0,B.join)((0,J.getHomeDir)(),".aws","sso","cache",`${r}.json`)};j.getSSOTokenFilepath=z});var R=_((C)=>{Object.defineProperty(C,"__esModule",{value:!0});C.getSSOTokenFromFile=C.tokenIntercept=void 0;var Q=a("fs/promises"),Y=P();C.tokenIntercept={};var Z=async(e)=>{if(C.tokenIntercept[e])return C.tokenIntercept[e];let t=(0,Y.getSSOTokenFilepath)(e),r=await(0,Q.readFile)(t,"utf8");return JSON.parse(r)};C.getSSOTokenFromFile=Z});var k=_((L)=>{Object.defineProperty(L,"__esModule",{value:!0});L.readFile=L.fileIntercept=L.filePromises=void 0;var ee=a("fs/promises");L.filePromises={};L.fileIntercept={};var te=(e,t)=>{if(L.fileIntercept[e]!==void 0)return L.fileIntercept[e];if(!L.filePromises[e]||t?.ignoreCache)L.filePromises[e]=(0,ee.readFile)(e,"utf8");return L.filePromises[e]};L.readFile=te});var ye=_((c)=>{var l=I(),O=P(),y=R(),g=a("path"),S=re(),f=k(),q="AWS_PROFILE",$="default",oe=(e)=>e.profile||process.env[q]||$,p=".",ie=(e)=>Object.entries(e).filter(([t])=>{let r=t.indexOf(p);if(r===-1)return!1;return Object.values(S.IniSectionType).includes(t.substring(0,r))}).reduce((t,[r,o])=>{let i=r.indexOf(p),n=r.substring(0,i)===S.IniSectionType.PROFILE?r.substring(i+1):r;return t[n]=o,t},{...e.default&&{default:e.default}}),ne="AWS_CONFIG_FILE",M=()=>process.env[ne]||g.join(l.getHomeDir(),".aws","config"),se="AWS_SHARED_CREDENTIALS_FILE",ce=()=>process.env[se]||g.join(l.getHomeDir(),".aws","credentials"),ae=/^([\w-]+)\s(["'])?([\w-@\+\.%:/]+)\2$/,le=["__proto__","profile __proto__"],T=(e)=>{let t={},r,o;for(let i of e.split(/\r?\n/)){let n=i.split(/(^|\s)[;#]/)[0].trim();if(n[0]==="["&&n[n.length-1]==="]"){r=void 0,o=void 0;let s=n.substring(1,n.length-1),u=ae.exec(s);if(u){let[,d,,m]=u;if(Object.values(S.IniSectionType).includes(d))r=[d,m].join(p)}else r=s;if(le.includes(s))throw Error(`Found invalid profile name "${s}"`)}else if(r){let s=n.indexOf("=");if(![0,-1].includes(s)){let[u,d]=[n.substring(0,s).trim(),n.substring(s+1).trim()];if(d==="")o=u;else{if(o&&i.trimStart()===i)o=void 0;t[r]=t[r]||{};let m=o?[o,u].join(p):u;t[r][m]=d}}}}return t},A=()=>({}),K=async(e={})=>{let{filepath:t=ce(),configFilepath:r=M()}=e,o=l.getHomeDir(),i="~/",n=t;if(t.startsWith("~/"))n=g.join(o,t.slice(2));let h=r;if(r.startsWith("~/"))h=g.join(o,r.slice(2));let s=await Promise.all([f.readFile(h,{ignoreCache:e.ignoreCache}).then(T).then(ie).catch(A),f.readFile(n,{ignoreCache:e.ignoreCache}).then(T).catch(A)]);return{configFile:s[0],credentialsFile:s[1]}},pe=(e)=>Object.entries(e).filter(([t])=>t.startsWith(S.IniSectionType.SSO_SESSION+p)).reduce((t,[r,o])=>({...t,[r.substring(r.indexOf(p)+1)]:o}),{}),ue=()=>({}),fe=async(e={})=>f.readFile(e.configFilepath??M()).then(T).then(pe).catch(ue),de=(...e)=>{let t={};for(let r of e)for(let[o,i]of Object.entries(r))if(t[o]!==void 0)Object.assign(t[o],i);else t[o]=i;return t},_e=async(e)=>{let t=await K(e);return de(t.configFile,t.credentialsFile)},Fe={getFileRecord(){return f.fileIntercept},interceptFile(e,t){f.fileIntercept[e]=Promise.resolve(t)},getTokenRecord(){return y.tokenIntercept},interceptToken(e,t){y.tokenIntercept[e]=t}};c.getSSOTokenFromFile=y.getSSOTokenFromFile;c.readFile=f.readFile;c.CONFIG_PREFIX_SEPARATOR=p;c.DEFAULT_PROFILE=$;c.ENV_PROFILE=q;c.externalDataInterceptor=Fe;c.getProfileName=oe;c.loadSharedConfigFiles=K;c.loadSsoSessionData=fe;c.parseKnownFiles=_e;Object.prototype.hasOwnProperty.call(l,"__proto__")&&!Object.prototype.hasOwnProperty.call(c,"__proto__")&&Object.defineProperty(c,"__proto__",{enumerable:!0,value:l.__proto__});Object.keys(l).forEach(function(e){if(e!=="default"&&!Object.prototype.hasOwnProperty.call(c,e))c[e]=l[e]});Object.prototype.hasOwnProperty.call(O,"__proto__")&&!Object.prototype.hasOwnProperty.call(c,"__proto__")&&Object.defineProperty(c,"__proto__",{enumerable:!0,value:O.__proto__});Object.keys(O).forEach(function(e){if(e!=="default"&&!Object.prototype.hasOwnProperty.call(c,e))c[e]=O[e]})});
|
|
3
3
|
export{ye as V};
|
|
4
4
|
|
|
5
|
-
//# debugId=
|
|
5
|
+
//# debugId=E91CD05BB844E54164756E2164756E21
|
|
@@ -9,6 +9,6 @@
|
|
|
9
9
|
"'use strict';\n\nvar getHomeDir = require('./getHomeDir');\nvar getSSOTokenFilepath = require('./getSSOTokenFilepath');\nvar getSSOTokenFromFile = require('./getSSOTokenFromFile');\nvar path = require('path');\nvar types = require('@smithy/types');\nvar readFile = require('./readFile');\n\nconst ENV_PROFILE = \"AWS_PROFILE\";\nconst DEFAULT_PROFILE = \"default\";\nconst getProfileName = (init) => init.profile || process.env[ENV_PROFILE] || DEFAULT_PROFILE;\n\nconst CONFIG_PREFIX_SEPARATOR = \".\";\n\nconst getConfigData = (data) => Object.entries(data)\n .filter(([key]) => {\n const indexOfSeparator = key.indexOf(CONFIG_PREFIX_SEPARATOR);\n if (indexOfSeparator === -1) {\n return false;\n }\n return Object.values(types.IniSectionType).includes(key.substring(0, indexOfSeparator));\n})\n .reduce((acc, [key, value]) => {\n const indexOfSeparator = key.indexOf(CONFIG_PREFIX_SEPARATOR);\n const updatedKey = key.substring(0, indexOfSeparator) === types.IniSectionType.PROFILE ? key.substring(indexOfSeparator + 1) : key;\n acc[updatedKey] = value;\n return acc;\n}, {\n ...(data.default && { default: data.default }),\n});\n\nconst ENV_CONFIG_PATH = \"AWS_CONFIG_FILE\";\nconst getConfigFilepath = () => process.env[ENV_CONFIG_PATH] || path.join(getHomeDir.getHomeDir(), \".aws\", \"config\");\n\nconst ENV_CREDENTIALS_PATH = \"AWS_SHARED_CREDENTIALS_FILE\";\nconst getCredentialsFilepath = () => process.env[ENV_CREDENTIALS_PATH] || path.join(getHomeDir.getHomeDir(), \".aws\", \"credentials\");\n\nconst prefixKeyRegex = /^([\\w-]+)\\s([\"'])?([\\w-@\\+\\.%:/]+)\\2$/;\nconst profileNameBlockList = [\"__proto__\", \"profile __proto__\"];\nconst parseIni = (iniData) => {\n const map = {};\n let currentSection;\n let currentSubSection;\n for (const iniLine of iniData.split(/\\r?\\n/)) {\n const trimmedLine = iniLine.split(/(^|\\s)[;#]/)[0].trim();\n const isSection = trimmedLine[0] === \"[\" && trimmedLine[trimmedLine.length - 1] === \"]\";\n if (isSection) {\n currentSection = undefined;\n currentSubSection = undefined;\n const sectionName = trimmedLine.substring(1, trimmedLine.length - 1);\n const matches = prefixKeyRegex.exec(sectionName);\n if (matches) {\n const [, prefix, , name] = matches;\n if (Object.values(types.IniSectionType).includes(prefix)) {\n currentSection = [prefix, name].join(CONFIG_PREFIX_SEPARATOR);\n }\n }\n else {\n currentSection = sectionName;\n }\n if (profileNameBlockList.includes(sectionName)) {\n throw new Error(`Found invalid profile name \"${sectionName}\"`);\n }\n }\n else if (currentSection) {\n const indexOfEqualsSign = trimmedLine.indexOf(\"=\");\n if (![0, -1].includes(indexOfEqualsSign)) {\n const [name, value] = [\n trimmedLine.substring(0, indexOfEqualsSign).trim(),\n trimmedLine.substring(indexOfEqualsSign + 1).trim(),\n ];\n if (value === \"\") {\n currentSubSection = name;\n }\n else {\n if (currentSubSection && iniLine.trimStart() === iniLine) {\n currentSubSection = undefined;\n }\n map[currentSection] = map[currentSection] || {};\n const key = currentSubSection ? [currentSubSection, name].join(CONFIG_PREFIX_SEPARATOR) : name;\n map[currentSection][key] = value;\n }\n }\n }\n }\n return map;\n};\n\nconst swallowError$1 = () => ({});\nconst loadSharedConfigFiles = async (init = {}) => {\n const { filepath = getCredentialsFilepath(), configFilepath = getConfigFilepath() } = init;\n const homeDir = getHomeDir.getHomeDir();\n const relativeHomeDirPrefix = \"~/\";\n let resolvedFilepath = filepath;\n if (filepath.startsWith(relativeHomeDirPrefix)) {\n resolvedFilepath = path.join(homeDir, filepath.slice(2));\n }\n let resolvedConfigFilepath = configFilepath;\n if (configFilepath.startsWith(relativeHomeDirPrefix)) {\n resolvedConfigFilepath = path.join(homeDir, configFilepath.slice(2));\n }\n const parsedFiles = await Promise.all([\n readFile.readFile(resolvedConfigFilepath, {\n ignoreCache: init.ignoreCache,\n })\n .then(parseIni)\n .then(getConfigData)\n .catch(swallowError$1),\n readFile.readFile(resolvedFilepath, {\n ignoreCache: init.ignoreCache,\n })\n .then(parseIni)\n .catch(swallowError$1),\n ]);\n return {\n configFile: parsedFiles[0],\n credentialsFile: parsedFiles[1],\n };\n};\n\nconst getSsoSessionData = (data) => Object.entries(data)\n .filter(([key]) => key.startsWith(types.IniSectionType.SSO_SESSION + CONFIG_PREFIX_SEPARATOR))\n .reduce((acc, [key, value]) => ({ ...acc, [key.substring(key.indexOf(CONFIG_PREFIX_SEPARATOR) + 1)]: value }), {});\n\nconst swallowError = () => ({});\nconst loadSsoSessionData = async (init = {}) => readFile.readFile(init.configFilepath ?? getConfigFilepath())\n .then(parseIni)\n .then(getSsoSessionData)\n .catch(swallowError);\n\nconst mergeConfigFiles = (...files) => {\n const merged = {};\n for (const file of files) {\n for (const [key, values] of Object.entries(file)) {\n if (merged[key] !== undefined) {\n Object.assign(merged[key], values);\n }\n else {\n merged[key] = values;\n }\n }\n }\n return merged;\n};\n\nconst parseKnownFiles = async (init) => {\n const parsedFiles = await loadSharedConfigFiles(init);\n return mergeConfigFiles(parsedFiles.configFile, parsedFiles.credentialsFile);\n};\n\nconst externalDataInterceptor = {\n getFileRecord() {\n return readFile.fileIntercept;\n },\n interceptFile(path, contents) {\n readFile.fileIntercept[path] = Promise.resolve(contents);\n },\n getTokenRecord() {\n return getSSOTokenFromFile.tokenIntercept;\n },\n interceptToken(id, contents) {\n getSSOTokenFromFile.tokenIntercept[id] = contents;\n },\n};\n\nexports.getSSOTokenFromFile = getSSOTokenFromFile.getSSOTokenFromFile;\nexports.readFile = readFile.readFile;\nexports.CONFIG_PREFIX_SEPARATOR = CONFIG_PREFIX_SEPARATOR;\nexports.DEFAULT_PROFILE = DEFAULT_PROFILE;\nexports.ENV_PROFILE = ENV_PROFILE;\nexports.externalDataInterceptor = externalDataInterceptor;\nexports.getProfileName = getProfileName;\nexports.loadSharedConfigFiles = loadSharedConfigFiles;\nexports.loadSsoSessionData = loadSsoSessionData;\nexports.parseKnownFiles = parseKnownFiles;\nObject.prototype.hasOwnProperty.call(getHomeDir, '__proto__') &&\n !Object.prototype.hasOwnProperty.call(exports, '__proto__') &&\n Object.defineProperty(exports, '__proto__', {\n enumerable: true,\n value: getHomeDir['__proto__']\n });\n\nObject.keys(getHomeDir).forEach(function (k) {\n if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) exports[k] = getHomeDir[k];\n});\nObject.prototype.hasOwnProperty.call(getSSOTokenFilepath, '__proto__') &&\n !Object.prototype.hasOwnProperty.call(exports, '__proto__') &&\n Object.defineProperty(exports, '__proto__', {\n enumerable: true,\n value: getSSOTokenFilepath['__proto__']\n });\n\nObject.keys(getSSOTokenFilepath).forEach(function (k) {\n if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) exports[k] = getSSOTokenFilepath[k];\n});\n"
|
|
10
10
|
],
|
|
11
11
|
"mappings": ";8GACA,CAAO,eAAe,EAAS,aAAc,CAAE,MAAO,EAAK,CAAC,EACpD,aAAkB,OAC1B,IAAM,UACA,YACA,EAAe,CAAC,EAChB,EAAqB,IAAM,CAC7B,GAAI,SAAW,QA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B,EACxB,qBAAqB,GACrB,kBAAkB,GAC1B,OAAO,UAAU,eAAe,KAAK,EAAY,WAAW,GACxD,CAAC,OAAO,UAAU,eAAe,KAAK,EAAS,WAAW,GAC1D,OAAO,eAAe,EAAS,YAAa,CACxC,WAAY,GACZ,MAAO,EAAW,SACtB,CAAC,EAEL,OAAO,KAAK,CAAU,EAAE,QAAQ,QAAS,CAAC,EAAG,CACzC,GAAI,IAAM,WAAa,CAAC,OAAO,UAAU,eAAe,KAAK,EAAS,CAAC,EAAG,EAAQ,GAAK,EAAW,GACrG,EACD,OAAO,UAAU,eAAe,KAAK,EAAqB,WAAW,GACjE,CAAC,OAAO,UAAU,eAAe,KAAK,EAAS,WAAW,GAC1D,OAAO,eAAe,EAAS,YAAa,CACxC,WAAY,GACZ,MAAO,EAAoB,SAC/B,CAAC,EAEL,OAAO,KAAK,CAAmB,EAAE,QAAQ,QAAS,CAAC,EAAG,CAClD,GAAI,IAAM,WAAa,CAAC,OAAO,UAAU,eAAe,KAAK,EAAS,CAAC,EAAG,EAAQ,GAAK,EAAoB,GAC9G",
|
|
12
|
-
"debugId": "
|
|
12
|
+
"debugId": "E91CD05BB844E54164756E2164756E21",
|
|
13
13
|
"names": []
|
|
14
14
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Qa as m}from"./chunk-ba1h9pm6.js";import{createElement as j}from"react";function z(i,t){let u=Object.keys(t).sort((s,p)=>p.length-s.length).map((s)=>s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")),r=new RegExp(u.join("|"),"g");return i.replace(r,(s)=>t[s])}async function O(i,t,u=[],r){let s=[...u.map((n)=>`${i}/views/${n}.tsx`),r?`${i}/views/${r}.tsx`:`${i}/views/RootLayout.tsx`],p=new Set;for(let n of s){let e=t.moduleGraph.getModulesByFile(n);if(e)for(let d of e)p.add(d)}let b=[],l=[],g={};for(let n of p)if(n)for(let e of n.importedModules){if(e.file.includes("module.css"))g[e.file]=e.ssrTransformResult.map.sourcesContent.join("");if(e.file.includes(".css"))l.push(e.file)}for(let n of l){let e=await t.transformRequest(n+"?direct"),d=n.includes("module.css"),a="";if(d)a=z(g[n],e.default);b.push({isDev:!0,id:n,content:d?a:e.code})}return b.map((n,e)=>{return j("style",{key:e,type:"text/css","data-vite-dev-id":n.id,dangerouslySetInnerHTML:{__html:n.content}})})}async function Q(i=[]){return i.map((t,u)=>{return j("style",{key:u,id:t?.id,type:"text/css",dangerouslySetInnerHTML:{__html:t.content}})})}import{existsSync as f}from"fs";import{basename as q}from"path";import{networkInterfaces as k}from"os";var v={name:"gemi",version:"0.
|
|
2
|
+
import{Qa as m}from"./chunk-ba1h9pm6.js";import{createElement as j}from"react";function z(i,t){let u=Object.keys(t).sort((s,p)=>p.length-s.length).map((s)=>s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")),r=new RegExp(u.join("|"),"g");return i.replace(r,(s)=>t[s])}async function O(i,t,u=[],r){let s=[...u.map((n)=>`${i}/views/${n}.tsx`),r?`${i}/views/${r}.tsx`:`${i}/views/RootLayout.tsx`],p=new Set;for(let n of s){let e=t.moduleGraph.getModulesByFile(n);if(e)for(let d of e)p.add(d)}let b=[],l=[],g={};for(let n of p)if(n)for(let e of n.importedModules){if(e.file.includes("module.css"))g[e.file]=e.ssrTransformResult.map.sourcesContent.join("");if(e.file.includes(".css"))l.push(e.file)}for(let n of l){let e=await t.transformRequest(n+"?direct"),d=n.includes("module.css"),a="";if(d)a=z(g[n],e.default);b.push({isDev:!0,id:n,content:d?a:e.code})}return b.map((n,e)=>{return j("style",{key:e,type:"text/css","data-vite-dev-id":n.id,dangerouslySetInnerHTML:{__html:n.content}})})}async function Q(i=[]){return i.map((t,u)=>{return j("style",{key:u,id:t?.id,type:"text/css",dangerouslySetInnerHTML:{__html:t.content}})})}import{existsSync as f}from"fs";import{basename as q}from"path";import{networkInterfaces as k}from"os";var v={name:"gemi",version:"0.237.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","./ai/voice":"./ai/voice/index.ts","./ai/testing":"./ai/testing/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","./probe":"./probe/index.ts","./console/run":"./console/run.ts","./queue/work":"./services/queue/work.ts","./stats/route-table":"./stats/route-table.ts","./ide/typescript-plugin":"./ide/typescript-plugin/index.ts","./bun/preload":"./bun/preload.ts","./bun/plugin":"./bun/plugin.ts","./vitest":"./vitest/index.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=@azure/communication-email --external=@azure/identity --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/ai/voice 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 x vitest","test:types":"vitest run --typecheck.only","test:live":"GEMI_AI_LIVE=1 bun --bun x vitest run ai/live","test:packaging":"bun --bun x 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","happy-dom":"^21.0.4",jsdom:"^30.0.1",oxlint:"^1.39.0",postgres:"^3.4.5",react:"19.2.3","react-dom":"19.2.3",typescript:"^5.7.3",vitest:"^4.0.0"},peerDependencies:{"@azure/communication-email":"^1.1.0","@azure/identity":"^4.0.0","@azure/storage-blob":"^12.28.0",react:">=19","react-dom":">=19",sharp:"^0.34.2",typescript:">=5",vite:"^8.0.0",postgres:"^3.4.0"},peerDependenciesMeta:{"@azure/communication-email":{optional:!0},"@azure/identity":{optional:!0},"@azure/storage-blob":{optional:!0},typescript:{optional:!0},postgres:{optional:!0}}};var E=[" \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"],$=Boolean(process.stdout.isTTY)&&!process.env.NO_COLOR,c=(i,t)=>$?`\x1B[${i}m${t}\x1B[0m`:t,h=(i)=>c("1",i),x=(i)=>c("2",i),o=(i)=>c("36",i),G=(i)=>c("32",i),_=(i)=>c("35",i);function A(){return v.version??"?"}function J(i){for(let t of Object.values(k()))for(let u of t??[])if((u.family==="IPv4"||u.family===4)&&!u.internal)return`http://${u.address}:${i}`;return null}function L(i){return m(i).filter((t)=>f(t)).map((t)=>q(t))}function V(i){let{port:t,rootDir:u}=i,r=`http://localhost:${t}`,s=J(t),p=L(u),b=(g,n)=>` ${G("\u279C")} ${h(g.padEnd(9))}${n}`,l=["",...E.map((g)=>_(g)),"",` ${x("gemi")} ${o(`v${A()}`)}`,"",b("Local:",o(r)),b("Network:",s?o(s):x("unavailable")),b("Env:",p.length?p.join(", "):x("none")),""];console.log(l.join(`
|
|
3
3
|
`))}function I(i,t){return Error(`app/views/${i}.tsx is missing. gemi's auth routes render it because ${t} is on. Add the view, or turn that setting off in app/config/auth.ts.`)}function T(i=process.env.SERVER_IDLE_TIMEOUT){if(i===void 0||i.trim()==="")return 10;let t=Number(i.trim());if(!Number.isInteger(t)||t<0||t>255)throw Error(`SERVER_IDLE_TIMEOUT must be a whole number of seconds from 0 to 255 (0 disables the timeout), got ${JSON.stringify(i)}.`);return t}
|
|
4
4
|
export{O as Z,Q as _,V as $,I as aa,T as ba};
|
|
5
5
|
|
|
6
|
-
//# debugId=
|
|
6
|
+
//# debugId=0B7688073DCCA0D764756E2164756E21
|
|
@@ -8,6 +8,6 @@
|
|
|
8
8
|
"/**\n * Bun's default, and what both servers use when `SERVER_IDLE_TIMEOUT` is unset.\n */\nexport const DEFAULT_SERVER_IDLE_TIMEOUT = 10;\n\n/**\n * The `idleTimeout` (seconds) both `gemi dev` and `gemi start` pass to\n * `Bun.serve`, from `SERVER_IDLE_TIMEOUT` (#787).\n *\n * One reader for both servers, so a long-poll that works under `gemi start`\n * also works under `gemi dev`. Before this, only `httpProd` read the variable\n * and the dev server always ran at Bun's 10 seconds.\n *\n * It is the time a connection may stay silent, a response that has not started\n * included, before Bun closes it; `0` disables it. It does not apply to an\n * upgraded websocket (the HMR relay included), which has its own\n * `websocket.idleTimeout`.\n *\n * Unset or blank means the default. Anything that is not a whole number from 0\n * to 255 (Bun's own limits) fails the boot with the variable's name, instead\n * of Bun's \"expects idleTimeout to be an integer\", which does not say where the\n * value came from.\n */\nexport function serverIdleTimeout(raw: string | undefined = process.env.SERVER_IDLE_TIMEOUT): number {\n if (raw === undefined || raw.trim() === \"\") return DEFAULT_SERVER_IDLE_TIMEOUT;\n\n const seconds = Number(raw.trim());\n if (!Number.isInteger(seconds) || seconds < 0 || seconds > 255) {\n throw new Error(\n `SERVER_IDLE_TIMEOU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,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,ECjErB,SAAS,CAAwB,CAAC,EAAc,EAAoB,CACzE,OAAW,MACT,aAAa,0DAA6D,wEAE5E,ECcK,SAAS,CAAiB,CAAC,EAA0B,QAAQ,IAAI,oBAA6B,CACnG,GAAI,IAAQ,QAAa,EAAI,KAAK,IAAM,GAAI,MArBH,IAuBzC,IAAM,EAAU,OAAO,EAAI,KAAK,CAAC,EACjC,GAAI,CAAC,OAAO,UAAU,CAAO,GAAK,EAAU,GAAK,EAAU,IACzD,MAAU,MACR,qGACmC,KAAK,UAAU,CAAG,IACvD,EAEF,OAAO",
|
|
11
|
-
"debugId": "
|
|
11
|
+
"debugId": "0B7688073DCCA0D764756E2164756E21",
|
|
12
12
|
"names": []
|
|
13
13
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
function H(z){if(z===401)return"authentication";if(z===403)return"permission";if(z===404)return"not_found";if(z===416)return"range_not_satisfiable";if(z===429)return"rate_limit";if(z>=500)return"server_error";return"form_error"}var N="GEMI_REQUEST_BREAKER_ERROR";class J extends Error{static legacyStringPayload=!1;kind=N;payload;constructor(z,C={}){super(z);let D=C.status??400;this.payload={api:{status:D,data:{error:L(C.kind??H(D),z??"",D)},...C.headers?{headers:C.headers}:{}},view:{status:D}}}}function L(z,C,D){return{kind:z,message:C,status:D}}function X(z,C,D){return J.legacyStringPayload?C:L(z,C,D)}
|
|
3
|
-
export{H as
|
|
3
|
+
export{H as Dj,N as Ej,J as Fj,L as Gj,X as Hj};
|
|
4
4
|
|
|
5
|
-
//# debugId=
|
|
5
|
+
//# debugId=5F3660793BC13AEA64756E2164756E21
|
|
@@ -6,6 +6,6 @@
|
|
|
6
6
|
"import { refusalKindForStatus, type Refusal, type RefusalKind } from \"./refusal\";\n\nexport const GEMI_REQUEST_BREAKER_ERROR = \"GEMI_REQUEST_BREAKER_ERROR\";\n\nexport type RequestBreakerOptions = {\n /** The answer's status. 400 when absent. */\n status?: number;\n /**\n * What the client's guards classify it as. Absent, it follows from\n * `status`: 401 `authentication`, 403 `permission`, 404 `not_found`, 429\n * `rate_limit`, 5xx `server_error`, any other status `form_error`.\n */\n kind?: Exclude<RefusalKind, \"validation_error\">;\n /** Extra headers for the API answer. */\n headers?: Record<string, string>;\n};\n\nexport class RequestBreakerError extends Error {\n /**\n * Answer the refusals that were bare strings before 0.88 — authentication,\n * authorization, permission, CSRF and a 500 — with that string again,\n * instead of `{ kind, message, status }`.\n *\n * For a shipped native client that reads `body.error` as a string and cannot\n * be rolled forward in the same deploy as the server. Set it once at boot,\n * and remove the line when the clients read `body.error.message`:\n *\n * ```ts\n * RequestBreakerError.legacyStringPayload = true;\n * ```\n *\n * gemi's own web client reads either shape. Refusals that were already\n * objects (404, 429, a policy 403) stay objects.\n */\n static legacyStringPayload = false;\n\n public kind = GEMI_REQUEST_BREAKER_ERROR;\n public payload: {\n api: Record<string, any>;\n view: Record<string, any>;\n /**\n * What a `.json` view navigation answers, when that differs from `api`.\n * Absent, it gets `api` — right for most breakers, but not for one that\n * must be a 401 to an API client and a redirect to the client router.\n */\n viewData?: Record<string, any>;\n };\n\n /**\n * A refusal that answers `{ error: { kind, message, status } }` with\n * `status`, so the client's guards classify it without a payload of your\n * own. A subclass that sets `payload` itself replaces this.\n *\n * ```ts\n * throw new RequestBreakerError(\"This slug is taken\", { status: 409 });\n * // → 409 { error: { kind: \"form_error\", message: \"This slug is taken\", status: 409 } }\n * ```\n */\n constructor(message?: string, options: RequestBreakerOptions = {}) {\n super(message);\n const status = options.status ?? 400;\n this.payload = {\n api: {\n status,\n data: {\n error: refusal(options.kind ?? refusalKindForStatus(status), message ?? \"\", status),\n },\n ...(options.headers ? { headers: options.headers } : {}),\n },\n view: { status },\n };\n }\n}\n\n/** A refusal's `error` field. */\nexport function refusal<K extends Exclude<RefusalKind, \"validation_error\">>(\n kind: K,\n message: string,\n status: number,\n): Refusal<K> {\n return { kind, message, status };\n}\n\n/**\n * A refusal that was a bare string before 0.88: the object, or the string\n * under `RequestBreakerError.legacyStringPayload`.\n *\n * @internal\n */\nexport function stringEraRefusal<K extends Exclude<RefusalKind, \"validation_error\">>(\n kind: K,\n message: string,\n status: number,\n): Refusal<K> | string {\n return RequestBreakerError.legacyStringPayload ? message : refusal(kind, message, status);\n}\n"
|
|
7
7
|
],
|
|
8
8
|
"mappings": ";AA0DO,SAAS,CAAoB,CAAC,EAA0D,CAC7F,GAAI,IAAW,IAAK,MAAO,iBAC3B,GAAI,IAAW,IAAK,MAAO,aAC3B,GAAI,IAAW,IAAK,MAAO,YAC3B,GAAI,IAAW,IAAK,MAAO,wBAC3B,GAAI,IAAW,IAAK,MAAO,aAC3B,GAAI,GAAU,IAAK,MAAO,eAC1B,MAAO,aC/DF,IAAM,EAA6B,6BAenC,MAAM,UAA4B,KAAM,OAiBtC,qBAAsB,GAEtB,KAAO,EACP,QAqBP,WAAW,CAAC,EAAkB,EAAiC,CAAC,EAAG,CACjE,MAAM,CAAO,EACb,IAAM,EAAS,EAAQ,QAAU,IACjC,KAAK,QAAU,CACb,IAAK,CACH,SACA,KAAM,CACJ,MAAO,EAAQ,EAAQ,MAAQ,EAAqB,CAAM,EAAG,GAAW,GAAI,CAAM,CACpF,KACI,EAAQ,QAAU,CAAE,QAAS,EAAQ,OAAQ,EAAI,CAAC,CACxD,EACA,KAAM,CAAE,QAAO,CACjB,EAEJ,CAGO,SAAS,CAA2D,CACzE,EACA,EACA,EACY,CACZ,MAAO,CAAE,OAAM,UAAS,QAAO,EAS1B,SAAS,CAAoE,CAClF,EACA,EACA,EACqB,CACrB,OAAO,EAAoB,oBAAsB,EAAU,EAAQ,EAAM,EAAS,CAAM",
|
|
9
|
-
"debugId": "
|
|
9
|
+
"debugId": "5F3660793BC13AEA64756E2164756E21",
|
|
10
10
|
"names": []
|
|
11
11
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{Sm as J}from"./chunk-5fxdjmgd.js";class L{kernel;onException;constructor(f){this.kernel=new f.kernel,this.kernel.boot.call(this.kernel),this.onException=f.onException??((A)=>{console.error("Unhandled exception in App:",A)})}async waitForBoot(){await this.kernel.waitForBoot()}getComponentTree(){return this.kernel.viewRoutes().componentTree}getFlatComponentTree(){let f=new Set;for(let A of this.kernel.domains().viewDispatchers())for(let C of A.flatComponentTree)f.add(C);return Array.from(f)}getRequiredViews(){let f={};for(let A of this.kernel.domains().viewDispatchers())Object.assign(f,A.requiredViews);return f}devAllowedHosts(){let{resolver:f}=this.kernel.domains();if(!f)return[];if(f.devHosts===!0)return!0;return[`.${f.root}`,...f.devHosts]}sockets(){return this.kernel.sockets.call(this.kernel)}applyTrustedClientIp(f){this.kernel.domains().applyClientIp(f)}async staticFiles(f){return this.kernel.run.call(this.kernel,()=>this.kernel.domains().staticFiles(f))}getRouteManifest(){return this.kernel.viewRoutes().routeManifest}globallyGated=new WeakMap;async withGlobalMiddleware(f,A,C){let z;try{z=await this.kernel.run.call(this.kernel,()=>this.kernel.globalMiddleware(f))}catch(F){return await C(F)}if(z.refusal)return z.refusal;return this.globallyGated.set(f,z.carried),z.apply(await A(f))}async fetch(f){let A=new URL(f.url);return this.kernel.run.call(this.kernel,async()=>{this.applyTrustedClientIp(f);let C=this.globallyGated.has(f),z=C?null:await this.kernel.globalMiddleware(f),F=C?this.globallyGated.get(f):z.carried;if(z?.refusal)return z.refusal;let H=this.kernel.mcpHttp();if(H){let B=await H.handle(f);if(B)return z?z.apply(B):B}let I=this.kernel.domains(),D=await I.ask(f)??await I.route(f);if(D instanceof Response)return z?z.apply(D):D;if(!D){let B=new Response("Unknown host",{status:404});return z?z.apply(B):B}let G=J(A.pathname)?await D.api.handleApiRequest(f,F):await D.view.handleViewRequest(f,F);if(!z)return G;if(typeof G==="function"){let B=G;return async(...M)=>z.apply(await B(...M))}return z.apply(G)})}dispatchJob(f,A){return this.kernel.run.bind(this.kernel)(()=>{return this.kernel.queue().dispatchJob(f,A)})}shutdown(f){return this.kernel.shutdown(f)}destroy(){this.kernel.destroy()}clone(){return Object.assign(Object.create(Object.getPrototypeOf(this)),this)}}export{L as Sa};
|
|
3
3
|
|
|
4
|
-
//# debugId=
|
|
4
|
+
//# debugId=8F5856DF79B1C4A664756E2164756E21
|
|
@@ -5,6 +5,6 @@
|
|
|
5
5
|
"import type { Kernel } from \"../kernel\";\nimport type { CarriedContext } from \"../http/requestContext\";\nimport { isApiPath } from \"../services/router/apiPath\";\nimport type { SocketHub } from \"../services/broadcast/SocketHub\";\n\n/** What the servers use of the broadcast `SocketHub`. */\nexport type SocketTransport = Pick<\n SocketHub,\n \"matches\" | \"upgrade\" | \"websocket\" | \"socketOptions\" | \"start\" | \"shutdown\"\n>;\n\ninterface AppParams {\n kernel: new () => Kernel;\n onException?: (error: Error) => void;\n}\n\nexport class App {\n private kernel: Kernel;\n public onException?: (error: Error) => void;\n\n constructor(params: AppParams) {\n this.kernel = new params.kernel();\n this.kernel.boot.call(this.kernel);\n this.onException =\n params.onException ??\n ((error: Error) => {\n console.error(\"Unhandled exception in App:\", error);\n });\n }\n\n // Every service this class touches is resolved through a `this.kernel.*`\n // accessor rather than by importing the service class and calling `app()`\n // here. That is deliberate: the built bin (`dist/bin/gemi.js`) bundles its own\n // copy of gemi, while the app's Kernel is loaded from source and resolves\n // `gemi/*` to the source modules — so the two copies have *different*\n // `kernelContext` AsyncLocalStorage instances and different `Application`\n // class objects. A method call on the Kernel executes in the app's copy and\n // reads the app's container; a resolution attempted here would not. Service\n // *tokens* still cross the boundary safely (they are plain strings), which is\n // why `kernel.resolve()` works from either side.\n public async waitForBoot() {\n await this.kernel.waitForBoot();\n }\n\n public getComponentTree() {\n return this.kernel.viewRoutes().componentTree;\n }\n\n // Every host group's views, not just the root's: the servers load these\n // modules up front, and a view only an `admin.` group routes to still has\n // to be among them.\n public getFlatComponentTree() {\n const views = new Set<string>();\n for (const dispatcher of this.kernel.domains().viewDispatchers()) {\n for (const view of dispatcher.flatComponentTree) {\n views.add(view);\n }\n }\n return Array.from(views);\n }\n\n /**\n * The views gemi's own routes need from `app/views`, by name, with the\n * config that requires each (#1040), for the servers' existence check.\n */\n public getRequiredViews(): Record<string, string> {\n const views: Record<string, string> = {};\n for (const dispatcher of this.kernel.domains().viewDispatchers()) {\n Object.assign(views, dispatcher.requiredViews);\n }\n return views;\n }\n\n /**\n * The hosts the dev server's Vite may answer, besides the ones it always\n * admits (`localhost`, `*.localhost`, IP addresses): the `route.domains`\n * root, its subdomains and `route.domains.devHosts`. `true`, any host, only\n * when the app sets `devHosts: true` itself. Custom domains are not let\n * through on their own: the dev server cannot tell a real one from a host\n * name pointed at it by DNS rebinding, even less so with `custom.fallback`.\n */\n public devAllowedHosts(): true | string[] {\n const { resolver } = this.kernel.domains();\n if (!resolver) {\n return [];\n }\n if (resolver.devHosts === true) {\n return true;\n }\n return [`.${resolver.root}`, ...resolver.devHosts];\n }\n\n /**\n * The broadcast WebSocket endpoint the servers wire into `Bun.serve`, or\n * `null` when the app has no `route.channels`. Typed structurally: the hub\n * belongs to the app's copy of gemi (see the note above).\n */\n public sockets(): SocketTransport | null {\n return this.kernel.sockets.call(this.kernel);\n }\n\n /**\n * Applies `route.domains.trustProxy`'s `clientIpHeader` and, failing that,\n * `GEMI_CLIENT_IP_HEADER` (with or without `route.domains`): on a request\n * that carries a proxy's secret, the address its header names becomes\n * the one in `X-Forwarded-For`. The servers call it right after settling\n * `X-Forwarded-For` (`GEMI_TRUST_PROXY`) and before anything reads it —\n * the socket upgrade and the global middleware included. `fetch` calls it\n * too, for a caller that is not one of the servers. Idempotent.\n */\n public applyTrustedClientIp(req: Request) {\n this.kernel.domains().applyClientIp(req);\n }\n\n /**\n * How the servers serve static files to `req`'s host (#1015): whether the\n * files copied out of `public/` are served, and whether a miss under\n * `/assets` reaches the routes, and whether `/assets` files are sent with\n * `Access-Control-Allow-Origin: *` (#1311). Resolves the host only when a\n * `route.domains` group sets one of them differently from the root.\n */\n public async staticFiles(\n req: Request,\n ): Promise<{ publicFiles: boolean; assetRoutes: boolean; assetCors?: boolean }> {\n return this.kernel.run.call(this.kernel, () => this.kernel.domains().staticFiles(req));\n }\n\n public getRouteManifest() {\n return this.kernel.viewRoutes().routeManifest;\n }\n\n // Requests `withGlobalMiddleware` already ran the global middleware for, so\n // `fetch` inside it does not run the list a second time, and can still hand\n // the route what the list carried. Keyed by the Request object: the servers\n // hand `fetch` the same one they gated.\n private globallyGated = new WeakMap<Request, CarriedContext | null>();\n\n /**\n * Runs the `global` middleware list, then `next` — what the servers put in\n * front of everything they serve, so the list covers static files, which\n * never reach `fetch`, as well as routes. A refusal is answered without\n * calling `next`. A global middleware that throws something other than a\n * break is answered by `onError` rather than by `next`, since a gate that\n * failed must not let a static file through.\n */\n public async withGlobalMiddleware(\n req: Request,\n next: (req: Request) => Promise<Response>,\n onError: (err: unknown) => Response | Promise<Response>,\n ): Promise<Response> {\n let outcome: Awaited<ReturnType<Kernel[\"globalMiddleware\"]>>;\n try {\n outcome = await this.kernel.run.call(this.kernel, () => this.kernel.globalMiddleware(req));\n } catch (err) {\n return await onError(err);\n }\n if (outcome.refusal) {\n return outcome.refusal;\n }\n this.globallyGated.set(req, outcome.carried);\n return outcome.apply(await next(req));\n }\n\n public async fetch(req: Request): Promise<Response> {\n const url = new URL(req.url);\n return this.kernel.run.call(this.kernel, async () => {\n // Repeated from the servers, for a caller that is not one of them.\n this.applyTrustedClientIp(req);\n // Run here too for a caller that is not one of the servers, a test or an\n // app's own `Bun.serve`, so the list is not skipped by calling `fetch`.\n const gated = this.globallyGated.has(req);\n const outcome = gated ? null : await this.kernel.globalMiddleware(req);\n const carried = gated ? this.globallyGated.get(req) : outcome.carried;\n if (outcome?.refusal) {\n return outcome.refusal;\n }\n // The MCP endpoint, and its OAuth endpoints, on the host it is\n // configured for. Ahead of routing, so no route can shadow it, and after\n // the global middleware, which covers it as it covers everything.\n const mcp = this.kernel.mcpHttp();\n if (mcp) {\n const answered = await mcp.handle(req);\n if (answered) {\n return outcome ? outcome.apply(answered) : answered;\n }\n }\n const domains = this.kernel.domains();\n const dispatchers = (await domains.ask(req)) ?? (await domains.route(req));\n if (dispatchers instanceof Response) {\n return outcome ? outcome.apply(dispatchers) : dispatchers;\n }\n if (!dispatchers) {\n const unknown = new Response(\"Unknown host\", { status: 404 });\n return outcome ? outcome.apply(unknown) : unknown;\n }\n const result = isApiPath(url.pathname)\n ? await dispatchers.api.handleApiRequest(req, carried)\n : await dispatchers.view.handleViewRequest(req, carried);\n if (!outcome) {\n return result;\n }\n // A document comes back as a render function the server calls with its\n // manifests, and the Response only exists once it has.\n if (typeof result === \"function\") {\n const render = result as (...args: any[]) => Promise<Response>;\n return (async (...args: any[]) => outcome.apply(await render(...args))) as any;\n }\n return outcome.apply(result);\n });\n }\n\n public dispatchJob(jobName: string, args: string) {\n const kernelRun = this.kernel.run.bind(this.kernel);\n return kernelRun(() => {\n return this.kernel.queue().dispatchJob(jobName, args);\n });\n }\n\n /** Every provider's `shutdown()`; see `Kernel.shutdown`. */\n public shutdown(options?: { timeoutMs?: number }) {\n return this.kernel.shutdown(options);\n }\n\n public destroy() {\n this.kernel.destroy();\n }\n\n public clone() {\n return Object.assign(Object.create(Object.getPrototypeOf(this)), this);\n }\n}\n\nexport type FetchHandler = InstanceType<typeof App>[\"fetch\"];\n"
|
|
6
6
|
],
|
|
7
7
|
"mappings": ";yCAgBO,MAAM,CAAI,CACP,OACD,YAEP,WAAW,CAAC,EAAmB,CAC7B,KAAK,OAAS,IAAI,EAAO,OACzB,KAAK,OAAO,KAAK,KAAK,KAAK,MAAM,EACjC,KAAK,YACH,EAAO,cACN,CAAC,IAAiB,CACjB,QAAQ,MAAM,8BAA+B,CAAK,SAc3C,YAAW,EAAG,CACzB,MAAM,KAAK,OAAO,YAAY,EAGzB,gBAAgB,EAAG,CACxB,OAAO,KAAK,OAAO,WAAW,EAAE,cAM3B,oBAAoB,EAAG,CAC5B,IAAM,EAAQ,IAAI,IAClB,QAAW,KAAc,KAAK,OAAO,QAAQ,EAAE,gBAAgB,EAC7D,QAAW,KAAQ,EAAW,kBAC5B,EAAM,IAAI,CAAI,EAGlB,OAAO,MAAM,KAAK,CAAK,EAOlB,gBAAgB,EAA2B,CAChD,IAAM,EAAgC,CAAC,EACvC,QAAW,KAAc,KAAK,OAAO,QAAQ,EAAE,gBAAgB,EAC7D,OAAO,OAAO,EAAO,EAAW,aAAa,EAE/C,OAAO,EAWF,eAAe,EAAoB,CACxC,IAAQ,YAAa,KAAK,OAAO,QAAQ,EACzC,GAAI,CAAC,EACH,MAAO,CAAC,EAEV,GAAI,EAAS,WAAa,GACxB,MAAO,GAET,MAAO,CAAC,IAAI,EAAS,OAAQ,GAAG,EAAS,QAAQ,EAQ5C,OAAO,EAA2B,CACvC,OAAO,KAAK,OAAO,QAAQ,KAAK,KAAK,MAAM,EAYtC,oBAAoB,CAAC,EAAc,CACxC,KAAK,OAAO,QAAQ,EAAE,cAAc,CAAG,OAU5B,YAAW,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AAM,EAAU,IAAI,SAAS,eAAgB,CAAE,OAAQ,GAAI,CAAC,EAC5D,OAAO,EAAU,EAAQ,MAAM,CAAO,EAAI,EAE5C,IAAM,EAAS,EAAU,EAAI,QAAQ,EACjC,MAAM,EAAY,IAAI,iBAAiB,EAAK,CAAO,EACnD,MAAM,EAAY,KAAK,kBAAkB,EAAK,CAAO,EACzD,GAAI,CAAC,EACH,OAAO,EAIT,GAAI,OAAO,IAAW,WAAY,CAChC,IAAM,EAAS,EACf,MAAQ,UAAU,IAAgB,EAAQ,MAAM,MAAM,EAAO,GAAG,CAAI,CAAC,EAEvE,OAAO,EAAQ,MAAM,CAAM,EAC5B,EAGI,WAAW,CAAC,EAAiB,EAAc,CAEhD,OADkB,KAAK,OAAO,IAAI,KAAK,KAAK,MAAM,EACjC,IAAM,CACrB,OAAO,KAAK,OAAO,MAAM,EAAE,YAAY,EAAS,CAAI,EACrD,EAII,QAAQ,CAAC,EAAkC,CAChD,OAAO,KAAK,OAAO,SAAS,CAAO,EAG9B,OAAO,EAAG,CACf,KAAK,OAAO,QAAQ,EAGf,KAAK,EAAG,CACb,OAAO,OAAO,OAAO,OAAO,OAAO,OAAO,eAAe,IAAI,CAAC,EAAG,IAAI,EAEzE",
|
|
8
|
-
"debugId": "
|
|
8
|
+
"debugId": "8F5856DF79B1C4A664756E2164756E21",
|
|
9
9
|
"names": []
|
|
10
10
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{Vm as y}from"./chunk-g29wz7h7.js";var v=y((x)=>{class s extends Error{name="ProviderError";tryNextLink;constructor(r,t=!0){let n,e=!0;if(typeof t==="boolean")n=void 0,e=t;else if(t!=null&&typeof t==="object")n=t.logger,e=t.tryNextLink??!0;super(r);this.tryNextLink=e,Object.setPrototypeOf(this,s.prototype),n?.debug?.(`@smithy/property-provider ${e?"->":"(!)"} ${r}`)}static from(r,t=!0){return Object.assign(new this(r.message,t),r)}}class f extends s{name="CredentialsProviderError";constructor(r,t=!0){super(r,t);Object.setPrototypeOf(this,f.prototype)}}class l extends s{name="TokenProviderError";constructor(r,t=!0){super(r,t);Object.setPrototypeOf(this,l.prototype)}}var p=(...r)=>async()=>{if(r.length===0)throw new s("No providers in chain");let t;for(let n of r)try{return await n()}catch(e){if(t=e,e?.tryNextLink)continue;throw e}throw t},d=(r)=>()=>Promise.resolve(r),h=(r,t,n)=>{let e,o,i,c=!1,a=async()=>{if(!o)o=r();try{e=await o,i=!0,c=!1}finally{o=void 0}return e};if(t===void 0)return async(u)=>{if(!i||u?.forceRefresh)e=await a();return e};return async(u)=>{if(!i||u?.forceRefresh)e=await a();if(c)return e;if(n&&!n(e))return c=!0,e;if(t(e))return await a(),e;return e}};x.CredentialsProviderError=f;x.ProviderError=s;x.TokenProviderError=l;x.chain=p;x.fromStatic=d;x.memoize=h});
|
|
3
3
|
export{v as Y};
|
|
4
4
|
|
|
5
|
-
//# debugId=
|
|
5
|
+
//# debugId=76D45D5D5C80303364756E2164756E21
|
|
@@ -5,6 +5,6 @@
|
|
|
5
5
|
"'use strict';\n\nclass ProviderError extends Error {\n name = \"ProviderError\";\n tryNextLink;\n constructor(message, options = true) {\n let logger;\n let tryNextLink = true;\n if (typeof options === \"boolean\") {\n logger = undefined;\n tryNextLink = options;\n }\n else if (options != null && typeof options === \"object\") {\n logger = options.logger;\n tryNextLink = options.tryNextLink ?? true;\n }\n super(message);\n this.tryNextLink = tryNextLink;\n Object.setPrototypeOf(this, ProviderError.prototype);\n logger?.debug?.(`@smithy/property-provider ${tryNextLink ? \"->\" : \"(!)\"} ${message}`);\n }\n static from(error, options = true) {\n return Object.assign(new this(error.message, options), error);\n }\n}\n\nclass CredentialsProviderError extends ProviderError {\n name = \"CredentialsProviderError\";\n constructor(message, options = true) {\n super(message, options);\n Object.setPrototypeOf(this, CredentialsProviderError.prototype);\n }\n}\n\nclass TokenProviderError extends ProviderError {\n name = \"TokenProviderError\";\n constructor(message, options = true) {\n super(message, options);\n Object.setPrototypeOf(this, TokenProviderError.prototype);\n }\n}\n\nconst chain = (...providers) => async () => {\n if (providers.length === 0) {\n throw new ProviderError(\"No providers in chain\");\n }\n let lastProviderError;\n for (const provider of providers) {\n try {\n const credentials = await provider();\n return credentials;\n }\n catch (err) {\n lastProviderError = err;\n if (err?.tryNextLink) {\n continue;\n }\n throw err;\n }\n }\n throw lastProviderError;\n};\n\nconst fromStatic = (staticValue) => () => Promise.resolve(staticValue);\n\nconst memoize = (provider, isExpired, requiresRefresh) => {\n let resolved;\n let pending;\n let hasResult;\n let isConstant = false;\n const coalesceProvider = async () => {\n if (!pending) {\n pending = provider();\n }\n try {\n resolved = await pending;\n hasResult = true;\n isConstant = false;\n }\n finally {\n pending = undefined;\n }\n return resolved;\n };\n if (isExpired === undefined) {\n return async (options) => {\n if (!hasResult || options?.forceRefresh) {\n resolved = await coalesceProvider();\n }\n return resolved;\n };\n }\n return async (options) => {\n if (!hasResult || options?.forceRefresh) {\n resolved = await coalesceProvider();\n }\n if (isConstant) {\n return resolved;\n }\n if (requiresRefresh && !requiresRefresh(resolved)) {\n isConstant = true;\n return resolved;\n }\n if (isExpired(resolved)) {\n await coalesceProvider();\n return resolved;\n }\n return resolved;\n };\n};\n\nexports.CredentialsProviderError = CredentialsProviderError;\nexports.ProviderError = ProviderError;\nexports.TokenProviderError = TokenProviderError;\nexports.chain = chain;\nexports.fromStatic = fromStatic;\nexports.memoize = memoize;\n"
|
|
6
6
|
],
|
|
7
7
|
"mappings": ";uDAEA,MAAM,UAAsB,KAAM,CAC9B,KAAO,gBACP,YACA,WAAW,CAAC,EAAS,EAAU,GAAM,CACjC,IAAI,EACA,EAAc,GAClB,GAAI,OAAO,IAAY,UACnB,EAAS,OACT,EAAc,EAEb,QAAI,GAAW,MAAQ,OAAO,IAAY,SAC3C,EAAS,EAAQ,OACjB,EAAc,EAAQ,aAAe,GAEzC,MAAM,CAAO,EACb,KAAK,YAAc,EACnB,OAAO,eAAe,KAAM,EAA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N,EAEX,GAAI,EAAU,CAAQ,EAElB,OADA,MAAM,EAAiB,EAChB,EAEX,OAAO,IAIP,2BAA2B,EAC3B,gBAAgB,EAChB,qBAAqB,EACrB,QAAQ,EACR,aAAa,EACb,UAAU",
|
|
8
|
-
"debugId": "
|
|
8
|
+
"debugId": "76D45D5D5C80303364756E2164756E21",
|
|
9
9
|
"names": []
|
|
10
10
|
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Xe as o}from"./chunk-a9p3djqm.js";import{Ye as i}from"./chunk-bhycdjcv.js";import{kl as t}from"./chunk-6wv3k8ap.js";import{pm as r}from"./chunk-xj3ebwrj.js";class n extends i{register(){this.app.singleton(r,()=>new r(t(o(),this.app.config.get("translation",{}))))}}
|
|
3
|
+
export{n as pb};
|
|
4
|
+
|
|
5
|
+
//# debugId=FCA3167375F5B56F64756E2164756E21
|
|
@@ -5,6 +5,6 @@
|
|
|
5
5
|
"import { ServiceProvider } from \"../support/ServiceProvider\";\nimport { withDefaults } from \"../support/withDefaults\";\nimport { Translator } from \"./Translator\";\nimport { translationConfigDefaults, type TranslationConfig } from \"./config\";\n\nexport class TranslationServiceProvider extends ServiceProvider {\n register() {\n this.app.singleton(\n Translator,\n () =>\n new Translator(\n withDefaults(\n translationConfigDefaults(),\n this.app.config.get<TranslationConfig>(\"translation\", {}),\n ),\n ),\n );\n }\n}\n"
|
|
6
6
|
],
|
|
7
7
|
"mappings": ";sLAKO,AAAM,IAAmC,LAAgB,CAC9D,QAAQ,EAAG,CACT,KAAK,IAAI,UACP,EACA,IACE,IAAI,EACF,EACE,EAA0B,EAC1B,KAAK,IAAI,OAAO,IAAuB,cAAe,CAAC,CAAC,CAC1D,CACF,CACJ,EAEJ",
|
|
8
|
-
"debugId": "
|
|
8
|
+
"debugId": "FCA3167375F5B56F64756E2164756E21",
|
|
9
9
|
"names": []
|
|
10
10
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{kl as m}from"./chunk-6wv3k8ap.js";import{ml as H,nl as C,rl as A,tl as E}from"./chunk-nznkpf8r.js";import{Vl as g}from"./chunk-fgnpyj44.js";import{Cm as k}from"./chunk-5pbjc6tm.js";import{Ym as l}from"./chunk-g29wz7h7.js";class V extends Error{lock;token;constructor(J,Y,Z="its lease ran out or another holder took it"){super(`Lost the lock "${J}" (token ${Y}): ${Z}.`);this.lock=J;this.token=Y;this.name="LockLostError"}}var d=60000,h=100,c=(J)=>new Promise((Y)=>setTimeout(Y,J));class T{store;name;owner;token;ttl;lost;controller=new AbortController;deadline;expiryTimer;renewTimer;done=!1;constructor(J,Y,Z,$,j,W){this.store=J;this.name=Y;this.owner=Z;this.token=$;this.ttl=j;this.lost=this.controller.signal,this.deadline=W+j,this.armExpiry()}get expired(){return this.lost.aborted||performance.now()>=this.deadline}async extend(J=this.ttl){if(this.lost.aborted)return!1;let Y=performance.now();if(!await this.store.extend(this.name,this.owner,this.token,J))return this.markLost(),!1;if(this.done)return!0;return this.deadline=Math.max(this.deadline,Y+J),this.armExpiry(),!0}async isHeld(){if(this.lost.aborted)return!1;let J=await this.store.held(this.name,this.owner,this.token);if(!J)this.markLost();return J}async fence(J){if(this.lost.aborted)throw new V(this.name,this.token);try{return await this.store.fence(this.name,this.owner,this.token,J)}catch(Y){if(Y instanceof V)this.markLost();throw Y}}async release(){if(this.stop(),this.lost.aborted)return!1;return this.store.release(this.name,this.owner,this.token)}startRenewing(){if(this.renewTimer||this.done)return;this.renewTimer=setInterval(()=>{this.extend().catch((J)=>{console.error(`[gemi] Could not renew the lock "${this.name}".`,J)})},Math.max(1,Math.floor(this.ttl/3))),this.renewTimer.unref?.()}markLost(J){if(this.stop(),!this.lost.aborted)this.controller.abort(new V(this.name,this.token,J))}stop(){this.done=!0,clearInterval(this.renewTimer),clearTimeout(this.expiryTimer),this.renewTimer=void 0,this.expiryTimer=void 0}armExpiry(){clearTimeout(this.expiryTimer),this.expiryTimer=setTimeout(()=>this.markLost("its lease ran out before it was renewed"),Math.max(0,this.deadline-performance.now())),this.expiryTimer.unref?.()}}class i{store;static token="locks";constructor(J){this.store=J}async acquire(J,Y={}){let Z=Y.ttl??d;if(!(Z>0))throw Error(`A lock's ttl must be a positive number of milliseconds; got ${Z}.`);let $=Bun.randomUUIDv7(),j=performance.now()+Math.max(0,Y.wait??0);for(;;){let W=performance.now(),z=await this.store.acquire(J,$,Z);if(z!==null){let X=new T(this.store,J,$,z,Z,W);if(Y.renew)X.startRenewing();return X}let G=j-performance.now();if(G<=0)return null;await c(Math.min(h,G))}}async run(J,Y,Z){let $=await this.acquire(J,{...Y,renew:Y.renew??!0});if(!$)return{acquired:!1};let j;try{j=await Z($)}catch(W){throw await $.release().catch(()=>{}),W}if($.expired)throw $.markLost(),$.lost.reason;return await $.release(),{acquired:!0,value:j}}}function VJ(J){return J}function S(){return{driver:"memory",pollInterval:30000,maxSubscriptions:1e4,batchSize:100,keepaliveInterval:5000}}function O(J){let Y=new URLSearchParams;for(let[Z,$]of J)Y.append(Z,String($));return Y.toString()}function R(J){let Y=new Map;if(!J)return Y;let Z;try{Z=new URLSearchParams(J)}catch{return Y}for(let[$,j]of Z){let W=Number(j);if(j!==""&&Number.isSafeInteger(W)&&W>=0)Y.set($,W)}return Y}var{SQL:s}=globalThis.Bun;function t(){return Bun.semver.satisfies(Bun.version,">=1.4.0")}var o=async(J)=>{let Y=new s(J,{max:1,idleTimeout:0,maxLifetime:0});return{listen:(Z,$,j)=>Y.listen(Z,$,j),close:()=>Y.close({timeout:1})}},a=async(J)=>{let Y;try{Y=(await import("./chunk-sxtg2qha.js")).default}catch($){throw Error("The change feed's database driver needs a Postgres client that can LISTEN: Bun 1.4 or later, or the `postgres` package (bun add postgres).",{cause:$})}let Z=Y(J,{max:1,idle_timeout:0,max_lifetime:null,fetch_types:!1,onnotice:()=>{}});return{listen:($,j,W)=>Z.listen($,j,W),close:()=>Z.end({timeout:1}).catch(()=>{})}},y=(J)=>t()?o(J):a(J);var r=/^[A-Za-z_][A-Za-z0-9_]*$/;class x{headsTable;entriesTable;notifyChannel;sql;dialect;connection;url;retain;listener;sqliteTurn=Promise.resolve();constructor(J,Y={}){if(J.dialect!=="postgres"&&J.dialect!=="sqlite")throw Error(`The change feed's database driver supports Postgres and SQLite, not ${J.dialect}.`);let Z=Y.headsTable??"gemi_change_heads",$=Y.entriesTable??"gemi_changes",j=Y.notifyChannel??"gemi_changes";for(let z of[Z,$,j])if(!r.test(z))throw Error(`"${z}" is not a plain identifier. Use letters, digits and underscores.`);let W=Y.retain??1000;if(!Number.isInteger(W)||W<1)throw Error(`The change feed's retain must be a whole number, 1 or more; got ${W}.`);this.headsTable=Z,this.entriesTable=$,this.notifyChannel=j,this.sql=J.sql,this.dialect=J.dialect,this.connection=J.name,this.url=J.url,this.retain=W,this.listener=Y.listener??y}async createTable(){for(let J of n(this.headsTable,this.entriesTable))await this.sql.unsafe(J)}joinsTransaction(){return this.transaction()!==void 0}publish(J,Y){let Z=this.transaction();if(!Z){let j=()=>this.sql.begin((z)=>this.append(z,J,Y));if(this.dialect!=="sqlite")return j();let W=this.sqliteTurn.then(j);return this.sqliteTurn=W.catch(()=>{}),W}let $=this.append(Z,J,Y);return E($),$}async append(J,Y,Z){let $=J.unsafe(`"${this.headsTable}"`),j=J.unsafe(`"${this.entriesTable}"`),[W]=await J`
|
|
3
3
|
INSERT INTO ${$} (channel, seq) VALUES (${Y}, 1)
|
|
4
4
|
ON CONFLICT (channel) DO UPDATE SET seq = ${$}.seq + 1
|
|
5
5
|
RETURNING seq
|
|
@@ -34,6 +34,6 @@ data: ${JSON.stringify(J.event)}
|
|
|
34
34
|
data: ${JSON.stringify(Y)}
|
|
35
35
|
|
|
36
36
|
`)}function v(J,Y,Z,$){let j=Y instanceof Request?Y:Y.rawRequest,W=$.cursor??j.headers.get("Last-Event-ID")??new URL(j.url).searchParams.get("cursor"),z;try{z=J.subscribe(Z,{cursor:W,signal:j.signal})}catch(Q){if(!(Q instanceof P))throw Q;return new Response(JSON.stringify({error:"The change feed is at capacity."}),{status:503,headers:{"Content-Type":"application/json","Retry-After":String($.retryAfter??5)}})}let G=null,X=!1,U=!1,B=(Q)=>{if(G)clearInterval(G);if(G=null,z.close(),U)return;U=!0;try{Q.close()}catch{}},p=new ReadableStream({start(Q){G=setInterval(()=>{if(k())return B(Q);try{Q.enqueue(w.encode(N))}catch{B(Q)}},J.config.keepaliveInterval)},async pull(Q){try{if(!X){if(await z.ready(),X=!0,!U)Q.enqueue(b(z.cursor,{type:"ready"}));return}let K=await z.next();if(K.done||U)return B(Q);Q.enqueue(b(z.cursor,K.value))}catch(K){if(!U)console.error("[gemi] A change feed stream failed.",K);B(Q)}},cancel(){if(U=!0,G)clearInterval(G);G=null,z.close()}});return new Response(p,{headers:_()})}var q=255,f=500,$J=30000;class P extends Error{limit;constructor(J){super(`The change feed holds its limit of ${J} subscriptions.`);this.limit=J;this.name="ChangeFeedFullError"}}class jJ{options;static token="changeFeed";driver;config;followers=new Map;all=new Set;listenState="off";listening=null;retryTimer=null;backoffMs=f;pollTimer=null;polling=null;constructor(J={},Y={}){this.options=Y;this.config=m(S(),J),this.driver=zJ(this.config.driver,Y.application)}get subscriptions(){return this.all.size}get isListening(){return this.listenState==="listening"}async publish(J,Y){F(J);let Z=Y===void 0?null:Y;if(H()!==void 0&&!this.driver.joinsTransaction?.())return A(async()=>{this.wake(J,await this.driver.publish(J,Z))}),null;let $=await this.driver.publish(J,Z);return A(()=>this.wake(J,$)),$}async head(J){return F(J),(await this.driver.heads([J])).get(J)??0}async cursor(J){let Y=D(J);return O(await this.driver.heads(Y))}subscribe(J,Y={}){let Z=D(J);if(this.all.size>=this.config.maxSubscriptions)throw new P(this.config.maxSubscriptions);let $=new u(this,Z,WJ(Y.cursor),this.config,Y.signal);this.all.add($);for(let j of Z){let W=this.followers.get(j);if(!W)this.followers.set(j,W=new Set);W.add($)}return this.startListening(),this.startPolling(),$}stream(J,Y,Z={}){return v(this,J,D(Y),Z)}async close(){if(this.listenState="closed",this.retryTimer)clearTimeout(this.retryTimer);this.retryTimer=null,this.stopPolling();for(let Y of this.all)Y.close();let J=this.listening;this.listening=null,await J?.close(),await this.driver.close?.()}forget(J){if(!this.all.delete(J))return;for(let Y of J.channels){let Z=this.followers.get(Y);if(Z?.delete(J),Z?.size===0)this.followers.delete(Y)}if(this.all.size===0)this.stopPolling()}poll(){return this.polling??=(async()=>{try{let J=[...this.followers.keys()];for(let Y=0;Y<J.length;Y+=500){let Z=await this.driver.heads(J.slice(Y,Y+500));for(let[$,j]of Z)this.wake($,j)}}catch(J){console.error("[gemi] The change feed could not read its channels' heads.",J)}finally{this.polling=null}})(),this.polling}startPolling(){if(this.pollTimer)return;this.pollTimer=setInterval(()=>void this.poll(),this.config.pollInterval),this.pollTimer.unref?.()}stopPolling(){if(this.pollTimer)clearInterval(this.pollTimer);this.pollTimer=null}wake(J,Y){for(let Z of this.followers.get(J)??[])Z.moved(J,Y)}resync(){this.poll()}startListening(){if(this.listenState!=="off"||!this.driver.listen)return;this.connect()}async connect(){this.listenState="connecting",this.retryTimer=null;try{let J=await this.driver.listen((Y,Z)=>this.wake(Y,Z),()=>this.resync());if(this.listenState!=="connecting"){await J.close();return}this.listening=J,this.listenState="listening",this.backoffMs=f,this.resync()}catch(J){if(this.listenState!=="connecting")return;console.error(`[gemi] The change feed could not listen for other instances' changes; retrying in ${this.backoffMs}ms.`,J),this.listenState="retrying",this.retryTimer=setTimeout(()=>void this.connect(),this.backoffMs),this.retryTimer.unref?.(),this.backoffMs=Math.min(this.backoffMs*2,$J)}}}class u{manager;config;signal;channels;positions=new Map;readTo=new Map;dirty=new Set;pending=[];started=null;wakeUp=null;closed=!1;onAbort=()=>this.close();constructor(J,Y,Z,$,j){this.manager=J;this.config=$;this.signal=j;this.channels=Y;for(let W of Y){let z=Z.get(W);if(z!==void 0)this.positions.set(W,z),this.readTo.set(W,z),this.dirty.add(W)}if(j?.aborted)this.close();else j?.addEventListener("abort",this.onAbort,{once:!0})}get cursor(){return O(this.positions)}get isClosed(){return this.closed}ready(){return this.started??=(async()=>{let J=this.channels.filter((Z)=>!this.positions.has(Z));if(J.length===0)return;let Y=await this.manager.driver.heads(J);for(let Z of J){let $=Y.get(Z)??0;this.positions.set(Z,$),this.readTo.set(Z,$)}})(),this.started}async next(){await this.ready();for(;;){if(this.closed)return{done:!0,value:void 0};let J=this.pending.shift();if(J)return this.positions.set(J.channel,J.seq),{done:!1,value:J};let Y=this.dirty.values().next().value;if(Y!==void 0){await this.read(Y);continue}await this.idle()}}async return(){return this.close(),{done:!0,value:void 0}}[Symbol.asyncIterator](){return this}close(){if(this.closed)return;this.closed=!0,this.pending.length=0,this.signal?.removeEventListener("abort",this.onAbort),this.manager.forget(this),this.wake()}moved(J,Y){let Z=this.readTo.get(J);if(Z!==void 0&&Y===Z)return;this.dirty.add(J),this.wake()}async read(J){let Y=this.readTo.get(J)??0;this.dirty.delete(J);let{batchSize:Z}=this.config,{entries:$,head:j,gap:W}=await this.manager.driver.read(J,Y,Z);if(this.closed)return;if(W){this.readTo.set(J,j),this.pending.push({type:"reset",channel:J,seq:j});return}for(let z of $)this.readTo.set(J,z.seq),this.pending.push({type:"change",channel:J,seq:z.seq,data:z.data});if($.length===Z)this.dirty.add(J)}idle(){return new Promise((J)=>{this.wakeUp=J})}wake(){let J=this.wakeUp;this.wakeUp=null,J?.()}}function F(J){if(typeof J!=="string"||J===""||J.length>q)throw Error(`A change feed channel is a string of 1 to ${q} characters; got ${JSON.stringify(J)}.`)}function D(J){let Y=[...new Set(typeof J==="string"?[J]:J)];if(Y.length===0)throw Error("A change feed subscription needs at least one channel.");for(let Z of Y)F(Z);return Y}function WJ(J){if(J===void 0||J===null)return new Map;if(typeof J==="string")return R(J);let Y=J instanceof Map?[...J]:Object.entries(J);return R(O(new Map(Y)))}function zJ(J,Y){if(J==="memory")return new I;if(J==="database"||typeof J==="function"){if(!Y&&(J==="database"||J.length>0))throw Error("The change feed driver needs the application it belongs to, and this ChangeFeedManager was built without one. Pass { application }.");if(J==="database")return new x(Y.make(g));return J(Y)}if(typeof J==="string")throw Error(`Unknown change feed driver "${J}". The changeFeed slice's driver is "memory", "database", a ChangeFeedDriver, or a function returning one.`);return J}var GJ={ms:1,s:1000,m:60000,h:3600000,d:86400000,w:604800000};function vJ(J){if(typeof J==="number"){if(!Number.isFinite(J)||J<0)throw TypeError(`A duration is 0 or more milliseconds; got ${J}.`);return Math.round(J)}let Y=/^\s*(\d+(?:\.\d+)?)\s*(ms|s|m|h|d|w)\s*$/.exec(String(J));if(!Y)throw TypeError(`"${String(J)}" is not a duration. Use milliseconds, or a number and one of ms, s, m, h, d, w ("30s", "7d").`);return Math.round(Number(Y[1])*GJ[Y[2]])}
|
|
37
|
-
export{vJ as
|
|
37
|
+
export{vJ as Vk,V as Wk,T as Xk,i as Yk,VJ as Zk,S as _k,O as $k,R as al,x as bl,I as cl,L as dl,JJ as el,_ as fl,MJ as gl,P as hl,jJ as il,u as jl};
|
|
38
38
|
|
|
39
|
-
//# debugId=
|
|
39
|
+
//# debugId=E0473EC09D13941664756E2164756E21
|
|
@@ -15,6 +15,6 @@
|
|
|
15
15
|
"/**\n * A length of time: milliseconds as a number, or a number and a unit, such as\n * `\"500ms\"`, `\"30s\"`, `\"5m\"`, `\"2h\"`, `\"7d\"` or `\"1w\"`.\n */\nexport type Duration = number | `${number}${\"ms\" | \"s\" | \"m\" | \"h\" | \"d\" | \"w\"}`;\n\nconst UNITS: Record<string, number> = {\n ms: 1,\n s: 1000,\n m: 60_000,\n h: 60 * 60_000,\n d: 24 * 60 * 60_000,\n w: 7 * 24 * 60 * 60_000,\n};\n\n/** A `Duration` in milliseconds. Throws for anything else, on the caller's stack. */\nexport function toMilliseconds(duration: Duration): number {\n if (typeof duration === \"number\") {\n if (!Number.isFinite(duration) || duration < 0) {\n throw new TypeError(`A duration is 0 or more milliseconds; got ${duration}.`);\n }\n return Math.round(duration);\n }\n const match = /^\\s*(\\d+(?:\\.\\d+)?)\\s*(ms|s|m|h|d|w)\\s*$/.exec(String(duration));\n if (!match) {\n throw new TypeError(\n `\"${String(duration)}\" is not a duration. Use milliseconds, or a number and ` +\n `one of ms, s, m, h, d, w (\"30s\", \"7d\").`,\n );\n }\n return Math.round(Number(match[1]) * UNITS[match[2]!]!);\n}\n"
|
|
16
16
|
],
|
|
17
17
|
"mappings": ";6PAsGO,AAAM,IAAsB,DAAM,LAE5B,KACA,MAFX,WAAW,CACA,EACA,EACT,EAAS,8CACT,CACA,MAAM,kBAAkB,aAAgB,OAAW,IAAS,EAJnD,YACA,aAIT,KAAK,KAAO,gBAEhB,CC5FA,IAAM,EAAc,MACd,EAAY,IAEZ,EAAQ,CAAC,IAAe,IAAI,QAAQ,CAAC,IAAY,WAAW,EAAS,CAAE,CAAC,EAgBvE,MAAM,CAAS,CASD,MACR,KACA,MACA,MACA,IAZF,KACQ,WAAa,IAAI,gBAC1B,SACA,YACA,WACA,KAAO,GAEf,WAAW,CACQ,EACR,EACA,EACA,EACA,EACT,EACA,CANiB,aACR,YACA,aACA,aACA,WAGT,KAAK,KAAO,KAAK,WAAW,OAC5B,KAAK,SAAW,EAAc,EAC9B,KAAK,UAAU,KAIb,QAAO,EAAY,CACrB,OAAO,KAAK,KAAK,SAAW,YAAY,IAAI,GAAK,KAAK,cAIlD,OAAM,CAAC,EAAM,KAAK,IAAuB,CAC7C,GAAI,KAAK,KAAK,QAAS,MAAO,GAC9B,IAAM,EAAc,YAAY,IAAI,EAEpC,GAAI,CADO,MAAM,KAAK,MAAM,OAAO,KAAK,KAAM,KAAK,MAAO,KAAK,MAAO,CAAG,EAGvE,OADA,KAAK,SAAS,EACP,GAET,GAAI,KAAK,KAAM,MAAO,GAGtB,OAFA,KAAK,SAAW,KAAK,IAAI,KAAK,SAAU,EAAc,CAAG,EACzD,KAAK,UAAU,EACR,QAIH,OAAM,EAAqB,CAC/B,GAAI,KAAK,KAAK,QAAS,MAAO,GAC9B,IAAM,EAAO,MAAM,K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G,QACH,EAAG,SACH,EAAG,SACL,EAGO,SAAS,EAAc,CAAC,EAA4B,CACzD,GAAI,OAAO,IAAa,SAAU,CAChC,GAAI,CAAC,OAAO,SAAS,CAAQ,GAAK,EAAW,EAC3C,MAAU,UAAU,6CAA6C,IAAW,EAE9E,OAAO,KAAK,MAAM,CAAQ,EAE5B,IAAM,EAAQ,2CAA2C,KAAK,OAAO,CAAQ,CAAC,EAC9E,GAAI,CAAC,EACH,MAAU,UACR,IAAI,OAAO,CAAQ,iGAErB,EAEF,OAAO,KAAK,MAAM,OAAO,EAAM,EAAE,EAAI,GAAM,EAAM,GAAK",
|
|
18
|
-
"debugId": "
|
|
18
|
+
"debugId": "E0473EC09D13941664756E2164756E21",
|
|
19
19
|
"names": []
|
|
20
20
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{h as _t}from"./chunk-k2mpxwh2.js";import{A as oo,B as Lt,C as yo,i as er,k as M,l as vo,m as Eo,n as So,p as Gr,q as zr,r as kt,s as Io,t as cr,u as Po,v as xo,w as ar,x as eo,y as ro,z as to}from"./chunk-9sbhqscs.js";import{D as gt}from"./chunk-6v1fbe70.js";import{E as hr,F as mt,H as Qt,L as Ue,P as f}from"./chunk-at82qczv.js";import{Q as Oo}from"./chunk-h0dch3vh.js";import{T as zt}from"./chunk-h5wjk91m.js";import{U as Ht}from"./chunk-8n40a2sn.js";import"./chunk-hprgj13q.js";import"./chunk-4n3jva4e.js";import"./chunk-sh2bd09k.js";import"./chunk-x6a5qxpa.js";import{Aa as Zt}from"./chunk-28yb0q82.js";import{Sm as S}from"./chunk-ts75gcfd.js";var A=S((oe)=>{Object.defineProperty(oe,"__esModule",{value:!0});oe.resolveHttpAuthSchemeConfig=oe.defaultSSOOIDCHttpAuthSchemeProvider=oe.defaultSSOOIDCHttpAuthSchemeParametersProvider=void 0;var Rr=M(),w=hr(),fr=async(e,r,i)=>{return{operation:(0,w.getSmithyContext)(r).operation,region:await(0,w.normalizeProvider)(e.region)()||(()=>{throw Error("expected `region` to be configured for `aws.auth#sigv4`")})()}};oe.defaultSSOOIDCHttpAuthSchemeParametersProvider=fr;function Fr(e){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"sso-oauth",region:e.region},propertiesExtractor:(r,i)=>({signingProperties:{config:r,context:i}})}}function Ur(e){return{schemeId:"smithy.api#noAuth"}}var $r=(e)=>{let r=[];switch(e.operation){case"CreateToken":{r.push(Ur(e));break}default:r.push(Fr(e))}return r};oe.defaultSSOOIDCHttpAuthSchemeProvider=$r;var jr=(e)=>{let r=(0,Rr.resolveAwsSdkSigV4Config)(e);return Object.assign(r,{authSchemePreference:(0,w.normalizeProvider)(e.authSchemePreference??[])})};oe.resolveHttpAuthSchemeConfig=jr});var De=S((xe)=>{Object.defineProperty(xe,"__esModule",{value:!0});xe.ruleSet=void 0;var Ee="required",p="fn",d="argv",q="ref",se=!0,ne="isSet",N="booleanEquals",D="error",b="endpoint",I="tree",G="PartitionResult",z="getAttr",pe={[Ee]:!1,type:"string"},de={[Ee]:!0,default:!1,type:"boolean"},ce={[q]:"Endpoint"},Se={[p]:N,[d]:[{[q]:"UseFIPS"},!0]},Ie={[p]:N,[d]:[{[q]:"UseDualStack"},!0]},n={},ae={[p]:z,[d]:[{[q]:G},"supportsFIPS"]},Pe={[q]:G},le={[p]:N,[d]:[!0,{[p]:z,[d]:[Pe,"supportsDualStack"]}]},ue=[Se],Oe=[Ie],ve=[{[q]:"Region"}],Ar={version:"1.0",parameters:{Region:pe,UseDualStack:de,UseFIPS:de,Endpoint:pe},rules:[{conditions:[{[p]:ne,[d]:[ce]}],rules:[{conditions:ue,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:D},{conditions:Oe,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:D},{endpoint:{url:ce,properties:n,headers:n},type:b}],type:I},{conditions:[{[p]:ne,[d]:ve}],rules:[{conditions:[{[p]:"aws.partition",[d]:ve,assign:G}],rules:[{conditions:[Se,Ie],rules:[{conditions:[{[p]:N,[d]:[se,ae]},le],rules:[{endpoint:{url:"https://oidc-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:n,headers:n},type:b}],type:I},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:D}],type:I},{conditions:ue,rules:[{conditions:[{[p]:N,[d]:[ae,se]}],rules:[{conditions:[{[p]:"stringEquals",[d]:[{[p]:z,[d]:[Pe,"name"]},"aws-us-gov"]}],endpoint:{url:"https://oidc.{Region}.amazonaws.com",properties:n,headers:n},type:b},{endpoint:{url:"https://oidc-fips.{Region}.{PartitionResult#dnsSuffix}",properties:n,headers:n},type:b}],type:I},{error:"FIPS is enabled but this partition does not support FIPS",type:D}],type:I},{conditions:Oe,rules:[{conditions:[le],rules:[{endpoint:{url:"https://oidc.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:n,headers:n},type:b}],type:I},{error:"DualStack is enabled but this partition does not support DualStack",type:D}],type:I},{endpoint:{url:"https://oidc.{Region}.{PartitionResult#dnsSuffix}",properties:n,headers:n},type:b}],type:I}],type:I},{error:"Invalid Configuration: Missing Region",type:D}]};xe.ruleSet=Ar});var Ne=S((be)=>{Object.defineProperty(be,"__esModule",{value:!0});be.defaultEndpointResolver=void 0;var mr=zr(),m=Gr(),Hr=De(),Lr=new m.EndpointCache({size:50,params:["Endpoint","Region","UseDualStack","UseFIPS"]}),Tr=(e,r={})=>{return Lr.get(e,()=>(0,m.resolveEndpoint)(Hr.ruleSet,{endpointParams:e,logger:r.logger}))};be.defaultEndpointResolver=Tr;m.customEndpointFunctions.aws=mr.awsEndpointFunctions});var F=S((L)=>{Object.defineProperty(L,"__esModule",{value:!0});L.SSOOIDCServiceException=L.__ServiceException=void 0;var he=f();Object.defineProperty(L,"__ServiceException",{enumerable:!0,get:function(){return he.ServiceException}});class H extends he.ServiceException{constructor(e){super(e);Object.setPrototypeOf(this,H.prototype)}}L.SSOOIDCServiceException=H});var k=S((fe)=>{Object.defineProperty(fe,"__esModule",{value:!0});fe.UnsupportedGrantTypeException=fe.UnauthorizedClientException=fe.SlowDownException=fe.InvalidScopeException=fe.InvalidRequestException=fe.InvalidGrantException=fe.InvalidClientException=fe.InternalServerException=fe.ExpiredTokenException=fe.AuthorizationPendingException=fe.AccessDeniedException=void 0;var l=F();class T extends l.SSOOIDCServiceException{name="AccessDeniedException";$fault="client";error;reason;error_description;constructor(e){super({name:"AccessDeniedException",$fault:"client",...e});Object.setPrototypeOf(this,T.prototype),this.error=e.error,this.reason=e.reason,this.error_description=e.error_description}}fe.AccessDeniedException=T;class B extends l.SSOOIDCServiceException{name="AuthorizationPendingException";$fault="client";error;error_description;constructor(e){super({name:"AuthorizationPendingException",$fault:"client",...e});Object.setPrototypeOf(this,B.prototype),this.error=e.error,this.error_description=e.error_description}}fe.AuthorizationPendingException=B;class V extends l.SSOOIDCServiceException{name="ExpiredTokenException";$fault="client";error;error_description;constructor(e){super({name:"ExpiredTokenException",$fault:"client",...e});Object.setPrototypeOf(this,V.prototype),this.error=e.error,this.error_description=e.error_description}}fe.ExpiredTokenException=V;class W extends l.SSOOIDCServiceException{name="InternalServerException";$fault="server";error;error_description;constructor(e){super({name:"InternalServerException",$fault:"server",...e});Object.setPrototypeOf(this,W.prototype),this.error=e.error,this.error_description=e.error_description}}fe.InternalServerException=W;class Y extends l.SSOOIDCServiceException{name="InvalidClientException";$fault="client";error;error_description;constructor(e){super({name:"InvalidClientException",$fault:"client",...e});Object.setPrototypeOf(this,Y.prototype),this.error=e.error,this.error_description=e.error_description}}fe.InvalidClientException=Y;class J extends l.SSOOIDCServiceException{name="InvalidGrantException";$fault="client";error;error_description;constructor(e){super({name:"InvalidGrantException",$fault:"client",...e});Object.setPrototypeOf(this,J.prototype),this.error=e.error,this.error_description=e.error_description}}fe.InvalidGrantException=J;class K extends l.SSOOIDCServiceException{name="InvalidRequestException";$fault="client";error;reason;error_description;constructor(e){super({name:"InvalidRequestException",$fault:"client",...e});Object.setPrototypeOf(this,K.prototype),this.error=e.error,this.reason=e.reason,this.error_description=e.error_description}}fe.InvalidRequestException=K;class X extends l.SSOOIDCServiceException{name="InvalidScopeException";$fault="client";error;error_description;constructor(e){super({name:"InvalidScopeException",$fault:"client",...e});Object.setPrototypeOf(this,X.prototype),this.error=e.error,this.error_description=e.error_description}}fe.InvalidScopeException=X;class C extends l.SSOOIDCServiceException{name="SlowDownException";$fault="client";error;error_description;constructor(e){super({name:"SlowDownException",$fault:"client",...e});Object.setPrototypeOf(this,C.prototype),this.error=e.error,this.error_description=e.error_description}}fe.SlowDownException=C;class Q extends l.SSOOIDCServiceException{name="UnauthorizedClientException";$fault="client";error;error_description;constructor(e){super({name:"UnauthorizedClientException",$fault:"client",...e});Object.setPrototypeOf(this,Q.prototype),this.error=e.error,this.error_description=e.error_description}}fe.UnauthorizedClientException=Q;class Z extends l.SSOOIDCServiceException{name="UnsupportedGrantTypeException";$fault="client";error;error_description;constructor(e){super({name:"UnsupportedGrantTypeException",$fault:"client",...e});Object.setPrototypeOf(this,Z.prototype),this.error=e.error,this.error_description=e.error_description}}fe.UnsupportedGrantTypeException=Z});var g=S((ze)=>{Object.defineProperty(ze,"__esModule",{value:!0});ze.CreateToken$=ze.CreateTokenResponse$=ze.CreateTokenRequest$=ze.errorTypeRegistries=ze.UnsupportedGrantTypeException$=ze.UnauthorizedClientException$=ze.SlowDownException$=ze.InvalidScopeException$=ze.InvalidRequestException$=ze.InvalidGrantException$=ze.InvalidClientException$=ze.InternalServerException$=ze.ExpiredTokenException$=ze.AuthorizationPendingException$=ze.AccessDeniedException$=ze.SSOOIDCServiceException$=void 0;var kr="AccessDeniedException",gr="AuthorizationPendingException",_r="AccessToken",et="ClientSecret",rt="CreateToken",tt="CreateTokenRequest",ot="CreateTokenResponse",it="CodeVerifier",st="ExpiredTokenException",nt="InvalidClientException",pt="InvalidGrantException",dt="InvalidRequestException",ct="InternalServerException",at="InvalidScopeException",lt="IdToken",ut="RefreshToken",Ot="SlowDownException",vt="UnauthorizedClientException",Et="UnsupportedGrantTypeException",St="accessToken",E="client",It="clientId",Pt="clientSecret",xt="codeVerifier",yt="code",Dt="deviceCode",t="error",bt="expiresIn",u="error_description",qt="grantType",Nt="http",O="httpError",ht="idToken",$e="reason",je="refreshToken",Rt="redirectUri",we="smithy.ts.sdk.synthetic.com.amazonaws.ssooidc",ft="scope",Ft="server",Ut="tokenType",o="com.amazonaws.ssooidc",Me=Ue(),v=k(),$t=F(),Ae=Me.TypeRegistry.for(we);ze.SSOOIDCServiceException$=[-3,we,"SSOOIDCServiceException",0,[],[]];Ae.registerError(ze.SSOOIDCServiceException$,$t.SSOOIDCServiceException);var c=Me.TypeRegistry.for(o);ze.AccessDeniedException$=[-3,o,kr,{[t]:E,[O]:400},[t,$e,u],[0,0,0]];c.registerError(ze.AccessDeniedException$,v.AccessDeniedException);ze.AuthorizationPendingException$=[-3,o,gr,{[t]:E,[O]:400},[t,u],[0,0]];c.registerError(ze.AuthorizationPendingException$,v.AuthorizationPendingException);ze.ExpiredTokenException$=[-3,o,st,{[t]:E,[O]:400},[t,u],[0,0]];c.registerError(ze.ExpiredTokenException$,v.ExpiredTokenException);ze.InternalServerException$=[-3,o,ct,{[t]:Ft,[O]:500},[t,u],[0,0]];c.registerError(ze.InternalServerException$,v.InternalServerException);ze.InvalidClientException$=[-3,o,nt,{[t]:E,[O]:401},[t,u],[0,0]];c.registerError(ze.InvalidClientException$,v.InvalidClientException);ze.InvalidGrantException$=[-3,o,pt,{[t]:E,[O]:400},[t,u],[0,0]];c.registerError(ze.InvalidGrantException$,v.InvalidGrantException);ze.InvalidRequestException$=[-3,o,dt,{[t]:E,[O]:400},[t,$e,u],[0,0,0]];c.registerError(ze.InvalidRequestException$,v.InvalidRequestException);ze.InvalidScopeException$=[-3,o,at,{[t]:E,[O]:400},[t,u],[0,0]];c.registerError(ze.InvalidScopeException$,v.InvalidScopeException);ze.SlowDownException$=[-3,o,Ot,{[t]:E,[O]:400},[t,u],[0,0]];c.registerError(ze.SlowDownException$,v.SlowDownException);ze.UnauthorizedClientException$=[-3,o,vt,{[t]:E,[O]:400},[t,u],[0,0]];c.registerError(ze.UnauthorizedClientException$,v.UnauthorizedClientException);ze.UnsupportedGrantTypeException$=[-3,o,Et,{[t]:E,[O]:400},[t,u],[0,0]];c.registerError(ze.UnsupportedGrantTypeException$,v.UnsupportedGrantTypeException);ze.errorTypeRegistries=[Ae,c];var jt=[0,o,_r,8,0],wt=[0,o,et,8,0],Mt=[0,o,it,8,0],At=[0,o,lt,8,0],Ge=[0,o,ut,8,0];ze.CreateTokenRequest$=[3,o,tt,0,[It,Pt,qt,Dt,yt,je,ft,Rt,xt],[0,[()=>wt,0],0,0,0,[()=>Ge,0],64,0,[()=>Mt,0]],3];ze.CreateTokenResponse$=[3,o,ot,0,[St,Ut,bt,je,ht],[[()=>jt,0],0,1,[()=>Ge,0],[()=>At,0]]];ze.CreateToken$=[9,o,rt,{[Nt]:["POST","/token",200]},()=>ze.CreateTokenRequest$,()=>ze.CreateTokenResponse$]});var or=S((rr)=>{Object.defineProperty(rr,"__esModule",{value:!0});rr.getRuntimeConfig=void 0;var Tt=M(),Bt=Lt(),Vt=er(),Wt=f(),Yt=Ht(),ge=mt(),_e=zt(),Jt=A(),Kt=Ne(),Xt=g(),Ct=(e)=>{return{apiVersion:"2019-06-10",base64Decoder:e?.base64Decoder??ge.fromBase64,base64Encoder:e?.base64Encoder??ge.toBase64,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??Kt.defaultEndpointResolver,extensions:e?.extensions??[],httpAuthSchemeProvider:e?.httpAuthSchemeProvider??Jt.defaultSSOOIDCHttpAuthSchemeProvider,httpAuthSchemes:e?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:(r)=>r.getIdentityProvider("aws.auth#sigv4"),signer:new Tt.AwsSdkSigV4Signer},{schemeId:"smithy.api#noAuth",identityProvider:(r)=>r.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new Vt.NoAuthSigner}],logger:e?.logger??new Wt.NoOpLogger,protocol:e?.protocol??Bt.AwsRestJsonProtocol,protocolSettings:e?.protocolSettings??{defaultNamespace:"com.amazonaws.ssooidc",errorTypeRegistries:Xt.errorTypeRegistries,version:"2019-06-10",serviceTarget:"AWSSSOOIDCService"},serviceId:e?.serviceId??"SSO OIDC",urlParser:e?.urlParser??Yt.parseUrl,utf8Decoder:e?.utf8Decoder??_e.fromUtf8,utf8Encoder:e?.utf8Encoder??_e.toUtf8}};rr.getRuntimeConfig=Ct});var Or=S((lr)=>{Object.defineProperty(lr,"__esModule",{value:!0});lr.getRuntimeConfig=void 0;var io=Zt(),so=io.__importDefault(_t()),ir=M(),sr=eo(),U=cr(),no=ro(),nr=ar(),x=gt(),pr=Qt(),dr=f(),po=to(),co=oo(),ao=kt(),lo=or(),uo=(e)=>{(0,dr.emitWarningIfUnsupportedVersion)(process.version);let r=(0,co.resolveDefaultsModeConfig)(e),i=()=>r().then(dr.loadConfigsForDefaultMode),a=(0,lo.getRuntimeConfig)(e);(0,ir.emitWarningIfUnsupportedVersion)(process.version);let s={profile:e?.profile,logger:a.logger};return{...a,...e,runtime:"node",defaultsMode:r,authSchemePreference:e?.authSchemePreference??(0,x.loadConfig)(ir.NODE_AUTH_SCHEME_PREFERENCE_OPTIONS,s),bodyLengthChecker:e?.bodyLengthChecker??po.calculateBodyLength,defaultUserAgentProvider:e?.defaultUserAgentProvider??(0,sr.createDefaultUserAgentProvider)({serviceId:a.serviceId,clientVersion:so.default.version}),maxAttempts:e?.maxAttempts??(0,x.loadConfig)(nr.NODE_MAX_ATTEMPT_CONFIG_OPTIONS,e),region:e?.region??(0,x.loadConfig)(U.NODE_REGION_CONFIG_OPTIONS,{...U.NODE_REGION_CONFIG_FILE_OPTIONS,...s}),requestHandler:pr.NodeHttpHandler.create(e?.requestHandler??i),retryMode:e?.retryMode??(0,x.loadConfig)({...nr.NODE_RETRY_MODE_CONFIG_OPTIONS,default:async()=>(await i()).retryMode||ao.DEFAULT_RETRY_MODE},e),sha256:e?.sha256??no.Hash.bind(null,"sha256"),streamCollector:e?.streamCollector??pr.streamCollector,useDualstackEndpoint:e?.useDualstackEndpoint??(0,x.loadConfig)(U.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS,s),useFipsEndpoint:e?.useFipsEndpoint??(0,x.loadConfig)(U.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS,s),userAgentAppId:e?.userAgentAppId??(0,x.loadConfig)(sr.NODE_APP_ID_CONFIG_OPTIONS,s)}};lr.getRuntimeConfig=uo});var Yo=S((P)=>{var vr=vo(),Do=Eo(),bo=So(),Er=Io(),qo=cr(),_=er(),No=Ue(),ho=Po(),yr=xo(),Sr=ar(),y=f(),Ir=A(),Ro=Or(),Pr=yo(),xr=Oo(),h=g(),$=k(),fo=F(),Fo=(e)=>{return Object.assign(e,{useDualstackEndpoint:e.useDualstackEndpoint??!1,useFipsEndpoint:e.useFipsEndpoint??!1,defaultSigningName:"sso-oauth"})},Uo={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}},$o=(e)=>{let{httpAuthSchemes:r,httpAuthSchemeProvider:i,credentials:a}=e;return{setHttpAuthScheme(s){let R=r.findIndex((j)=>j.schemeId===s.schemeId);if(R===-1)r.push(s);else r.splice(R,1,s)},httpAuthSchemes(){return r},setHttpAuthSchemeProvider(s){i=s},httpAuthSchemeProvider(){return i},setCredentials(s){a=s},credentials(){return a}}},jo=(e)=>{return{httpAuthSchemes:e.httpAuthSchemes(),httpAuthSchemeProvider:e.httpAuthSchemeProvider(),credentials:e.credentials()}},wo=(e,r)=>{let i=Object.assign(Pr.getAwsRegionExtensionConfiguration(e),y.getDefaultExtensionConfiguration(e),xr.getHttpHandlerExtensionConfiguration(e),$o(e));return r.forEach((a)=>a.configure(i)),Object.assign(e,Pr.resolveAwsRegionExtensionConfiguration(i),y.resolveDefaultRuntimeConfig(i),xr.resolveHttpHandlerRuntimeConfig(i),jo(i))};class ee extends y.Client{config;constructor(...[e]){let r=Ro.getRuntimeConfig(e||{});super(r);this.initConfig=r;let i=Fo(r),a=Er.resolveUserAgentConfig(i),s=Sr.resolveRetryConfig(a),R=qo.resolveRegionConfig(s),j=vr.resolveHostHeaderConfig(R),Dr=yr.resolveEndpointConfig(j),br=Ir.resolveHttpAuthSchemeConfig(Dr),qr=wo(br,e?.extensions||[]);this.config=qr,this.middlewareStack.use(No.getSchemaSerdePlugin(this.config)),this.middlewareStack.use(Er.getUserAgentPlugin(this.config)),this.middlewareStack.use(Sr.getRetryPlugin(this.config)),this.middlewareStack.use(ho.getContentLengthPlugin(this.config)),this.middlewareStack.use(vr.getHostHeaderPlugin(this.config)),this.middlewareStack.use(Do.getLoggerPlugin(this.config)),this.middlewareStack.use(bo.getRecursionDetectionPlugin(this.config)),this.middlewareStack.use(_.getHttpAuthSchemeEndpointRuleSetPlugin(this.config,{httpAuthSchemeParametersProvider:Ir.defaultSSOOIDCHttpAuthSchemeParametersProvider,identityProviderConfigProvider:async(Nr)=>new _.DefaultIdentityProviderConfig({"aws.auth#sigv4":Nr.credentials})})),this.middlewareStack.use(_.getHttpSigningPlugin(this.config))}destroy(){super.destroy()}}class re extends y.Command.classBuilder().ep(Uo).m(function(e,r,i,a){return[yr.getEndpointPlugin(i,e.getEndpointParameterInstructions())]}).s("AWSSSOOIDCService","CreateToken",{}).n("SSOOIDCClient","CreateTokenCommand").sc(h.CreateToken$).build(){}var Mo={CreateTokenCommand:re};class te extends ee{}y.createAggregatedClient(Mo,te);var Ao={KMS_ACCESS_DENIED:"KMS_AccessDeniedException"},Go={KMS_DISABLED_KEY:"KMS_DisabledException",KMS_INVALID_KEY_USAGE:"KMS_InvalidKeyUsageException",KMS_INVALID_STATE:"KMS_InvalidStateException",KMS_KEY_NOT_FOUND:"KMS_NotFoundException"};P.$Command=y.Command;P.__Client=y.Client;P.SSOOIDCServiceException=fo.SSOOIDCServiceException;P.AccessDeniedExceptionReason=Ao;P.CreateTokenCommand=re;P.InvalidRequestExceptionReason=Go;P.SSOOIDC=te;P.SSOOIDCClient=ee;Object.prototype.hasOwnProperty.call(h,"__proto__")&&!Object.prototype.hasOwnProperty.call(P,"__proto__")&&Object.defineProperty(P,"__proto__",{enumerable:!0,value:h.__proto__});Object.keys(h).forEach(function(e){if(e!=="default"&&!Object.prototype.hasOwnProperty.call(P,e))P[e]=h[e]});Object.prototype.hasOwnProperty.call($,"__proto__")&&!Object.prototype.hasOwnProperty.call(P,"__proto__")&&Object.defineProperty(P,"__proto__",{enumerable:!0,value:$.__proto__});Object.keys($).forEach(function(e){if(e!=="default"&&!Object.prototype.hasOwnProperty.call(P,e))P[e]=$[e]})});export default Yo();
|
|
2
|
+
import{h as _t}from"./chunk-x8pk6qqs.js";import{A as oo,B as Lt,C as yo,i as er,k as M,l as vo,m as Eo,n as So,p as Gr,q as zr,r as kt,s as Io,t as cr,u as Po,v as xo,w as ar,x as eo,y as ro,z as to}from"./chunk-5kjnbmwp.js";import{D as gt}from"./chunk-y9efbqmp.js";import{E as hr,F as mt,H as Qt,L as Ue,P as f}from"./chunk-jwh7t982.js";import{Q as Oo}from"./chunk-h6z5k6yh.js";import{T as zt}from"./chunk-pqaha4f1.js";import{U as Ht}from"./chunk-trbwk80g.js";import"./chunk-185k67yf.js";import"./chunk-b9gf8sqq.js";import"./chunk-5nn0pgxg.js";import"./chunk-2h1ta6cv.js";import{Aa as Zt}from"./chunk-gj4hg8xk.js";import{Vm as S}from"./chunk-g29wz7h7.js";var A=S((oe)=>{Object.defineProperty(oe,"__esModule",{value:!0});oe.resolveHttpAuthSchemeConfig=oe.defaultSSOOIDCHttpAuthSchemeProvider=oe.defaultSSOOIDCHttpAuthSchemeParametersProvider=void 0;var Rr=M(),w=hr(),fr=async(e,r,i)=>{return{operation:(0,w.getSmithyContext)(r).operation,region:await(0,w.normalizeProvider)(e.region)()||(()=>{throw Error("expected `region` to be configured for `aws.auth#sigv4`")})()}};oe.defaultSSOOIDCHttpAuthSchemeParametersProvider=fr;function Fr(e){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"sso-oauth",region:e.region},propertiesExtractor:(r,i)=>({signingProperties:{config:r,context:i}})}}function Ur(e){return{schemeId:"smithy.api#noAuth"}}var $r=(e)=>{let r=[];switch(e.operation){case"CreateToken":{r.push(Ur(e));break}default:r.push(Fr(e))}return r};oe.defaultSSOOIDCHttpAuthSchemeProvider=$r;var jr=(e)=>{let r=(0,Rr.resolveAwsSdkSigV4Config)(e);return Object.assign(r,{authSchemePreference:(0,w.normalizeProvider)(e.authSchemePreference??[])})};oe.resolveHttpAuthSchemeConfig=jr});var De=S((xe)=>{Object.defineProperty(xe,"__esModule",{value:!0});xe.ruleSet=void 0;var Ee="required",p="fn",d="argv",q="ref",se=!0,ne="isSet",N="booleanEquals",D="error",b="endpoint",I="tree",G="PartitionResult",z="getAttr",pe={[Ee]:!1,type:"string"},de={[Ee]:!0,default:!1,type:"boolean"},ce={[q]:"Endpoint"},Se={[p]:N,[d]:[{[q]:"UseFIPS"},!0]},Ie={[p]:N,[d]:[{[q]:"UseDualStack"},!0]},n={},ae={[p]:z,[d]:[{[q]:G},"supportsFIPS"]},Pe={[q]:G},le={[p]:N,[d]:[!0,{[p]:z,[d]:[Pe,"supportsDualStack"]}]},ue=[Se],Oe=[Ie],ve=[{[q]:"Region"}],Ar={version:"1.0",parameters:{Region:pe,UseDualStack:de,UseFIPS:de,Endpoint:pe},rules:[{conditions:[{[p]:ne,[d]:[ce]}],rules:[{conditions:ue,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:D},{conditions:Oe,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:D},{endpoint:{url:ce,properties:n,headers:n},type:b}],type:I},{conditions:[{[p]:ne,[d]:ve}],rules:[{conditions:[{[p]:"aws.partition",[d]:ve,assign:G}],rules:[{conditions:[Se,Ie],rules:[{conditions:[{[p]:N,[d]:[se,ae]},le],rules:[{endpoint:{url:"https://oidc-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:n,headers:n},type:b}],type:I},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:D}],type:I},{conditions:ue,rules:[{conditions:[{[p]:N,[d]:[ae,se]}],rules:[{conditions:[{[p]:"stringEquals",[d]:[{[p]:z,[d]:[Pe,"name"]},"aws-us-gov"]}],endpoint:{url:"https://oidc.{Region}.amazonaws.com",properties:n,headers:n},type:b},{endpoint:{url:"https://oidc-fips.{Region}.{PartitionResult#dnsSuffix}",properties:n,headers:n},type:b}],type:I},{error:"FIPS is enabled but this partition does not support FIPS",type:D}],type:I},{conditions:Oe,rules:[{conditions:[le],rules:[{endpoint:{url:"https://oidc.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:n,headers:n},type:b}],type:I},{error:"DualStack is enabled but this partition does not support DualStack",type:D}],type:I},{endpoint:{url:"https://oidc.{Region}.{PartitionResult#dnsSuffix}",properties:n,headers:n},type:b}],type:I}],type:I},{error:"Invalid Configuration: Missing Region",type:D}]};xe.ruleSet=Ar});var Ne=S((be)=>{Object.defineProperty(be,"__esModule",{value:!0});be.defaultEndpointResolver=void 0;var mr=zr(),m=Gr(),Hr=De(),Lr=new m.EndpointCache({size:50,params:["Endpoint","Region","UseDualStack","UseFIPS"]}),Tr=(e,r={})=>{return Lr.get(e,()=>(0,m.resolveEndpoint)(Hr.ruleSet,{endpointParams:e,logger:r.logger}))};be.defaultEndpointResolver=Tr;m.customEndpointFunctions.aws=mr.awsEndpointFunctions});var F=S((L)=>{Object.defineProperty(L,"__esModule",{value:!0});L.SSOOIDCServiceException=L.__ServiceException=void 0;var he=f();Object.defineProperty(L,"__ServiceException",{enumerable:!0,get:function(){return he.ServiceException}});class H extends he.ServiceException{constructor(e){super(e);Object.setPrototypeOf(this,H.prototype)}}L.SSOOIDCServiceException=H});var k=S((fe)=>{Object.defineProperty(fe,"__esModule",{value:!0});fe.UnsupportedGrantTypeException=fe.UnauthorizedClientException=fe.SlowDownException=fe.InvalidScopeException=fe.InvalidRequestException=fe.InvalidGrantException=fe.InvalidClientException=fe.InternalServerException=fe.ExpiredTokenException=fe.AuthorizationPendingException=fe.AccessDeniedException=void 0;var l=F();class T extends l.SSOOIDCServiceException{name="AccessDeniedException";$fault="client";error;reason;error_description;constructor(e){super({name:"AccessDeniedException",$fault:"client",...e});Object.setPrototypeOf(this,T.prototype),this.error=e.error,this.reason=e.reason,this.error_description=e.error_description}}fe.AccessDeniedException=T;class B extends l.SSOOIDCServiceException{name="AuthorizationPendingException";$fault="client";error;error_description;constructor(e){super({name:"AuthorizationPendingException",$fault:"client",...e});Object.setPrototypeOf(this,B.prototype),this.error=e.error,this.error_description=e.error_description}}fe.AuthorizationPendingException=B;class V extends l.SSOOIDCServiceException{name="ExpiredTokenException";$fault="client";error;error_description;constructor(e){super({name:"ExpiredTokenException",$fault:"client",...e});Object.setPrototypeOf(this,V.prototype),this.error=e.error,this.error_description=e.error_description}}fe.ExpiredTokenException=V;class W extends l.SSOOIDCServiceException{name="InternalServerException";$fault="server";error;error_description;constructor(e){super({name:"InternalServerException",$fault:"server",...e});Object.setPrototypeOf(this,W.prototype),this.error=e.error,this.error_description=e.error_description}}fe.InternalServerException=W;class Y extends l.SSOOIDCServiceException{name="InvalidClientException";$fault="client";error;error_description;constructor(e){super({name:"InvalidClientException",$fault:"client",...e});Object.setPrototypeOf(this,Y.prototype),this.error=e.error,this.error_description=e.error_description}}fe.InvalidClientException=Y;class J extends l.SSOOIDCServiceException{name="InvalidGrantException";$fault="client";error;error_description;constructor(e){super({name:"InvalidGrantException",$fault:"client",...e});Object.setPrototypeOf(this,J.prototype),this.error=e.error,this.error_description=e.error_description}}fe.InvalidGrantException=J;class K extends l.SSOOIDCServiceException{name="InvalidRequestException";$fault="client";error;reason;error_description;constructor(e){super({name:"InvalidRequestException",$fault:"client",...e});Object.setPrototypeOf(this,K.prototype),this.error=e.error,this.reason=e.reason,this.error_description=e.error_description}}fe.InvalidRequestException=K;class X extends l.SSOOIDCServiceException{name="InvalidScopeException";$fault="client";error;error_description;constructor(e){super({name:"InvalidScopeException",$fault:"client",...e});Object.setPrototypeOf(this,X.prototype),this.error=e.error,this.error_description=e.error_description}}fe.InvalidScopeException=X;class C extends l.SSOOIDCServiceException{name="SlowDownException";$fault="client";error;error_description;constructor(e){super({name:"SlowDownException",$fault:"client",...e});Object.setPrototypeOf(this,C.prototype),this.error=e.error,this.error_description=e.error_description}}fe.SlowDownException=C;class Q extends l.SSOOIDCServiceException{name="UnauthorizedClientException";$fault="client";error;error_description;constructor(e){super({name:"UnauthorizedClientException",$fault:"client",...e});Object.setPrototypeOf(this,Q.prototype),this.error=e.error,this.error_description=e.error_description}}fe.UnauthorizedClientException=Q;class Z extends l.SSOOIDCServiceException{name="UnsupportedGrantTypeException";$fault="client";error;error_description;constructor(e){super({name:"UnsupportedGrantTypeException",$fault:"client",...e});Object.setPrototypeOf(this,Z.prototype),this.error=e.error,this.error_description=e.error_description}}fe.UnsupportedGrantTypeException=Z});var g=S((ze)=>{Object.defineProperty(ze,"__esModule",{value:!0});ze.CreateToken$=ze.CreateTokenResponse$=ze.CreateTokenRequest$=ze.errorTypeRegistries=ze.UnsupportedGrantTypeException$=ze.UnauthorizedClientException$=ze.SlowDownException$=ze.InvalidScopeException$=ze.InvalidRequestException$=ze.InvalidGrantException$=ze.InvalidClientException$=ze.InternalServerException$=ze.ExpiredTokenException$=ze.AuthorizationPendingException$=ze.AccessDeniedException$=ze.SSOOIDCServiceException$=void 0;var kr="AccessDeniedException",gr="AuthorizationPendingException",_r="AccessToken",et="ClientSecret",rt="CreateToken",tt="CreateTokenRequest",ot="CreateTokenResponse",it="CodeVerifier",st="ExpiredTokenException",nt="InvalidClientException",pt="InvalidGrantException",dt="InvalidRequestException",ct="InternalServerException",at="InvalidScopeException",lt="IdToken",ut="RefreshToken",Ot="SlowDownException",vt="UnauthorizedClientException",Et="UnsupportedGrantTypeException",St="accessToken",E="client",It="clientId",Pt="clientSecret",xt="codeVerifier",yt="code",Dt="deviceCode",t="error",bt="expiresIn",u="error_description",qt="grantType",Nt="http",O="httpError",ht="idToken",$e="reason",je="refreshToken",Rt="redirectUri",we="smithy.ts.sdk.synthetic.com.amazonaws.ssooidc",ft="scope",Ft="server",Ut="tokenType",o="com.amazonaws.ssooidc",Me=Ue(),v=k(),$t=F(),Ae=Me.TypeRegistry.for(we);ze.SSOOIDCServiceException$=[-3,we,"SSOOIDCServiceException",0,[],[]];Ae.registerError(ze.SSOOIDCServiceException$,$t.SSOOIDCServiceException);var c=Me.TypeRegistry.for(o);ze.AccessDeniedException$=[-3,o,kr,{[t]:E,[O]:400},[t,$e,u],[0,0,0]];c.registerError(ze.AccessDeniedException$,v.AccessDeniedException);ze.AuthorizationPendingException$=[-3,o,gr,{[t]:E,[O]:400},[t,u],[0,0]];c.registerError(ze.AuthorizationPendingException$,v.AuthorizationPendingException);ze.ExpiredTokenException$=[-3,o,st,{[t]:E,[O]:400},[t,u],[0,0]];c.registerError(ze.ExpiredTokenException$,v.ExpiredTokenException);ze.InternalServerException$=[-3,o,ct,{[t]:Ft,[O]:500},[t,u],[0,0]];c.registerError(ze.InternalServerException$,v.InternalServerException);ze.InvalidClientException$=[-3,o,nt,{[t]:E,[O]:401},[t,u],[0,0]];c.registerError(ze.InvalidClientException$,v.InvalidClientException);ze.InvalidGrantException$=[-3,o,pt,{[t]:E,[O]:400},[t,u],[0,0]];c.registerError(ze.InvalidGrantException$,v.InvalidGrantException);ze.InvalidRequestException$=[-3,o,dt,{[t]:E,[O]:400},[t,$e,u],[0,0,0]];c.registerError(ze.InvalidRequestException$,v.InvalidRequestException);ze.InvalidScopeException$=[-3,o,at,{[t]:E,[O]:400},[t,u],[0,0]];c.registerError(ze.InvalidScopeException$,v.InvalidScopeException);ze.SlowDownException$=[-3,o,Ot,{[t]:E,[O]:400},[t,u],[0,0]];c.registerError(ze.SlowDownException$,v.SlowDownException);ze.UnauthorizedClientException$=[-3,o,vt,{[t]:E,[O]:400},[t,u],[0,0]];c.registerError(ze.UnauthorizedClientException$,v.UnauthorizedClientException);ze.UnsupportedGrantTypeException$=[-3,o,Et,{[t]:E,[O]:400},[t,u],[0,0]];c.registerError(ze.UnsupportedGrantTypeException$,v.UnsupportedGrantTypeException);ze.errorTypeRegistries=[Ae,c];var jt=[0,o,_r,8,0],wt=[0,o,et,8,0],Mt=[0,o,it,8,0],At=[0,o,lt,8,0],Ge=[0,o,ut,8,0];ze.CreateTokenRequest$=[3,o,tt,0,[It,Pt,qt,Dt,yt,je,ft,Rt,xt],[0,[()=>wt,0],0,0,0,[()=>Ge,0],64,0,[()=>Mt,0]],3];ze.CreateTokenResponse$=[3,o,ot,0,[St,Ut,bt,je,ht],[[()=>jt,0],0,1,[()=>Ge,0],[()=>At,0]]];ze.CreateToken$=[9,o,rt,{[Nt]:["POST","/token",200]},()=>ze.CreateTokenRequest$,()=>ze.CreateTokenResponse$]});var or=S((rr)=>{Object.defineProperty(rr,"__esModule",{value:!0});rr.getRuntimeConfig=void 0;var Tt=M(),Bt=Lt(),Vt=er(),Wt=f(),Yt=Ht(),ge=mt(),_e=zt(),Jt=A(),Kt=Ne(),Xt=g(),Ct=(e)=>{return{apiVersion:"2019-06-10",base64Decoder:e?.base64Decoder??ge.fromBase64,base64Encoder:e?.base64Encoder??ge.toBase64,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??Kt.defaultEndpointResolver,extensions:e?.extensions??[],httpAuthSchemeProvider:e?.httpAuthSchemeProvider??Jt.defaultSSOOIDCHttpAuthSchemeProvider,httpAuthSchemes:e?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:(r)=>r.getIdentityProvider("aws.auth#sigv4"),signer:new Tt.AwsSdkSigV4Signer},{schemeId:"smithy.api#noAuth",identityProvider:(r)=>r.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new Vt.NoAuthSigner}],logger:e?.logger??new Wt.NoOpLogger,protocol:e?.protocol??Bt.AwsRestJsonProtocol,protocolSettings:e?.protocolSettings??{defaultNamespace:"com.amazonaws.ssooidc",errorTypeRegistries:Xt.errorTypeRegistries,version:"2019-06-10",serviceTarget:"AWSSSOOIDCService"},serviceId:e?.serviceId??"SSO OIDC",urlParser:e?.urlParser??Yt.parseUrl,utf8Decoder:e?.utf8Decoder??_e.fromUtf8,utf8Encoder:e?.utf8Encoder??_e.toUtf8}};rr.getRuntimeConfig=Ct});var Or=S((lr)=>{Object.defineProperty(lr,"__esModule",{value:!0});lr.getRuntimeConfig=void 0;var io=Zt(),so=io.__importDefault(_t()),ir=M(),sr=eo(),U=cr(),no=ro(),nr=ar(),x=gt(),pr=Qt(),dr=f(),po=to(),co=oo(),ao=kt(),lo=or(),uo=(e)=>{(0,dr.emitWarningIfUnsupportedVersion)(process.version);let r=(0,co.resolveDefaultsModeConfig)(e),i=()=>r().then(dr.loadConfigsForDefaultMode),a=(0,lo.getRuntimeConfig)(e);(0,ir.emitWarningIfUnsupportedVersion)(process.version);let s={profile:e?.profile,logger:a.logger};return{...a,...e,runtime:"node",defaultsMode:r,authSchemePreference:e?.authSchemePreference??(0,x.loadConfig)(ir.NODE_AUTH_SCHEME_PREFERENCE_OPTIONS,s),bodyLengthChecker:e?.bodyLengthChecker??po.calculateBodyLength,defaultUserAgentProvider:e?.defaultUserAgentProvider??(0,sr.createDefaultUserAgentProvider)({serviceId:a.serviceId,clientVersion:so.default.version}),maxAttempts:e?.maxAttempts??(0,x.loadConfig)(nr.NODE_MAX_ATTEMPT_CONFIG_OPTIONS,e),region:e?.region??(0,x.loadConfig)(U.NODE_REGION_CONFIG_OPTIONS,{...U.NODE_REGION_CONFIG_FILE_OPTIONS,...s}),requestHandler:pr.NodeHttpHandler.create(e?.requestHandler??i),retryMode:e?.retryMode??(0,x.loadConfig)({...nr.NODE_RETRY_MODE_CONFIG_OPTIONS,default:async()=>(await i()).retryMode||ao.DEFAULT_RETRY_MODE},e),sha256:e?.sha256??no.Hash.bind(null,"sha256"),streamCollector:e?.streamCollector??pr.streamCollector,useDualstackEndpoint:e?.useDualstackEndpoint??(0,x.loadConfig)(U.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS,s),useFipsEndpoint:e?.useFipsEndpoint??(0,x.loadConfig)(U.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS,s),userAgentAppId:e?.userAgentAppId??(0,x.loadConfig)(sr.NODE_APP_ID_CONFIG_OPTIONS,s)}};lr.getRuntimeConfig=uo});var Yo=S((P)=>{var vr=vo(),Do=Eo(),bo=So(),Er=Io(),qo=cr(),_=er(),No=Ue(),ho=Po(),yr=xo(),Sr=ar(),y=f(),Ir=A(),Ro=Or(),Pr=yo(),xr=Oo(),h=g(),$=k(),fo=F(),Fo=(e)=>{return Object.assign(e,{useDualstackEndpoint:e.useDualstackEndpoint??!1,useFipsEndpoint:e.useFipsEndpoint??!1,defaultSigningName:"sso-oauth"})},Uo={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}},$o=(e)=>{let{httpAuthSchemes:r,httpAuthSchemeProvider:i,credentials:a}=e;return{setHttpAuthScheme(s){let R=r.findIndex((j)=>j.schemeId===s.schemeId);if(R===-1)r.push(s);else r.splice(R,1,s)},httpAuthSchemes(){return r},setHttpAuthSchemeProvider(s){i=s},httpAuthSchemeProvider(){return i},setCredentials(s){a=s},credentials(){return a}}},jo=(e)=>{return{httpAuthSchemes:e.httpAuthSchemes(),httpAuthSchemeProvider:e.httpAuthSchemeProvider(),credentials:e.credentials()}},wo=(e,r)=>{let i=Object.assign(Pr.getAwsRegionExtensionConfiguration(e),y.getDefaultExtensionConfiguration(e),xr.getHttpHandlerExtensionConfiguration(e),$o(e));return r.forEach((a)=>a.configure(i)),Object.assign(e,Pr.resolveAwsRegionExtensionConfiguration(i),y.resolveDefaultRuntimeConfig(i),xr.resolveHttpHandlerRuntimeConfig(i),jo(i))};class ee extends y.Client{config;constructor(...[e]){let r=Ro.getRuntimeConfig(e||{});super(r);this.initConfig=r;let i=Fo(r),a=Er.resolveUserAgentConfig(i),s=Sr.resolveRetryConfig(a),R=qo.resolveRegionConfig(s),j=vr.resolveHostHeaderConfig(R),Dr=yr.resolveEndpointConfig(j),br=Ir.resolveHttpAuthSchemeConfig(Dr),qr=wo(br,e?.extensions||[]);this.config=qr,this.middlewareStack.use(No.getSchemaSerdePlugin(this.config)),this.middlewareStack.use(Er.getUserAgentPlugin(this.config)),this.middlewareStack.use(Sr.getRetryPlugin(this.config)),this.middlewareStack.use(ho.getContentLengthPlugin(this.config)),this.middlewareStack.use(vr.getHostHeaderPlugin(this.config)),this.middlewareStack.use(Do.getLoggerPlugin(this.config)),this.middlewareStack.use(bo.getRecursionDetectionPlugin(this.config)),this.middlewareStack.use(_.getHttpAuthSchemeEndpointRuleSetPlugin(this.config,{httpAuthSchemeParametersProvider:Ir.defaultSSOOIDCHttpAuthSchemeParametersProvider,identityProviderConfigProvider:async(Nr)=>new _.DefaultIdentityProviderConfig({"aws.auth#sigv4":Nr.credentials})})),this.middlewareStack.use(_.getHttpSigningPlugin(this.config))}destroy(){super.destroy()}}class re extends y.Command.classBuilder().ep(Uo).m(function(e,r,i,a){return[yr.getEndpointPlugin(i,e.getEndpointParameterInstructions())]}).s("AWSSSOOIDCService","CreateToken",{}).n("SSOOIDCClient","CreateTokenCommand").sc(h.CreateToken$).build(){}var Mo={CreateTokenCommand:re};class te extends ee{}y.createAggregatedClient(Mo,te);var Ao={KMS_ACCESS_DENIED:"KMS_AccessDeniedException"},Go={KMS_DISABLED_KEY:"KMS_DisabledException",KMS_INVALID_KEY_USAGE:"KMS_InvalidKeyUsageException",KMS_INVALID_STATE:"KMS_InvalidStateException",KMS_KEY_NOT_FOUND:"KMS_NotFoundException"};P.$Command=y.Command;P.__Client=y.Client;P.SSOOIDCServiceException=fo.SSOOIDCServiceException;P.AccessDeniedExceptionReason=Ao;P.CreateTokenCommand=re;P.InvalidRequestExceptionReason=Go;P.SSOOIDC=te;P.SSOOIDCClient=ee;Object.prototype.hasOwnProperty.call(h,"__proto__")&&!Object.prototype.hasOwnProperty.call(P,"__proto__")&&Object.defineProperty(P,"__proto__",{enumerable:!0,value:h.__proto__});Object.keys(h).forEach(function(e){if(e!=="default"&&!Object.prototype.hasOwnProperty.call(P,e))P[e]=h[e]});Object.prototype.hasOwnProperty.call($,"__proto__")&&!Object.prototype.hasOwnProperty.call(P,"__proto__")&&Object.defineProperty(P,"__proto__",{enumerable:!0,value:$.__proto__});Object.keys($).forEach(function(e){if(e!=="default"&&!Object.prototype.hasOwnProperty.call(P,e))P[e]=$[e]})});export default Yo();
|
|
3
3
|
|
|
4
|
-
//# debugId=
|
|
4
|
+
//# debugId=CED996C2CA679EF964756E2164756E21
|